summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:16:24 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:16:24 +0000
commit9221dca64f0c8b5de72727491e41cf63e902eaab (patch)
treed8cbbf520eb4b5c656a54b2e36947008dcb751ad /lib
parentInitial commit. (diff)
downloadman-db-upstream.tar.xz
man-db-upstream.zip
Adding upstream version 2.8.5.upstream/2.8.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.am74
-rw-r--r--lib/Makefile.in2011
-rw-r--r--lib/README22
-rw-r--r--lib/appendstr.c55
-rw-r--r--lib/cleanup.c266
-rw-r--r--lib/cleanup.h33
-rw-r--r--lib/debug.c71
-rw-r--r--lib/decompress.c159
-rw-r--r--lib/decompress.h40
-rw-r--r--lib/encodings.c915
-rw-r--r--lib/encodings.h37
-rw-r--r--lib/hashtable.c232
-rw-r--r--lib/hashtable.h61
-rw-r--r--lib/linelength.c108
-rw-r--r--lib/linelength.h23
-rw-r--r--lib/lower.c47
-rw-r--r--lib/lower.h24
-rw-r--r--lib/orderfiles.c164
-rw-r--r--lib/orderfiles.h23
-rw-r--r--lib/pathsearch.c130
-rw-r--r--lib/pathsearch.h34
-rw-r--r--lib/sandbox.c636
-rw-r--r--lib/sandbox.h38
-rw-r--r--lib/security.c177
-rw-r--r--lib/security.h35
-rw-r--r--lib/tempfile.c79
-rw-r--r--lib/util.c267
-rw-r--r--lib/wordfnmatch.c64
-rw-r--r--lib/wordfnmatch.h23
-rw-r--r--lib/xchown.c49
-rw-r--r--lib/xchown.h29
-rw-r--r--lib/xregcomp.c49
-rw-r--r--lib/xregcomp.h25
33 files changed, 6000 insertions, 0 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
new file mode 100644
index 0000000..ba5684f
--- /dev/null
+++ b/lib/Makefile.am
@@ -0,0 +1,74 @@
+## Process this file with automake to produce Makefile.in
+##
+## Copyright (C) 1994, 1995 Graeme Wilford.
+## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Colin Watson.
+##
+## This file is part of man-db.
+##
+## man-db is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## man-db is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with man-db; if not, write to the Free Software Foundation,
+## Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+pkglib_LTLIBRARIES = libman.la
+dist_noinst_DATA = README
+
+AM_CFLAGS = $(WARN_CFLAGS)
+
+libman_la_CPPFLAGS = \
+ -I$(top_builddir)/include \
+ -I$(top_srcdir)/gl/lib \
+ -I$(top_builddir)/gl/lib \
+ -DLOCALEDIR=\"$(localedir)\" \
+ $(libpipeline_CFLAGS) \
+ $(libseccomp_CFLAGS)
+
+libman_la_SOURCES = \
+ appendstr.c \
+ cleanup.c \
+ cleanup.h \
+ debug.c \
+ decompress.c \
+ decompress.h \
+ encodings.c \
+ encodings.h \
+ hashtable.c \
+ hashtable.h \
+ linelength.c \
+ linelength.h \
+ lower.c \
+ lower.h \
+ orderfiles.c \
+ orderfiles.h \
+ pathsearch.c \
+ pathsearch.h \
+ sandbox.c \
+ sandbox.h \
+ security.c \
+ security.h \
+ tempfile.c \
+ util.c \
+ wordfnmatch.c \
+ wordfnmatch.h \
+ xchown.c \
+ xchown.h \
+ xregcomp.c \
+ xregcomp.h
+
+libman_la_LIBADD = ../gl/lib/libgnu.la $(LTLIBOBJS) \
+ $(LIBCOMPRESS) @LTLIBINTL@
+
+libman_la_LDFLAGS = \
+ -avoid-version -release $(VERSION) -rpath $(pkglibdir) \
+ -no-undefined \
+ $(libpipeline_LIBS) \
+ $(libseccomp_LIBS)
diff --git a/lib/Makefile.in b/lib/Makefile.in
new file mode 100644
index 0000000..0187440
--- /dev/null
+++ b/lib/Makefile.in
@@ -0,0 +1,2011 @@
+# Makefile.in generated by automake 1.16.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2018 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@
+
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = lib
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/man-arg-automatic-create.m4 \
+ $(top_srcdir)/m4/man-arg-automatic-update.m4 \
+ $(top_srcdir)/m4/man-arg-cache-owner.m4 \
+ $(top_srcdir)/m4/man-arg-cats.m4 \
+ $(top_srcdir)/m4/man-arg-config-file.m4 \
+ $(top_srcdir)/m4/man-arg-db.m4 \
+ $(top_srcdir)/m4/man-arg-device.m4 \
+ $(top_srcdir)/m4/man-arg-mandirs.m4 \
+ $(top_srcdir)/m4/man-arg-override-dir.m4 \
+ $(top_srcdir)/m4/man-arg-sections.m4 \
+ $(top_srcdir)/m4/man-arg-setuid.m4 \
+ $(top_srcdir)/m4/man-arg-systemdsystemunitdir.m4 \
+ $(top_srcdir)/m4/man-arg-systemdtmpfilesdir.m4 \
+ $(top_srcdir)/m4/man-arg-undoc.m4 $(top_srcdir)/m4/man-bdb.m4 \
+ $(top_srcdir)/m4/man-check-progs.m4 \
+ $(top_srcdir)/m4/man-compress-lib.m4 \
+ $(top_srcdir)/m4/man-gnu-nroff.m4 \
+ $(top_srcdir)/m4/man-heirloom-nroff.m4 \
+ $(top_srcdir)/m4/man-libseccomp.m4 \
+ $(top_srcdir)/m4/man-linguas.m4 $(top_srcdir)/m4/man-po4a.m4 \
+ $(top_srcdir)/m4/man-tar-sort-name.m4 \
+ $(top_srcdir)/m4/man-trans-subst.m4 \
+ $(top_srcdir)/gl/m4/00gnulib.m4 \
+ $(top_srcdir)/gl/m4/__inline.m4 \
+ $(top_srcdir)/gl/m4/absolute-header.m4 \
+ $(top_srcdir)/gl/m4/alloca.m4 $(top_srcdir)/gl/m4/argp.m4 \
+ $(top_srcdir)/gl/m4/asm-underscore.m4 \
+ $(top_srcdir)/gl/m4/btowc.m4 \
+ $(top_srcdir)/gl/m4/builtin-expect.m4 \
+ $(top_srcdir)/gl/m4/canonicalize.m4 \
+ $(top_srcdir)/gl/m4/chdir-long.m4 \
+ $(top_srcdir)/gl/m4/clock_time.m4 $(top_srcdir)/gl/m4/close.m4 \
+ $(top_srcdir)/gl/m4/closedir.m4 $(top_srcdir)/gl/m4/codeset.m4 \
+ $(top_srcdir)/gl/m4/d-ino.m4 $(top_srcdir)/gl/m4/d-type.m4 \
+ $(top_srcdir)/gl/m4/dirent_h.m4 $(top_srcdir)/gl/m4/dirfd.m4 \
+ $(top_srcdir)/gl/m4/dirname.m4 \
+ $(top_srcdir)/gl/m4/double-slash-root.m4 \
+ $(top_srcdir)/gl/m4/dup.m4 $(top_srcdir)/gl/m4/dup2.m4 \
+ $(top_srcdir)/gl/m4/eealloc.m4 $(top_srcdir)/gl/m4/environ.m4 \
+ $(top_srcdir)/gl/m4/errno_h.m4 $(top_srcdir)/gl/m4/error.m4 \
+ $(top_srcdir)/gl/m4/exponentd.m4 \
+ $(top_srcdir)/gl/m4/extensions.m4 \
+ $(top_srcdir)/gl/m4/extern-inline.m4 \
+ $(top_srcdir)/gl/m4/fchdir.m4 $(top_srcdir)/gl/m4/fcntl-o.m4 \
+ $(top_srcdir)/gl/m4/fcntl.m4 $(top_srcdir)/gl/m4/fcntl_h.m4 \
+ $(top_srcdir)/gl/m4/fdopendir.m4 \
+ $(top_srcdir)/gl/m4/filenamecat.m4 \
+ $(top_srcdir)/gl/m4/flexmember.m4 \
+ $(top_srcdir)/gl/m4/float_h.m4 $(top_srcdir)/gl/m4/flock.m4 \
+ $(top_srcdir)/gl/m4/fnmatch.m4 \
+ $(top_srcdir)/gl/m4/fnmatch_h.m4 $(top_srcdir)/gl/m4/fstat.m4 \
+ $(top_srcdir)/gl/m4/fstatat.m4 $(top_srcdir)/gl/m4/futimens.m4 \
+ $(top_srcdir)/gl/m4/getcwd-abort-bug.m4 \
+ $(top_srcdir)/gl/m4/getcwd-path-max.m4 \
+ $(top_srcdir)/gl/m4/getcwd.m4 $(top_srcdir)/gl/m4/getdelim.m4 \
+ $(top_srcdir)/gl/m4/getdtablesize.m4 \
+ $(top_srcdir)/gl/m4/getline.m4 $(top_srcdir)/gl/m4/getlogin.m4 \
+ $(top_srcdir)/gl/m4/getlogin_r.m4 \
+ $(top_srcdir)/gl/m4/getopt.m4 \
+ $(top_srcdir)/gl/m4/getpagesize.m4 \
+ $(top_srcdir)/gl/m4/getprogname.m4 \
+ $(top_srcdir)/gl/m4/gettext.m4 $(top_srcdir)/gl/m4/gettime.m4 \
+ $(top_srcdir)/gl/m4/gettimeofday.m4 \
+ $(top_srcdir)/gl/m4/glibc21.m4 $(top_srcdir)/gl/m4/glob.m4 \
+ $(top_srcdir)/gl/m4/glob_h.m4 \
+ $(top_srcdir)/gl/m4/gnulib-common.m4 \
+ $(top_srcdir)/gl/m4/gnulib-comp.m4 \
+ $(top_srcdir)/gl/m4/host-cpu-c-abi.m4 \
+ $(top_srcdir)/gl/m4/iconv.m4 $(top_srcdir)/gl/m4/idpriv.m4 \
+ $(top_srcdir)/gl/m4/include_next.m4 \
+ $(top_srcdir)/gl/m4/intlmacosx.m4 \
+ $(top_srcdir)/gl/m4/intmax_t.m4 \
+ $(top_srcdir)/gl/m4/inttypes_h.m4 $(top_srcdir)/gl/m4/ioctl.m4 \
+ $(top_srcdir)/gl/m4/langinfo_h.m4 \
+ $(top_srcdir)/gl/m4/largefile.m4 \
+ $(top_srcdir)/gl/m4/lib-ignore.m4 \
+ $(top_srcdir)/gl/m4/lib-ld.m4 $(top_srcdir)/gl/m4/lib-link.m4 \
+ $(top_srcdir)/gl/m4/lib-prefix.m4 \
+ $(top_srcdir)/gl/m4/libtool.m4 $(top_srcdir)/gl/m4/limits-h.m4 \
+ $(top_srcdir)/gl/m4/localcharset.m4 \
+ $(top_srcdir)/gl/m4/locale-fr.m4 \
+ $(top_srcdir)/gl/m4/locale-ja.m4 \
+ $(top_srcdir)/gl/m4/locale-zh.m4 \
+ $(top_srcdir)/gl/m4/locale_h.m4 \
+ $(top_srcdir)/gl/m4/localeconv.m4 \
+ $(top_srcdir)/gl/m4/localtime-buffer.m4 \
+ $(top_srcdir)/gl/m4/lock.m4 $(top_srcdir)/gl/m4/longlong.m4 \
+ $(top_srcdir)/gl/m4/lstat.m4 $(top_srcdir)/gl/m4/ltoptions.m4 \
+ $(top_srcdir)/gl/m4/ltsugar.m4 \
+ $(top_srcdir)/gl/m4/ltversion.m4 \
+ $(top_srcdir)/gl/m4/lt~obsolete.m4 \
+ $(top_srcdir)/gl/m4/malloc.m4 $(top_srcdir)/gl/m4/malloca.m4 \
+ $(top_srcdir)/gl/m4/mbrtowc.m4 $(top_srcdir)/gl/m4/mbsinit.m4 \
+ $(top_srcdir)/gl/m4/mbsrtowcs.m4 \
+ $(top_srcdir)/gl/m4/mbstate_t.m4 $(top_srcdir)/gl/m4/mbtowc.m4 \
+ $(top_srcdir)/gl/m4/memchr.m4 $(top_srcdir)/gl/m4/memmem.m4 \
+ $(top_srcdir)/gl/m4/mempcpy.m4 $(top_srcdir)/gl/m4/memrchr.m4 \
+ $(top_srcdir)/gl/m4/minmax.m4 $(top_srcdir)/gl/m4/mkdir.m4 \
+ $(top_srcdir)/gl/m4/mkdtemp.m4 $(top_srcdir)/gl/m4/mkstemp.m4 \
+ $(top_srcdir)/gl/m4/mmap-anon.m4 $(top_srcdir)/gl/m4/mode_t.m4 \
+ $(top_srcdir)/gl/m4/msvc-inval.m4 \
+ $(top_srcdir)/gl/m4/msvc-nothrow.m4 \
+ $(top_srcdir)/gl/m4/multiarch.m4 \
+ $(top_srcdir)/gl/m4/nanosleep.m4 \
+ $(top_srcdir)/gl/m4/nl_langinfo.m4 $(top_srcdir)/gl/m4/nls.m4 \
+ $(top_srcdir)/gl/m4/nocrash.m4 \
+ $(top_srcdir)/gl/m4/nonblocking.m4 \
+ $(top_srcdir)/gl/m4/off_t.m4 \
+ $(top_srcdir)/gl/m4/open-cloexec.m4 \
+ $(top_srcdir)/gl/m4/open.m4 $(top_srcdir)/gl/m4/openat.m4 \
+ $(top_srcdir)/gl/m4/opendir.m4 $(top_srcdir)/gl/m4/pathmax.m4 \
+ $(top_srcdir)/gl/m4/po.m4 $(top_srcdir)/gl/m4/printf.m4 \
+ $(top_srcdir)/gl/m4/progtest.m4 \
+ $(top_srcdir)/gl/m4/pthread_rwlock_rdlock.m4 \
+ $(top_srcdir)/gl/m4/raise.m4 $(top_srcdir)/gl/m4/rawmemchr.m4 \
+ $(top_srcdir)/gl/m4/readdir.m4 $(top_srcdir)/gl/m4/readlink.m4 \
+ $(top_srcdir)/gl/m4/realloc.m4 $(top_srcdir)/gl/m4/regex.m4 \
+ $(top_srcdir)/gl/m4/rename.m4 $(top_srcdir)/gl/m4/rewinddir.m4 \
+ $(top_srcdir)/gl/m4/rmdir.m4 $(top_srcdir)/gl/m4/same.m4 \
+ $(top_srcdir)/gl/m4/save-cwd.m4 $(top_srcdir)/gl/m4/select.m4 \
+ $(top_srcdir)/gl/m4/setenv.m4 $(top_srcdir)/gl/m4/sigaction.m4 \
+ $(top_srcdir)/gl/m4/signal_h.m4 \
+ $(top_srcdir)/gl/m4/signalblocking.m4 \
+ $(top_srcdir)/gl/m4/size_max.m4 $(top_srcdir)/gl/m4/sleep.m4 \
+ $(top_srcdir)/gl/m4/socketlib.m4 \
+ $(top_srcdir)/gl/m4/sockets.m4 $(top_srcdir)/gl/m4/socklen.m4 \
+ $(top_srcdir)/gl/m4/ssize_t.m4 \
+ $(top_srcdir)/gl/m4/stat-time.m4 $(top_srcdir)/gl/m4/stat.m4 \
+ $(top_srcdir)/gl/m4/std-gnu11.m4 \
+ $(top_srcdir)/gl/m4/stdalign.m4 $(top_srcdir)/gl/m4/stdarg.m4 \
+ $(top_srcdir)/gl/m4/stdbool.m4 $(top_srcdir)/gl/m4/stddef_h.m4 \
+ $(top_srcdir)/gl/m4/stdint.m4 $(top_srcdir)/gl/m4/stdint_h.m4 \
+ $(top_srcdir)/gl/m4/stdio_h.m4 $(top_srcdir)/gl/m4/stdlib_h.m4 \
+ $(top_srcdir)/gl/m4/strcase.m4 \
+ $(top_srcdir)/gl/m4/strcasestr.m4 \
+ $(top_srcdir)/gl/m4/strchrnul.m4 $(top_srcdir)/gl/m4/strdup.m4 \
+ $(top_srcdir)/gl/m4/strerror.m4 \
+ $(top_srcdir)/gl/m4/string_h.m4 \
+ $(top_srcdir)/gl/m4/strings_h.m4 \
+ $(top_srcdir)/gl/m4/strndup.m4 $(top_srcdir)/gl/m4/strnlen.m4 \
+ $(top_srcdir)/gl/m4/strsep.m4 \
+ $(top_srcdir)/gl/m4/sys_file_h.m4 \
+ $(top_srcdir)/gl/m4/sys_ioctl_h.m4 \
+ $(top_srcdir)/gl/m4/sys_select_h.m4 \
+ $(top_srcdir)/gl/m4/sys_socket_h.m4 \
+ $(top_srcdir)/gl/m4/sys_stat_h.m4 \
+ $(top_srcdir)/gl/m4/sys_time_h.m4 \
+ $(top_srcdir)/gl/m4/sys_types_h.m4 \
+ $(top_srcdir)/gl/m4/sys_uio_h.m4 \
+ $(top_srcdir)/gl/m4/sysexits.m4 \
+ $(top_srcdir)/gl/m4/tempname.m4 \
+ $(top_srcdir)/gl/m4/threadlib.m4 $(top_srcdir)/gl/m4/time_h.m4 \
+ $(top_srcdir)/gl/m4/timespec.m4 \
+ $(top_srcdir)/gl/m4/unistd-safer.m4 \
+ $(top_srcdir)/gl/m4/unistd_h.m4 $(top_srcdir)/gl/m4/utime.m4 \
+ $(top_srcdir)/gl/m4/utime_h.m4 $(top_srcdir)/gl/m4/utimens.m4 \
+ $(top_srcdir)/gl/m4/utimes.m4 \
+ $(top_srcdir)/gl/m4/vasnprintf.m4 \
+ $(top_srcdir)/gl/m4/vasprintf.m4 \
+ $(top_srcdir)/gl/m4/vsnprintf.m4 \
+ $(top_srcdir)/gl/m4/warn-on-use.m4 \
+ $(top_srcdir)/gl/m4/warnings.m4 $(top_srcdir)/gl/m4/wchar_h.m4 \
+ $(top_srcdir)/gl/m4/wchar_t.m4 $(top_srcdir)/gl/m4/wcrtomb.m4 \
+ $(top_srcdir)/gl/m4/wctype_h.m4 $(top_srcdir)/gl/m4/wint_t.m4 \
+ $(top_srcdir)/gl/m4/xalloc.m4 $(top_srcdir)/gl/m4/xgetcwd.m4 \
+ $(top_srcdir)/gl/m4/xsize.m4 $(top_srcdir)/gl/m4/xstrndup.m4 \
+ $(top_srcdir)/gl/m4/xvasprintf.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(dist_noinst_DATA) \
+ $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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__installdirs = "$(DESTDIR)$(pkglibdir)"
+LTLIBRARIES = $(pkglib_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+libman_la_DEPENDENCIES = ../gl/lib/libgnu.la $(LTLIBOBJS) \
+ $(am__DEPENDENCIES_1)
+am_libman_la_OBJECTS = libman_la-appendstr.lo libman_la-cleanup.lo \
+ libman_la-debug.lo libman_la-decompress.lo \
+ libman_la-encodings.lo libman_la-hashtable.lo \
+ libman_la-linelength.lo libman_la-lower.lo \
+ libman_la-orderfiles.lo libman_la-pathsearch.lo \
+ libman_la-sandbox.lo libman_la-security.lo \
+ libman_la-tempfile.lo libman_la-util.lo \
+ libman_la-wordfnmatch.lo libman_la-xchown.lo \
+ libman_la-xregcomp.lo
+libman_la_OBJECTS = $(am_libman_la_OBJECTS)
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+libman_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(libman_la_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/libman_la-appendstr.Plo \
+ ./$(DEPDIR)/libman_la-cleanup.Plo \
+ ./$(DEPDIR)/libman_la-debug.Plo \
+ ./$(DEPDIR)/libman_la-decompress.Plo \
+ ./$(DEPDIR)/libman_la-encodings.Plo \
+ ./$(DEPDIR)/libman_la-hashtable.Plo \
+ ./$(DEPDIR)/libman_la-linelength.Plo \
+ ./$(DEPDIR)/libman_la-lower.Plo \
+ ./$(DEPDIR)/libman_la-orderfiles.Plo \
+ ./$(DEPDIR)/libman_la-pathsearch.Plo \
+ ./$(DEPDIR)/libman_la-sandbox.Plo \
+ ./$(DEPDIR)/libman_la-security.Plo \
+ ./$(DEPDIR)/libman_la-tempfile.Plo \
+ ./$(DEPDIR)/libman_la-util.Plo \
+ ./$(DEPDIR)/libman_la-wordfnmatch.Plo \
+ ./$(DEPDIR)/libman_la-xchown.Plo \
+ ./$(DEPDIR)/libman_la-xregcomp.Plo
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
+CCLD = $(CC)
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
+SOURCES = $(libman_la_SOURCES)
+DIST_SOURCES = $(libman_la_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+DATA = $(dist_noinst_DATA)
+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 README
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+APPLE_UNIVERSAL_BUILD = @APPLE_UNIVERSAL_BUILD@
+AR = @AR@
+ARFLAGS = @ARFLAGS@
+ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BITSIZEOF_PTRDIFF_T = @BITSIZEOF_PTRDIFF_T@
+BITSIZEOF_SIG_ATOMIC_T = @BITSIZEOF_SIG_ATOMIC_T@
+BITSIZEOF_SIZE_T = @BITSIZEOF_SIZE_T@
+BITSIZEOF_WCHAR_T = @BITSIZEOF_WCHAR_T@
+BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DBLIBS = @DBLIBS@
+DBTYPE = @DBTYPE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EMULTIHOP_HIDDEN = @EMULTIHOP_HIDDEN@
+EMULTIHOP_VALUE = @EMULTIHOP_VALUE@
+ENOLINK_HIDDEN = @ENOLINK_HIDDEN@
+ENOLINK_VALUE = @ENOLINK_VALUE@
+EOVERFLOW_HIDDEN = @EOVERFLOW_HIDDEN@
+EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
+ERRNO_H = @ERRNO_H@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FLOAT_H = @FLOAT_H@
+FNMATCH_H = @FNMATCH_H@
+GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
+GETOPT_H = @GETOPT_H@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GLIBC21 = @GLIBC21@
+GLOB_H = @GLOB_H@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIB_ACCEPT = @GNULIB_ACCEPT@
+GNULIB_ACCEPT4 = @GNULIB_ACCEPT4@
+GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
+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_CLOSEDIR = @GNULIB_CLOSEDIR@
+GNULIB_CONNECT = @GNULIB_CONNECT@
+GNULIB_CTIME = @GNULIB_CTIME@
+GNULIB_DIRFD = @GNULIB_DIRFD@
+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_EXPLICIT_BZERO = @GNULIB_EXPLICIT_BZERO@
+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_FDOPENDIR = @GNULIB_FDOPENDIR@
+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_FLOCK = @GNULIB_FLOCK@
+GNULIB_FNMATCH = @GNULIB_FNMATCH@
+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_GETPASS = @GNULIB_GETPASS@
+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_GLOB = @GNULIB_GLOB@
+GNULIB_GL_UNISTD_H_GETOPT = @GNULIB_GL_UNISTD_H_GETOPT@
+GNULIB_GRANTPT = @GNULIB_GRANTPT@
+GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
+GNULIB_IOCTL = @GNULIB_IOCTL@
+GNULIB_ISATTY = @GNULIB_ISATTY@
+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_LOCALENAME = @GNULIB_LOCALENAME@
+GNULIB_LOCALTIME = @GNULIB_LOCALTIME@
+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_OPENDIR = @GNULIB_OPENDIR@
+GNULIB_OVERRIDES_STRUCT_STAT = @GNULIB_OVERRIDES_STRUCT_STAT@
+GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@
+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_READDIR = @GNULIB_READDIR@
+GNULIB_READLINK = @GNULIB_READLINK@
+GNULIB_READLINKAT = @GNULIB_READLINKAT@
+GNULIB_REALLOCARRAY = @GNULIB_REALLOCARRAY@
+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_REWINDDIR = @GNULIB_REWINDDIR@
+GNULIB_RMDIR = @GNULIB_RMDIR@
+GNULIB_RPMATCH = @GNULIB_RPMATCH@
+GNULIB_SCANDIR = @GNULIB_SCANDIR@
+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_STRFTIME = @GNULIB_STRFTIME@
+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_STRTOK_R = @GNULIB_STRTOK_R@
+GNULIB_STRTOLL = @GNULIB_STRTOLL@
+GNULIB_STRTOULL = @GNULIB_STRTOULL@
+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_TRUNCATE = @GNULIB_TRUNCATE@
+GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
+GNULIB_TZSET = @GNULIB_TZSET@
+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_UTIME = @GNULIB_UTIME@
+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_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_WCSFTIME = @GNULIB_WCSFTIME@
+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_ALPHASORT = @HAVE_ALPHASORT@
+HAVE_ATOLL = @HAVE_ATOLL@
+HAVE_BTOWC = @HAVE_BTOWC@
+HAVE_C99_STDINT_H = @HAVE_C99_STDINT_H@
+HAVE_CANONICALIZE_FILE_NAME = @HAVE_CANONICALIZE_FILE_NAME@
+HAVE_CHOWN = @HAVE_CHOWN@
+HAVE_CLOSEDIR = @HAVE_CLOSEDIR@
+HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@
+HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@
+HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
+HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@
+HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
+HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
+HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
+HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
+HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
+HAVE_DECL_GETLOADAVG = @HAVE_DECL_GETLOADAVG@
+HAVE_DECL_GETLOGIN = @HAVE_DECL_GETLOGIN@
+HAVE_DECL_GETLOGIN_R = @HAVE_DECL_GETLOGIN_R@
+HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
+HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
+HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
+HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_OBSTACK_PRINTF = @HAVE_DECL_OBSTACK_PRINTF@
+HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
+HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
+HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
+HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRERROR_R = @HAVE_DECL_STRERROR_R@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRSIGNAL = @HAVE_DECL_STRSIGNAL@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
+HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
+HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
+HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
+HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
+HAVE_DIRENT_H = @HAVE_DIRENT_H@
+HAVE_DPRINTF = @HAVE_DPRINTF@
+HAVE_DUP2 = @HAVE_DUP2@
+HAVE_DUP3 = @HAVE_DUP3@
+HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
+HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
+HAVE_FACCESSAT = @HAVE_FACCESSAT@
+HAVE_FCHDIR = @HAVE_FCHDIR@
+HAVE_FCHMODAT = @HAVE_FCHMODAT@
+HAVE_FCHOWNAT = @HAVE_FCHOWNAT@
+HAVE_FCNTL = @HAVE_FCNTL@
+HAVE_FDATASYNC = @HAVE_FDATASYNC@
+HAVE_FDOPENDIR = @HAVE_FDOPENDIR@
+HAVE_FEATURES_H = @HAVE_FEATURES_H@
+HAVE_FFS = @HAVE_FFS@
+HAVE_FFSL = @HAVE_FFSL@
+HAVE_FFSLL = @HAVE_FFSLL@
+HAVE_FLOCK = @HAVE_FLOCK@
+HAVE_FNMATCH = @HAVE_FNMATCH@
+HAVE_FNMATCH_H = @HAVE_FNMATCH_H@
+HAVE_FREELOCALE = @HAVE_FREELOCALE@
+HAVE_FSEEKO = @HAVE_FSEEKO@
+HAVE_FSTATAT = @HAVE_FSTATAT@
+HAVE_FSYNC = @HAVE_FSYNC@
+HAVE_FTELLO = @HAVE_FTELLO@
+HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
+HAVE_FUTIMENS = @HAVE_FUTIMENS@
+HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETGROUPS = @HAVE_GETGROUPS@
+HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
+HAVE_GETLOGIN = @HAVE_GETLOGIN@
+HAVE_GETOPT_H = @HAVE_GETOPT_H@
+HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
+HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
+HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GLOB = @HAVE_GLOB@
+HAVE_GLOB_H = @HAVE_GLOB_H@
+HAVE_GLOB_PATTERN_P = @HAVE_GLOB_PATTERN_P@
+HAVE_GRANTPT = @HAVE_GRANTPT@
+HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
+HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
+HAVE_ISWBLANK = @HAVE_ISWBLANK@
+HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@
+HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
+HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
+HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
+HAVE_LANGINFO_T_FMT_AMPM = @HAVE_LANGINFO_T_FMT_AMPM@
+HAVE_LANGINFO_YESEXPR = @HAVE_LANGINFO_YESEXPR@
+HAVE_LCHMOD = @HAVE_LCHMOD@
+HAVE_LCHOWN = @HAVE_LCHOWN@
+HAVE_LINK = @HAVE_LINK@
+HAVE_LINKAT = @HAVE_LINKAT@
+HAVE_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_NEWLOCALE = @HAVE_NEWLOCALE@
+HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
+HAVE_OPENAT = @HAVE_OPENAT@
+HAVE_OPENDIR = @HAVE_OPENDIR@
+HAVE_OS_H = @HAVE_OS_H@
+HAVE_PCLOSE = @HAVE_PCLOSE@
+HAVE_PIPE = @HAVE_PIPE@
+HAVE_PIPE2 = @HAVE_PIPE2@
+HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
+HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
+HAVE_PREAD = @HAVE_PREAD@
+HAVE_PSELECT = @HAVE_PSELECT@
+HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@
+HAVE_PTSNAME = @HAVE_PTSNAME@
+HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
+HAVE_PWRITE = @HAVE_PWRITE@
+HAVE_QSORT_R = @HAVE_QSORT_R@
+HAVE_RAISE = @HAVE_RAISE@
+HAVE_RANDOM = @HAVE_RANDOM@
+HAVE_RANDOM_H = @HAVE_RANDOM_H@
+HAVE_RANDOM_R = @HAVE_RANDOM_R@
+HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
+HAVE_READDIR = @HAVE_READDIR@
+HAVE_READLINK = @HAVE_READLINK@
+HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@
+HAVE_REALPATH = @HAVE_REALPATH@
+HAVE_RENAMEAT = @HAVE_RENAMEAT@
+HAVE_REWINDDIR = @HAVE_REWINDDIR@
+HAVE_RPMATCH = @HAVE_RPMATCH@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
+HAVE_SCANDIR = @HAVE_SCANDIR@
+HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
+HAVE_SETENV = @HAVE_SETENV@
+HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_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_SYSEXITS_H = @HAVE_SYSEXITS_H@
+HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
+HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@
+HAVE_SYS_FILE_H = @HAVE_SYS_FILE_H@
+HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@
+HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
+HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_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_TZSET = @HAVE_TZSET@
+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_UTIME = @HAVE_UTIME@
+HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
+HAVE_UTIME_H = @HAVE_UTIME_H@
+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_WCSFTIME = @HAVE_WCSFTIME@
+HAVE_WCSLEN = @HAVE_WCSLEN@
+HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
+HAVE_WCSNCAT = @HAVE_WCSNCAT@
+HAVE_WCSNCMP = @HAVE_WCSNCMP@
+HAVE_WCSNCPY = @HAVE_WCSNCPY@
+HAVE_WCSNLEN = @HAVE_WCSNLEN@
+HAVE_WCSNRTOMBS = @HAVE_WCSNRTOMBS@
+HAVE_WCSPBRK = @HAVE_WCSPBRK@
+HAVE_WCSRCHR = @HAVE_WCSRCHR@
+HAVE_WCSRTOMBS = @HAVE_WCSRTOMBS@
+HAVE_WCSSPN = @HAVE_WCSSPN@
+HAVE_WCSSTR = @HAVE_WCSSTR@
+HAVE_WCSTOK = @HAVE_WCSTOK@
+HAVE_WCSWIDTH = @HAVE_WCSWIDTH@
+HAVE_WCSXFRM = @HAVE_WCSXFRM@
+HAVE_WCTRANS_T = @HAVE_WCTRANS_T@
+HAVE_WCTYPE_H = @HAVE_WCTYPE_H@
+HAVE_WCTYPE_T = @HAVE_WCTYPE_T@
+HAVE_WINSOCK2_H = @HAVE_WINSOCK2_H@
+HAVE_WINT_T = @HAVE_WINT_T@
+HAVE_WMEMCHR = @HAVE_WMEMCHR@
+HAVE_WMEMCMP = @HAVE_WMEMCMP@
+HAVE_WMEMCPY = @HAVE_WMEMCPY@
+HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
+HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
+HAVE__BOOL = @HAVE__BOOL@
+HAVE__EXIT = @HAVE__EXIT@
+IGNORE_UNUSED_LIBRARIES_CFLAGS = @IGNORE_UNUSED_LIBRARIES_CFLAGS@
+INCLUDE_NEXT = @INCLUDE_NEXT@
+INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBCOMPRESS = @LIBCOMPRESS@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBMULTITHREAD = @LIBMULTITHREAD@
+LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
+LIBS = @LIBS@
+LIBSOCKET = @LIBSOCKET@
+LIBTHREAD = @LIBTHREAD@
+LIBTOOL = @LIBTOOL@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_GETLOGIN = @LIB_GETLOGIN@
+LIB_NANOSLEEP = @LIB_NANOSLEEP@
+LIB_SELECT = @LIB_SELECT@
+LIMITS_H = @LIMITS_H@
+LINGUAS = @LINGUAS@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALE_FR = @LOCALE_FR@
+LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
+LOCALE_JA = @LOCALE_JA@
+LOCALE_ZH_CN = @LOCALE_ZH_CN@
+LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANDIR_LAYOUT = @MANDIR_LAYOUT@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MAN_SUBDIRS = @MAN_SUBDIRS@
+MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@
+NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
+NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
+NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
+NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H = @NEXT_AS_FIRST_DIRECTIVE_FNMATCH_H@
+NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_GLOB_H = @NEXT_AS_FIRST_DIRECTIVE_GLOB_H@
+NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
+NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
+NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
+NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@
+NEXT_AS_FIRST_DIRECTIVE_STDARG_H = @NEXT_AS_FIRST_DIRECTIVE_STDARG_H@
+NEXT_AS_FIRST_DIRECTIVE_STDDEF_H = @NEXT_AS_FIRST_DIRECTIVE_STDDEF_H@
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
+NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
+NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
+NEXT_AS_FIRST_DIRECTIVE_STRINGS_H = @NEXT_AS_FIRST_DIRECTIVE_STRINGS_H@
+NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYSEXITS_H = @NEXT_AS_FIRST_DIRECTIVE_SYSEXITS_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_FILE_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_FILE_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_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_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
+NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
+NEXT_AS_FIRST_DIRECTIVE_UTIME_H = @NEXT_AS_FIRST_DIRECTIVE_UTIME_H@
+NEXT_AS_FIRST_DIRECTIVE_WCHAR_H = @NEXT_AS_FIRST_DIRECTIVE_WCHAR_H@
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H@
+NEXT_DIRENT_H = @NEXT_DIRENT_H@
+NEXT_ERRNO_H = @NEXT_ERRNO_H@
+NEXT_FCNTL_H = @NEXT_FCNTL_H@
+NEXT_FLOAT_H = @NEXT_FLOAT_H@
+NEXT_FNMATCH_H = @NEXT_FNMATCH_H@
+NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_GLOB_H = @NEXT_GLOB_H@
+NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
+NEXT_LIMITS_H = @NEXT_LIMITS_H@
+NEXT_LOCALE_H = @NEXT_LOCALE_H@
+NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
+NEXT_STDARG_H = @NEXT_STDARG_H@
+NEXT_STDDEF_H = @NEXT_STDDEF_H@
+NEXT_STDINT_H = @NEXT_STDINT_H@
+NEXT_STDIO_H = @NEXT_STDIO_H@
+NEXT_STDLIB_H = @NEXT_STDLIB_H@
+NEXT_STRINGS_H = @NEXT_STRINGS_H@
+NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYSEXITS_H = @NEXT_SYSEXITS_H@
+NEXT_SYS_FILE_H = @NEXT_SYS_FILE_H@
+NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@
+NEXT_SYS_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_TIME_H = @NEXT_TIME_H@
+NEXT_UNISTD_H = @NEXT_UNISTD_H@
+NEXT_UTIME_H = @NEXT_UTIME_H@
+NEXT_WCHAR_H = @NEXT_WCHAR_H@
+NEXT_WCTYPE_H = @NEXT_WCTYPE_H@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PO4A = @PO4A@
+POSUB = @POSUB@
+PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
+PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
+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_CLOSEDIR = @REPLACE_CLOSEDIR@
+REPLACE_CTIME = @REPLACE_CTIME@
+REPLACE_DIRFD = @REPLACE_DIRFD@
+REPLACE_DPRINTF = @REPLACE_DPRINTF@
+REPLACE_DUP = @REPLACE_DUP@
+REPLACE_DUP2 = @REPLACE_DUP2@
+REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_FACCESSAT = @REPLACE_FACCESSAT@
+REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
+REPLACE_FCLOSE = @REPLACE_FCLOSE@
+REPLACE_FCNTL = @REPLACE_FCNTL@
+REPLACE_FDOPEN = @REPLACE_FDOPEN@
+REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@
+REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FNMATCH = @REPLACE_FNMATCH@
+REPLACE_FOPEN = @REPLACE_FOPEN@
+REPLACE_FPRINTF = @REPLACE_FPRINTF@
+REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREELOCALE = @REPLACE_FREELOCALE@
+REPLACE_FREOPEN = @REPLACE_FREOPEN@
+REPLACE_FSEEK = @REPLACE_FSEEK@
+REPLACE_FSEEKO = @REPLACE_FSEEKO@
+REPLACE_FSTAT = @REPLACE_FSTAT@
+REPLACE_FSTATAT = @REPLACE_FSTATAT@
+REPLACE_FTELL = @REPLACE_FTELL@
+REPLACE_FTELLO = @REPLACE_FTELLO@
+REPLACE_FTRUNCATE = @REPLACE_FTRUNCATE@
+REPLACE_FUTIMENS = @REPLACE_FUTIMENS@
+REPLACE_GETCWD = @REPLACE_GETCWD@
+REPLACE_GETDELIM = @REPLACE_GETDELIM@
+REPLACE_GETDOMAINNAME = @REPLACE_GETDOMAINNAME@
+REPLACE_GETDTABLESIZE = @REPLACE_GETDTABLESIZE@
+REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
+REPLACE_GETLINE = @REPLACE_GETLINE@
+REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
+REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
+REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
+REPLACE_GLOB = @REPLACE_GLOB@
+REPLACE_GLOB_PATTERN_P = @REPLACE_GLOB_PATTERN_P@
+REPLACE_GMTIME = @REPLACE_GMTIME@
+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_NEWLOCALE = @REPLACE_NEWLOCALE@
+REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
+REPLACE_NULL = @REPLACE_NULL@
+REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
+REPLACE_OPEN = @REPLACE_OPEN@
+REPLACE_OPENAT = @REPLACE_OPENAT@
+REPLACE_OPENDIR = @REPLACE_OPENDIR@
+REPLACE_PERROR = @REPLACE_PERROR@
+REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_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_STRFTIME = @REPLACE_STRFTIME@
+REPLACE_STRNCAT = @REPLACE_STRNCAT@
+REPLACE_STRNDUP = @REPLACE_STRNDUP@
+REPLACE_STRNLEN = @REPLACE_STRNLEN@
+REPLACE_STRSIGNAL = @REPLACE_STRSIGNAL@
+REPLACE_STRSTR = @REPLACE_STRSTR@
+REPLACE_STRTOD = @REPLACE_STRTOD@
+REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
+REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
+REPLACE_SYMLINK = @REPLACE_SYMLINK@
+REPLACE_SYMLINKAT = @REPLACE_SYMLINKAT@
+REPLACE_TIMEGM = @REPLACE_TIMEGM@
+REPLACE_TMPFILE = @REPLACE_TMPFILE@
+REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
+REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
+REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_TZSET = @REPLACE_TZSET@
+REPLACE_UNLINK = @REPLACE_UNLINK@
+REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
+REPLACE_UNSETENV = @REPLACE_UNSETENV@
+REPLACE_USLEEP = @REPLACE_USLEEP@
+REPLACE_UTIME = @REPLACE_UTIME@
+REPLACE_UTIMENSAT = @REPLACE_UTIMENSAT@
+REPLACE_VASPRINTF = @REPLACE_VASPRINTF@
+REPLACE_VDPRINTF = @REPLACE_VDPRINTF@
+REPLACE_VFPRINTF = @REPLACE_VFPRINTF@
+REPLACE_VPRINTF = @REPLACE_VPRINTF@
+REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
+REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
+REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSFTIME = @REPLACE_WCSFTIME@
+REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
+REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
+REPLACE_WCTOB = @REPLACE_WCTOB@
+REPLACE_WCTOMB = @REPLACE_WCTOMB@
+REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
+REPLACE_WRITE = @REPLACE_WRITE@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
+SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
+STDALIGN_H = @STDALIGN_H@
+STDARG_H = @STDARG_H@
+STDBOOL_H = @STDBOOL_H@
+STDDEF_H = @STDDEF_H@
+STDINT_H = @STDINT_H@
+STRIP = @STRIP@
+SYSEXITS_H = @SYSEXITS_H@
+SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@
+SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
+TBL_X_FORMAT = @TBL_X_FORMAT@
+TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+TRANS_APROPOS = @TRANS_APROPOS@
+TRANS_APROPOS_UPPER = @TRANS_APROPOS_UPPER@
+TRANS_CATMAN = @TRANS_CATMAN@
+TRANS_CATMAN_UPPER = @TRANS_CATMAN_UPPER@
+TRANS_LEXGROG = @TRANS_LEXGROG@
+TRANS_LEXGROG_UPPER = @TRANS_LEXGROG_UPPER@
+TRANS_MAN = @TRANS_MAN@
+TRANS_MANCONV = @TRANS_MANCONV@
+TRANS_MANCONV_UPPER = @TRANS_MANCONV_UPPER@
+TRANS_MANDB = @TRANS_MANDB@
+TRANS_MANDB_UPPER = @TRANS_MANDB_UPPER@
+TRANS_MANPATH = @TRANS_MANPATH@
+TRANS_MANPATH_UPPER = @TRANS_MANPATH_UPPER@
+TRANS_MAN_UPPER = @TRANS_MAN_UPPER@
+TRANS_WHATIS = @TRANS_WHATIS@
+TRANS_WHATIS_UPPER = @TRANS_WHATIS_UPPER@
+TRANS_ZSOELIM = @TRANS_ZSOELIM@
+TRANS_ZSOELIM_UPPER = @TRANS_ZSOELIM_UPPER@
+TROFF = @TROFF@
+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@
+UTIME_H = @UTIME_H@
+VERSION = @VERSION@
+WARN_CFLAGS = @WARN_CFLAGS@
+WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
+WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
+WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@
+WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@
+WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+browser = @browser@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+bunzip2 = @bunzip2@
+bzip2 = @bzip2@
+cache_top_owner = @cache_top_owner@
+cat = @cat@
+col = @col@
+compress = @compress@
+compress_ext = @compress_ext@
+compressor = @compressor@
+config_file = @config_file@
+config_file_basename = @config_file_basename@
+config_file_dirname = @config_file_dirname@
+datadir = @datadir@
+datarootdir = @datarootdir@
+date = @date@
+docdir = @docdir@
+dvidir = @dvidir@
+eqn = @eqn@
+exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+gltests_LIBOBJS = @gltests_LIBOBJS@
+gltests_LTLIBOBJS = @gltests_LTLIBOBJS@
+gltests_WITNESS = @gltests_WITNESS@
+grap = @grap@
+grep = @grep@
+gunzip = @gunzip@
+gzip = @gzip@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+libpipeline_CFLAGS = @libpipeline_CFLAGS@
+libpipeline_LIBS = @libpipeline_LIBS@
+libseccomp_CFLAGS = @libseccomp_CFLAGS@
+libseccomp_LIBS = @libseccomp_LIBS@
+localedir = @localedir@
+localstatedir = @localstatedir@
+lzip = @lzip@
+lzma = @lzma@
+man_mode = @man_mode@
+man_owner = @man_owner@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+neqn = @neqn@
+nroff = @nroff@
+oldincludedir = @oldincludedir@
+override_dir = @override_dir@
+pager = @pager@
+pdfdir = @pdfdir@
+pic = @pic@
+preconv = @preconv@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+refer = @refer@
+roff_version = @roff_version@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sections = @sections@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
+systemdtmpfilesdir = @systemdtmpfilesdir@
+target_alias = @target_alias@
+tbl = @tbl@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+tr = @tr@
+troff = @troff@
+uncompress = @uncompress@
+unlzip = @unlzip@
+unlzma = @unlzma@
+unxz = @unxz@
+vgrind = @vgrind@
+xz = @xz@
+pkglib_LTLIBRARIES = libman.la
+dist_noinst_DATA = README
+AM_CFLAGS = $(WARN_CFLAGS)
+libman_la_CPPFLAGS = \
+ -I$(top_builddir)/include \
+ -I$(top_srcdir)/gl/lib \
+ -I$(top_builddir)/gl/lib \
+ -DLOCALEDIR=\"$(localedir)\" \
+ $(libpipeline_CFLAGS) \
+ $(libseccomp_CFLAGS)
+
+libman_la_SOURCES = \
+ appendstr.c \
+ cleanup.c \
+ cleanup.h \
+ debug.c \
+ decompress.c \
+ decompress.h \
+ encodings.c \
+ encodings.h \
+ hashtable.c \
+ hashtable.h \
+ linelength.c \
+ linelength.h \
+ lower.c \
+ lower.h \
+ orderfiles.c \
+ orderfiles.h \
+ pathsearch.c \
+ pathsearch.h \
+ sandbox.c \
+ sandbox.h \
+ security.c \
+ security.h \
+ tempfile.c \
+ util.c \
+ wordfnmatch.c \
+ wordfnmatch.h \
+ xchown.c \
+ xchown.h \
+ xregcomp.c \
+ xregcomp.h
+
+libman_la_LIBADD = ../gl/lib/libgnu.la $(LTLIBOBJS) \
+ $(LIBCOMPRESS) @LTLIBINTL@
+
+libman_la_LDFLAGS = \
+ -avoid-version -release $(VERSION) -rpath $(pkglibdir) \
+ -no-undefined \
+ $(libpipeline_LIBS) \
+ $(libseccomp_LIBS)
+
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(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) --foreign lib/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --foreign lib/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
+ }
+
+uninstall-pkglibLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
+ done
+
+clean-pkglibLTLIBRARIES:
+ -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
+ @list='$(pkglib_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+
+libman.la: $(libman_la_OBJECTS) $(libman_la_DEPENDENCIES) $(EXTRA_libman_la_DEPENDENCIES)
+ $(AM_V_CCLD)$(libman_la_LINK) -rpath $(pkglibdir) $(libman_la_OBJECTS) $(libman_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-appendstr.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-cleanup.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-debug.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-decompress.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-encodings.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-hashtable.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-linelength.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-lower.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-orderfiles.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-pathsearch.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-sandbox.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-security.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-tempfile.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-util.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-wordfnmatch.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-xchown.Plo@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libman_la-xregcomp.Plo@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+ @$(MKDIR_P) $(@D)
+ @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
+
+.c.o:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+libman_la-appendstr.lo: appendstr.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libman_la-appendstr.lo -MD -MP -MF $(DEPDIR)/libman_la-appendstr.Tpo -c -o libman_la-appendstr.lo `test -f 'appendstr.c' || echo '$(srcdir)/'`appendstr.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libman_la-appendstr.Tpo $(DEPDIR)/libman_la-appendstr.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='appendstr.c' object='libman_la-appendstr.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libman_la-appendstr.lo `test -f 'appendstr.c' || echo '$(srcdir)/'`appendstr.c
+
+libman_la-cleanup.lo: cleanup.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libman_la-cleanup.lo -MD -MP -MF $(DEPDIR)/libman_la-cleanup.Tpo -c -o libman_la-cleanup.lo `test -f 'cleanup.c' || echo '$(srcdir)/'`cleanup.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libman_la-cleanup.Tpo $(DEPDIR)/libman_la-cleanup.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cleanup.c' object='libman_la-cleanup.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libman_la-cleanup.lo `test -f 'cleanup.c' || echo '$(srcdir)/'`cleanup.c
+
+libman_la-debug.lo: debug.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libman_la-debug.lo -MD -MP -MF $(DEPDIR)/libman_la-debug.Tpo -c -o libman_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libman_la-debug.Tpo $(DEPDIR)/libman_la-debug.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='debug.c' object='libman_la-debug.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libman_la-debug.lo `test -f 'debug.c' || echo '$(srcdir)/'`debug.c
+
+libman_la-decompress.lo: decompress.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libman_la-decompress.lo -MD -MP -MF $(DEPDIR)/libman_la-decompress.Tpo -c -o libman_la-decompress.lo `test -f 'decompress.c' || echo '$(srcdir)/'`decompress.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libman_la-decompress.Tpo $(DEPDIR)/libman_la-decompress.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='decompress.c' object='libman_la-decompress.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libman_la-decompress.lo `test -f 'decompress.c' || echo '$(srcdir)/'`decompress.c
+
+libman_la-encodings.lo: encodings.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libman_la-encodings.lo -MD -MP -MF $(DEPDIR)/libman_la-encodings.Tpo -c -o libman_la-encodings.lo `test -f 'encodings.c' || echo '$(srcdir)/'`encodings.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libman_la-encodings.Tpo $(DEPDIR)/libman_la-encodings.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='encodings.c' object='libman_la-encodings.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libman_la-encodings.lo `test -f 'encodings.c' || echo '$(srcdir)/'`encodings.c
+
+libman_la-hashtable.lo: hashtable.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libman_la-hashtable.lo -MD -MP -MF $(DEPDIR)/libman_la-hashtable.Tpo -c -o libman_la-hashtable.lo `test -f 'hashtable.c' || echo '$(srcdir)/'`hashtable.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libman_la-hashtable.Tpo $(DEPDIR)/libman_la-hashtable.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='hashtable.c' object='libman_la-hashtable.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libman_la-hashtable.lo `test -f 'hashtable.c' || echo '$(srcdir)/'`hashtable.c
+
+libman_la-linelength.lo: linelength.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libman_la-linelength.lo -MD -MP -MF $(DEPDIR)/libman_la-linelength.Tpo -c -o libman_la-linelength.lo `test -f 'linelength.c' || echo '$(srcdir)/'`linelength.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libman_la-linelength.Tpo $(DEPDIR)/libman_la-linelength.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linelength.c' object='libman_la-linelength.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libman_la-linelength.lo `test -f 'linelength.c' || echo '$(srcdir)/'`linelength.c
+
+libman_la-lower.lo: lower.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libman_la-lower.lo -MD -MP -MF $(DEPDIR)/libman_la-lower.Tpo -c -o libman_la-lower.lo `test -f 'lower.c' || echo '$(srcdir)/'`lower.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libman_la-lower.Tpo $(DEPDIR)/libman_la-lower.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='lower.c' object='libman_la-lower.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libman_la-lower.lo `test -f 'lower.c' || echo '$(srcdir)/'`lower.c
+
+libman_la-orderfiles.lo: orderfiles.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libman_la-orderfiles.lo -MD -MP -MF $(DEPDIR)/libman_la-orderfiles.Tpo -c -o libman_la-orderfiles.lo `test -f 'orderfiles.c' || echo '$(srcdir)/'`orderfiles.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libman_la-orderfiles.Tpo $(DEPDIR)/libman_la-orderfiles.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='orderfiles.c' object='libman_la-orderfiles.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libman_la-orderfiles.lo `test -f 'orderfiles.c' || echo '$(srcdir)/'`orderfiles.c
+
+libman_la-pathsearch.lo: pathsearch.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libman_la-pathsearch.lo -MD -MP -MF $(DEPDIR)/libman_la-pathsearch.Tpo -c -o libman_la-pathsearch.lo `test -f 'pathsearch.c' || echo '$(srcdir)/'`pathsearch.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libman_la-pathsearch.Tpo $(DEPDIR)/libman_la-pathsearch.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='pathsearch.c' object='libman_la-pathsearch.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libman_la-pathsearch.lo `test -f 'pathsearch.c' || echo '$(srcdir)/'`pathsearch.c
+
+libman_la-sandbox.lo: sandbox.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libman_la-sandbox.lo -MD -MP -MF $(DEPDIR)/libman_la-sandbox.Tpo -c -o libman_la-sandbox.lo `test -f 'sandbox.c' || echo '$(srcdir)/'`sandbox.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libman_la-sandbox.Tpo $(DEPDIR)/libman_la-sandbox.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sandbox.c' object='libman_la-sandbox.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libman_la-sandbox.lo `test -f 'sandbox.c' || echo '$(srcdir)/'`sandbox.c
+
+libman_la-security.lo: security.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libman_la-security.lo -MD -MP -MF $(DEPDIR)/libman_la-security.Tpo -c -o libman_la-security.lo `test -f 'security.c' || echo '$(srcdir)/'`security.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libman_la-security.Tpo $(DEPDIR)/libman_la-security.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='security.c' object='libman_la-security.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libman_la-security.lo `test -f 'security.c' || echo '$(srcdir)/'`security.c
+
+libman_la-tempfile.lo: tempfile.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libman_la-tempfile.lo -MD -MP -MF $(DEPDIR)/libman_la-tempfile.Tpo -c -o libman_la-tempfile.lo `test -f 'tempfile.c' || echo '$(srcdir)/'`tempfile.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libman_la-tempfile.Tpo $(DEPDIR)/libman_la-tempfile.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tempfile.c' object='libman_la-tempfile.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libman_la-tempfile.lo `test -f 'tempfile.c' || echo '$(srcdir)/'`tempfile.c
+
+libman_la-util.lo: util.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libman_la-util.lo -MD -MP -MF $(DEPDIR)/libman_la-util.Tpo -c -o libman_la-util.lo `test -f 'util.c' || echo '$(srcdir)/'`util.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libman_la-util.Tpo $(DEPDIR)/libman_la-util.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='util.c' object='libman_la-util.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libman_la-util.lo `test -f 'util.c' || echo '$(srcdir)/'`util.c
+
+libman_la-wordfnmatch.lo: wordfnmatch.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libman_la-wordfnmatch.lo -MD -MP -MF $(DEPDIR)/libman_la-wordfnmatch.Tpo -c -o libman_la-wordfnmatch.lo `test -f 'wordfnmatch.c' || echo '$(srcdir)/'`wordfnmatch.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libman_la-wordfnmatch.Tpo $(DEPDIR)/libman_la-wordfnmatch.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='wordfnmatch.c' object='libman_la-wordfnmatch.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libman_la-wordfnmatch.lo `test -f 'wordfnmatch.c' || echo '$(srcdir)/'`wordfnmatch.c
+
+libman_la-xchown.lo: xchown.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libman_la-xchown.lo -MD -MP -MF $(DEPDIR)/libman_la-xchown.Tpo -c -o libman_la-xchown.lo `test -f 'xchown.c' || echo '$(srcdir)/'`xchown.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libman_la-xchown.Tpo $(DEPDIR)/libman_la-xchown.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xchown.c' object='libman_la-xchown.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libman_la-xchown.lo `test -f 'xchown.c' || echo '$(srcdir)/'`xchown.c
+
+libman_la-xregcomp.lo: xregcomp.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libman_la-xregcomp.lo -MD -MP -MF $(DEPDIR)/libman_la-xregcomp.Tpo -c -o libman_la-xregcomp.lo `test -f 'xregcomp.c' || echo '$(srcdir)/'`xregcomp.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libman_la-xregcomp.Tpo $(DEPDIR)/libman_la-xregcomp.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xregcomp.c' object='libman_la-xregcomp.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libman_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libman_la-xregcomp.lo `test -f 'xregcomp.c' || echo '$(srcdir)/'`xregcomp.c
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+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: $(BUILT_SOURCES)
+ $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(DATA)
+installdirs:
+ for dir in "$(DESTDIR)$(pkglibdir)"; 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-generic clean-libtool clean-pkglibLTLIBRARIES \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -f ./$(DEPDIR)/libman_la-appendstr.Plo
+ -rm -f ./$(DEPDIR)/libman_la-cleanup.Plo
+ -rm -f ./$(DEPDIR)/libman_la-debug.Plo
+ -rm -f ./$(DEPDIR)/libman_la-decompress.Plo
+ -rm -f ./$(DEPDIR)/libman_la-encodings.Plo
+ -rm -f ./$(DEPDIR)/libman_la-hashtable.Plo
+ -rm -f ./$(DEPDIR)/libman_la-linelength.Plo
+ -rm -f ./$(DEPDIR)/libman_la-lower.Plo
+ -rm -f ./$(DEPDIR)/libman_la-orderfiles.Plo
+ -rm -f ./$(DEPDIR)/libman_la-pathsearch.Plo
+ -rm -f ./$(DEPDIR)/libman_la-sandbox.Plo
+ -rm -f ./$(DEPDIR)/libman_la-security.Plo
+ -rm -f ./$(DEPDIR)/libman_la-tempfile.Plo
+ -rm -f ./$(DEPDIR)/libman_la-util.Plo
+ -rm -f ./$(DEPDIR)/libman_la-wordfnmatch.Plo
+ -rm -f ./$(DEPDIR)/libman_la-xchown.Plo
+ -rm -f ./$(DEPDIR)/libman_la-xregcomp.Plo
+ -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-pkglibLTLIBRARIES
+
+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)/libman_la-appendstr.Plo
+ -rm -f ./$(DEPDIR)/libman_la-cleanup.Plo
+ -rm -f ./$(DEPDIR)/libman_la-debug.Plo
+ -rm -f ./$(DEPDIR)/libman_la-decompress.Plo
+ -rm -f ./$(DEPDIR)/libman_la-encodings.Plo
+ -rm -f ./$(DEPDIR)/libman_la-hashtable.Plo
+ -rm -f ./$(DEPDIR)/libman_la-linelength.Plo
+ -rm -f ./$(DEPDIR)/libman_la-lower.Plo
+ -rm -f ./$(DEPDIR)/libman_la-orderfiles.Plo
+ -rm -f ./$(DEPDIR)/libman_la-pathsearch.Plo
+ -rm -f ./$(DEPDIR)/libman_la-sandbox.Plo
+ -rm -f ./$(DEPDIR)/libman_la-security.Plo
+ -rm -f ./$(DEPDIR)/libman_la-tempfile.Plo
+ -rm -f ./$(DEPDIR)/libman_la-util.Plo
+ -rm -f ./$(DEPDIR)/libman_la-wordfnmatch.Plo
+ -rm -f ./$(DEPDIR)/libman_la-xchown.Plo
+ -rm -f ./$(DEPDIR)/libman_la-xregcomp.Plo
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkglibLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
+ clean-generic clean-libtool clean-pkglibLTLIBRARIES \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-libtool 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-pkglibLTLIBRARIES install-ps \
+ install-ps-am install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+ uninstall-am uninstall-pkglibLTLIBRARIES
+
+.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/lib/README b/lib/README
new file mode 100644
index 0000000..ba2c691
--- /dev/null
+++ b/lib/README
@@ -0,0 +1,22 @@
+These library source files have various authors but are all covered by
+either the GNU General Public License or the GNU Lesser General Public
+License, and are freely distributable under their terms and conditions.
+
+See the files ../docs/COPYING and ../docs/COPYING.LIB for relevant
+information.
+
+appendstr.c author - Markus Armbruster
+cleanup.* author - Markus Armbruster, Colin Watson
+debug.c author - Colin Watson
+decompress.* author - Colin Watson
+encodings.* author - Colin Watson
+hashtable.* author - Wilf., Colin Watson
+linelength.* author - Martin Schulze, Jon Tombs, Colin Watson
+lower.* author - Wilf., Colin Watson
+pathsearch.* author - Colin Watson
+pipeline.* author - James Clark, Colin Watson
+security.* author - John W. Eaton, Wilf., Colin Watson
+tempfile.c author - Colin Watson
+util.c author - John W. Eaton, Wilf., Colin Watson
+wordfnmatch.* author - Colin Watson
+xregcomp.* author - Colin Watson
diff --git a/lib/appendstr.c b/lib/appendstr.c
new file mode 100644
index 0000000..ef07ce8
--- /dev/null
+++ b/lib/appendstr.c
@@ -0,0 +1,55 @@
+/* appendstr.c -- append to a dynamically allocated string
+ Copyright (C) 1994 Markus Armbruster
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Library 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; see the file COPYING.LIB. If not, write
+ to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
+ 02139, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <string.h>
+#include <stdarg.h>
+
+#include "manconfig.h"
+
+/* append strings to first argument, which is realloced to the correct size
+ first arg may be NULL */
+char *appendstr (char *str, ...)
+{
+ va_list ap;
+ size_t len, newlen;
+ char *next, *end;
+
+ len = str ? strlen (str) : 0;
+
+ va_start (ap, str);
+ newlen = len + 1;
+ while ((next = va_arg (ap, char *)))
+ newlen += strlen (next);
+ va_end (ap);
+
+ str = xrealloc (str, newlen);
+ end = str + len;
+
+ va_start (ap, str);
+ while ((next = va_arg (ap, char *))) {
+ strcpy (end, next);
+ end += strlen (next);
+ }
+ va_end (ap);
+
+ return str;
+}
diff --git a/lib/cleanup.c b/lib/cleanup.c
new file mode 100644
index 0000000..5aa2e50
--- /dev/null
+++ b/lib/cleanup.c
@@ -0,0 +1,266 @@
+/*
+ * cleanup.c -- simple dynamic cleanup function management
+ * Copyright (C) 1995 Markus Armbruster.
+ * Copyright (C) 2007 Colin Watson.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; see the file COPYING.LIB. If not,
+ * write to the Free Software Foundation, Inc., 51 Franklin St, Fifth
+ * Floor, Boston, MA 02110-1301 USA.
+*/
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <stdlib.h>
+#include <stdio.h> /* SunOS's loosing assert.h needs it */
+#include <assert.h>
+#include <signal.h>
+#include <unistd.h>
+#include <string.h>
+
+#include "manconfig.h" /* for FATAL */
+#include "cleanup.h"
+
+
+
+/* Dealing with signals */
+
+
+/* saved signal actions */
+static struct sigaction saved_hup_action;
+static struct sigaction saved_int_action;
+static struct sigaction saved_term_action;
+
+
+/* Run cleanups, then reraise signal with default handler. */
+static void
+sighandler (int signo)
+{
+ struct sigaction act;
+ sigset_t set;
+
+ do_cleanups_sigsafe (1);
+
+ /* set default signal action */
+ memset (&act, 0, sizeof act);
+ act.sa_handler = SIG_DFL;
+ sigemptyset (&act.sa_mask);
+ act.sa_flags = 0;
+ if (sigaction (signo, &act, NULL)) {
+ /* should not happen */
+ _exit (FATAL); /* exit() is taboo from signal handlers! */
+ }
+
+ /* unmask signo */
+ if ( sigemptyset (&set)
+ || sigaddset (&set, signo)
+ || sigprocmask (SIG_UNBLOCK, &set, NULL)) {
+ /* shouldn't happen */
+ _exit (FATAL); /* exit() is taboo from signal handlers! */
+ }
+
+ /* signal has now default action and is unmasked,
+ reraise it to terminate program abnormally */
+ kill (getpid(), signo);
+ abort();
+}
+
+
+/* Save signo's current action to oldact, if its handler is SIG_DFL
+ install sighandler, return 0 on success, -1 on failure. */
+static int
+trap_signal (int signo, struct sigaction *oldact)
+{
+ if (sigaction (signo, NULL, oldact)) {
+ return -1;
+ }
+
+ if (oldact->sa_handler == SIG_DFL) {
+ struct sigaction act;
+
+ memset (&act, 0, sizeof act);
+ act.sa_handler = sighandler;
+ sigemptyset (&act.sa_mask);
+ act.sa_flags = 0;
+ return sigaction (signo, &act, oldact);
+ }
+
+ return 0;
+}
+
+
+/* Trap some abnormal exits to call do_cleanups(). */
+static int
+trap_abnormal_exits (void)
+{
+ if ( trap_signal (SIGHUP, &saved_hup_action)
+ || trap_signal (SIGINT, &saved_int_action)
+ || trap_signal (SIGTERM, &saved_term_action))
+ return -1;
+ return 0;
+}
+
+
+/* Restore signo's action from oldact if its current handler is
+ sighandler, return 0 on success, -1 on failure. */
+static int
+untrap_signal (int signo, struct sigaction *oldact)
+{
+ struct sigaction act;
+ if (sigaction (signo, NULL, &act)) {
+ return -1;
+ }
+
+ if (act.sa_handler == sighandler) {
+ return sigaction (signo, oldact, NULL);
+ }
+
+ return 0;
+}
+
+
+/* Undo a previous trap_abnormal_exits(). */
+static int
+untrap_abnormal_exits (void)
+{
+ if ( untrap_signal (SIGHUP, &saved_hup_action)
+ | untrap_signal (SIGINT, &saved_int_action)
+ | untrap_signal (SIGTERM, &saved_term_action))
+ return -1;
+ return 0;
+}
+
+
+
+typedef struct {
+ cleanup_fun fun;
+ void *arg;
+ int sigsafe;
+} slot;
+
+static slot *stack = NULL; /* stack of cleanup functions */
+static unsigned nslots = 0; /* #slots in stack */
+static unsigned tos = 0; /* top of stack, 0 <= tos <= nslots */
+
+/* Call cleanup functions in stack from from top to bottom,
+ * Automatically called on program termination via exit(3) or default
+ * action for SIGHUP, SIGINT or SIGTERM.
+ * Since this may be called from a signal handler, do not use free().
+ * If in_sighandler is true, cleanup functions with sigsafe=0 will not be
+ * called.
+ */
+void
+do_cleanups_sigsafe (int in_sighandler)
+{
+ unsigned i;
+
+ assert (tos <= nslots);
+ for (i = tos; i > 0; --i)
+ if (!in_sighandler || stack[i-1].sigsafe)
+ stack[i-1].fun (stack[i-1].arg);
+}
+
+/* Call cleanup functions in stack from from top to bottom,
+ * Automatically called on program termination via exit(3).
+ */
+void
+do_cleanups (void)
+{
+ do_cleanups_sigsafe (0);
+ tos = 0;
+ nslots = 0;
+ free (stack);
+ stack = NULL;
+}
+
+
+/* Push a cleanup function on the cleanup stack,
+ * return 0 on success, -1 on failure.
+ * Caution: the cleanup function may be called from signal handlers if
+ * sigsafe=1. If you just want a convenient atexit() wrapper, pass
+ * sigsafe=0.
+ */
+int
+push_cleanup (cleanup_fun fun, void *arg, int sigsafe)
+{
+ static int handler_installed = 0;
+
+ assert (tos <= nslots);
+
+ if (!handler_installed) {
+ if (atexit (do_cleanups))
+ return -1;
+ handler_installed = 1;
+ }
+
+ if (tos == nslots) {
+ /* stack is full, allocate another slot */
+ /* stack is not expected to grow much, otherwise we would double it */
+ slot *new_stack;
+
+ if (stack) {
+ new_stack = xnrealloc (stack, nslots+1, sizeof (slot));
+ } else {
+ new_stack = xnmalloc (nslots+1, sizeof (slot));
+ }
+
+ if (!new_stack) return -1;
+ stack = new_stack;
+ ++nslots;
+ }
+
+ assert (tos < nslots);
+ stack[tos].fun = fun;
+ stack[tos].arg = arg;
+ stack[tos].sigsafe = sigsafe;
+ ++tos;
+
+
+ trap_abnormal_exits();
+
+ return 0;
+}
+
+
+/* Remove topmost cleanup function from the cleanup stack that matches the
+ * given values.
+ */
+void
+pop_cleanup (cleanup_fun fun, void *arg)
+{
+ unsigned i, j;
+
+ assert (tos > 0);
+
+ for (i = tos; i > 0; --i) {
+ if (stack[i-1].fun == fun && stack[i-1].arg == arg) {
+ for (j = i; j < tos; ++j)
+ stack[j-1] = stack[j];
+ --tos;
+ break;
+ }
+ }
+
+ if (tos == 0) untrap_abnormal_exits();
+}
+
+
+/* Pop all cleanup functions from the cleanup stack. */
+void
+pop_all_cleanups (void)
+{
+ tos = 0;
+ untrap_abnormal_exits();
+}
diff --git a/lib/cleanup.h b/lib/cleanup.h
new file mode 100644
index 0000000..555900d
--- /dev/null
+++ b/lib/cleanup.h
@@ -0,0 +1,33 @@
+/*
+ * cleanup.h -- simple dynamic cleanup function management
+ * Copyright (C) 1995 Markus Armbruster.
+ * Copyright (C) 2007 Colin Watson.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; see the file COPYING.LIB. If not,
+ * write to the Free Software Foundation, Inc., 51 Franklin St, Fifth
+ * Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef _CLEANUP_H
+#define _CLEANUP_H
+
+typedef void (*cleanup_fun) (void *);
+
+extern void do_cleanups_sigsafe (int);
+extern void do_cleanups (void);
+extern int push_cleanup (cleanup_fun, void *, int);
+extern void pop_cleanup (cleanup_fun, void *);
+extern void pop_all_cleanups (void);
+
+#endif /* _CLEANUP_H */
diff --git a/lib/debug.c b/lib/debug.c
new file mode 100644
index 0000000..1b75e63
--- /dev/null
+++ b/lib/debug.c
@@ -0,0 +1,71 @@
+/*
+ * debug.c: debugging messages
+ * Copyright (C) 2007 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <errno.h>
+
+#include "manconfig.h"
+
+int debug_level = 0;
+
+void init_debug (void)
+{
+ const char *man_debug = getenv ("MAN_DEBUG");
+ if (man_debug && STREQ (man_debug, "1"))
+ debug_level = 1;
+}
+
+static void vdebug (const char *message, va_list args)
+{
+ if (debug_level)
+ vfprintf (stderr, message, args);
+}
+
+void debug (const char *message, ...)
+{
+ if (debug_level) {
+ va_list args;
+
+ va_start (args, message);
+ vdebug (message, args);
+ va_end (args);
+ }
+}
+
+void debug_error (const char *message, ...)
+{
+ if (debug_level) {
+ va_list args;
+
+ va_start (args, message);
+ vdebug (message, args);
+ va_end (args);
+
+ debug (": %s\n", strerror (errno));
+ }
+}
diff --git a/lib/decompress.c b/lib/decompress.c
new file mode 100644
index 0000000..15dda5b
--- /dev/null
+++ b/lib/decompress.c
@@ -0,0 +1,159 @@
+/*
+ * decompress.c: decompression abstraction layer
+ *
+ * Copyright (C) 2007, 2008 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#ifdef HAVE_LIBZ
+# include "zlib.h"
+#endif /* HAVE_LIBZ */
+
+#include "xvasprintf.h"
+
+#include "manconfig.h"
+#include "comp_src.h"
+#include "pipeline.h"
+#include "decompress.h"
+#include "sandbox.h"
+
+#ifdef HAVE_LIBZ
+
+static void decompress_zlib (void *data ATTRIBUTE_UNUSED)
+{
+ gzFile zlibfile;
+ int fd;
+
+ fd = dup (STDIN_FILENO);
+ if (fd < 0)
+ return;
+
+ zlibfile = gzdopen (fd, "r");
+ if (!zlibfile) {
+ close (fd);
+ return;
+ }
+
+ for (;;) {
+ char buffer[4096];
+ int r = gzread (zlibfile, buffer, 4096);
+ if (r <= 0)
+ break;
+ if (fwrite (buffer, 1, (size_t) r, stdout) < (size_t) r)
+ break;
+ }
+
+ gzclose (zlibfile);
+ return;
+}
+
+#endif /* HAVE_LIBZ */
+
+extern man_sandbox *sandbox;
+
+pipeline *decompress_open (const char *filename)
+{
+ pipecmd *cmd;
+ pipeline *p;
+ struct stat st;
+#ifdef HAVE_LIBZ
+ size_t filename_len;
+#endif /* HAVE_LIBZ */
+ char *ext;
+ struct compression *comp;
+
+ if (stat (filename, &st) < 0 || S_ISDIR (st.st_mode))
+ return NULL;
+
+#ifdef HAVE_LIBZ
+ filename_len = strlen (filename);
+ if (filename_len > 3 && STREQ (filename + filename_len - 3, ".gz")) {
+ cmd = pipecmd_new_function ("zcat", &decompress_zlib, NULL,
+ NULL);
+ pipecmd_pre_exec (cmd, sandbox_load, sandbox_free, sandbox);
+ p = pipeline_new_commands (cmd, (void *) 0);
+ goto got_pipeline;
+ }
+#endif /* HAVE_LIBZ */
+
+ ext = strrchr (filename, '.');
+ if (ext) {
+ ++ext;
+
+ for (comp = comp_list; comp->ext; ++comp) {
+ if (!STREQ (comp->ext, ext))
+ continue;
+
+ cmd = pipecmd_new_argstr (comp->prog);
+ pipecmd_pre_exec (cmd, sandbox_load, sandbox_free,
+ sandbox);
+ p = pipeline_new_commands (cmd, (void *) 0);
+ goto got_pipeline;
+ }
+ }
+
+#ifdef HAVE_GZIP
+ /* HP-UX */
+ ext = strstr (filename, ".Z/");
+ if (ext) {
+ cmd = pipecmd_new_argstr (GUNZIP);
+ pipecmd_pre_exec (cmd, sandbox_load, sandbox_free, sandbox);
+ p = pipeline_new_commands (cmd, (void *) 0);
+ goto got_pipeline;
+ }
+#endif
+
+ p = pipeline_new ();
+
+got_pipeline:
+ pipeline_want_infile (p, filename);
+ pipeline_want_out (p, -1);
+ return p;
+}
+
+pipeline *decompress_fdopen (int fd)
+{
+ pipeline *p;
+#ifdef HAVE_LIBZ
+ pipecmd *cmd;
+#endif /* HAVE_LIBZ */
+
+#ifdef HAVE_LIBZ
+ cmd = pipecmd_new_function ("zcat", &decompress_zlib, NULL, NULL);
+ pipecmd_pre_exec (cmd, sandbox_load, sandbox_free, sandbox);
+ p = pipeline_new_commands (cmd, (void *) 0);
+#else /* HAVE_LIBZ */
+ p = pipeline_new ();
+#endif /* HAVE_LIBZ */
+
+ pipeline_want_in (p, fd);
+ pipeline_want_out (p, -1);
+ return p;
+}
diff --git a/lib/decompress.h b/lib/decompress.h
new file mode 100644
index 0000000..35f7c51
--- /dev/null
+++ b/lib/decompress.h
@@ -0,0 +1,40 @@
+/*
+ * decompress.h: interface to decompression abstraction layer
+ *
+ * Copyright (C) 2007 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef MAN_DECOMPRESS_H
+#define MAN_DECOMPRESS_H
+
+#include "pipeline.h"
+
+struct decompress;
+
+/* Open a decompressor reading from FILENAME. The caller must start the
+ * resulting pipeline.
+ */
+pipeline *decompress_open (const char *filename);
+
+/* Open a decompressor reading from file descriptor FD. The caller must
+ * start the resulting pipeline.
+ */
+pipeline *decompress_fdopen (int fd);
+
+#endif /* MAN_DECOMPRESS_H */
diff --git a/lib/encodings.c b/lib/encodings.c
new file mode 100644
index 0000000..ec8fb6b
--- /dev/null
+++ b/lib/encodings.c
@@ -0,0 +1,915 @@
+/*
+ * encodings.c: locale and encoding handling for man
+ *
+ * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+ * Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "gettext.h"
+#include "localcharset.h"
+#include <locale.h>
+#include <ctype.h>
+
+#include "manconfig.h"
+
+#include "pathsearch.h"
+#include "pipeline.h"
+#include "decompress.h"
+
+#include "encodings.h"
+
+
+/* Due to historical limitations in groff (which may be removed in the
+ * future), there is no mechanism for a man page to specify its own
+ * encoding. This means that each national language directory needs to carry
+ * with it information about its encoding, and each groff device needs to
+ * have a default encoding associated with it. Out of the box, groff
+ * formally allows only ISO-8859-1 on input; however, patches originating
+ * with Debian and imported by many other GNU/Linux distributions change
+ * this somewhat.
+ *
+ * Eventually, groff will support proper Unicode input, and much of this
+ * horror can go away.
+ *
+ * Do *not* confuse source encoding with groff encoding. The encoding
+ * specified in this table is the encoding in which the source man pages in
+ * each language directory are expected to be written. The groff encoding is
+ * determined by the selected groff device and sometimes also by the user's
+ * locale.
+ *
+ * The standard output encoding is the encoding assumed for cat pages for
+ * each language directory. It must *not* be used to discover the actual
+ * output encoding displayed to the user; that is determined by the locale.
+ * TODO: it would be useful to be able to change the standard output
+ * encoding in the configuration file.
+ *
+ * This table is expected to change over time, particularly as man pages
+ * begin to move towards UTF-8. Feel free to patch this for your
+ * distribution; send me updates for languages I've missed.
+ *
+ * Explicit encodings in the directory name (e.g. de_DE.UTF-8) override this
+ * table.
+ */
+struct directory_entry {
+ const char *lang_dir;
+ const char *source_encoding;
+};
+
+static struct directory_entry directory_table[] = {
+ { "C", "ISO-8859-1" }, /* English */
+ { "POSIX", "ISO-8859-1" }, /* English */
+ { "da", "ISO-8859-1" }, /* Danish */
+ { "de", "ISO-8859-1" }, /* German */
+ { "en", "ISO-8859-1" }, /* English */
+ { "es", "ISO-8859-1" }, /* Spanish */
+ { "et", "ISO-8859-1" }, /* Estonian */
+ { "fi", "ISO-8859-1" }, /* Finnish */
+ { "fr", "ISO-8859-1" }, /* French */
+ { "ga", "ISO-8859-1" }, /* Irish */
+ { "gl", "ISO-8859-1" }, /* Galician */
+ { "id", "ISO-8859-1" }, /* Indonesian */
+ { "is", "ISO-8859-1" }, /* Icelandic */
+ { "it", "ISO-8859-1" }, /* Italian */
+ { "nb", "ISO-8859-1" }, /* Norwegian Bokmål */
+ { "nl", "ISO-8859-1" }, /* Dutch */
+ { "nn", "ISO-8859-1" }, /* Norwegian Nynorsk */
+ { "no", "ISO-8859-1" }, /* Norwegian */
+ { "pt", "ISO-8859-1" }, /* Portuguese */
+ { "sv", "ISO-8859-1" }, /* Swedish */
+
+#ifdef MULTIBYTE_GROFF
+ /* These languages require a patched version of groff with the
+ * ascii8 and nippon devices.
+ */
+ { "be", "CP1251" }, /* Belarusian */
+ { "bg", "CP1251" }, /* Bulgarian */
+ { "cs", "ISO-8859-2" }, /* Czech */
+ { "el", "ISO-8859-7" }, /* Greek */
+ { "hr", "ISO-8859-2" }, /* Croatian */
+ { "hu", "ISO-8859-2" }, /* Hungarian */
+ { "ja", "EUC-JP" }, /* Japanese */
+ { "ko", "EUC-KR" }, /* Korean */
+ { "lt", "ISO-8859-13" }, /* Lithuanian */
+ { "lv", "ISO-8859-13" }, /* Latvian */
+ { "mk", "ISO-8859-5" }, /* Macedonian */
+ { "pl", "ISO-8859-2" }, /* Polish */
+ { "ro", "ISO-8859-2" }, /* Romanian */
+ { "ru", "KOI8-R" }, /* Russian */
+ { "sk", "ISO-8859-2" }, /* Slovak */
+ { "sl", "ISO-8859-2" }, /* Slovenian */
+ /* sr@latin must precede sr, due to top-down left-substring matching later */
+ { "sr@latin", "ISO-8859-2" }, /* Serbian Latin */
+ { "sr", "ISO-8859-5" }, /* Serbian */
+ { "tr", "ISO-8859-9" }, /* Turkish */
+ { "uk", "KOI8-U" }, /* Ukrainian */
+ { "vi", "TCVN5712-1" }, /* Vietnamese */
+ { "zh_CN", "GBK" }, /* Simplified Chinese */
+ { "zh_SG", "GBK" }, /* Simplified Chinese, Singapore */
+ { "zh_HK", "BIG5HKSCS" }, /* Traditional Chinese, Hong Kong */
+ { "zh_TW", "BIG5" }, /* Traditional Chinese */
+#endif /* MULTIBYTE_GROFF */
+
+ { NULL, NULL }
+};
+
+static const char fallback_source_encoding[] = "ISO-8859-1";
+
+/* Unfortunately, there is no portable way to inspect iconv's internal table
+ * of character set aliases. We copy the most interesting ones here so that
+ * we can deal with them if they appear in directory names. Note that all
+ * names will be converted to upper case before looking them up in this
+ * table.
+ */
+struct charset_alias_entry {
+ const char *alias;
+ const char *canonical_name;
+};
+
+static struct charset_alias_entry charset_alias_table[] = {
+ /* The FHS is silly and requires numeric-only aliases that iconv
+ * does not support.
+ */
+ { "88591", "ISO-8859-1" },
+ { "88592", "ISO-8859-2" },
+ { "88593", "ISO-8859-3" },
+ { "88594", "ISO-8859-4" },
+ { "88595", "ISO-8859-5" },
+ { "88596", "ISO-8859-6" },
+ { "88597", "ISO-8859-7" },
+ { "88598", "ISO-8859-8" },
+ { "88599", "ISO-8859-9" },
+ { "885910", "ISO-8859-10" },
+ { "885911", "ISO-8859-11" },
+ { "885913", "ISO-8859-13" },
+ { "885914", "ISO-8859-14" },
+ { "885915", "ISO-8859-15" },
+ { "885916", "ISO-8859-16" },
+
+ { "ASCII", "ANSI_X3.4-1968" },
+ { "BIG-5", "BIG5" },
+ { "BIG5-HKSCS", "BIG5HKSCS" },
+ { "EUCCN", "EUC-CN" },
+ { "EUCJP", "EUC-JP" },
+ { "EUCKR", "EUC-KR" },
+ { "EUCTW", "EUC-TW" },
+ { "GB2312", "EUC-CN" },
+ { "ISO8859-1", "ISO-8859-1" },
+ { "ISO8859-2", "ISO-8859-2" },
+ { "ISO8859-3", "ISO-8859-3" },
+ { "ISO8859-4", "ISO-8859-4" },
+ { "ISO8859-5", "ISO-8859-5" },
+ { "ISO8859-6", "ISO-8859-6" },
+ { "ISO8859-7", "ISO-8859-7" },
+ { "ISO8859-8", "ISO-8859-8" },
+ { "ISO8859-9", "ISO-8859-9" },
+ { "ISO8859-10", "ISO-8859-10" },
+ { "ISO8859-11", "ISO-8859-11" },
+ { "ISO8859-13", "ISO-8859-13" },
+ { "ISO8859-14", "ISO-8859-14" },
+ { "ISO8859-15", "ISO-8859-15" },
+ { "ISO8859-16", "ISO-8859-16" },
+ { "KOI8R", "KOI8-R" },
+ { "KOI8U", "KOI8-U" },
+ { "UJIS", "EUC-JP" },
+ { "US-ASCII", "ANSI_X3.4-1968" },
+ { "UTF8", "UTF-8" },
+
+ { NULL, NULL }
+};
+
+/* The default groff terminal output device to be used is determined based
+ * on locale_charset (), which returns the character set used by the current
+ * locale.
+ */
+struct charset_entry {
+ const char *charset_from_locale;
+ const char *default_device;
+};
+
+static struct charset_entry charset_table[] = {
+ { "ANSI_X3.4-1968", "ascii" },
+#ifndef HEIRLOOM_NROFF
+ { "ISO-8859-1", "latin1" },
+#endif /* HEIRLOOM_NROFF */
+ { "UTF-8", "utf8" },
+
+#ifndef HEIRLOOM_NROFF
+# ifdef MULTIBYTE_GROFF
+ { "BIG5", "nippon" },
+ { "BIG5HKSCS", "nippon" },
+ { "EUC-CN", "nippon" },
+ { "EUC-JP", "nippon" },
+ { "EUC-TW", "nippon" },
+ { "GBK", "nippon" },
+# else /* !MULTIBYTE_GROFF */
+ /* If we have a smarter version of groff, this is better dealt with
+ * using either ascii8 (Debian multibyte patch) or preconv (as of
+ * groff 1.20). This is a not-quite-right stopgap in case we have
+ * neither.
+ */
+ { "ISO-8859-15", "latin1" },
+# endif /* MULTIBYTE_GROFF */
+#endif /* HEIRLOOM_NROFF */
+
+ { NULL, NULL }
+};
+
+static const char *fallback_default_device =
+#ifdef MULTIBYTE_GROFF
+ "ascii8"
+#else /* !MULTIBYTE_GROFF */
+ "ascii"
+#endif /* MULTIBYTE_GROFF */
+ ;
+
+/* The encoding used for the text passed to groff is a function of the
+ * selected groff device. Traditional devices expect ISO-8859-1 on input
+ * (yes, even the utf8 device); devices added in the Debian multibyte patch
+ * expect other encodings. The ascii8 device passes top-bit-set characters
+ * straight through so is (probably ...) encoding-agnostic. If this encoding
+ * does not match the source encoding, an iconv pipe is used (if available)
+ * to perform recoding.
+ */
+struct device_entry {
+ const char *roff_device;
+ const char *roff_encoding;
+ const char *output_encoding;
+};
+
+static struct device_entry device_table[] = {
+ /* nroff devices */
+ { "ascii", "ANSI_X3.4-1968", "ANSI_X3.4-1968" },
+ { "latin1", "ISO-8859-1", "ISO-8859-1" },
+ { "utf8", "ISO-8859-1", "UTF-8" },
+
+#ifdef MULTIBYTE_GROFF
+ { "ascii8", NULL, NULL },
+ { "nippon", NULL, NULL },
+#endif /* MULTIBYTE_GROFF */
+
+#ifdef HEIRLOOM_NROFF
+ /* Not strictly accurate, but we only use this in UTF-8 locales. */
+ { "locale", "UTF-8", "UTF-8" },
+#endif /* HEIRLOOM_NROFF */
+
+ /* troff devices */
+ { "X75", NULL, NULL },
+ { "X75-12", NULL, NULL },
+ { "X100", NULL, NULL },
+ { "X100-12", NULL, NULL },
+ { "dvi", NULL, NULL },
+ { "html", NULL, NULL },
+ { "lbp", NULL, NULL },
+ { "lj4", NULL, NULL },
+ { "ps", NULL, NULL },
+
+ { NULL, NULL, NULL }
+};
+
+static const char fallback_roff_encoding[] = "ISO-8859-1";
+
+/* Setting less_charset to iso8859 tells the less pager that characters
+ * between 0xA0 and 0xFF are displayable, not that its input is encoded in
+ * ISO-8859-*. TODO: Perhaps using LESSCHARDEF would be better.
+ *
+ * Character set names compatible only with jless go in jless_charset.
+ */
+struct less_charset_entry {
+ const char *charset_from_locale;
+ const char *less_charset;
+ const char *jless_charset;
+};
+
+static struct less_charset_entry less_charset_table[] = {
+ { "ANSI_X3.4-1968", "ascii", NULL },
+ { "ISO-8859-1", "iso8859", NULL },
+ { "UTF-8", "utf-8", NULL },
+
+#ifdef MULTIBYTE_GROFF
+ { "CP1251", "windows", NULL },
+ { "EUC-JP", "iso8859", "japanese-ujis" },
+ { "KOI8-R", "koi8-r", NULL },
+ /* close enough? */
+ { "KOI8-U", "koi8-r", NULL },
+#endif /* MULTIBYTE_GROFF */
+
+ { NULL, NULL, NULL }
+};
+
+static const char fallback_less_charset[] = "iso8859";
+
+/* Encoding conversions from groff-1.20/src/preproc/preconv/preconv.cpp.
+ * I've only included those not already recognised by GNU libiconv.
+ */
+struct conversion_entry {
+ const char *from;
+ const char *to;
+};
+
+static struct conversion_entry conversion_table[] = {
+ { "chinese-big5", "Big5" },
+ { "chinese-euc", "GB2312" },
+ { "chinese-iso-8bit", "GB2312" },
+ { "cn-gb-2312", "GB2312" },
+ { "cp878", "KOI8-R" },
+ { "cyrillic-iso-8bit", "ISO-8859-5" },
+ { "cyrillic-koi8", "KOI8-R" },
+ { "euc-china", "GB2312" },
+ { "euc-japan", "EUC-JP" },
+ { "euc-japan-1990", "EUC-JP" },
+ { "euc-kr", "EUC-KR" },
+ { "greek-iso-8bit", "ISO-8859-7" },
+ { "iso-latin-1", "ISO-8859-1" },
+ { "iso-latin-2", "ISO-8859-2" },
+ { "iso-latin-5", "ISO-8859-9" },
+ { "iso-latin-7", "ISO-8859-13" },
+ { "iso-latin-9", "ISO-8859-15" },
+ { "japanese-iso-8bit", "EUC-JP" },
+ { "japanese-euc", "EUC-JP" },
+ { "jis8", "EUC-JP" },
+ { "korean-euc", "EUC-KR" },
+ { "korean-iso-8bit", "EUC-KR" },
+ { "latin-0", "ISO-8859-15" },
+ { "latin-1", "ISO-8859-1" },
+ { "latin-2", "ISO-8859-2" },
+ { "latin-5", "ISO-8859-9" },
+ { "latin-7", "ISO-8859-13" },
+ { "mule-utf-16", "UTF-16" },
+ { "mule-utf-16be", "UTF-16BE" },
+ { "mule-utf-16-be", "UTF-16BE" },
+ { "mule-utf-16be-with-signature", "UTF-16" },
+ { "mule-utf-16le", "UTF-16LE" },
+ { "mule-utf-16-le", "UTF-16LE" },
+ { "mule-utf-16le-with-signature", "UTF-16" },
+ { "mule-utf-8", "UTF-8" },
+ { "utf-16-be", "UTF-16BE" },
+ { "utf-16be-with-signature", "UTF-16" },
+ { "utf-16-be-with-signature", "UTF-16" },
+ { "utf-16-le", "UTF-16LE" },
+ { "utf-16le-with-signature", "UTF-16" },
+ { "utf-16-le-with-signature", "UTF-16" },
+ { NULL, NULL }
+};
+
+const char *groff_preconv = NULL;
+
+/* Is the groff "preconv" helper available? If so, return its name.
+ * Otherwise, return NULL.
+ */
+const char *get_groff_preconv (void)
+{
+ if (groff_preconv) {
+ if (*groff_preconv)
+ return groff_preconv;
+ else
+ return NULL;
+ }
+
+ if (pathsearch_executable ("gpreconv"))
+ groff_preconv = "gpreconv";
+ else if (pathsearch_executable ("preconv"))
+ groff_preconv = "preconv";
+ else
+ groff_preconv = "";
+
+ if (*groff_preconv)
+ return groff_preconv;
+ else
+ return NULL;
+}
+
+/* Return the assumed encoding of the source man page, based on the
+ * directory in which it was found. The caller should attempt to recode from
+ * this to whatever encoding is expected by groff.
+ *
+ * The caller should free the returned string when it is finished with it.
+ */
+char *get_page_encoding (const char *lang)
+{
+ const struct directory_entry *entry;
+ const char *dot;
+
+ if (!lang || !*lang) {
+ /* Guess based on the locale. */
+ lang = setlocale (LC_MESSAGES, NULL);
+ if (!lang)
+ return xstrdup (fallback_source_encoding);
+ }
+
+ dot = strchr (lang, '.');
+ if (dot) {
+ /* The FHS has the worst specification of what's supposed to
+ * go after the dot here that I've ever seen. To quote from
+ * version 2.1:
+ *
+ * "It is recommended that this be a numeric representation
+ * if possible (ISO standards, especially), not include
+ * additional punctuation symbols, and that any letters be
+ * in lowercase."
+ *
+ * Any sane standard would use directory names like
+ * de_DE.ISO-8859-1; the examples in the FHS recommend
+ * de_DE.88591 instead. Considering that there is no other
+ * conceivable use for encodings in directory names other
+ * than to pass them to iconv or similar, this is quite
+ * startlingly useless.
+ *
+ * While we now support this thanks to
+ * get_canonical_charset_name, the FHS specification is
+ * obviously wrong and I plan to petition to have it
+ * changed. I recommend ignoring this part of the FHS.
+ */
+ char *dir_encoding =
+ xstrndup (dot + 1, strcspn (dot + 1, ",@"));
+ char *canonical_dir_encoding =
+ xstrdup (get_canonical_charset_name (dir_encoding));
+ free (dir_encoding);
+ return canonical_dir_encoding;
+ }
+
+ for (entry = directory_table; entry->lang_dir; ++entry)
+ if (STRNEQ (entry->lang_dir, lang, strlen (entry->lang_dir)))
+ return xstrdup (entry->source_encoding);
+
+ return xstrdup (fallback_source_encoding);
+}
+
+/* Return the canonical encoding for source man pages in the specified
+ * language. This ignores any encoding specification in the language
+ * directory name. The source encoding should be used as a basis for
+ * determining the correct roff device to use: that is, the caller should
+ * behave as if it is recoding from the page encoding to the source encoding
+ * first, although in practice it should recode directly from the page
+ * encoding to the roff encoding.
+ *
+ * You should normally only call this function if the page encoding is
+ * UTF-8, in which case older versions of groff that lack preconv need to
+ * have the page recoded to some legacy encoding). If the page is in a
+ * legacy encoding, then attempting to recode from that to some other legacy
+ * encoding will probably do more harm than good.
+ *
+ * Here are a few concrete examples of why these distinctions are important:
+ *
+ * /usr/share/man/en_GB.UTF-8, locale C
+ * page encoding = UTF-8
+ * source encoding = ISO-8859-1
+ * roff encoding = ISO-8859-1
+ * output encoding = UTF-8
+ * UTF-8 -> iconv -> ISO-8859-1 -> groff -Tascii -> ANSI_X3.4-1968
+ *
+ * /usr/share/man/pl_PL.UTF-8, locale pl_PL.UTF-8
+ * page encoding = UTF-8
+ * source encoding = ISO-8859-2
+ * roff encoding = ISO-8859-2
+ * output encoding = ISO-8859-2
+ * UTF-8 -> iconv -> ISO-8859-2 -> groff -Tascii8
+ * -> ISO-8859-2 -> iconv -> UTF-8
+ *
+ * /usr/share/man/ja_JP.EUC-JP, locale ja_JP.UTF-8
+ * page encoding = EUC-JP
+ * source encoding = EUC-JP
+ * roff encoding = UTF-8
+ * output encoding = UTF-8
+ * EUC-JP -> iconv -> UTF-8 -> groff -Tutf8 -> UTF-8
+ *
+ * /usr/share/man/en_GB.ISO-8859-15, locale en_GB.UTF-8
+ * page encoding = ISO-8859-15
+ * source encoding = ISO-8859-15
+ * roff encoding = ISO-8859-15
+ * output encoding = ISO-8859-15
+ * ISO-8859-15 -> groff -Tascii8 -> ISO-8859-15 -> iconv -> UTF-8
+ */
+const char *get_source_encoding (const char *lang)
+{
+ const struct directory_entry *entry;
+
+ if (!lang || !*lang) {
+ /* Guess based on the locale. */
+ lang = setlocale (LC_MESSAGES, NULL);
+ if (!lang)
+ return fallback_source_encoding;
+ }
+
+ for (entry = directory_table; entry->lang_dir; ++entry)
+ if (STRNEQ (entry->lang_dir, lang, strlen (entry->lang_dir)))
+ return entry->source_encoding;
+
+ return fallback_source_encoding;
+}
+
+const char *get_canonical_charset_name (const char *charset)
+{
+ const struct charset_alias_entry *entry;
+ char *charset_upper = xstrdup (charset);
+ char *p;
+
+ for (p = charset_upper; *p; ++p)
+ *p = CTYPE (toupper, *p);
+
+ for (entry = charset_alias_table; entry->alias; ++entry)
+ if (STREQ (entry->alias, charset_upper)) {
+ free (charset_upper);
+ return entry->canonical_name;
+ }
+
+ free (charset_upper);
+ return charset;
+}
+
+/* Return the current locale's character set. */
+const char *get_locale_charset (void)
+{
+ const char *charset;
+ char *saved_locale;
+
+ /* We need to modify LC_CTYPE temporarily in order to look at the
+ * codeset, so save it first.
+ */
+ saved_locale = setlocale (LC_CTYPE, NULL);
+ if (saved_locale)
+ saved_locale = xstrdup (saved_locale);
+
+ setlocale (LC_CTYPE, "");
+
+ charset = locale_charset ();
+
+ /* Restore LC_CTYPE to its value on entry to this function. */
+ setlocale (LC_CTYPE, saved_locale);
+ free (saved_locale);
+
+ if (charset && *charset)
+ return get_canonical_charset_name (charset);
+ else
+ return NULL;
+}
+
+/* Find a locale with this character set. This is a non-portable operation,
+ * but required to make col(1) work correctly with -E. If no locale can be
+ * found, or if none needs to be set, return NULL.
+ *
+ * The caller should free the returned string when it is finished with it.
+ */
+char *find_charset_locale (const char *charset)
+{
+ const char *canonical_charset = get_canonical_charset_name (charset);
+ char *saved_locale;
+ const char supported_path[] = "/usr/share/i18n/SUPPORTED";
+ FILE *supported = NULL;
+ char *line = NULL;
+ size_t n = 0;
+ char *locale = NULL;
+
+ if (STREQ (charset, get_locale_charset ()))
+ return NULL;
+
+ saved_locale = setlocale (LC_CTYPE, NULL);
+ if (saved_locale)
+ saved_locale = xstrdup (saved_locale);
+
+ supported = fopen (supported_path, "r");
+ while (supported && getline (&line, &n, supported) >= 0) {
+ const char *space = strchr (line, ' ');
+ if (space) {
+ char *encoding = xstrdup (space + 1);
+ char *newline = strchr (encoding, '\n');
+ if (newline)
+ *newline = 0;
+ if (STREQ (canonical_charset,
+ get_canonical_charset_name (encoding))) {
+ locale = xstrndup (line, space - line);
+ /* Is this locale actually installed? */
+ if (setlocale (LC_CTYPE, locale)) {
+ free (encoding);
+ goto out;
+ } else {
+ free (locale);
+ locale = NULL;
+ }
+ }
+ free (encoding);
+ }
+ free (line);
+ line = NULL;
+ }
+
+ if (strlen (canonical_charset) >= 5 &&
+ STRNEQ (canonical_charset, "UTF-8", 5)) {
+ locale = xstrdup ("C.UTF-8");
+ if (setlocale (LC_CTYPE, locale))
+ goto out;
+ free (locale);
+ locale = xstrdup ("en_US.UTF-8");
+ if (setlocale (LC_CTYPE, locale))
+ goto out;
+ free (locale);
+ locale = NULL;
+ }
+
+out:
+ free (line);
+ setlocale (LC_CTYPE, saved_locale);
+ free (saved_locale);
+ if (supported)
+ fclose (supported);
+ return locale;
+}
+
+/* Can we take this input encoding and produce this output encoding, perhaps
+ * with the help of some iconv pipes? */
+static int compatible_encodings (const char *input, const char *output)
+{
+ if (STREQ (input, output))
+ return 1;
+
+ /* If the input is ASCII, recoding should be easy. Try it. */
+ if (STREQ (input, "ANSI_X3.4-1968"))
+ return 1;
+
+ /* If the input is UTF-8, it's either a simple recoding of whatever
+ * we want or else it probably won't work at all no matter what we
+ * do. We might as well try it for now.
+ */
+ if (STREQ (input, "UTF-8"))
+ return 1;
+
+ /* If the output is ASCII, this is probably because the caller
+ * explicitly asked for it, so we have little choice but to try.
+ */
+ if (STREQ (output, "ANSI_X3.4-1968"))
+ return 1;
+
+#ifdef MULTIBYTE_GROFF
+ /* Special case for some CJK UTF-8 locales, which take UTF-8 input
+ * recoded from EUC-JP (etc.) and produce UTF-8 output. This is
+ * rather filthy.
+ */
+ if ((STREQ (input, "BIG5") || STREQ (input, "BIG5HKSCS") ||
+ STREQ (input, "EUC-JP") ||
+ STREQ (input, "EUC-CN") || STREQ (input, "GBK") ||
+ STREQ (input, "EUC-KR") ||
+ STREQ (input, "EUC-TW")) &&
+ STREQ (output, "UTF-8"))
+ return 1;
+#endif /* MULTIBYTE_GROFF */
+
+ return 0;
+}
+
+/* Return the default groff device for the given character set. This may be
+ * overridden by the user. The page's source encoding is needed to ensure
+ * that the device is compatible: consider ru_RU.UTF-8, which needs ascii8
+ * and a trailing iconv pipe to recode to UTF-8.
+ *
+ * All this encoding compatibility stuff feels like a slightly nasty hack,
+ * but I haven't yet come up with a cleaner way to do it.
+ */
+const char *get_default_device (const char *charset_from_locale,
+ const char *source_encoding)
+{
+ const struct charset_entry *entry;
+
+ if (get_groff_preconv ()) {
+ /* ASCII is a special case, and the only way we can get
+ * things like bullet marks to come out right is by using
+ * the ascii device. People using such a basic locale
+ * probably don't want anything fancy anyway.
+ */
+ if (charset_from_locale &&
+ STREQ (charset_from_locale, "ANSI_X3.4-1968"))
+ return "ascii";
+ else
+ return "utf8";
+ }
+
+ if (!charset_from_locale)
+ return fallback_default_device;
+
+ for (entry = charset_table; entry->charset_from_locale; ++entry) {
+ if (STREQ (entry->charset_from_locale, charset_from_locale)) {
+ const char *roff_encoding =
+ get_roff_encoding (entry->default_device,
+ source_encoding);
+ if (compatible_encodings (source_encoding,
+ roff_encoding))
+ return entry->default_device;
+ }
+ }
+
+ return fallback_default_device;
+}
+
+/* Is this a known *roff device name? */
+int is_roff_device (const char *device)
+{
+ const struct device_entry *entry;
+
+ for (entry = device_table; entry->roff_device; ++entry) {
+ if (STREQ (entry->roff_device, device))
+ return 1;
+ }
+
+ return 0;
+}
+
+/* Find the input encoding expected by groff, and set the LESSCHARSET
+ * environment variable appropriately.
+ */
+const char *get_roff_encoding (const char *device, const char *source_encoding)
+{
+ const struct device_entry *entry;
+ int found = 0;
+ const char *roff_encoding = NULL;
+
+ if (device) {
+ for (entry = device_table; entry->roff_device; ++entry) {
+ if (STREQ (entry->roff_device, device)) {
+ found = 1;
+ roff_encoding = entry->roff_encoding;
+ break;
+ }
+ }
+ }
+
+ if (!found)
+ roff_encoding = fallback_roff_encoding;
+
+#ifdef MULTIBYTE_GROFF
+ /* An ugly special case is needed here. The utf8 device normally
+ * takes ISO-8859-1 input. However, with the multibyte patch, when
+ * recoding from CJK character sets it takes UTF-8 input instead.
+ * This is evil, but there's not much that can be done about it
+ * apart from waiting for groff 2.0.
+ */
+ if (device && STREQ (device, "utf8") && !get_groff_preconv () &&
+ STREQ (get_locale_charset (), "UTF-8")) {
+ const char *ctype = setlocale (LC_CTYPE, NULL);
+ if (STRNEQ (ctype, "ja_JP", 5) ||
+ STRNEQ (ctype, "ko_KR", 5) ||
+ STRNEQ (ctype, "zh_CN", 5) ||
+ STRNEQ (ctype, "zh_HK", 5) ||
+ STRNEQ (ctype, "zh_SG", 5) ||
+ STRNEQ (ctype, "zh_TW", 5))
+ roff_encoding = "UTF-8";
+ }
+#endif /* MULTIBYTE_GROFF */
+
+ return roff_encoding ? roff_encoding : source_encoding;
+}
+
+/* Find the output encoding that this device will produce, or NULL if it
+ * will simply pass through the input encoding.
+ */
+const char *get_output_encoding (const char *device)
+{
+ const struct device_entry *entry;
+
+ for (entry = device_table; entry->roff_device; ++entry)
+ if (STREQ (entry->roff_device, device))
+ return entry->output_encoding;
+
+ return NULL;
+}
+
+/* Return the value of LESSCHARSET appropriate for this locale. */
+const char *get_less_charset (const char *charset_from_locale)
+{
+ const struct less_charset_entry *entry;
+
+ if (charset_from_locale) {
+ for (entry = less_charset_table; entry->charset_from_locale;
+ ++entry)
+ if (STREQ (entry->charset_from_locale,
+ charset_from_locale))
+ return entry->less_charset;
+ }
+
+ return fallback_less_charset;
+}
+
+/* Return the value of JLESSCHARSET appropriate for this locale. May return
+ * NULL.
+ */
+const char *get_jless_charset (const char *charset_from_locale)
+{
+ const struct less_charset_entry *entry;
+
+ if (charset_from_locale) {
+ for (entry = less_charset_table; entry->charset_from_locale;
+ ++entry)
+ if (STREQ (entry->charset_from_locale,
+ charset_from_locale))
+ return entry->jless_charset;
+ }
+
+ return NULL;
+}
+
+/* Convert Emacs-style coding tags to ones that libiconv understands. */
+static char *convert_encoding (char *encoding)
+{
+ size_t encoding_len = strlen (encoding);
+ const struct conversion_entry *entry;
+
+#define STRIP(s, l) do { \
+ if (encoding_len > (l) && \
+ !strcasecmp (encoding + encoding_len - (l), (s))) \
+ encoding[encoding_len - (l)] = '\0'; \
+} while (0)
+
+ STRIP ("-dos", 4);
+ STRIP ("-mac", 4);
+ STRIP ("-unix", 5);
+
+#undef STRIP
+
+ for (entry = conversion_table; entry->from; ++entry)
+ if (!strcasecmp (entry->from, encoding)) {
+ free (encoding);
+ return xstrdup (entry->to);
+ }
+
+ return encoding;
+}
+
+/* Inspect the first line of data in a pipeline for preprocessor encoding
+ * declarations.
+ */
+char *check_preprocessor_encoding (pipeline *p)
+{
+ char *pp_encoding = NULL;
+
+#ifdef PP_COOKIE
+ const char *line = pipeline_peekline (p);
+ char *directive = NULL;
+
+ /* Some people use .\" incorrectly. We allow it for encoding
+ * declarations but not for preprocessor declarations.
+ */
+ if (line &&
+ (STRNEQ (line, PP_COOKIE, 4) || STRNEQ (line, ".\\\" ", 4))) {
+ const char *newline = strchr (line, '\n');
+ if (newline)
+ directive = xstrndup (line + 4,
+ newline - (line + 4));
+ else
+ directive = xstrdup (line + 4);
+ }
+
+ if (directive && strstr (directive, "-*-")) {
+ const char *pp_search = strstr (directive, "-*-") + 3;
+ while (pp_search && *pp_search) {
+ while (*pp_search == ' ')
+ ++pp_search;
+ if (STRNEQ (pp_search, "coding:", 7)) {
+ const char *pp_encoding_allow;
+ size_t pp_encoding_len;
+ pp_search += 7;
+ while (*pp_search == ' ')
+ ++pp_search;
+ pp_encoding_allow = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "abcdefghijklmnopqrstuvwxyz"
+ "0123456789-_/:.()";
+ pp_encoding_len = strspn (pp_search,
+ pp_encoding_allow);
+ pp_encoding = xstrndup (pp_search,
+ pp_encoding_len);
+ pp_encoding = convert_encoding (pp_encoding);
+ debug ("preprocessor encoding: %s\n",
+ pp_encoding);
+ break;
+ } else {
+ pp_search = strchr (pp_search, ';');
+ if (pp_search)
+ ++pp_search;
+ }
+ }
+ }
+ free (directive);
+#endif /* PP_COOKIE */
+
+ return pp_encoding;
+}
diff --git a/lib/encodings.h b/lib/encodings.h
new file mode 100644
index 0000000..9967a89
--- /dev/null
+++ b/lib/encodings.h
@@ -0,0 +1,37 @@
+/*
+ * encodings.h: Interface to locale and encoding handling for man
+ *
+ * Copyright (C) 2003, 2004, 2006, 2007, 2008 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+const char *get_groff_preconv (void);
+char *get_page_encoding (const char *lang);
+const char *get_source_encoding (const char *lang);
+const char *get_canonical_charset_name (const char *charset);
+const char *get_locale_charset (void);
+char *find_charset_locale (const char *charset);
+const char *get_default_device (const char *locale_charset,
+ const char *source_encoding);
+int is_roff_device (const char *device);
+const char *get_roff_encoding (const char *device,
+ const char *source_encoding);
+const char *get_output_encoding (const char *device);
+const char *get_less_charset (const char *locale_charset);
+const char *get_jless_charset (const char *locale_charset);
+char *check_preprocessor_encoding (struct pipeline *p);
diff --git a/lib/hashtable.c b/lib/hashtable.c
new file mode 100644
index 0000000..85fbb04
--- /dev/null
+++ b/lib/hashtable.c
@@ -0,0 +1,232 @@
+/*
+ * hashtable.c: in core hash table routines.
+ *
+ * Copyright (C) 1994, 1995 Graeme W. Wilford. (Wilf.)
+ * Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * All of these routines except hashtable_free() can be found in K&R II.
+ *
+ * Sat Aug 20 15:01:02 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+/* which hash function do we want ? */
+/* #define PROLOGUE */
+#define KRII
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <string.h>
+#include <stdlib.h>
+
+#include "manconfig.h"
+#include "hashtable.h"
+
+#if defined(PROLOGUE)
+#define HASHSIZE 2048
+#elif defined(KRII)
+#define HASHSIZE 2001
+#else
+#error hash function not defined
+#endif
+
+/* Return hash value for string. */
+static unsigned int hash (const char *s, size_t len)
+{
+ unsigned int hashval = 0;
+ size_t i;
+
+ for (i = 0; i < len && s[i]; ++i)
+#if defined(KRII)
+ hashval = s[i] + 31 * hashval;
+ return hashval % HASHSIZE;
+#elif defined(PROLOGUE)
+ hashval = (hashval << 1) + s[i];
+ return hashval & (HASHSIZE - 1);
+#endif
+}
+
+void null_hashtable_free (void *defn ATTRIBUTE_UNUSED)
+{
+}
+
+/* Create a hashtable. */
+struct hashtable *hashtable_create (hashtable_free_ptr free_defn)
+{
+ struct hashtable *ht = XMALLOC (struct hashtable);
+ ht->hashtab = XCALLOC (HASHSIZE, struct nlist *);
+ ht->unique = 0;
+ ht->identical = 0;
+ ht->free_defn = free_defn;
+ return ht;
+}
+
+/* Return pointer to hash entry structure containing s, or NULL if it
+ * doesn't exist.
+ */
+struct nlist *hashtable_lookup_structure (const struct hashtable *ht,
+ const char *s, size_t len)
+{
+ struct nlist *np;
+
+ for (np = ht->hashtab[hash (s, len)]; np; np = np->next) {
+ if (strncmp (s, np->name, len) == 0)
+ return np;
+ }
+ return NULL;
+}
+
+/* Return pointer to definition of s, or NULL if it doesn't exist. */
+void *hashtable_lookup (const struct hashtable *ht, const char *s, size_t len)
+{
+ struct nlist *np = hashtable_lookup_structure (ht, s, len);
+ if (np)
+ return np->defn;
+ else
+ return NULL;
+}
+
+/* Return structure containing definition (never NULL). */
+struct nlist *hashtable_install (struct hashtable *ht,
+ const char *name, size_t len, void *defn)
+{
+ struct nlist *np;
+
+ np = hashtable_lookup_structure (ht, name, len);
+ if (np) {
+ if (np->defn)
+ ht->free_defn (np->defn);
+ } else {
+ unsigned int hashval;
+
+ np = XMALLOC (struct nlist);
+ np->name = xstrndup (name, len);
+ hashval = hash (name, len);
+
+ /* record uniqueness if debugging */
+ if (debug_level) {
+ if (ht->hashtab[hashval])
+ ht->identical++;
+ else
+ ht->unique++;
+ }
+
+ /* point to last entry with this hash */
+ np->next = ht->hashtab[hashval];
+
+ /* attach to hashtab array */
+ ht->hashtab[hashval] = np;
+ }
+
+ np->defn = defn;
+
+ return np;
+}
+
+/* Remove structure containing name from the hash tree. */
+void hashtable_remove (struct hashtable *ht, const char *name, size_t len)
+{
+ struct nlist *np, *prev;
+ unsigned int hashval = hash (name, len);
+
+ for (np = ht->hashtab[hashval], prev = NULL; np;
+ prev = np, np = np->next) {
+ if (strncmp (name, np->name, len) == 0) {
+ if (prev)
+ prev->next = np->next;
+ else
+ ht->hashtab[hashval] = np->next;
+ if (np->defn)
+ ht->free_defn (np->defn);
+ free (np->name);
+ free (np);
+ return;
+ }
+ }
+}
+
+struct hashtable_iter {
+ struct nlist **bucket;
+ struct nlist *np;
+};
+
+/* Iterate over hash. Do not modify hash while iterating. */
+struct nlist *hashtable_iterate (const struct hashtable *ht,
+ struct hashtable_iter **iterp)
+{
+ struct hashtable_iter *iter = *iterp;
+
+ if (!iter)
+ *iterp = iter = XZALLOC (struct hashtable_iter);
+
+ if (iter->np && iter->np->next)
+ return iter->np = iter->np->next;
+
+ if (iter->bucket)
+ ++iter->bucket;
+ else
+ iter->bucket = ht->hashtab;
+
+ while (iter->bucket < ht->hashtab + HASHSIZE) {
+ if (*iter->bucket)
+ return iter->np = *iter->bucket;
+ ++iter->bucket;
+ }
+
+ free (iter);
+ *iterp = NULL;
+ return NULL;
+}
+
+/* Free up the hash tree (garbage collection). Also call the free_defn()
+ * hook to free up values if necessary.
+ */
+void hashtable_free (struct hashtable *ht)
+{
+ int i;
+
+ if (!ht)
+ return;
+
+ debug ("hashtable_free: %d entries, %d (%d%%) unique\n",
+ ht->unique + ht->identical,
+ ht->unique,
+ ht->unique ? (ht->unique * 100) / (ht->unique + ht->identical)
+ : 0);
+
+ for (i = 0; i < HASHSIZE; i++) {
+ struct nlist *np;
+
+ np = ht->hashtab[i];
+ while (np) {
+ struct nlist *next;
+
+ if (np->defn)
+ ht->free_defn (np->defn);
+ free (np->name);
+ next = np->next;
+ free (np);
+ np = next;
+ }
+ }
+
+ free (ht->hashtab);
+ free (ht);
+}
diff --git a/lib/hashtable.h b/lib/hashtable.h
new file mode 100644
index 0000000..3924518
--- /dev/null
+++ b/lib/hashtable.h
@@ -0,0 +1,61 @@
+/*
+ * hashtable.h: contains struct nlist
+ *
+ * Copyright (C) 1994, 1995 Graeme W. Wilford. (Wilf.)
+ * Copyright (C) 2002, 2003, 2004, 2005, 2007, 2009 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Sat Aug 20 15:01:02 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#ifndef _HASHTABLE_H
+#define _HASHTABLE_H
+
+typedef void (*hashtable_free_ptr) (void *defn);
+
+struct hashtable {
+ struct nlist **hashtab; /* the storage array */
+ int unique; /* unique hash values */
+ int identical; /* identical hash values */
+ hashtable_free_ptr free_defn; /* function to free a hash entry */
+};
+
+struct nlist {
+ struct nlist *next; /* next in the chain */
+ char *name; /* the _name_ */
+ void *defn; /* the _definition_ */
+};
+
+struct hashtable_iter;
+
+extern void null_hashtable_free (void *defn);
+
+extern struct hashtable *hashtable_create (hashtable_free_ptr free_defn);
+extern struct nlist *hashtable_lookup_structure (const struct hashtable *ht,
+ const char *s, size_t len);
+extern void *hashtable_lookup (const struct hashtable *ht,
+ const char *s, size_t len);
+extern struct nlist *hashtable_install (struct hashtable *ht,
+ const char *name, size_t len,
+ void *defn);
+extern struct nlist *hashtable_iterate (const struct hashtable *ht,
+ struct hashtable_iter **iterp);
+extern void hashtable_remove (struct hashtable *ht, const char *s, size_t len);
+extern void hashtable_free (struct hashtable *ht);
+
+#endif /* _HASHTABLE_H */
diff --git a/lib/linelength.c b/lib/linelength.c
new file mode 100644
index 0000000..69a702f
--- /dev/null
+++ b/lib/linelength.c
@@ -0,0 +1,108 @@
+/*
+ * linelength.c: find the terminal line length
+ * Preferences: 1. MANWIDTH, 2. COLUMNS, 3. ioctl, 4. 80
+ *
+ * Originally adapted from Andries Brouwer's man implementation, also
+ * released under the GPL: authors believed to include Martin Schulze and
+ * Jon Tombs, dated 1995/09/02.
+ *
+ * Changes for man-db copyright (C) 2001, 2003, 2007 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <termios.h>
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#ifndef _PATH_TTY
+# define _PATH_TTY "/dev/tty"
+#endif /* _PATH_TTY */
+
+static int line_length = -1;
+
+int get_line_length (void)
+{
+ const char *columns;
+ int width;
+#ifdef TIOCGWINSZ
+ int dev_tty, tty_fd = -1;
+#endif
+
+ if (line_length != -1)
+ return line_length;
+
+ line_length = 80;
+
+ columns = getenv ("MANWIDTH");
+ if (columns != NULL) {
+ width = atoi (columns);
+ if (width > 0)
+ return line_length = width;
+ }
+
+ columns = getenv ("COLUMNS");
+ if (columns != NULL) {
+ width = atoi (columns);
+ if (width > 0)
+ return line_length = width;
+ }
+
+#ifdef TIOCGWINSZ
+ /* Original TIOCGWINSZ approach was from Jon Tombs.
+ * We don't require both stdin and stdout to be a tty, and line
+ * length is primarily a property of output. However, if it happens
+ * that stdin is connected to a terminal but stdout isn't, then that
+ * may well be because the user is trying something like
+ * 'MAN_KEEP_STDERR=1 man foo >/dev/null' to see just the error
+ * messages, so use the window size from stdin as a fallback.
+ * In some cases we may have neither (e.g. if man is running inside
+ * lesspipe); /dev/tty should be a reliable way to get to the
+ * current tty if it exists.
+ */
+ dev_tty = open (_PATH_TTY, O_RDONLY);
+ if (dev_tty >= 0)
+ tty_fd = dev_tty;
+ else if (isatty (STDOUT_FILENO))
+ tty_fd = STDOUT_FILENO;
+ else if (isatty (STDIN_FILENO))
+ tty_fd = STDIN_FILENO;
+ if (tty_fd >= 0) {
+ int ret;
+ struct winsize wsz;
+
+ ret = ioctl (tty_fd, TIOCGWINSZ, &wsz);
+ if (dev_tty >= 0)
+ close (dev_tty);
+ if (ret)
+ perror ("TIOCGWINSZ failed");
+ else if (wsz.ws_col)
+ return line_length = wsz.ws_col;
+ }
+#endif
+
+ return line_length = 80;
+}
diff --git a/lib/linelength.h b/lib/linelength.h
new file mode 100644
index 0000000..49d958f
--- /dev/null
+++ b/lib/linelength.h
@@ -0,0 +1,23 @@
+/*
+ * linelength.h: interface to find the terminal line length
+ *
+ * Copyright (C) 2007 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+int get_line_length (void);
diff --git a/lib/lower.c b/lib/lower.c
new file mode 100644
index 0000000..e620fb7
--- /dev/null
+++ b/lib/lower.c
@@ -0,0 +1,47 @@
+/*
+ * lower.c: return lower-case copy of a string
+ *
+ * Copyright (C) 1994, 1995 Graeme W. Wilford. (Wilf.)
+ * Copyright (C) 2003, 2008 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <string.h>
+#include <ctype.h>
+
+#include "manconfig.h"
+
+#include "lower.h"
+
+/* return lowered version of s */
+char *lower (const char *s)
+{
+ char *low, *p;
+
+ p = low = xmalloc (strlen (s) + 1);
+
+ while (*s)
+ *p++ = CTYPE (tolower, *s++);
+
+ *p = *s;
+ return low;
+}
diff --git a/lib/lower.h b/lib/lower.h
new file mode 100644
index 0000000..571de33
--- /dev/null
+++ b/lib/lower.h
@@ -0,0 +1,24 @@
+/*
+ * lower.h: interface to return lower-case copy of a string
+ *
+ * Copyright (C) 1994, 1995 Graeme W. Wilford. (Wilf.)
+ * Copyright (C) 2003, 2008 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+char *lower (const char *s);
diff --git a/lib/orderfiles.c b/lib/orderfiles.c
new file mode 100644
index 0000000..d67f4d8
--- /dev/null
+++ b/lib/orderfiles.c
@@ -0,0 +1,164 @@
+/*
+ * orderfiles.c: order file accesses to optimise disk load
+ *
+ * Copyright (C) 2014 Colin Watson.
+ *
+ * Inspired by and loosely based on dpkg/src/filesdb.c, which is:
+ * Copyright (C) 1995 Ian Jackson <ian@chiark.greenend.org.uk>
+ * Copyright (C) 2000,2001 Wichert Akkerman <wakkerma@debian.org>
+ * Copyright (C) 2008-2014 Guillem Jover <guillem@debian.org>
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#ifdef HAVE_LINUX_FIEMAP_H
+# include <linux/fiemap.h>
+# include <linux/fs.h>
+# include <sys/ioctl.h>
+# include <sys/vfs.h>
+#endif /* HAVE_LINUX_FIEMAP_H */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "manconfig.h"
+
+#include "hashtable.h"
+
+struct hashtable *physical_offsets = NULL;
+
+#if defined(HAVE_LINUX_FIEMAP_H)
+int compare_physical_offsets (const void *a, const void *b)
+{
+ const char *left = *(const char **) a;
+ const char *right = *(const char **) b;
+ uint64_t *left_offset_p = hashtable_lookup (physical_offsets,
+ left, strlen (left));
+ uint64_t *right_offset_p = hashtable_lookup (physical_offsets,
+ right, strlen (right));
+ uint64_t left_offset = left_offset_p ? *left_offset_p : UINT64_MAX;
+ uint64_t right_offset = right_offset_p ? *right_offset_p : UINT64_MAX;
+
+ if (left_offset < right_offset)
+ return -1;
+ else if (left_offset > right_offset)
+ return 1;
+ else
+ return 0;
+}
+
+void order_files (const char *dir, char **basenames, size_t n_basenames)
+{
+ int dir_fd_open_flags;
+ int dir_fd;
+ struct statfs fs;
+ size_t i;
+
+ dir_fd_open_flags = O_SEARCH | O_DIRECTORY;
+#ifdef O_PATH
+ dir_fd_open_flags |= O_PATH;
+#endif
+ dir_fd = open (dir, dir_fd_open_flags);
+ if (dir_fd < 0)
+ return;
+
+ if (fstatfs (dir_fd, &fs) < 0) {
+ close (dir_fd);
+ return;
+ }
+
+ /* Sort files by the physical locations of their first blocks, in an
+ * attempt to minimise disk drive head movements. This assumes that
+ * files are small enough that they are likely to be in one block or
+ * a small number of contiguous blocks, which seems a reasonable
+ * assumption for manual pages.
+ */
+ physical_offsets = hashtable_create (&free);
+ for (i = 0; i < n_basenames; ++i) {
+ struct {
+ struct fiemap fiemap;
+ struct fiemap_extent extent;
+ } fm;
+ int fd;
+
+ fd = openat (dir_fd, basenames[i], O_RDONLY);
+ if (fd < 0)
+ continue;
+
+ memset (&fm, 0, sizeof (fm));
+ fm.fiemap.fm_start = 0;
+ fm.fiemap.fm_length = fs.f_bsize;
+ fm.fiemap.fm_flags = 0;
+ fm.fiemap.fm_extent_count = 1;
+
+ if (ioctl (fd, FS_IOC_FIEMAP, (unsigned long) &fm) == 0) {
+ uint64_t *offset = XMALLOC (uint64_t);
+ *offset = fm.fiemap.fm_extents[0].fe_physical;
+ hashtable_install (physical_offsets, basenames[i],
+ strlen (basenames[i]), offset);
+ }
+
+ close (fd);
+ }
+ qsort (basenames, n_basenames, sizeof *basenames,
+ compare_physical_offsets);
+ hashtable_free (physical_offsets);
+ physical_offsets = NULL;
+ close (dir_fd);
+}
+#elif defined(HAVE_POSIX_FADVISE)
+void order_files (const char *dir, char **basenames, size_t n_basenames)
+{
+ int dir_fd_open_flags;
+ int dir_fd;
+ size_t i;
+
+ dir_fd_open_flags = O_SEARCH | O_DIRECTORY;
+#ifdef O_PATH
+ dir_fd_open_flags |= O_PATH;
+#endif
+ dir_fd = open (dir, dir_fd_open_flags);
+ if (dir_fd < 0)
+ return;
+
+ /* While we can't actually order the files, we can at least ask the
+ * kernel to preload them.
+ */
+ for (i = 0; i < n_basenames; ++i) {
+ int fd = openat (dir_fd, basenames[i], O_RDONLY | O_NONBLOCK);
+ if (fd >= 0) {
+ posix_fadvise (fd, 0, 0, POSIX_FADV_WILLNEED);
+ close (fd);
+ }
+ }
+
+ close (dir_fd);
+}
+#else
+void order_files (const char *dir, char **basenames, size_t n_basenames)
+{
+}
+#endif
diff --git a/lib/orderfiles.h b/lib/orderfiles.h
new file mode 100644
index 0000000..b4e6689
--- /dev/null
+++ b/lib/orderfiles.h
@@ -0,0 +1,23 @@
+/*
+ * orderfiles.h: interface to ordering file accesses to optimise disk load
+ *
+ * Copyright (C) 2014 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+void order_files (const char *dir, char **basenames, size_t n_basenames);
diff --git a/lib/pathsearch.c b/lib/pathsearch.c
new file mode 100644
index 0000000..402f7d1
--- /dev/null
+++ b/lib/pathsearch.c
@@ -0,0 +1,130 @@
+/*
+ * pathsearch.c: $PATH-searching functions.
+ *
+ * Copyright (C) 2004, 2007, 2008, 2009, 2011 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <string.h>
+#include <stdlib.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include "xgetcwd.h"
+#include "xvasprintf.h"
+
+#include "manconfig.h"
+#include "pathsearch.h"
+
+static int pathsearch (const char *name, const mode_t bits)
+{
+ char *cwd = NULL;
+ char *path = getenv ("PATH");
+ char *pathtok;
+ const char *element;
+ struct stat st;
+ int ret = 0;
+
+ if (!path)
+ /* Eh? Oh well. */
+ return 0;
+
+ if (strchr (name, '/')) {
+ /* Qualified name; look directly. */
+ if (stat (name, &st) == -1)
+ return 0;
+ if (S_ISREG (st.st_mode) && (st.st_mode & bits))
+ return 1;
+ return 0;
+ }
+
+ pathtok = path = xstrdup (path);
+
+ /* Unqualified name; iterate over $PATH looking for it. */
+ for (element = strsep (&pathtok, ":"); element;
+ element = strsep (&pathtok, ":")) {
+ char *filename;
+
+ if (!*element) {
+ if (!cwd)
+ cwd = xgetcwd ();
+ element = cwd;
+ }
+
+ filename = xasprintf ("%s/%s", element, name);
+ if (stat (filename, &st) == -1) {
+ free (filename);
+ continue;
+ }
+
+ free (filename);
+
+ if (S_ISREG (st.st_mode) && (st.st_mode & bits)) {
+ ret = 1;
+ break;
+ }
+ }
+
+ free (path);
+ free (cwd);
+ return ret;
+}
+
+int pathsearch_executable (const char *name)
+{
+ return pathsearch (name, 0111);
+}
+
+int directory_on_path (const char *dir)
+{
+ char *cwd = NULL;
+ char *path = getenv ("PATH");
+ char *pathtok;
+ const char *element;
+ int ret = 0;
+
+ if (!path)
+ /* Eh? Oh well. */
+ return 0;
+
+ pathtok = path = xstrdup (path);
+
+ for (element = strsep (&pathtok, ":"); element;
+ element = strsep (&pathtok, ":")) {
+ if (!*element) {
+ if (!cwd)
+ cwd = xgetcwd ();
+ element = cwd;
+ }
+
+ if (STREQ (element, dir)) {
+ ret = 1;
+ break;
+ }
+ }
+
+ free (path);
+ free (cwd);
+ return ret;
+}
diff --git a/lib/pathsearch.h b/lib/pathsearch.h
new file mode 100644
index 0000000..970fbee
--- /dev/null
+++ b/lib/pathsearch.h
@@ -0,0 +1,34 @@
+/*
+ * pathsearch.h: interface to $PATH-searching functions
+ *
+ * Copyright (C) 2004 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+#ifndef PATHSEARCH_H
+#define PATHSEARCH_H
+
+/* Return non-zero if NAME is found as an executable regular file on the
+ * $PATH.
+ */
+int pathsearch_executable (const char *name);
+
+/* Return non-zero if DIR matches an entry on the $PATH. */
+int directory_on_path (const char *dir);
+
+#endif /* PATHSEARCH_H */
diff --git a/lib/sandbox.c b/lib/sandbox.c
new file mode 100644
index 0000000..c097482
--- /dev/null
+++ b/lib/sandbox.c
@@ -0,0 +1,636 @@
+/*
+ * sandbox.c: Process sandboxing
+ *
+ * Copyright (C) 2017 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Some of the syscall lists in this file come from systemd, whose
+ * copyright/licensing statement is as follows. Per LGPLv2.1 s. 3, I have
+ * altered the original references to LGPLv2.1 to refer to GPLv2 instead.
+ *
+ * Copyright 2014 Lennart Poettering
+ *
+ * systemd is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * systemd is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with systemd; If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#ifdef HAVE_LIBSECCOMP
+# include <sys/ioctl.h>
+# include <sys/ipc.h>
+# include <sys/mman.h>
+# include <sys/prctl.h>
+# include <sys/shm.h>
+# include <sys/socket.h>
+# include <termios.h>
+# include <seccomp.h>
+#endif /* HAVE_LIBSECCOMP */
+
+#include "manconfig.h"
+
+#include "error.h"
+
+#include "sandbox.h"
+
+struct man_sandbox {
+#ifdef HAVE_LIBSECCOMP
+ scmp_filter_ctx ctx;
+ scmp_filter_ctx permissive_ctx;
+#else /* !HAVE_LIBSECCOMP */
+ char dummy;
+#endif /* HAVE_LIBSECCOMP */
+};
+
+#ifdef HAVE_LIBSECCOMP
+static int seccomp_filter_unavailable = 0;
+
+static void gripe_seccomp_filter_unavailable (void)
+{
+ debug ("seccomp filtering requires a kernel configured with "
+ "CONFIG_SECCOMP_FILTER\n");
+}
+
+static int search_ld_preload (const char *needle)
+{
+ const char *ld_preload_env;
+ static char *ld_preload_file = NULL;
+
+ ld_preload_env = getenv ("LD_PRELOAD");
+ if (ld_preload_env && strstr (ld_preload_env, needle) != NULL)
+ return 1;
+
+ if (!ld_preload_file) {
+ int fd;
+ struct stat st;
+ char *mapped = NULL;
+
+ fd = open ("/etc/ld.so.preload", O_RDONLY);
+ if (fd >= 0 && fstat (fd, &st) >= 0 && st.st_size)
+ mapped = mmap (NULL, st.st_size, PROT_READ,
+ MAP_PRIVATE | MAP_FILE, fd, 0);
+ if (mapped) {
+ ld_preload_file = xstrndup (mapped, st.st_size);
+ munmap (mapped, st.st_size);
+ } else
+ ld_preload_file = xstrdup ("");
+ if (fd >= 0)
+ close (fd);
+ }
+ /* This isn't very accurate: /etc/ld.so.preload may contain
+ * comments. On the other hand, glibc says "it should only be used
+ * for emergencies and testing". File a bug if this is a problem
+ * for you.
+ */
+ if (strstr (ld_preload_file, needle) != NULL)
+ return 1;
+
+ return 0;
+}
+
+/* Can we load a seccomp filter into this process?
+ *
+ * This guard allows us to call sandbox_load in code paths that may
+ * conditionally do so again.
+ */
+static int can_load_seccomp (void)
+{
+ const char *man_disable_seccomp;
+ int seccomp_status;
+
+ if (seccomp_filter_unavailable) {
+ gripe_seccomp_filter_unavailable ();
+ return 0;
+ }
+
+ man_disable_seccomp = getenv ("MAN_DISABLE_SECCOMP");
+ if (man_disable_seccomp && *man_disable_seccomp) {
+ debug ("seccomp filter disabled by user request\n");
+ return 0;
+ }
+
+ /* Valgrind causes the child process to make some system calls we
+ * don't want to allow in general, so disable seccomp when running
+ * on Valgrind.
+ *
+ * The correct approach seems to be to either require valgrind.h at
+ * build-time or copy valgrind.h into this project and then use the
+ * RUNNING_ON_VALGRIND macro, but I'd really rather not add a
+ * build-dependency for this or take a copy of a >6000-line header
+ * file. Since the goal of this is only to disable the seccomp
+ * filter under Valgrind, this will do for now.
+ */
+ if (search_ld_preload ("/vgpreload")) {
+ debug ("seccomp filter disabled while running under "
+ "Valgrind\n");
+ return 0;
+ }
+
+ seccomp_status = prctl (PR_GET_SECCOMP);
+
+ if (seccomp_status == 0)
+ return 1;
+
+ if (seccomp_status == -1) {
+ if (errno == EINVAL)
+ debug ("running kernel does not support seccomp\n");
+ else
+ debug ("unknown error getting seccomp status: %s\n",
+ strerror (errno));
+ } else if (seccomp_status == 2)
+ debug ("seccomp already enabled\n");
+ else
+ debug ("unknown return value from PR_GET_SECCOMP: %d\n",
+ seccomp_status);
+ return 0;
+}
+#endif /* HAVE_LIBSECCOMP */
+
+#ifdef HAVE_LIBSECCOMP
+
+#define SC_ALLOW(name) \
+ do { \
+ int nr = seccomp_syscall_resolve_name (name); \
+ if (nr == __NR_SCMP_ERROR) \
+ break; \
+ if (seccomp_rule_add (ctx, SCMP_ACT_ALLOW, nr, 0) < 0) \
+ error (FATAL, errno, "can't add seccomp rule"); \
+ } while (0)
+
+#define SC_ALLOW_ARG_1(name, cmp1) \
+ do { \
+ int nr = seccomp_syscall_resolve_name (name); \
+ if (nr == __NR_SCMP_ERROR) \
+ break; \
+ if (seccomp_rule_add (ctx, SCMP_ACT_ALLOW, nr, 1, cmp1) < 0) \
+ error (FATAL, errno, "can't add seccomp rule"); \
+ } while (0)
+
+#define SC_ALLOW_ARG_2(name, cmp1, cmp2) \
+ do { \
+ int nr = seccomp_syscall_resolve_name (name); \
+ if (nr == __NR_SCMP_ERROR) \
+ break; \
+ if (seccomp_rule_add (ctx, SCMP_ACT_ALLOW, nr, \
+ 2, cmp1, cmp2) < 0) \
+ error (FATAL, errno, "can't add seccomp rule"); \
+ } while (0)
+
+/* Create a seccomp filter.
+ *
+ * If permissive is true, then the returned filter will allow limited file
+ * creation (although not making executable files). This obviously
+ * constitutes less effective confinement, but it's necessary for some
+ * subprocesses (such as groff) that need the ability to write to temporary
+ * files. Confining these further requires additional tools that can do
+ * path-based filtering or similar, such as AppArmor.
+ */
+static scmp_filter_ctx make_seccomp_filter (int permissive)
+{
+ scmp_filter_ctx ctx;
+ mode_t mode_mask = S_ISUID | S_ISGID | S_IXUSR | S_IXGRP | S_IXOTH;
+ int create_mask = O_CREAT
+#ifdef O_TMPFILE
+ | O_TMPFILE
+#endif /* O_TMPFILE */
+ ;
+
+ debug ("initialising seccomp filter (permissive: %d)\n", permissive);
+ ctx = seccomp_init (SCMP_ACT_TRAP);
+ if (!ctx)
+ error (FATAL, errno, "can't initialise seccomp filter");
+
+ /* Allow sibling architectures for x86, since people sometimes mix
+ * and match architectures there for performance reasons.
+ */
+ switch (seccomp_arch_native ()) {
+ case SCMP_ARCH_X86:
+ seccomp_arch_add (ctx, SCMP_ARCH_X86_64);
+ seccomp_arch_add (ctx, SCMP_ARCH_X32);
+ break;
+ case SCMP_ARCH_X86_64:
+ seccomp_arch_add (ctx, SCMP_ARCH_X86);
+ seccomp_arch_add (ctx, SCMP_ARCH_X32);
+ break;
+ case SCMP_ARCH_X32:
+ seccomp_arch_add (ctx, SCMP_ARCH_X86);
+ seccomp_arch_add (ctx, SCMP_ARCH_X86_64);
+ break;
+ }
+
+ /* This sandbox is intended to allow operations that might
+ * reasonably be needed in simple data-transforming pipes: it should
+ * allow the process to do most reasonable things to itself, to read
+ * and write data from and to already-open file descriptors, to open
+ * files in read-only mode, and to fork new processes with the same
+ * restrictions. (If permissive is true, then it should also allow
+ * limited file creation; see the header comment above.)
+ *
+ * Since I currently know of no library with suitable syscall lists,
+ * the syscall lists here are taken from
+ * systemd:src/shared/seccomp-util.c, last updated from commit
+ * 67eb5b380a7b7eed82f658190bff4ca2d83e9abe (2017-11-30).
+ */
+
+ /* systemd: SystemCallFilter=@default */
+ SC_ALLOW ("clock_getres");
+ SC_ALLOW ("clock_gettime");
+ SC_ALLOW ("clock_nanosleep");
+ SC_ALLOW ("execve");
+ SC_ALLOW ("exit");
+ SC_ALLOW ("exit_group");
+ SC_ALLOW ("futex");
+ SC_ALLOW ("get_robust_list");
+ SC_ALLOW ("get_thread_area");
+ SC_ALLOW ("getegid");
+ SC_ALLOW ("getegid32");
+ SC_ALLOW ("geteuid");
+ SC_ALLOW ("geteuid32");
+ SC_ALLOW ("getgid");
+ SC_ALLOW ("getgid32");
+ SC_ALLOW ("getgroups");
+ SC_ALLOW ("getgroups32");
+ SC_ALLOW ("getpgid");
+ SC_ALLOW ("getpgrp");
+ SC_ALLOW ("getpid");
+ SC_ALLOW ("getppid");
+ SC_ALLOW ("getresgid");
+ SC_ALLOW ("getresgid32");
+ SC_ALLOW ("getresuid");
+ SC_ALLOW ("getresuid32");
+ SC_ALLOW ("getrlimit");
+ SC_ALLOW ("getsid");
+ SC_ALLOW ("gettid");
+ SC_ALLOW ("gettimeofday");
+ SC_ALLOW ("getuid");
+ SC_ALLOW ("getuid32");
+ SC_ALLOW ("membarrier");
+ SC_ALLOW ("nanosleep");
+ SC_ALLOW ("pause");
+ SC_ALLOW ("prlimit64");
+ SC_ALLOW ("restart_syscall");
+ SC_ALLOW ("rt_sigreturn");
+ SC_ALLOW ("sched_yield");
+ SC_ALLOW ("set_robust_list");
+ SC_ALLOW ("set_thread_area");
+ SC_ALLOW ("set_tid_address");
+ SC_ALLOW ("set_tls");
+ SC_ALLOW ("sigreturn");
+ SC_ALLOW ("time");
+ SC_ALLOW ("ugetrlimit");
+
+ /* systemd: SystemCallFilter=@basic-io */
+ SC_ALLOW ("_llseek");
+ SC_ALLOW ("close");
+ SC_ALLOW ("dup");
+ SC_ALLOW ("dup2");
+ SC_ALLOW ("dup3");
+ SC_ALLOW ("lseek");
+ SC_ALLOW ("pread64");
+ SC_ALLOW ("preadv");
+ SC_ALLOW ("preadv2");
+ SC_ALLOW ("pwrite64");
+ SC_ALLOW ("pwritev");
+ SC_ALLOW ("pwritev2");
+ SC_ALLOW ("read");
+ SC_ALLOW ("readv");
+ SC_ALLOW ("write");
+ SC_ALLOW ("writev");
+
+ /* systemd: SystemCallFilter=@file-system (subset) */
+ SC_ALLOW ("access");
+ SC_ALLOW ("chdir");
+ if (permissive) {
+ SC_ALLOW_ARG_1 ("chmod",
+ SCMP_A1 (SCMP_CMP_MASKED_EQ, mode_mask, 0));
+ SC_ALLOW_ARG_1 ("creat",
+ SCMP_A1 (SCMP_CMP_MASKED_EQ, mode_mask, 0));
+ }
+ SC_ALLOW ("faccessat");
+ SC_ALLOW ("fallocate");
+ SC_ALLOW ("fchdir");
+ if (permissive) {
+ SC_ALLOW_ARG_1 ("fchmod",
+ SCMP_A1 (SCMP_CMP_MASKED_EQ, mode_mask, 0));
+ SC_ALLOW_ARG_1 ("fchmodat",
+ SCMP_A2 (SCMP_CMP_MASKED_EQ, mode_mask, 0));
+ }
+ SC_ALLOW ("fcntl");
+ SC_ALLOW ("fcntl64");
+ SC_ALLOW ("fstat");
+ SC_ALLOW ("fstat64");
+ SC_ALLOW ("fstatat64");
+ SC_ALLOW ("fstatfs");
+ SC_ALLOW ("fstatfs64");
+ SC_ALLOW ("ftruncate");
+ SC_ALLOW ("ftruncate64");
+ if (permissive) SC_ALLOW ("futimesat");
+ SC_ALLOW ("getcwd");
+ SC_ALLOW ("getdents");
+ SC_ALLOW ("getdents64");
+ if (permissive) SC_ALLOW ("link");
+ if (permissive) SC_ALLOW ("linkat");
+ SC_ALLOW ("lstat");
+ SC_ALLOW ("lstat64");
+ if (permissive) SC_ALLOW ("mkdir");
+ if (permissive) SC_ALLOW ("mkdirat");
+ SC_ALLOW ("mmap");
+ SC_ALLOW ("mmap2");
+ SC_ALLOW ("munmap");
+ SC_ALLOW ("newfstatat");
+ SC_ALLOW ("oldfstat");
+ SC_ALLOW ("oldlstat");
+ SC_ALLOW ("oldstat");
+ if (permissive) {
+ SC_ALLOW_ARG_2 ("open",
+ SCMP_A1 (SCMP_CMP_MASKED_EQ, O_CREAT, O_CREAT),
+ SCMP_A2 (SCMP_CMP_MASKED_EQ, mode_mask, 0));
+ SC_ALLOW_ARG_2 ("openat",
+ SCMP_A2 (SCMP_CMP_MASKED_EQ, O_CREAT, O_CREAT),
+ SCMP_A3 (SCMP_CMP_MASKED_EQ, mode_mask, 0));
+#ifdef O_TMPFILE
+ SC_ALLOW_ARG_2 ("open",
+ SCMP_A1 (SCMP_CMP_MASKED_EQ,
+ O_TMPFILE, O_TMPFILE),
+ SCMP_A2 (SCMP_CMP_MASKED_EQ, mode_mask, 0));
+ SC_ALLOW_ARG_2 ("openat",
+ SCMP_A2 (SCMP_CMP_MASKED_EQ,
+ O_TMPFILE, O_TMPFILE),
+ SCMP_A3 (SCMP_CMP_MASKED_EQ, mode_mask, 0));
+#endif /* O_TMPFILE */
+ SC_ALLOW_ARG_1 ("open",
+ SCMP_A1 (SCMP_CMP_MASKED_EQ, create_mask, 0));
+ SC_ALLOW_ARG_1 ("openat",
+ SCMP_A2 (SCMP_CMP_MASKED_EQ, create_mask, 0));
+ } else {
+ SC_ALLOW_ARG_1 ("open",
+ SCMP_A1 (SCMP_CMP_MASKED_EQ, O_ACCMODE,
+ O_RDONLY));
+ SC_ALLOW_ARG_1 ("openat",
+ SCMP_A2 (SCMP_CMP_MASKED_EQ, O_ACCMODE,
+ O_RDONLY));
+ }
+ SC_ALLOW ("readlink");
+ SC_ALLOW ("readlinkat");
+ if (permissive) SC_ALLOW ("rename");
+ if (permissive) SC_ALLOW ("renameat");
+ if (permissive) SC_ALLOW ("renameat2");
+ if (permissive) SC_ALLOW ("rmdir");
+ SC_ALLOW ("stat");
+ SC_ALLOW ("stat64");
+ SC_ALLOW ("statfs");
+ SC_ALLOW ("statfs64");
+ SC_ALLOW ("statx");
+ if (permissive) SC_ALLOW ("symlink");
+ if (permissive) SC_ALLOW ("symlinkat");
+ if (permissive) SC_ALLOW ("truncate");
+ if (permissive) SC_ALLOW ("truncateat");
+ if (permissive) SC_ALLOW ("unlink");
+ if (permissive) SC_ALLOW ("unlinkat");
+ if (permissive) SC_ALLOW ("utime");
+ if (permissive) SC_ALLOW ("utimensat");
+ if (permissive) SC_ALLOW ("utimes");
+
+ /* systemd: SystemCallFilter=@io-event */
+ SC_ALLOW ("_newselect");
+ SC_ALLOW ("epoll_create");
+ SC_ALLOW ("epoll_create1");
+ SC_ALLOW ("epoll_ctl");
+ SC_ALLOW ("epoll_ctl_old");
+ SC_ALLOW ("epoll_pwait");
+ SC_ALLOW ("epoll_wait");
+ SC_ALLOW ("epoll_wait_old");
+ SC_ALLOW ("eventfd");
+ SC_ALLOW ("eventfd2");
+ SC_ALLOW ("poll");
+ SC_ALLOW ("ppoll");
+ SC_ALLOW ("pselect6");
+ SC_ALLOW ("select");
+
+ /* systemd: SystemCallFilter=@ipc (subset) */
+ SC_ALLOW ("pipe");
+ SC_ALLOW ("pipe2");
+
+ /* systemd: SystemCallFilter=@process (subset) */
+ SC_ALLOW ("arch_prctl");
+ SC_ALLOW ("capget");
+ SC_ALLOW ("clone");
+ SC_ALLOW ("execveat");
+ SC_ALLOW ("fork");
+ SC_ALLOW ("getrusage");
+ SC_ALLOW ("prctl");
+ SC_ALLOW ("vfork");
+ SC_ALLOW ("wait4");
+ SC_ALLOW ("waitid");
+ SC_ALLOW ("waitpid");
+
+ /* systemd: SystemCallFilter=@signal */
+ SC_ALLOW ("rt_sigaction");
+ SC_ALLOW ("rt_sigpending");
+ SC_ALLOW ("rt_sigprocmask");
+ SC_ALLOW ("rt_sigsuspend");
+ SC_ALLOW ("rt_sigtimedwait");
+ SC_ALLOW ("sigaction");
+ SC_ALLOW ("sigaltstack");
+ SC_ALLOW ("signal");
+ SC_ALLOW ("signalfd");
+ SC_ALLOW ("signalfd4");
+ SC_ALLOW ("sigpending");
+ SC_ALLOW ("sigprocmask");
+ SC_ALLOW ("sigsuspend");
+
+ /* systemd: SystemCallFilter=@sync */
+ SC_ALLOW ("fdatasync");
+ SC_ALLOW ("fsync");
+ SC_ALLOW ("msync");
+ SC_ALLOW ("sync");
+ SC_ALLOW ("sync_file_range");
+ SC_ALLOW ("syncfs");
+
+ /* Extra syscalls not in any of systemd's sets. */
+ SC_ALLOW ("arm_fadvise64_64");
+ SC_ALLOW ("arm_sync_file_range");
+ SC_ALLOW ("brk");
+ SC_ALLOW ("fadvise64");
+ SC_ALLOW ("fadvise64_64");
+ if (permissive)
+ SC_ALLOW ("ioctl");
+ else {
+ SC_ALLOW_ARG_1 ("ioctl", SCMP_A1 (SCMP_CMP_EQ, TCGETS));
+ SC_ALLOW_ARG_1 ("ioctl", SCMP_A1 (SCMP_CMP_EQ, TIOCGWINSZ));
+ }
+ SC_ALLOW ("madvise");
+ SC_ALLOW ("mprotect");
+ SC_ALLOW ("mremap");
+ SC_ALLOW ("sched_getaffinity");
+ SC_ALLOW ("sync_file_range2");
+ SC_ALLOW ("sysinfo");
+ SC_ALLOW ("uname");
+
+ /* Allow killing processes and threads. This is unfortunate but
+ * unavoidable: groff uses kill to explicitly pass on SIGPIPE to its
+ * child processes, and we can't do any more sophisticated filtering
+ * in seccomp.
+ */
+ SC_ALLOW ("kill");
+ SC_ALLOW ("tgkill");
+
+ /* Allow some relatively harmless System V shared memory operations.
+ * These seem to be popular among the sort of program that wants to
+ * install itself in /etc/ld.so.preload or similar (e.g. antivirus
+ * programs and VPNs).
+ */
+ SC_ALLOW_ARG_1 ("shmat", SCMP_A2 (SCMP_CMP_EQ, SHM_RDONLY));
+ SC_ALLOW_ARG_1 ("shmctl", SCMP_A1 (SCMP_CMP_EQ, IPC_STAT));
+ SC_ALLOW ("shmdt");
+ SC_ALLOW ("shmget");
+
+ /* Some antivirus programs use an LD_PRELOAD wrapper that wants to
+ * talk to a private daemon using a Unix-domain socket. We really
+ * don't want to allow these syscalls in general, but if such a
+ * thing is in use we probably have no choice.
+ *
+ * snoopy is an execve monitoring tool that may log messages to
+ * /dev/log.
+ */
+ if (search_ld_preload ("libesets_pac.so") ||
+ search_ld_preload ("libscep_pac.so") ||
+ search_ld_preload ("libsnoopy.so")) {
+ SC_ALLOW ("connect");
+ SC_ALLOW ("recvmsg");
+ SC_ALLOW ("sendto");
+ SC_ALLOW ("setsockopt");
+ SC_ALLOW_ARG_1 ("socket", SCMP_A0 (SCMP_CMP_EQ, AF_UNIX));
+ }
+ /* ESET sends messages to a System V message queue. */
+ if (search_ld_preload ("libesets_pac.so") ||
+ search_ld_preload ("libscep_pac.so")) {
+ SC_ALLOW_ARG_1 ("msgget", SCMP_A1 (SCMP_CMP_EQ, 0));
+ SC_ALLOW ("msgsnd");
+ }
+
+ return ctx;
+}
+
+#undef SC_ALLOW_ARG_2
+#undef SC_ALLOW_ARG_1
+#undef SC_ALLOW
+
+#endif /* HAVE_LIBSECCOMP */
+
+/* Create a sandbox for processing untrusted data.
+ *
+ * This only sets up data structures; the caller must call sandbox_load to
+ * actually enter the sandbox.
+ */
+man_sandbox *sandbox_init (void)
+{
+ man_sandbox *sandbox = XZALLOC (man_sandbox);
+
+#ifdef HAVE_LIBSECCOMP
+ sandbox->ctx = make_seccomp_filter (0);
+ sandbox->permissive_ctx = make_seccomp_filter (1);
+#else /* !HAVE_LIBSECCOMP */
+ sandbox->dummy = 0;
+#endif /* HAVE_LIBSECCOMP */
+
+ return sandbox;
+}
+
+static void _sandbox_load (man_sandbox *sandbox, int permissive) {
+#ifdef HAVE_LIBSECCOMP
+ if (can_load_seccomp ()) {
+ scmp_filter_ctx ctx;
+
+ debug ("loading seccomp filter (permissive: %d)\n",
+ permissive);
+ if (permissive)
+ ctx = sandbox->permissive_ctx;
+ else
+ ctx = sandbox->ctx;
+ if (seccomp_load (ctx) < 0) {
+ if (errno == EINVAL || errno == EFAULT) {
+ /* The kernel doesn't give us particularly
+ * fine-grained errors. EINVAL could in
+ * theory be an invalid BPF program, but
+ * it's much more likely that the running
+ * kernel doesn't support seccomp filtering.
+ * EFAULT normally means a programming
+ * error, but it could also be returned here
+ * by some versions of qemu-user
+ * (https://bugs.launchpad.net/bugs/1726394).
+ */
+ gripe_seccomp_filter_unavailable ();
+ /* Don't try this again. */
+ seccomp_filter_unavailable = 1;
+ } else
+ error (FATAL, errno,
+ "can't load seccomp filter");
+ }
+ }
+#endif /* HAVE_LIBSECCOMP */
+}
+
+/* Enter a sandbox for processing untrusted data. */
+void sandbox_load (void *data)
+{
+ man_sandbox *sandbox = data;
+
+ _sandbox_load (sandbox, 0);
+}
+
+/* Enter a sandbox for processing untrusted data, allowing limited file
+ * creation.
+ */
+void sandbox_load_permissive (void *data)
+{
+ man_sandbox *sandbox = data;
+
+ _sandbox_load (sandbox, 1);
+}
+
+/* Free a sandbox for processing untrusted data. */
+void sandbox_free (void *data) {
+ man_sandbox *sandbox = data;
+
+#ifdef HAVE_LIBSECCOMP
+ seccomp_release (sandbox->ctx);
+#endif /* HAVE_LIBSECCOMP */
+
+ free (sandbox);
+}
diff --git a/lib/sandbox.h b/lib/sandbox.h
new file mode 100644
index 0000000..a838e0e
--- /dev/null
+++ b/lib/sandbox.h
@@ -0,0 +1,38 @@
+/*
+ * sandbox.h: Interface to process sandboxing
+ *
+ * Copyright (C) 2017 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef MAN_SANDBOX_H
+#define MAN_SANDBOX_H
+
+struct man_sandbox;
+typedef struct man_sandbox man_sandbox;
+
+extern man_sandbox *sandbox_init (void);
+
+/* These functions take a man_sandbox * argument, but have more generic
+ * types suitable for use with pipecmd_pre_exec.
+ */
+extern void sandbox_load (void *data);
+extern void sandbox_load_permissive (void *data);
+extern void sandbox_free (void *data);
+
+#endif /* MAN_SANDBOX_H */
diff --git a/lib/security.c b/lib/security.c
new file mode 100644
index 0000000..e739d50
--- /dev/null
+++ b/lib/security.c
@@ -0,0 +1,177 @@
+/*
+ * security.c: Routines to aid secure uid operations
+ *
+ * Copyright (C) 1994, 1995 Graeme W. Wilford. (Wilf.)
+ * Copyright (C) 2001, 2003, 2004, 2007, 2010, 2011 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Mon Aug 8 20:35:30 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <assert.h>
+#include <errno.h>
+#include <sys/types.h>
+
+#include "gettext.h"
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+
+#include "error.h"
+#include "cleanup.h"
+#include "pipeline.h"
+
+#include "security.h"
+
+#ifdef MAN_OWNER
+
+ /*
+ * This is the name of the user that the preformatted man pages belong to.
+ * If you are running man as a setuid program, you should make sure
+ * that all of the cat pages and the directories that
+ * they live in are writeable by this user.
+ */
+
+# include <pwd.h>
+# include <unistd.h>
+
+# include "idpriv.h"
+
+uid_t ruid; /* initial real user id */
+uid_t euid; /* initial effective user id */
+uid_t uid; /* current euid */
+gid_t rgid; /* initial real group id */
+gid_t egid; /* initial effective group id */
+gid_t gid; /* current egid */
+
+static struct passwd *man_owner;
+
+/* Keep a count of how many times we've dropped privileges, and only regain
+ * them if regain_effective_privs() is called an equal number of times.
+ */
+static int priv_drop_count = 0;
+
+static void gripe_set_euid (void)
+{
+ error (FATAL, errno, _("can't set effective uid"));
+}
+
+#endif /* MAN_OWNER */
+
+void init_security (void)
+{
+#ifdef MAN_OWNER
+ ruid = getuid ();
+ uid = euid = geteuid ();
+ debug ("ruid=%d, euid=%d\n", (int) ruid, (int) euid);
+ rgid = getgid ();
+ gid = egid = getegid ();
+ debug ("rgid=%d, egid=%d\n", (int) rgid, (int) egid);
+ priv_drop_count = 0;
+ drop_effective_privs ();
+#endif /* MAN_OWNER */
+}
+
+int running_setuid (void)
+{
+#ifdef MAN_OWNER
+ return ruid != euid;
+#else /* !MAN_OWNER */
+ return 0;
+#endif
+}
+
+#ifdef MAN_OWNER
+/* Return a pointer to the password entry structure for MAN_OWNER. This
+ * structure will be statically stored.
+ */
+struct passwd *get_man_owner (void)
+{
+ if (man_owner)
+ return man_owner;
+
+ man_owner = getpwnam (MAN_OWNER);
+ if (!man_owner)
+ error (FAIL, 0, _("the setuid man user \"%s\" does not exist"),
+ MAN_OWNER);
+ assert (man_owner);
+ return man_owner;
+}
+#endif /* MAN_OWNER */
+
+/*
+ * function to gain user privs by either (a) dropping effective privs
+ * completely (saved ids) or (b) reversing euid w/ uid.
+ * Ignore if superuser.
+ */
+void drop_effective_privs (void)
+{
+#ifdef MAN_OWNER
+ if (uid != ruid) {
+ debug ("drop_effective_privs()\n");
+ if (idpriv_temp_drop ())
+ gripe_set_euid ();
+ uid = ruid;
+ gid = rgid;
+ }
+
+ priv_drop_count++;
+ debug ("++priv_drop_count = %d\n", priv_drop_count);
+#endif /* MAN_OWNER */
+}
+
+/*
+ * function to (re)gain setuid privs by (a) setting euid from suid or (b)
+ * (re)reversing uid w/ euid. Ignore if superuser.
+ */
+void regain_effective_privs (void)
+{
+#ifdef MAN_OWNER
+ if (priv_drop_count) {
+ priv_drop_count--;
+ debug ("--priv_drop_count = %d\n", priv_drop_count);
+ if (priv_drop_count)
+ return;
+ }
+
+ if (uid != euid) {
+ debug ("regain_effective_privs()\n");
+ if (idpriv_temp_restore ())
+ gripe_set_euid ();
+
+ uid = euid;
+ gid = egid;
+ }
+#endif /* MAN_OWNER */
+}
+
+/* Pipeline command pre-exec hook to permanently drop privileges. */
+void drop_privs (void *data ATTRIBUTE_UNUSED)
+{
+#ifdef MAN_OWNER
+ if (idpriv_drop ())
+ gripe_set_euid ();
+#endif /* MAN_OWNER */
+}
diff --git a/lib/security.h b/lib/security.h
new file mode 100644
index 0000000..63ef533
--- /dev/null
+++ b/lib/security.h
@@ -0,0 +1,35 @@
+/*
+ * security.h: Interface to secure uid operations
+ *
+ * Copyright (C) 1990, 1991 John W. Eaton.
+ * Copyright (C) 1994, 1995 Graeme W. Wilford. (Wilf.)
+ * Copyright (C) 2001, 2002, 2004, 2008, 2010, 2011 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <pwd.h>
+
+/* security.c */
+extern void drop_effective_privs (void);
+extern void regain_effective_privs (void);
+extern void drop_privs (void *data);
+extern void init_security (void);
+extern int running_setuid (void);
+#ifdef MAN_OWNER
+extern struct passwd *get_man_owner (void);
+#endif /* MAN_OWNER */
diff --git a/lib/tempfile.c b/lib/tempfile.c
new file mode 100644
index 0000000..91ee0fb
--- /dev/null
+++ b/lib/tempfile.c
@@ -0,0 +1,79 @@
+/* tempfile.c: handle temporary directory creation (formerly also temporary
+ * files but this is no longer used).
+ *
+ * Copyright (C) 2001, 2003, 2007, 2009, 2011 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "xvasprintf.h"
+
+#include "manconfig.h"
+
+static const char *path_search (void)
+{
+ const char *dir = NULL;
+
+ if (getuid () == geteuid () && getgid () == getegid ()) {
+ dir = getenv ("TMPDIR");
+ if (!dir || !CAN_ACCESS (dir, W_OK))
+ dir = NULL;
+ if (!dir) {
+ dir = getenv ("TMP");
+ if (!dir || !CAN_ACCESS (dir, W_OK))
+ dir = NULL;
+ }
+ }
+#ifdef P_tmpdir
+ if (!dir) {
+ dir = P_tmpdir;
+ if (!dir || !CAN_ACCESS (dir, W_OK))
+ dir = NULL;
+ }
+#endif
+ if (!dir) {
+ dir = "/tmp";
+ if (!CAN_ACCESS (dir, W_OK))
+ dir = NULL;
+ }
+
+ return dir;
+}
+
+/* Get a sane temporary directory, looking in $TMPDIR, P_tmpdir, and finally
+ * /tmp.
+ */
+char *create_tempdir (const char *template)
+{
+ const char *dir = path_search ();
+ char *created_dirname;
+
+ if (!dir)
+ return NULL;
+ created_dirname = xasprintf ("%s/%sXXXXXX", dir, template);
+ if (!mkdtemp (created_dirname))
+ return NULL;
+ return created_dirname;
+}
diff --git a/lib/util.c b/lib/util.c
new file mode 100644
index 0000000..3f4b10f
--- /dev/null
+++ b/lib/util.c
@@ -0,0 +1,267 @@
+/*
+ * util.c
+ *
+ * Copyright (C) 1990, 1991 John W. Eaton.
+ * Copyright (C) 1994, 1995 Graeme W. Wilford. (Wilf.)
+ * Copyright (C) 2001, 2002, 2004, 2007, 2008, 2010 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * John W. Eaton
+ * jwe@che.utexas.edu
+ * Department of Chemical Engineering
+ * The University of Texas at Austin
+ * Austin, Texas 78712
+ *
+ * Wed May 4 15:44:47 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk): slight
+ * changes to all routines, mainly cosmetic.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <dirent.h>
+#include <unistd.h>
+#include <locale.h>
+
+#include "stat-time.h"
+#include "timespec.h"
+#include "xvasprintf.h"
+
+#include "gettext.h"
+
+#include "manconfig.h"
+
+#include "error.h"
+#include "pipeline.h"
+
+/*
+ * Does file a have a different timestamp to file b?
+ *
+ * case:
+ *
+ * a is man_page, b is cat_page
+ *
+ * a and b have different times returns 1/3 (ret & 1) == 1
+ * a and b have same times returns 0/2 (!(ret & 1)) == 1
+ * a is zero in length returns + 2 (for Wilf. and his stray cats)
+ * b is zero in length returns + 4
+ * stat on a fails returns -1
+ * stat on b fails returns -2
+ * stat on a and b fails returns -3
+ */
+int is_changed (const char *fa, const char *fb)
+{
+ struct stat fa_sb;
+ struct stat fb_sb;
+ int fa_stat;
+ int fb_stat;
+ int status = 0;
+
+ debug ("is_changed: a=%s, b=%s", fa, fb);
+
+ fa_stat = stat (fa, &fa_sb);
+ if (fa_stat != 0)
+ status = 1;
+
+ fb_stat = stat (fb, &fb_sb);
+ if (fb_stat != 0)
+ status |= 2;
+
+ if (status != 0) {
+ debug (" (%d)\n", -status);
+ return -status;
+ }
+
+ if (fa_sb.st_size == 0)
+ status |= 2;
+
+ if (fb_sb.st_size == 0)
+ status |= 4;
+
+ status |= (timespec_cmp (get_stat_mtime (&fa_sb),
+ get_stat_mtime (&fb_sb)) != 0);
+
+ debug (" (%d)\n", status);
+ return status;
+}
+
+/*
+ * Is path a directory?
+ */
+int is_directory (const char *path)
+{
+ struct stat sb;
+ int status;
+
+ status = stat (path, &sb);
+
+ if (status != 0)
+ return status;
+
+ return ((sb.st_mode & S_IFDIR) != 0);
+}
+
+/* Escape dangerous metacharacters before dumping into a shell command. */
+char *escape_shell (const char *unesc)
+{
+ char *esc, *escp;
+ const char *unescp;
+
+ if (!unesc)
+ return NULL;
+
+ escp = esc = xmalloc (strlen (unesc) * 2 + 1);
+ for (unescp = unesc; *unescp; unescp++)
+ if ((*unescp >= '0' && *unescp <= '9') ||
+ (*unescp >= 'A' && *unescp <= 'Z') ||
+ (*unescp >= 'a' && *unescp <= 'z') ||
+ strchr (",-./:@_", *unescp))
+ *escp++ = *unescp;
+ else {
+ *escp++ = '\\';
+ *escp++ = *unescp;
+ }
+ *escp = 0;
+ return esc;
+}
+
+/* Remove a directory and all files in it. Only recurse beyond that if
+ * RECURSE is set.
+ */
+int remove_directory (const char *directory, int recurse)
+{
+ DIR *handle = opendir (directory);
+ struct dirent *entry;
+
+ if (!handle)
+ return -1;
+ while ((entry = readdir (handle)) != NULL) {
+ struct stat st;
+ char *path;
+
+ if (STREQ (entry->d_name, ".") || STREQ (entry->d_name, ".."))
+ continue;
+ path = xasprintf ("%s/%s", directory, entry->d_name);
+ if (stat (path, &st) == -1) {
+ free (path);
+ closedir (handle);
+ return -1;
+ }
+ if (recurse && S_ISDIR (st.st_mode)) {
+ if (remove_directory (path, recurse) == -1) {
+ free (path);
+ closedir (handle);
+ return -1;
+ }
+ } else if (S_ISREG (st.st_mode)) {
+ if (unlink (path) == -1) {
+ free (path);
+ closedir (handle);
+ return -1;
+ }
+ }
+ free (path);
+ }
+ closedir (handle);
+
+ if (rmdir (directory) == -1)
+ return -1;
+ return 0;
+}
+
+/* Returns an allocated copy of s, with leading and trailing spaces
+ * removed.
+ */
+char *trim_spaces (const char *s)
+{
+ int length;
+ while (*s == ' ')
+ ++s;
+ length = strlen (s);
+ while (length && s[length - 1] == ' ')
+ --length;
+ return xstrndup (s, length);
+}
+
+char *lang_dir (const char *filename)
+{
+ char *ld; /* the lang dir: point to static data */
+ const char *fm; /* the first "/man/" dir */
+ const char *sm; /* the second "/man?/" dir */
+
+ ld = xstrdup ("");
+ if (!filename)
+ return ld;
+
+ /* Check whether filename is in a man page hierarchy. */
+ if (STRNEQ (filename, "man/", 4))
+ fm = filename;
+ else {
+ fm = strstr (filename, "/man/");
+ if (fm)
+ ++fm;
+ }
+ if (!fm)
+ return ld;
+ sm = strstr (fm + 2, "/man");
+ if (!sm)
+ return ld;
+ if (sm[5] != '/')
+ return ld;
+ if (!strchr ("123456789lno", sm[4]))
+ return ld;
+
+ /* If there's no lang dir element, it's an English man page. */
+ if (sm == fm + 3) {
+ free (ld);
+ return xstrdup ("C");
+ }
+
+ /* found a lang dir */
+ fm += 4;
+ sm = strchr (fm, '/');
+ if (!sm)
+ return ld;
+ free (ld);
+ ld = xstrndup (fm, sm - fm);
+ debug ("found lang dir element %s\n", ld);
+ return ld;
+}
+
+void init_locale (void)
+{
+ char *locale = setlocale (LC_ALL, "");
+ if (!locale &&
+ !getenv ("MAN_NO_LOCALE_WARNING") &&
+ !getenv ("DPKG_RUNNING_VERSION"))
+ /* Obviously can't translate this. */
+ error (0, 0, "can't set the locale; make sure $LC_* and $LANG "
+ "are correct");
+ setenv ("MAN_NO_LOCALE_WARNING", "1", 1);
+#ifdef ENABLE_NLS
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ bindtextdomain (PACKAGE "-gnulib", LOCALEDIR);
+ textdomain (PACKAGE);
+#endif /* ENABLE_NLS */
+}
diff --git a/lib/wordfnmatch.c b/lib/wordfnmatch.c
new file mode 100644
index 0000000..0ec2650
--- /dev/null
+++ b/lib/wordfnmatch.c
@@ -0,0 +1,64 @@
+/*
+ * wordfnmatch.c: fnmatch on word boundaries
+ *
+ * Copyright (C) 2001, 2003, 2008 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <stdlib.h>
+#include <ctype.h>
+
+#include "fnmatch.h"
+
+#include "manconfig.h"
+
+#include "lower.h"
+#include "wordfnmatch.h"
+
+/* TODO: How on earth do we allow multiple-word matches without
+ * reimplementing fnmatch()?
+ */
+int word_fnmatch (const char *lowpattern, const char *string)
+{
+ char *lowstring = lower (string);
+ char *begin = lowstring, *p;
+
+ for (p = lowstring; *p; p++) {
+ if (CTYPE (islower, *p) || *p == '_')
+ continue;
+
+ /* Check for multiple non-word characters in a row. */
+ if (p <= begin + 1)
+ begin++;
+ else {
+ *p = '\0';
+ if (fnmatch (lowpattern, begin, 0) == 0) {
+ free (lowstring);
+ return 1;
+ }
+ begin = p + 1;
+ }
+ }
+
+ free (lowstring);
+ return 0;
+}
diff --git a/lib/wordfnmatch.h b/lib/wordfnmatch.h
new file mode 100644
index 0000000..0fc29f0
--- /dev/null
+++ b/lib/wordfnmatch.h
@@ -0,0 +1,23 @@
+/*
+ * wordfnmatch.h: interface to fnmatch on word boundaries
+ *
+ * Copyright (C) 2001, 2003, 2008 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+int word_fnmatch (const char *lowpattern, const char *string);
diff --git a/lib/xchown.c b/lib/xchown.c
new file mode 100644
index 0000000..7f284fa
--- /dev/null
+++ b/lib/xchown.c
@@ -0,0 +1,49 @@
+/*
+ * xchown.c: chown replacement function
+ *
+ * Copyright (C) 2016 Mihail Konev.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <unistd.h>
+
+#include "gettext.h"
+#define _(String) gettext (String)
+
+#include "error.h"
+#include "manconfig.h"
+
+void xchown (const char *path, uid_t owner, gid_t group)
+{
+ int rc;
+ rc = chown (path, owner, group);
+ if (rc)
+ error (FATAL, 0, _("can't chown %s"), path);
+}
+
+#ifdef HAVE_LCHOWN
+void xlchown (const char *path, uid_t owner, gid_t group)
+{
+ int rc;
+ rc = lchown (path, owner, group);
+ if (rc)
+ error (FATAL, 0, _("can't chown %s"), path);
+}
+#endif
diff --git a/lib/xchown.h b/lib/xchown.h
new file mode 100644
index 0000000..8a035b2
--- /dev/null
+++ b/lib/xchown.h
@@ -0,0 +1,29 @@
+/*
+ * xchown.h: chown replacement function
+ *
+ * Copyright (C) 2016 Mihail Konev.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * */
+
+#ifndef _XCHOWN_H
+#define _XCHOWN_H
+
+void xchown (const char *path, uid_t owner, gid_t group);
+#ifdef HAVE_LCHOWN
+void xlchown (const char *path, uid_t owner, gid_t group);
+#endif /* HAVE_LCHOWN */
+
+#endif /* _XCHOWN_H */
diff --git a/lib/xregcomp.c b/lib/xregcomp.c
new file mode 100644
index 0000000..cd6ed9d
--- /dev/null
+++ b/lib/xregcomp.c
@@ -0,0 +1,49 @@
+/*
+ * xregcomp.c: regcomp with error checking
+ *
+ * Copyright (C) 2008 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include "regex.h"
+
+#include "gettext.h"
+#include <locale.h>
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+
+#include "error.h"
+#include "xregcomp.h"
+
+void xregcomp (regex_t *preg, const char *regex, int cflags)
+{
+ int err = regcomp (preg, regex, cflags);
+ if (err) {
+ size_t errstrsize;
+ char *errstr;
+ errstrsize = regerror (err, preg, NULL, 0);
+ errstr = xmalloc (errstrsize);
+ regerror (err, preg, errstr, errstrsize);
+ error (FATAL, 0, _("fatal: regex `%s': %s"), regex, errstr);
+ }
+}
diff --git a/lib/xregcomp.h b/lib/xregcomp.h
new file mode 100644
index 0000000..ca34b44
--- /dev/null
+++ b/lib/xregcomp.h
@@ -0,0 +1,25 @@
+/*
+ * xregcomp.h: interface to regcomp with error checking
+ *
+ * Copyright (C) 2008 Colin Watson.
+ *
+ * This file is part of man-db.
+ *
+ * man-db is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * man-db is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with man-db; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "regex.h"
+
+void xregcomp (regex_t *preg, const char *regex, int cflags);