summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--GNUmakefile.in224
-rw-r--r--README252
-rw-r--r--acconfig.h92
-rw-r--r--aclocal.m4473
-rw-r--r--configure.in559
-rw-r--r--docs/COPYING339
-rw-r--r--docs/ChangeLog1085
-rw-r--r--docs/INSTALL.autoconf142
-rw-r--r--docs/INSTALL.quick27
-rw-r--r--docs/NEWS205
-rw-r--r--docs/ToDo12
-rw-r--r--include/Defines.in130
-rw-r--r--include/README1
-rw-r--r--include/comp_src.h.in59
-rw-r--r--include/config.h.in333
-rw-r--r--include/manconfig.h.in389
-rw-r--r--include/sections.list32
-rw-r--r--intl/ChangeLog1022
-rw-r--r--intl/Makefile.in214
-rw-r--r--intl/VERSION1
-rw-r--r--intl/bindtextdom.c199
-rw-r--r--intl/cat-compat.c262
-rw-r--r--intl/dcgettext.c593
-rw-r--r--intl/dgettext.c59
-rw-r--r--intl/explodename.c181
-rw-r--r--intl/finddomain.c189
-rw-r--r--intl/gettext.c70
-rw-r--r--intl/gettext.h105
-rw-r--r--intl/gettextP.h73
-rw-r--r--intl/hash-string.h63
-rw-r--r--intl/intl-compat.c76
-rw-r--r--intl/l10nflist.c409
-rw-r--r--intl/libgettext.h182
-rw-r--r--intl/linux-msg.sed100
-rw-r--r--intl/loadinfo.h58
-rw-r--r--intl/loadmsgcat.c199
-rw-r--r--intl/localealias.c378
-rw-r--r--intl/po2tbl.sed.in102
-rw-r--r--intl/textdomain.c106
-rw-r--r--intl/xopen-msg.sed104
-rw-r--r--lib/Makefile.in59
-rw-r--r--lib/README14
-rw-r--r--lib/alloca.c479
-rw-r--r--lib/ansidecl.h108
-rw-r--r--lib/basename.c34
-rw-r--r--lib/cleanup.c238
-rw-r--r--lib/cleanup.h11
-rw-r--r--lib/error.c119
-rw-r--r--lib/error.h16
-rw-r--r--lib/flock.c72
-rw-r--r--lib/flock.h17
-rw-r--r--lib/fnmatch.c200
-rw-r--r--lib/fnmatch.h67
-rw-r--r--lib/getopt.c748
-rw-r--r--lib/getopt.h129
-rw-r--r--lib/getopt1.c180
-rw-r--r--lib/glob.c675
-rw-r--r--lib/glob.h97
-rw-r--r--lib/memcmp.c366
-rw-r--r--lib/putenv.c112
-rw-r--r--lib/realpath.c168
-rw-r--r--lib/rename.c42
-rw-r--r--lib/strappend.c78
-rw-r--r--lib/strcspn.c46
-rw-r--r--lib/strsep.c48
-rw-r--r--lib/strspn.c52
-rw-r--r--lib/strstr.c65
-rw-r--r--lib/tempnam.c107
-rw-r--r--lib/waitpid.c32
-rw-r--r--lib/xmalloc.c95
-rw-r--r--lib/xstrdup.c44
-rw-r--r--libdb/COPYING.LIB481
-rw-r--r--libdb/Makefile.in90
-rw-r--r--libdb/README7
-rw-r--r--libdb/db_btree.c333
-rw-r--r--libdb/db_delete.c142
-rw-r--r--libdb/db_gdbm.c38
-rw-r--r--libdb/db_lookup.c342
-rw-r--r--libdb/db_ndbm.c101
-rw-r--r--libdb/db_storage.h69
-rw-r--r--libdb/db_store.c254
-rw-r--r--libdb/db_ver.c86
-rw-r--r--libdb/man_db-nls.h18
-rw-r--r--libdb/mydbm.h145
-rw-r--r--libdb/stamp-h1
-rw-r--r--man-db.gnu80
-rw-r--r--man/Makefile.in151
-rw-r--r--man/THANKS11
-rw-r--r--man/de_DE.88591/man1/apropos.man1135
-rw-r--r--man/de_DE.88591/man1/man.man1841
-rw-r--r--man/de_DE.88591/man1/manpath.man1125
-rw-r--r--man/de_DE.88591/man1/whatis.man1148
-rw-r--r--man/de_DE.88591/man1/zsoelim.man182
-rw-r--r--man/de_DE.88591/man5/manpath.man5118
-rw-r--r--man/de_DE.88591/man8/accessdb.man843
-rw-r--r--man/de_DE.88591/man8/catman.man8116
-rw-r--r--man/de_DE.88591/man8/mandb.man8123
-rw-r--r--man/de_DE.ascii/man1/apropos.man1135
-rw-r--r--man/de_DE.ascii/man1/man.man1841
-rw-r--r--man/de_DE.ascii/man1/manpath.man1125
-rw-r--r--man/de_DE.ascii/man1/whatis.man1148
-rw-r--r--man/de_DE.ascii/man1/zsoelim.man182
-rw-r--r--man/de_DE.ascii/man5/manpath.man5118
-rw-r--r--man/de_DE.ascii/man8/accessdb.man843
-rw-r--r--man/de_DE.ascii/man8/catman.man8116
-rw-r--r--man/de_DE.ascii/man8/mandb.man8123
-rw-r--r--man/es_ES.88591/man1/apropos.man1171
-rw-r--r--man/es_ES.88591/man1/man.man1928
-rw-r--r--man/es_ES.88591/man1/manpath.man1118
-rw-r--r--man/es_ES.88591/man1/whatis.man1195
-rw-r--r--man/es_ES.88591/man1/zsoelim.man175
-rw-r--r--man/es_ES.88591/man5/manpath.man5109
-rw-r--r--man/es_ES.88591/man8/accessdb.man843
-rw-r--r--man/es_ES.88591/man8/catman.man899
-rw-r--r--man/es_ES.88591/man8/mandb.man8154
-rw-r--r--man/it_IT.88591/man1/apropos.man1189
-rw-r--r--man/it_IT.88591/man1/man.man1925
-rw-r--r--man/it_IT.88591/man1/manpath.man1135
-rw-r--r--man/it_IT.88591/man1/whatis.man1197
-rw-r--r--man/it_IT.88591/man1/zsoelim.man186
-rw-r--r--man/it_IT.88591/man5/manpath.man5110
-rw-r--r--man/it_IT.88591/man8/accessdb.man850
-rw-r--r--man/it_IT.88591/man8/catman.man8112
-rw-r--r--man/it_IT.88591/man8/mandb.man8163
-rw-r--r--man/ja_JP.ujis/man1/apropos.man1169
-rw-r--r--man/ja_JP.ujis/man1/man.man1940
-rw-r--r--man/ja_JP.ujis/man1/manpath.man1115
-rw-r--r--man/ja_JP.ujis/man1/whatis.man1183
-rw-r--r--man/ja_JP.ujis/man1/zsoelim.man174
-rw-r--r--man/ja_JP.ujis/man5/manpath.man5113
-rw-r--r--man/ja_JP.ujis/man8/accessdb.man845
-rw-r--r--man/ja_JP.ujis/man8/catman.man899
-rw-r--r--man/ja_JP.ujis/man8/mandb.man8150
-rw-r--r--man/man1/apropos.man1181
-rw-r--r--man/man1/man.man1919
-rw-r--r--man/man1/manpath.man1125
-rw-r--r--man/man1/whatis.man1192
-rw-r--r--man/man1/zsoelim.man172
-rw-r--r--man/man5/manpath.man5102
-rw-r--r--man/man8/accessdb.man844
-rw-r--r--man/man8/catman.man8100
-rw-r--r--man/man8/mandb.man8145
-rw-r--r--po/Makefile.in.in247
-rw-r--r--po/POTFILES.in18
-rw-r--r--po/cs.po735
-rw-r--r--po/de.po744
-rw-r--r--po/es.po736
-rw-r--r--po/fr.po717
-rw-r--r--po/it.po723
-rw-r--r--po/ja.po641
-rw-r--r--src/Makefile.in201
-rw-r--r--src/README.lexgrog16
-rw-r--r--src/accessdb.c103
-rw-r--r--src/catman.c504
-rw-r--r--src/check_mandirs.c604
-rw-r--r--src/compression.c192
-rw-r--r--src/convert_name.c94
-rw-r--r--src/fake_security.c39
-rw-r--r--src/globbing.c161
-rw-r--r--src/hashtable.c163
-rw-r--r--src/hashtable.h26
-rw-r--r--src/lexgrog.l336
-rw-r--r--src/lexgrog.l-2.3.8239
-rw-r--r--src/lexgrog.l-2.4a299
-rw-r--r--src/lexgrog.l.new325
-rw-r--r--src/man.c2629
-rw-r--r--src/man.h17
-rw-r--r--src/man.sh8
-rw-r--r--src/man_db-nls.h141
-rw-r--r--src/man_db.config65
-rw-r--r--src/mandb.c495
-rw-r--r--src/manp.c1028
-rw-r--r--src/manp.h12
-rw-r--r--src/manpath.c169
-rw-r--r--src/security.c234
-rw-r--r--src/security.h54
-rw-r--r--src/stamp-h1
-rw-r--r--src/straycats.c364
-rw-r--r--src/ult_src.c337
-rw-r--r--src/ult_src.h5
-rw-r--r--src/util.c161
-rw-r--r--src/version.c32
-rw-r--r--src/whatis.c626
-rw-r--r--src/wrapper.c109
-rw-r--r--stamp-h.in1
-rw-r--r--tools/README19
-rw-r--r--tools/chconfig117
-rwxr-xr-xtools/checkman58
-rw-r--r--tools/install-manpage102
-rwxr-xr-xtools/install-sh119
-rw-r--r--tools/mandb_[nt]fmt-script28
-rwxr-xr-xtools/mkcatdirs111
-rwxr-xr-xtools/mkinstalldirs32
-rwxr-xr-xtools/nroff-script56
-rw-r--r--zsoelim/Makefile.in53
-rw-r--r--zsoelim/README6
-rw-r--r--zsoelim/zsoelim.l451
197 files changed, 42558 insertions, 0 deletions
diff --git a/GNUmakefile.in b/GNUmakefile.in
new file mode 100644
index 00000000..0ccbdd0e
--- /dev/null
+++ b/GNUmakefile.in
@@ -0,0 +1,224 @@
+# Master Makefile for the man_db package.
+#
+# Copyright (C) 1994, 1995, Graeme Wilford.
+#
+# You may distribute under the terms of the GNU General Public
+# License as specified in the COPYING file that comes with the man_db
+# distribution.
+#
+# Sat Aug 6 15:46:44 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk):
+
+#------------------------------------------------------------------------#
+# You should not need to edit this file at all. All user options can now #
+# be passed via --enable-?, --disable-? or --with-? options to #
+# ./configure. #
+# #
+# `./configure --help' shows current options available #
+# #
+# All system specific definitions are now in include/Defines. #
+# #
+# path definitions are in include/manconfig.h #
+# compression related definitions are in include/comp_src.h #
+#------------------------------------------------------------------------#
+
+srcdir = @srcdir@
+libdir = @libdir@
+VPATH = @srcdir@
+top_srcdir = @top_srcdir@
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+# GNUmakefile and include/Defines are automatic targets, don't add below.
+INCLUDES := $(addprefix include/, config.h manconfig.h comp_src.h)
+EVERYTHING = lib libdb src zsoelim man intl po
+ALL = lib libdb src zsoelim man intl po
+INSTALL = src zsoelim man intl po
+
+include include/Defines
+
+.PHONY: $(DEFAULT_TARGETS) $(EVERYTHING) dist nls_defines ID \
+ $(addsuffix _root, $(DEFAULT_TARGETS)) update default RCS check
+
+ifeq ($(nls),on)
+languages = $(notdir $(wildcard $(top_srcdir)/nls/*_*))
+
+default: $(INCLUDES)
+ @echo " "
+ @echo "./configure has determined that your system understands native language"
+ @echo "support (nls) message catalogues. This package is able to exploit this"
+ @echo "feature by displaying it's text messages in different languages on a per"
+ @echo "user basis. British English is the default (built in) language."
+ @echo " "
+ @echo "Please issue make command with NLS language options (as shown below) or"
+ @echo "'make nls=off' to disable all native language support. Currently the"
+ @echo "supported languages in POSIX 1003.1 locale format are:"
+ @echo " "
+ @for i in $(languages); do echo " $$i"; done
+ @echo " "
+ @echo "To enable support for all of these locales issue 'make nls=all'"
+ @echo "To support only a subset of these locales, issue"
+ @echo "'make nls=\"locale1 locale2 ...\"' (locales must be separated by spaces"
+ @echo "and the entire string quoted)"
+ @echo " "
+ @exit 0
+
+all:
+ $(MAKE) nls=off
+
+else # nls != on
+
+ ifeq ($(nls),off)
+ ALL = lib libdb src zsoelim man
+ INSTALL = src zsoelim man
+ else # nls != off
+ endif # nls = off
+
+all: $(ALL)
+
+endif # nls = on
+
+$(EVERYTHING): $(INCLUDES) nls_defines
+ $(MAKE) -C $@ $(targets)
+
+# Automatic regeneration targets
+$(srcdir)/configure: configure.in aclocal.m4
+ -cd $(srcdir) && autoconf
+
+$(srcdir)/include/config.h.in: stamp-h.in
+$(srcdir)/stamp-h.in: configure.in acconfig.h aclocal.m4
+ -cd $(srcdir) && autoheader && date > stamp-h.in
+
+# Use CONFIG_FILES= CONFIG_HEADERS= to force config.status to only
+# re-create the relevant config file.
+
+include/config.h: stamp-h
+stamp-h: $(srcdir)/include/config.h.in config.status
+ CONFIG_FILES= ./config.status
+ date > stamp-h
+
+config.status: $(srcdir)/configure
+ ./config.status --recheck
+
+# Allow sub-Makefiles to request update
+%: %.in config.status
+ CONFIG_HEADERS= CONFIG_FILES=$@ ./config.status
+
+# The following 3 rules must be explicit as using a pattern match rule would
+# pick up include/config.h as a target which would be wrong.
+
+include/manconfig.h: include/manconfig.h.in config.status
+ CONFIG_HEADERS= CONFIG_FILES=$@ ./config.status
+
+include/comp_src.h: include/comp_src.h.in config.status
+ CONFIG_HEADERS= CONFIG_FILES=$@ ./config.status
+
+include/Defines: include/Defines.in config.status
+ CONFIG_HEADERS= CONFIG_FILES=$@ ./config.status
+
+# Special targets
+ID:
+ mkid $(foreach dir, . $(EVERYTHING), \
+ $(srcdir)/$(dir)/*.[chl] $(srcdir)/$(dir)/Makefile.in)
+
+nls_defines:
+ cp include/Defines include/Defines.old
+ sed -e 's/^nls = .*/nls = $(nls)/' include/Defines.old > include/Defines
+
+# Just make sure that all configure created files are up to date
+update: nls_defines $(INCLUDES) $(addsuffix /Makefile, $(ALL))
+
+# testsuite doesn't exist
+testsuite:
+ @echo " "
+ @echo "The man_db testsuite was not found. To perform a check of the installed"
+ @echo "programs, you must have the man_db testsuite package and DejaGNU, both"
+ @echo "available separately."
+ @echo " "
+ @exit 1
+
+# Special loop-back root directory targets
+mostlyclean_root clean_root:
+ rm -f core *~ docs/*~ include/*~
+
+distclean_root: clean_root
+ rm -f $(INCLUDES) include/Defines GNUmakefile makefile
+ rm -f include/Defines.old config.status config.cache config.log stamp-h
+ rm -f src/lexgrog.c configure zsoelim/zsoelim.c
+
+realclean_root: distclean_root
+ rm -f tags ID
+
+TAGS_root:
+ $(MKTAGS) $(srcdir)/*.h include/*.h
+
+# Normal targets and dependencies.
+# If the make variable clean is set to yes, no dependencies are re-created
+
+install: $(INCLUDES) nls_defines
+
+install uninstall:
+ for i in $(INSTALL); do $(MAKE) prefix=../$(prefix) -C $$i $@; done
+
+TAGS realclean distclean mostlyclean clean:
+ for i in $(EVERYTHING); do $(MAKE) prefix=../$(prefix) -C $$i $@ clean=yes; done
+ $(MAKE) $@_root
+
+check: testsuite testsuite/Makefile
+ $(MAKE) -C testsuite
+
+ifeq ($(srcdir),.)
+# Sorry folks, can only make a dist from the $(srcdir)
+
+# The files in the distribution
+_subdirs = $(EVERYTHING) tools docs include
+
+_all = */README */Makefile.in
+_root = README configure *.h *.m4 *.in
+_docs = INSTALL.* COPYING ChangeLog NEWS ToDo
+_gencat = *.[ch1] Copyright
+_include = *.in
+_lib = *.[ch]
+_libdb = *.[ch] stamp-h COPYING.LIB
+_man = man?/*.man? */man?/*.man? THANKS
+_nls = nls.h *_*/*.m THANKS
+_src = README.lexgrog *.[chl] *.l-* man_db.config stamp-h
+_tools = checkman install-sh mandb_\[nt\]fmt-script mkcatdirs \
+ mkinstalldirs nroff-script
+_xcat = Register xcat.[cl]
+_zsoelim = *.[cl]
+
+FILES = $(_root) $(_all) \
+ $(foreach _subdir, $(_subdirs), \
+ $(addprefix $(_subdir)/, $(_$(_subdir))))
+
+message = release $(version), date $(date)
+nls_man = de_DE.88591 de_DE.ascii
+nls_cat = en_GB de_DE.88591
+man_db := man_db-$(version)
+
+RCS:
+ ci -l -f$(rev) -m'$(message)' $(FILES)
+
+# Ensure the flex C files and man_db-nls.h's are current
+dist: update
+ $(MAKE) -C src man_db-nls.h lexgrog.c nls=en_GB
+ $(MAKE) -C libdb man_db-nls.h nls=en_GB
+ $(MAKE) -C zsoelim zsoelim.c
+ $(MAKE) -C xcat xcat.c
+ rm -fr $(man_db)
+ rm -f $(man_db).tgz
+ mkdir $(man_db)
+ mkdir $(addprefix $(man_db)/, $(_subdirs))
+ mkdir $(addprefix $(man_db)/nls/, $(nls_cat))
+ mkdir $(addprefix $(man_db)/man/, $(nls_man))
+ mkdir $(addprefix $(man_db)/man/, \
+ $(foreach dir, . $(nls_man), \
+ $(dir)/man1 $(dir)/man5 $(dir)/man8))
+ for file in $(FILES); do \
+ ln $(srcdir)/$$file $(man_db)/$$file; \
+ done
+ chmod -R a+rX $(man_db)
+ tar cvf - $(man_db) | gzip -9 > $(man_db).tgz
+ rm -fr $(man_db)
+endif
diff --git a/README b/README
new file mode 100644
index 00000000..06c5a562
--- /dev/null
+++ b/README
@@ -0,0 +1,252 @@
+README for the man_db manual pager suite, version 2.3.x
+=======================================================
+
+Please read the man_db-manual, available in cat/PostScript/dvi formats,
+located at an FTP site carrying this package. It contains configuration
+details and other aspects of this manual pager suite that are not
+duplicated or relevant here.
+
+Read docs/INSTALL.autoconf for generic options to configure.
+Read docs/INSTALL.quick if you know all about man_db.
+Read docs/NEWS for visible changes since the last public release.
+Read docs/ChangeLog for details of recent source code changes.
+Read docs/ToDo for future plans.
+
+This package _requires_ GNU make version 3.68 or newer to be used.
+Other vendors' make programs will not work with the Makefiles in this
+package due to extensive utilization of GNU make features.
+
+The C source will require an ANSI C compiler. To generate dependencies
+(only necessary if developing or source level debugging), a cpp that
+understands -M is required.
+
+
+Notice to users of man_db version 2.2 or 2.2.1
+==============================================
+
+If you have stray-cats and created place-holders for them with `straycats'
+from the man_db-2.2 distribution, you must delete them before using
+man_db-2.3. (straycats v2.2 with an option of `--delete-placeholders' will
+do). man_db-2.3 still provides support for stray-cats, but uses a database
+entry rather than a file system i-node to indicate their presence.
+
+Obsoleted files include $(libdir)/makewhatis, /etc/manpath.config,
+$(bindir)/{getwhatis,makewhatis,straycats}, $(libdir)/globalman.*,
+any user localman.* databases and the manual pages: getwhatis, makewhatis
+and straycats all from section 8. The other binaries:
+$(bindir)/{man,mandb,manpath,apropos,whatis} and associated manual pages
+may be replaced by this version depending upon install directories.
+
+
+Notice regarding current state of FSSTND (Linux/?BSD)
+=====================================================
+
+The FSSTND is currently in a state of flux with respect to manual and
+cat page hierarchies. As of July 13th, 1995, the last public release
+of the standard proposed the root of the manual page hierarchy as
+`/usr' and the root of the writable cat hierarchy as `/var/catman' for
+the purposes of man->cat filename translation. As such, the following
+are defined in ./include/manconfig.h.in:
+
+#define CAT_ROOT "/var/catman" /* required by fsstnd() */
+#define MAN_ROOT "/usr" /* required by fsstnd() */
+
+Should these locations change, simply define the paths accordingly and
+recompile. Other FSSTND changes relating to man/cat paths will not be
+compatible with this version of man_db.
+
+INSTALL
+=======
+
+Running configure.
+
+ o READ `docs/INSTALL' regarding ./configure options
+
+ o RUN `./configure --help' to see what --enable and --with
+ options may be useful.
+
+ o RUN `./configure' with the appropriate options and environment
+ variable settings
+
+BROWSE or EDIT the following files that are created by the configuration
+process.
+
+ o `include/Defines' regarding general definitions used by all
+ Makefiles in the distribution
+
+ o `include/manconfig.h' regarding paths to support programs,
+ the default section list and other specific definitions.
+
+ o `include/comp_src.h' if the default compressor support is
+ inadequate for your requirements. (usually .Z [compress],
+ .z, .gz [gzip])
+
+Running make.
+
+configure will determine your system's ability to use native language
+support (NLS) message catalogues. If support is available, running `make'
+with no target will display the available language identifiers. To compile
+man_db with no support for message catalogues, simply run `make' with a
+target of `all'. N.B. This is not related to man's ability to display NLS
+manual pages, support for which is compiled in by default.
+
+ o RUN `make' to query nls languages on systems that support message
+ catalogues or `make all' to compile with the default English
+ messages only.
+
+If you ran `make' with no target and the compile did not begin, do one of
+the following.
+
+ o RUN `make nls=<your_choice>', `make nls=all' or `make nls=off'
+ which is equivalent to `make all'.
+
+Sort out the man_db configuration file.
+
+ o RUN `./src/man -l man/man5/manpath.5' from the root of this
+ distribution to read the man_db configuration file details.
+
+ o EDIT `./src/man_db.config' to your local requirements.
+
+Install the package.
+
+ o (gain superuser privileges for the rest of the steps)
+
+ o RUN `make install' to install the utilities and English manual
+ pages.
+
+The following command is required if you elected to compile the package
+without support for message catalogues but would like to install native
+language manual page translations.
+
+ o RUN `make man targets=install nls=<your_choice>' to install
+ translations of the standard English manual pages
+
+Initialise the `index' databases for all manpaths marked as global in the
+man_db configuration file.
+
+ o RUN `mandb' (This step is equivalent to running straycats and
+ makewhatis too).
+
+The following steps are optional / dependent on local conventions.
+
+ o ACKNOWLEDGE any warnings emitted by mandb. Bogus manual pages
+ are not included in the database and may be a waste of space.
+ Those pages without correctly formatted `whatis' lines are
+ included, but will have a whatis entry of "(unknown)"
+
+ o CD tools and RUN `mkcatdirs -t' to see if you have all of the
+ required cat directories. `mkcatdirs' without an option will
+ display a usage message.
+
+ o CD tools and RUN `checkman' with an argument of colon separated
+ manual page hierarchies to cross check for duplicated manual
+ pages. If no argument is given, your default $MANPATH will be
+ used.
+
+ The output of checkman may be piped into a file and used as an
+ argument to `rm', the `is newer than' messages are directed to
+ standard error. e.g. `checkman > dups'
+
+ If you are confident that the duplicates found are indeed
+ duplicates, you can back them up and delete them to save space.
+
+ At this point, running checkman again may yield further duplicates
+ that were ignored the first time.
+
+ o RUN `catman' with appropriate options to create any/all cat files
+ that you would like pre-formatted.
+
+
+Multiple build directories
+==========================
+
+It is possible to build man_db-2.3 in a directory other than the directory
+containing this file (and all of the program sources). This is particularly
+useful if compiling on multiple architectures or testing various
+configuration options as only a single copy of the sources is required.
+
+To enable this support, simply change directory to where you would like to
+build the package and run the configure program in this directory
+*from there*. Further information about this support can be found in the
+generic install document `docs/INSTALL'
+
+
+Makefile targets and variables
+==============================
+
+The standard GNU Makefile targets: all, install, uninstall, mostlyclean,
+clean, distclean, realclean and TAGS are available in every Makefile-
+supported directory. In addition, the master Makefile has the targets:
+update (update any configuration files whose source has changed) and dist
+(create a compressed and tarred distribution file).
+
+During the configuration process, `configure' sets the installation
+variables, `prefix' and `exec_prefix'. These are then used to form other
+variables such as `bindir' and `sysconfdir'. To change any of these or
+other standard GNU install variables dynamically, issue the `make' command
+with variable expressions as arguments, eg. `make prefix=/usr/local/packages'
+
+N.B. If prefix=/usr (either statically or dynamically), then sysconfdir=/etc
+instead of the usual $(prefix)/etc. To force sysconfdir to be /usr/etc, set
+it on the make command line.
+
+
+Default preprocessors
+=====================
+
+man_db uses a manual page directed preprocessor system, that is, each manual
+page may request preprocessing by a selection of preprocessors. Some
+systems' manual pages do not come with this information built in. In such
+circumstances, it is advisable to set a default list of preprocessors that
+each manual page should be passed through, so that those requiring special
+processing are readable. To achieve this, set DEFAULT_MANROFFSEQ (found in
+include/manconfig.h) to the appropriate preprocessor string, after running
+configure, but prior to compilation. This is not necessary for the
+following systems whose default preprocessing requirements are known.
+
+ Known not to require DEFAULT_MANROFFSEQ:
+ Linux, SunOS
+ Known to require #define DEFAULT_MANROFFSEQ "t":
+ Ultrix
+ Known to require #define DEFAULT_MANROFFSEQ "te":
+ HP-UX, OSF/1
+
+If unsure of the default preprocessors required by a system, the standard
+system's man(1) manual page may provide an answer.
+
+
+System specific notes
+=====================
+
+Linux
+
+ o Public released C library distributions prior to 4.5.26 contain
+ no Berkeley DB interface routines and an old gdbm implementation.
+ It is advisable to either install a recent version of gdbm (v1.6+)
+ or the Berkeley DB library (v1.79+) to gain enhanced performance.
+
+ o C library distribution 4.6.20 contains a bug that requires -static
+ to be used as a linker option if -g and -ldb are also used. If
+ not, programs linked with the db library will cause a segmentation
+ violation on startup.
+
+ o C library distribution 4.6.27 contains a bug that causes links
+ with -ldb to fail completely if -g is used without -static. As
+ such, configure will automatically choose gdbm routines found
+ in the gdbm library if $CFLAGS contains -g without -static at the
+ time of running configure.
+
+ o The recommended ./configure command:
+
+ CFLAGS='-O2 -fomit-frame-pointer' ./configure --prefix=/usr
+
+
+Ultrix-4.3a
+
+ o When compiled for BSD environment, each running `man' increases
+ the system load as reported by uptime(1) by one. The reason for
+ this behaviour is currently unknown, but the load increase does
+ *not* reflect actual resource usage. To avoid it, compile for
+ POSIX environment:
+
+ CC='cc -YPOSIX' ./configure
diff --git a/acconfig.h b/acconfig.h
new file mode 100644
index 00000000..4e547ee6
--- /dev/null
+++ b/acconfig.h
@@ -0,0 +1,92 @@
+/* define if you want to remove debugging assertions */
+#undef NDEBUG
+
+/* define to the version of the OS, if you have a debian gnu/linux system */
+#undef DEBIAN
+
+/* define to the full version of the program, if you have a debian gnu/linux system */
+#undef DEBVER
+
+/* define to the full email address of the debian maintainer, if you have a debian gnu/linux system */
+#undef DEBMAINT
+
+/* define if you have, and want to use, ndbm interface routines */
+#undef NDBM
+
+/* define if you have, and want to use, gdbm interface routines */
+#undef GDBM
+
+/* define if you have, and want to use, Berkeley database library */
+#undef BTREE
+
+/* define if you have, and want to use, Berkeley database header files */
+#undef BDB_H
+
+/* define if you have troff */
+#undef HAS_TROFF
+
+/* define if you don't have nroff */
+#undef NROFF_MISSING
+
+/* define as the setuid owner of man or undefine if not installing setuid */
+#undef SECURE_MAN_UID
+
+/* define if you have the setlocale() function */
+#undef HAVE_SETLOCALE
+
+/* define if you have the re_comp and re_exec BSD regex routines */
+#undef BSD_REGEX
+
+/* define if you have the regcomp and regexec POSIX regex routines */
+#undef POSIX_REGEX
+
+/* define if nroff is GNU nroff */
+#undef GNU_NROFF
+
+/* define if we are using groff as troff */
+#undef TROFF_IS_GROFF
+
+/* define if your sprintf function returns a count of converted characters */
+#undef ANSI_SPRINTF
+
+/* define COMP_CAT if you have compressors and want to support compressed
+ cat files */
+#undef COMP_CAT
+
+/* define COMP_SRC if you have compressors and want to support compressed
+ manual source */
+#undef COMP_SRC
+
+/* define if your pclose function doesn't handle multiple streams properly */
+#undef BROKEN_PCLOSE
+
+/* define if using <fnmatch.h> rather than "lib/fnmatch.h" */
+#undef HAVE_FNMATCH_H
+
+/* define if using <getopt.h> rather than "lib/getopt.h" */
+#undef HAVE_GETOPT_H
+
+/* define if using <glob.h> rather than "lib/glob.h" */
+#undef HAVE_GLOB_H
+
+/* Define to 1 if NLS is requested. */
+#undef ENABLE_NLS
+
+/* Define as 1 if you have catgets and don't want to use GNU gettext. */
+#undef HAVE_CATGETS
+
+/* Define as 1 if you have gettext and don't want to use GNU gettext. */
+#undef HAVE_GETTEXT
+
+/* Define if your locale.h file contains LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
+
+/* Define to 1 if stpcpy function is available. */
+#undef HAVE_STPCPY
+
+/* Define to the name of the distribution. */
+#undef PACKAGE
+
+/* Define to the version of the distribution. */
+#undef VERSION
+
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 00000000..177ecd04
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,473 @@
+dnl
+dnl Check to see if sprintf() returns the number of chars converted
+dnl Take no arguments
+dnl
+AC_DEFUN(MAN_FUNC_ANSI_SPRINTF,
+[AC_MSG_CHECKING(for ANSI C sprintf)
+
+AC_CACHE_VAL(man_cv_func_ansi_sprintf,
+[AC_TRY_RUN(
+changequote(<<, >>)dnl
+<<int main(void)
+{char str[12];
+if ((int)sprintf(str,"test_string")==11) exit(0);
+exit(1);
+}>>,
+changequote([, ])dnl
+man_cv_func_ansi_sprintf=yes,
+[man_cv_func_ansi_sprintf=no],
+[man_cv_func_ansi_sprintf=no])dnl
+])
+
+test "$man_cv_func_ansi_sprintf" = "yes" && AC_DEFINE(ANSI_SPRINTF)
+
+AC_MSG_RESULT($man_cv_func_ansi_sprintf)
+])
+
+dnl
+dnl Check to see if nroff is GNU nroff, take nroff path as arg.
+dnl
+AC_DEFUN(MAN_PROG_GNU_NROFF,
+[AC_MSG_CHECKING(whether nroff is GNU nroff)
+
+AC_CACHE_VAL(man_cv_prog_gnu_nroff,
+[if test `echo "\\n(.g" | $1 | tr -d '\n'` -eq 1
+then
+ man_cv_prog_gnu_nroff=yes
+else
+ man_cv_prog_gnu_nroff=no
+fi])
+
+if test "$man_cv_prog_gnu_nroff" = "yes"
+then
+ AC_DEFINE(GNU_NROFF)
+fi
+AC_MSG_RESULT($man_cv_prog_gnu_nroff)
+])
+dnl
+dnl Check to see if popen/pclose correctly handles multiple streams
+dnl
+AC_DEFUN(MAN_FUNC_PCLOSE,
+[AC_MSG_CHECKING(for working pclose)
+
+AC_CACHE_VAL(man_cv_func_pclose,
+[AC_TRY_RUN(
+[#include <stdio.h>
+#include <sys/wait.h>
+int
+try_pclose (FILE *f, int expected)
+{
+ int s;
+ s = pclose (f);
+ if (s != -1 && WIFEXITED (s))
+ return WEXITSTATUS (s) != expected;
+ else
+ return 1;
+}
+int
+main (void)
+{
+ FILE *f, *t;
+ int i, sf, st;
+ for (i = 0; i <= 1; ++i) {
+ f = popen ("false", "r");
+ sleep (1);
+ t = popen ("true", "r");
+ sleep (1);
+ if (i) {
+ st = try_pclose (t, 0);
+ sf = try_pclose (f, 1);
+ } else {
+ sf = try_pclose (f, 1);
+ st = try_pclose (t, 0);
+ }
+ if (sf || st) exit(1);
+ }
+ exit(0);
+}],
+man_cv_func_pclose=yes,
+[man_cv_func_pclose=no],
+[man_cv_func_pclose=no])dnl
+])
+
+test "$man_cv_func_pclose" = "no" && AC_DEFINE(BROKEN_PCLOSE)
+
+AC_MSG_RESULT($man_cv_func_pclose)
+])
+
+# Macro to add for using GNU gettext.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+#
+# This file file be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 3
+
+AC_DEFUN(AM_WITH_NLS,
+ [AC_MSG_CHECKING([whether NLS is requested])
+ dnl Default is enabled NLS
+ AC_ARG_ENABLE(nls,
+ [ --disable-nls do not use Native Language Support],
+ USE_NLS=$enableval, USE_NLS=yes)
+ AC_MSG_RESULT($USE_NLS)
+ AC_SUBST(USE_NLS)
+
+ USE_INCLUDED_LIBINTL=no
+
+ dnl If we use NLS figure out what method
+ if test "$USE_NLS" = "yes"; then
+ AC_DEFINE(ENABLE_NLS)
+ AC_MSG_CHECKING([whether included gettext is requested])
+ AC_ARG_WITH(included-gettext,
+ [ --with-included-gettext use the GNU gettext library included here],
+ nls_cv_force_use_gnu_gettext=$withval,
+ nls_cv_force_use_gnu_gettext=no)
+ AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
+
+ nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+ if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+ dnl User does not insist on using GNU NLS library. Figure out what
+ dnl to use. If gettext or catgets are available (in this order) we
+ dnl use this. Else we have to fall back to GNU NLS library.
+ dnl catgets is only used if permitted by option --with-catgets.
+ nls_cv_header_intl=
+ nls_cv_header_libgt=
+ CATOBJEXT=NONE
+
+ AC_CHECK_HEADER(libintl.h,
+ [AC_CACHE_CHECK([for gettext in libc], gt_cv_func_gettext_libc,
+ [AC_TRY_LINK([#include <libintl.h>], [return (int) gettext ("")],
+ gt_cv_func_gettext_libc=yes, gt_cv_func_gettext_libc=no)])
+
+ if test "$gt_cv_func_gettext_libc" != "yes"; then
+ AC_CHECK_LIB(intl, bindtextdomain,
+ [AC_CACHE_CHECK([for gettext in libintl],
+ gt_cv_func_gettext_libintl,
+ [AC_TRY_LINK([], [return (int) gettext ("")],
+ gt_cv_func_gettext_libintl=yes,
+ gt_cv_func_gettext_libintl=no)])])
+ fi
+
+ if test "$gt_cv_func_gettext_libc" = "yes" \
+ || test "$gt_cv_func_gettext_libintl" = "yes"; then
+ AC_DEFINE(HAVE_GETTEXT)
+ AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)dnl
+ if test "$MSGFMT" != "no"; then
+ AC_CHECK_FUNCS(dcgettext)
+ AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+ AC_TRY_LINK(, [extern int _nl_msg_cat_cntr;
+ return _nl_msg_cat_cntr],
+ [CATOBJEXT=.gmo
+ DATADIRNAME=share],
+ [CATOBJEXT=.mo
+ DATADIRNAME=lib])
+ INSTOBJEXT=.mo
+ fi
+ fi
+ ])
+
+ if test "$CATOBJEXT" = "NONE"; then
+ AC_MSG_CHECKING([whether catgets can be used])
+ AC_ARG_WITH(catgets,
+ [ --with-catgets use catgets functions if available],
+ nls_cv_use_catgets=$withval, nls_cv_use_catgets=no)
+ AC_MSG_RESULT($nls_cv_use_catgets)
+
+ if test "$nls_cv_use_catgets" = "yes"; then
+ dnl No gettext in C library. Try catgets next.
+ AC_CHECK_LIB(i, main)
+ AC_CHECK_FUNC(catgets,
+ [AC_DEFINE(HAVE_CATGETS)
+ INTLOBJS="\$(CATOBJS)"
+ AC_PATH_PROG(GENCAT, gencat, no)dnl
+ if test "$GENCAT" != "no"; then
+ AC_PATH_PROG(GMSGFMT, gmsgfmt, no)
+ if test "$GMSGFMT" = "no"; then
+ AM_PATH_PROG_WITH_TEST(GMSGFMT, msgfmt,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], no)
+ fi
+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+ USE_INCLUDED_LIBINTL=yes
+ CATOBJEXT=.cat
+ INSTOBJEXT=.cat
+ DATADIRNAME=lib
+ INTLDEPS='$(top_builddir)/intl/libintl.a'
+ INTLLIBS=$INTLDEPS
+ LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+ nls_cv_header_intl=intl/libintl.h
+ nls_cv_header_libgt=intl/libgettext.h
+ fi])
+ fi
+ fi
+
+ if test "$CATOBJEXT" = "NONE"; then
+ dnl Neither gettext nor catgets in included in the C library.
+ dnl Fall back on GNU gettext library.
+ nls_cv_use_gnu_gettext=yes
+ fi
+ fi
+
+ if test "$nls_cv_use_gnu_gettext" = "yes"; then
+ dnl Mark actions used to generate GNU NLS library.
+ INTLOBJS="\$(GETTOBJS)"
+ AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep 'dv '`"], msgfmt)
+ AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+ AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+ [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+ AC_SUBST(MSGFMT)
+ USE_INCLUDED_LIBINTL=yes
+ CATOBJEXT=.gmo
+ INSTOBJEXT=.mo
+ DATADIRNAME=share
+ INTLDEPS='$(top_builddir)/intl/libintl.a'
+ INTLLIBS=$INTLDEPS
+ LIBS=`echo $LIBS | sed -e 's/-lintl//'`
+ nls_cv_header_intl=intl/libintl.h
+ nls_cv_header_libgt=intl/libgettext.h
+ fi
+
+ dnl Test whether we really found GNU xgettext.
+ if test "$XGETTEXT" != ":"; then
+ dnl If it is no GNU xgettext we define it as : so that the
+ dnl Makefiles still can work.
+ if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+ : ;
+ else
+ AC_MSG_RESULT(
+ [found xgettext programs is not GNU xgettext; ignore it])
+ XGETTEXT=":"
+ fi
+ fi
+
+ # We need to process the po/ directory.
+ POSUB=po
+ else
+ DATADIRNAME=share
+ nls_cv_header_intl=intl/libintl.h
+ nls_cv_header_libgt=intl/libgettext.h
+ fi
+
+ # If this is used in GNU gettext we have to set USE_NLS to `yes'
+ # because some of the sources are only built for this goal.
+ if test "$PACKAGE" = gettext; then
+ USE_NLS=yes
+ USE_INCLUDED_LIBINTL=yes
+ fi
+
+ dnl These rules are solely for the distribution goal. While doing this
+ dnl we only have to keep exactly one list of the available catalogs
+ dnl in configure.in.
+ for lang in $ALL_LINGUAS; do
+ GMOFILES="$GMOFILES $lang.gmo"
+ POFILES="$POFILES $lang.po"
+ done
+
+ dnl Make all variables we use known to autoconf.
+ AC_SUBST(USE_INCLUDED_LIBINTL)
+ AC_SUBST(CATALOGS)
+ AC_SUBST(CATOBJEXT)
+ AC_SUBST(DATADIRNAME)
+ AC_SUBST(GMOFILES)
+ AC_SUBST(INSTOBJEXT)
+ AC_SUBST(INTLDEPS)
+ AC_SUBST(INTLLIBS)
+ AC_SUBST(INTLOBJS)
+ AC_SUBST(POFILES)
+ AC_SUBST(POSUB)
+ ])
+
+AC_DEFUN(AM_GNU_GETTEXT,
+ [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+ AC_REQUIRE([AC_PROG_CC])dnl
+ AC_REQUIRE([AC_PROG_RANLIB])dnl
+ AC_REQUIRE([AC_ISC_POSIX])dnl
+ AC_REQUIRE([AC_HEADER_STDC])dnl
+ AC_REQUIRE([AC_C_CONST])dnl
+ AC_REQUIRE([AC_C_INLINE])dnl
+ AC_REQUIRE([AC_TYPE_OFF_T])dnl
+ AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+ AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+ AC_REQUIRE([AC_FUNC_MMAP])dnl
+
+ AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h string.h \
+unistd.h values.h sys/param.h])
+ AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
+__argz_count __argz_stringify __argz_next])
+
+ if test "${ac_cv_func_stpcpy+set}" != "set"; then
+ AC_CHECK_FUNCS(stpcpy)
+ fi
+ if test "${ac_cv_func_stpcpy}" = "yes"; then
+ AC_DEFINE(HAVE_STPCPY)
+ fi
+
+ AM_LC_MESSAGES
+ AM_WITH_NLS
+
+ if test "x$CATOBJEXT" != "x"; then
+ if test "x$ALL_LINGUAS" = "x"; then
+ LINGUAS=
+ else
+ AC_MSG_CHECKING(for catalogs to be installed)
+ NEW_LINGUAS=
+ for lang in ${LINGUAS=$ALL_LINGUAS}; do
+ case "$ALL_LINGUAS" in
+ *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
+ esac
+ done
+ LINGUAS=$NEW_LINGUAS
+ AC_MSG_RESULT($LINGUAS)
+ fi
+
+ dnl Construct list of names of catalog files to be constructed.
+ if test -n "$LINGUAS"; then
+ for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+ fi
+ fi
+
+ dnl The reference to <locale.h> in the installed <libintl.h> file
+ dnl must be resolved because we cannot expect the users of this
+ dnl to define HAVE_LOCALE_H.
+ if test $ac_cv_header_locale_h = yes; then
+ INCLUDE_LOCALE_H="#include <locale.h>"
+ else
+ INCLUDE_LOCALE_H="\
+/* The system does not provide the header <locale.h>. Take care yourself. */"
+ fi
+ AC_SUBST(INCLUDE_LOCALE_H)
+
+ dnl Determine which catalog format we have (if any is needed)
+ dnl For now we know about two different formats:
+ dnl Linux libc-5 and the normal X/Open format
+ test -d intl || mkdir intl
+ if test "$CATOBJEXT" = ".cat"; then
+ AC_CHECK_HEADER(linux/version.h, msgformat=linux, msgformat=xopen)
+
+ dnl Transform the SED scripts while copying because some dumb SEDs
+ dnl cannot handle comments.
+ sed -e '/^#/d' $srcdir/intl/$msgformat-msg.sed > intl/po2msg.sed
+ fi
+ dnl po2tbl.sed is always needed.
+ sed -e '/^#.*[^\\]$/d' -e '/^#$/d' \
+ $srcdir/intl/po2tbl.sed.in > intl/po2tbl.sed
+
+ dnl In the intl/Makefile.in we have a special dependency which makes
+ dnl only sense for gettext. We comment this out for non-gettext
+ dnl packages.
+ if test "$PACKAGE" = "gettext"; then
+ GT_NO="#NO#"
+ GT_YES=
+ else
+ GT_NO=
+ GT_YES="#YES#"
+ fi
+ AC_SUBST(GT_NO)
+ AC_SUBST(GT_YES)
+
+ dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly
+ dnl find the mkinstalldirs script in another subdir but ($top_srcdir).
+ dnl Try to locate is.
+ MKINSTALLDIRS=
+ if test -n "$ac_aux_dir"; then
+ MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs"
+ fi
+ if test -z "$MKINSTALLDIRS"; then
+ MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
+ fi
+ AC_SUBST(MKINSTALLDIRS)
+
+ dnl *** For now the libtool support in intl/Makefile is not for real.
+ l=
+ AC_SUBST(l)
+
+ dnl Generate list of files to be processed by xgettext which will
+ dnl be included in po/Makefile.
+ test -d po || mkdir po
+ if test "x$srcdir" != "x."; then
+ if test "x`echo $srcdir | sed 's@/.*@@'`" = "x"; then
+ posrcprefix="$srcdir/"
+ else
+ posrcprefix="../$srcdir/"
+ fi
+ else
+ posrcprefix="../"
+ fi
+ rm -f po/POTFILES
+ sed -e "/^#/d" -e "/^\$/d" -e "s,.*, $posrcprefix& \\\\," -e "\$s/\(.*\) \\\\/\1/" \
+ < $srcdir/po/POTFILES.in > po/POTFILES
+ ])
+
+# Check whether LC_MESSAGES is available in <locale.h>.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+#
+# This file file be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 1
+
+AC_DEFUN(AM_LC_MESSAGES,
+ [if test $ac_cv_header_locale_h = yes; then
+ AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+ [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+ am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+ if test $am_cv_val_LC_MESSAGES = yes; then
+ AC_DEFINE(HAVE_LC_MESSAGES)
+ fi
+ fi])
+
+# Search path for a program which passes the given test.
+# Ulrich Drepper <drepper@cygnus.com>, 1996.
+#
+# This file file be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+# serial 1
+
+dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
+dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN(AM_PATH_PROG_WITH_TEST,
+[# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+ /*)
+ ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+ ;;
+ *)
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+ for ac_dir in ifelse([$5], , $PATH, [$5]); do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ if [$3]; then
+ ac_cv_path_$1="$ac_dir/$ac_word"
+ break
+ fi
+ fi
+ done
+ IFS="$ac_save_ifs"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+ ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test -n "[$]$1"; then
+ AC_MSG_RESULT([$]$1)
+else
+ AC_MSG_RESULT(no)
+fi
+AC_SUBST($1)dnl
+])
diff --git a/configure.in b/configure.in
new file mode 100644
index 00000000..00ac3c8c
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,559 @@
+dnl Process this file with autoconf v1.116+ to produce a configure script.
+dnl
+dnl Initialise and check we're in the correct directory.
+dnl
+AC_INIT(acconfig.h)
+AC_CONFIG_AUX_DIR(tools)
+AC_CONFIG_HEADER(include/config.h)
+AC_ARG_PROGRAM
+dnl
+dnl Define below date and version information to be put into man pages etc.
+dnl
+datemark=20000223
+date=`LANG=C date -d $datemark `
+date_it=`LANG=it_IT date -d $datemark +'%d %B %Y'`
+date_es=`LANG=es_ES date -d $datemark +'%d %B %Y'`
+date_de=`LANG=de_DE date -d $datemark +'%d %B %Y'`
+date_fr=`LANG=fr_FR date -d $datemark +'%d %B %Y'`
+dnl
+curdate=`LANG=en_EN date +'%d %B %Y'`
+curdate_it=`LANG=it_IT date +'%d %B %Y'`
+curdate_es=`LANG=es_ES date +'%d %B %Y'`
+curdate_de=`LANG=de_DE date +'%d %B %Y'`
+curdate_fr=`LANG=fr_FR date +'%d %B %Y'`
+pwd=`pwd`
+VERSION=`expr $PWD : '.*-\([0-9.]*\)'`
+PACKAGE=`expr $PWD : '\(.*\)-[0-9.]*'`
+PACKAGE="man-db"
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
+AC_SUBST(PACKAGE)dnl
+AC_SUBST(VERSION)dnl
+ALL_LINGUAS="de it es cs ja fr"
+AM_GNU_GETTEXT
+AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
+dnl
+dnl MAN_ECHO("string to be echoed")dnl
+define(MAN_ECHO, [echo $1 1>&AC_FD_MSG])dnl
+dnl MAN_ECHO_VAR(ENV-VARIABLE)
+define(MAN_ECHO_VAR, [MAN_ECHO("default $1 = \"$$1\"")])dnl
+dnl
+dnl Use some un-documented features to find unique autoconf version integer
+dnl
+define(MAN_AC_VERSION, [builtin(eval, $3 + $2 * 1000 + $1 * 1000000)])dnl
+man_ac_version=MAN_AC_VERSION(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)))
+dnl
+AC_SUBST(date)dnl
+AC_SUBST(curdate)dnl
+dnl AC_SUBST(datemark)dnl
+AC_SUBST(date_it)dnl
+AC_SUBST(curdate_it)dnl
+AC_SUBST(date_es)dnl
+AC_SUBST(curdate_es)dnl
+AC_SUBST(date_de)dnl
+AC_SUBST(curdate_de)dnl
+AC_SUBST(date_fr)dnl
+AC_SUBST(curdate_fr)dnl
+AC_SUBST(man_ac_version)dnl
+dnl
+dnl We have to be a bit naughty here and supply options.
+dnl The autoconf literature states that only features that can be
+dnl separately 'built' should use --enable and friends. Oh well...
+dnl Current options: debug, setuid, device, db.
+dnl
+AC_ARG_ENABLE(debug,
+[ --enable-debug build a Makefile suitable for debugging purposes],
+ [: ${LDFLAGS=-g}
+ MAN_ECHO("Enabling debugging Makefile")
+ debug=on],
+ [: ${CFLAGS=-g -O2}
+ : ${LDFLAGS=-s}
+ : ${LIBS=-lc}
+ AC_DEFINE(NDEBUG)
+ debug=off])
+AC_ARG_ENABLE(setuid,
+[ --enable-setuid[=ARG] install man setuid to user ARG (default - ARG=man)
+ --disable-setuid don't install man setuid],
+ [if test "$enableval" = "yes"
+ then
+ enableval=man
+ fi
+ if test "$enableval" = "no"
+ then
+ man_owner=
+ man_install_flags="-m 755"
+ MAN_ECHO("Man will not be installed setuid")
+ else
+ man_owner=$enableval
+ man_install_flags="-m 4755 -o $man_owner"
+ MAN_ECHO("Man will be installed setuid $enableval")
+ AC_DEFINE_UNQUOTED(SECURE_MAN_UID, "$man_owner")
+ fi],
+ [man_owner=man
+ man_install_flags="-m 4755 -o man"
+ AC_DEFINE_UNQUOTED(SECURE_MAN_UID, "$man_owner")])
+AC_ARG_WITH(device,
+[ --with-device=DEVICE use nroff with the output device DEVICE],
+ [if test "$withval" = "yes" || test "$withval" = "no"
+ then
+ AC_MSG_ERROR(--with-device requires an argument)
+ else
+ nroff_device=" -T$withval"
+ fi])
+AC_ARG_WITH(db,
+[ --with-db=LIBRARY use database library LIBRARY (db2, db1, db, gdbm, ndbm)],
+ [if test "$withval" = "yes" || test "$withval" = "no"
+ then
+ AC_MSG_ERROR(--with-db requires an argument)
+ else
+ db=$withval
+ fi],
+ : ${db=no})
+dnl
+dnl Finish the argument parsing
+dnl
+AC_SUBST(man_install_flags)dnl
+AC_SUBST(debug)dnl
+dnl
+dnl Check $PATH for the following progs and append suitable options.
+dnl
+AC_PROG_CC
+AC_PROG_CPP
+AC_PROG_INSTALL
+AC_PROG_RANLIB
+AC_PATH_PROG(cat, cat)
+AC_PATH_PROG(lynx, lynx)
+AC_PATH_PROG(tr, tr)
+dnl
+if test -s /etc/debian_version
+then AC_PATH_PROGS(pager, pager)
+ test "$pager" || AC_MSG_ERROR(Debian requires /usr/bin/pager)
+else AC_PATH_PROGS(pager, pager less more)
+fi
+test "$pager" && pager="exec $pager -s"
+dnl
+dnl
+dnl now test if this is a debian system
+dnl
+AC_MSG_CHECKING(if this is a Debian GNU/Linux system)
+if test -s /etc/debian_version
+then
+ debian=`awk '{ print $1 }' /etc/debian_version`
+ AC_DEFINE_UNQUOTED(DEBIAN,$debian)
+ AC_MSG_RESULT(yes Debian-$debian)
+ dnl
+ AC_MSG_CHECKING(for the full debian version of this program)
+ dnl
+ tempfile=`tempfile`
+ if test -r debian/changelog
+ then `dpkg-parsechangelog 2>/dev/null >$tempfile`
+ elif test -r ../debian/changelog
+ then `dpkg-parsechangelog -l../debian/changelog 2>/dev/null >$tempfile`
+ else `rm -f $tempfile`
+ AC_MSG_ERROR(this macro requires that configure runs inside a debianized tree)
+ fi
+ debian_version=`awk '/Version:/{ print $2 }' $tempfile`
+ debian_maint=`awk -F: '/Maintainer:/{ print $2 }' $tempfile`
+ AC_MSG_RESULT($debian_version $debian_maint)
+ AC_DEFINE_UNQUOTED(DEBVER,"$debian_version")
+ AC_DEFINE_UNQUOTED(DEBMAINT,"$debian_maint")
+else
+ AC_MSG_RESULT(no)
+fi
+dnl
+dnl define below (in list of preference) *roff macros to check for.
+dnl
+macros="andoc an doc"
+dnl
+dnl We have problems here, as different systems have different *roff
+dnl formatters and they accept different options and do different things :(
+dnl
+AC_PATH_PROGS(nroff, nroff gnroff groff)
+if test "$nroff"
+then
+ dnl define GNU_NROFF if necessary
+ MAN_PROG_GNU_NROFF($nroff)
+ if test "$nroff_device"
+ then
+ AC_MSG_CHECKING(that nroff works with argument$nroff_device)
+dnl
+dnl cannot cache this result as it can change between runs of configure.
+dnl
+ if $nroff $nroff_device /dev/null >/dev/null 2>&1 3>&1
+ then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ AC_MSG_ERROR(nroff does not work with argument$nroff_device)
+ fi
+ fi
+ AC_MSG_CHECKING(for appropriate nroff macro)
+ AC_CACHE_VAL(man_cv_prog_nroff_macro, [
+
+ for macro in $macros
+ do
+ if $nroff -m$macro $nroff_device /dev/null >/dev/null 2>&1 3>&1
+ then
+ man_cv_prog_nroff_macro=-m$macro
+ break
+ fi
+ done])
+
+ if test "$man_cv_prog_nroff_macro"
+ then
+ nroff="$nroff ${man_cv_prog_nroff_macro}"
+dnl nroff="$nroff ${man_cv_prog_nroff_macro}${nroff_device}"
+ AC_MSG_RESULT($man_cv_prog_nroff_macro)
+ else
+ AC_MSG_RESULT(ambiguous)
+ AC_MSG_WARN(please edit include/manconfig.h and add nroff definition)
+ fi
+else
+ AC_MSG_WARN(Cannot find an nroff-like program, formatting of manual page source will not be supported.)
+ nroff="(nroff not installed)"
+ AC_DEFINE(NROFF_MISSING)
+fi
+AC_PATH_PROGS(troff, groff)
+if test "$troff"
+then
+ AC_DEFINE(TROFF_IS_GROFF)
+ TROFF=groff
+else
+ AC_PATH_PROGS(troff, troff gtroff)
+ TROFF=troff
+fi
+if test "$troff"
+then
+ AC_DEFINE(HAS_TROFF)
+ AC_MSG_CHECKING(for appropriate $TROFF options)
+ AC_CACHE_VAL(man_cv_prog_troff_options, [
+dnl
+dnl do a quick test to see if -t works [AIX needs this], groff doesn't as
+dnl it indicates pre-process with tbl.
+dnl
+ test "$TROFF" = "troff" && $troff -t /dev/null >/dev/null 2>&1 3>&1 \
+ && troff_filter="-t "
+ for macro in $macros
+ do
+ if $troff $troff_filter -m$macro /dev/null >/dev/null 2>&1 3>&1
+ then
+ man_cv_prog_troff_options="${troff_filter}-m${macro}"
+ break
+ fi
+ done])
+ if test "$man_cv_prog_troff_options"
+ then
+ troff="$troff $man_cv_prog_troff_options"
+ AC_MSG_RESULT($man_cv_prog_troff_options)
+ else
+ AC_MSG_RESULT(ambiguous)
+ AC_MSG_WARN(please edit include/manconfig.h and add troff definition)
+ fi
+else
+ troff="(troff not installed)"
+fi
+dnl
+AC_PATH_PROGS(eqn, eqn geqn)
+AC_PATH_PROGS(neqn, neqn gneqn)
+dnl
+dnl if we fail to find an neqn, use eqn and try to force it to output
+dnl for an ascii device. As this is only relevant for equations (?), not
+dnl using latin1 should be acceptable. -Tlatin1 is ignored by some eqn.
+dnl
+if test -z "$neqn"
+then
+ test "$eqn" &&
+ (test "$nroff_device" && neqn="$eqn -T$nroff_device" || neqn="$eqn -Tascii")
+fi
+AC_PATH_PROGS(tbl, tbl gtbl)
+AC_PATH_PROGS(col, col gcol)
+if test -s /etc/debian_version -a ! "$col"
+then
+ AC_MSG_ERROR(man-db on debian must be built with col; install bsdmainutils)
+fi
+AC_PATH_PROGS(vgrind, vgrind gvgrind)
+AC_PATH_PROGS(refer, refer grefer)
+AC_PATH_PROGS(grap, grap)
+AC_PATH_PROGS(pic, pic gpic)
+test "$pic" && pic="$pic -S"
+AC_PATH_PROG(gzip, gzip)
+if test "$gzip"
+then
+ gunzip="$gzip -dc"
+ compressor="$gzip -c7"
+ compress_ext="gz"
+ decompressor="$gunzip"
+fi
+AC_PATH_PROG(compress, compress)
+if test "$compress"
+then
+ uncompress="$compress -dc"
+ if test -z "$gzip"
+ then
+ compressor="$compress -c"
+ compress_ext="Z"
+ decompressor="$uncompress"
+ fi
+fi
+if test "$gzip" || test "$compress"
+then
+ AC_DEFINE(COMP_CAT)
+ AC_DEFINE(COMP_SRC)
+fi
+AC_SUBST(compressor)dnl
+AC_SUBST(compress_ext)dnl
+AC_SUBST(gunzip)dnl
+AC_SUBST(uncompress)dnl
+AC_SUBST(decompressor)dnl
+dnl
+dnl to add more decompressors just follow the scheme above.
+dnl
+dnl check for various header files and associated libraries.
+dnl
+AC_AIX
+AC_MINIX
+AC_ISC_POSIX
+dnl AC_PROG_LEX calls AC_TRY_LINK: must come after above 3
+AC_PROG_LEX
+AC_STDC_HEADERS
+AC_HEADER_SYS_WAIT
+AC_HEADER_DIRENT
+AC_CHECK_HEADERS(unistd.h memory.h fcntl.h limits.h sys/file.h regex.h)
+AC_CHECK_HEADERS(string.h strings.h, break)
+dnl
+dnl Checks for structures and compiler characteristics.
+dnl
+AC_C_CONST
+AC_C_INLINE
+AC_TYPE_OFF_T
+AC_TYPE_PID_T
+AC_TYPE_UID_T
+AC_TYPE_SIZE_T
+dnl
+dnl Checks for functions.
+dnl
+AC_FUNC_ALLOCA
+AC_FUNC_MEMCMP
+AC_TYPE_SIGNAL
+AC_FUNC_STRCOLL
+AC_FUNC_VFORK
+AC_FUNC_VPRINTF
+MAN_FUNC_ANSI_SPRINTF
+MAN_FUNC_PCLOSE
+dnl
+dnl Find a suitable database interface header and library
+dnl
+dnl Check for Berkeley db routines (first version API)
+dnl
+dnl
+if test "$db" = "no" || test "$db" = "db2" || test "$db" = "db"
+then for head in db_185.h db2/db_185.h db2_185.h
+ do AC_CHECK_HEADER($head,[
+ for lib in db2 db
+ do AC_CHECK_LIB($lib, dbopen, LIBS="$LIBS -l$lib"
+ AC_CHECK_LIB($lib, db_open,
+ AC_DEFINE_UNQUOTED(BDB_H,<$head>)
+ AC_DEFINE_UNQUOTED(BTREE,$lib)
+ db=yes, db=no)
+ , db=no)
+ test "$db" = "yes" && break
+ done
+ ], db=no)
+ test "$db" = "yes" && break
+ done
+fi
+dnl
+dnl
+dnl
+if test "$db" = "no" || test "$db" = "db1" || test "$db" = "db"
+then for head in db/db.h db.h db1/db.h
+ do AC_CHECK_HEADER($head,[
+ for lib in db db1
+ do AC_CHECK_LIB($lib, dbopen, LIBS="$LIBS -l$lib"
+ AC_CHECK_LIB($lib, db_open,
+ db=no,
+ AC_DEFINE_UNQUOTED(BDB_H,<$head>)
+ AC_DEFINE_UNQUOTED(BTREE,$lib)
+ db=yes)
+ , db=no)
+ test "$db" = "yes" && break
+ done
+ ], db=no)
+ done
+fi
+dnl
+dnl
+dnl
+
+dnl dnl
+dnl for head in db/db.h, db.h, db1/db.h
+dnl do AC_CHECK_HEADER($head,[
+dnl for lib in db db1
+dnl do AC_CHECK_LIB($lib, dbopen, LIBS="$LIBS -l$lib"
+dnl AC_DEFINE(BDB_H,$head)
+dnl AC_DEFINE(BTREE,$lib),
+dnl
+dnl db=yes, db=no)
+dnl dnl
+dnl dnl
+dnl dnl
+dnl dnl
+dnl dnl
+dnl if test "$db" = "no" || test "$db" = "db2"
+dnl then
+dnl AC_CHECK_HEADER(db2_185.h,[
+dnl for lib in db2 c
+dnl do
+dnl AC_CHECK_LIB($lib, dbopen, test "$lib" = "c" || LIBS="$LIBS -l$lib"
+dnl AC_DEFINE(BTREE,2)
+dnl AC_DEFINE(DB_ON_LIBC)
+dnl db=yes, db=no)
+dnl test "$db" = "yes" && break
+dnl done], db=no)
+dnl fi
+dnl if test "$db" = "no" || test "$db" = "db2"
+dnl then
+dnl AC_CHECK_HEADER(db2/db_185.h,[
+dnl for lib in db2 c
+dnl do
+dnl AC_CHECK_LIB($lib, dbopen, test "$lib" = "c" || LIBS="$LIBS -l$lib"
+dnl AC_DEFINE(BTREE,2)
+dnl db=yes, db=no)
+dnl test "$db" = "yes" && break
+dnl done], db=no)
+dnl fi
+dnl dnl
+dnl dnl from package libdb1-dev
+dnl dnl
+dnl if test "$db" = "no" || test "$db" = "db"
+dnl then
+dnl AC_CHECK_HEADER(db/db.h,[
+dnl for lib in db c
+dnl do
+dnl AC_CHECK_LIB($lib, dbopen, test "$lib" = "c" || LIBS="$LIBS -l$lib"
+dnl AC_DEFINE(BTREE,1)
+dnl db=yes, db=no)
+dnl test "$db" = "yes" && break
+dnl done], db=no)
+dnl fi
+dnl dnl
+dnl dnl from package libc6-dev
+dnl dnl
+dnl dnl ########## statically linked #####
+dnl if test "$db" = "no" || test "$db" = "db"
+dnl then
+dnl AC_CHECK_HEADER(db1/db.h,[
+dnl for lib in db c
+dnl do
+dnl AC_CHECK_LIB($lib, dbopen, test "$lib" = "c" || LIBS=" /usr/lib/libdb.a $LIBS"
+dnl AC_DEFINE(BTREE,1)
+dnl AC_DEFINE(DB_ON_LIBC)
+dnl db=yes, db=no)
+dnl test "$db" = "yes" && break
+dnl done], db=no)
+dnl fi
+dnl
+dnl Check for GNU dbm routines
+dnl
+if test "$db" = "no" || test "$db" = "gdbm"
+then
+ AC_CHECK_HEADER(gdbm.h,[
+ for lib in gdbm c dbm
+ do
+ AC_CHECK_LIB($lib, gdbm_fetch, test "$lib" = "c" || LIBS="$LIBS -l$lib"
+ AC_DEFINE(GDBM)
+ db=yes, db=no)
+ if test "$db" = "yes"
+ then
+dnl Need to explicitly check for some routines, rather than using
+dnl version info extracted from gdbm.h
+ AC_CHECK_FUNCS(gdbm_exists gdbm_setopt)
+ break
+ fi
+ done], db=no)
+fi
+dnl
+dnl Check for UNIX ndbm routines
+dnl
+if test "$db" = "no" || test "$db" = "ndbm"
+then
+ AC_CHECK_HEADER(ndbm.h,[
+ for lib in ndbm c dbm
+ do
+ AC_CHECK_LIB($lib, dbm_fetch, test "$lib" = "c" || LIBS="$LIBS -l$lib"
+ AC_DEFINE(NDBM)
+ db=yes, db=no)
+ test "$db" = "yes" && break
+ done], db=no)
+fi
+if test "$db" != "yes"
+then
+ if test "$db" = "no"
+ then
+ AC_MSG_ERROR(Fatal: no supported database library/header found)
+ else
+ AC_MSG_ERROR(Fatal: $db: unsupported database library)
+ fi
+fi
+if test "$debug" = "on"
+then
+ AC_CHECK_LIB(efence, EF_Print)
+fi
+dnl
+dnl Check for available functions.
+dnl
+AC_CHECK_FUNCS(getcwd getwd, break)
+AC_CHECK_FUNCS(atexit on_exit, break)
+AC_CHECK_FUNCS(setreuid strerror)
+AC_CHECK_FUNCS(canonicalize_file_name)
+AC_CHECK_FUNC(setlocale,
+ AC_DEFINE(HAVE_SETLOCALE)
+ AC_CHECK_FUNC(catopen,
+ nls=on,
+ AC_CHECK_LIB(i, catopen,
+ LIBS="$LIBS -li"
+ nls=on,
+ nls=off)),
+ nls=off)
+AC_SUBST(nls)dnl
+dnl
+dnl I think it's reasonable to assume that the system has the following
+dnl headers if the (POSIXy) functions exist.
+dnl
+AC_CHECK_FUNC(regcomp, AC_DEFINE(POSIX_REGEX),
+ AC_CHECK_FUNC(re_comp, AC_DEFINE(BSD_REGEX),
+ AC_MSG_WARN(no regex routines found, whatis/apropos will ignore -r)))
+AC_CHECK_FUNC(fnmatch, AC_DEFINE(HAVE_FNMATCH_H), LIBOBJS="$LIBOBJS fnmatch.o")
+AC_CHECK_FUNC(globfree, AC_DEFINE(HAVE_GLOB_H), LIBOBJS="$LIBOBJS glob.o")
+AC_CHECK_FUNC(getopt_long, AC_DEFINE(HAVE_GETOPT_H), LIBOBJS="$LIBOBJS getopt.o getopt1.o")
+AC_REPLACE_FUNCS(flock putenv realpath rename basename tempnam waitpid strstr strsep strcspn strspn)
+dnl
+MAN_ECHO_VAR(CC)
+MAN_ECHO_VAR(CPP)
+MAN_ECHO_VAR(CPPFLAGS)
+MAN_ECHO_VAR(CFLAGS)
+MAN_ECHO_VAR(LDFLAGS)
+MAN_ECHO_VAR(LIBS)
+AC_OUTPUT([GNUmakefile \
+ lib/Makefile \
+ src/Makefile \
+ man/Makefile \
+ libdb/Makefile \
+ zsoelim/Makefile \
+ include/Defines \
+ include/comp_src.h \
+ include/manconfig.h \
+ intl/Makefile \
+ po/Makefile.in], \
+ [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile ])
+date > stamp-h
+dnl Create a bogus makefile that non-GNU make's will try to use. This is
+dnl better than messages like `make:105: missing separator **'
+cat > makefile <<MEOF
+all:
+ @echo "Compilation of this package requires GNU make ver 3.68 or above."
+ @echo "If you are using GNU make and it ignores the GNUmakefile in this"
+ @echo "directory, issue the command 'make -f GNUmakefile'"
+
+update install clean realclean distclean TAGS dist: all
+MEOF
diff --git a/docs/COPYING b/docs/COPYING
new file mode 100644
index 00000000..a43ea212
--- /dev/null
+++ b/docs/COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/docs/ChangeLog b/docs/ChangeLog
new file mode 100644
index 00000000..c4d051d3
--- /dev/null
+++ b/docs/ChangeLog
@@ -0,0 +1,1085 @@
+Wed Feb 23 22:34:54 EET 2000 fab (fpolacco@debian.org)
+
+ * Version: 2.3.12
+
+ * New maintainer.
+
+ * find the huge list of changes (in three years) in file
+ debian/changelog.
+
+Thu Jul 13 11:29:32 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version: 2.3.10
+
+ * src/apropos.c: fix for #undef REGEX regarding int regex
+
+ * src/lexgrog.l: default to new version.
+
+ * src/README.lexgrog: new.
+
+ * configure.in: all echo's through MAN_ECHO() for --quiet.
+
+ * various: apply patch from Carl Edman (cedman@princeton.edu),
+ port to NeXTstep and misc small fixes.
+
+Fri Jun 16 11:12:08 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version: 2.3.9
+
+Wed Jun 14 17:08:41 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/man.c (make_display_command): fix command when ascii==1
+
+ * src/man.c (display): don't return 1 on skip if local_man_file==1
+
+ * man/Makefile.in: force make to resolve the program name strings
+ (which are sed commands) once only.
+
+ * configure.in: don't exec pager (too many side effects)
+
+Sun Jun 4 13:51:22 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version: 2.3.8
+
+ * various: apply patch from CERN to allow globbed support for
+ HPUX, OSF and SOLARIS system manual page hierarchies.
+
+ * GNUmakefile.in: add hook for `make check'
+
+Mon May 29 18:57:24 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/whatis.c (main): if $POSIXLY_CORRECT is in effect,
+ default to case-less extended regex searches for apropos
+ as specified by POSIX 1
+
+ * man/man1/apropos.man1: document above change.
+
+ * src/whatis.c (apropos, parse_name): ensure case-less
+ matching on manual page name aswell as it's whatis for apropos.
+
+ * all manual pages: replace instances of program with %program%
+ and arrange to do a sed replacement with the actual name of the
+ program, chosen by the installer.
+
+ * zsoelim/zsoelim.l: fix recursion detector.
+
+ * src/lexgrog.l (newline_found): new.
+
+Mon May 22 20:07:17 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * nls/de_DE.88591/*.m: from Lars Fenneberg (li@gimli.comlink.de)
+
+ * src/Makefile, libdb/Makefile: fix -DNLS
+
+ * src/man.c (LESS_PROMPT): Make " Manual page" a translatable
+ message.
+
+ * man/de_DE.ISO_8859-1: rename as man/de_DE.88591
+
+ * nls/THANKS, man/THANKS: new.
+
+ * src/whatis.c: If $POSIXLY_CORRECT, force apropos to do extended
+ regex matching.
+
+Sat May 20 12:27:47 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/man.c: if -f or -k, simply execv() the program, passing
+ the entire argv[] to it.
+
+ * man/man1/man.man1: document change.
+
+ * src/whatis.c: ignore -f, --whatis, -k and --apropos
+
+Sat May 13 18:10:50 BST 1995 Markus Armbruster
+
+ * Version: 2.3.7
+
+ * lib/cleanup.c (pop_all_cleanups): new
+ * src/man.c, src/security.c: use pop_all_cleanups() in children.
+
+ * general: use fork() instead of vfork() in situations where
+ vfork() could cause problems.
+
+Tue May 9 23:30:58 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * manual pages: aesthetic/grammer changes.
+
+ * flex files: process with flex-2.5.2
+
+Mon May 8 11:15:07 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * include/manconfig.h.in: #define some exit codes.
+ * all sources: use the codes.
+ * English manual pages: add EXIT STATUS section where
+ appropriate
+
+ * src/man.c (make_display_command): back out execing the pager
+ as PAGER does not have to be a simple program name.
+
+ * configure.in: prepend "exec " to the default pager.
+
+ * src/mandb.c: fix stupid bug where global databases remain
+ owned by the creator in all circumstances. Clean up.
+
+ * src/straycats.c, src/check_mandirs.c: homogenized and
+ re-worded messages emitted by mandb.
+
+Mon May 8 11:15:07 BST 1995 Markus Armbruster
+
+ * lib/cleanup.c, lib/cleanup.h: new functions. Install
+ sighandler, initialise and operate a stack of cleanup funcs
+ callable on exit().
+
+ * src/mandb.c, src/man.c: modify to use cleanup functions.
+
+Tue Apr 25 20:21:51 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version: 2.3.6
+
+ * src/whatis.c: new, replaced with edited version from 2.4 alpha
+ source tree. Apropos now does _real_ word matches.
+
+ * man/man1/apropos.man1: remove description of option -e.
+
+Mon Apr 24 17:26:54 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/man.c (get_section_list): Ignore empty $MANSECT.
+ * src/man.c (main): if (!*pager) pager = CAT;
+
+ * libdb/db_storage.h, include/manconfig.h.in, src/check_mandirs.c,
+ src/straycats.c: small modifications to fix broken
+ FAVOUR_STRAYCATS behaviour and properly handle situation when
+ STRAYCAT and WHATIS_CAT share namespace. Move definition of
+ FAVOUR_STRAYCATS to include/manconfig.h.in. From Zoltan.
+
+ * zsoelim/zsoelim.c: exit 1 on command line file open failure.
+
+ * src/man.c (man_getopt): consolidate incompatible option parsing.
+ * src/man.c (usage): update wrt. option parsing.
+
+ * src/man.c (display): only prompt/attempt display if found==1.
+
+ * src/man.c (make_display_command): exec the pager.
+
+Fri Apr 21 15:16:59 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version: 2.3.5 (public release)
+
+ * src/whatis.c: fix a couple of problems caused by whatis/apropos
+ split.
+
+ * configure.in: remove determination of viable gencat program,
+ always use our own.
+
+Wed Apr 19 09:53:27 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * GNUmakefile.in: renamed Makefile to differentiate between
+ GNU make and others.
+
+ * configure.in: create bogus ./makefile to catch non GNU make
+ programs.
+
+Mon Apr 17 11:06:32 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version: 2.3.4
+
+ * src/man.c (format_display_and_save): don't save cat if
+ formatting process fails and/or produces nothing.
+
+Sat Apr 8 18:02:52 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/mandb.c: change #ifdef SECURE_MAN_UID to
+ #if defined(SECURE_MAN_UID) && defined(MAN_DB_UPDATES) as the
+ databases should be owned by their creators if man is not
+ responsible for updating them.
+
+ * src/man.c: minor changes regarding MAN_DB_UPDATES
+
+ * include/manconfig.h.in: update CATMODE and DBMODE w.r.t.
+ recent MAN_DB_UPDATES/MAN_CATS definitions.
+
+ * src/mandb.c: changes to operation. Work on a temporary copy of
+ the database, then rename() to actual database. Catch SIGINT,
+ SIGTERM and remove the temp copy if necessary.
+
+ * src/compression.c (decompress): kill(getpid(), SIGINT) instead of
+ exit(0) if child (decompressing man page) fails.
+
+ * src/straycats.c (check_for_stray): kill(getpid(), SIGINT) instead of
+ exit(0) if child (decompressing cat page) fails.
+
+ * libdb/db_lookup.c (make_content): ndbm limit is 4k not 1k.
+
+Mon Apr 3 20:52:06 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * docs/NEWS: new
+
+ * README: more Linux-system information.
+
+ * configure.in, acconfig.h: #define NDEBUG if !--enable-debug
+
+ * include/Defines.in: comment out @LEXLIB@, not required in link
+ stage.
+
+Sun Apr 2 17:42:02 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version: 2.3.3
+
+ * README: add sections referring to default preprocessors and
+ system specific notes.
+
+ * xcat/xcat.l, zsoelim,zsoelim.l, src/lexgrog.l: process with
+ flex-2.5.1
+
+Fri Mar 31 17:12:44 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/whatis.c (display): add free(string)
+
+ * src/whatis.c, src/Makefile.in: produce separate object files for
+ apropos and whatis so that the programs know which one they are
+ regardless of actual program-filename.
+
+ * All Makefile.in, include/Defines.in: append CPPFLAGS supplied to
+ ./configure or make to the standard $(CPPFLAGS) variable.
+ Allows configuring with unusual #include directories, eg.
+ CPPFLAGS=-I/usr/src/gdbm LDFLAGS=-L/usr/src/gdbm ./configure
+
+ * configure.in (--with-db=LIBRARY): override the default database
+ interface library on systems having a choice. Options={db,gdbm,ndbm}
+
+ * configure.in: Re: sec 5.6 of the autoconf manual, replace
+ (if test a=b -o a=c) with
+ (if test a=b || test a=c)
+
+Tue Mar 28 16:44:46 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version: 2.3b2
+
+ * lib/flock.c, lib/flock.h: New. flock() wrapper to fcntl() for
+ systems that lack flock().
+
+ * xcat/xcat.l: #include "manconfig.h". For systems not supporting
+ __inline__
+
+ * include/Defines.in (%.d : %.c): modify rule to account for C
+ compilers other than gcc
+
+ * All Makefiles.in (cd $dir && $(MAKE)): change to $(MAKE) -C $dir
+ * nls/Makefile.sub.in: merge into nls/Makefile.in
+
+Mon Mar 27 22:42:53 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/globbing.c (look_for_file): don't rely on GLOB_NOMATCH as
+ AIX doesn't have it.
+
+ * configure.in, include/manconfig.h.in (man_ac_version): new,
+ replaces ac_version and is more robust
+ * configure.in, aclocal.m4: rename non-autoconf macros so that
+ future versions of autoconf won't clash
+
+ * gencat/gencat.c, gencat/genlib.c: tidy up header includes and
+ remove unused variable definitions
+
+ * configure.in: check for gencat
+
+Mon Mar 27 12:51:47 BST 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version 2.3b1
+
+ * src/man.c: small HAS_TROFF/NROFF_MISSING changes from Markus.
+
+Thu Mar 23 18:09:46 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/man.c: man will only _create_ user db's if
+ MAN_DB_CREATES is #defined (It is not defined by default)
+
+ * add ability to install programs/man pages with transformed names.
+ ie --program-prefix=PREFIX,
+ --program-suffix=SUFFIX and
+ --program-transform-name=EXP
+ arguments to configure are now observed.
+
+ * src/man.c (try_db): store an info->addr==NULL entry in the
+ hashtable if we fail to access this db. Only try to open the
+ db once. If the db access succeeds, but the lookup fails to find
+ anything, store info==NULL in the hashtable.
+
+ * libdb/db_ver.c (dbver_rd): don't die if wrong version. Issue a
+ message, return 1 and let the caller decide what to do.
+
+Mon Mar 20 16:13:23 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/whatis.c (get_whatis): new. Use the pointer member of mandata
+ structure to access the whatis string.
+ (display): modify to use get_whatis().
+
+ * src/checkmandirs.c (splitline): don't store whatis referenced
+ `whatis' lines in the db.
+
+ * libdb/db_lookup.c (make_content): store a NULL whatis as "" rather
+ than "-".
+
+Sun Mar 19 16:37:58 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/lexgrog.l: wipe out roff comment lines (again).
+
+ * src/whatis.c: use BSD style regex if POSIX unavailable. Ignore
+ --regex if neither available. Fix failed-regex-compilation error
+ message.
+
+ * lib/regex.c, lib/regex.h: remove
+
+ * configure.in: account for regex changes.
+
+ * libdb/db_delete.c (dbdelete): don't barf on delete request of a
+ multi-key that is not listed in the main key, return NO_ENTRY.
+
+ * src/man.c (try_section): don't try to delete db entry for missing
+ straycat. Return 0 and leave that to the caller.
+
+Sat Mar 18 12:31:48 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Replaced strncasecmp() calls with strncmp(). Removed partial
+ support for man dirs named .../MAN.
+
+ * lib/{alloca.c,putenv.c,memcmp.c}: new
+ lib/{getopt.c,getopt1.c,getopt.h,error.c,xstrdup.c,xmalloc.c}:
+ newer replacements
+
+ * All Makefile.in, include/Defines.in, include/manconfig.h.in:
+ use standard (GNU coding) installation variables:
+ bindir, sysconfdir, man?ext, man?dir, localedir, manroot.
+ These variables, along with prefix and exec_prefix may be specified
+ on the `make' command line.
+
+ * configure.in: move definition of BINDIR and config_prefix to
+ include/Defines.in to allow dynamic evaluation. Rename config_prefix
+ to sysconfdir.
+
+ * libdb/db_lookup.c (list_extensions): fix return count.
+
+ * libdb/db_delete.c (dbdelete): take account of situation
+ where there were multiple name entries and they are subsequently
+ deleted. When deleting the last one (which still has a multi-key
+ entry), delete the standard key too, rather than recomputing it's
+ content (which would be nothing and cause a "corrupt db" message).
+
+Fri Mar 17 23:36:44 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/man.c (glob_for_file, make_names): remove
+ src/globbing.c: new file
+ lib/glob.c, lib/glob.h, lib/fnmatch.c, lib/fnmatch.h: replacements
+ from GNU glob.tar.gz
+ configure.in: glob changes.
+ Use POSIX glob replacement.
+ Allow --extension to be used in globbing environment. Don't search
+ for cats in alternate cat directory if no index.
+
+ * All Makefile.in: add standard (GNU coding) targets: all, clean,
+ mostlyclean, distclean, realclean, install, uninstall, TAGS, dist
+ Other configuration/goal modifications
+
+ * Makefile.in: force config.status to do selective re-creation
+
+ * src/zsoelim.l: cater for ".SH \f?NAME\f?"
+
+ * acconfig.m4 (AC_FUNC_PCLOSE), src/man.c (display): small changes
+ from Markus
+
+ * Makefile.in, README: change `make all' to equal `make nls=off'
+ rather than `make nls=all'
+
+ * include/Defines.in: move -DDEFAULT_MANROFFSEQ to
+ include/manconfig.h
+
+ * include/manconfig.h: change inline parsing. Use autoconf-2.2
+
+Thu Mar 16 12:38:15 GMT 1995 Markus Armbruster (armbru@pond.sub.org)
+
+ * Version: 2.2a20
+
+ * zsoelim/zsoelim.l: general fixes
+
+ * configure.in: don't add -lc as library containing db routines.
+
+ * lib/glob.c: ultrix fixes
+
+ * lib/rename.c: replacement
+
+ * lib/strappend.c: small fix and copyright notice
+
+Wed Mar 15 11:17:58 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/lexgrog.l: modifications to whatis parser, mainly for
+ stray cats.
+
+ * src/man.c (main): add drop_effective_privs() and
+ regain_effective_privs() around manpath configuration so that
+ users' `hidden' manpaths are found and used.
+
+ * substantial configuration changes regarding all Makefiles to
+ allow `alternate build directory' support. man_db may be built
+ in *any* directory. Aids multi-architecture builds and testing
+ of various configuration options.
+
+ * rationalised source files to #include "local_header" and
+ #include <system_header>. CPPFLAGS uses -I- to limit -I paths
+ to "" resolving only. Other alternate build directory mods.
+
+ * src/comp_src.h.in: moved to ./comp_src.h.in
+ src/manconfig.h, src/path.h.in: combined into ./manconfig.h.in
+
+ * *ensure* that lib/{regex,fnmatch,getopt}.h are only #included
+ if the replacement c source is used. Otherwise use system routines
+ and system headers.
+
+ * ./configure.in, acconfig.h, aclocal.m4 (AC_FUNC_PCLOSE,
+ BROKEN_PCLOSE): new autoconf macro
+
+ * gencat is not installed by default. (cd gencat && make install)
+
+ * tools/mkcatdirs: re-written
+ tools/checkman: new utility to check for duplicate manual pages
+ across manual page hierarchies.
+
+ * docs/INSTALL, README: new
+
+ * src/man.c (display): attempt to open tmp_cat_filename(), if
+ unable, don't try to save cat.
+
+Sun Mar 12 18:12:13 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version 2.2a19
+
+ * all source (main): replace mkprogname(%s) with
+ xstrdup(basename(%s))
+
+ * src/util.c (strappend): remove
+ * lib/strappend.c: new
+
+Mon Mar 6 20:05:27 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/man.c (--local): re-enable support for compressed local
+ files. eg `man -l foo.1.gz'
+
+ * src/man.c (make_roff_command): Check in alternate catdir then
+ mandir for external format script if ALT_EXT_FORMAT #defined.
+
+ * zsoelim/zsoelim.l: partial rewrite to mimick GNU soelim
+ `bad roff request' error behaviour.
+
+Mon Mar 6 13:51:32 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/man.c: fix SEGV if arg --local used
+
+ * src/man.c (gripe_system): exit with errorcode of failed command
+
+Sun Mar 5 20:54:13 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version 2.2a18
+
+ * src/catman.c (main): check individual cat directories for
+ existence and perms.
+
+ * src/man.c (commit_tmp_cat): fix SEGV
+
+ * src/man.c: NO_MAN_UPDATES & NO_MAN_CATS #defined code
+ regions for experimental CERN use, untested and incomplete.
+
+ * configure.in, src/Makefile, src/paths.h.in: undo bogus dependance
+ on NLS for output device=latin1.
+
+ * configure.in (--with-device=<device>): new option to select
+ default nroff output device. Test that nroff can handle selected
+ output device (if any).
+
+Thu Mar 2 19:30:45 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/lexgrog.l (too_big), (add_str_to_whatis),
+ (add_char_to_whatis): new functions
+ (find_name): add extra argument.
+ add string bounds checking, add new condition to terminate NAME
+ section: <man_name>\n{W}*\n+.+
+
+ * src/check_mandirs.c, src/straycats.c, src/manconfig.h: change
+ callers of find_name().
+
+ * src/man.c (try_db_section): warn of re-cache failure, but don't
+ exit.
+ lots of changes/simplifications w.r.t. global/user hierarchies.
+ global_manpath == 1 for global hierarchy, global_manpath == 0 for
+ user. global_manpath is set once we know which hierarchy we are
+ displaying from.
+
+Tue Feb 28 13:34:15 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/man.c (display): fix SEGV.
+
+ * src/util.c (strappend): allow realloc of NULL string.
+
+ * src/man.c: replace strappend(xstrdup("string"), ...) with
+ strappend(NULL, string, ...)
+
+ * src/straycats.c (check_for_stray): allow any supported
+ straycat compression extension if COMP_SRC is #defined.
+ Replace static buffers with dynamic.
+
+ * src/check_mandirs.c, src/whatis.c: replace static buffers
+ with dynamic.
+
+ * src/util.c: (mkdbname): new function.
+ src/*.c: replace static database[PATH_MAX] with mkdbname() calls.
+
+Sun Feb 26 20:58:59 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version 2.2a17
+
+ * src/whatis.c: warn if no index or whatis db's available.
+
+ * src/man.c: Fixes to setuid/privs code regarding user manual
+ trees and ruid==0 from Markus.
+
+ * configure.in: add checks for AIX, USG, stdlib.h, MINIX, ISC_POSIX
+
+ * lib/glob.c: ensure that _POSIX_VERSION can be defined
+
+Sun Feb 19 12:38:10 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version 2.2a16
+
+ * Various portability fixes provided by Philippe Defert
+ (defert@cern.ch)
+
+ * FSSTND changes regarding /usr, /var/catman searching
+
+ * Some header file re-arrangement to aid user configuration.
+
+Sun Feb 12 15:00:44 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version 2.2a15
+
+Sat Feb 4 10:54:21 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * man(1), manpath(5): revisions.
+
+Thu Feb 2 23:36:20 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/catman.c (do_access): new
+
+ * src/man.c (do_chown): new
+ catman changes, don't do_prompt() if print_where==1
+
+ * src/manp.c: changed an !is_directory() to is_directory() != 1
+
+Sat Jan 28 09:39:07 1995 Markus Armbruster (armbru@pond.sub.org)
+
+ * man.c: **changes** ??
+
+Sun Jan 22 16:15:04 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version 2.2a14+
+
+ * configure.in, libdb/mydbm.h libdb/db_gdbm.c: if using gdbm,
+ explicitly test for gdbm_exists() rather than use header #defines.
+
+ * man/man1/mandb.man1, man/man1/catman.man1: moved to man/man8 and
+ renamed.
+
+ * apropos(1), whatis(1), manpath(1), zsoelim(1), catman(8),
+ mandb(8) manual pages: significant revisions.
+
+Sat Jan 21 14:33:28 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * incorporate Markus' changes with my post 2.2a13 changes.
+
+ * src/version.c (ver): fix, use fprintf() instead of error().
+
+Thu 22 Dec 1994 15:12:38 +0100 1994 Markus Armbruster (armbru@pond.sub.org)
+
+ * src/man.c (make_roff_command, make_display_command,
+ open_cat_stream, close_cat_stream, display,
+ find_cat_file, checked_system,
+ get_preprocessors): new functions
+
+ * src/man.c (format_and_display, format_and_display_file,
+ display_cat_file, parse_roff_directive,
+ add_directive): removed functions
+
+ * src/man.c (glob_for_file, make_name): made consistent.
+
+ * src/util.c (strappend): new function.
+ (do_system_command): changed/renamed to do_system().
+
+ * src/manp.c (global_catpath): replaced/fixed
+
+ * src/security, src/fake_security (do_system_command_drop_privs):
+ renamed to do_system_dropped_privs().
+
+ * lib/rename.c: new file
+
+Mon Jan 9 20:42:38 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * nls/Makefile, man/Makefile: allow for bogus or non existent
+ native languages passed in $nls.
+
+ * src/man.c (do_prompt): replaced with less friendly but more
+ portable version.
+
+ * inline directives replaced with __inline__ to be more ansi.
+
+Mon Dec 19 12:59:28 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version: 2.2a14
+
+ * aclocal.m4, configure.in: don't define variable nroff_device
+
+ * src/Makefile, src/paths.h.in: define GNU_NROFF_DEVICE.
+ If nls != off, GNU_NROFF_DEVICE=" -Tlatin1"
+ else, GNU_NROFF_DEVICE=" -Tascii"
+
+ * src/man.c, src/catman.c, src/security.c: #include <vfork.h> if
+ available. _exit() from child rather than exit().
+
+Sun Dec 18 17:54:22 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/util.c (basename): removed
+ lib/basename.c: extracted from src/util.c
+ configure.in: check for/replace basename function if necessary.
+
+ * src/catman.c (add_arg): replace strdup() with xstrdup().
+
+ * soelim/soelim.*: renamed zsoelim/zsoelim.*
+
+ * manual pages: reflect soelim - zsoelim name change.
+
+Fri Dec 16 12:17:48 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * configure.in: correctly determine db header and required library
+
+ * src/man.c (main, do_extern): pass manpath to whatis / apropos in
+ case man was called with -M or -m.
+
+ * src/catman.c (main): interrogate $MANSECT for manual sections.
+
+ * man/man1/catman.man1, man/man1/man.man1 ($MANSEC): replace with
+ the correct variable - $MANSECT.
+
+ * src/man.c: new option (-7 or --ascii) passes page through minimal
+ latin1 to ascii translator. Only useful for nroff written in ascii
+ and formatted with -Tlatin1.
+
+ * man/man1/man.man1: document it.
+
+ * src/man.c (make_command): new routine to piece together man's
+ system() call.
+
+Thu Dec 15 13:52:42 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version: 2.2a13
+
+ * src/catman.c (parse_for_sec): only supply man with -L locale
+ arguments if locale!=0x0
+
+ * src/Makefile: fix libmandb.a rule
+
+Wed Dec 14 22:49:59 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version 2.2a12
+
+ * major package restructure with creation of new subdirectories
+ for xcat and the db routines. Allowed split up of single db source
+ file into some constituent function parts.
+
+ * some Makefile restructuring to allow arbitrary ordering of
+ subdirectory builds.
+
+ * ./dblib/*, ./xcat/*: new or moved from src/.
+
+ * src/db_storage.c: moved and split up into ./dblib/*.c
+ src/mydbm.h, db_storage.h: moved into ./dblib
+ src/nls.h: moved to ./nls.h
+ src/xcat.c, src/xcat.l, src/Register: moved into ./xcat
+
+Wed Dec 14 00:17:11 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/manconfig.h: #include <stddef.h> for size_t declaration.
+
+ * src/checkmandirs.c (reset_db_time): remove use of strerror() in
+ debug line for systems without it.
+
+ * src/manp.c: ensure no warnings given if quiet==1
+
+Tue Dec 12 22:10:07 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/xcat.l: allow duplicate message id's to exist in single C
+ source file, do not duplicate in the relative message file or
+ src/man_db-nls.h. Warn of such duplications as they may be in error.
+
+Tue Dec 12 19:05:21 GMT 1994 Markus Armbruster (armbru@pond.sub.org)
+
+ * configure.in: fix definition of BINDIR when --prefix not used
+
+ * src/man.c: replace "export foo=bar" with "foo=bar; export foo" in
+ system() command
+
+ * soelim/Makefile: do not backup old soelim before install
+
+ * lib/error.h: new
+
+ * convert all error message to the form
+ error(int exitcode, int errno, char *message)
+ where exitcode!=0 causes exit(exitcode) after message and errno!=0
+ causes the error text to be appended to the message. All messages
+ have "<program_name>: " prepended.
+
+ * all C source: #include "../lib/error.h" and replace prognam with
+ program_name.
+
+ * src/db_storage.c (ndbm_flopen, btree_flopen): generalised
+ (ndbm_trun_open, btree_trunc_open): removed
+ (ndbm_flclose): new
+
+ * src/gripes.c: functions copied to relevant caller.
+ src/gripes.c, src/gripes.h: removed
+
+Sun Dec 11 15:16:42 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version: 2.2a11 (not released)
+
+ * src/man.c (main): putenv("LESSCHARSET=latin1"), remove from
+ less_options[]
+
+ * src/lexgrog.l: translate \\[ ] (escaped space) to space,
+ accept '\" as *roff comment,
+ add a space at *roff end-of-line if necessary.
+
+Sat Dec 10 21:37:41 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * man/man1/catman.man1: new
+
+ * soelim/soelim.man1: new
+
+ * src/man.c (display_cat_file): if (COMP_SRC), support straycats
+ with any supported compression extension or none at all.
+ src/man.c (make_cat_file): replace execle() with execve().
+
+ * src/catman.c: added ARG_MAX support and use execve() instead of
+ system(). This should now behave on systems with small execve()
+ argument capacity by batching more, but smaller, man jobs.
+
+ * Makefile: `make all' now equates to `make nls=all'
+
+Thu Dec 8 00:03:12 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version: 2.2a10
+
+ * src/catman.c: new utility.
+ src/man.c (main): minor changes wrt --catman flag.
+
+ * src/paths.h.in (MAN_BIN): add definition for catman.
+
+ * dvi/: provide dvi files of the packages' manual pages.
+
+Tue Dec 6 20:58:19 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * man/man.man1: addition of EXAMPLES section.
+
+ * src/man.c (do_prompt): change message.
+ src/man.c (need_to_rerun): make -u really force an update.
+ src/checkmandirs.c (reset_db_time): new function.
+
+ * src/mydbm.h, src/db_storage.c (ndbm_flopen, ndbm_trunc_flopen):
+ provide file locking mechanism for ndbm.
+ src/db_storage.c (btree_trunc_flopen): renamed (btree_trunc_open),
+ add mode argument to open() call.
+
+ * src/db_storage.c (make_content): add `static' to declaration of
+ (dash).
+
+ * src/man.c (try_db_section): ensure db found file entry is
+ consistent with the physical file, if not, update the db entry
+ before proceeding. Cache consistency should be getting much better
+ in a wide variety of circumstances now. This check is not performed
+ for straycats.
+
+Tue Dec 6 12:05:57 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * man/man.man1, man/mandb.man1: large changes.
+
+ * aclocal.m4, configure.in (AC_PROG_GNU_ROFF): test for GNU nroff
+ src/man.c: Do not use col with GNU nroff -Tlatin1 as (a) it is not
+ needed: see grotty(1) and (b) it is not 8 bit clean. continuation
+ dashes should now reappear.
+
+Wed Nov 23 16:49:48 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/check_mandirs.c (test_manfile): Provide better checking for
+ the existence of both foo.1 and foo.1.gz type problems. This should
+ catch any problems earlier and relieve the db interface code of the
+ job of identifying such problems.
+
+ * src/man.c (manopt_to_env): cater for $MANOPT option arguments
+ that contain spaces (for -r).
+ src/man.c (man_getopt): revise, change duplicate option behaviour,
+ modify -[tTZ] handling and add option -D.
+ src/man/man1/man.man1: document.
+
+ * src/man.c: create LESS_OPTS and LESS_PROMPT and move their
+ definitions to src/paths.h[.in].
+
+ * configure.in: append -s by default to whatever pager is found.
+ favour db.h and -ldb above gdbm.h and -lgdbm.
+ N.B.
+ db creates index.bt
+ gdbm creates index.db
+ ndbm creates index.dir and index.pag
+
+Wed Nov 23 16:46:59 GMT 1994 Zoltan Hidvegi (hzoli@cs.elte.hu)
+
+ * src/man.c: changes relating to (less_options) and (prompt). Add
+ command line support for less' prompt: option -r.
+
+ * man/man1/man.man1: document it.
+
+Sat Nov 19 20:19:39 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version: 2.2a9
+
+ * src/mydbm.h, src/db_storage.c: incorporate completely new
+ database type: a binary tree method using the Berkeley db-1.85.1
+ library. Currently experimental and is not used by default, it has
+ the potential of enhanced speed and easy maintenance as it allows
+ storage of identical keys, thus reducing the amount of work necessary
+ to store and lookup multi sectional manual pages such as manpath.1
+ and manpath.5. During initial tests, the `walk through' algorithm,
+ used in apropos searches was 65% faster and the general database
+ open function is 100% faster when compared with gdbm-1.7.3.
+
+ * src/whatis.c (apropos): #define-optimised for btree database type.
+
+ * src/convert_name.c (convert_name): reorder actions to stop certain
+ catfiles ending up with a double compression extension, for
+ instance: foo.1.gz.gz.
+
+ * src/Makefile, src/man.c: enable -DNO_DEFAULT_TBL_OR_COL as an
+ experiment.
+
+Fri Nov 18 21:00:47 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version: 2.2a8 (not released)
+
+ * configure.in (config_file, config_prefix): Fix behaviour.
+
+ * src/*.[cl], soelim/soelim.l:
+ s,malloc,xmalloc,g
+ s,realloc,xrealloc,g
+ s,strdup,xstrdup,g
+ src/manconfig.h: remove redefinitions of malloc, realloc and strdup.
+
+Thu Nov 17 22:01:11 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/lexgrog.l: changed catfile whatis extraction rules to be a
+ little more forgiving. Increased char array size from 1024 to 2048.
+
+ * mkcatdirs: shell script to create relative cat dirs.
+
+ * src/$PROGS: replaced all occurances of `optional_argument' with
+ `required_argument' in (long_options).
+
+ * src/man.c, src/compression.c, src/straycats.c: ensure that a
+ failed child process is recognised and dealt with (normally exit(0)).
+
+ * src/man.c (make_cat_file): removed need to filter-then-copy if not
+ setuid. [untested]
+
+ * src/man.c, src/mandb.c (main): optional profiling support if
+ __profile__ defined.
+
+ * configure.in (config_file, config_prefix): don't work unless
+ --prefix=<something> is a command line option, temporarily setting
+ them to /etc/man_db.config and /etc respectively.
+
+Wed Nov 16 20:34:54 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version: 2.2a7
+
+ * src/man.c (format_and_display_file): Fix bug which caused
+ `man -l -' to fail. Produce sensible error message when -l file
+ is inaccessable. Allow compressed manual pages to be specified when
+ using -l (must have correct extension)
+
+ * soelim/soelim.l (main): ensure (progname) is the basename of
+ argv[0] .
+
+ * src/manpath.c (main): remove local declaration of (quiet).
+ add `--global' option.
+
+Wed Nov 16 20:29:20 GMT 1994 Markus Armbruster (armbru@pond.sub.org)
+
+ * configure.in: if $prefix=/usr, put config file in /etc else
+ put it in $prefix/etc
+ src/manconfig.h (CONFIG_FILE): move to paths.h.in
+
+ * src/nls.h (LC_MESSAGES): define as (LC_ALL) in all cases where
+ (LC_MESSAGES) is not defined in <locale.h>
+
+ * src/lexgrog.l: #include "manconfig.h" to redefine strdup() to
+ xstrdup()
+
+Tue Nov 15 21:38:19 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/manp.c (is_global_mandir): new
+ src/man.c (locate_page): use it instead of (global_catpath)
+
+ * src/*.h: add suitable predicates to function prototype
+ declarations
+ moved all function declarations to header files
+ src/compression.h.in: renamed to comp_src.h.in
+
+Mon Nov 14 18:17:48 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version: 2.2a6
+
+ * src/hashtable.c, src/hashtable.h (struct nlist): replaced
+ (union) member with (void *) and simplified. Modified users.
+
+ * src/man.c (make_cat_file): fixed NULL ptr reference in call to
+ (execle)
+ src/man.c: determined and fixed memory leaks using Checker.
+
+Mon Nov 14 03:33:37 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/db_storage.c (replace_if_necessary, split_data,
+ list_extensions): new
+ src/db_storage.c (free_content): replaced with (free_mandata_struct)
+ all callers changed
+ src/db_storage.c (split_content_keep, split_content_temp): replaced
+ with (split_content)
+
+Sun Nov 13 13:50:46 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/nls.h: change of macros, add (NLS_INIT, EXIT_FUNC)
+ src/*.c: removed (NLS_CLOSE) macros, adjustments due to above
+ src/version.c (close_catalogue): new
+ configure.in (AC_HAVE_FUNCS): (atexit, on_exit)
+
+ * getmandbver.c: removed
+
+Sat Nov 12 14:18:02 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/security.h: new, contains security macros from src/manconfig.h
+ src/manconfig.h: removed security macros
+ src/security.c, src/security.h: replaced (SYSV_SAVED_IDS) with
+ (BROKEN_LINUX_SAVED_IDS)
+
+ * src/paths.h.in, src/compression.h.in, configure.in: changed
+ compression defines
+ src/paths.h.in: defined (STD_SECTIONS), got rid of (MANPATH_MAIN)
+ src/*.c: removed all (MANPATH_MAIN) defines
+ configure.in: added (COMP_CAT) and (COMP_SRC) definitions
+ src/manconfig.h: removed (COMP_SRC) definition
+
+ * All manual pages: Fixed to be compatible with native *roff
+ implementations having a request argument limit of 6
+
+ * src/db_storage.c (gripe_extract_data, gripe_corrupt_data):
+ new routines
+
+ * All Makefiles: add (exec_prefix, mandir, bindir) where necessary
+
+Sat Nov 12 13:38:59 GMT 1994 Markus Armbruster (armbru@pond.sub.org)
+
+ * soelim/Makefile (install): made more portable
+
+ * src/manconfig.h: changes to (POSIX_SAVED_IDS) definition
+
+ * src/man.c (main): removed unnecessary #ifdef conditions regading
+ (SECURE_MANUID)
+
+Sat Nov 12 13:24:17 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/ult_src.c (ult_src): no longer follow an absolute .so include
+ src/ult_src.c (test_for_include): new
+
+Fri Nov 11 10:16:32 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/man.c (manopt_to_env): generalised
+
+ * src/man.c (do_extern): removed (gripe_alloc) call,
+ modified callers
+ src/manp.c: removed (gripe_alloc) calls, general tidy
+ src/gripes.c (gripe_alloc): removed
+
+ * src/ult_src.c (ult_src): fixed loop when (buf) != NULL
+ changed absolute .so include actions
+ configure.in (AC_HAVE_FUNCS): removed (memmove)
+
+ * src/mydbm.h (copy_datum): added references
+ src/db_storage.c (copy_datum): added function
+ Fixes for `native ndbm' data corruption by Markus Armbruster
+
+ * src/Makefile: removed dbver.o as dependency of manpath
+
+ * aclocal.m4 (AC_FUNC_SPRINTF_COUNT): new file and macro
+ configure.in: use it
+ acconfig.h: add (SPRINTF_CHARCOUNT)
+ src/check_mandirs (add_dir_entries): use it
+ src/whatis.c (display): use it
+
+ * src/check_mandirs.c (test_mandirs): added a (free(exists))
+
+ * src/straycats.c (check_for_stray): Fixes regarding straycats
+ with no compression extension
+
+Fri Nov 11 00:29:15 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * lib/xmalloc.c, lib/xstrdup.c, lib/error.c: replaced
+ lib/strdup.c: removed
+ lib/strstr.c: replaced
+ lib/strsep.c, lib/strspn.c, lib/strcspn.c, lib/ansidecl.h: new
+ configure.in (AC_REPLACE_FUNCS): with respect to above
+
+ * src/check_mandirs.c (testmandirs): (free_hashtab) only if
+ necessary
+
+Thu Nov 10 11:07:52 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * Version: 2.2a5
+
+ * src/man.c (usage, man_getopt, parse_roff_directive, ditroff):
+ add `-Z' option
+ man/man1/man.man1: document it
+
+Wed Nov 9 20:16:35 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * configure.in (prefix, nroff, neqn, groff, soelim, CFLAGS,
+ LDFLAGS): portability changes.
+ Suggestions from Markus Armbruster <armbru@pond.sub.org>
+ gencat/Makefile (CFLAGS, LDFLAGS): definitions removed
+
+ * soelim/Makefile (install): procedural changes
+
+ * src/ult_src.c (ult_softlink): changes regarding S_ISLNK
+
+ * src/manconfig.h: #define __inline
+
+ * src/man.c, src/whatis.c, src/nls.c (LC_MESSAGES): define
+ as LC_ALL if necessary
+
+Tue Nov 8 23:17:22 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+ * src/version.c (ver): aesthetic changes
+ * src/man.c, src/whatis.c, src/manpath.c, src/mandb.c (usage, ver):
+ calling changes
+
+ * src/version.h, src/update_db: removed
+
+ * src/convert_name.c (conver_name): argument changes
+ src/man.c (format_and_display): caller of above changed
+ (need_to_rerun, locate_page): new functions to split (man)
+ (format_and_display_nosave): renamed to format_and_display_file
+
+ * soelim/soelim.l (usage, ver): new functions
+ removal of NLS dependence
+
+ * Version: 2.2a4
diff --git a/docs/INSTALL.autoconf b/docs/INSTALL.autoconf
new file mode 100644
index 00000000..f52c148b
--- /dev/null
+++ b/docs/INSTALL.autoconf
@@ -0,0 +1,142 @@
+Prerequisits
+============
+
+ You will need a recent version of Gnu Make to use the Makefiles
+contained herein.
+
+Basic Installation
+==================
+
+ These are generic installation instructions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, a file
+`config.cache' that saves the results of its tests to speed up
+reconfiguring, and a file `config.log' containing compiler output
+(useful mainly for debugging `configure').
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If at some point `config.cache'
+contains results you don't want to keep, you may remove or edit it.
+
+ The file `configure.in' is used to create `configure' by a program
+called `autoconf'. You only need `configure.in' if you want to change
+it or regenerate `configure' using a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes awhile. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source directory by typing `make clean'. To also remove the files
+ that `configure' created (so you can compile the package for a
+ different kind of computer), type `make distclean'.
+
+Compilers and Options
+=====================
+
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. You can give `configure'
+initial values for variables by setting them in the environment. Using
+a Bourne-compatible shell, you can do that on the command line like
+this:
+ CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
+
+Or on systems that have the `env' program, you can do it like this:
+ env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
+
+Using a Different Build Directory
+=================================
+
+ You can compile the package in a different directory from the one
+containing the source code. Doing so allows you to compile it on more
+than one kind of computer at the same time. To do this, you must use a
+version of `make' that supports the `VPATH' variable, such as GNU
+`make'. `cd' to the directory where you want the object files and
+executables to go and run the `configure' script. `configure'
+automatically checks for the source code in the directory that
+`configure' is in and in `..'.
+
+Installation Names
+==================
+
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+Optional Features
+=================
+
+ Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Sharing Defaults
+================
+
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Operation Controls
+==================
+
+ `configure' recognizes the following options to control how it
+operates.
+
+`--cache-file=FILE'
+ Save the results of the tests in FILE instead of `config.cache'.
+ Set FILE to `/dev/null' to disable caching, for debugging
+ `configure'.
+
+`--help'
+ Print a summary of the options to `configure', and exit.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made.
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`--version'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`configure' also accepts some other, not widely useful, options.
diff --git a/docs/INSTALL.quick b/docs/INSTALL.quick
new file mode 100644
index 00000000..8c6687b1
--- /dev/null
+++ b/docs/INSTALL.quick
@@ -0,0 +1,27 @@
+Full installation details are included in ./README. If you are simply
+upgrading an old version of man_db and know that all of the defaults
+are correct (your config file will NOT be overwritten), you may follow
+the Quick install below.
+
+Quick INSTALL
+=============
+
+ o RUN `./configure <appropriate flags>'
+ o EDIT configuration files/headers if necessary
+ o RUN `make <appropriate variable definitions>'
+ o RUN `make install <appropriate variable definitions>'
+
+Note (1): If you don't know what <appropriate flags> or <appropriate
+variable definitions> mean, you should be reading/following the install
+procedure in ./README instead.
+
+Note (2): You must not replace the `make install' step by copying the
+binaries to wherever you may want them. Various paths are hard coded
+into the binaries during `make' and unless you know exactly what you
+are doing, it is likely that run time errors will occur.
+
+Note (3): If you run make with path/prefix/name_transformation variable
+definitions such as `make prefix=/tmp zsoelim=zsoelim', you must supply
+the same variable definitions to `make install'. In general it is
+better to run `./configure' with the appropriate options rather than
+waiting until the make stage of the build.
diff --git a/docs/NEWS b/docs/NEWS
new file mode 100644
index 00000000..1d5ba730
--- /dev/null
+++ b/docs/NEWS
@@ -0,0 +1,205 @@
+Major changes since man_db-2.3.5:
+
+ Fixes:
+ ------
+
+ o Global databases were not owned by setuid owner (if applicable).
+ As a consequence only mandb could update the databases unless
+ man was run by superuser. Stupid bug.
+
+ o The keyword passed to apropos _never_ matched the first word
+ of any whatis line.
+
+ o FAVOUR_STRAYCATS code (if enabled), did not work properly.
+
+ o zsoelim did not work as advertised.
+
+ Improvements:
+ -------------
+
+ o Man removes it's temporary files upon abnormal termination.
+
+ o apropos does proper word matching rather than the fuzzy
+ matching of 2.3.5. eg. supplying any of the keywords:
+ `ld.so', `a.out', `dynamic', `linker' or `loader' will match
+ the following entry:
+
+ ld.so (8) - a.out dynamic linker/loader
+
+ whereas `a.out' and `loader' used to fail.
+
+ o man/whatis/apropos return with exit code 16 if manual
+ page/file or keyword is not matched. Previously exit code 0
+ was used making it difficult for callers to know if the lookup
+ was successful.
+
+ o addition of German message catalogue.
+
+ o `apropos' and `man -k' do POSIX specified regex matching rather
+ than keyword searches if the environment variable POSIXLY_CORRECT
+ is defined.
+
+ o added glob-only support of native system manual hierarchies
+ on HP-UX, OSF and Solaris operating systems. Improved the
+ whatis parsing code to cope with majority of HP-UX manual pages.
+
+ o ported to NeXTstep.
+
+Major changes since man_db-2.2.1:
+
+ Added support for...
+ --------------------
+
+ o Non-standard section names i.e. multi-character
+
+ o Compressed manual pages.
+ A new utility `zsoelim' is included to correctly handle nroff
+ .so requests that point to a file which has been compressed.
+
+ o Compressed stray cats.
+ By definition, stray cats are not re-creatable as they have no
+ relative source manual page. As they may have non-default
+ compression extensions and may reside on read-only media,
+ stray cats have the same compression support as manual pages.
+
+ o FSSTND proposed `extension' support.
+ Specific package manual pages may be installed in the standard
+ sections but with a package-unique extension appended as in
+ exit(3tcl) - ../man/man3/exit.3tcl. Using the command
+
+ `man -e tcl exit'
+
+ would then display an exit manual page with a tcl extension, if
+ available. Of course, `man 3tcl exit' works as always.
+
+ o FSSTND proposed NLS man subdirectories.
+ Of the form .../man/<locale>/man<sec>/
+
+ o NLS message catalogue hooks.
+ Provision has been made for the programs to emit their messages in
+ a language dependent form.
+
+ o `whatis' referred manual pages.
+ Some manual pages contain relevant information for commands or
+ programs that would not otherwise reference the page.
+ The `whatis' part of the manual page is used to create virtual
+ links to these pages by all of the names mentioned within it.
+ Examples include names such as `.' and `:' referencing the local
+ shell manual page.
+
+ o Catman utility.
+ Used to pre-format the manual pages into cat pages.
+
+ o Operating systems other than Linux.
+ man_db has been reported to compile on the following platforms:
+
+ Linux, SunOS, Solaris, Ultrix, OSF, HP-UX, AIX, IRIX
+
+ (although portability does not extend to support of native
+ manual tree structures on some of these systems, eg. HP-UX)
+
+ o Berkeley DB library routines.
+ This compliments the support of both gdbm and ndbm which already
+ existed. DB databases may be shared across platforms.
+
+ o $MANOPTS environment variable.
+ The environment variable MANOPTS may be set to any string in
+ command line option/argument format. It is parsed by man(1) prior
+ to it's actual command line.
+
+ o Per manual hierarchy cat directory locations.
+ It is possible to redirect your cat pages to other directories or
+ even other file systems.
+
+ o Per manual hierarchy nroff/[tg]roff format scripts.
+ Ability to create custom formatter scripts that are called by
+ man(1) to enable format/display of non-standard manual pages or
+ manual pages requiring a special macro package.
+
+ o Extension of `man -l'.
+ Arguments following -l are interpreted as local files requiring
+ format and display. Extensions are:
+
+ `man -l -' formats and displays stdin.
+ `man -l foo.1.gz' decompresses, formats and displays foo.1.gz.
+
+ o Latin1 manual pages/choice of nroff output device.
+
+ o Viewing of ASCII manual pages formatted for a latin1 output device
+ on a 7 bit ASCII terminal (-7).
+
+ o Whatis and apropos utilities support regex and wildcard matching.
+
+ o checkman.
+ Shell script utility that will find and display duplicated manual
+ pages found across manual page hierarchies.
+
+ o mkcatdirs.
+ Shell script utility to create appropriate cat directories after
+ installation and setup.
+
+ Conceptual improvements
+ -----------------------
+
+ o Replacement of single database with multiple modular db's.
+ Easier integration of additional information into the databases in
+ the future.
+
+ o Both user and global databases share the same name:
+
+ `index.<db-type>'
+
+ where <db-type> could be `bt', `db' or `pag' and `dir'.
+
+ o Databases contain `whatis' text.
+ Makewhatis and text whatis databases are redundant, although
+ whatis and apropos will use the text whatis database for information
+ if they cannot read from a relevant index database.
+
+ o straycats handled without need for `placeholders'.
+
+ o Friendly less(1) prompt.
+ If man(1) uses less(1) as it's pager (dependent on both static and
+ dynamic factors), the prompt is modified to suit the manual page
+ being displayed. The modification performed is also changeable by
+ the user.
+
+ o man_db manual.
+ man_db has a manual that covers the setup, maintenance and use of
+ a generic online manual page system.
+
+ o Modes of operation.
+ The man_db utilities can be compiled with various modes of
+ operation in mind. Eg. man can be stopped from updating databases
+ and/or creating cat files in situations where security is extremely
+ important. See the man_db manual for details.
+
+ Speed improvements
+ ------------------
+
+ o Background compression/saving of cat files.
+ Cat files are compressed and saved in the background, whilst the
+ user is able to browse the formatted page directly.
+
+ o Merge of straycats and makewhatis into mandb.
+ While mandb has slowed, it now incorporates makewhatis and straycats
+ functionality and is much faster as a whole. 2.0a2 used grep/awk,
+ 2.2 used C regex and 2.3 now uses lex sourced C to strip out the
+ whatis information from the raw man or cat files.
+
+ o Berkeley DB support.
+ Provides lower database initialisation overhead as compared with
+ gdbm.
+
+ o Extremely fast whatis(1) searches.
+ whatis(1) uses keyed database lookups to retrieve whatis strings
+ for standard (non regex/wildcard) searches.
+
+ Fixes
+ -----
+
+ o Correct handling of $MANSECT.
+ The environment variable MANSECT is no longer ignored.
+
+ o Acknowledgement of $MANPATH order.
+ manpath elements are searched in the order specified.
diff --git a/docs/ToDo b/docs/ToDo
new file mode 100644
index 00000000..1339bbb4
--- /dev/null
+++ b/docs/ToDo
@@ -0,0 +1,12 @@
+In progress:
+
+* get pre-processors from file at mandb time and store in the db.
+* store .so link in the db.
+* reduce wasted/duplicated text stored within the databases.
+ 10-20% database size reduction so far.
+
+In need of attention:
+
+* clear up the use of troff and/or groff
+* complete configuration file redesign to allow better dynamic determination
+ of programs/paths/extensions etc.
diff --git a/include/Defines.in b/include/Defines.in
new file mode 100644
index 00000000..d463cc9c
--- /dev/null
+++ b/include/Defines.in
@@ -0,0 +1,130 @@
+# @configure_input@
+#
+# Master definition file for the man package.
+#
+# Copyright (C) 1994, Graeme Wilford.
+#
+# You may distribute under the terms of the GNU General Public
+# License as specified in the COPYING file that comes with the man_db
+# distribution.
+#
+# Sat Aug 6 13:28:44 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk):
+
+#---------------------------------------------------------------------#
+# The values defined in this file are used throughout the compilation #
+# of this package: changes should be made here, rather than in the #
+# individual Makefiles. Most of these variables are determined by #
+# ./configure #
+#---------------------------------------------------------------------#
+
+# Programs
+SHELL = /bin/sh
+CC = @CC@
+LEX = @LEX@
+RANLIB = @RANLIB@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+MKINSTALLDIRS = $(top_srcdir)/tools/mkinstalldirs
+MKTAGS = ctags -stv
+
+# C compilation parameters
+DEFS = @DEFS@
+CPPFLAGS = @CPPFLAGS@
+CFLAGS = @CFLAGS@
+LDFLAGS = @LDFLAGS@
+LDLIBS = @LIBS@ #@LEXLIB@
+
+# system directories
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+MSG_DIR = $(top_srcdir)/nls/en_GB
+
+# GNU installation variables
+bindir = $(exec_prefix)/bin
+sbindir = $(exec_prefix)/sbin
+localedir = $(exec_prefix)/lib/locale
+manroot = $(prefix)/share/man
+man1dir = man1
+man5dir = man5
+man8dir = man8
+man1ext = .1
+man5ext = .5
+man8ext = .8
+
+# special rule for sysconfdir
+sysconfdir = $(subst /usr,,$(prefix)/etc)
+
+# The names of the installed programs/manual pages are referred to
+# as variables. They all undergo autoconf transformation rules.
+transform=@program_transform_name@
+
+man = $(shell echo man |sed '$(transform)')
+mandb = $(shell echo mandb |sed '$(transform)')
+catman = $(shell echo catman |sed '$(transform)')
+whatis = $(shell echo whatis |sed '$(transform)')
+apropos = $(shell echo apropos |sed '$(transform)')
+manpath = $(shell echo manpath |sed '$(transform)')
+zsoelim = $(shell echo zsoelim |sed '$(transform)')
+
+config_file = $(sysconfdir)/manpath.config
+sections_file = $(sysconfdir)/man/sections.list
+message_catalogue = man_db
+
+# These are phony in all directories
+DEFAULT_TARGETS = TAGS all install uninstall \
+ mostlyclean clean distclean realclean
+
+# Some misc stuff...
+debug = @debug@
+nls = @nls@
+date = @date@
+date_it = @date_it@
+date_es = @date_es@
+date_de = @date_de@
+date_fr = @date_fr@
+curdate = @curdate@
+curdate_it = @curdate_it@
+curdate_es = @curdate_es@
+curdate_de = @curdate_de@
+curdate_fr = @curdate_fr@
+version = @VERSION@
+man_install_flags = @man_install_flags@
+gencat = $(local_gencat)
+#gencat = $(shell which gencat)
+
+# some path definitions required by the manpage Makefile...
+pager="@pager@"
+troff="@troff@"
+
+#-----------------------------------#
+# Nothing worth changing below here #
+#-----------------------------------#
+
+# ** WARNING ** don't put any non-pattern rules here or they'll
+# become the default for all Makefiles.
+
+# A couple of rules.
+%.d: %.c
+ $(CPP) -M $(CPPFLAGS) $< | \
+ sed -e 's/$*\.o[ ]*/& $@/g' > $@ || (rm -f $@; exit 1)
+
+%.o: %.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
+
+# A rule to re-create subdirectory Makefiles
+ifneq ($(top_srcdir),$(srcdir))
+%: %.in
+ -$(MAKE) -C .. `basename \`pwd\``/$@
+endif
+
+# A message useful in some subdirectories.
+define make_in_root
+@echo " "
+@echo "The value of the nls variable has not yet been determined."
+@echo "Please issue the make command in the directory above this one."
+@echo "Once the value of the nls variable has been determined, it will"
+@echo "be possible to issue make here."
+@echo " "
+@exit 1
+endef
+
diff --git a/include/README b/include/README
new file mode 100644
index 00000000..902e3d6c
--- /dev/null
+++ b/include/README
@@ -0,0 +1 @@
+This directory contains configuration files created by configure.
diff --git a/include/comp_src.h.in b/include/comp_src.h.in
new file mode 100644
index 00000000..353d9e9e
--- /dev/null
+++ b/include/comp_src.h.in
@@ -0,0 +1,59 @@
+/* @configure_input@
+ *
+ * comp_src.h: structure used by compression.c
+ *
+ * Copyright (C), 1994, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+/*--------------------------------------------------------------------------*/
+/* This is where we define the decompressors used to decompress any nroff */
+/* source that we find. All cat pages are compressed with either gzip (if */
+/* available) or compress. This is not the place to define _the_ cat page */
+/* decompressor - see paths.h for that. */
+/* */
+/* To add a decompressor all you need to know is its name (preferrably its */
+/* location), and the unique extension that it gives to files compressed */
+/* with it. Here is an example. You have a compressor named foobar and */
+/* compressed files have an extension of .fb . It is located in /usr/bin */
+/* and requires a -d option to be used as a decompressor. Add the following */
+/* line to the structure below. */
+/* */
+/* {"/usr/bin/foobar -d", "fb", NULL}, */
+/*--------------------------------------------------------------------------*/
+
+#ifdef COMP_SRC
+
+struct compression comp_list[] = {
+
+/* If we have gzip, incorporate the following */
+#ifdef GUNZIP
+ {GUNZIP, "gz", NULL},
+ {GUNZIP, "z", NULL},
+#endif /* GUNZIP */
+
+/* If we have compress, incorporate the following */
+#ifdef UNCOMPRESS
+ {UNCOMPRESS, "Z", NULL},
+#endif /* GUNZIP */
+
+/*------------------------------------------------------*/
+/* Add your decompressor(s) and extension(s) below here */
+/*------------------------------------------------------*/
+
+
+
+/*----------------*/
+/* and above here */
+/*----------------*/
+
+/* ... and the last structure is */
+ {NULL, NULL, NULL}
+};
+
+#endif /* COMP_SRC */
diff --git a/include/config.h.in b/include/config.h.in
new file mode 100644
index 00000000..ee4eabfc
--- /dev/null
+++ b/include/config.h.in
@@ -0,0 +1,333 @@
+/* include/config.h.in. Generated automatically from configure.in by autoheader. */
+
+/* Define if on AIX 3.
+ System headers sometimes define this.
+ We just want to avoid a redefinition error message. */
+#ifndef _ALL_SOURCE
+#undef _ALL_SOURCE
+#endif
+
+/* Define if using alloca.c. */
+#undef C_ALLOCA
+
+/* Define to empty if the keyword does not work. */
+#undef const
+
+/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
+ This function is required for alloca.c support on those systems. */
+#undef CRAY_STACKSEG_END
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef gid_t
+
+/* Define if you have alloca, as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
+#undef HAVE_ALLOCA_H
+
+/* Define if you don't have vprintf but do have _doprnt. */
+#undef HAVE_DOPRNT
+
+/* Define if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define if you have the strcoll function and it is properly defined. */
+#undef HAVE_STRCOLL
+
+/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define if you have <vfork.h>. */
+#undef HAVE_VFORK_H
+
+/* Define if you have the vprintf function. */
+#undef HAVE_VPRINTF
+
+/* Define as __inline if that's what the C compiler calls it. */
+#undef inline
+
+/* Define if on MINIX. */
+#undef _MINIX
+
+/* Define to `long' if <sys/types.h> doesn't define. */
+#undef off_t
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef pid_t
+
+/* Define if the system does not provide POSIX.1 features except
+ with this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define if you need to in order for stat and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define as the return type of signal handlers (int or void). */
+#undef RETSIGTYPE
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+#undef size_t
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown
+ */
+#undef STACK_DIRECTION
+
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef uid_t
+
+/* Define vfork as fork if vfork does not work. */
+#undef vfork
+
+/* define if you want to remove debugging assertions */
+#undef NDEBUG
+
+/* define to the version of the OS, if you have a debian gnu/linux system */
+#undef DEBIAN
+
+/* define to the full version of the program, if you have a debian gnu/linux system */
+#undef DEBVER
+
+/* define to the full email address of the debian maintainer, if you have a debian gnu/linux system */
+#undef DEBMAINT
+
+/* define if you have, and want to use, ndbm interface routines */
+#undef NDBM
+
+/* define if you have, and want to use, gdbm interface routines */
+#undef GDBM
+
+/* define if you have, and want to use, Berkeley database library */
+#undef BTREE
+
+/* define if you have, and want to use, Berkeley database header files */
+#undef BDB_H
+
+/* define if you have troff */
+#undef HAS_TROFF
+
+/* define if you don't have nroff */
+#undef NROFF_MISSING
+
+/* define as the setuid owner of man or undefine if not installing setuid */
+#undef SECURE_MAN_UID
+
+/* define if you have the setlocale() function */
+#undef HAVE_SETLOCALE
+
+/* define if you have the re_comp and re_exec BSD regex routines */
+#undef BSD_REGEX
+
+/* define if you have the regcomp and regexec POSIX regex routines */
+#undef POSIX_REGEX
+
+/* define if nroff is GNU nroff */
+#undef GNU_NROFF
+
+/* define if we are using groff as troff */
+#undef TROFF_IS_GROFF
+
+/* define if your sprintf function returns a count of converted characters */
+#undef ANSI_SPRINTF
+
+/* define COMP_CAT if you have compressors and want to support compressed
+ cat files */
+#undef COMP_CAT
+
+/* define COMP_SRC if you have compressors and want to support compressed
+ manual source */
+#undef COMP_SRC
+
+/* define if your pclose function doesn't handle multiple streams properly */
+#undef BROKEN_PCLOSE
+
+/* define if using <fnmatch.h> rather than "lib/fnmatch.h" */
+#undef HAVE_FNMATCH_H
+
+/* define if using <getopt.h> rather than "lib/getopt.h" */
+#undef HAVE_GETOPT_H
+
+/* define if using <glob.h> rather than "lib/glob.h" */
+#undef HAVE_GLOB_H
+
+/* Define to 1 if NLS is requested. */
+#undef ENABLE_NLS
+
+/* Define as 1 if you have catgets and don't want to use GNU gettext. */
+#undef HAVE_CATGETS
+
+/* Define as 1 if you have gettext and don't want to use GNU gettext. */
+#undef HAVE_GETTEXT
+
+/* Define if your locale.h file contains LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
+
+/* Define to 1 if stpcpy function is available. */
+#undef HAVE_STPCPY
+
+/* Define to the name of the distribution. */
+#undef PACKAGE
+
+/* Define to the version of the distribution. */
+#undef VERSION
+
+/* Define if you have the __argz_count function. */
+#undef HAVE___ARGZ_COUNT
+
+/* Define if you have the __argz_next function. */
+#undef HAVE___ARGZ_NEXT
+
+/* Define if you have the __argz_stringify function. */
+#undef HAVE___ARGZ_STRINGIFY
+
+/* Define if you have the atexit function. */
+#undef HAVE_ATEXIT
+
+/* Define if you have the basename function. */
+#undef HAVE_BASENAME
+
+/* Define if you have the canonicalize_file_name function. */
+#undef HAVE_CANONICALIZE_FILE_NAME
+
+/* Define if you have the dcgettext function. */
+#undef HAVE_DCGETTEXT
+
+/* Define if you have the flock function. */
+#undef HAVE_FLOCK
+
+/* Define if you have the gdbm_exists function. */
+#undef HAVE_GDBM_EXISTS
+
+/* Define if you have the gdbm_setopt function. */
+#undef HAVE_GDBM_SETOPT
+
+/* Define if you have the getcwd function. */
+#undef HAVE_GETCWD
+
+/* Define if you have the getpagesize function. */
+#undef HAVE_GETPAGESIZE
+
+/* Define if you have the getwd function. */
+#undef HAVE_GETWD
+
+/* Define if you have the munmap function. */
+#undef HAVE_MUNMAP
+
+/* Define if you have the on_exit function. */
+#undef HAVE_ON_EXIT
+
+/* Define if you have the putenv function. */
+#undef HAVE_PUTENV
+
+/* Define if you have the realpath function. */
+#undef HAVE_REALPATH
+
+/* Define if you have the rename function. */
+#undef HAVE_RENAME
+
+/* Define if you have the setenv function. */
+#undef HAVE_SETENV
+
+/* Define if you have the setlocale function. */
+#undef HAVE_SETLOCALE
+
+/* Define if you have the setreuid function. */
+#undef HAVE_SETREUID
+
+/* Define if you have the stpcpy function. */
+#undef HAVE_STPCPY
+
+/* Define if you have the strcasecmp function. */
+#undef HAVE_STRCASECMP
+
+/* Define if you have the strchr function. */
+#undef HAVE_STRCHR
+
+/* Define if you have the strcspn function. */
+#undef HAVE_STRCSPN
+
+/* Define if you have the strerror function. */
+#undef HAVE_STRERROR
+
+/* Define if you have the strsep function. */
+#undef HAVE_STRSEP
+
+/* Define if you have the strspn function. */
+#undef HAVE_STRSPN
+
+/* Define if you have the strstr function. */
+#undef HAVE_STRSTR
+
+/* Define if you have the tempnam function. */
+#undef HAVE_TEMPNAM
+
+/* Define if you have the waitpid function. */
+#undef HAVE_WAITPID
+
+/* Define if you have the <argz.h> header file. */
+#undef HAVE_ARGZ_H
+
+/* Define if you have the <dirent.h> header file. */
+#undef HAVE_DIRENT_H
+
+/* Define if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define if you have the <locale.h> header file. */
+#undef HAVE_LOCALE_H
+
+/* Define if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define if you have the <ndir.h> header file. */
+#undef HAVE_NDIR_H
+
+/* Define if you have the <nl_types.h> header file. */
+#undef HAVE_NL_TYPES_H
+
+/* Define if you have the <regex.h> header file. */
+#undef HAVE_REGEX_H
+
+/* Define if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define if you have the <sys/dir.h> header file. */
+#undef HAVE_SYS_DIR_H
+
+/* Define if you have the <sys/file.h> header file. */
+#undef HAVE_SYS_FILE_H
+
+/* Define if you have the <sys/ndir.h> header file. */
+#undef HAVE_SYS_NDIR_H
+
+/* Define if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define if you have the <values.h> header file. */
+#undef HAVE_VALUES_H
+
+/* Define if you have the efence library (-lefence). */
+#undef HAVE_LIBEFENCE
+
+/* Define if you have the i library (-li). */
+#undef HAVE_LIBI
diff --git a/include/manconfig.h.in b/include/manconfig.h.in
new file mode 100644
index 00000000..c8af4648
--- /dev/null
+++ b/include/manconfig.h.in
@@ -0,0 +1,389 @@
+/* @configure_input@ */
+
+/*--------------------------------------------------------------------------*/
+/* This file contains the paths/binary locations of the programs used by */
+/* these utilities and various C pre-processor definitions that modify the */
+/* behaviour of the man_db suite. You may like to check that all of the */
+/* formatters are from the same package. Ie, that we are not using a native */
+/* UNIX nroff with GNU tbl. */
+/*--------------------------------------------------------------------------*/
+
+/* STD_SECTIONS must contain all of your man hierarchy subdirectories. The
+ order is important. Manual pages will be displayed in this order. Ie
+ if "1" comes before "2", then a kill(1) will be displayed in preference to
+ kill(2), or if `man --all kill', it will be displayed first. Section names
+ may be multi-character, but this is non-standard and probably best
+ avoided. */
+
+#define STD_SECTIONS { \
+ "1", \
+ "n", "l", "8", "3", "2", \
+ "5", "4", "9", "6", "7", \
+ "1x", "3x", "5x", "6x", "8x", \
+ "1bind", "3bind", "5bind", "7bind", "8bind", \
+ "1cn", "8cn", \
+ "1m", \
+ "1mh", "5mh", "8mh", \
+ "1netpbm", "3netpbm", "5netpbm", \
+ "1p", \
+ "3blt", \
+ "3curses", "3ncurses", "3form", "3menu", \
+ "3db", "3gdbm", \
+ "3f", \
+ "3gk", \
+ "3mm", \
+ "3paper", \
+ "3pm", \
+ "3pq", \
+ "3pub", \
+ "3qt", \
+ "3readline", \
+ "3t", \
+ "3tk", "3tcl", "3tclx", \
+ "3tix", \
+ "5mm", \
+ "7l", \
+ "7nr", \
+ "8c", \
+ NULL \
+}
+
+/* Some system's man pages require default pre-processing with perhaps tbl
+ or other formatters, DEFAULT_MANROFFSEQ can compensate by adding a list of
+ default pre-processors using the standard syntax of first letter.
+ ie "t" = tbl (the table pre-processor)
+ "te" = tbl, eqn (both the table and equation pre-processors)
+ DEFAULT_MANROFFSEQ can be overridden by command line arguments to man, the
+ environment variable $MANROFFSEQ, and by the manual page being formatted. */
+
+#if defined (__hpux) || (defined (__alpha) && !defined(__GLIBC__))
+# define DEFAULT_MANROFFSEQ "te"
+#elif defined (__ultrix)
+# define DEFAULT_MANROFFSEQ "t"
+#endif
+
+/* uncomment the following line if manual pages require tbl by default */
+#ifndef DEFAULT_MANROFFSEQ
+#define DEFAULT_MANROFFSEQ "t"
+#endif
+
+/* #define:
+ MAN_DB_CREATES - to allow man to create user databases on the fly
+ MAN_DB_UPDATES - to allow man to update databases
+ MAN_CATS - to allow man to create/update cat files */
+
+#define MAN_DB_CREATES
+#define MAN_DB_UPDATES
+#define MAN_CATS
+
+/* By default, man_db will store a whatis referenced manual page in favour
+ of a stray cat page when they both share identical namespace. If you
+ would like to see a stray cat eg. kill(1) in favour of a kill(1) whatis
+ referenced to bash_builtins(1), uncomment the following line. */
+
+/* #define FAVOUR_STRAYCATS */
+
+/* The maximum number of manual page hierarchies expected in the manpath.
+ Also the maximum amount of non-comment lines in the config file. */
+#define MAXDIRS 128
+
+/* CATMODE is the mode of the formatted cat pages that we create. The man_db
+ package can be run in 4 main modes, 3 of which are relatively secure and
+ allow the cats to be non world writable. The `wide open' mode requires
+ CATMODE to be 0666. Edit if necessary, after reading the man_db manual */
+
+#define CATMODE 0644 /* u=rw,go=r */
+
+/* DBMODE is the mode of the created databases. As with CATMODE, secure
+ operation requires that the db's don't have world write access. In the
+ unlikely event that this is required, change to 0666.
+ For increased speed, at the cost of buffer cache, set the sticky bit
+ on databases so that they remain memory resident. To do this, OR the
+ required mode with 1000 and prepend a 0, eg 01644 */
+
+#define DBMODE 0644 /* u=rw,go=r */
+
+/* The name of the databases. DB_EXT depends on the database type in use */
+#define MAN_DB "/index" DB_EXT
+
+/* The locations of the following files were determined by ../configure so
+ some of them may be incorrect. Edit as necessary */
+
+#ifndef PAGER
+# define PAGER "@pager@"
+#endif
+
+#ifndef CAT
+# define CAT "@cat@"
+#endif
+
+#ifndef WEB_BROWSER
+# define WEB_BROWSER "exec @lynx@"
+#endif
+
+#ifndef TR
+# define TR "@tr@"
+#endif
+
+#ifdef HAS_TROFF
+# ifndef TROFF
+# define TROFF "@troff@"
+# endif
+#endif
+
+#ifndef NROFF_MISSING
+# ifndef NROFF
+# define NROFF "@nroff@"
+# endif
+#endif
+
+#ifndef EQN
+# define EQN "@eqn@"
+#endif
+
+#ifndef NEQN
+# define NEQN "@neqn@"
+#endif
+
+#ifndef TBL
+# define TBL "@tbl@"
+#endif
+
+#ifndef COL
+# define COL "@col@"
+#endif
+
+#ifndef VGRIND
+# define VGRIND "@vgrind@"
+#endif
+
+#ifndef REFER
+# define REFER "@refer@"
+#endif
+
+#ifndef GRAP
+# define GRAP "@grap@"
+#endif
+
+#ifndef PIC
+# define PIC "@pic@"
+#endif
+
+/*------------------------------------------------------------------*/
+/* The following definitions are best left alone by the uninitiated */
+/*------------------------------------------------------------------*/
+
+/* less options (i)gnore case on search
+ (x8) set tab stops to 8 spaces
+ (m)ore display style */
+
+#ifndef LESS_OPTS
+# define LESS_OPTS "$LESS\\$-Pm\\:\\$ix8mPm"
+#endif
+
+/* This is a minimal latin1 special characters to ascii translation table */
+#if !defined(TR_SET1) || !defined(TR_SET2)
+# define TR_SET1 " \'\\255\\267\\264\\327\'"
+# define TR_SET2 " \'\\055\\157\\047\\170\'"
+#endif
+
+#ifdef COMP_CAT
+/* This is the default compressor, decompressor and compressed extension.
+ These are used for compressing cat pages. The compressor is likely to
+ be gzip or compress and the extension: .gz or .Z . Please make sure that
+ all of your cat pages have the same extension (whatever that may be) */
+
+# define COMPRESSOR "@compressor@"
+# define DECOMPRESSOR "@decompressor@"
+# define COMPRESS_EXT "@compress_ext@"
+#endif /* COMP_CAT */
+
+#ifdef COMP_SRC
+/* These are the currently supported decompressors. They are used for
+ decompressing cat pages and source nroff. To add further decompressors,
+ you will need to edit comp_src.h[.in] . Help is provided in the file */
+
+# define GUNZIP "@gunzip@"
+# define UNCOMPRESS "@uncompress@"
+#endif /* COMP_SRC */
+
+/*-----------------------------------------------------------------------*/
+/* The things below here shouldn't really be changed unless you really */
+/* know what you are doing. */
+/*-----------------------------------------------------------------------*/
+
+#define VERSION "@VERSION@"
+#define DATE "@date@"
+
+#ifdef inline
+/* autoconf treats inline differently between 2.1 and 2.2+ */
+# define AC_VERSION @man_ac_version@
+
+# if (AC_VERSION >= 1116000) && (AC_VERSION < 2002000)
+ /* autoconf #defines inline to be __inline if the compiler doesn't
+ like it. */
+# undef inline
+# define __inline__
+# define __inline
+
+# elif (AC_VERSION >= 2002000)
+ /* autoconf #defines inline to be either "__inline", "__inline__"
+ or "" if the compiler doesn't like inline */
+# define __inline__ inline
+# define __inline inline
+
+# else
+warning unknown autoconf version, __inline__ may cause problems.
+# endif /* AC_VERSION */
+#endif /* inline */
+
+/* my gcc specs file is hacked to define __profile__ if I compile with
+ the -p or -pg flag, to do this manually (needed if you want to know where
+ gmon.out ended up), uncomment the following line */
+/* #define __profile__ */
+
+/* if testing BTREE db allowing inserts of identical keys, uncomment below */
+/* #define FAST_BTREE */
+
+/* If running checker, support the garbage detector, else don't */
+#ifdef __CHECKER__
+extern void __chkr_garbage_detector(void);
+# define chkr_garbage_detector() __chkr_garbage_detector()
+#else
+# define chkr_garbage_detector()
+#endif
+
+/* Don't define debug at all, else you'll either engage all debug messages (1)
+ or you'll stop the utilities from being runtime debuggable (0) */
+/* #define debug 0 */
+
+/* This structure definition is only really needed if COMP_SRC==1, but it is
+ used in external declarations quite freely, so it's included
+ unconditionally */
+
+struct compression {
+ char *prog;
+ char *ext;
+ char *file;
+};
+
+/* depending on the compiler ... */
+#if __STDC__
+# define VOID void
+#else
+# define VOID char
+#endif
+
+/*-------------------------------------*/
+/* Now for some function prototypes... */
+/*-------------------------------------*/
+
+/* some library function declarations */
+#include <stddef.h> /* for size_t */
+extern VOID *xmalloc(size_t n);
+extern VOID *xrealloc(void *p, size_t n);
+extern __inline__ char *xstrdup(const char *string);
+
+/* ver.c */
+#ifndef STATIC_VER
+extern __inline__ void ver(void);
+#endif /* !STATIC_VER */
+
+/* compression.c */
+extern struct compression *comp_info(char *filename);
+extern struct compression *comp_file(char *filename);
+extern char *decompress(char *filename, struct compression *comp);
+extern __inline__ void remove_ztemp(void);
+extern __inline__ char *get_ztemp(void);
+
+/* security.c */
+extern __inline__ void drop_effective_privs(void);
+extern __inline__ void regain_effective_privs(void);
+extern int do_system_drop_privs(const char *command);
+extern int remove_with_dropped_privs(const char *filename);
+
+/* check_mandirs.c */
+extern void test_manfile(char *file, const char *path);
+extern void update_db_time(void);
+extern void reset_db_time(void);
+extern short create_db(const char *manpath);
+extern short update_db(const char *manpath);
+
+/* straycats.c */
+extern int straycats(char *mandir);
+
+/* lexgrog.l */
+struct lexgrog;
+extern int find_name(char *file, char *filename, struct lexgrog *p_lg);
+
+/* util.c */
+extern char *strappend(char *, ...);
+extern int is_newer(char *fa, char *fb);
+extern int is_directory(char *path);
+extern __inline__ int do_system(const char *command);
+extern char *mkdbname(const char *path);
+
+#if !defined(HAVE_BASENAME)
+extern char *basename();
+#else /* HAVE_BASENAME */
+extern char *basename(const char *path);
+#endif /* !HAVE_BASENAME */
+
+#ifndef HAVE_STRSEP
+extern char *strsep(char **stringp, const char *delim);
+#endif /* !HAVE_STRSEP */
+
+#ifndef debug
+extern int debug; /* shows whether -d issued */
+#endif /* !debug */
+
+extern int quiet; /* be quiet(er) if 1 */
+extern char *program_name; /* the basename of the program (as called) */
+
+/*--------------------------*/
+/* Some general definitions */
+/*--------------------------*/
+
+#define MANPAGE 0
+#define CATPAGE 1
+
+/* exit codes */
+#define OK 0 /* success */
+#define FAIL 1 /* usage or syntax error */
+#define FATAL 2 /* operational error */
+#define CHILD_FAIL 3 /* child failed */
+#define INTERRUPTED 4 /* Interrupted by signal */
+#define NOT_FOUND 16 /* No action was taken */
+
+/* string macros */
+#define STREQ(a,b) (strcmp(a,b) == 0)
+#define STRNEQ(a,b,d) (strncmp(a,b,d) == 0)
+
+/* FSSTND directories */
+#define CAT_ROOT "/var/catman" /* required by fsstnd() */
+#define MAN_ROOT "/usr" /* required by fsstnd() */
+/* FHS directories */
+#define FHS_CAT_ROOT "/var/cache/man" /* required by fsstnd() */
+#define FHS_MAN_ROOT "/usr/share" /* required by fsstnd() */
+
+/* some special database keys used for storing important info */
+#define VER_KEY "$version$" /* version key */
+#define VER_ID "2.3.1" /* version content */
+#define KEY "$mtime$" /* `time of last update' key */
+
+/* The owner of man (if setuid) is the definition of SECURE_MAN_UID */
+#define MAN_OWNER SECURE_MAN_UID
+
+/* defines the ordered list of filters detected by lexgrog */
+enum { TBL_FILTER=0 /* tbl */
+ , EQN_FILTER /* eqn */
+ , PIC_FILTER /* pic */
+ , REF_FILTER /* refer */
+ , MAX_FILTERS /* delimiter */
+ };
+
+typedef struct lexgrog {
+ int type;
+ char * whatis;
+ char * filters;
+}lexgrog;
diff --git a/include/sections.list b/include/sections.list
new file mode 100644
index 00000000..b4faeb00
--- /dev/null
+++ b/include/sections.list
@@ -0,0 +1,32 @@
+ORDER = "1", "n", "l", "8", "3", "2", "5", "4", "9", "6", "7"
+LIST =
+"1", "n", "l", "8", "3", "2", \
+"5", "4", "9", "6", "7", \
+"1x", "3x", "5x", "6x", "8x", \
+"1bind", "3bind", "5bind", "7bind", "8bind", \
+"1cn", "8cn", \
+"1m", \
+"1mh", "5mh", "8mh", \
+"1netpbm", "3netpbm", "5netpbm", \
+"1p", \
+"3blt", \
+"3curses", "3ncurses", "3form", "3menu", \
+"3db", "3gdbm", \
+"3f", \
+"3gk", \
+"3mm", \
+"3paper", \
+"3pm", \
+"3pq", \
+"3pub", \
+"3qt", \
+"3readline", \
+"3t", \
+"3tk", "3tcl", "3tclx", \
+"3tix", \
+"5mm", \
+"7l", \
+"7nr", \
+"8c", \
+
+
diff --git a/intl/ChangeLog b/intl/ChangeLog
new file mode 100644
index 00000000..ecff6f6b
--- /dev/null
+++ b/intl/ChangeLog
@@ -0,0 +1,1022 @@
+1997-09-06 02:10 Ulrich Drepper <drepper@cygnus.com>
+
+ * intlh.inst.in: Reformat copyright.
+
+1997-08-19 15:22 Ulrich Drepper <drepper@cygnus.com>
+
+ * dcgettext.c (DCGETTEXT): Remove wrong comment.
+
+1997-08-16 00:13 Ulrich Drepper <drepper@cygnus.com>
+
+ * Makefile.in (install-data): Don't change directory to install.
+
+1997-08-01 14:30 Ulrich Drepper <drepper@cygnus.com>
+
+ * cat-compat.c: Fix copyright.
+
+ * localealias.c: Don't define strchr unless !HAVE_STRCHR.
+
+ * loadmsgcat.c: Update copyright. Fix typos.
+
+ * l10nflist.c: Don't define strchr unless !HAVE_STRCHR.
+ (_nl_make_l10nflist): Handle sponsor and revision correctly.
+
+ * gettext.c: Update copyright.
+ * gettext.h: Likewise.
+ * hash-string.h: Likewise.
+
+ * finddomain.c: Remoave dead code. Define strchr only if
+ !HAVE_STRCHR.
+
+ * explodename.c: Include <sys/types.h>.
+
+ * explodename.c: Reformat copyright text.
+ (_nl_explode_name): Fix typo.
+
+ * dcgettext.c: Define and use __set_errno.
+ (guess_category_value): Don't use setlocale if HAVE_LC_MESSAGES is
+ not defined.
+
+ * bindtextdom.c: Pretty printing.
+
+1997-05-01 02:25 Ulrich Drepper <drepper@cygnus.com>
+
+ * dcgettext.c (guess_category_value): Don't depend on
+ HAVE_LC_MESSAGES. We don't need the macro here.
+ Patch by Bruno Haible <haible@ilog.fr>.
+
+ * cat-compat.c (textdomain): DoN't refer to HAVE_SETLOCALE_NULL
+ macro. Instead use HAVE_LOCALE_NULL and define it when using
+ glibc, as in dcgettext.c.
+ Patch by Bruno Haible <haible@ilog.fr>.
+
+ * Makefile.in (CPPFLAGS): New variable. Reported by Franc,ois
+ Pinard.
+
+Mon Mar 10 06:51:17 1997 Ulrich Drepper <drepper@cygnus.com>
+
+ * Makefile.in: Implement handling of libtool.
+
+ * gettextP.h: Change data structures for use of generic lowlevel
+ i18n file handling.
+
+Wed Dec 4 20:21:18 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * textdomain.c: Put parentheses around arguments of memcpy macro
+ definition.
+ * localealias.c: Likewise.
+ * l10nflist.c: Likewise.
+ * finddomain.c: Likewise.
+ * bindtextdom.c: Likewise.
+ Reported by Thomas Esken.
+
+Mon Nov 25 22:57:51 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * textdomain.c: Move definition of `memcpy` macro to right
+ position.
+
+Fri Nov 22 04:01:58 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * finddomain.c [!HAVE_STRING_H && !_LIBC]: Define memcpy using
+ bcopy if not already defined. Reported by Thomas Esken.
+ * bindtextdom.c: Likewise.
+ * l10nflist.c: Likewise.
+ * localealias.c: Likewise.
+ * textdomain.c: Likewise.
+
+Tue Oct 29 11:10:27 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * Makefile.in (libdir): Change to use exec_prefix instead of
+ prefix. Reported by Knut-HåvardAksnes <etokna@eto.ericsson.se>.
+
+Sat Aug 31 03:07:09 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * l10nflist.c (_nl_normalize_codeset): We convert to lower case,
+ so don't prepend uppercase `ISO' for only numeric arg.
+
+Fri Jul 19 00:15:46 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * l10nflist.c: Move inclusion of argz.h, ctype.h, stdlib.h after
+ definition of _GNU_SOURCE. Patch by Roland McGrath.
+
+ * Makefile.in (uninstall): Fix another bug with `for' loop and
+ empty arguments. Patch by Jim Meyering. Correct name os
+ uninstalled files: no intl- prefix anymore.
+
+ * Makefile.in (install-data): Again work around shells which
+ cannot handle mpty for list. Reported by Jim Meyering.
+
+Sat Jul 13 18:11:35 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * Makefile.in (install): Split goal. Now depend on install-exec
+ and install-data.
+ (install-exec, install-data): New goals. Created from former
+ install goal.
+ Reported by Karl Berry.
+
+Sat Jun 22 04:58:14 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * Makefile.in (MKINSTALLDIRS): New variable. Path to
+ mkinstalldirs script.
+ (install): use MKINSTALLDIRS variable or if the script is not present
+ try to find it in the $top_scrdir).
+
+Wed Jun 19 02:56:56 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * l10nflist.c: Linux libc *partly* includes the argz_* functions.
+ Grr. Work around by renaming the static version and use macros
+ for renaming.
+
+Tue Jun 18 20:11:17 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * l10nflist.c: Correct presence test macros of __argz_* functions.
+
+ * l10nflist.c: Include <argz.h> based on test of it instead when
+ __argz_* functions are available.
+ Reported by Andreas Schwab.
+
+Thu Jun 13 15:17:44 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * explodename.c, l10nflist.c: Define NULL for dumb systems.
+
+Tue Jun 11 17:05:13 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * intlh.inst.in, libgettext.h (dcgettext): Rename local variable
+ result to __result to prevent name clash.
+
+ * l10nflist.c, localealias.c, dcgettext.c: Define _GNU_SOURCE to
+ get prototype for stpcpy and strcasecmp.
+
+ * intlh.inst.in, libgettext.h: Move declaration of
+ `_nl_msg_cat_cntr' outside __extension__ block to prevent warning
+ from gcc's -Wnested-extern option.
+
+Fri Jun 7 01:58:00 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * Makefile.in (install): Remove comment.
+
+Thu Jun 6 17:28:17 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * Makefile.in (install): Work around for another Buglix stupidity.
+ Always use an `else' close for `if's. Reported by Nelson Beebe.
+
+ * Makefile.in (intlh.inst): Correct typo in phony rule.
+ Reported by Nelson Beebe.
+
+Thu Jun 6 01:49:52 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * dcgettext.c (read_alias_file): Rename variable alloca_list to
+ block_list as the macro calls assume.
+ Patch by Eric Backus.
+
+ * localealias.c [!HAVE_ALLOCA]: Define alloca as macro using
+ malloc.
+ (read_alias_file): Rename varriabe alloca_list to block_list as the
+ macro calls assume.
+ Patch by Eric Backus.
+
+ * l10nflist.c: Correct conditional for <argz.h> inclusion.
+ Reported by Roland McGrath.
+
+ * Makefile.in (all): Depend on all-@USE_INCLUDED_LIBINTL@, not
+ all-@USE_NLS@.
+
+ * Makefile.in (install): intlh.inst comes from local dir, not
+ $(srcdir).
+
+ * Makefile.in (intlh.inst): Special handling of this goal. If
+ used in gettext, this is really a rul to construct this file. If
+ used in any other package it is defined as a .PHONY rule with
+ empty body.
+
+ * finddomain.c: Extract locale file information handling into
+ l10nfile.c. Rename local stpcpy__ function to stpcpy.
+
+ * dcgettext.c (stpcpy): Add local definition.
+
+ * l10nflist.c: Solve some portability problems. Patches partly by
+ Thomas Esken. Add local definition of stpcpy.
+
+Tue Jun 4 02:47:49 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * intlh.inst.in: Don't depend including <locale.h> on
+ HAVE_LOCALE_H. Instead configure must rewrite this fiile
+ depending on the result of the configure run.
+
+ * Makefile.in (install): libintl.inst is now called intlh.inst.
+ Add rules for updating intlh.inst from intlh.inst.in.
+
+ * libintl.inst: Renamed to intlh.inst.in.
+
+ * localealias.c, dcgettext.c [__GNUC__]: Define HAVE_ALLOCA to 1
+ because gcc has __buitlin_alloca.
+ Reported by Roland McGrath.
+
+Mon Jun 3 00:32:16 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * Makefile.in (installcheck): New goal to fulfill needs of
+ automake's distcheck.
+
+ * Makefile.in (install): Reorder commands so that VERSION is
+ found.
+
+ * Makefile.in (gettextsrcdir): Now use subdirectory intl/ in
+ @datadir@/gettext.
+ (COMSRCS): Add l10nfile.c.
+ (OBJECTS): Add l10nfile.o.
+ (DISTFILES): Rename to DISTFILE.normal. Remove $(DISTFILES.common).
+ (DISTFILE.gettext): Remove $(DISTFILES.common).
+ (all-gettext): Remove goal.
+ (install): If $(PACKAGE) = gettext install, otherwose do nothing. No
+ package but gettext itself should install libintl.h + headers.
+ (dist): Extend goal to work for gettext, too.
+ (dist-gettext): Remove goal.
+
+ * dcgettext.c [!HAVE_ALLOCA]: Define macro alloca by using malloc.
+
+Sun Jun 2 17:33:06 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * loadmsgcat.c (_nl_load_domain): Parameter is now comes from
+ find_l10nfile.
+
+Sat Jun 1 02:23:03 1996 Ulrich Drepper <drepper@cygnus.com>
+
+ * l10nflist.c (__argz_next): Add definition.
+
+ * dcgettext.c [!HAVE_ALLOCA]: Add code for handling missing alloca
+ code. Use new l10nfile handling.
+
+ * localealias.c [!HAVE_ALLOCA]: Add code for handling missing
+ alloca code.
+
+ * l10nflist.c: Initial revision.
+
+Tue Apr 2 18:51:18 1996 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (all-gettext): New goal. Same as all-yes.
+
+Thu Mar 28 23:01:22 1996 Karl Eichwalder <ke@ke.central.de>
+
+ * Makefile.in (gettextsrcdir): Define using @datadir@.
+
+Tue Mar 26 12:39:14 1996 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c: Include <ctype.h>. Reported by Roland McGrath.
+
+Sat Mar 23 02:00:35 1996 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c (stpcpy): Rename to stpcpy__ to prevent clashing
+ with external declaration.
+
+Sat Mar 2 00:47:09 1996 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (all-no): Rename from all_no.
+
+Sat Feb 17 00:25:59 1996 Ulrich Drepper <drepper@myware>
+
+ * gettextP.h [loaded_domain]: Array `successor' must now contain up
+ to 63 elements (because of codeset name normalization).
+
+ * finddomain.c: Implement codeset name normalization.
+
+Thu Feb 15 04:39:09 1996 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (all): Define to `all-@USE_NLS@'.
+ (all-yes, all_no): New goals. `all-no' is noop, `all-yes'
+ is former all.
+
+Mon Jan 15 21:46:01 1996 Howard Gayle <howard@hal.com>
+
+ * localealias.c (alias_compare): Increment string pointers in loop
+ of strcasecmp replacement.
+
+Fri Dec 29 21:16:34 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (install-src): Who commented this goal out ? :-)
+
+Fri Dec 29 15:08:16 1995 Ulrich Drepper <drepper@myware>
+
+ * dcgettext.c (DCGETTEXT): Save `errno'. Failing system calls
+ should not effect it because a missing catalog is no error.
+ Reported by Harald K<o:>nig <koenig@tat.physik.uni-tuebingen.de>.
+
+Tue Dec 19 22:09:13 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (Makefile): Explicitly use $(SHELL) for running
+ shell scripts.
+
+Fri Dec 15 17:34:59 1995 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
+
+ * Makefile.in (install-src): Only install library and header when
+ we use the own implementation. Don't do it when using the
+ system's gettext or catgets functions.
+
+ * dcgettext.c (find_msg): Must not swap domain->hash_size here.
+
+Sat Dec 9 16:24:37 1995 Ulrich Drepper <drepper@myware>
+
+ * localealias.c, libintl.inst, libgettext.h, hash-string.h,
+ gettextP.h, finddomain.c, dcgettext.c, cat-compat.c:
+ Use PARAMS instead of __P. Suggested by Roland McGrath.
+
+Tue Dec 5 11:39:14 1995 Larry Schwimmer <rosebud@cyclone.stanford.edu>
+
+ * libgettext.h: Use `#if !defined (_LIBINTL_H)' instead of `#if
+ !_LIBINTL_H' because Solaris defines _LIBINTL_H as empty.
+
+Mon Dec 4 15:42:07 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (install-src):
+ Install libintl.inst instead of libintl.h.install.
+
+Sat Dec 2 22:51:38 1995 Marcus Daniels <marcus@sysc.pdx.edu>
+
+ * cat-compat.c (textdomain):
+ Reverse order in which files are tried you load. First
+ try local file, when this failed absolute path.
+
+Wed Nov 29 02:03:53 1995 Nelson H. F. Beebe <beebe@math.utah.edu>
+
+ * cat-compat.c (bindtextdomain): Add missing { }.
+
+Sun Nov 26 18:21:41 1995 Ulrich Drepper <drepper@myware>
+
+ * libintl.inst: Add missing __P definition. Reported by Nelson Beebe.
+
+ * Makefile.in:
+ Add dummy `all' and `dvi' goals. Reported by Tom Tromey.
+
+Sat Nov 25 16:12:01 1995 Franc,ois Pinard <pinard@iro.umontreal.ca>
+
+ * hash-string.h: Capitalize arguments of macros.
+
+Sat Nov 25 12:01:36 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (DISTFILES): Prevent files names longer than 13
+ characters. libintl.h.glibc->libintl.glibc,
+ libintl.h.install->libintl.inst. Reported by Joshua R. Poulson.
+
+Sat Nov 25 11:31:12 1995 Eric Backus <ericb@lsid.hp.com>
+
+ * dcgettext.c: Fix bug in preprocessor conditionals.
+
+Sat Nov 25 02:35:27 1995 Nelson H. F. Beebe <beebe@math.utah.edu>
+
+ * libgettext.h: Solaris cc does not understand
+ #if !SYMBOL1 && !SYMBOL2. Sad but true.
+
+Thu Nov 23 16:22:14 1995 Ulrich Drepper <drepper@myware>
+
+ * hash-string.h (hash_string):
+ Fix for machine with >32 bit `unsigned long's.
+
+ * dcgettext.c (DCGETTEXT):
+ Fix horrible bug in loop for alternative translation.
+
+Thu Nov 23 01:45:29 1995 Ulrich Drepper <drepper@myware>
+
+ * po2tbl.sed.in, linux-msg.sed, xopen-msg.sed:
+ Some further simplifications in message number generation.
+
+Mon Nov 20 21:08:43 1995 Ulrich Drepper <drepper@myware>
+
+ * libintl.h.glibc: Use __const instead of const in prototypes.
+
+ * Makefile.in (install-src):
+ Install libintl.h.install instead of libintl.h. This
+ is a stripped-down version. Suggested by Peter Miller.
+
+ * libintl.h.install, libintl.h.glibc: Initial revision.
+
+ * localealias.c (_nl_expand_alias, read_alias_file):
+ Protect prototypes in type casts by __P.
+
+Tue Nov 14 16:43:58 1995 Ulrich Drepper <drepper@myware>
+
+ * hash-string.h: Correct prototype for hash_string.
+
+Sun Nov 12 12:42:30 1995 Ulrich Drepper <drepper@myware>
+
+ * hash-string.h (hash_string): Add prototype.
+
+ * gettextP.h: Fix copyright.
+ (SWAP): Add prototype.
+
+Wed Nov 8 22:56:33 1995 Ulrich Drepper <drepper@myware>
+
+ * localealias.c (read_alias_file): Forgot sizeof.
+ Avoid calling *printf function. This introduces a big overhead.
+ Patch by Roland McGrath.
+
+Tue Nov 7 14:21:08 1995 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c, cat-compat.c: Wrong indentation in #if for stpcpy.
+
+ * finddomain.c (stpcpy):
+ Define substitution function local. The macro was to flaky.
+
+ * cat-compat.c: Fix typo.
+
+ * xopen-msg.sed, linux-msg.sed:
+ While bringing message number to right place only accept digits.
+
+ * linux-msg.sed, xopen-msg.sed: Now that the counter does not have
+ leading 0s we don't need to remove them. Reported by Marcus
+ Daniels.
+
+ * Makefile.in (../po/cat-id-tbl.o): Use $(top_srdir) in
+ dependency. Reported by Marcus Daniels.
+
+ * cat-compat.c: (stpcpy) [!_LIBC && !HAVE_STPCPY]: Define replacement.
+ Generally cleanup using #if instead of #ifndef.
+
+ * Makefile.in: Correct typos in comment. By Franc,ois Pinard.
+
+Mon Nov 6 00:27:02 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (install-src): Don't install libintl.h and libintl.a
+ if we use an available gettext implementation.
+
+Sun Nov 5 22:02:08 1995 Ulrich Drepper <drepper@myware>
+
+ * libgettext.h: Fix typo: HAVE_CATGETTS -> HAVE_CATGETS. Reported
+ by Franc,ois Pinard.
+
+ * libgettext.h: Use #if instead of #ifdef/#ifndef.
+
+ * finddomain.c:
+ Comments describing what has to be done should start with FIXME.
+
+Sun Nov 5 19:38:01 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (DISTFILES): Split. Use DISTFILES with normal meaning.
+ DISTFILES.common names the files common to both dist goals.
+ DISTFILES.gettext are the files only distributed in GNU gettext.
+
+Sun Nov 5 17:32:54 1995 Ulrich Drepper <drepper@myware>
+
+ * dcgettext.c (DCGETTEXT): Correct searching in derived locales.
+ This was necessary since a change in _nl_find_msg several weeks
+ ago. I really don't know this is still not fixed.
+
+Sun Nov 5 12:43:12 1995 Ulrich Drepper <drepper@myware>
+
+ * loadmsgcat.c (_nl_load_domain): Test for FILENAME == NULL. This
+ might mark a special condition.
+
+ * finddomain.c (make_entry_rec): Don't make illegal entry as decided.
+
+ * Makefile.in (dist): Suppress error message when ln failed.
+ Get files from $(srcdir) explicitly.
+
+ * libgettext.h (gettext_const): Rename to gettext_noop.
+
+Fri Nov 3 07:36:50 1995 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c (make_entry_rec):
+ Protect against wrong locale names by testing mask.
+
+ * libgettext.h (gettext_const): Add macro definition.
+ Capitalize macro arguments.
+
+Thu Nov 2 23:15:51 1995 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c (_nl_find_domain):
+ Test for pointer != NULL before accessing value.
+ Reported by Tom Tromey.
+
+ * gettext.c (NULL):
+ Define as (void*)0 instad of 0. Reported by Franc,ois Pinard.
+
+Mon Oct 30 21:28:52 1995 Ulrich Drepper <drepper@myware>
+
+ * po2tbl.sed.in: Serious typo bug fixed by Jim Meyering.
+
+Sat Oct 28 23:20:47 1995 Ulrich Drepper <drepper@myware>
+
+ * libgettext.h: Disable dcgettext optimization for Solaris 2.3.
+
+ * localealias.c (alias_compare):
+ Peter Miller reported that tolower in some systems is
+ even dumber than I thought. Protect call by `isupper'.
+
+Fri Oct 27 22:22:51 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (libdir, includedir): New variables.
+ (install-src): Install libintl.a and libintl.h in correct dirs.
+
+Fri Oct 27 22:07:29 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (SOURCES): Fix typo: intrl.compat.c -> intl-compat.c.
+
+ * po2tbl.sed.in: Patch for buggy SEDs by Christian von Roques.
+
+ * localealias.c:
+ Fix typo and superflous test. Reported by Christian von Roques.
+
+Fri Oct 6 11:52:05 1995 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c (_nl_find_domain):
+ Correct some remainder from the pre-CEN syntax. Now
+ we don't have a constant number of successors anymore.
+
+Wed Sep 27 21:41:13 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (DISTFILES): Add libintl.h.glibc.
+
+ * Makefile.in (dist-libc): Add goal for packing sources for glibc.
+ (COMSRCS, COMHDRS): Splitted to separate sources shared with glibc.
+
+ * loadmsgcat.c: Forget to continue #if line.
+
+ * localealias.c:
+ [_LIBC]: Rename strcasecmp to __strcasecmp to keep ANSI C name
+ space clean.
+
+ * dcgettext.c, finddomain.c: Better comment to last change.
+
+ * loadmsgcat.c:
+ [_LIBC]: Rename fstat, open, close, read, mmap, and munmap to
+ __fstat, __open, __close, __read, __mmap, and __munmap resp
+ to keep ANSI C name space clean.
+
+ * finddomain.c:
+ [_LIBC]: Rename stpcpy to __stpcpy to keep ANSI C name space clean.
+
+ * dcgettext.c:
+ [_LIBC]: Rename getced and stpcpy to __getcwd and __stpcpy resp to
+ keep ANSI C name space clean.
+
+ * libgettext.h:
+ Include sys/types.h for those old SysV systems out there.
+ Reported by Francesco Potorti`.
+
+ * loadmsgcat.c (use_mmap): Define if compiled for glibc.
+
+ * bindtextdom.c: Include all those standard headers
+ unconditionally if _LIBC is defined.
+
+ * finddomain.c: Fix 2 times defiend -> defined.
+
+ * textdomain.c: Include libintl.h instead of libgettext.h when
+ compiling for glibc. Include all those standard headers
+ unconditionally if _LIBC is defined.
+
+ * localealias.c, loadmsgcat.c: Prepare to be compiled in glibc.
+
+ * gettext.c:
+ Include libintl.h instead of libgettext.h when compiling for glibc.
+ Get NULL from stddef.h if we compile for glibc.
+
+ * finddomain.c: Include libintl.h instead of libgettext.h when
+ compiling for glibc. Include all those standard headers
+ unconditionally if _LIBC is defined.
+
+ * dcgettext.c: Include all those standard headers unconditionally
+ if _LIBC is defined.
+
+ * dgettext.c: If compiled in glibc include libintl.h instead of
+ libgettext.h.
+ (locale.h): Don't rely on HAVE_LOCALE_H when compiling for glibc.
+
+ * dcgettext.c: If compiled in glibc include libintl.h instead of
+ libgettext.h.
+ (getcwd): Don't rely on HAVE_GETCWD when compiling for glibc.
+
+ * bindtextdom.c:
+ If compiled in glibc include libintl.h instead of libgettext.h.
+
+Mon Sep 25 22:23:06 1995 Ulrich Drepper <drepper@myware>
+
+ * localealias.c (_nl_expand_alias): Don't call bsearch if NMAP <= 0.
+ Reported by Marcus Daniels.
+
+ * cat-compat.c (bindtextdomain):
+ String used in putenv must not be recycled.
+ Reported by Marcus Daniels.
+
+ * libgettext.h (__USE_GNU_GETTEXT):
+ Additional symbol to signal that we use GNU gettext
+ library.
+
+ * cat-compat.c (bindtextdomain):
+ Fix bug with the strange stpcpy replacement.
+ Reported by Nelson Beebe.
+
+Sat Sep 23 08:23:51 1995 Ulrich Drepper <drepper@myware>
+
+ * cat-compat.c: Include <string.h> for stpcpy prototype.
+
+ * localealias.c (read_alias_file):
+ While expand strdup code temporary variable `cp' hided
+ higher level variable with same name. Rename to `tp'.
+
+ * textdomain.c (textdomain):
+ Avoid warning by using temporary variable in strdup code.
+
+ * finddomain.c (_nl_find_domain): Remove unused variable `application'.
+
+Thu Sep 21 15:51:44 1995 Ulrich Drepper <drepper@myware>
+
+ * localealias.c (alias_compare):
+ Use strcasecmp() only if available. Else use
+ implementation in place.
+
+ * intl-compat.c:
+ Wrapper functions now call *__ functions instead of __*.
+
+ * libgettext.h: Declare prototypes for *__ functions instead for __*.
+
+ * cat-compat.c, loadmsgcat.c:
+ Don't use xmalloc, xstrdup, and stpcpy. These functions are not part
+ of the standard libc and so prevent libintl.a from being used
+ standalone.
+
+ * bindtextdom.c:
+ Don't use xmalloc, xstrdup, and stpcpy. These functions are not part
+ of the standard libc and so prevent libintl.a from being used
+ standalone.
+ Rename to bindtextdomain__ if not used in GNU C Library.
+
+ * dgettext.c:
+ Rename function to dgettext__ if not used in GNU C Library.
+
+ * gettext.c:
+ Don't use xmalloc, xstrdup, and stpcpy. These functions are not part
+ of the standard libc and so prevent libintl.a from being used
+ standalone.
+ Functions now called gettext__ if not used in GNU C Library.
+
+ * dcgettext.c, localealias.c, textdomain.c, finddomain.c:
+ Don't use xmalloc, xstrdup, and stpcpy. These functions are not part
+ of the standard libc and so prevent libintl.a from being used
+ standalone.
+
+Sun Sep 17 23:14:49 1995 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c: Correct some bugs in handling of CEN standard
+ locale definitions.
+
+Thu Sep 7 01:49:28 1995 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c: Implement CEN syntax.
+
+ * gettextP.h (loaded_domain): Extend number of successors to 31.
+
+Sat Aug 19 19:25:29 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (aliaspath): Remove path to X11 locale dir.
+
+ * Makefile.in: Make install-src depend on install. This helps
+ gettext to install the sources and other packages can use the
+ install goal.
+
+Sat Aug 19 15:19:33 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (uninstall): Remove stuff installed by install-src.
+
+Tue Aug 15 13:13:53 1995 Ulrich Drepper <drepper@myware>
+
+ * VERSION.in: Initial revision.
+
+ * Makefile.in (DISTFILES):
+ Add VERSION file. This is not necessary for gettext, but
+ for other packages using this library.
+
+Tue Aug 15 06:16:44 1995 Ulrich Drepper <drepper@myware>
+
+ * gettextP.h (_nl_find_domain):
+ New prototype after changing search strategy.
+
+ * finddomain.c (_nl_find_domain):
+ We now try only to find a specified catalog. Fall back to other
+ catalogs listed in the locale list is now done in __dcgettext.
+
+ * dcgettext.c (__dcgettext):
+ Now we provide message fall back even to different languages.
+ I.e. if a message is not available in one language all the other
+ in the locale list a tried. Formerly fall back was only possible
+ within one language. Implemented by moving one loop from
+ _nl_find_domain to here.
+
+Mon Aug 14 23:45:50 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (gettextsrcdir):
+ Directory where source of GNU gettext library are made
+ available.
+ (INSTALL, INSTALL_DATA): Programs used for installing sources.
+ (gettext-src): New. Rule to install GNU gettext sources for use in
+ gettextize shell script.
+
+Sun Aug 13 14:40:48 1995 Ulrich Drepper <drepper@myware>
+
+ * loadmsgcat.c (_nl_load_domain):
+ Use mmap for loading only when munmap function is
+ also available.
+
+ * Makefile.in (install): Depend on `all' goal.
+
+Wed Aug 9 11:04:33 1995 Ulrich Drepper <drepper@myware>
+
+ * localealias.c (read_alias_file):
+ Do not overwrite '\n' when terminating alias value string.
+
+ * localealias.c (read_alias_file):
+ Handle long lines. Ignore the rest not fitting in
+ the buffer after the initial `fgets' call.
+
+Wed Aug 9 00:54:29 1995 Ulrich Drepper <drepper@myware>
+
+ * gettextP.h (_nl_load_domain):
+ Add prototype, replacing prototype for _nl_load_msg_cat.
+
+ * finddomain.c (_nl_find_domain):
+ Remove unneeded variable filename and filename_len.
+ (expand_alias): Remove prototype because functions does not
+ exist anymore.
+
+ * localealias.c (read_alias_file):
+ Change type of fname_len parameter to int.
+ (xmalloc): Add prototype.
+
+ * loadmsgcat.c: Better prototypes for xmalloc.
+
+Tue Aug 8 22:30:39 1995 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c (_nl_find_domain):
+ Allow alias name to be constructed from the four components.
+
+ * Makefile.in (aliaspath): New variable. Set to preliminary value.
+ (SOURCES): Add localealias.c.
+ (OBJECTS): Add localealias.o.
+
+ * gettextP.h: Add prototype for _nl_expand_alias.
+
+ * finddomain.c: Aliasing handled in intl/localealias.c.
+
+ * localealias.c: Aliasing for locale names.
+
+ * bindtextdom.c: Better prototypes for xmalloc and xstrdup.
+
+Mon Aug 7 23:47:42 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (DISTFILES): gettext.perl is now found in misc/.
+
+ * cat-compat.c (bindtextdomain):
+ Correct implementation. dirname parameter was not used.
+ Reported by Marcus Daniels.
+
+ * gettextP.h (loaded_domain):
+ New fields `successor' and `decided' for oo, lazy
+ message handling implementation.
+
+ * dcgettext.c:
+ Adopt for oo, lazy message handliing.
+ Now we can inherit translations from less specific locales.
+ (find_msg): New function.
+
+ * loadmsgcat.c, finddomain.c:
+ Complete rewrite. Implement oo, lazy message handling :-).
+ We now have an additional environment variable `LANGUAGE' with
+ a higher priority than LC_ALL for the LC_MESSAGE locale.
+ Here we can set a colon separated list of specifications each
+ of the form `language[_territory[.codeset]][@modifier]'.
+
+Sat Aug 5 09:55:42 1995 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c (unistd.h):
+ Include to get _PC_PATH_MAX defined on system having it.
+
+Fri Aug 4 22:42:00 1995 Ulrich Drepper <drepper@myware>
+
+ * finddomain.c (stpcpy): Include prototype.
+
+ * Makefile.in (dist): Remove `copying instead' message.
+
+Wed Aug 2 18:52:03 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (ID, TAGS): Do not use $^.
+
+Tue Aug 1 20:07:11 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (TAGS, ID): Use $^ as command argument.
+ (TAGS): Give etags -o option t write to current directory,
+ not $(srcdir).
+ (ID): Use $(srcdir) instead os $(top_srcdir)/src.
+ (distclean): Remove ID.
+
+Sun Jul 30 11:51:46 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (gnulocaledir):
+ New variable, always using share/ for data directory.
+ (DEFS): Add GNULOCALEDIR, used in finddomain.c.
+
+ * finddomain.c (_nl_default_dirname):
+ Set to GNULOCALEDIR, because it always has to point
+ to the directory where GNU gettext Library writes it to.
+
+ * intl-compat.c (textdomain, bindtextdomain):
+ Undefine macros before function definition.
+
+Sat Jul 22 01:10:02 1995 Ulrich Drepper <drepper@myware>
+
+ * libgettext.h (_LIBINTL_H):
+ Protect definition in case where this file is included as
+ libgettext.h on Solaris machines. Add comment about this.
+
+Wed Jul 19 02:36:42 1995 Ulrich Drepper <drepper@myware>
+
+ * intl-compat.c (textdomain): Correct typo.
+
+Wed Jul 19 01:51:35 1995 Ulrich Drepper <drepper@myware>
+
+ * dcgettext.c (dcgettext): Function now called __dcgettext.
+
+ * dgettext.c (dgettext): Now called __dgettext and calls
+ __dcgettext.
+
+ * gettext.c (gettext):
+ Function now called __gettext and calls __dgettext.
+
+ * textdomain.c (textdomain): Function now called __textdomain.
+
+ * bindtextdom.c (bindtextdomain): Function now called
+ __bindtextdomain.
+
+ * intl-compat.c: Initial revision.
+
+ * Makefile.in (SOURCES): Add intl-compat.c.
+ (OBJECTS): We always compile the GNU gettext library functions.
+ OBJECTS contains all objects but cat-compat.o, ../po/cat-if-tbl.o,
+ and intl-compat.o.
+ (GETTOBJS): Contains now only intl-compat.o.
+
+ * libgettext.h:
+ Re-include protection matches dualistic character of libgettext.h.
+ For all functions in GNU gettext library define __ counter part.
+
+ * finddomain.c (strchr): Define as index if not found in C library.
+ (_nl_find_domain): For relative paths paste / in between.
+
+Tue Jul 18 16:37:45 1995 Ulrich Drepper <drepper@myware>
+
+ * loadmsgcat.c, finddomain.c: Add inclusion of sys/types.h.
+
+ * xopen-msg.sed: Fix bug with `msgstr ""' lines.
+ A little bit better comments.
+
+Tue Jul 18 01:18:27 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in:
+ po-mode.el, makelinks, combine-sh are now found in ../misc.
+
+ * po-mode.el, makelinks, combine-sh, elisp-comp:
+ Moved to ../misc/.
+
+ * libgettext.h, gettextP.h, gettext.h: Uniform test for __STDC__.
+
+Sun Jul 16 22:33:02 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (INSTALL, INSTALL_DATA): New variables.
+ (install-data, uninstall): Install/uninstall .elc file.
+
+ * po-mode.el (Installation comment):
+ Add .pox as possible extension of .po files.
+
+Sun Jul 16 13:23:27 1995 Ulrich Drepper <drepper@myware>
+
+ * elisp-comp: Complete new version by Franc,ois: This does not
+ fail when not compiling in the source directory.
+
+Sun Jul 16 00:12:17 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (../po/cat-id-tbl.o):
+ Use $(MAKE) instead of make for recursive make.
+
+ * Makefile.in (.el.elc): Use $(SHELL) instead of /bin/sh.
+ (install-exec): Add missing dummy goal.
+ (install-data, uninstall): @ in multi-line shell command at
+ beginning, not in front of echo. Reported by Eric Backus.
+
+Sat Jul 15 00:21:28 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (DISTFILES):
+ Rename libgettext.perl to gettext.perl to fit in 14 chars
+ file systems.
+
+ * gettext.perl:
+ Rename to gettext.perl to fit in 14 chars file systems.
+
+Thu Jul 13 23:17:20 1995 Ulrich Drepper <drepper@myware>
+
+ * cat-compat.c: If !STDC_HEADERS try to include malloc.h.
+
+Thu Jul 13 20:55:02 1995 Ulrich Drepper <drepper@myware>
+
+ * po2tbl.sed.in: Pretty printing.
+
+ * linux-msg.sed, xopen-msg.sed:
+ Correct bugs with handling substitute flags in branches.
+
+ * hash-string.h (hash_string):
+ Old K&R compilers don't under stand `unsigned char'.
+
+ * gettext.h (nls_uint32):
+ Some old K&R compilers (eg HP) don't understand `unsigned int'.
+
+ * cat-compat.c (msg_to_cat_id): De-ANSI-fy prototypes.
+
+Thu Jul 13 01:34:33 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (ELCFILES): New variable.
+ (DISTFILES): Add elisp-comp.
+ Add implicit rule for .el -> .elc compilation.
+ (install-data): install $ELCFILES
+ (clean): renamed po-to-tbl and po-to-msg to po2tbl and po2msg resp.
+
+ * elisp-comp: Initial revision
+
+Wed Jul 12 16:14:52 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in:
+ cat-id-tbl.c is now found in po/. This enables us to use an identical
+ intl/ directory in all packages.
+
+ * dcgettext.c (dcgettext): hashing does not work for table size <= 2.
+
+ * textdomain.c: fix typo (#if def -> #if defined)
+
+Tue Jul 11 18:44:43 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in (stamp-cat-id): use top_srcdir to address source files
+ (DISTFILES,distclean): move tupdate.perl to src/
+
+ * po-to-tbl.sed.in:
+ add additional jump to clear change flag to recognize multiline strings
+
+Tue Jul 11 01:32:50 1995 Ulrich Drepper <drepper@myware>
+
+ * textdomain.c: Protect inclusion of stdlib.h and string.h.
+
+ * loadmsgcat.c: Protect inclusion of stdlib.h.
+
+ * libgettext.h: Protect inclusion of locale.h.
+ Allow use in C++ programs.
+ Define NULL is not happened already.
+
+ * Makefile.in (DISTFILES): ship po-to-tbl.sed.in instead of
+ po-to-tbl.sed.
+ (distclean): remove po-to-tbl.sed and tupdate.perl.
+
+ * tupdate.perl.in: Substitute Perl path even in exec line.
+ Don't include entries without translation from old .po file.
+
+Tue Jul 4 00:41:51 1995 Ulrich Drepper <drepper@myware>
+
+ * tupdate.perl.in: use "Updated: " in msgid "".
+
+ * cat-compat.c: Fix typo (LOCALDIR -> LOCALEDIR).
+ Define getenv if !__STDC__.
+
+ * bindtextdom.c: Protect stdlib.h and string.h inclusion.
+ Define free if !__STDC__.
+
+ * finddomain.c: Change DEF_MSG_DOM_DIR to LOCALEDIR.
+ Define free if !__STDC__.
+
+ * cat-compat.c: Change DEF_MSG_DOM_DIR to LOCALEDIR.
+
+Mon Jul 3 23:56:30 1995 Ulrich Drepper <drepper@myware>
+
+ * Makefile.in: Use LOCALEDIR instead of DEF_MSG_DOM_DIR.
+ Remove unneeded $(srcdir) from Makefile.in dependency.
+
+ * makelinks: Add copyright and short description.
+
+ * po-mode.el: Last version for 0.7.
+
+ * tupdate.perl.in: Fix die message.
+
+ * dcgettext.c: Protect include of string.h.
+
+ * gettext.c: Protect include of stdlib.h and further tries to get NULL.
+
+ * finddomain.c: Some corrections in includes.
+
+ * Makefile.in (INCLUDES): Prune list correct path to Makefile.in.
+
+ * po-to-tbl.sed: Adopt for new .po file format.
+
+ * linux-msg.sed, xopen-msg.sed: Adopt for new .po file format.
+
+Sun Jul 2 23:55:03 1995 Ulrich Drepper <drepper@myware>
+
+ * tupdate.perl.in: Complete rewrite for new .po file format.
+
+Sun Jul 2 02:06:50 1995 Ulrich Drepper <drepper@myware>
+
+ * First official release. This directory contains all the code
+ needed to internationalize own packages. It provides functions
+ which allow to use the X/Open catgets function with an interface
+ like the Uniforum gettext function. For system which does not
+ have neither of those a complete implementation is provided.
diff --git a/intl/Makefile.in b/intl/Makefile.in
new file mode 100644
index 00000000..7b6d85e0
--- /dev/null
+++ b/intl/Makefile.in
@@ -0,0 +1,214 @@
+# Makefile for directory with message catalog handling in GNU NLS Utilities.
+# Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+SHELL = /bin/sh
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = ..
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+transform = @program_transform_name@
+libdir = $(exec_prefix)/lib
+includedir = $(prefix)/include
+datadir = $(prefix)/@DATADIRNAME@
+localedir = $(datadir)/locale
+gnulocaledir = $(prefix)/share/locale
+gettextsrcdir = @datadir@/gettext/intl
+aliaspath = $(localedir):.
+subdir = intl
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+
+l = @l@
+
+AR = ar
+CC = @CC@
+LIBTOOL = @LIBTOOL@
+RANLIB = @RANLIB@
+
+DEFS = -DLOCALEDIR=\"$(localedir)\" -DGNULOCALEDIR=\"$(gnulocaledir)\" \
+-DLOCALE_ALIAS_PATH=\"$(aliaspath)\" @DEFS@
+CPPFLAGS = @CPPFLAGS@
+CFLAGS = @CFLAGS@
+LDFLAGS = @LDFLAGS@
+
+COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
+
+HEADERS = $(COMHDRS) libgettext.h loadinfo.h
+COMHDRS = gettext.h gettextP.h hash-string.h
+SOURCES = $(COMSRCS) intl-compat.c cat-compat.c
+COMSRCS = bindtextdom.c dcgettext.c dgettext.c gettext.c \
+finddomain.c loadmsgcat.c localealias.c textdomain.c l10nflist.c \
+explodename.c
+OBJECTS = @INTLOBJS@ bindtextdom.$lo dcgettext.$lo dgettext.$lo gettext.$lo \
+finddomain.$lo loadmsgcat.$lo localealias.$lo textdomain.$lo l10nflist.$lo \
+explodename.$lo
+CATOBJS = cat-compat.$lo ../po/cat-id-tbl.$lo
+GETTOBJS = intl-compat.$lo
+DISTFILES.common = ChangeLog Makefile.in linux-msg.sed po2tbl.sed.in \
+xopen-msg.sed $(HEADERS) $(SOURCES)
+DISTFILES.normal = VERSION
+DISTFILES.gettext = libintl.glibc intlh.inst.in
+
+.SUFFIXES:
+.SUFFIXES: .c .o .lo
+.c.o:
+ $(COMPILE) $<
+.c.lo:
+ $(LIBTOOL) --mode=compile $(COMPILE) $<
+
+INCLUDES = -I.. -I. -I$(top_srcdir)/intl -I$(top_srcdir)/include -I$(top_srcdir)/lib
+
+all: all-@USE_INCLUDED_LIBINTL@
+
+all-yes: libintl.$la intlh.inst
+all-no:
+
+libintl.a: $(OBJECTS)
+ rm -f $@
+ $(AR) cru $@ $(OBJECTS)
+ $(RANLIB) $@
+
+libintl.la: $(OBJECTS)
+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o $@ $(OBJECTS) \
+ -version-info 1:0 -rpath $(libdir)
+
+../po/cat-id-tbl.$lo: ../po/cat-id-tbl.c $(top_srcdir)/po/$(PACKAGE).pot
+ cd ../po && $(MAKE) cat-id-tbl.$lo
+
+check: all
+
+# This installation goal is only used in GNU gettext. Packages which
+# only use the library should use install instead.
+
+# We must not install the libintl.h/libintl.a files if we are on a
+# system which has the gettext() function in its C library or in a
+# separate library or use the catgets interface. A special case is
+# where configure found a previously installed GNU gettext library.
+# If you want to use the one which comes with this version of the
+# package, you have to use `configure --with-included-gettext'.
+install: install-exec install-data
+install-exec: all
+ if test "$(PACKAGE)" = "gettext" \
+ && test '@INTLOBJS@' = '$(GETTOBJS)'; then \
+ if test -r $(MKINSTALLDIRS); then \
+ $(MKINSTALLDIRS) $(libdir) $(includedir); \
+ else \
+ $(top_srcdir)/mkinstalldirs $(libdir) $(includedir); \
+ fi; \
+ $(INSTALL_DATA) intlh.inst $(includedir)/libintl.h; \
+ $(INSTALL_DATA) libintl.a $(libdir)/libintl.a; \
+ else \
+ : ; \
+ fi
+install-data: all
+ if test "$(PACKAGE)" = "gettext"; then \
+ if test -r $(MKINSTALLDIRS); then \
+ $(MKINSTALLDIRS) $(gettextsrcdir); \
+ else \
+ $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
+ fi; \
+ $(INSTALL_DATA) VERSION $(gettextsrcdir)/VERSION; \
+ dists="$(DISTFILES.common)"; \
+ for file in $$dists; do \
+ $(INSTALL_DATA) $(srcdir)/$$file $(gettextsrcdir)/$$file; \
+ done; \
+ else \
+ : ; \
+ fi
+
+# Define this as empty until I found a useful application.
+installcheck:
+
+uninstall:
+ dists="$(DISTFILES.common)"; \
+ for file in $$dists; do \
+ rm -f $(gettextsrcdir)/$$file; \
+ done
+
+info dvi:
+
+$(OBJECTS): ../include/config.h libgettext.h
+bindtextdom.$lo finddomain.$lo loadmsgcat.$lo: gettextP.h gettext.h loadinfo.h
+dcgettext.$lo: gettextP.h gettext.h hash-string.h loadinfo.h
+
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES)
+ here=`pwd`; cd $(srcdir) && etags -o $$here/TAGS $(HEADERS) $(SOURCES)
+
+id: ID
+
+ID: $(HEADERS) $(SOURCES)
+ here=`pwd`; cd $(srcdir) && mkid -f$$here/ID $(HEADERS) $(SOURCES)
+
+
+mostlyclean:
+ rm -f *.a *.o *.lo core core.*
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile ID TAGS po2msg.sed po2tbl.sed libintl.h
+
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+
+# GNU gettext needs not contain the file `VERSION' but contains some
+# other files which should not be distributed in other packages.
+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: Makefile $(DISTFILES)
+ if test "$(PACKAGE)" = gettext; then \
+ additional="$(DISTFILES.gettext)"; \
+ else \
+ additional="$(DISTFILES.normal)"; \
+ fi; \
+ for file in $(DISTFILES.common) $$additional; do \
+ ln $(srcdir)/$$file $(distdir) 2> /dev/null \
+ || cp -p $(srcdir)/$$file $(distdir); \
+ done
+
+dist-libc:
+ tar zcvf intl-glibc.tar.gz $(COMSRCS) $(COMHDRS) libintl.h.glibc
+
+Makefile: Makefile.in ../config.status
+ cd .. \
+ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+# The dependency for intlh.inst is different in gettext and all other
+# packages. Because we cannot you GNU make features we have to solve
+# the problem while rewriting Makefile.in.
+@GT_YES@intlh.inst: intlh.inst.in ../config.status
+@GT_YES@ cd .. \
+@GT_YES@ && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= \
+@GT_YES@ $(SHELL) ./config.status
+@GT_NO@.PHONY: intlh.inst
+@GT_NO@intlh.inst:
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/intl/VERSION b/intl/VERSION
new file mode 100644
index 00000000..d31950a6
--- /dev/null
+++ b/intl/VERSION
@@ -0,0 +1 @@
+GNU gettext library from gettext-0.10.32
diff --git a/intl/bindtextdom.c b/intl/bindtextdom.c
new file mode 100644
index 00000000..9fcb8d9f
--- /dev/null
+++ b/intl/bindtextdom.c
@@ -0,0 +1,199 @@
+/* Implementation of the bindtextdomain(3) function
+ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#else
+# ifdef HAVE_MALLOC_H
+# include <malloc.h>
+# else
+void free ();
+# endif
+#endif
+
+#if defined HAVE_STRING_H || defined _LIBC
+# include <string.h>
+#else
+# include <strings.h>
+# ifndef memcpy
+# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+# endif
+#endif
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgettext.h"
+#endif
+#include "gettext.h"
+#include "gettextP.h"
+
+/* @@ end of prolog @@ */
+
+/* Contains the default location of the message catalogs. */
+extern const char _nl_default_dirname[];
+
+/* List with bindings of specific domains. */
+extern struct binding *_nl_domain_bindings;
+
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define BINDTEXTDOMAIN __bindtextdomain
+# define strdup(str) __strdup (str)
+#else
+# define BINDTEXTDOMAIN bindtextdomain__
+#endif
+
+/* Specify that the DOMAINNAME message catalog will be found
+ in DIRNAME rather than in the system locale data base. */
+char *
+BINDTEXTDOMAIN (domainname, dirname)
+ const char *domainname;
+ const char *dirname;
+{
+ struct binding *binding;
+
+ /* Some sanity checks. */
+ if (domainname == NULL || domainname[0] == '\0')
+ return NULL;
+
+ for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
+ {
+ int compare = strcmp (domainname, binding->domainname);
+ if (compare == 0)
+ /* We found it! */
+ break;
+ if (compare < 0)
+ {
+ /* It is not in the list. */
+ binding = NULL;
+ break;
+ }
+ }
+
+ if (dirname == NULL)
+ /* The current binding has be to returned. */
+ return binding == NULL ? (char *) _nl_default_dirname : binding->dirname;
+
+ if (binding != NULL)
+ {
+ /* The domain is already bound. If the new value and the old
+ one are equal we simply do nothing. Otherwise replace the
+ old binding. */
+ if (strcmp (dirname, binding->dirname) != 0)
+ {
+ char *new_dirname;
+
+ if (strcmp (dirname, _nl_default_dirname) == 0)
+ new_dirname = (char *) _nl_default_dirname;
+ else
+ {
+#if defined _LIBC || defined HAVE_STRDUP
+ new_dirname = strdup (dirname);
+ if (new_dirname == NULL)
+ return NULL;
+#else
+ size_t len = strlen (dirname) + 1;
+ new_dirname = (char *) malloc (len);
+ if (new_dirname == NULL)
+ return NULL;
+
+ memcpy (new_dirname, dirname, len);
+#endif
+ }
+
+ if (binding->dirname != _nl_default_dirname)
+ free (binding->dirname);
+
+ binding->dirname = new_dirname;
+ }
+ }
+ else
+ {
+ /* We have to create a new binding. */
+ size_t len;
+ struct binding *new_binding =
+ (struct binding *) malloc (sizeof (*new_binding));
+
+ if (new_binding == NULL)
+ return NULL;
+
+#if defined _LIBC || defined HAVE_STRDUP
+ new_binding->domainname = strdup (domainname);
+ if (new_binding->domainname == NULL)
+ return NULL;
+#else
+ len = strlen (domainname) + 1;
+ new_binding->domainname = (char *) malloc (len);
+ if (new_binding->domainname == NULL)
+ return NULL;
+ memcpy (new_binding->domainname, domainname, len);
+#endif
+
+ if (strcmp (dirname, _nl_default_dirname) == 0)
+ new_binding->dirname = (char *) _nl_default_dirname;
+ else
+ {
+#if defined _LIBC || defined HAVE_STRDUP
+ new_binding->dirname = strdup (dirname);
+ if (new_binding->dirname == NULL)
+ return NULL;
+#else
+ len = strlen (dirname) + 1;
+ new_binding->dirname = (char *) malloc (len);
+ if (new_binding->dirname == NULL)
+ return NULL;
+ memcpy (new_binding->dirname, dirname, len);
+#endif
+ }
+
+ /* Now enqueue it. */
+ if (_nl_domain_bindings == NULL
+ || strcmp (domainname, _nl_domain_bindings->domainname) < 0)
+ {
+ new_binding->next = _nl_domain_bindings;
+ _nl_domain_bindings = new_binding;
+ }
+ else
+ {
+ binding = _nl_domain_bindings;
+ while (binding->next != NULL
+ && strcmp (domainname, binding->next->domainname) > 0)
+ binding = binding->next;
+
+ new_binding->next = binding->next;
+ binding->next = new_binding;
+ }
+
+ binding = new_binding;
+ }
+
+ return binding->dirname;
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__bindtextdomain, bindtextdomain);
+#endif
diff --git a/intl/cat-compat.c b/intl/cat-compat.c
new file mode 100644
index 00000000..867d901b
--- /dev/null
+++ b/intl/cat-compat.c
@@ -0,0 +1,262 @@
+/* Compatibility code for gettext-using-catgets interface.
+ Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <string.h>
+#else
+char *getenv ();
+# ifdef HAVE_MALLOC_H
+# include <malloc.h>
+# endif
+#endif
+
+#ifdef HAVE_NL_TYPES_H
+# include <nl_types.h>
+#endif
+
+#include "libgettext.h"
+
+/* @@ end of prolog @@ */
+
+/* XPG3 defines the result of `setlocale (category, NULL)' as:
+ ``Directs `setlocale()' to query `category' and return the current
+ setting of `local'.''
+ However it does not specify the exact format. And even worse: POSIX
+ defines this not at all. So we can use this feature only on selected
+ system (e.g. those using GNU C Library). */
+#ifdef _LIBC
+# define HAVE_LOCALE_NULL
+#endif
+
+/* The catalog descriptor. */
+static nl_catd catalog = (nl_catd) -1;
+
+/* Name of the default catalog. */
+static const char default_catalog_name[] = "messages";
+
+/* Name of currently used catalog. */
+static const char *catalog_name = default_catalog_name;
+
+/* Get ID for given string. If not found return -1. */
+static int msg_to_cat_id PARAMS ((const char *msg));
+
+/* Substitution for systems lacking this function in their C library. */
+#if !_LIBC && !HAVE_STPCPY
+static char *stpcpy PARAMS ((char *dest, const char *src));
+#endif
+
+
+/* Set currently used domain/catalog. */
+char *
+textdomain (domainname)
+ const char *domainname;
+{
+ nl_catd new_catalog;
+ char *new_name;
+ size_t new_name_len;
+ char *lang;
+
+#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES \
+ && defined HAVE_LOCALE_NULL
+ lang = setlocale (LC_MESSAGES, NULL);
+#else
+ lang = getenv ("LC_ALL");
+ if (lang == NULL || lang[0] == '\0')
+ {
+ lang = getenv ("LC_MESSAGES");
+ if (lang == NULL || lang[0] == '\0')
+ lang = getenv ("LANG");
+ }
+#endif
+ if (lang == NULL || lang[0] == '\0')
+ lang = "C";
+
+ /* See whether name of currently used domain is asked. */
+ if (domainname == NULL)
+ return (char *) catalog_name;
+
+ if (domainname[0] == '\0')
+ domainname = default_catalog_name;
+
+ /* Compute length of added path element. */
+ new_name_len = sizeof (LOCALEDIR) - 1 + 1 + strlen (lang)
+ + sizeof ("/LC_MESSAGES/") - 1 + sizeof (PACKAGE) - 1
+ + sizeof (".cat");
+
+ new_name = (char *) malloc (new_name_len);
+ if (new_name == NULL)
+ return NULL;
+
+ strcpy (new_name, PACKAGE);
+ new_catalog = catopen (new_name, 0);
+
+ if (new_catalog == (nl_catd) -1)
+ {
+ /* NLSPATH search didn't work, try absolute path */
+ sprintf (new_name, "%s/%s/LC_MESSAGES/%s.cat", LOCALEDIR, lang,
+ PACKAGE);
+ new_catalog = catopen (new_name, 0);
+
+ if (new_catalog == (nl_catd) -1)
+ {
+ free (new_name);
+ return (char *) catalog_name;
+ }
+ }
+
+ /* Close old catalog. */
+ if (catalog != (nl_catd) -1)
+ catclose (catalog);
+ if (catalog_name != default_catalog_name)
+ free ((char *) catalog_name);
+
+ catalog = new_catalog;
+ catalog_name = new_name;
+
+ return (char *) catalog_name;
+}
+
+char *
+bindtextdomain (domainname, dirname)
+ const char *domainname;
+ const char *dirname;
+{
+#if HAVE_SETENV || HAVE_PUTENV
+ char *old_val, *new_val, *cp;
+ size_t new_val_len;
+
+ /* This does not make much sense here but to be compatible do it. */
+ if (domainname == NULL)
+ return NULL;
+
+ /* Compute length of added path element. If we use setenv we don't need
+ the first byts for NLSPATH=, but why complicate the code for this
+ peanuts. */
+ new_val_len = sizeof ("NLSPATH=") - 1 + strlen (dirname)
+ + sizeof ("/%L/LC_MESSAGES/%N.cat");
+
+ old_val = getenv ("NLSPATH");
+ if (old_val == NULL || old_val[0] == '\0')
+ {
+ old_val = NULL;
+ new_val_len += 1 + sizeof (LOCALEDIR) - 1
+ + sizeof ("/%L/LC_MESSAGES/%N.cat");
+ }
+ else
+ new_val_len += strlen (old_val);
+
+ new_val = (char *) malloc (new_val_len);
+ if (new_val == NULL)
+ return NULL;
+
+# if HAVE_SETENV
+ cp = new_val;
+# else
+ cp = stpcpy (new_val, "NLSPATH=");
+# endif
+
+ cp = stpcpy (cp, dirname);
+ cp = stpcpy (cp, "/%L/LC_MESSAGES/%N.cat:");
+
+ if (old_val == NULL)
+ {
+# if __STDC__
+ stpcpy (cp, LOCALEDIR "/%L/LC_MESSAGES/%N.cat");
+# else
+
+ cp = stpcpy (cp, LOCALEDIR);
+ stpcpy (cp, "/%L/LC_MESSAGES/%N.cat");
+# endif
+ }
+ else
+ stpcpy (cp, old_val);
+
+# if HAVE_SETENV
+ setenv ("NLSPATH", new_val, 1);
+ free (new_val);
+# else
+ putenv (new_val);
+ /* Do *not* free the environment entry we just entered. It is used
+ from now on. */
+# endif
+
+#endif
+
+ return (char *) domainname;
+}
+
+#undef gettext
+char *
+gettext (msg)
+ const char *msg;
+{
+ int msgid;
+
+ if (msg == NULL || catalog == (nl_catd) -1)
+ return (char *) msg;
+
+ /* Get the message from the catalog. We always use set number 1.
+ The message ID is computed by the function `msg_to_cat_id'
+ which works on the table generated by `po-to-tbl'. */
+ msgid = msg_to_cat_id (msg);
+ if (msgid == -1)
+ return (char *) msg;
+
+ return catgets (catalog, 1, msgid, (char *) msg);
+}
+
+/* Look through the table `_msg_tbl' which has `_msg_tbl_length' entries
+ for the one equal to msg. If it is found return the ID. In case when
+ the string is not found return -1. */
+static int
+msg_to_cat_id (msg)
+ const char *msg;
+{
+ int cnt;
+
+ for (cnt = 0; cnt < _msg_tbl_length; ++cnt)
+ if (strcmp (msg, _msg_tbl[cnt]._msg) == 0)
+ return _msg_tbl[cnt]._msg_number;
+
+ return -1;
+}
+
+
+/* @@ begin of epilog @@ */
+
+/* We don't want libintl.a to depend on any other library. So we
+ avoid the non-standard function stpcpy. In GNU C Library this
+ function is available, though. Also allow the symbol HAVE_STPCPY
+ to be defined. */
+#if !_LIBC && !HAVE_STPCPY
+static char *
+stpcpy (dest, src)
+ char *dest;
+ const char *src;
+{
+ while ((*dest++ = *src++) != '\0')
+ /* Do nothing. */ ;
+ return dest - 1;
+}
+#endif
diff --git a/intl/dcgettext.c b/intl/dcgettext.c
new file mode 100644
index 00000000..a316bfd1
--- /dev/null
+++ b/intl/dcgettext.c
@@ -0,0 +1,593 @@
+/* Implementation of the dcgettext(3) function
+ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <sys/types.h>
+
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+# define HAVE_ALLOCA 1
+#else
+# if defined HAVE_ALLOCA_H || defined _LIBC
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca
+char *alloca ();
+# endif
+# endif
+# endif
+#endif
+
+#include <errno.h>
+#ifndef errno
+extern int errno;
+#endif
+#ifndef __set_errno
+# define __set_errno(val) errno = (val)
+#endif
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#else
+char *getenv ();
+# ifdef HAVE_MALLOC_H
+# include <malloc.h>
+# else
+void free ();
+# endif
+#endif
+
+#if defined HAVE_STRING_H || defined _LIBC
+# ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+# endif
+# include <string.h>
+#else
+# include <strings.h>
+#endif
+#if !HAVE_STRCHR && !defined _LIBC
+# ifndef strchr
+# define strchr index
+# endif
+#endif
+
+#if defined HAVE_UNISTD_H || defined _LIBC
+# include <unistd.h>
+#endif
+
+#include "gettext.h"
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgettext.h"
+#endif
+#include "hash-string.h"
+
+/* @@ end of prolog @@ */
+
+#ifdef _LIBC
+/* Rename the non ANSI C functions. This is required by the standard
+ because some ANSI C functions will require linking with this object
+ file and the name space must not be polluted. */
+# define getcwd __getcwd
+# define stpcpy __stpcpy
+#else
+# if !defined HAVE_GETCWD
+char *getwd ();
+# define getcwd(buf, max) getwd (buf)
+# else
+char *getcwd ();
+# endif
+# ifndef HAVE_STPCPY
+static char *stpcpy PARAMS ((char *dest, const char *src));
+# endif
+#endif
+
+/* Amount to increase buffer size by in each try. */
+#define PATH_INCR 32
+
+/* The following is from pathmax.h. */
+/* Non-POSIX BSD systems might have gcc's limits.h, which doesn't define
+ PATH_MAX but might cause redefinition warnings when sys/param.h is
+ later included (as on MORE/BSD 4.3). */
+#if defined(_POSIX_VERSION) || (defined(HAVE_LIMITS_H) && !defined(__GNUC__))
+# include <limits.h>
+#endif
+
+#ifndef _POSIX_PATH_MAX
+# define _POSIX_PATH_MAX 255
+#endif
+
+#if !defined(PATH_MAX) && defined(_PC_PATH_MAX)
+# define PATH_MAX (pathconf ("/", _PC_PATH_MAX) < 1 ? 1024 : pathconf ("/", _PC_PATH_MAX))
+#endif
+
+/* Don't include sys/param.h if it already has been. */
+#if defined(HAVE_SYS_PARAM_H) && !defined(PATH_MAX) && !defined(MAXPATHLEN)
+# include <sys/param.h>
+#endif
+
+#if !defined(PATH_MAX) && defined(MAXPATHLEN)
+# define PATH_MAX MAXPATHLEN
+#endif
+
+#ifndef PATH_MAX
+# define PATH_MAX _POSIX_PATH_MAX
+#endif
+
+/* XPG3 defines the result of `setlocale (category, NULL)' as:
+ ``Directs `setlocale()' to query `category' and return the current
+ setting of `local'.''
+ However it does not specify the exact format. And even worse: POSIX
+ defines this not at all. So we can use this feature only on selected
+ system (e.g. those using GNU C Library). */
+#ifdef _LIBC
+# define HAVE_LOCALE_NULL
+#endif
+
+/* Name of the default domain used for gettext(3) prior any call to
+ textdomain(3). The default value for this is "messages". */
+const char _nl_default_default_domain[] = "messages";
+
+/* Value used as the default domain for gettext(3). */
+const char *_nl_current_default_domain = _nl_default_default_domain;
+
+/* Contains the default location of the message catalogs. */
+const char _nl_default_dirname[] = GNULOCALEDIR;
+
+/* List with bindings of specific domains created by bindtextdomain()
+ calls. */
+struct binding *_nl_domain_bindings;
+
+/* Prototypes for local functions. */
+static char *find_msg PARAMS ((struct loaded_l10nfile *domain_file,
+ const char *msgid));
+static const char *category_to_name PARAMS ((int category));
+static const char *guess_category_value PARAMS ((int category,
+ const char *categoryname));
+
+
+/* For those loosing systems which don't have `alloca' we have to add
+ some additional code emulating it. */
+#ifdef HAVE_ALLOCA
+/* Nothing has to be done. */
+# define ADD_BLOCK(list, address) /* nothing */
+# define FREE_BLOCKS(list) /* nothing */
+#else
+struct block_list
+{
+ void *address;
+ struct block_list *next;
+};
+# define ADD_BLOCK(list, addr) \
+ do { \
+ struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \
+ /* If we cannot get a free block we cannot add the new element to \
+ the list. */ \
+ if (newp != NULL) { \
+ newp->address = (addr); \
+ newp->next = (list); \
+ (list) = newp; \
+ } \
+ } while (0)
+# define FREE_BLOCKS(list) \
+ do { \
+ while (list != NULL) { \
+ struct block_list *old = list; \
+ list = list->next; \
+ free (old); \
+ } \
+ } while (0)
+# undef alloca
+# define alloca(size) (malloc (size))
+#endif /* have alloca */
+
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define DCGETTEXT __dcgettext
+#else
+# define DCGETTEXT dcgettext__
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+ locale. */
+char *
+DCGETTEXT (domainname, msgid, category)
+ const char *domainname;
+ const char *msgid;
+ int category;
+{
+#ifndef HAVE_ALLOCA
+ struct block_list *block_list = NULL;
+#endif
+ struct loaded_l10nfile *domain;
+ struct binding *binding;
+ const char *categoryname;
+ const char *categoryvalue;
+ char *dirname, *xdomainname;
+ char *single_locale;
+ char *retval;
+ int saved_errno = errno;
+
+ /* If no real MSGID is given return NULL. */
+ if (msgid == NULL)
+ return NULL;
+
+ /* If DOMAINNAME is NULL, we are interested in the default domain. If
+ CATEGORY is not LC_MESSAGES this might not make much sense but the
+ defintion left this undefined. */
+ if (domainname == NULL)
+ domainname = _nl_current_default_domain;
+
+ /* First find matching binding. */
+ for (binding = _nl_domain_bindings; binding != NULL; binding = binding->next)
+ {
+ int compare = strcmp (domainname, binding->domainname);
+ if (compare == 0)
+ /* We found it! */
+ break;
+ if (compare < 0)
+ {
+ /* It is not in the list. */
+ binding = NULL;
+ break;
+ }
+ }
+
+ if (binding == NULL)
+ dirname = (char *) _nl_default_dirname;
+ else if (binding->dirname[0] == '/')
+ dirname = binding->dirname;
+ else
+ {
+ /* We have a relative path. Make it absolute now. */
+ size_t dirname_len = strlen (binding->dirname) + 1;
+ size_t path_max;
+ char *ret;
+
+ path_max = (unsigned) PATH_MAX;
+ path_max += 2; /* The getcwd docs say to do this. */
+
+ dirname = (char *) alloca (path_max + dirname_len);
+ ADD_BLOCK (block_list, dirname);
+
+ __set_errno (0);
+ while ((ret = getcwd (dirname, path_max)) == NULL && errno == ERANGE)
+ {
+ path_max += PATH_INCR;
+ dirname = (char *) alloca (path_max + dirname_len);
+ ADD_BLOCK (block_list, dirname);
+ __set_errno (0);
+ }
+
+ if (ret == NULL)
+ {
+ /* We cannot get the current working directory. Don't signal an
+ error but simply return the default string. */
+ FREE_BLOCKS (block_list);
+ __set_errno (saved_errno);
+ return (char *) msgid;
+ }
+
+ stpcpy (stpcpy (strchr (dirname, '\0'), "/"), binding->dirname);
+ }
+
+ /* Now determine the symbolic name of CATEGORY and its value. */
+ categoryname = category_to_name (category);
+ categoryvalue = guess_category_value (category, categoryname);
+
+ xdomainname = (char *) alloca (strlen (categoryname)
+ + strlen (domainname) + 5);
+ ADD_BLOCK (block_list, xdomainname);
+
+ stpcpy (stpcpy (stpcpy (stpcpy (xdomainname, categoryname), "/"),
+ domainname),
+ ".mo");
+
+ /* Creating working area. */
+ single_locale = (char *) alloca (strlen (categoryvalue) + 1);
+ ADD_BLOCK (block_list, single_locale);
+
+
+ /* Search for the given string. This is a loop because we perhaps
+ got an ordered list of languages to consider for th translation. */
+ while (1)
+ {
+ /* Make CATEGORYVALUE point to the next element of the list. */
+ while (categoryvalue[0] != '\0' && categoryvalue[0] == ':')
+ ++categoryvalue;
+ if (categoryvalue[0] == '\0')
+ {
+ /* The whole contents of CATEGORYVALUE has been searched but
+ no valid entry has been found. We solve this situation
+ by implicitly appending a "C" entry, i.e. no translation
+ will take place. */
+ single_locale[0] = 'C';
+ single_locale[1] = '\0';
+ }
+ else
+ {
+ char *cp = single_locale;
+ while (categoryvalue[0] != '\0' && categoryvalue[0] != ':')
+ *cp++ = *categoryvalue++;
+ *cp = '\0';
+ }
+
+ /* If the current locale value is C (or POSIX) we don't load a
+ domain. Return the MSGID. */
+ if (strcmp (single_locale, "C") == 0
+ || strcmp (single_locale, "POSIX") == 0)
+ {
+ FREE_BLOCKS (block_list);
+ __set_errno (saved_errno);
+ return (char *) msgid;
+ }
+
+
+ /* Find structure describing the message catalog matching the
+ DOMAINNAME and CATEGORY. */
+ domain = _nl_find_domain (dirname, single_locale, xdomainname);
+
+ if (domain != NULL)
+ {
+ retval = find_msg (domain, msgid);
+
+ if (retval == NULL)
+ {
+ int cnt;
+
+ for (cnt = 0; domain->successor[cnt] != NULL; ++cnt)
+ {
+ retval = find_msg (domain->successor[cnt], msgid);
+
+ if (retval != NULL)
+ break;
+ }
+ }
+
+ if (retval != NULL)
+ {
+ FREE_BLOCKS (block_list);
+ __set_errno (saved_errno);
+ return retval;
+ }
+ }
+ }
+ /* NOTREACHED */
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__dcgettext, dcgettext);
+#endif
+
+
+static char *
+find_msg (domain_file, msgid)
+ struct loaded_l10nfile *domain_file;
+ const char *msgid;
+{
+ size_t top, act, bottom;
+ struct loaded_domain *domain;
+
+ if (domain_file->decided == 0)
+ _nl_load_domain (domain_file);
+
+ if (domain_file->data == NULL)
+ return NULL;
+
+ domain = (struct loaded_domain *) domain_file->data;
+
+ /* Locate the MSGID and its translation. */
+ if (domain->hash_size > 2 && domain->hash_tab != NULL)
+ {
+ /* Use the hashing table. */
+ nls_uint32 len = strlen (msgid);
+ nls_uint32 hash_val = hash_string (msgid);
+ nls_uint32 idx = hash_val % domain->hash_size;
+ nls_uint32 incr = 1 + (hash_val % (domain->hash_size - 2));
+ nls_uint32 nstr = W (domain->must_swap, domain->hash_tab[idx]);
+
+ if (nstr == 0)
+ /* Hash table entry is empty. */
+ return NULL;
+
+ if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len
+ && strcmp (msgid,
+ domain->data + W (domain->must_swap,
+ domain->orig_tab[nstr - 1].offset)) == 0)
+ return (char *) domain->data + W (domain->must_swap,
+ domain->trans_tab[nstr - 1].offset);
+
+ while (1)
+ {
+ if (idx >= domain->hash_size - incr)
+ idx -= domain->hash_size - incr;
+ else
+ idx += incr;
+
+ nstr = W (domain->must_swap, domain->hash_tab[idx]);
+ if (nstr == 0)
+ /* Hash table entry is empty. */
+ return NULL;
+
+ if (W (domain->must_swap, domain->orig_tab[nstr - 1].length) == len
+ && strcmp (msgid,
+ domain->data + W (domain->must_swap,
+ domain->orig_tab[nstr - 1].offset))
+ == 0)
+ return (char *) domain->data
+ + W (domain->must_swap, domain->trans_tab[nstr - 1].offset);
+ }
+ /* NOTREACHED */
+ }
+
+ /* Now we try the default method: binary search in the sorted
+ array of messages. */
+ bottom = 0;
+ top = domain->nstrings;
+ while (bottom < top)
+ {
+ int cmp_val;
+
+ act = (bottom + top) / 2;
+ cmp_val = strcmp (msgid, domain->data
+ + W (domain->must_swap,
+ domain->orig_tab[act].offset));
+ if (cmp_val < 0)
+ top = act;
+ else if (cmp_val > 0)
+ bottom = act + 1;
+ else
+ break;
+ }
+
+ /* If an translation is found return this. */
+ return bottom >= top ? NULL : (char *) domain->data
+ + W (domain->must_swap,
+ domain->trans_tab[act].offset);
+}
+
+
+/* Return string representation of locale CATEGORY. */
+static const char *
+category_to_name (category)
+ int category;
+{
+ const char *retval;
+
+ switch (category)
+ {
+#ifdef LC_COLLATE
+ case LC_COLLATE:
+ retval = "LC_COLLATE";
+ break;
+#endif
+#ifdef LC_CTYPE
+ case LC_CTYPE:
+ retval = "LC_CTYPE";
+ break;
+#endif
+#ifdef LC_MONETARY
+ case LC_MONETARY:
+ retval = "LC_MONETARY";
+ break;
+#endif
+#ifdef LC_NUMERIC
+ case LC_NUMERIC:
+ retval = "LC_NUMERIC";
+ break;
+#endif
+#ifdef LC_TIME
+ case LC_TIME:
+ retval = "LC_TIME";
+ break;
+#endif
+#ifdef LC_MESSAGES
+ case LC_MESSAGES:
+ retval = "LC_MESSAGES";
+ break;
+#endif
+#ifdef LC_RESPONSE
+ case LC_RESPONSE:
+ retval = "LC_RESPONSE";
+ break;
+#endif
+#ifdef LC_ALL
+ case LC_ALL:
+ /* This might not make sense but is perhaps better than any other
+ value. */
+ retval = "LC_ALL";
+ break;
+#endif
+ default:
+ /* If you have a better idea for a default value let me know. */
+ retval = "LC_XXX";
+ }
+
+ return retval;
+}
+
+/* Guess value of current locale from value of the environment variables. */
+static const char *
+guess_category_value (category, categoryname)
+ int category;
+ const char *categoryname;
+{
+ const char *retval;
+
+ /* The highest priority value is the `LANGUAGE' environment
+ variable. This is a GNU extension. */
+ retval = getenv ("LANGUAGE");
+ if (retval != NULL && retval[0] != '\0')
+ return retval;
+
+ /* `LANGUAGE' is not set. So we have to proceed with the POSIX
+ methods of looking to `LC_ALL', `LC_xxx', and `LANG'. On some
+ systems this can be done by the `setlocale' function itself. */
+#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL
+ return setlocale (category, NULL);
+#else
+ /* Setting of LC_ALL overwrites all other. */
+ retval = getenv ("LC_ALL");
+ if (retval != NULL && retval[0] != '\0')
+ return retval;
+
+ /* Next comes the name of the desired category. */
+ retval = getenv (categoryname);
+ if (retval != NULL && retval[0] != '\0')
+ return retval;
+
+ /* Last possibility is the LANG environment variable. */
+ retval = getenv ("LANG");
+ if (retval != NULL && retval[0] != '\0')
+ return retval;
+
+ /* We use C as the default domain. POSIX says this is implementation
+ defined. */
+ return "C";
+#endif
+}
+
+/* @@ begin of epilog @@ */
+
+/* We don't want libintl.a to depend on any other library. So we
+ avoid the non-standard function stpcpy. In GNU C Library this
+ function is available, though. Also allow the symbol HAVE_STPCPY
+ to be defined. */
+#if !_LIBC && !HAVE_STPCPY
+static char *
+stpcpy (dest, src)
+ char *dest;
+ const char *src;
+{
+ while ((*dest++ = *src++) != '\0')
+ /* Do nothing. */ ;
+ return dest - 1;
+}
+#endif
diff --git a/intl/dgettext.c b/intl/dgettext.c
new file mode 100644
index 00000000..2fde6770
--- /dev/null
+++ b/intl/dgettext.c
@@ -0,0 +1,59 @@
+/* dgettext.c -- implementation of the dgettext(3) function
+ Copyright (C) 1995 Software Foundation, Inc.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined HAVE_LOCALE_H || defined _LIBC
+# include <locale.h>
+#endif
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgettext.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define DGETTEXT __dgettext
+# define DCGETTEXT __dcgettext
+#else
+# define DGETTEXT dgettext__
+# define DCGETTEXT dcgettext__
+#endif
+
+/* Look up MSGID in the DOMAINNAME message catalog of the current
+ LC_MESSAGES locale. */
+char *
+DGETTEXT (domainname, msgid)
+ const char *domainname;
+ const char *msgid;
+{
+ return DCGETTEXT (domainname, msgid, LC_MESSAGES);
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__dgettext, dgettext);
+#endif
diff --git a/intl/explodename.c b/intl/explodename.c
new file mode 100644
index 00000000..37c46e9d
--- /dev/null
+++ b/intl/explodename.c
@@ -0,0 +1,181 @@
+/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+
+#include "loadinfo.h"
+
+/* On some strange systems still no definition of NULL is found. Sigh! */
+#ifndef NULL
+# if defined __STDC__ && __STDC__
+# define NULL ((void *) 0)
+# else
+# define NULL 0
+# endif
+#endif
+
+/* @@ end of prolog @@ */
+
+int
+_nl_explode_name (name, language, modifier, territory, codeset,
+ normalized_codeset, special, sponsor, revision)
+ char *name;
+ const char **language;
+ const char **modifier;
+ const char **territory;
+ const char **codeset;
+ const char **normalized_codeset;
+ const char **special;
+ const char **sponsor;
+ const char **revision;
+{
+ enum { undecided, xpg, cen } syntax;
+ char *cp;
+ int mask;
+
+ *modifier = NULL;
+ *territory = NULL;
+ *codeset = NULL;
+ *normalized_codeset = NULL;
+ *special = NULL;
+ *sponsor = NULL;
+ *revision = NULL;
+
+ /* Now we determine the single parts of the locale name. First
+ look for the language. Termination symbols are `_' and `@' if
+ we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */
+ mask = 0;
+ syntax = undecided;
+ *language = cp = name;
+ while (cp[0] != '\0' && cp[0] != '_' && cp[0] != '@'
+ && cp[0] != '+' && cp[0] != ',')
+ ++cp;
+
+ if (*language == cp)
+ /* This does not make sense: language has to be specified. Use
+ this entry as it is without exploding. Perhaps it is an alias. */
+ cp = strchr (*language, '\0');
+ else if (cp[0] == '_')
+ {
+ /* Next is the territory. */
+ cp[0] = '\0';
+ *territory = ++cp;
+
+ while (cp[0] != '\0' && cp[0] != '.' && cp[0] != '@'
+ && cp[0] != '+' && cp[0] != ',' && cp[0] != '_')
+ ++cp;
+
+ mask |= TERRITORY;
+
+ if (cp[0] == '.')
+ {
+ /* Next is the codeset. */
+ syntax = xpg;
+ cp[0] = '\0';
+ *codeset = ++cp;
+
+ while (cp[0] != '\0' && cp[0] != '@')
+ ++cp;
+
+ mask |= XPG_CODESET;
+
+ if (*codeset != cp && (*codeset)[0] != '\0')
+ {
+ *normalized_codeset = _nl_normalize_codeset (*codeset,
+ cp - *codeset);
+ if (strcmp (*codeset, *normalized_codeset) == 0)
+ free ((char *) *normalized_codeset);
+ else
+ mask |= XPG_NORM_CODESET;
+ }
+ }
+ }
+
+ if (cp[0] == '@' || (syntax != xpg && cp[0] == '+'))
+ {
+ /* Next is the modifier. */
+ syntax = cp[0] == '@' ? xpg : cen;
+ cp[0] = '\0';
+ *modifier = ++cp;
+
+ while (syntax == cen && cp[0] != '\0' && cp[0] != '+'
+ && cp[0] != ',' && cp[0] != '_')
+ ++cp;
+
+ mask |= XPG_MODIFIER | CEN_AUDIENCE;
+ }
+
+ if (syntax != xpg && (cp[0] == '+' || cp[0] == ',' || cp[0] == '_'))
+ {
+ syntax = cen;
+
+ if (cp[0] == '+')
+ {
+ /* Next is special application (CEN syntax). */
+ cp[0] = '\0';
+ *special = ++cp;
+
+ while (cp[0] != '\0' && cp[0] != ',' && cp[0] != '_')
+ ++cp;
+
+ mask |= CEN_SPECIAL;
+ }
+
+ if (cp[0] == ',')
+ {
+ /* Next is sponsor (CEN syntax). */
+ cp[0] = '\0';
+ *sponsor = ++cp;
+
+ while (cp[0] != '\0' && cp[0] != '_')
+ ++cp;
+
+ mask |= CEN_SPONSOR;
+ }
+
+ if (cp[0] == '_')
+ {
+ /* Next is revision (CEN syntax). */
+ cp[0] = '\0';
+ *revision = ++cp;
+
+ mask |= CEN_REVISION;
+ }
+ }
+
+ /* For CEN syntax values it might be important to have the
+ separator character in the file name, not for XPG syntax. */
+ if (syntax == xpg)
+ {
+ if (*territory != NULL && (*territory)[0] == '\0')
+ mask &= ~TERRITORY;
+
+ if (*codeset != NULL && (*codeset)[0] == '\0')
+ mask &= ~XPG_CODESET;
+
+ if (*modifier != NULL && (*modifier)[0] == '\0')
+ mask &= ~XPG_MODIFIER;
+ }
+
+ return mask;
+}
diff --git a/intl/finddomain.c b/intl/finddomain.c
new file mode 100644
index 00000000..ec85d4de
--- /dev/null
+++ b/intl/finddomain.c
@@ -0,0 +1,189 @@
+/* Handle list of needed message catalogs
+ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <ctype.h>
+#include <errno.h>
+#include <stdio.h>
+#include <sys/types.h>
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#else
+# ifdef HAVE_MALLOC_H
+# include <malloc.h>
+# else
+void free ();
+# endif
+#endif
+
+#if defined HAVE_STRING_H || defined _LIBC
+# include <string.h>
+#else
+# include <strings.h>
+# ifndef memcpy
+# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+# endif
+#endif
+#if !HAVE_STRCHR && !defined _LIBC
+# ifndef strchr
+# define strchr index
+# endif
+#endif
+
+#if defined HAVE_UNISTD_H || defined _LIBC
+# include <unistd.h>
+#endif
+
+#include "gettext.h"
+#include "gettextP.h"
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgettext.h"
+#endif
+
+/* @@ end of prolog @@ */
+/* List of already loaded domains. */
+static struct loaded_l10nfile *_nl_loaded_domains;
+
+
+/* Return a data structure describing the message catalog described by
+ the DOMAINNAME and CATEGORY parameters with respect to the currently
+ established bindings. */
+struct loaded_l10nfile *
+_nl_find_domain (dirname, locale, domainname)
+ const char *dirname;
+ char *locale;
+ const char *domainname;
+{
+ struct loaded_l10nfile *retval;
+ const char *language;
+ const char *modifier;
+ const char *territory;
+ const char *codeset;
+ const char *normalized_codeset;
+ const char *special;
+ const char *sponsor;
+ const char *revision;
+ const char *alias_value;
+ int mask;
+
+ /* LOCALE can consist of up to four recognized parts for the XPG syntax:
+
+ language[_territory[.codeset]][@modifier]
+
+ and six parts for the CEN syntax:
+
+ language[_territory][+audience][+special][,[sponsor][_revision]]
+
+ Beside the first all of them are allowed to be missing. If the
+ full specified locale is not found, the less specific one are
+ looked for. The various part will be stripped of according to
+ the following order:
+ (1) revision
+ (2) sponsor
+ (3) special
+ (4) codeset
+ (5) normalized codeset
+ (6) territory
+ (7) audience/modifier
+ */
+
+ /* If we have already tested for this locale entry there has to
+ be one data set in the list of loaded domains. */
+ retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
+ strlen (dirname) + 1, 0, locale, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, domainname, 0);
+ if (retval != NULL)
+ {
+ /* We know something about this locale. */
+ int cnt;
+
+ if (retval->decided == 0)
+ _nl_load_domain (retval);
+
+ if (retval->data != NULL)
+ return retval;
+
+ for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
+ {
+ if (retval->successor[cnt]->decided == 0)
+ _nl_load_domain (retval->successor[cnt]);
+
+ if (retval->successor[cnt]->data != NULL)
+ break;
+ }
+ return cnt >= 0 ? retval : NULL;
+ /* NOTREACHED */
+ }
+
+ /* See whether the locale value is an alias. If yes its value
+ *overwrites* the alias name. No test for the original value is
+ done. */
+ alias_value = _nl_expand_alias (locale);
+ if (alias_value != NULL)
+ {
+ size_t len = strlen (alias_value) + 1;
+ locale = (char *) malloc (len);
+ if (locale == NULL)
+ return NULL;
+
+ memcpy (locale, alias_value, len);
+ }
+
+ /* Now we determine the single parts of the locale name. First
+ look for the language. Termination symbols are `_' and `@' if
+ we use XPG4 style, and `_', `+', and `,' if we use CEN syntax. */
+ mask = _nl_explode_name (locale, &language, &modifier, &territory,
+ &codeset, &normalized_codeset, &special,
+ &sponsor, &revision);
+
+ /* Create all possible locale entries which might be interested in
+ generalization. */
+ retval = _nl_make_l10nflist (&_nl_loaded_domains, dirname,
+ strlen (dirname) + 1, mask, language, territory,
+ codeset, normalized_codeset, modifier, special,
+ sponsor, revision, domainname, 1);
+ if (retval == NULL)
+ /* This means we are out of core. */
+ return NULL;
+
+ if (retval->decided == 0)
+ _nl_load_domain (retval);
+ if (retval->data == NULL)
+ {
+ int cnt;
+ for (cnt = 0; retval->successor[cnt] != NULL; ++cnt)
+ {
+ if (retval->successor[cnt]->decided == 0)
+ _nl_load_domain (retval->successor[cnt]);
+ if (retval->successor[cnt]->data != NULL)
+ break;
+ }
+ }
+
+ /* The room for an alias was dynamically allocated. Free it now. */
+ if (alias_value != NULL)
+ free (locale);
+
+ return retval;
+}
diff --git a/intl/gettext.c b/intl/gettext.c
new file mode 100644
index 00000000..1336d21e
--- /dev/null
+++ b/intl/gettext.c
@@ -0,0 +1,70 @@
+/* Implementation of gettext(3) function
+ Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef _LIBC
+# define __need_NULL
+# include <stddef.h>
+#else
+# ifdef STDC_HEADERS
+# include <stdlib.h> /* Just for NULL. */
+# else
+# ifdef HAVE_STRING_H
+# include <string.h>
+# else
+# define NULL ((void *) 0)
+# endif
+# endif
+#endif
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgettext.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define GETTEXT __gettext
+# define DGETTEXT __dgettext
+#else
+# define GETTEXT gettext__
+# define DGETTEXT dgettext__
+#endif
+
+/* Look up MSGID in the current default message catalog for the current
+ LC_MESSAGES locale. If not found, returns MSGID itself (the default
+ text). */
+char *
+GETTEXT (msgid)
+ const char *msgid;
+{
+ return DGETTEXT (NULL, msgid);
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__gettext, gettext);
+#endif
diff --git a/intl/gettext.h b/intl/gettext.h
new file mode 100644
index 00000000..6b4b9e33
--- /dev/null
+++ b/intl/gettext.h
@@ -0,0 +1,105 @@
+/* Internal header for GNU gettext internationalization functions
+ Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef _GETTEXT_H
+#define _GETTEXT_H 1
+
+#include <stdio.h>
+
+#if HAVE_LIMITS_H || _LIBC
+# include <limits.h>
+#endif
+
+/* @@ end of prolog @@ */
+
+/* The magic number of the GNU message catalog format. */
+#define _MAGIC 0x950412de
+#define _MAGIC_SWAPPED 0xde120495
+
+/* Revision number of the currently used .mo (binary) file format. */
+#define MO_REVISION_NUMBER 0
+
+/* The following contortions are an attempt to use the C preprocessor
+ to determine an unsigned integral type that is 32 bits wide. An
+ alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
+ doing that would require that the configure script compile and *run*
+ the resulting executable. Locally running cross-compiled executables
+ is usually not possible. */
+
+#if __STDC__
+# define UINT_MAX_32_BITS 4294967295U
+#else
+# define UINT_MAX_32_BITS 0xFFFFFFFF
+#endif
+
+/* If UINT_MAX isn't defined, assume it's a 32-bit type.
+ This should be valid for all systems GNU cares about because
+ that doesn't include 16-bit systems, and only modern systems
+ (that certainly have <limits.h>) have 64+-bit integral types. */
+
+#ifndef UINT_MAX
+# define UINT_MAX UINT_MAX_32_BITS
+#endif
+
+#if UINT_MAX == UINT_MAX_32_BITS
+typedef unsigned nls_uint32;
+#else
+# if USHRT_MAX == UINT_MAX_32_BITS
+typedef unsigned short nls_uint32;
+# else
+# if ULONG_MAX == UINT_MAX_32_BITS
+typedef unsigned long nls_uint32;
+# else
+ /* The following line is intended to throw an error. Using #error is
+ not portable enough. */
+ "Cannot determine unsigned 32-bit data type."
+# endif
+# endif
+#endif
+
+
+/* Header for binary .mo file format. */
+struct mo_file_header
+{
+ /* The magic number. */
+ nls_uint32 magic;
+ /* The revision number of the file format. */
+ nls_uint32 revision;
+ /* The number of strings pairs. */
+ nls_uint32 nstrings;
+ /* Offset of table with start offsets of original strings. */
+ nls_uint32 orig_tab_offset;
+ /* Offset of table with start offsets of translation strings. */
+ nls_uint32 trans_tab_offset;
+ /* Size of hashing table. */
+ nls_uint32 hash_tab_size;
+ /* Offset of first hashing entry. */
+ nls_uint32 hash_tab_offset;
+};
+
+struct string_desc
+{
+ /* Length of addressed string. */
+ nls_uint32 length;
+ /* Offset of string in file. */
+ nls_uint32 offset;
+};
+
+/* @@ begin of epilog @@ */
+
+#endif /* gettext.h */
diff --git a/intl/gettextP.h b/intl/gettextP.h
new file mode 100644
index 00000000..bb8d5523
--- /dev/null
+++ b/intl/gettextP.h
@@ -0,0 +1,73 @@
+/* Header describing internals of gettext library
+ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifndef _GETTEXTP_H
+#define _GETTEXTP_H
+
+#include "loadinfo.h"
+
+/* @@ end of prolog @@ */
+
+#ifndef PARAMS
+# if __STDC__
+# define PARAMS(args) args
+# else
+# define PARAMS(args) ()
+# endif
+#endif
+
+#ifndef W
+# define W(flag, data) ((flag) ? SWAP (data) : (data))
+#endif
+
+
+static nls_uint32 SWAP PARAMS ((nls_uint32 i));
+
+static inline nls_uint32
+SWAP (i)
+ nls_uint32 i;
+{
+ return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
+}
+
+
+struct loaded_domain
+{
+ const char *data;
+ int must_swap;
+ nls_uint32 nstrings;
+ struct string_desc *orig_tab;
+ struct string_desc *trans_tab;
+ nls_uint32 hash_size;
+ nls_uint32 *hash_tab;
+};
+
+struct binding
+{
+ struct binding *next;
+ char *domainname;
+ char *dirname;
+};
+
+struct loaded_l10nfile *_nl_find_domain PARAMS ((const char *__dirname,
+ char *__locale,
+ const char *__domainname));
+void _nl_load_domain PARAMS ((struct loaded_l10nfile *__domain));
+
+/* @@ begin of epilog @@ */
+
+#endif /* gettextP.h */
diff --git a/intl/hash-string.h b/intl/hash-string.h
new file mode 100644
index 00000000..e66e8417
--- /dev/null
+++ b/intl/hash-string.h
@@ -0,0 +1,63 @@
+/* Implements a string hashing function.
+ Copyright (C) 1995, 1997 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_VALUES_H
+# include <values.h>
+#endif
+
+/* @@ end of prolog @@ */
+
+#ifndef PARAMS
+# if __STDC__
+# define PARAMS(Args) Args
+# else
+# define PARAMS(Args) ()
+# endif
+#endif
+
+/* We assume to have `unsigned long int' value with at least 32 bits. */
+#define HASHWORDBITS 32
+
+
+/* Defines the so called `hashpjw' function by P.J. Weinberger
+ [see Aho/Sethi/Ullman, COMPILERS: Principles, Techniques and Tools,
+ 1986, 1987 Bell Telephone Laboratories, Inc.] */
+static unsigned long hash_string PARAMS ((const char *__str_param));
+
+static inline unsigned long
+hash_string (str_param)
+ const char *str_param;
+{
+ unsigned long int hval, g;
+ const char *str = str_param;
+
+ /* Compute the hash value for the given string. */
+ hval = 0;
+ while (*str != '\0')
+ {
+ hval <<= 4;
+ hval += (unsigned long) *str++;
+ g = hval & ((unsigned long) 0xf << (HASHWORDBITS - 4));
+ if (g != 0)
+ {
+ hval ^= g >> (HASHWORDBITS - 8);
+ hval ^= g;
+ }
+ }
+ return hval;
+}
diff --git a/intl/intl-compat.c b/intl/intl-compat.c
new file mode 100644
index 00000000..503efa0f
--- /dev/null
+++ b/intl/intl-compat.c
@@ -0,0 +1,76 @@
+/* intl-compat.c - Stub functions to call gettext functions from GNU gettext
+ Library.
+ Copyright (C) 1995 Software Foundation, Inc.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include "libgettext.h"
+
+/* @@ end of prolog @@ */
+
+
+#undef gettext
+#undef dgettext
+#undef dcgettext
+#undef textdomain
+#undef bindtextdomain
+
+
+char *
+bindtextdomain (domainname, dirname)
+ const char *domainname;
+ const char *dirname;
+{
+ return bindtextdomain__ (domainname, dirname);
+}
+
+
+char *
+dcgettext (domainname, msgid, category)
+ const char *domainname;
+ const char *msgid;
+ int category;
+{
+ return dcgettext__ (domainname, msgid, category);
+}
+
+
+char *
+dgettext (domainname, msgid)
+ const char *domainname;
+ const char *msgid;
+{
+ return dgettext__ (domainname, msgid);
+}
+
+
+char *
+gettext (msgid)
+ const char *msgid;
+{
+ return gettext__ (msgid);
+}
+
+
+char *
+textdomain (domainname)
+ const char *domainname;
+{
+ return textdomain__ (domainname);
+}
diff --git a/intl/l10nflist.c b/intl/l10nflist.c
new file mode 100644
index 00000000..4e2bc130
--- /dev/null
+++ b/intl/l10nflist.c
@@ -0,0 +1,409 @@
+/* Handle list of needed message catalogs
+ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+
+#if defined HAVE_STRING_H || defined _LIBC
+# ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+# endif
+# include <string.h>
+#else
+# include <strings.h>
+# ifndef memcpy
+# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+# endif
+#endif
+#if !HAVE_STRCHR && !defined _LIBC
+# ifndef strchr
+# define strchr index
+# endif
+#endif
+
+#if defined _LIBC || defined HAVE_ARGZ_H
+# include <argz.h>
+#endif
+#include <ctype.h>
+#include <sys/types.h>
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#endif
+
+#include "loadinfo.h"
+
+/* On some strange systems still no definition of NULL is found. Sigh! */
+#ifndef NULL
+# if defined __STDC__ && __STDC__
+# define NULL ((void *) 0)
+# else
+# define NULL 0
+# endif
+#endif
+
+/* @@ end of prolog @@ */
+
+#ifdef _LIBC
+/* Rename the non ANSI C functions. This is required by the standard
+ because some ANSI C functions will require linking with this object
+ file and the name space must not be polluted. */
+# define stpcpy(dest, src) __stpcpy(dest, src)
+#else
+# ifndef HAVE_STPCPY
+static char *stpcpy PARAMS ((char *dest, const char *src));
+# endif
+#endif
+
+/* Define function which are usually not available. */
+
+#if !defined _LIBC && !defined HAVE___ARGZ_COUNT
+/* Returns the number of strings in ARGZ. */
+static size_t argz_count__ PARAMS ((const char *argz, size_t len));
+
+static size_t
+argz_count__ (argz, len)
+ const char *argz;
+ size_t len;
+{
+ size_t count = 0;
+ while (len > 0)
+ {
+ size_t part_len = strlen (argz);
+ argz += part_len + 1;
+ len -= part_len + 1;
+ count++;
+ }
+ return count;
+}
+# undef __argz_count
+# define __argz_count(argz, len) argz_count__ (argz, len)
+#endif /* !_LIBC && !HAVE___ARGZ_COUNT */
+
+#if !defined _LIBC && !defined HAVE___ARGZ_STRINGIFY
+/* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
+ except the last into the character SEP. */
+static void argz_stringify__ PARAMS ((char *argz, size_t len, int sep));
+
+static void
+argz_stringify__ (argz, len, sep)
+ char *argz;
+ size_t len;
+ int sep;
+{
+ while (len > 0)
+ {
+ size_t part_len = strlen (argz);
+ argz += part_len;
+ len -= part_len + 1;
+ if (len > 0)
+ *argz++ = sep;
+ }
+}
+# undef __argz_stringify
+# define __argz_stringify(argz, len, sep) argz_stringify__ (argz, len, sep)
+#endif /* !_LIBC && !HAVE___ARGZ_STRINGIFY */
+
+#if !defined _LIBC && !defined HAVE___ARGZ_NEXT
+static char *argz_next__ PARAMS ((char *argz, size_t argz_len,
+ const char *entry));
+
+static char *
+argz_next__ (argz, argz_len, entry)
+ char *argz;
+ size_t argz_len;
+ const char *entry;
+{
+ if (entry)
+ {
+ if (entry < argz + argz_len)
+ entry = strchr (entry, '\0') + 1;
+
+ return entry >= argz + argz_len ? NULL : (char *) entry;
+ }
+ else
+ if (argz_len > 0)
+ return argz;
+ else
+ return 0;
+}
+# undef __argz_next
+# define __argz_next(argz, len, entry) argz_next__ (argz, len, entry)
+#endif /* !_LIBC && !HAVE___ARGZ_NEXT */
+
+
+/* Return number of bits set in X. */
+static int pop PARAMS ((int x));
+
+static inline int
+pop (x)
+ int x;
+{
+ /* We assume that no more than 16 bits are used. */
+ x = ((x & ~0x5555) >> 1) + (x & 0x5555);
+ x = ((x & ~0x3333) >> 2) + (x & 0x3333);
+ x = ((x >> 4) + x) & 0x0f0f;
+ x = ((x >> 8) + x) & 0xff;
+
+ return x;
+}
+
+
+struct loaded_l10nfile *
+_nl_make_l10nflist (l10nfile_list, dirlist, dirlist_len, mask, language,
+ territory, codeset, normalized_codeset, modifier, special,
+ sponsor, revision, filename, do_allocate)
+ struct loaded_l10nfile **l10nfile_list;
+ const char *dirlist;
+ size_t dirlist_len;
+ int mask;
+ const char *language;
+ const char *territory;
+ const char *codeset;
+ const char *normalized_codeset;
+ const char *modifier;
+ const char *special;
+ const char *sponsor;
+ const char *revision;
+ const char *filename;
+ int do_allocate;
+{
+ char *abs_filename;
+ struct loaded_l10nfile *last = NULL;
+ struct loaded_l10nfile *retval;
+ char *cp;
+ size_t entries;
+ int cnt;
+
+ /* Allocate room for the full file name. */
+ abs_filename = (char *) malloc (dirlist_len
+ + strlen (language)
+ + ((mask & TERRITORY) != 0
+ ? strlen (territory) + 1 : 0)
+ + ((mask & XPG_CODESET) != 0
+ ? strlen (codeset) + 1 : 0)
+ + ((mask & XPG_NORM_CODESET) != 0
+ ? strlen (normalized_codeset) + 1 : 0)
+ + (((mask & XPG_MODIFIER) != 0
+ || (mask & CEN_AUDIENCE) != 0)
+ ? strlen (modifier) + 1 : 0)
+ + ((mask & CEN_SPECIAL) != 0
+ ? strlen (special) + 1 : 0)
+ + (((mask & CEN_SPONSOR) != 0
+ || (mask & CEN_REVISION) != 0)
+ ? (1 + ((mask & CEN_SPONSOR) != 0
+ ? strlen (sponsor) + 1 : 0)
+ + ((mask & CEN_REVISION) != 0
+ ? strlen (revision) + 1 : 0)) : 0)
+ + 1 + strlen (filename) + 1);
+
+ if (abs_filename == NULL)
+ return NULL;
+
+ retval = NULL;
+ last = NULL;
+
+ /* Construct file name. */
+ memcpy (abs_filename, dirlist, dirlist_len);
+ __argz_stringify (abs_filename, dirlist_len, ':');
+ cp = abs_filename + (dirlist_len - 1);
+ *cp++ = '/';
+ cp = stpcpy (cp, language);
+
+ if ((mask & TERRITORY) != 0)
+ {
+ *cp++ = '_';
+ cp = stpcpy (cp, territory);
+ }
+ if ((mask & XPG_CODESET) != 0)
+ {
+ *cp++ = '.';
+ cp = stpcpy (cp, codeset);
+ }
+ if ((mask & XPG_NORM_CODESET) != 0)
+ {
+ *cp++ = '.';
+ cp = stpcpy (cp, normalized_codeset);
+ }
+ if ((mask & (XPG_MODIFIER | CEN_AUDIENCE)) != 0)
+ {
+ /* This component can be part of both syntaces but has different
+ leading characters. For CEN we use `+', else `@'. */
+ *cp++ = (mask & CEN_AUDIENCE) != 0 ? '+' : '@';
+ cp = stpcpy (cp, modifier);
+ }
+ if ((mask & CEN_SPECIAL) != 0)
+ {
+ *cp++ = '+';
+ cp = stpcpy (cp, special);
+ }
+ if ((mask & (CEN_SPONSOR | CEN_REVISION)) != 0)
+ {
+ *cp++ = ',';
+ if ((mask & CEN_SPONSOR) != 0)
+ cp = stpcpy (cp, sponsor);
+ if ((mask & CEN_REVISION) != 0)
+ {
+ *cp++ = '_';
+ cp = stpcpy (cp, revision);
+ }
+ }
+
+ *cp++ = '/';
+ stpcpy (cp, filename);
+
+ /* Look in list of already loaded domains whether it is already
+ available. */
+ last = NULL;
+ for (retval = *l10nfile_list; retval != NULL; retval = retval->next)
+ if (retval->filename != NULL)
+ {
+ int compare = strcmp (retval->filename, abs_filename);
+ if (compare == 0)
+ /* We found it! */
+ break;
+ if (compare < 0)
+ {
+ /* It's not in the list. */
+ retval = NULL;
+ break;
+ }
+
+ last = retval;
+ }
+
+ if (retval != NULL || do_allocate == 0)
+ {
+ free (abs_filename);
+ return retval;
+ }
+
+ retval = (struct loaded_l10nfile *)
+ malloc (sizeof (*retval) + (__argz_count (dirlist, dirlist_len)
+ * (1 << pop (mask))
+ * sizeof (struct loaded_l10nfile *)));
+ if (retval == NULL)
+ return NULL;
+
+ retval->filename = abs_filename;
+ retval->decided = (__argz_count (dirlist, dirlist_len) != 1
+ || ((mask & XPG_CODESET) != 0
+ && (mask & XPG_NORM_CODESET) != 0));
+ retval->data = NULL;
+
+ if (last == NULL)
+ {
+ retval->next = *l10nfile_list;
+ *l10nfile_list = retval;
+ }
+ else
+ {
+ retval->next = last->next;
+ last->next = retval;
+ }
+
+ entries = 0;
+ /* If the DIRLIST is a real list the RETVAL entry corresponds not to
+ a real file. So we have to use the DIRLIST separation mechanism
+ of the inner loop. */
+ cnt = __argz_count (dirlist, dirlist_len) == 1 ? mask - 1 : mask;
+ for (; cnt >= 0; --cnt)
+ if ((cnt & ~mask) == 0
+ && ((cnt & CEN_SPECIFIC) == 0 || (cnt & XPG_SPECIFIC) == 0)
+ && ((cnt & XPG_CODESET) == 0 || (cnt & XPG_NORM_CODESET) == 0))
+ {
+ /* Iterate over all elements of the DIRLIST. */
+ char *dir = NULL;
+
+ while ((dir = __argz_next ((char *) dirlist, dirlist_len, dir))
+ != NULL)
+ retval->successor[entries++]
+ = _nl_make_l10nflist (l10nfile_list, dir, strlen (dir) + 1, cnt,
+ language, territory, codeset,
+ normalized_codeset, modifier, special,
+ sponsor, revision, filename, 1);
+ }
+ retval->successor[entries] = NULL;
+
+ return retval;
+}
+
+/* Normalize codeset name. There is no standard for the codeset
+ names. Normalization allows the user to use any of the common
+ names. */
+const char *
+_nl_normalize_codeset (codeset, name_len)
+ const char *codeset;
+ size_t name_len;
+{
+ int len = 0;
+ int only_digit = 1;
+ char *retval;
+ char *wp;
+ size_t cnt;
+
+ for (cnt = 0; cnt < name_len; ++cnt)
+ if (isalnum (codeset[cnt]))
+ {
+ ++len;
+
+ if (isalpha (codeset[cnt]))
+ only_digit = 0;
+ }
+
+ retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1);
+
+ if (retval != NULL)
+ {
+ if (only_digit)
+ wp = stpcpy (retval, "iso");
+ else
+ wp = retval;
+
+ for (cnt = 0; cnt < name_len; ++cnt)
+ if (isalpha (codeset[cnt]))
+ *wp++ = tolower (codeset[cnt]);
+ else if (isdigit (codeset[cnt]))
+ *wp++ = codeset[cnt];
+
+ *wp = '\0';
+ }
+
+ return (const char *) retval;
+}
+
+
+/* @@ begin of epilog @@ */
+
+/* We don't want libintl.a to depend on any other library. So we
+ avoid the non-standard function stpcpy. In GNU C Library this
+ function is available, though. Also allow the symbol HAVE_STPCPY
+ to be defined. */
+#if !_LIBC && !HAVE_STPCPY
+static char *
+stpcpy (dest, src)
+ char *dest;
+ const char *src;
+{
+ while ((*dest++ = *src++) != '\0')
+ /* Do nothing. */ ;
+ return dest - 1;
+}
+#endif
diff --git a/intl/libgettext.h b/intl/libgettext.h
new file mode 100644
index 00000000..0d4de4d0
--- /dev/null
+++ b/intl/libgettext.h
@@ -0,0 +1,182 @@
+/* Message catalogs for internationalization.
+ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+/* Because on some systems (e.g. Solaris) we sometimes have to include
+ the systems libintl.h as well as this file we have more complex
+ include protection above. But the systems header might perhaps also
+ define _LIBINTL_H and therefore we have to protect the definition here. */
+
+#if !defined (_LIBINTL_H) || !defined (_LIBGETTEXT_H)
+#if !defined (_LIBINTL_H)
+# define _LIBINTL_H 1
+#endif
+#define _LIBGETTEXT_H 1
+
+/* We define an additional symbol to signal that we use the GNU
+ implementation of gettext. */
+#define __USE_GNU_GETTEXT 1
+
+#include <sys/types.h>
+
+#if HAVE_LOCALE_H
+# include <locale.h>
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* @@ end of prolog @@ */
+
+#ifndef PARAMS
+# if __STDC__
+# define PARAMS(args) args
+# else
+# define PARAMS(args) ()
+# endif
+#endif
+
+#ifndef NULL
+# if !defined __cplusplus || defined __GNUC__
+# define NULL ((void *) 0)
+# else
+# define NULL (0)
+# endif
+#endif
+
+#if !HAVE_LC_MESSAGES
+/* This value determines the behaviour of the gettext() and dgettext()
+ function. But some system does not have this defined. Define it
+ to a default value. */
+# define LC_MESSAGES (-1)
+#endif
+
+
+/* Declarations for gettext-using-catgets interface. Derived from
+ Jim Meyering's libintl.h. */
+struct _msg_ent
+{
+ const char *_msg;
+ int _msg_number;
+};
+
+
+#if HAVE_CATGETS
+/* These two variables are defined in the automatically by po-to-tbl.sed
+ generated file `cat-id-tbl.c'. */
+extern const struct _msg_ent _msg_tbl[];
+extern int _msg_tbl_length;
+#endif
+
+
+/* For automatical extraction of messages sometimes no real
+ translation is needed. Instead the string itself is the result. */
+#define gettext_noop(Str) (Str)
+
+/* Look up MSGID in the current default message catalog for the current
+ LC_MESSAGES locale. If not found, returns MSGID itself (the default
+ text). */
+extern char *gettext PARAMS ((const char *__msgid));
+extern char *gettext__ PARAMS ((const char *__msgid));
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current
+ LC_MESSAGES locale. */
+extern char *dgettext PARAMS ((const char *__domainname, const char *__msgid));
+extern char *dgettext__ PARAMS ((const char *__domainname,
+ const char *__msgid));
+
+/* Look up MSGID in the DOMAINNAME message catalog for the current CATEGORY
+ locale. */
+extern char *dcgettext PARAMS ((const char *__domainname, const char *__msgid,
+ int __category));
+extern char *dcgettext__ PARAMS ((const char *__domainname,
+ const char *__msgid, int __category));
+
+
+/* Set the current default message catalog to DOMAINNAME.
+ If DOMAINNAME is null, return the current default.
+ If DOMAINNAME is "", reset to the default of "messages". */
+extern char *textdomain PARAMS ((const char *__domainname));
+extern char *textdomain__ PARAMS ((const char *__domainname));
+
+/* Specify that the DOMAINNAME message catalog will be found
+ in DIRNAME rather than in the system locale data base. */
+extern char *bindtextdomain PARAMS ((const char *__domainname,
+ const char *__dirname));
+extern char *bindtextdomain__ PARAMS ((const char *__domainname,
+ const char *__dirname));
+
+#if ENABLE_NLS
+
+/* Solaris 2.3 has the gettext function but dcgettext is missing.
+ So we omit this optimization for Solaris 2.3. BTW, Solaris 2.4
+ has dcgettext. */
+# if !HAVE_CATGETS && (!HAVE_GETTEXT || HAVE_DCGETTEXT)
+
+# define gettext(Msgid) \
+ dgettext (NULL, Msgid)
+
+# define dgettext(Domainname, Msgid) \
+ dcgettext (Domainname, Msgid, LC_MESSAGES)
+
+# if defined __GNUC__ && __GNUC__ == 2 && __GNUC_MINOR__ >= 7
+/* This global variable is defined in loadmsgcat.c. We need a sign,
+ whether a new catalog was loaded, which can be associated with all
+ translations. */
+extern int _nl_msg_cat_cntr;
+
+# define dcgettext(Domainname, Msgid, Category) \
+ (__extension__ \
+ ({ \
+ char *__result; \
+ if (__builtin_constant_p (Msgid)) \
+ { \
+ static char *__translation__; \
+ static int __catalog_counter__; \
+ if (! __translation__ || __catalog_counter__ != _nl_msg_cat_cntr) \
+ { \
+ __translation__ = \
+ dcgettext__ (Domainname, Msgid, Category); \
+ __catalog_counter__ = _nl_msg_cat_cntr; \
+ } \
+ __result = __translation__; \
+ } \
+ else \
+ __result = dcgettext__ (Domainname, Msgid, Category); \
+ __result; \
+ }))
+# endif
+# endif
+
+#else
+
+# define gettext(Msgid) (Msgid)
+# define dgettext(Domainname, Msgid) (Msgid)
+# define dcgettext(Domainname, Msgid, Category) (Msgid)
+# define textdomain(Domainname) while (0) /* nothing */
+# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */
+
+#endif
+
+/* @@ begin of epilog @@ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/intl/linux-msg.sed b/intl/linux-msg.sed
new file mode 100644
index 00000000..5918e720
--- /dev/null
+++ b/intl/linux-msg.sed
@@ -0,0 +1,100 @@
+# po2msg.sed - Convert Uniforum style .po file to Linux style .msg file
+# Copyright (C) 1995 Free Software Foundation, Inc.
+# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+#
+# The first directive in the .msg should be the definition of the
+# message set number. We use always set number 1.
+#
+1 {
+ i\
+$set 1 # Automatically created by po2msg.sed
+ h
+ s/.*/0/
+ x
+}
+#
+# Mitch's old catalog format does not allow comments.
+#
+# We copy the original message as a comment into the .msg file.
+#
+/^msgid/ {
+ s/msgid[ ]*"//
+#
+# This does not work now with the new format.
+# /"$/! {
+# s/\\$//
+# s/$/ ... (more lines following)"/
+# }
+ x
+# The following nice solution is by
+# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
+ td
+# Increment a decimal number in pattern space.
+# First hide trailing `9' digits.
+ :d
+ s/9\(_*\)$/_\1/
+ td
+# Assure at least one digit is available.
+ s/^\(_*\)$/0\1/
+# Increment the last digit.
+ s/8\(_*\)$/9\1/
+ s/7\(_*\)$/8\1/
+ s/6\(_*\)$/7\1/
+ s/5\(_*\)$/6\1/
+ s/4\(_*\)$/5\1/
+ s/3\(_*\)$/4\1/
+ s/2\(_*\)$/3\1/
+ s/1\(_*\)$/2\1/
+ s/0\(_*\)$/1\1/
+# Convert the hidden `9' digits to `0's.
+ s/_/0/g
+ x
+ G
+ s/\(.*\)"\n\([0-9]*\)/$ #\2 Original Message:(\1)/p
+}
+#
+# The .msg file contains, other then the .po file, only the translations
+# but each given a unique ID. Starting from 1 and incrementing by 1 for
+# each message we assign them to the messages.
+# It is important that the .po file used to generate the cat-id-tbl.c file
+# (with po-to-tbl) is the same as the one used here. (At least the order
+# of declarations must not be changed.)
+#
+/^msgstr/ {
+ s/msgstr[ ]*"\(.*\)"/# \1/
+# Clear substitution flag.
+ tb
+# Append the next line.
+ :b
+ N
+# Look whether second part is continuation line.
+ s/\(.*\n\)"\(.*\)"/\1\2/
+# Yes, then branch.
+ ta
+ P
+ D
+# Note that D includes a jump to the start!!
+# We found a continuation line. But before printing insert '\'.
+ :a
+ s/\(.*\)\(\n.*\)/\1\\\2/
+ P
+# We cannot use D here.
+ s/.*\n\(.*\)/\1/
+ tb
+}
+d
diff --git a/intl/loadinfo.h b/intl/loadinfo.h
new file mode 100644
index 00000000..c67c2eb2
--- /dev/null
+++ b/intl/loadinfo.h
@@ -0,0 +1,58 @@
+#ifndef PARAMS
+# if __STDC__
+# define PARAMS(args) args
+# else
+# define PARAMS(args) ()
+# endif
+#endif
+
+/* Encoding of locale name parts. */
+#define CEN_REVISION 1
+#define CEN_SPONSOR 2
+#define CEN_SPECIAL 4
+#define XPG_NORM_CODESET 8
+#define XPG_CODESET 16
+#define TERRITORY 32
+#define CEN_AUDIENCE 64
+#define XPG_MODIFIER 128
+
+#define CEN_SPECIFIC (CEN_REVISION|CEN_SPONSOR|CEN_SPECIAL|CEN_AUDIENCE)
+#define XPG_SPECIFIC (XPG_CODESET|XPG_NORM_CODESET|XPG_MODIFIER)
+
+
+struct loaded_l10nfile
+{
+ const char *filename;
+ int decided;
+
+ const void *data;
+
+ struct loaded_l10nfile *next;
+ struct loaded_l10nfile *successor[1];
+};
+
+
+extern const char *_nl_normalize_codeset PARAMS ((const char *codeset,
+ size_t name_len));
+
+extern struct loaded_l10nfile *
+_nl_make_l10nflist PARAMS ((struct loaded_l10nfile **l10nfile_list,
+ const char *dirlist, size_t dirlist_len, int mask,
+ const char *language, const char *territory,
+ const char *codeset,
+ const char *normalized_codeset,
+ const char *modifier, const char *special,
+ const char *sponsor, const char *revision,
+ const char *filename, int do_allocate));
+
+
+extern const char *_nl_expand_alias PARAMS ((const char *name));
+
+extern int _nl_explode_name PARAMS ((char *name, const char **language,
+ const char **modifier,
+ const char **territory,
+ const char **codeset,
+ const char **normalized_codeset,
+ const char **special,
+ const char **sponsor,
+ const char **revision));
diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c
new file mode 100644
index 00000000..73e90a91
--- /dev/null
+++ b/intl/loadmsgcat.c
@@ -0,0 +1,199 @@
+/* Load needed message catalogs
+ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <fcntl.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#endif
+
+#if defined HAVE_UNISTD_H || defined _LIBC
+# include <unistd.h>
+#endif
+
+#if (defined HAVE_MMAP && defined HAVE_MUNMAP) || defined _LIBC
+# include <sys/mman.h>
+#endif
+
+#include "gettext.h"
+#include "gettextP.h"
+
+/* @@ end of prolog @@ */
+
+#ifdef _LIBC
+/* Rename the non ISO C functions. This is required by the standard
+ because some ISO C functions will require linking with this object
+ file and the name space must not be polluted. */
+# define fstat __fstat
+# define open __open
+# define close __close
+# define read __read
+# define mmap __mmap
+# define munmap __munmap
+#endif
+
+/* We need a sign, whether a new catalog was loaded, which can be associated
+ with all translations. This is important if the translations are
+ cached by one of GCC's features. */
+int _nl_msg_cat_cntr = 0;
+
+
+/* Load the message catalogs specified by FILENAME. If it is no valid
+ message catalog do nothing. */
+void
+_nl_load_domain (domain_file)
+ struct loaded_l10nfile *domain_file;
+{
+ int fd;
+ struct stat st;
+ struct mo_file_header *data = (struct mo_file_header *) -1;
+#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+ || defined _LIBC
+ int use_mmap = 0;
+#endif
+ struct loaded_domain *domain;
+
+ domain_file->decided = 1;
+ domain_file->data = NULL;
+
+ /* If the record does not represent a valid locale the FILENAME
+ might be NULL. This can happen when according to the given
+ specification the locale file name is different for XPG and CEN
+ syntax. */
+ if (domain_file->filename == NULL)
+ return;
+
+ /* Try to open the addressed file. */
+ fd = open (domain_file->filename, O_RDONLY);
+ if (fd == -1)
+ return;
+
+ /* We must know about the size of the file. */
+ if (fstat (fd, &st) != 0
+ && st.st_size < (off_t) sizeof (struct mo_file_header))
+ {
+ /* Something went wrong. */
+ close (fd);
+ return;
+ }
+
+#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+ || defined _LIBC
+ /* Now we are ready to load the file. If mmap() is available we try
+ this first. If not available or it failed we try to load it. */
+ data = (struct mo_file_header *) mmap (NULL, st.st_size, PROT_READ,
+ MAP_PRIVATE, fd, 0);
+
+ if (data != (struct mo_file_header *) -1)
+ {
+ /* mmap() call was successful. */
+ close (fd);
+ use_mmap = 1;
+ }
+#endif
+
+ /* If the data is not yet available (i.e. mmap'ed) we try to load
+ it manually. */
+ if (data == (struct mo_file_header *) -1)
+ {
+ off_t to_read;
+ char *read_ptr;
+
+ data = (struct mo_file_header *) malloc (st.st_size);
+ if (data == NULL)
+ return;
+
+ to_read = st.st_size;
+ read_ptr = (char *) data;
+ do
+ {
+ long int nb = (long int) read (fd, read_ptr, to_read);
+ if (nb == -1)
+ {
+ close (fd);
+ return;
+ }
+
+ read_ptr += nb;
+ to_read -= nb;
+ }
+ while (to_read > 0);
+
+ close (fd);
+ }
+
+ /* Using the magic number we can test whether it really is a message
+ catalog file. */
+ if (data->magic != _MAGIC && data->magic != _MAGIC_SWAPPED)
+ {
+ /* The magic number is wrong: not a message catalog file. */
+#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+ || defined _LIBC
+ if (use_mmap)
+ munmap ((caddr_t) data, st.st_size);
+ else
+#endif
+ free (data);
+ return;
+ }
+
+ domain_file->data
+ = (struct loaded_domain *) malloc (sizeof (struct loaded_domain));
+ if (domain_file->data == NULL)
+ return;
+
+ domain = (struct loaded_domain *) domain_file->data;
+ domain->data = (char *) data;
+ domain->must_swap = data->magic != _MAGIC;
+
+ /* Fill in the information about the available tables. */
+ switch (W (domain->must_swap, data->revision))
+ {
+ case 0:
+ domain->nstrings = W (domain->must_swap, data->nstrings);
+ domain->orig_tab = (struct string_desc *)
+ ((char *) data + W (domain->must_swap, data->orig_tab_offset));
+ domain->trans_tab = (struct string_desc *)
+ ((char *) data + W (domain->must_swap, data->trans_tab_offset));
+ domain->hash_size = W (domain->must_swap, data->hash_tab_size);
+ domain->hash_tab = (nls_uint32 *)
+ ((char *) data + W (domain->must_swap, data->hash_tab_offset));
+ break;
+ default:
+ /* This is an illegal revision. */
+#if (defined HAVE_MMAP && defined HAVE_MUNMAP && !defined DISALLOW_MMAP) \
+ || defined _LIBC
+ if (use_mmap)
+ munmap ((caddr_t) data, st.st_size);
+ else
+#endif
+ free (data);
+ free (domain);
+ domain_file->data = NULL;
+ return;
+ }
+
+ /* Show that one domain is changed. This might make some cached
+ translations invalid. */
+ ++_nl_msg_cat_cntr;
+}
diff --git a/intl/localealias.c b/intl/localealias.c
new file mode 100644
index 00000000..00d91941
--- /dev/null
+++ b/intl/localealias.c
@@ -0,0 +1,378 @@
+/* Handle aliases for locale names
+ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <ctype.h>
+#include <stdio.h>
+#include <sys/types.h>
+
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+# define HAVE_ALLOCA 1
+#else
+# if defined HAVE_ALLOCA_H || defined _LIBC
+# include <alloca.h>
+# else
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca
+char *alloca ();
+# endif
+# endif
+# endif
+#endif
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#else
+char *getenv ();
+# ifdef HAVE_MALLOC_H
+# include <malloc.h>
+# else
+void free ();
+# endif
+#endif
+
+#if defined HAVE_STRING_H || defined _LIBC
+# ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+# endif
+# include <string.h>
+#else
+# include <strings.h>
+# ifndef memcpy
+# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+# endif
+#endif
+#if !HAVE_STRCHR && !defined _LIBC
+# ifndef strchr
+# define strchr index
+# endif
+#endif
+
+#include "gettext.h"
+#include "gettextP.h"
+
+/* @@ end of prolog @@ */
+
+#ifdef _LIBC
+/* Rename the non ANSI C functions. This is required by the standard
+ because some ANSI C functions will require linking with this object
+ file and the name space must not be polluted. */
+# define strcasecmp __strcasecmp
+#endif
+
+
+/* For those loosing systems which don't have `alloca' we have to add
+ some additional code emulating it. */
+#ifdef HAVE_ALLOCA
+/* Nothing has to be done. */
+# define ADD_BLOCK(list, address) /* nothing */
+# define FREE_BLOCKS(list) /* nothing */
+#else
+struct block_list
+{
+ void *address;
+ struct block_list *next;
+};
+# define ADD_BLOCK(list, addr) \
+ do { \
+ struct block_list *newp = (struct block_list *) malloc (sizeof (*newp)); \
+ /* If we cannot get a free block we cannot add the new element to \
+ the list. */ \
+ if (newp != NULL) { \
+ newp->address = (addr); \
+ newp->next = (list); \
+ (list) = newp; \
+ } \
+ } while (0)
+# define FREE_BLOCKS(list) \
+ do { \
+ while (list != NULL) { \
+ struct block_list *old = list; \
+ list = list->next; \
+ free (old); \
+ } \
+ } while (0)
+# undef alloca
+# define alloca(size) (malloc (size))
+#endif /* have alloca */
+
+
+struct alias_map
+{
+ const char *alias;
+ const char *value;
+};
+
+
+static struct alias_map *map;
+static size_t nmap = 0;
+static size_t maxmap = 0;
+
+
+/* Prototypes for local functions. */
+static size_t read_alias_file PARAMS ((const char *fname, int fname_len));
+static void extend_alias_table PARAMS ((void));
+static int alias_compare PARAMS ((const struct alias_map *map1,
+ const struct alias_map *map2));
+
+
+const char *
+_nl_expand_alias (name)
+ const char *name;
+{
+ static const char *locale_alias_path = LOCALE_ALIAS_PATH;
+ struct alias_map *retval;
+ size_t added;
+
+ do
+ {
+ struct alias_map item;
+
+ item.alias = name;
+
+ if (nmap > 0)
+ retval = (struct alias_map *) bsearch (&item, map, nmap,
+ sizeof (struct alias_map),
+ (int (*) PARAMS ((const void *,
+ const void *))
+ ) alias_compare);
+ else
+ retval = NULL;
+
+ /* We really found an alias. Return the value. */
+ if (retval != NULL)
+ return retval->value;
+
+ /* Perhaps we can find another alias file. */
+ added = 0;
+ while (added == 0 && locale_alias_path[0] != '\0')
+ {
+ const char *start;
+
+ while (locale_alias_path[0] == ':')
+ ++locale_alias_path;
+ start = locale_alias_path;
+
+ while (locale_alias_path[0] != '\0' && locale_alias_path[0] != ':')
+ ++locale_alias_path;
+
+ if (start < locale_alias_path)
+ added = read_alias_file (start, locale_alias_path - start);
+ }
+ }
+ while (added != 0);
+
+ return NULL;
+}
+
+
+static size_t
+read_alias_file (fname, fname_len)
+ const char *fname;
+ int fname_len;
+{
+#ifndef HAVE_ALLOCA
+ struct block_list *block_list = NULL;
+#endif
+ FILE *fp;
+ char *full_fname;
+ size_t added;
+ static const char aliasfile[] = "/locale.alias";
+
+ full_fname = (char *) alloca (fname_len + sizeof aliasfile);
+ ADD_BLOCK (block_list, full_fname);
+ memcpy (full_fname, fname, fname_len);
+ memcpy (&full_fname[fname_len], aliasfile, sizeof aliasfile);
+
+ fp = fopen (full_fname, "r");
+ if (fp == NULL)
+ {
+ FREE_BLOCKS (block_list);
+ return 0;
+ }
+
+ added = 0;
+ while (!feof (fp))
+ {
+ /* It is a reasonable approach to use a fix buffer here because
+ a) we are only interested in the first two fields
+ b) these fields must be usable as file names and so must not
+ be that long
+ */
+ char buf[BUFSIZ];
+ char *alias;
+ char *value;
+ char *cp;
+
+ if (fgets (buf, BUFSIZ, fp) == NULL)
+ /* EOF reached. */
+ break;
+
+ cp = buf;
+ /* Ignore leading white space. */
+ while (isspace (cp[0]))
+ ++cp;
+
+ /* A leading '#' signals a comment line. */
+ if (cp[0] != '\0' && cp[0] != '#')
+ {
+ alias = cp++;
+ while (cp[0] != '\0' && !isspace (cp[0]))
+ ++cp;
+ /* Terminate alias name. */
+ if (cp[0] != '\0')
+ *cp++ = '\0';
+
+ /* Now look for the beginning of the value. */
+ while (isspace (cp[0]))
+ ++cp;
+
+ if (cp[0] != '\0')
+ {
+ char *tp;
+ size_t len;
+
+ value = cp++;
+ while (cp[0] != '\0' && !isspace (cp[0]))
+ ++cp;
+ /* Terminate value. */
+ if (cp[0] == '\n')
+ {
+ /* This has to be done to make the following test
+ for the end of line possible. We are looking for
+ the terminating '\n' which do not overwrite here. */
+ *cp++ = '\0';
+ *cp = '\n';
+ }
+ else if (cp[0] != '\0')
+ *cp++ = '\0';
+
+ if (nmap >= maxmap)
+ extend_alias_table ();
+
+ /* We cannot depend on strdup available in the libc. Sigh! */
+ len = strlen (alias) + 1;
+ tp = (char *) malloc (len);
+ if (tp == NULL)
+ {
+ FREE_BLOCKS (block_list);
+ return added;
+ }
+ memcpy (tp, alias, len);
+ map[nmap].alias = tp;
+
+ len = strlen (value) + 1;
+ tp = (char *) malloc (len);
+ if (tp == NULL)
+ {
+ FREE_BLOCKS (block_list);
+ return added;
+ }
+ memcpy (tp, value, len);
+ map[nmap].value = tp;
+
+ ++nmap;
+ ++added;
+ }
+ }
+
+ /* Possibly not the whole line fits into the buffer. Ignore
+ the rest of the line. */
+ while (strchr (cp, '\n') == NULL)
+ {
+ cp = buf;
+ if (fgets (buf, BUFSIZ, fp) == NULL)
+ /* Make sure the inner loop will be left. The outer loop
+ will exit at the `feof' test. */
+ *cp = '\n';
+ }
+ }
+
+ /* Should we test for ferror()? I think we have to silently ignore
+ errors. --drepper */
+ fclose (fp);
+
+ if (added > 0)
+ qsort (map, nmap, sizeof (struct alias_map),
+ (int (*) PARAMS ((const void *, const void *))) alias_compare);
+
+ FREE_BLOCKS (block_list);
+ return added;
+}
+
+
+static void
+extend_alias_table ()
+{
+ size_t new_size;
+ struct alias_map *new_map;
+
+ new_size = maxmap == 0 ? 100 : 2 * maxmap;
+ new_map = (struct alias_map *) malloc (new_size
+ * sizeof (struct alias_map));
+ if (new_map == NULL)
+ /* Simply don't extend: we don't have any more core. */
+ return;
+
+ memcpy (new_map, map, nmap * sizeof (struct alias_map));
+
+ if (maxmap != 0)
+ free (map);
+
+ map = new_map;
+ maxmap = new_size;
+}
+
+
+static int
+alias_compare (map1, map2)
+ const struct alias_map *map1;
+ const struct alias_map *map2;
+{
+#if defined _LIBC || defined HAVE_STRCASECMP
+ return strcasecmp (map1->alias, map2->alias);
+#else
+ const unsigned char *p1 = (const unsigned char *) map1->alias;
+ const unsigned char *p2 = (const unsigned char *) map2->alias;
+ unsigned char c1, c2;
+
+ if (p1 == p2)
+ return 0;
+
+ do
+ {
+ /* I know this seems to be odd but the tolower() function in
+ some systems libc cannot handle nonalpha characters. */
+ c1 = isupper (*p1) ? tolower (*p1) : *p1;
+ c2 = isupper (*p2) ? tolower (*p2) : *p2;
+ if (c1 == '\0')
+ break;
+ ++p1;
+ ++p2;
+ }
+ while (c1 == c2);
+
+ return c1 - c2;
+#endif
+}
diff --git a/intl/po2tbl.sed.in b/intl/po2tbl.sed.in
new file mode 100644
index 00000000..b3bcca4d
--- /dev/null
+++ b/intl/po2tbl.sed.in
@@ -0,0 +1,102 @@
+# po2tbl.sed - Convert Uniforum style .po file to lookup table for catgets
+# Copyright (C) 1995 Free Software Foundation, Inc.
+# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+1 {
+ i\
+/* Automatically generated by po2tbl.sed from @PACKAGE NAME@.pot. */\
+\
+#if HAVE_CONFIG_H\
+# include <config.h>\
+#endif\
+\
+#include "libgettext.h"\
+\
+const struct _msg_ent _msg_tbl[] = {
+ h
+ s/.*/0/
+ x
+}
+#
+# Write msgid entries in C array form.
+#
+/^msgid/ {
+ s/msgid[ ]*\(".*"\)/ {\1/
+ tb
+# Append the next line
+ :b
+ N
+# Look whether second part is continuation line.
+ s/\(.*\)"\(\n\)"\(.*"\)/\1\2\3/
+# Yes, then branch.
+ ta
+# Because we assume that the input file correctly formed the line
+# just read cannot be again be a msgid line. So it's safe to ignore
+# it.
+ s/\(.*\)\n.*/\1/
+ bc
+# We found a continuation line. But before printing insert '\'.
+ :a
+ s/\(.*\)\(\n.*\)/\1\\\2/
+ P
+# We cannot use D here.
+ s/.*\n\(.*\)/\1/
+# Some buggy seds do not clear the `successful substitution since last ``t'''
+# flag on `N', so we do a `t' here to clear it.
+ tb
+# Not reached
+ :c
+ x
+# The following nice solution is by
+# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
+ td
+# Increment a decimal number in pattern space.
+# First hide trailing `9' digits.
+ :d
+ s/9\(_*\)$/_\1/
+ td
+# Assure at least one digit is available.
+ s/^\(_*\)$/0\1/
+# Increment the last digit.
+ s/8\(_*\)$/9\1/
+ s/7\(_*\)$/8\1/
+ s/6\(_*\)$/7\1/
+ s/5\(_*\)$/6\1/
+ s/4\(_*\)$/5\1/
+ s/3\(_*\)$/4\1/
+ s/2\(_*\)$/3\1/
+ s/1\(_*\)$/2\1/
+ s/0\(_*\)$/1\1/
+# Convert the hidden `9' digits to `0's.
+ s/_/0/g
+ x
+ G
+ s/\(.*\)\n\([0-9]*\)/\1, \2},/
+ s/\(.*\)"$/\1/
+ p
+}
+#
+# Last line.
+#
+$ {
+ i\
+};\
+
+ g
+ s/0*\(.*\)/int _msg_tbl_length = \1;/p
+}
+d
diff --git a/intl/textdomain.c b/intl/textdomain.c
new file mode 100644
index 00000000..55d93406
--- /dev/null
+++ b/intl/textdomain.c
@@ -0,0 +1,106 @@
+/* Implementation of the textdomain(3) function
+ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+ Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#if defined STDC_HEADERS || defined _LIBC
+# include <stdlib.h>
+#endif
+
+#if defined STDC_HEADERS || defined HAVE_STRING_H || defined _LIBC
+# include <string.h>
+#else
+# include <strings.h>
+# ifndef memcpy
+# define memcpy(Dst, Src, Num) bcopy (Src, Dst, Num)
+# endif
+#endif
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "libgettext.h"
+#endif
+
+/* @@ end of prolog @@ */
+
+/* Name of the default text domain. */
+extern const char _nl_default_default_domain[];
+
+/* Default text domain in which entries for gettext(3) are to be found. */
+extern const char *_nl_current_default_domain;
+
+
+/* Names for the libintl functions are a problem. They must not clash
+ with existing names and they should follow ANSI C. But this source
+ code is also used in GNU C Library where the names have a __
+ prefix. So we have to make a difference here. */
+#ifdef _LIBC
+# define TEXTDOMAIN __textdomain
+# define strdup(str) __strdup (str)
+#else
+# define TEXTDOMAIN textdomain__
+#endif
+
+/* Set the current default message catalog to DOMAINNAME.
+ If DOMAINNAME is null, return the current default.
+ If DOMAINNAME is "", reset to the default of "messages". */
+char *
+TEXTDOMAIN (domainname)
+ const char *domainname;
+{
+ char *old;
+
+ /* A NULL pointer requests the current setting. */
+ if (domainname == NULL)
+ return (char *) _nl_current_default_domain;
+
+ old = (char *) _nl_current_default_domain;
+
+ /* If domain name is the null string set to default domain "messages". */
+ if (domainname[0] == '\0'
+ || strcmp (domainname, _nl_default_default_domain) == 0)
+ _nl_current_default_domain = _nl_default_default_domain;
+ else
+ {
+ /* If the following malloc fails `_nl_current_default_domain'
+ will be NULL. This value will be returned and so signals we
+ are out of core. */
+#if defined _LIBC || defined HAVE_STRDUP
+ _nl_current_default_domain = strdup (domainname);
+#else
+ size_t len = strlen (domainname) + 1;
+ char *cp = (char *) malloc (len);
+ if (cp != NULL)
+ memcpy (cp, domainname, len);
+ _nl_current_default_domain = cp;
+#endif
+ }
+
+ if (old != _nl_default_default_domain)
+ free (old);
+
+ return (char *) _nl_current_default_domain;
+}
+
+#ifdef _LIBC
+/* Alias for function name in GNU C Library. */
+weak_alias (__textdomain, textdomain);
+#endif
diff --git a/intl/xopen-msg.sed b/intl/xopen-msg.sed
new file mode 100644
index 00000000..b19c0bbd
--- /dev/null
+++ b/intl/xopen-msg.sed
@@ -0,0 +1,104 @@
+# po2msg.sed - Convert Uniforum style .po file to X/Open style .msg file
+# Copyright (C) 1995 Free Software Foundation, Inc.
+# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+#
+# The first directive in the .msg should be the definition of the
+# message set number. We use always set number 1.
+#
+1 {
+ i\
+$set 1 # Automatically created by po2msg.sed
+ h
+ s/.*/0/
+ x
+}
+#
+# We copy all comments into the .msg file. Perhaps they can help.
+#
+/^#/ s/^#[ ]*/$ /p
+#
+# We copy the original message as a comment into the .msg file.
+#
+/^msgid/ {
+# Does not work now
+# /"$/! {
+# s/\\$//
+# s/$/ ... (more lines following)"/
+# }
+ s/^msgid[ ]*"\(.*\)"$/$ Original Message: \1/
+ p
+}
+#
+# The .msg file contains, other then the .po file, only the translations
+# but each given a unique ID. Starting from 1 and incrementing by 1 for
+# each message we assign them to the messages.
+# It is important that the .po file used to generate the cat-id-tbl.c file
+# (with po-to-tbl) is the same as the one used here. (At least the order
+# of declarations must not be changed.)
+#
+/^msgstr/ {
+ s/msgstr[ ]*"\(.*\)"/\1/
+ x
+# The following nice solution is by
+# Bruno <Haible@ma2s2.mathematik.uni-karlsruhe.de>
+ td
+# Increment a decimal number in pattern space.
+# First hide trailing `9' digits.
+ :d
+ s/9\(_*\)$/_\1/
+ td
+# Assure at least one digit is available.
+ s/^\(_*\)$/0\1/
+# Increment the last digit.
+ s/8\(_*\)$/9\1/
+ s/7\(_*\)$/8\1/
+ s/6\(_*\)$/7\1/
+ s/5\(_*\)$/6\1/
+ s/4\(_*\)$/5\1/
+ s/3\(_*\)$/4\1/
+ s/2\(_*\)$/3\1/
+ s/1\(_*\)$/2\1/
+ s/0\(_*\)$/1\1/
+# Convert the hidden `9' digits to `0's.
+ s/_/0/g
+ x
+# Bring the line in the format `<number> <message>'
+ G
+ s/^[^\n]*$/& /
+ s/\(.*\)\n\([0-9]*\)/\2 \1/
+# Clear flag from last substitution.
+ tb
+# Append the next line.
+ :b
+ N
+# Look whether second part is a continuation line.
+ s/\(.*\n\)"\(.*\)"/\1\2/
+# Yes, then branch.
+ ta
+ P
+ D
+# Note that `D' includes a jump to the start!!
+# We found a continuation line. But before printing insert '\'.
+ :a
+ s/\(.*\)\(\n.*\)/\1\\\2/
+ P
+# We cannot use the sed command `D' here
+ s/.*\n\(.*\)/\1/
+ tb
+}
+d
diff --git a/lib/Makefile.in b/lib/Makefile.in
new file mode 100644
index 00000000..0ded3abd
--- /dev/null
+++ b/lib/Makefile.in
@@ -0,0 +1,59 @@
+# Library Makefile for the man package.
+#
+# Copyright (C) 1994, 1995, Graeme Wilford.
+#
+# You may distribute under the terms of the GNU General Public
+# License as specified in the COPYING file that comes with this
+# distribution.
+#
+# Wed June 6 15:44:47 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk):
+
+library = libman.a
+
+srcdir = @srcdir@
+VPATH = @srcdir@
+top_srcdir = @top_srcdir@
+
+include ../include/Defines
+
+.PHONY: $(DEFAULT_TARGETS) test
+
+override CPPFLAGS := $(DEFS) -I../include -I$(top_srcdir) -I$(srcdir) -I- \
+ $(CPPFLAGS)
+
+ALLSRCS = alloca.c basename.c cleanup.c error.c fnmatch.c getopt.c getopt1.c \
+ glob.c memcmp.c putenv.c realpath.c rename.c \
+ strappend.c strcspn.c strsep.c strspn.c strstr.c xmalloc.c xstrdup.c \
+ waitpid.c tempnam.c
+
+ALLOBJS = $(ALLSRCS:.c=.o)
+
+XOBJS = xstrdup.o xmalloc.o error.o
+
+ALL = @LIBOBJS@ @ALLOCA@ $(libobjects) cleanup.o strappend.o $(XOBJS)
+
+all: $(library)
+
+test: $(library)($(ALLOBJS))
+ -$(RANLIB) $(library)
+
+$(library): $(library)($(ALL))
+ -$(RANLIB) $@
+
+# The standard targets
+install uninstall:
+
+mostlyclean:
+ rm -f *~ core $(ALL)
+
+clean: mostlyclean
+ rm -f $(library)
+
+distclean: clean
+ rm -f Makefile
+
+realclean: distclean
+ rm -f tags
+
+TAGS:
+ $(MKTAGS) $(srcdir)/*.[ch]
diff --git a/lib/README b/lib/README
new file mode 100644
index 00000000..b5ef1a4c
--- /dev/null
+++ b/lib/README
@@ -0,0 +1,14 @@
+These library source files have various authors but are all covered by the
+GNU copyright and are freely distributable under its terms and conditions.
+
+See the files ../COPYING and ../libdb/COPYING.LIB for relevant information.
+
+glob.[ch], fnmatch.[ch] from GNU glob.tar.gz
+basename.c author - Wilf.
+strappend.c, error.h author - Markus Armbruster
+rename.c from GNU libiberty (gdb)
+realpath.c, from linux libc
+str*.c, flock.c, ansidecl.h from GNU libc
+putenv.c, getopt*.*, alloca.c,
+error.c, x*.c, memcmp.c from GNU sh-utils-1.12
+tempnam.c, waitpid.c author - Carl Edman
diff --git a/lib/alloca.c b/lib/alloca.c
new file mode 100644
index 00000000..b9bbfb46
--- /dev/null
+++ b/lib/alloca.c
@@ -0,0 +1,479 @@
+/* alloca.c -- allocate automatically reclaimed memory
+ (Mostly) portable public-domain implementation -- D A Gwyn
+
+ This implementation of the PWB library alloca function,
+ which is used to allocate space off the run-time stack so
+ that it is automatically reclaimed upon procedure exit,
+ was inspired by discussions with J. Q. Johnson of Cornell.
+ J.Otto Tennant <jot@cray.com> contributed the Cray support.
+
+ There are some preprocessor constants that can
+ be defined when compiling for your specific system, for
+ improved efficiency; however, the defaults should be okay.
+
+ The general concept of this implementation is to keep
+ track of all alloca-allocated blocks, and reclaim any
+ that are found to be deeper in the stack than the current
+ invocation. This heuristic does not reclaim storage as
+ soon as it becomes invalid, but it will do so eventually.
+
+ As a special case, alloca(0) reclaims storage without
+ allocating any. It is a good idea to use alloca(0) in
+ your main control loop, etc. to force garbage collection. */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#ifdef emacs
+#include "blockinput.h"
+#endif
+
+/* If compiling with GCC 2, this file's not needed. */
+#if !defined (__GNUC__) || __GNUC__ < 2
+
+/* If someone has defined alloca as a macro,
+ there must be some other way alloca is supposed to work. */
+#ifndef alloca
+
+#ifdef emacs
+#ifdef static
+/* actually, only want this if static is defined as ""
+ -- this is for usg, in which emacs must undefine static
+ in order to make unexec workable
+ */
+#ifndef STACK_DIRECTION
+you
+lose
+-- must know STACK_DIRECTION at compile-time
+#endif /* STACK_DIRECTION undefined */
+#endif /* static */
+#endif /* emacs */
+
+/* If your stack is a linked list of frames, you have to
+ provide an "address metric" ADDRESS_FUNCTION macro. */
+
+#if defined (CRAY) && defined (CRAY_STACKSEG_END)
+long i00afunc ();
+#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
+#else
+#define ADDRESS_FUNCTION(arg) &(arg)
+#endif
+
+#if __STDC__
+typedef void *pointer;
+#else
+typedef char *pointer;
+#endif
+
+#define NULL 0
+
+extern pointer xmalloc ();
+
+/* Define STACK_DIRECTION if you know the direction of stack
+ growth for your system; otherwise it will be automatically
+ deduced at run-time.
+
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+
+#ifndef STACK_DIRECTION
+#define STACK_DIRECTION 0 /* Direction unknown. */
+#endif
+
+#if STACK_DIRECTION != 0
+
+#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
+
+#else /* STACK_DIRECTION == 0; need run-time code. */
+
+static int stack_dir; /* 1 or -1 once known. */
+#define STACK_DIR stack_dir
+
+static void
+find_stack_direction ()
+{
+ static char *addr = NULL; /* Address of first `dummy', once known. */
+ auto char dummy; /* To get stack address. */
+
+ if (addr == NULL)
+ { /* Initial entry. */
+ addr = ADDRESS_FUNCTION (dummy);
+
+ find_stack_direction (); /* Recurse once. */
+ }
+ else
+ {
+ /* Second entry. */
+ if (ADDRESS_FUNCTION (dummy) > addr)
+ stack_dir = 1; /* Stack grew upward. */
+ else
+ stack_dir = -1; /* Stack grew downward. */
+ }
+}
+
+#endif /* STACK_DIRECTION == 0 */
+
+/* An "alloca header" is used to:
+ (a) chain together all alloca'ed blocks;
+ (b) keep track of stack depth.
+
+ It is very important that sizeof(header) agree with malloc
+ alignment chunk size. The following default should work okay. */
+
+#ifndef ALIGN_SIZE
+#define ALIGN_SIZE sizeof(double)
+#endif
+
+typedef union hdr
+{
+ char align[ALIGN_SIZE]; /* To force sizeof(header). */
+ struct
+ {
+ union hdr *next; /* For chaining headers. */
+ char *deep; /* For stack depth measure. */
+ } h;
+} header;
+
+static header *last_alloca_header = NULL; /* -> last alloca header. */
+
+/* Return a pointer to at least SIZE bytes of storage,
+ which will be automatically reclaimed upon exit from
+ the procedure that called alloca. Originally, this space
+ was supposed to be taken from the current stack frame of the
+ caller, but that method cannot be made to work for some
+ implementations of C, for example under Gould's UTX/32. */
+
+pointer
+alloca (size)
+ unsigned size;
+{
+ auto char probe; /* Probes stack depth: */
+ register char *depth = ADDRESS_FUNCTION (probe);
+
+#if STACK_DIRECTION == 0
+ if (STACK_DIR == 0) /* Unknown growth direction. */
+ find_stack_direction ();
+#endif
+
+ /* Reclaim garbage, defined as all alloca'd storage that
+ was allocated from deeper in the stack than currently. */
+
+ {
+ register header *hp; /* Traverses linked list. */
+
+#ifdef emacs
+ BLOCK_INPUT;
+#endif
+
+ for (hp = last_alloca_header; hp != NULL;)
+ if ((STACK_DIR > 0 && hp->h.deep > depth)
+ || (STACK_DIR < 0 && hp->h.deep < depth))
+ {
+ register header *np = hp->h.next;
+
+ free ((pointer) hp); /* Collect garbage. */
+
+ hp = np; /* -> next header. */
+ }
+ else
+ break; /* Rest are not deeper. */
+
+ last_alloca_header = hp; /* -> last valid storage. */
+
+#ifdef emacs
+ UNBLOCK_INPUT;
+#endif
+ }
+
+ if (size == 0)
+ return NULL; /* No allocation required. */
+
+ /* Allocate combined header + user data storage. */
+
+ {
+ register pointer new = xmalloc (sizeof (header) + size);
+ /* Address of header. */
+
+ ((header *) new)->h.next = last_alloca_header;
+ ((header *) new)->h.deep = depth;
+
+ last_alloca_header = (header *) new;
+
+ /* User storage begins just after header. */
+
+ return (pointer) ((char *) new + sizeof (header));
+ }
+}
+
+#if defined (CRAY) && defined (CRAY_STACKSEG_END)
+
+#ifdef DEBUG_I00AFUNC
+#include <stdio.h>
+#endif
+
+#ifndef CRAY_STACK
+#define CRAY_STACK
+#ifndef CRAY2
+/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
+struct stack_control_header
+ {
+ long shgrow:32; /* Number of times stack has grown. */
+ long shaseg:32; /* Size of increments to stack. */
+ long shhwm:32; /* High water mark of stack. */
+ long shsize:32; /* Current size of stack (all segments). */
+ };
+
+/* The stack segment linkage control information occurs at
+ the high-address end of a stack segment. (The stack
+ grows from low addresses to high addresses.) The initial
+ part of the stack segment linkage control information is
+ 0200 (octal) words. This provides for register storage
+ for the routine which overflows the stack. */
+
+struct stack_segment_linkage
+ {
+ long ss[0200]; /* 0200 overflow words. */
+ long sssize:32; /* Number of words in this segment. */
+ long ssbase:32; /* Offset to stack base. */
+ long:32;
+ long sspseg:32; /* Offset to linkage control of previous
+ segment of stack. */
+ long:32;
+ long sstcpt:32; /* Pointer to task common address block. */
+ long sscsnm; /* Private control structure number for
+ microtasking. */
+ long ssusr1; /* Reserved for user. */
+ long ssusr2; /* Reserved for user. */
+ long sstpid; /* Process ID for pid based multi-tasking. */
+ long ssgvup; /* Pointer to multitasking thread giveup. */
+ long sscray[7]; /* Reserved for Cray Research. */
+ long ssa0;
+ long ssa1;
+ long ssa2;
+ long ssa3;
+ long ssa4;
+ long ssa5;
+ long ssa6;
+ long ssa7;
+ long sss0;
+ long sss1;
+ long sss2;
+ long sss3;
+ long sss4;
+ long sss5;
+ long sss6;
+ long sss7;
+ };
+
+#else /* CRAY2 */
+/* The following structure defines the vector of words
+ returned by the STKSTAT library routine. */
+struct stk_stat
+ {
+ long now; /* Current total stack size. */
+ long maxc; /* Amount of contiguous space which would
+ be required to satisfy the maximum
+ stack demand to date. */
+ long high_water; /* Stack high-water mark. */
+ long overflows; /* Number of stack overflow ($STKOFEN) calls. */
+ long hits; /* Number of internal buffer hits. */
+ long extends; /* Number of block extensions. */
+ long stko_mallocs; /* Block allocations by $STKOFEN. */
+ long underflows; /* Number of stack underflow calls ($STKRETN). */
+ long stko_free; /* Number of deallocations by $STKRETN. */
+ long stkm_free; /* Number of deallocations by $STKMRET. */
+ long segments; /* Current number of stack segments. */
+ long maxs; /* Maximum number of stack segments so far. */
+ long pad_size; /* Stack pad size. */
+ long current_address; /* Current stack segment address. */
+ long current_size; /* Current stack segment size. This
+ number is actually corrupted by STKSTAT to
+ include the fifteen word trailer area. */
+ long initial_address; /* Address of initial segment. */
+ long initial_size; /* Size of initial segment. */
+ };
+
+/* The following structure describes the data structure which trails
+ any stack segment. I think that the description in 'asdef' is
+ out of date. I only describe the parts that I am sure about. */
+
+struct stk_trailer
+ {
+ long this_address; /* Address of this block. */
+ long this_size; /* Size of this block (does not include
+ this trailer). */
+ long unknown2;
+ long unknown3;
+ long link; /* Address of trailer block of previous
+ segment. */
+ long unknown5;
+ long unknown6;
+ long unknown7;
+ long unknown8;
+ long unknown9;
+ long unknown10;
+ long unknown11;
+ long unknown12;
+ long unknown13;
+ long unknown14;
+ };
+
+#endif /* CRAY2 */
+#endif /* not CRAY_STACK */
+
+#ifdef CRAY2
+/* Determine a "stack measure" for an arbitrary ADDRESS.
+ I doubt that "lint" will like this much. */
+
+static long
+i00afunc (long *address)
+{
+ struct stk_stat status;
+ struct stk_trailer *trailer;
+ long *block, size;
+ long result = 0;
+
+ /* We want to iterate through all of the segments. The first
+ step is to get the stack status structure. We could do this
+ more quickly and more directly, perhaps, by referencing the
+ $LM00 common block, but I know that this works. */
+
+ STKSTAT (&status);
+
+ /* Set up the iteration. */
+
+ trailer = (struct stk_trailer *) (status.current_address
+ + status.current_size
+ - 15);
+
+ /* There must be at least one stack segment. Therefore it is
+ a fatal error if "trailer" is null. */
+
+ if (trailer == 0)
+ abort ();
+
+ /* Discard segments that do not contain our argument address. */
+
+ while (trailer != 0)
+ {
+ block = (long *) trailer->this_address;
+ size = trailer->this_size;
+ if (block == 0 || size == 0)
+ abort ();
+ trailer = (struct stk_trailer *) trailer->link;
+ if ((block <= address) && (address < (block + size)))
+ break;
+ }
+
+ /* Set the result to the offset in this segment and add the sizes
+ of all predecessor segments. */
+
+ result = address - block;
+
+ if (trailer == 0)
+ {
+ return result;
+ }
+
+ do
+ {
+ if (trailer->this_size <= 0)
+ abort ();
+ result += trailer->this_size;
+ trailer = (struct stk_trailer *) trailer->link;
+ }
+ while (trailer != 0);
+
+ /* We are done. Note that if you present a bogus address (one
+ not in any segment), you will get a different number back, formed
+ from subtracting the address of the first block. This is probably
+ not what you want. */
+
+ return (result);
+}
+
+#else /* not CRAY2 */
+/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
+ Determine the number of the cell within the stack,
+ given the address of the cell. The purpose of this
+ routine is to linearize, in some sense, stack addresses
+ for alloca. */
+
+static long
+i00afunc (long address)
+{
+ long stkl = 0;
+
+ long size, pseg, this_segment, stack;
+ long result = 0;
+
+ struct stack_segment_linkage *ssptr;
+
+ /* Register B67 contains the address of the end of the
+ current stack segment. If you (as a subprogram) store
+ your registers on the stack and find that you are past
+ the contents of B67, you have overflowed the segment.
+
+ B67 also points to the stack segment linkage control
+ area, which is what we are really interested in. */
+
+ stkl = CRAY_STACKSEG_END ();
+ ssptr = (struct stack_segment_linkage *) stkl;
+
+ /* If one subtracts 'size' from the end of the segment,
+ one has the address of the first word of the segment.
+
+ If this is not the first segment, 'pseg' will be
+ nonzero. */
+
+ pseg = ssptr->sspseg;
+ size = ssptr->sssize;
+
+ this_segment = stkl - size;
+
+ /* It is possible that calling this routine itself caused
+ a stack overflow. Discard stack segments which do not
+ contain the target address. */
+
+ while (!(this_segment <= address && address <= stkl))
+ {
+#ifdef DEBUG_I00AFUNC
+ fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
+#endif
+ if (pseg == 0)
+ break;
+ stkl = stkl - pseg;
+ ssptr = (struct stack_segment_linkage *) stkl;
+ size = ssptr->sssize;
+ pseg = ssptr->sspseg;
+ this_segment = stkl - size;
+ }
+
+ result = address - this_segment;
+
+ /* If you subtract pseg from the current end of the stack,
+ you get the address of the previous stack segment's end.
+ This seems a little convoluted to me, but I'll bet you save
+ a cycle somewhere. */
+
+ while (pseg != 0)
+ {
+#ifdef DEBUG_I00AFUNC
+ fprintf (stderr, "%011o %011o\n", pseg, size);
+#endif
+ stkl = stkl - pseg;
+ ssptr = (struct stack_segment_linkage *) stkl;
+ size = ssptr->sssize;
+ pseg = ssptr->sspseg;
+ result += size;
+ }
+ return (result);
+}
+
+#endif /* not CRAY2 */
+#endif /* CRAY */
+
+#endif /* no alloca */
+#endif /* not GCC version 2 */
diff --git a/lib/ansidecl.h b/lib/ansidecl.h
new file mode 100644
index 00000000..c351653b
--- /dev/null
+++ b/lib/ansidecl.h
@@ -0,0 +1,108 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, or (at your option)
+any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU C Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* ANSI and traditional C compatibility macros
+
+ ANSI C is assumed if __STDC__ is #defined.
+
+ Macro ANSI C definition Traditional C definition
+ ----- ---- - ---------- ----------- - ----------
+ PTR `void *' `char *'
+ LONG_DOUBLE `long double' `double'
+ CONST `const' `'
+ VOLATILE `volatile' `'
+ SIGNED `signed' `'
+ PTRCONST `void *const' `char *'
+
+ DEFUN(name, arglist, args)
+
+ Defines function NAME.
+
+ ARGLIST lists the arguments, separated by commas and enclosed in
+ parentheses. ARGLIST becomes the argument list in traditional C.
+
+ ARGS list the arguments with their types. It becomes a prototype in
+ ANSI C, and the type declarations in traditional C. Arguments should
+ be separated with `AND'. For functions with a variable number of
+ arguments, the last thing listed should be `DOTS'.
+
+ DEFUN_VOID(name)
+
+ Defines a function NAME, which takes no arguments.
+
+ EXFUN(name, prototype)
+
+ Is used in an external function declaration.
+ In ANSI C it is `NAMEPROTOTYPE' (so PROTOTYPE should be enclosed in
+ parentheses). In traditional C it is `NAME()'.
+ For a function that takes no arguments, PROTOTYPE should be `(NOARGS)'.
+
+ For example:
+ extern int EXFUN(printf, (CONST char *format DOTS));
+ int DEFUN(fprintf, (stream, format),
+ FILE *stream AND CONST char *format DOTS) { ... }
+ void DEFUN_VOID(abort) { ... }
+*/
+
+#ifndef _ANSIDECL_H
+
+#define _ANSIDECL_H 1
+
+
+/* Every source file includes this file,
+ so they will all get the switch for lint. */
+/* LINTLIBRARY */
+
+
+#ifdef __STDC__
+
+#define PTR void *
+#define PTRCONST void *CONST
+#define LONG_DOUBLE long double
+
+#define AND ,
+#define NOARGS void
+#define CONST const
+#define VOLATILE volatile
+#define SIGNED signed
+#define DOTS , ...
+
+#define EXFUN(name, proto) name proto
+#define DEFUN(name, arglist, args) name(args)
+#define DEFUN_VOID(name) name(NOARGS)
+
+#else /* Not ANSI C. */
+
+#define PTR char *
+#define PTRCONST PTR
+#define LONG_DOUBLE double
+
+#define AND ;
+#define NOARGS
+#define CONST
+#define VOLATILE
+#define SIGNED
+#define DOTS
+
+#define EXFUN(name, proto) name()
+#define DEFUN(name, arglist, args) name arglist args;
+#define DEFUN_VOID(name) name()
+
+#endif /* ANSI C. */
+
+
+#endif /* ansidecl.h */
diff --git a/lib/basename.c b/lib/basename.c
new file mode 100644
index 00000000..c26565ae
--- /dev/null
+++ b/lib/basename.c
@@ -0,0 +1,34 @@
+/*
+ * basename.c: take path as argument, return basename.
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU Library General Public
+ * License as specified in the file COPYING.LIB that comes with this
+ * distribution.
+ *
+ * Thu Dec 8 20:43:47 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#if defined(STDC_HEADERS)
+# include <string.h>
+#elif defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#else /* no string(s) header */
+extern char *strrchr();
+#endif /* STDC_HEADERS */
+
+/* return basename of given filename */
+char *basename(char *filename)
+{
+ char *base;
+
+ base = strrchr(filename, '/');
+ return base ? base + 1 : filename;
+}
diff --git a/lib/cleanup.c b/lib/cleanup.c
new file mode 100644
index 00000000..b7a3f639
--- /dev/null
+++ b/lib/cleanup.c
@@ -0,0 +1,238 @@
+/* cleanup.c -- simple dynamic cleanup function management
+ Copyright (C) 1995 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 <stdlib.h>
+#include <stdio.h> /* SunOS's loosing assert.h needs it */
+#include <assert.h>
+#include <signal.h>
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h>
+#endif
+
+#include "manconfig.h" /* for FATAL */
+#include "cleanup.h"
+
+
+#ifndef HAVE_ATEXIT
+# ifdef HAVE_ON_EXIT
+# define atexit(fun) (on_exit ((void (*)())fun, NULL))
+# else
+# error need either atexit() or on_exit()
+/* If necessary we could dummify the whole module in this case */
+# endif
+#endif
+
+
+
+/* Dealing with signals */
+
+
+/* saved signal actions */
+static struct sigaction saved_hup_action;
+static struct sigaction saved_int_action;
+static struct sigaction saved_term_action;
+
+
+/* Call do_cleanups(), then reraise signal with default handler. */
+static void
+sighandler (int signo)
+{
+ struct sigaction act;
+ sigset_t set;
+
+ do_cleanups ();
+
+ /* set default signal action */
+ act.sa_handler = SIG_DFL;
+ sigemptyset (&act.sa_mask);
+ act.sa_flags = 0;
+ if (sigaction (SIGINT, &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 it's 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;
+
+ 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 it's 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;
+} 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. */
+void
+do_cleanups (void)
+{
+ unsigned i;
+
+ assert (tos <= nslots);
+ for (i = tos; i > 0; --i) {
+ stack[i-1].fun (stack[i-1].arg);
+ }
+}
+
+
+/* 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. */
+int
+push_cleanup (cleanup_fun fun, void *arg)
+{
+ 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 = xrealloc (stack, (nslots+1)*sizeof(slot));
+ } else {
+ new_stack = xmalloc ((nslots+1)*sizeof(slot));
+ }
+
+ if (!new_stack) return -1;
+ stack = new_stack;
+ ++nslots;
+ }
+
+ assert (tos < nslots);
+ stack[tos].fun = fun;
+ stack[tos].arg = arg;
+ ++tos;
+
+
+ trap_abnormal_exits();
+
+ return 0;
+}
+
+
+/* Pop top cleanup function from the cleanup stack. */
+void
+pop_cleanup (void)
+{
+ assert (tos > 0);
+ --tos;
+
+ 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 00000000..2365f96b
--- /dev/null
+++ b/lib/cleanup.h
@@ -0,0 +1,11 @@
+#ifndef _CLEANUP_H
+#define _CLEANUP_H
+
+typedef void (*cleanup_fun) (void *);
+
+extern void do_cleanups (void);
+extern int push_cleanup (cleanup_fun, void *);
+extern void pop_cleanup (void);
+extern void pop_all_cleanups (void);
+
+#endif _CLEANUP_H
diff --git a/lib/error.c b/lib/error.c
new file mode 100644
index 00000000..45c88b42
--- /dev/null
+++ b/lib/error.c
@@ -0,0 +1,119 @@
+/* error.c -- error handler for noninteractive utilities
+ Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* Written by David MacKenzie <djm@gnu.ai.mit.edu>. */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+
+#if HAVE_VPRINTF || HAVE_DOPRNT
+# if __STDC__
+# include <stdarg.h>
+# define VA_START(args, lastarg) va_start(args, lastarg)
+# else
+# include <varargs.h>
+# define VA_START(args, lastarg) va_start(args)
+# endif
+#else
+# define va_alist a1, a2, a3, a4, a5, a6, a7, a8
+# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
+#endif
+
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <string.h>
+#else
+void exit ();
+#endif
+
+/* If NULL, error will flush stdout, then print on stderr the program
+ name, a colon and a space. Otherwise, error will call this
+ function without parameters instead. */
+void (*error_print_progname) () = NULL;
+
+/* The calling program should define program_name and set it to the
+ name of the executing program. */
+extern char *program_name;
+
+#if HAVE_STRERROR
+char *strerror ();
+#else
+static char *
+private_strerror (errnum)
+ int errnum;
+{
+ extern char *sys_errlist[];
+ extern int sys_nerr;
+
+ if (errnum > 0 && errnum <= sys_nerr)
+ return sys_errlist[errnum];
+ return "Unknown system error";
+}
+#define strerror private_strerror
+#endif
+
+/* Print the program name and error message MESSAGE, which is a printf-style
+ format string with optional args.
+ If ERRNUM is nonzero, print its corresponding system error message.
+ Exit with status STATUS if it is nonzero. */
+/* VARARGS */
+
+void
+#if defined(VA_START) && __STDC__
+error (int status, int errnum, const char *message, ...)
+#else
+error (status, errnum, message, va_alist)
+ int status;
+ int errnum;
+ char *message;
+ va_dcl
+#endif
+{
+#ifdef VA_START
+ va_list args;
+#endif
+
+ if (error_print_progname)
+ (*error_print_progname) ();
+ else
+ {
+ fflush (stdout);
+ fprintf (stderr, "%s: ", program_name);
+ }
+
+#ifdef VA_START
+ VA_START (args, message);
+# if HAVE_VPRINTF
+ vfprintf (stderr, message, args);
+# else
+ _doprnt (message, args, stderr);
+# endif
+ va_end (args);
+#else
+ fprintf (stderr, message, a1, a2, a3, a4, a5, a6, a7, a8);
+#endif
+
+ if (errnum)
+ fprintf (stderr, ": %s", strerror (errnum));
+ putc ('\n', stderr);
+ fflush (stderr);
+ if (status)
+ exit (status);
+}
diff --git a/lib/error.h b/lib/error.h
new file mode 100644
index 00000000..583eda3a
--- /dev/null
+++ b/lib/error.h
@@ -0,0 +1,16 @@
+#ifndef _ERROR_H
+#define _ERROR_H
+
+#include <errno.h>
+
+#ifndef STDC_HEADERS
+extern int errno;
+#endif
+
+#if __STDC__ && (HAVE_VPRINTF || HAVE_DOPRNT)
+void error (int, int, const char *, ...);
+#else
+void error ();
+#endif
+
+#endif
diff --git a/lib/flock.c b/lib/flock.c
new file mode 100644
index 00000000..dbfaa36a
--- /dev/null
+++ b/lib/flock.c
@@ -0,0 +1,72 @@
+/* Copyright (C) 1992 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; see the file COPYING.LIB. If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA. */
+
+/* This file implements the `flock' function in terms of the POSIX.1 `fcntl'
+ locking mechanism. In 4BSD, these are two incompatible locking mechanisms,
+ perhaps with different semantics? */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "ansidecl.h"
+#include "flock.h"
+#include <errno.h>
+
+#ifndef STDC_HEADERS
+extern int errno;
+#endif
+
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#if HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+#if HAVE_SYS_FILE_H
+# include <sys/file.h>
+#endif
+
+/* Apply or remove an advisory lock, according to OPERATION,
+ on the file FD refers to. */
+int
+DEFUN(flock, (fd, operation), int fd AND int operation)
+{
+ struct flock lbuf;
+
+ switch (operation & ~LOCK_NB)
+ {
+ case LOCK_SH:
+ lbuf.l_type = F_RDLCK;
+ break;
+ case LOCK_EX:
+ lbuf.l_type = F_WRLCK;
+ break;
+ case LOCK_UN:
+ lbuf.l_type = F_UNLCK;
+ break;
+ default:
+ errno = EINVAL;
+ return -1;
+ }
+
+ lbuf.l_whence = SEEK_SET;
+ lbuf.l_start = lbuf.l_len = 0L; /* Lock the whole file. */
+
+ return fcntl (fd, (operation & LOCK_NB) ? F_SETLK : F_SETLKW, &lbuf);
+}
diff --git a/lib/flock.h b/lib/flock.h
new file mode 100644
index 00000000..ed1331cd
--- /dev/null
+++ b/lib/flock.h
@@ -0,0 +1,17 @@
+/* Operations for the `flock' call. */
+#ifndef LOCK_SH
+# define LOCK_SH 1 /* Shared lock. */
+#endif
+
+#ifndef LOCK_EX
+# define LOCK_EX 2 /* Exclusive lock. */
+#endif
+
+#ifndef LOCK_UN
+# define LOCK_UN 8 /* Unlock. */
+#endif
+
+/* Can be OR'd in to one of the above. */
+#ifndef LOCK_NB
+# define LOCK_NB 4 /* Don't block when locking. */
+#endif
diff --git a/lib/fnmatch.c b/lib/fnmatch.c
new file mode 100644
index 00000000..eefe5d2b
--- /dev/null
+++ b/lib/fnmatch.c
@@ -0,0 +1,200 @@
+/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
+
+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., 675 Mass Ave,
+Cambridge, MA 02139, USA. */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <errno.h>
+#include "fnmatch.h"
+#include <ctype.h>
+
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+ actually compiling the library itself. This code is part of the GNU C
+ Library, but also included in many other GNU distributions. Compiling
+ and linking in this code is a waste when using the GNU C library
+ (especially if it is a shared library). Rather than having every GNU
+ program understand `configure --with-gnu-libc' and omit the object files,
+ it is simpler to just do this in the source for each such file. */
+
+#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
+
+
+#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS)
+extern int errno;
+#endif
+
+/* Match STRING against the filename pattern PATTERN, returning zero if
+ it matches, nonzero if not. */
+int
+fnmatch (pattern, string, flags)
+ const char *pattern;
+ const char *string;
+ int flags;
+{
+ register const char *p = pattern, *n = string;
+ register char c;
+
+/* Note that this evalutes C many times. */
+#define FOLD(c) ((flags & FNM_CASEFOLD) && isupper (c) ? tolower (c) : (c))
+
+ while ((c = *p++) != '\0')
+ {
+ c = FOLD (c);
+
+ switch (c)
+ {
+ case '?':
+ if (*n == '\0')
+ return FNM_NOMATCH;
+ else if ((flags & FNM_FILE_NAME) && *n == '/')
+ return FNM_NOMATCH;
+ else if ((flags & FNM_PERIOD) && *n == '.' &&
+ (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
+ return FNM_NOMATCH;
+ break;
+
+ case '\\':
+ if (!(flags & FNM_NOESCAPE))
+ {
+ c = *p++;
+ c = FOLD (c);
+ }
+ if (FOLD (*n) != c)
+ return FNM_NOMATCH;
+ break;
+
+ case '*':
+ if ((flags & FNM_PERIOD) && *n == '.' &&
+ (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
+ return FNM_NOMATCH;
+
+ for (c = *p++; c == '?' || c == '*'; c = *p++, ++n)
+ if (((flags & FNM_FILE_NAME) && *n == '/') ||
+ (c == '?' && *n == '\0'))
+ return FNM_NOMATCH;
+
+ if (c == '\0')
+ return 0;
+
+ {
+ char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c;
+ c1 = FOLD (c1);
+ for (--p; *n != '\0'; ++n)
+ if ((c == '[' || FOLD (*n) == c1) &&
+ fnmatch (p, n, flags & ~FNM_PERIOD) == 0)
+ return 0;
+ return FNM_NOMATCH;
+ }
+
+ case '[':
+ {
+ /* Nonzero if the sense of the character class is inverted. */
+ register int not;
+
+ if (*n == '\0')
+ return FNM_NOMATCH;
+
+ if ((flags & FNM_PERIOD) && *n == '.' &&
+ (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/')))
+ return FNM_NOMATCH;
+
+ not = (*p == '!' || *p == '^');
+ if (not)
+ ++p;
+
+ c = *p++;
+ for (;;)
+ {
+ register char cstart = c, cend = c;
+
+ if (!(flags & FNM_NOESCAPE) && c == '\\')
+ cstart = cend = *p++;
+
+ cstart = cend = FOLD (cstart);
+
+ if (c == '\0')
+ /* [ (unterminated) loses. */
+ return FNM_NOMATCH;
+
+ c = *p++;
+ c = FOLD (c);
+
+ if ((flags & FNM_FILE_NAME) && c == '/')
+ /* [/] can never match. */
+ return FNM_NOMATCH;
+
+ if (c == '-' && *p != ']')
+ {
+ cend = *p++;
+ if (!(flags & FNM_NOESCAPE) && cend == '\\')
+ cend = *p++;
+ if (cend == '\0')
+ return FNM_NOMATCH;
+ cend = FOLD (cend);
+
+ c = *p++;
+ }
+
+ if (FOLD (*n) >= cstart && FOLD (*n) <= cend)
+ goto matched;
+
+ if (c == ']')
+ break;
+ }
+ if (!not)
+ return FNM_NOMATCH;
+ break;
+
+ matched:;
+ /* Skip the rest of the [...] that already matched. */
+ while (c != ']')
+ {
+ if (c == '\0')
+ /* [... (unterminated) loses. */
+ return FNM_NOMATCH;
+
+ c = *p++;
+ if (!(flags & FNM_NOESCAPE) && c == '\\')
+ /* XXX 1003.2d11 is unclear if this is right. */
+ ++p;
+ }
+ if (not)
+ return FNM_NOMATCH;
+ }
+ break;
+
+ default:
+ if (c != FOLD (*n))
+ return FNM_NOMATCH;
+ }
+
+ ++n;
+ }
+
+ if (*n == '\0')
+ return 0;
+
+ if ((flags & FNM_LEADING_DIR) && *n == '/')
+ /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */
+ return 0;
+
+ return FNM_NOMATCH;
+}
+
+#endif /* _LIBC or not __GNU_LIBRARY__. */
diff --git a/lib/fnmatch.h b/lib/fnmatch.h
new file mode 100644
index 00000000..d9d73b3d
--- /dev/null
+++ b/lib/fnmatch.h
@@ -0,0 +1,67 @@
+/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
+
+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., 675 Mass Ave,
+Cambridge, MA 02139, USA. */
+
+#ifndef _FNMATCH_H
+
+#define _FNMATCH_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
+#undef __P
+#define __P(protos) protos
+#else /* Not C++ or ANSI C. */
+#undef __P
+#define __P(protos) ()
+/* We can get away without defining `const' here only because in this file
+ it is used only inside the prototype for `fnmatch', which is elided in
+ non-ANSI C where `const' is problematical. */
+#endif /* C++ or ANSI C. */
+
+
+/* We #undef these before defining them because some losing systems
+ (HP-UX A.08.07 for example) define these in <unistd.h>. */
+#undef FNM_PATHNAME
+#undef FNM_NOESCAPE
+#undef FNM_PERIOD
+
+/* Bits set in the FLAGS argument to `fnmatch'. */
+#define FNM_PATHNAME (1 << 0) /* No wildcard can ever match `/'. */
+#define FNM_NOESCAPE (1 << 1) /* Backslashes don't quote special chars. */
+#define FNM_PERIOD (1 << 2) /* Leading `.' is matched only explicitly. */
+
+#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
+#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */
+#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */
+#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */
+#endif
+
+/* Value returned by `fnmatch' if STRING does not match PATTERN. */
+#define FNM_NOMATCH 1
+
+/* Match STRING against the filename pattern PATTERN,
+ returning zero if it matches, FNM_NOMATCH if not. */
+extern int fnmatch __P ((const char *__pattern, const char *__string,
+ int __flags));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* fnmatch.h */
diff --git a/lib/getopt.c b/lib/getopt.c
new file mode 100644
index 00000000..69e1e64b
--- /dev/null
+++ b/lib/getopt.c
@@ -0,0 +1,748 @@
+/* Getopt for GNU.
+ NOTE: getopt is now part of the C library, so if you don't know what
+ "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu
+ before changing it!
+
+ Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94
+ Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
+ Ditto for AIX 3.2 and <stdlib.h>. */
+#ifndef _NO_PROTO
+#define _NO_PROTO
+#endif
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#if !defined (__STDC__) || !__STDC__
+/* This is a separate conditional since some stdc systems
+ reject `defined (const)'. */
+#ifndef const
+#define const
+#endif
+#endif
+
+#include <stdio.h>
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+ actually compiling the library itself. This code is part of the GNU C
+ Library, but also included in many other GNU distributions. Compiling
+ and linking in this code is a waste when using the GNU C library
+ (especially if it is a shared library). Rather than having every GNU
+ program understand `configure --with-gnu-libc' and omit the object files,
+ it is simpler to just do this in the source for each such file. */
+
+#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
+
+
+/* This needs to come after some library #include
+ to get __GNU_LIBRARY__ defined. */
+#ifdef __GNU_LIBRARY__
+/* Don't include stdlib.h for non-GNU C libraries because some of them
+ contain conflicting prototypes for getopt. */
+#include <stdlib.h>
+#endif /* GNU C library. */
+
+/* This version of `getopt' appears to the caller like standard Unix `getopt'
+ but it behaves differently for the user, since it allows the user
+ to intersperse the options with the other arguments.
+
+ As `getopt' works, it permutes the elements of ARGV so that,
+ when it is done, all the options precede everything else. Thus
+ all application programs are extended to handle flexible argument order.
+
+ Setting the environment variable POSIXLY_CORRECT disables permutation.
+ Then the behavior is completely standard.
+
+ GNU application programs can use a third alternative mode in which
+ they can distinguish the relative order of options and other arguments. */
+
+#include "getopt.h"
+
+/* For communication from `getopt' to the caller.
+ When `getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when `ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+char *optarg = NULL;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to `getopt'.
+
+ On entry to `getopt', zero means this is the first call; initialize.
+
+ When `getopt' returns EOF, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, `optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+/* XXX 1003.2 says this must be 1 before any call. */
+int optind = 0;
+
+/* The next char to be scanned in the option-element
+ in which the last option character we returned was found.
+ This allows us to pick up the scan where we left off.
+
+ If this is zero, or a null string, it means resume the scan
+ by advancing to the next ARGV-element. */
+
+static char *nextchar;
+
+/* Callers store zero here to inhibit the error message
+ for unrecognized options. */
+
+int opterr = 1;
+
+/* Set to an option character which was unrecognized.
+ This must be initialized on some systems to avoid linking in the
+ system's own getopt implementation. */
+
+int optopt = '?';
+
+/* Describe how to deal with options that follow non-option ARGV-elements.
+
+ If the caller did not specify anything,
+ the default is REQUIRE_ORDER if the environment variable
+ POSIXLY_CORRECT is defined, PERMUTE otherwise.
+
+ REQUIRE_ORDER means don't recognize them as options;
+ stop option processing when the first non-option is seen.
+ This is what Unix does.
+ This mode of operation is selected by either setting the environment
+ variable POSIXLY_CORRECT, or using `+' as the first character
+ of the list of option characters.
+
+ PERMUTE is the default. We permute the contents of ARGV as we scan,
+ so that eventually all the non-options are at the end. This allows options
+ to be given in any order, even with programs that were not written to
+ expect this.
+
+ RETURN_IN_ORDER is an option available to programs that were written
+ to expect options and other ARGV-elements in any order and that care about
+ the ordering of the two. We describe each non-option ARGV-element
+ as if it were the argument of an option with character code 1.
+ Using `-' as the first character of the list of option characters
+ selects this mode of operation.
+
+ The special argument `--' forces an end of option-scanning regardless
+ of the value of `ordering'. In the case of RETURN_IN_ORDER, only
+ `--' can cause `getopt' to return EOF with `optind' != ARGC. */
+
+static enum
+{
+ REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
+} ordering;
+
+/* Value of POSIXLY_CORRECT environment variable. */
+static char *posixly_correct;
+
+#ifdef __GNU_LIBRARY__
+/* We want to avoid inclusion of string.h with non-GNU libraries
+ because there are many ways it can cause trouble.
+ On some systems, it contains special magic macros that don't work
+ in GCC. */
+#include <string.h>
+#define my_index strchr
+#else
+
+/* Avoid depending on library functions or files
+ whose names are inconsistent. */
+
+char *getenv ();
+
+static char *
+my_index (str, chr)
+ const char *str;
+ int chr;
+{
+ while (*str)
+ {
+ if (*str == chr)
+ return (char *) str;
+ str++;
+ }
+ return 0;
+}
+
+/* If using GCC, we can safely declare strlen this way.
+ If not using GCC, it is ok not to declare it. */
+#ifdef __GNUC__
+/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h.
+ That was relevant to code that was here before. */
+#if !defined (__STDC__) || !__STDC__
+/* gcc with -traditional declares the built-in strlen to return int,
+ and has done so at least since version 2.4.5. -- rms. */
+extern int strlen (const char *);
+#endif /* not __STDC__ */
+#endif /* __GNUC__ */
+
+#endif /* not __GNU_LIBRARY__ */
+
+/* Handle permutation of arguments. */
+
+/* Describe the part of ARGV that contains non-options that have
+ been skipped. `first_nonopt' is the index in ARGV of the first of them;
+ `last_nonopt' is the index after the last of them. */
+
+static int first_nonopt;
+static int last_nonopt;
+
+/* Exchange two adjacent subsequences of ARGV.
+ One subsequence is elements [first_nonopt,last_nonopt)
+ which contains all the non-options that have been skipped so far.
+ The other is elements [last_nonopt,optind), which contains all
+ the options processed since those non-options were skipped.
+
+ `first_nonopt' and `last_nonopt' are relocated so that they describe
+ the new indices of the non-options in ARGV after they are moved. */
+
+static void
+exchange (argv)
+ char **argv;
+{
+ int bottom = first_nonopt;
+ int middle = last_nonopt;
+ int top = optind;
+ char *tem;
+
+ /* Exchange the shorter segment with the far end of the longer segment.
+ That puts the shorter segment into the right place.
+ It leaves the longer segment in the right place overall,
+ but it consists of two parts that need to be swapped next. */
+
+ while (top > middle && middle > bottom)
+ {
+ if (top - middle > middle - bottom)
+ {
+ /* Bottom segment is the short one. */
+ int len = middle - bottom;
+ register int i;
+
+ /* Swap it with the top part of the top segment. */
+ for (i = 0; i < len; i++)
+ {
+ tem = argv[bottom + i];
+ argv[bottom + i] = argv[top - (middle - bottom) + i];
+ argv[top - (middle - bottom) + i] = tem;
+ }
+ /* Exclude the moved bottom segment from further swapping. */
+ top -= len;
+ }
+ else
+ {
+ /* Top segment is the short one. */
+ int len = top - middle;
+ register int i;
+
+ /* Swap it with the bottom part of the bottom segment. */
+ for (i = 0; i < len; i++)
+ {
+ tem = argv[bottom + i];
+ argv[bottom + i] = argv[middle + i];
+ argv[middle + i] = tem;
+ }
+ /* Exclude the moved top segment from further swapping. */
+ bottom += len;
+ }
+ }
+
+ /* Update records for the slots the non-options now occupy. */
+
+ first_nonopt += (optind - last_nonopt);
+ last_nonopt = optind;
+}
+
+/* Initialize the internal data when the first call is made. */
+
+static const char *
+_getopt_initialize (optstring)
+ const char *optstring;
+{
+ /* Start processing options with ARGV-element 1 (since ARGV-element 0
+ is the program name); the sequence of previously skipped
+ non-option ARGV-elements is empty. */
+
+ first_nonopt = last_nonopt = optind = 1;
+
+ nextchar = NULL;
+
+ posixly_correct = getenv ("POSIXLY_CORRECT");
+
+ /* Determine how to handle the ordering of options and nonoptions. */
+
+ if (optstring[0] == '-')
+ {
+ ordering = RETURN_IN_ORDER;
+ ++optstring;
+ }
+ else if (optstring[0] == '+')
+ {
+ ordering = REQUIRE_ORDER;
+ ++optstring;
+ }
+ else if (posixly_correct != NULL)
+ ordering = REQUIRE_ORDER;
+ else
+ ordering = PERMUTE;
+
+ return optstring;
+}
+
+/* Scan elements of ARGV (whose length is ARGC) for option characters
+ given in OPTSTRING.
+
+ If an element of ARGV starts with '-', and is not exactly "-" or "--",
+ then it is an option element. The characters of this element
+ (aside from the initial '-') are option characters. If `getopt'
+ is called repeatedly, it returns successively each of the option characters
+ from each of the option elements.
+
+ If `getopt' finds another option character, it returns that character,
+ updating `optind' and `nextchar' so that the next call to `getopt' can
+ resume the scan with the following option character or ARGV-element.
+
+ If there are no more option characters, `getopt' returns `EOF'.
+ Then `optind' is the index in ARGV of the first ARGV-element
+ that is not an option. (The ARGV-elements have been permuted
+ so that those that are not options now come last.)
+
+ OPTSTRING is a string containing the legitimate option characters.
+ If an option character is seen that is not listed in OPTSTRING,
+ return '?' after printing an error message. If you set `opterr' to
+ zero, the error message is suppressed but we still return '?'.
+
+ If a char in OPTSTRING is followed by a colon, that means it wants an arg,
+ so the following text in the same ARGV-element, or the text of the following
+ ARGV-element, is returned in `optarg'. Two colons mean an option that
+ wants an optional arg; if there is text in the current ARGV-element,
+ it is returned in `optarg', otherwise `optarg' is set to zero.
+
+ If OPTSTRING starts with `-' or `+', it requests different methods of
+ handling the non-option ARGV-elements.
+ See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above.
+
+ Long-named options begin with `--' instead of `-'.
+ Their names may be abbreviated as long as the abbreviation is unique
+ or is an exact match for some defined option. If they have an
+ argument, it follows the option name in the same ARGV-element, separated
+ from the option name by a `=', or else the in next ARGV-element.
+ When `getopt' finds a long-named option, it returns 0 if that option's
+ `flag' field is nonzero, the value of the option's `val' field
+ if the `flag' field is zero.
+
+ The elements of ARGV aren't really const, because we permute them.
+ But we pretend they're const in the prototype to be compatible
+ with other systems.
+
+ LONGOPTS is a vector of `struct option' terminated by an
+ element containing a name which is zero.
+
+ LONGIND returns the index in LONGOPT of the long-named option found.
+ It is only valid when a long-named option has been found by the most
+ recent call.
+
+ If LONG_ONLY is nonzero, '-' as well as '--' can introduce
+ long-named options. */
+
+int
+_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
+ int argc;
+ char *const *argv;
+ const char *optstring;
+ const struct option *longopts;
+ int *longind;
+ int long_only;
+{
+ optarg = NULL;
+
+ if (optind == 0)
+ optstring = _getopt_initialize (optstring);
+
+ if (nextchar == NULL || *nextchar == '\0')
+ {
+ /* Advance to the next ARGV-element. */
+
+ if (ordering == PERMUTE)
+ {
+ /* If we have just processed some options following some non-options,
+ exchange them so that the options come first. */
+
+ if (first_nonopt != last_nonopt && last_nonopt != optind)
+ exchange ((char **) argv);
+ else if (last_nonopt != optind)
+ first_nonopt = optind;
+
+ /* Skip any additional non-options
+ and extend the range of non-options previously skipped. */
+
+ while (optind < argc
+ && (argv[optind][0] != '-' || argv[optind][1] == '\0'))
+ optind++;
+ last_nonopt = optind;
+ }
+
+ /* The special ARGV-element `--' means premature end of options.
+ Skip it like a null option,
+ then exchange with previous non-options as if it were an option,
+ then skip everything else like a non-option. */
+
+ if (optind != argc && !strcmp (argv[optind], "--"))
+ {
+ optind++;
+
+ if (first_nonopt != last_nonopt && last_nonopt != optind)
+ exchange ((char **) argv);
+ else if (first_nonopt == last_nonopt)
+ first_nonopt = optind;
+ last_nonopt = argc;
+
+ optind = argc;
+ }
+
+ /* If we have done all the ARGV-elements, stop the scan
+ and back over any non-options that we skipped and permuted. */
+
+ if (optind == argc)
+ {
+ /* Set the next-arg-index to point at the non-options
+ that we previously skipped, so the caller will digest them. */
+ if (first_nonopt != last_nonopt)
+ optind = first_nonopt;
+ return EOF;
+ }
+
+ /* If we have come to a non-option and did not permute it,
+ either stop the scan or describe it to the caller and pass it by. */
+
+ if ((argv[optind][0] != '-' || argv[optind][1] == '\0'))
+ {
+ if (ordering == REQUIRE_ORDER)
+ return EOF;
+ optarg = argv[optind++];
+ return 1;
+ }
+
+ /* We have found another option-ARGV-element.
+ Skip the initial punctuation. */
+
+ nextchar = (argv[optind] + 1
+ + (longopts != NULL && argv[optind][1] == '-'));
+ }
+
+ /* Decode the current option-ARGV-element. */
+
+ /* Check whether the ARGV-element is a long option.
+
+ If long_only and the ARGV-element has the form "-f", where f is
+ a valid short option, don't consider it an abbreviated form of
+ a long option that starts with f. Otherwise there would be no
+ way to give the -f short option.
+
+ On the other hand, if there's a long option "fubar" and
+ the ARGV-element is "-fu", do consider that an abbreviation of
+ the long option, just like "--fu", and not "-f" with arg "u".
+
+ This distinction seems to be the most useful approach. */
+
+ if (longopts != NULL
+ && (argv[optind][1] == '-'
+ || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1])))))
+ {
+ char *nameend;
+ const struct option *p;
+ const struct option *pfound = NULL;
+ int exact = 0;
+ int ambig = 0;
+ int indfound;
+ int option_index;
+
+ for (nameend = nextchar; *nameend && *nameend != '='; nameend++)
+ /* Do nothing. */ ;
+
+ /* Test all long options for either exact match
+ or abbreviated matches. */
+ for (p = longopts, option_index = 0; p->name; p++, option_index++)
+ if (!strncmp (p->name, nextchar, nameend - nextchar))
+ {
+ if (nameend - nextchar == strlen (p->name))
+ {
+ /* Exact match found. */
+ pfound = p;
+ indfound = option_index;
+ exact = 1;
+ break;
+ }
+ else if (pfound == NULL)
+ {
+ /* First nonexact match found. */
+ pfound = p;
+ indfound = option_index;
+ }
+ else
+ /* Second or later nonexact match found. */
+ ambig = 1;
+ }
+
+ if (ambig && !exact)
+ {
+ if (opterr)
+ fprintf (stderr, "%s: option `%s' is ambiguous\n",
+ argv[0], argv[optind]);
+ nextchar += strlen (nextchar);
+ optind++;
+ return '?';
+ }
+
+ if (pfound != NULL)
+ {
+ option_index = indfound;
+ optind++;
+ if (*nameend)
+ {
+ /* Don't test has_arg with >, because some C compilers don't
+ allow it to be used on enums. */
+ if (pfound->has_arg)
+ optarg = nameend + 1;
+ else
+ {
+ if (opterr)
+ {
+ if (argv[optind - 1][1] == '-')
+ /* --option */
+ fprintf (stderr,
+ "%s: option `--%s' doesn't allow an argument\n",
+ argv[0], pfound->name);
+ else
+ /* +option or -option */
+ fprintf (stderr,
+ "%s: option `%c%s' doesn't allow an argument\n",
+ argv[0], argv[optind - 1][0], pfound->name);
+ }
+ nextchar += strlen (nextchar);
+ return '?';
+ }
+ }
+ else if (pfound->has_arg == 1)
+ {
+ if (optind < argc)
+ optarg = argv[optind++];
+ else
+ {
+ if (opterr)
+ fprintf (stderr, "%s: option `%s' requires an argument\n",
+ argv[0], argv[optind - 1]);
+ nextchar += strlen (nextchar);
+ return optstring[0] == ':' ? ':' : '?';
+ }
+ }
+ nextchar += strlen (nextchar);
+ if (longind != NULL)
+ *longind = option_index;
+ if (pfound->flag)
+ {
+ *(pfound->flag) = pfound->val;
+ return 0;
+ }
+ return pfound->val;
+ }
+
+ /* Can't find it as a long option. If this is not getopt_long_only,
+ or the option starts with '--' or is not a valid short
+ option, then it's an error.
+ Otherwise interpret it as a short option. */
+ if (!long_only || argv[optind][1] == '-'
+ || my_index (optstring, *nextchar) == NULL)
+ {
+ if (opterr)
+ {
+ if (argv[optind][1] == '-')
+ /* --option */
+ fprintf (stderr, "%s: unrecognized option `--%s'\n",
+ argv[0], nextchar);
+ else
+ /* +option or -option */
+ fprintf (stderr, "%s: unrecognized option `%c%s'\n",
+ argv[0], argv[optind][0], nextchar);
+ }
+ nextchar = (char *) "";
+ optind++;
+ return '?';
+ }
+ }
+
+ /* Look at and handle the next short option-character. */
+
+ {
+ char c = *nextchar++;
+ char *temp = my_index (optstring, c);
+
+ /* Increment `optind' when we start to process its last character. */
+ if (*nextchar == '\0')
+ ++optind;
+
+ if (temp == NULL || c == ':')
+ {
+ if (opterr)
+ {
+ if (posixly_correct)
+ /* 1003.2 specifies the format of this message. */
+ fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c);
+ else
+ fprintf (stderr, "%s: invalid option -- %c\n", argv[0], c);
+ }
+ optopt = c;
+ return '?';
+ }
+ if (temp[1] == ':')
+ {
+ if (temp[2] == ':')
+ {
+ /* This is an option that accepts an argument optionally. */
+ if (*nextchar != '\0')
+ {
+ optarg = nextchar;
+ optind++;
+ }
+ else
+ optarg = NULL;
+ nextchar = NULL;
+ }
+ else
+ {
+ /* This is an option that requires an argument. */
+ if (*nextchar != '\0')
+ {
+ optarg = nextchar;
+ /* If we end this ARGV-element by taking the rest as an arg,
+ we must advance to the next element now. */
+ optind++;
+ }
+ else if (optind == argc)
+ {
+ if (opterr)
+ {
+ /* 1003.2 specifies the format of this message. */
+ fprintf (stderr, "%s: option requires an argument -- %c\n",
+ argv[0], c);
+ }
+ optopt = c;
+ if (optstring[0] == ':')
+ c = ':';
+ else
+ c = '?';
+ }
+ else
+ /* We already incremented `optind' once;
+ increment it again when taking next ARGV-elt as argument. */
+ optarg = argv[optind++];
+ nextchar = NULL;
+ }
+ }
+ return c;
+ }
+}
+
+int
+getopt (argc, argv, optstring)
+ int argc;
+ char *const *argv;
+ const char *optstring;
+{
+ return _getopt_internal (argc, argv, optstring,
+ (const struct option *) 0,
+ (int *) 0,
+ 0);
+}
+
+#endif /* _LIBC or not __GNU_LIBRARY__. */
+
+#ifdef TEST
+
+/* Compile with -DTEST to make an executable for use in testing
+ the above definition of `getopt'. */
+
+int
+main (argc, argv)
+ int argc;
+ char **argv;
+{
+ int c;
+ int digit_optind = 0;
+
+ while (1)
+ {
+ int this_option_optind = optind ? optind : 1;
+
+ c = getopt (argc, argv, "abc:d:0123456789");
+ if (c == EOF)
+ break;
+
+ switch (c)
+ {
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (digit_optind != 0 && digit_optind != this_option_optind)
+ printf ("digits occur in two different argv-elements.\n");
+ digit_optind = this_option_optind;
+ printf ("option %c\n", c);
+ break;
+
+ case 'a':
+ printf ("option a\n");
+ break;
+
+ case 'b':
+ printf ("option b\n");
+ break;
+
+ case 'c':
+ printf ("option c with value `%s'\n", optarg);
+ break;
+
+ case '?':
+ break;
+
+ default:
+ printf ("?? getopt returned character code 0%o ??\n", c);
+ }
+ }
+
+ if (optind < argc)
+ {
+ printf ("non-option ARGV-elements: ");
+ while (optind < argc)
+ printf ("%s ", argv[optind++]);
+ printf ("\n");
+ }
+
+ exit (0);
+}
+
+#endif /* TEST */
diff --git a/lib/getopt.h b/lib/getopt.h
new file mode 100644
index 00000000..4ac33b71
--- /dev/null
+++ b/lib/getopt.h
@@ -0,0 +1,129 @@
+/* Declarations for getopt.
+ Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef _GETOPT_H
+#define _GETOPT_H 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* For communication from `getopt' to the caller.
+ When `getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when `ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+extern char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to `getopt'.
+
+ On entry to `getopt', zero means this is the first call; initialize.
+
+ When `getopt' returns EOF, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, `optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+extern int optind;
+
+/* Callers store zero here to inhibit the error message `getopt' prints
+ for unrecognized options. */
+
+extern int opterr;
+
+/* Set to an option character which was unrecognized. */
+
+extern int optopt;
+
+/* Describe the long-named options requested by the application.
+ The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+ of `struct option' terminated by an element containing a name which is
+ zero.
+
+ The field `has_arg' is:
+ no_argument (or 0) if the option does not take an argument,
+ required_argument (or 1) if the option requires an argument,
+ optional_argument (or 2) if the option takes an optional argument.
+
+ If the field `flag' is not NULL, it points to a variable that is set
+ to the value given in the field `val' when the option is found, but
+ left unchanged if the option is not found.
+
+ To have a long-named option do something other than set an `int' to
+ a compiled-in constant, such as set a value from `optarg', set the
+ option's `flag' field to zero and its `val' field to a nonzero
+ value (the equivalent single-letter option character, if there is
+ one). For long options that have a zero `flag' field, `getopt'
+ returns the contents of the `val' field. */
+
+struct option
+{
+#if defined (__STDC__) && __STDC__
+ const char *name;
+#else
+ char *name;
+#endif
+ /* has_arg can't be an enum because some compilers complain about
+ type mismatches in all the code that assumes it is an int. */
+ int has_arg;
+ int *flag;
+ int val;
+};
+
+/* Names for the values of the `has_arg' field of `struct option'. */
+
+#define no_argument 0
+#define required_argument 1
+#define optional_argument 2
+
+#if defined (__STDC__) && __STDC__
+#ifdef __GNU_LIBRARY__
+/* Many other libraries have conflicting prototypes for getopt, with
+ differences in the consts, in stdlib.h. To avoid compilation
+ errors, only prototype getopt for the GNU C library. */
+extern int getopt (int argc, char *const *argv, const char *shortopts);
+#else /* not __GNU_LIBRARY__ */
+extern int getopt ();
+#endif /* __GNU_LIBRARY__ */
+extern int getopt_long (int argc, char *const *argv, const char *shortopts,
+ const struct option *longopts, int *longind);
+extern int getopt_long_only (int argc, char *const *argv,
+ const char *shortopts,
+ const struct option *longopts, int *longind);
+
+/* Internal only. Users should not call this directly. */
+extern int _getopt_internal (int argc, char *const *argv,
+ const char *shortopts,
+ const struct option *longopts, int *longind,
+ int long_only);
+#else /* not __STDC__ */
+extern int getopt ();
+extern int getopt_long ();
+extern int getopt_long_only ();
+
+extern int _getopt_internal ();
+#endif /* __STDC__ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GETOPT_H */
diff --git a/lib/getopt1.c b/lib/getopt1.c
new file mode 100644
index 00000000..6312c4c3
--- /dev/null
+++ b/lib/getopt1.c
@@ -0,0 +1,180 @@
+/* getopt_long and getopt_long_only entry points for GNU getopt.
+ Copyright (C) 1987, 88, 89, 90, 91, 92, 1993, 1994
+ Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "getopt.h"
+
+#if !defined (__STDC__) || !__STDC__
+/* This is a separate conditional since some stdc systems
+ reject `defined (const)'. */
+#ifndef const
+#define const
+#endif
+#endif
+
+#include <stdio.h>
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+ actually compiling the library itself. This code is part of the GNU C
+ Library, but also included in many other GNU distributions. Compiling
+ and linking in this code is a waste when using the GNU C library
+ (especially if it is a shared library). Rather than having every GNU
+ program understand `configure --with-gnu-libc' and omit the object files,
+ it is simpler to just do this in the source for each such file. */
+
+#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
+
+
+/* This needs to come after some library #include
+ to get __GNU_LIBRARY__ defined. */
+#ifdef __GNU_LIBRARY__
+#include <stdlib.h>
+#else
+char *getenv ();
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+int
+getopt_long (argc, argv, options, long_options, opt_index)
+ int argc;
+ char *const *argv;
+ const char *options;
+ const struct option *long_options;
+ int *opt_index;
+{
+ return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
+}
+
+/* Like getopt_long, but '-' as well as '--' can indicate a long option.
+ If an option that starts with '-' (not '--') doesn't match a long option,
+ but does match a short option, it is parsed as a short option
+ instead. */
+
+int
+getopt_long_only (argc, argv, options, long_options, opt_index)
+ int argc;
+ char *const *argv;
+ const char *options;
+ const struct option *long_options;
+ int *opt_index;
+{
+ return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
+}
+
+
+#endif /* _LIBC or not __GNU_LIBRARY__. */
+
+#ifdef TEST
+
+#include <stdio.h>
+
+int
+main (argc, argv)
+ int argc;
+ char **argv;
+{
+ int c;
+ int digit_optind = 0;
+
+ while (1)
+ {
+ int this_option_optind = optind ? optind : 1;
+ int option_index = 0;
+ static struct option long_options[] =
+ {
+ {"add", 1, 0, 0},
+ {"append", 0, 0, 0},
+ {"delete", 1, 0, 0},
+ {"verbose", 0, 0, 0},
+ {"create", 0, 0, 0},
+ {"file", 1, 0, 0},
+ {0, 0, 0, 0}
+ };
+
+ c = getopt_long (argc, argv, "abc:d:0123456789",
+ long_options, &option_index);
+ if (c == EOF)
+ break;
+
+ switch (c)
+ {
+ case 0:
+ printf ("option %s", long_options[option_index].name);
+ if (optarg)
+ printf (" with arg %s", optarg);
+ printf ("\n");
+ break;
+
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ case '4':
+ case '5':
+ case '6':
+ case '7':
+ case '8':
+ case '9':
+ if (digit_optind != 0 && digit_optind != this_option_optind)
+ printf ("digits occur in two different argv-elements.\n");
+ digit_optind = this_option_optind;
+ printf ("option %c\n", c);
+ break;
+
+ case 'a':
+ printf ("option a\n");
+ break;
+
+ case 'b':
+ printf ("option b\n");
+ break;
+
+ case 'c':
+ printf ("option c with value `%s'\n", optarg);
+ break;
+
+ case 'd':
+ printf ("option d with value `%s'\n", optarg);
+ break;
+
+ case '?':
+ break;
+
+ default:
+ printf ("?? getopt returned character code 0%o ??\n", c);
+ }
+ }
+
+ if (optind < argc)
+ {
+ printf ("non-option ARGV-elements: ");
+ while (optind < argc)
+ printf ("%s ", argv[optind++]);
+ printf ("\n");
+ }
+
+ exit (0);
+}
+
+#endif /* TEST */
diff --git a/lib/glob.c b/lib/glob.c
new file mode 100644
index 00000000..87dc3217
--- /dev/null
+++ b/lib/glob.c
@@ -0,0 +1,675 @@
+/* Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+
+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., 675 Mass Ave,
+Cambridge, MA 02139, USA. */
+
+/* AIX requires this to be the first thing in the file. */
+#if defined (_AIX) && !defined (__GNUC__)
+ #pragma alloca
+#endif
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <errno.h>
+#include <sys/types.h>
+
+
+/* Comment out all this code if we are using the GNU C Library, and are not
+ actually compiling the library itself. This code is part of the GNU C
+ Library, but also included in many other GNU distributions. Compiling
+ and linking in this code is a waste when using the GNU C library
+ (especially if it is a shared library). Rather than having every GNU
+ program understand `configure --with-gnu-libc' and omit the object files,
+ it is simpler to just do this in the source for each such file. */
+
+#if defined (_LIBC) || !defined (__GNU_LIBRARY__)
+
+
+#ifdef STDC_HEADERS
+#include <stddef.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#ifndef POSIX
+#ifdef _POSIX_VERSION
+#define POSIX
+#endif
+#endif
+#endif
+
+#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS)
+extern int errno;
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+
+#if defined (POSIX) || defined (HAVE_DIRENT_H) || defined (__GNU_LIBRARY__)
+#include <dirent.h>
+#ifndef __GNU_LIBRARY__
+#define D_NAMLEN(d) strlen((d)->d_name)
+#else /* GNU C library. */
+#define D_NAMLEN(d) ((d)->d_namlen)
+#endif /* Not GNU C library. */
+#else /* Not POSIX or HAVE_DIRENT_H. */
+#define direct dirent
+#define D_NAMLEN(d) ((d)->d_namlen)
+#ifdef HAVE_SYS_NDIR_H
+#include <sys/ndir.h>
+#endif /* HAVE_SYS_NDIR_H */
+#ifdef HAVE_SYS_DIR_H
+#include <sys/dir.h>
+#endif /* HAVE_SYS_DIR_H */
+#ifdef HAVE_NDIR_H
+#include <ndir.h>
+#endif /* HAVE_NDIR_H */
+#endif /* POSIX or HAVE_DIRENT_H or __GNU_LIBRARY__. */
+
+#if defined (POSIX) && !defined (__GNU_LIBRARY__)
+/* Posix does not require that the d_ino field be present, and some
+ systems do not provide it. */
+#define REAL_DIR_ENTRY(dp) 1
+#else
+#define REAL_DIR_ENTRY(dp) (dp->d_ino != 0)
+#endif /* POSIX */
+
+#if (defined (STDC_HEADERS) || defined (__GNU_LIBRARY__))
+#include <stdlib.h>
+#include <string.h>
+#define ANSI_STRING
+#else /* No standard headers. */
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#define ANSI_STRING
+#else
+#include <strings.h>
+#endif
+#ifdef HAVE_MEMORY_H
+#include <memory.h>
+#endif
+
+extern char *malloc (), *realloc ();
+extern void free ();
+
+extern void qsort ();
+extern void abort (), exit ();
+
+#endif /* Standard headers. */
+
+#ifndef ANSI_STRING
+
+#ifndef bzero
+extern void bzero ();
+#endif
+#ifndef bcopy
+extern void bcopy ();
+#endif
+
+#define memcpy(d, s, n) bcopy ((s), (d), (n))
+#define strrchr rindex
+/* memset is only used for zero here, but let's be paranoid. */
+#define memset(s, better_be_zero, n) \
+ ((void) ((better_be_zero) == 0 ? (bzero((s), (n)), 0) : (abort(), 0)))
+#endif /* Not ANSI_STRING. */
+
+#ifndef HAVE_STRCOLL
+#define strcoll strcmp
+#endif
+
+
+#ifndef __GNU_LIBRARY__
+#ifdef __GNUC__
+__inline
+#endif
+static char *
+my_realloc (p, n)
+ char *p;
+ unsigned int n;
+{
+ /* These casts are the for sake of the broken Ultrix compiler,
+ which warns of illegal pointer combinations otherwise. */
+ if (p == NULL)
+ return (char *) malloc (n);
+ return (char *) realloc (p, n);
+}
+#define realloc my_realloc
+#endif
+
+
+#if !defined(__alloca) && !defined(__GNU_LIBRARY__)
+
+#ifdef __GNUC__
+#undef alloca
+#define alloca(n) __builtin_alloca (n)
+#else /* Not GCC. */
+#if defined (sparc) || defined (HAVE_ALLOCA_H)
+#include <alloca.h>
+#else /* Not sparc or HAVE_ALLOCA_H. */
+#ifndef _AIX
+extern char *alloca ();
+#endif /* Not _AIX. */
+#endif /* sparc or HAVE_ALLOCA_H. */
+#endif /* GCC. */
+
+#define __alloca alloca
+
+#endif
+
+#ifndef STDC_HEADERS
+#undef size_t
+#define size_t unsigned int
+#endif
+
+/* Some system header files erroneously define these.
+ We want our own definitions from <fnmatch.h> to take precedence. */
+#undef FNM_PATHNAME
+#undef FNM_NOESCAPE
+#undef FNM_PERIOD
+#ifdef HAVE_FNMATCH_H
+# include <fnmatch.h>
+#else
+# include "fnmatch.h"
+#endif
+
+/* Some system header files erroneously define these.
+ We want our own definitions from <glob.h> to take precedence. */
+#undef GLOB_ERR
+#undef GLOB_MARK
+#undef GLOB_NOSORT
+#undef GLOB_DOOFFS
+#undef GLOB_NOCHECK
+#undef GLOB_APPEND
+#undef GLOB_NOESCAPE
+#undef GLOB_PERIOD
+#include "glob.h"
+
+__ptr_t (*__glob_opendir_hook) __P ((const char *directory));
+const char *(*__glob_readdir_hook) __P ((__ptr_t stream));
+void (*__glob_closedir_hook) __P ((__ptr_t stream));
+
+static int glob_pattern_p __P ((const char *pattern, int quote));
+static int glob_in_dir __P ((const char *pattern, const char *directory,
+ int flags,
+ int (*errfunc) __P ((const char *, int)),
+ glob_t *pglob));
+static int prefix_array __P ((const char *prefix, char **array, size_t n));
+static int collated_compare __P ((const __ptr_t, const __ptr_t));
+
+/* Do glob searching for PATTERN, placing results in PGLOB.
+ The bits defined above may be set in FLAGS.
+ If a directory cannot be opened or read and ERRFUNC is not nil,
+ it is called with the pathname that caused the error, and the
+ `errno' value from the failing call; if it returns non-zero
+ `glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
+ If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
+ Otherwise, `glob' returns zero. */
+int
+glob (pattern, flags, errfunc, pglob)
+ const char *pattern;
+ int flags;
+ int (*errfunc) __P ((const char *, int));
+ glob_t *pglob;
+{
+ const char *filename;
+ char *dirname;
+ size_t dirlen;
+ int status;
+ int oldcount;
+
+ if (pattern == NULL || pglob == NULL || (flags & ~__GLOB_FLAGS) != 0)
+ {
+ errno = EINVAL;
+ return -1;
+ }
+
+ /* Find the filename. */
+ filename = strrchr (pattern, '/');
+ if (filename == NULL)
+ {
+ filename = pattern;
+ dirname = (char *) ".";
+ dirlen = 0;
+ }
+ else if (filename == pattern)
+ {
+ /* "/pattern". */
+ dirname = (char *) "/";
+ dirlen = 1;
+ ++filename;
+ }
+ else
+ {
+ dirlen = filename - pattern;
+ dirname = (char *) __alloca (dirlen + 1);
+ memcpy (dirname, pattern, dirlen);
+ dirname[dirlen] = '\0';
+ ++filename;
+ }
+
+ if (filename[0] == '\0' && dirlen > 1)
+ /* "pattern/". Expand "pattern", appending slashes. */
+ {
+ int ret = glob (dirname, flags | GLOB_MARK, errfunc, pglob);
+ if (ret == 0)
+ pglob->gl_flags = (pglob->gl_flags & ~GLOB_MARK) | (flags & GLOB_MARK);
+ return ret;
+ }
+
+ if (!(flags & GLOB_APPEND))
+ {
+ pglob->gl_pathc = 0;
+ pglob->gl_pathv = NULL;
+ }
+
+ oldcount = pglob->gl_pathc;
+
+ if (glob_pattern_p (dirname, !(flags & GLOB_NOESCAPE)))
+ {
+ /* The directory name contains metacharacters, so we
+ have to glob for the directory, and then glob for
+ the pattern in each directory found. */
+ glob_t dirs;
+ register int i;
+
+ status = glob (dirname,
+ ((flags & (GLOB_ERR | GLOB_NOCHECK | GLOB_NOESCAPE)) |
+ GLOB_NOSORT),
+ errfunc, &dirs);
+ if (status != 0)
+ return status;
+
+ /* We have successfully globbed the preceding directory name.
+ For each name we found, call glob_in_dir on it and FILENAME,
+ appending the results to PGLOB. */
+ for (i = 0; i < dirs.gl_pathc; ++i)
+ {
+ int oldcount;
+
+#ifdef SHELL
+ {
+ /* Make globbing interruptible in the bash shell. */
+ extern int interrupt_state;
+
+ if (interrupt_state)
+ {
+ globfree (&dirs);
+ globfree (&files);
+ return GLOB_ABEND;
+ }
+ }
+#endif /* SHELL. */
+
+ oldcount = pglob->gl_pathc;
+ status = glob_in_dir (filename, dirs.gl_pathv[i],
+ (flags | GLOB_APPEND) & ~GLOB_NOCHECK,
+ errfunc, pglob);
+ if (status == GLOB_NOMATCH)
+ /* No matches in this directory. Try the next. */
+ continue;
+
+ if (status != 0)
+ {
+ globfree (&dirs);
+ globfree (pglob);
+ return status;
+ }
+
+ /* Stick the directory on the front of each name. */
+ if (prefix_array (dirs.gl_pathv[i],
+ &pglob->gl_pathv[oldcount],
+ pglob->gl_pathc - oldcount))
+ {
+ globfree (&dirs);
+ globfree (pglob);
+ return GLOB_NOSPACE;
+ }
+ }
+
+ flags |= GLOB_MAGCHAR;
+
+ if (pglob->gl_pathc == oldcount)
+ /* No matches. */
+ if (flags & GLOB_NOCHECK)
+ {
+ size_t len = strlen (pattern) + 1;
+ char *patcopy = (char *) malloc (len);
+ if (patcopy == NULL)
+ return GLOB_NOSPACE;
+ memcpy (patcopy, pattern, len);
+
+ pglob->gl_pathv
+ = (char **) realloc (pglob->gl_pathv,
+ (pglob->gl_pathc +
+ ((flags & GLOB_DOOFFS) ?
+ pglob->gl_offs : 0) +
+ 1 + 1) *
+ sizeof (char *));
+ if (pglob->gl_pathv == NULL)
+ {
+ free (patcopy);
+ return GLOB_NOSPACE;
+ }
+
+ if (flags & GLOB_DOOFFS)
+ while (pglob->gl_pathc < pglob->gl_offs)
+ pglob->gl_pathv[pglob->gl_pathc++] = NULL;
+
+ pglob->gl_pathv[pglob->gl_pathc++] = patcopy;
+ pglob->gl_pathv[pglob->gl_pathc] = NULL;
+ pglob->gl_flags = flags;
+ }
+ else
+ return GLOB_NOMATCH;
+ }
+ else
+ {
+ status = glob_in_dir (filename, dirname, flags, errfunc, pglob);
+ if (status != 0)
+ return status;
+
+ if (dirlen > 0)
+ {
+ /* Stick the directory on the front of each name. */
+ if (prefix_array (dirname,
+ &pglob->gl_pathv[oldcount],
+ pglob->gl_pathc - oldcount))
+ {
+ globfree (pglob);
+ return GLOB_NOSPACE;
+ }
+ }
+ }
+
+ if (!(flags & GLOB_NOSORT))
+ /* Sort the vector. */
+ qsort ((__ptr_t) & pglob->gl_pathv[oldcount],
+ pglob->gl_pathc - oldcount,
+ sizeof (char *), collated_compare);
+
+ return 0;
+}
+
+
+/* Free storage allocated in PGLOB by a previous `glob' call. */
+void
+globfree (pglob)
+ register glob_t *pglob;
+{
+ if (pglob->gl_pathv != NULL)
+ {
+ register int i;
+ for (i = 0; i < pglob->gl_pathc; ++i)
+ if (pglob->gl_pathv[i] != NULL)
+ free ((__ptr_t) pglob->gl_pathv[i]);
+ free ((__ptr_t) pglob->gl_pathv);
+ }
+}
+
+
+/* Do a collated comparison of A and B. */
+static int
+collated_compare (a, b)
+ const __ptr_t a;
+ const __ptr_t b;
+{
+ const char *const s1 = *(const char *const * const) a;
+ const char *const s2 = *(const char *const * const) b;
+
+ if (s1 == s2)
+ return 0;
+ if (s1 == NULL)
+ return 1;
+ if (s2 == NULL)
+ return -1;
+ return strcoll (s1, s2);
+}
+
+
+/* Prepend DIRNAME to each of N members of ARRAY, replacing ARRAY's
+ elements in place. Return nonzero if out of memory, zero if successful.
+ A slash is inserted between DIRNAME and each elt of ARRAY,
+ unless DIRNAME is just "/". Each old element of ARRAY is freed. */
+static int
+prefix_array (dirname, array, n)
+ const char *dirname;
+ char **array;
+ const size_t n;
+{
+ register size_t i;
+ size_t dirlen = strlen (dirname);
+
+ if (dirlen == 1 && dirname[0] == '/')
+ /* DIRNAME is just "/", so normal prepending would get us "//foo".
+ We want "/foo" instead, so don't prepend any chars from DIRNAME. */
+ dirlen = 0;
+
+ for (i = 0; i < n; ++i)
+ {
+ size_t eltlen = strlen (array[i]) + 1;
+ char *new = (char *) malloc (dirlen + 1 + eltlen);
+ if (new == NULL)
+ {
+ while (i > 0)
+ free ((__ptr_t) array[--i]);
+ return 1;
+ }
+
+ memcpy (new, dirname, dirlen);
+ new[dirlen] = '/';
+ memcpy (&new[dirlen + 1], array[i], eltlen);
+ free ((__ptr_t) array[i]);
+ array[i] = new;
+ }
+
+ return 0;
+}
+
+
+/* Return nonzero if PATTERN contains any metacharacters.
+ Metacharacters can be quoted with backslashes if QUOTE is nonzero. */
+static int
+glob_pattern_p (pattern, quote)
+ const char *pattern;
+ const int quote;
+{
+ register const char *p;
+ int open = 0;
+
+ for (p = pattern; *p != '\0'; ++p)
+ switch (*p)
+ {
+ case '?':
+ case '*':
+ return 1;
+
+ case '\\':
+ if (quote)
+ ++p;
+ break;
+
+ case '[':
+ open = 1;
+ break;
+
+ case ']':
+ if (open)
+ return 1;
+ break;
+ }
+
+ return 0;
+}
+
+
+/* Like `glob', but PATTERN is a final pathname component,
+ and matches are searched for in DIRECTORY.
+ The GLOB_NOSORT bit in FLAGS is ignored. No sorting is ever done.
+ The GLOB_APPEND flag is assumed to be set (always appends). */
+static int
+glob_in_dir (pattern, directory, flags, errfunc, pglob)
+ const char *pattern;
+ const char *directory;
+ int flags;
+ int (*errfunc) __P ((const char *, int));
+ glob_t *pglob;
+{
+ __ptr_t stream;
+
+ struct globlink
+ {
+ struct globlink *next;
+ char *name;
+ };
+ struct globlink *names = NULL;
+ size_t nfound = 0;
+
+ if (!glob_pattern_p (pattern, !(flags & GLOB_NOESCAPE)))
+ {
+ stream = NULL;
+ flags |= GLOB_NOCHECK;
+ }
+ else
+ {
+ flags |= GLOB_MAGCHAR;
+
+ stream = (__glob_opendir_hook ? (*__glob_opendir_hook) (directory)
+ : (__ptr_t) opendir (directory));
+ if (stream == NULL)
+ {
+ if ((errfunc != NULL && (*errfunc) (directory, errno)) ||
+ (flags & GLOB_ERR))
+ return GLOB_ABEND;
+ }
+ else
+ while (1)
+ {
+ const char *name;
+ size_t len;
+
+ if (__glob_readdir_hook)
+ {
+ name = (*__glob_readdir_hook) (stream);
+ if (name == NULL)
+ break;
+ len = 0;
+ }
+ else
+ {
+ struct dirent *d = readdir ((DIR *) stream);
+ if (d == NULL)
+ break;
+ if (! REAL_DIR_ENTRY (d))
+ continue;
+ name = d->d_name;
+#ifdef HAVE_D_NAMLEN
+ len = d->d_namlen;
+#else
+ len = 0;
+#endif
+ }
+
+ if (fnmatch (pattern, name,
+ (!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0) |
+ ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)) == 0)
+ {
+ struct globlink *new
+ = (struct globlink *) __alloca (sizeof (struct globlink));
+ if (len == 0)
+ len = strlen (name);
+ new->name
+ = (char *) malloc (len + ((flags & GLOB_MARK) ? 1 : 0) + 1);
+ if (new->name == NULL)
+ goto memory_error;
+ memcpy ((__ptr_t) new->name, name, len);
+ if (flags & GLOB_MARK)
+ new->name[len++] = '/';
+ new->name[len] = '\0';
+ new->next = names;
+ names = new;
+ ++nfound;
+ }
+ }
+ }
+
+ if (nfound == 0 && (flags & GLOB_NOCHECK))
+ {
+ size_t len = strlen (pattern);
+ nfound = 1;
+ names = (struct globlink *) __alloca (sizeof (struct globlink));
+ names->next = NULL;
+ names->name = (char *) malloc (len + ((flags & GLOB_MARK) ? 1 : 0) + 1);
+ if (names->name == NULL)
+ goto memory_error;
+ memcpy (names->name, pattern, len);
+ if (flags & GLOB_MARK)
+ names->name[len++] = '/';
+ names->name[len] = '\0';
+ }
+
+ pglob->gl_pathv
+ = (char **) realloc (pglob->gl_pathv,
+ (pglob->gl_pathc +
+ ((flags & GLOB_DOOFFS) ? pglob->gl_offs : 0) +
+ nfound + 1) *
+ sizeof (char *));
+ if (pglob->gl_pathv == NULL)
+ goto memory_error;
+
+ if (flags & GLOB_DOOFFS)
+ while (pglob->gl_pathc < pglob->gl_offs)
+ pglob->gl_pathv[pglob->gl_pathc++] = NULL;
+
+ for (; names != NULL; names = names->next)
+ pglob->gl_pathv[pglob->gl_pathc++] = names->name;
+ pglob->gl_pathv[pglob->gl_pathc] = NULL;
+
+ pglob->gl_flags = flags;
+
+ if (stream != NULL)
+ {
+ int save = errno;
+ if (__glob_closedir_hook)
+ (*__glob_closedir_hook) (stream);
+ else
+ (void) closedir ((DIR *) stream);
+ errno = save;
+ }
+ return nfound == 0 ? GLOB_NOMATCH : 0;
+
+ memory_error:
+ {
+ int save = errno;
+ if (__glob_closedir_hook)
+ (*__glob_closedir_hook) (stream);
+ else
+ (void) closedir ((DIR *) stream);
+ errno = save;
+ }
+ while (names != NULL)
+ {
+ if (names->name != NULL)
+ free ((__ptr_t) names->name);
+ names = names->next;
+ }
+ return GLOB_NOSPACE;
+}
+
+#endif /* _LIBC or not __GNU_LIBRARY__. */
diff --git a/lib/glob.h b/lib/glob.h
new file mode 100644
index 00000000..05ad47f0
--- /dev/null
+++ b/lib/glob.h
@@ -0,0 +1,97 @@
+/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+
+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., 675 Mass Ave,
+Cambridge, MA 02139, USA. */
+
+#ifndef _GLOB_H
+
+#define _GLOB_H 1
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#undef __ptr_t
+#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
+#undef __P
+#define __P(protos) protos
+#define __ptr_t void *
+#else /* Not C++ or ANSI C. */
+#undef __P
+#define __P(protos) ()
+#undef const
+#define const
+#define __ptr_t char *
+#endif /* C++ or ANSI C. */
+
+/* Bits set in the FLAGS argument to `glob'. */
+#define GLOB_ERR (1 << 0)/* Return on read errors. */
+#define GLOB_MARK (1 << 1)/* Append a slash to each name. */
+#define GLOB_NOSORT (1 << 2)/* Don't sort the names. */
+#define GLOB_DOOFFS (1 << 3)/* Insert PGLOB->gl_offs NULLs. */
+#define GLOB_NOCHECK (1 << 4)/* If nothing matches, return the pattern. */
+#define GLOB_APPEND (1 << 5)/* Append to results of a previous call. */
+#define GLOB_NOESCAPE (1 << 6)/* Backslashes don't quote metacharacters. */
+#define GLOB_PERIOD (1 << 7)/* Leading `.' can be matched by metachars. */
+#define __GLOB_FLAGS (GLOB_ERR|GLOB_MARK|GLOB_NOSORT|GLOB_DOOFFS| \
+ GLOB_NOESCAPE|GLOB_NOCHECK|GLOB_APPEND|GLOB_PERIOD)
+
+#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_BSD_SOURCE)
+#define GLOB_MAGCHAR (1 << 8)/* Set in gl_flags if any metachars seen. */
+#endif
+
+/* Error returns from `glob'. */
+#define GLOB_NOSPACE 1 /* Ran out of memory. */
+#define GLOB_ABEND 2 /* Read error. */
+#define GLOB_NOMATCH 3 /* No matches found. */
+
+/* Structure describing a globbing run. */
+typedef struct
+ {
+ int gl_pathc; /* Count of paths matched by the pattern. */
+ char **gl_pathv; /* List of matched pathnames. */
+ int gl_offs; /* Slots to reserve in `gl_pathv'. */
+ int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
+ } glob_t;
+
+/* Do glob searching for PATTERN, placing results in PGLOB.
+ The bits defined above may be set in FLAGS.
+ If a directory cannot be opened or read and ERRFUNC is not nil,
+ it is called with the pathname that caused the error, and the
+ `errno' value from the failing call; if it returns non-zero
+ `glob' returns GLOB_ABEND; if it returns zero, the error is ignored.
+ If memory cannot be allocated for PGLOB, GLOB_NOSPACE is returned.
+ Otherwise, `glob' returns zero. */
+extern int glob __P ((const char *__pattern, int __flags,
+ int (*__errfunc) __P ((const char *, int)),
+ glob_t *__pglob));
+
+/* Free storage allocated in PGLOB by a previous `glob' call. */
+extern void globfree __P ((glob_t *__pglob));
+
+
+#if !defined (_POSIX_C_SOURCE) || _POSIX_C_SOURCE < 2 || defined (_GNU_SOURCE)
+/* If they are not NULL, `glob' uses these functions to read directories. */
+extern __ptr_t (*__glob_opendir_hook) __P ((const char *__directory));
+extern const char *(*__glob_readdir_hook) __P ((__ptr_t __stream));
+extern void (*__glob_closedir_hook) __P ((__ptr_t __stream));
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* glob.h */
diff --git a/lib/memcmp.c b/lib/memcmp.c
new file mode 100644
index 00000000..dce6d3a8
--- /dev/null
+++ b/lib/memcmp.c
@@ -0,0 +1,366 @@
+/* Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+ Contributed by Torbjorn Granlund (tege@sics.se).
+
+NOTE: The canonical source of this file is maintained with the GNU C Library.
+Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+
+This program is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#undef __ptr_t
+#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
+#define __ptr_t void *
+#else /* Not C++ or ANSI C. */
+#undef const
+#define const
+#define __ptr_t char *
+#endif /* C++ or ANSI C. */
+
+#if defined (HAVE_STRING_H) || defined (_LIBC)
+#include <string.h>
+#endif
+
+#ifdef _LIBC
+
+#include <memcopy.h>
+
+#else /* Not in the GNU C library. */
+
+#include <sys/types.h>
+
+/* Type to use for aligned memory operations.
+ This should normally be the biggest type supported by a single load
+ and store. Must be an unsigned type. */
+#define op_t unsigned long int
+#define OPSIZ (sizeof(op_t))
+
+/* Threshold value for when to enter the unrolled loops. */
+#define OP_T_THRES 16
+
+/* Type to use for unaligned operations. */
+typedef unsigned char byte;
+
+#ifndef WORDS_BIGENDIAN
+#define MERGE(w0, sh_1, w1, sh_2) (((w0) >> (sh_1)) | ((w1) << (sh_2)))
+#else
+#define MERGE(w0, sh_1, w1, sh_2) (((w0) << (sh_1)) | ((w1) >> (sh_2)))
+#endif
+
+#endif /* In the GNU C library. */
+
+#ifdef WORDS_BIGENDIAN
+#define CMP_LT_OR_GT(a, b) ((a) > (b) ? 1 : -1)
+#else
+#define CMP_LT_OR_GT(a, b) memcmp_bytes ((a), (b))
+#endif
+
+/* BE VERY CAREFUL IF YOU CHANGE THIS CODE! */
+
+/* The strategy of this memcmp is:
+
+ 1. Compare bytes until one of the block pointers is aligned.
+
+ 2. Compare using memcmp_common_alignment or
+ memcmp_not_common_alignment, regarding the alignment of the other
+ block after the initial byte operations. The maximum number of
+ full words (of type op_t) are compared in this way.
+
+ 3. Compare the few remaining bytes. */
+
+#ifndef WORDS_BIGENDIAN
+/* memcmp_bytes -- Compare A and B bytewise in the byte order of the machine.
+ A and B are known to be different.
+ This is needed only on little-endian machines. */
+#ifdef __GNUC__
+__inline
+#endif
+static int
+memcmp_bytes (a, b)
+ op_t a, b;
+{
+ long int srcp1 = (long int) &a;
+ long int srcp2 = (long int) &b;
+ op_t a0, b0;
+
+ do
+ {
+ a0 = ((byte *) srcp1)[0];
+ b0 = ((byte *) srcp2)[0];
+ srcp1 += 1;
+ srcp2 += 1;
+ }
+ while (a0 == b0);
+ return a0 - b0;
+}
+#endif
+
+/* memcmp_common_alignment -- Compare blocks at SRCP1 and SRCP2 with LEN `op_t'
+ objects (not LEN bytes!). Both SRCP1 and SRCP2 should be aligned for
+ memory operations on `op_t's. */
+#ifdef __GNUC__
+__inline
+#endif
+static int
+memcmp_common_alignment (srcp1, srcp2, len)
+ long int srcp1;
+ long int srcp2;
+ size_t len;
+{
+ op_t a0, a1;
+ op_t b0, b1;
+
+ switch (len % 4)
+ {
+ case 2:
+ a0 = ((op_t *) srcp1)[0];
+ b0 = ((op_t *) srcp2)[0];
+ srcp1 -= 2 * OPSIZ;
+ srcp2 -= 2 * OPSIZ;
+ len += 2;
+ goto do1;
+ case 3:
+ a1 = ((op_t *) srcp1)[0];
+ b1 = ((op_t *) srcp2)[0];
+ srcp1 -= OPSIZ;
+ srcp2 -= OPSIZ;
+ len += 1;
+ goto do2;
+ case 0:
+ if (OP_T_THRES <= 3 * OPSIZ && len == 0)
+ return 0;
+ a0 = ((op_t *) srcp1)[0];
+ b0 = ((op_t *) srcp2)[0];
+ goto do3;
+ case 1:
+ a1 = ((op_t *) srcp1)[0];
+ b1 = ((op_t *) srcp2)[0];
+ srcp1 += OPSIZ;
+ srcp2 += OPSIZ;
+ len -= 1;
+ if (OP_T_THRES <= 3 * OPSIZ && len == 0)
+ goto do0;
+ /* Fall through. */
+ }
+
+ do
+ {
+ a0 = ((op_t *) srcp1)[0];
+ b0 = ((op_t *) srcp2)[0];
+ if (a1 != b1)
+ return CMP_LT_OR_GT (a1, b1);
+
+ do3:
+ a1 = ((op_t *) srcp1)[1];
+ b1 = ((op_t *) srcp2)[1];
+ if (a0 != b0)
+ return CMP_LT_OR_GT (a0, b0);
+
+ do2:
+ a0 = ((op_t *) srcp1)[2];
+ b0 = ((op_t *) srcp2)[2];
+ if (a1 != b1)
+ return CMP_LT_OR_GT (a1, b1);
+
+ do1:
+ a1 = ((op_t *) srcp1)[3];
+ b1 = ((op_t *) srcp2)[3];
+ if (a0 != b0)
+ return CMP_LT_OR_GT (a0, b0);
+
+ srcp1 += 4 * OPSIZ;
+ srcp2 += 4 * OPSIZ;
+ len -= 4;
+ }
+ while (len != 0);
+
+ /* This is the right position for do0. Please don't move
+ it into the loop. */
+ do0:
+ if (a1 != b1)
+ return CMP_LT_OR_GT (a1, b1);
+ return 0;
+}
+
+/* memcmp_not_common_alignment -- Compare blocks at SRCP1 and SRCP2 with LEN
+ `op_t' objects (not LEN bytes!). SRCP2 should be aligned for memory
+ operations on `op_t', but SRCP1 *should be unaligned*. */
+#ifdef __GNUC__
+__inline
+#endif
+static int
+memcmp_not_common_alignment (srcp1, srcp2, len)
+ long int srcp1;
+ long int srcp2;
+ size_t len;
+{
+ op_t a0, a1, a2, a3;
+ op_t b0, b1, b2, b3;
+ op_t x;
+ int shl, shr;
+
+ /* Calculate how to shift a word read at the memory operation
+ aligned srcp1 to make it aligned for comparison. */
+
+ shl = 8 * (srcp1 % OPSIZ);
+ shr = 8 * OPSIZ - shl;
+
+ /* Make SRCP1 aligned by rounding it down to the beginning of the `op_t'
+ it points in the middle of. */
+ srcp1 &= -OPSIZ;
+
+ switch (len % 4)
+ {
+ case 2:
+ a1 = ((op_t *) srcp1)[0];
+ a2 = ((op_t *) srcp1)[1];
+ b2 = ((op_t *) srcp2)[0];
+ srcp1 -= 1 * OPSIZ;
+ srcp2 -= 2 * OPSIZ;
+ len += 2;
+ goto do1;
+ case 3:
+ a0 = ((op_t *) srcp1)[0];
+ a1 = ((op_t *) srcp1)[1];
+ b1 = ((op_t *) srcp2)[0];
+ srcp2 -= 1 * OPSIZ;
+ len += 1;
+ goto do2;
+ case 0:
+ if (OP_T_THRES <= 3 * OPSIZ && len == 0)
+ return 0;
+ a3 = ((op_t *) srcp1)[0];
+ a0 = ((op_t *) srcp1)[1];
+ b0 = ((op_t *) srcp2)[0];
+ srcp1 += 1 * OPSIZ;
+ goto do3;
+ case 1:
+ a2 = ((op_t *) srcp1)[0];
+ a3 = ((op_t *) srcp1)[1];
+ b3 = ((op_t *) srcp2)[0];
+ srcp1 += 2 * OPSIZ;
+ srcp2 += 1 * OPSIZ;
+ len -= 1;
+ if (OP_T_THRES <= 3 * OPSIZ && len == 0)
+ goto do0;
+ /* Fall through. */
+ }
+
+ do
+ {
+ a0 = ((op_t *) srcp1)[0];
+ b0 = ((op_t *) srcp2)[0];
+ x = MERGE(a2, shl, a3, shr);
+ if (x != b3)
+ return CMP_LT_OR_GT (x, b3);
+
+ do3:
+ a1 = ((op_t *) srcp1)[1];
+ b1 = ((op_t *) srcp2)[1];
+ x = MERGE(a3, shl, a0, shr);
+ if (x != b0)
+ return CMP_LT_OR_GT (x, b0);
+
+ do2:
+ a2 = ((op_t *) srcp1)[2];
+ b2 = ((op_t *) srcp2)[2];
+ x = MERGE(a0, shl, a1, shr);
+ if (x != b1)
+ return CMP_LT_OR_GT (x, b1);
+
+ do1:
+ a3 = ((op_t *) srcp1)[3];
+ b3 = ((op_t *) srcp2)[3];
+ x = MERGE(a1, shl, a2, shr);
+ if (x != b2)
+ return CMP_LT_OR_GT (x, b2);
+
+ srcp1 += 4 * OPSIZ;
+ srcp2 += 4 * OPSIZ;
+ len -= 4;
+ }
+ while (len != 0);
+
+ /* This is the right position for do0. Please don't move
+ it into the loop. */
+ do0:
+ x = MERGE(a2, shl, a3, shr);
+ if (x != b3)
+ return CMP_LT_OR_GT (x, b3);
+ return 0;
+}
+
+int
+memcmp (s1, s2, len)
+ const __ptr_t s1;
+ const __ptr_t s2;
+ size_t len;
+{
+ op_t a0;
+ op_t b0;
+ long int srcp1 = (long int) s1;
+ long int srcp2 = (long int) s2;
+ op_t res;
+
+ if (len >= OP_T_THRES)
+ {
+ /* There are at least some bytes to compare. No need to test
+ for LEN == 0 in this alignment loop. */
+ while (srcp2 % OPSIZ != 0)
+ {
+ a0 = ((byte *) srcp1)[0];
+ b0 = ((byte *) srcp2)[0];
+ srcp1 += 1;
+ srcp2 += 1;
+ res = a0 - b0;
+ if (res != 0)
+ return res;
+ len -= 1;
+ }
+
+ /* SRCP2 is now aligned for memory operations on `op_t'.
+ SRCP1 alignment determines if we can do a simple,
+ aligned compare or need to shuffle bits. */
+
+ if (srcp1 % OPSIZ == 0)
+ res = memcmp_common_alignment (srcp1, srcp2, len / OPSIZ);
+ else
+ res = memcmp_not_common_alignment (srcp1, srcp2, len / OPSIZ);
+ if (res != 0)
+ return res;
+
+ /* Number of bytes remaining in the interval [0..OPSIZ-1]. */
+ srcp1 += len & -OPSIZ;
+ srcp2 += len & -OPSIZ;
+ len %= OPSIZ;
+ }
+
+ /* There are just a few bytes to compare. Use byte memory operations. */
+ while (len != 0)
+ {
+ a0 = ((byte *) srcp1)[0];
+ b0 = ((byte *) srcp2)[0];
+ srcp1 += 1;
+ srcp2 += 1;
+ res = a0 - b0;
+ if (res != 0)
+ return res;
+ len -= 1;
+ }
+
+ return 0;
+}
diff --git a/lib/putenv.c b/lib/putenv.c
new file mode 100644
index 00000000..fe4d3cab
--- /dev/null
+++ b/lib/putenv.c
@@ -0,0 +1,112 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <sys/types.h>
+#include <errno.h>
+
+#ifndef STDC_HEADERS
+extern int errno;
+#endif
+
+/* Don't include stdlib.h for non-GNU C libraries because some of them
+ contain conflicting prototypes for getopt.
+ This needs to come after some library #include
+ to get __GNU_LIBRARY__ defined. */
+#ifdef __GNU_LIBRARY__
+#include <stdlib.h>
+#else
+char *malloc ();
+#endif /* GNU C library. */
+
+#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
+#include <string.h>
+#else
+#include <strings.h>
+#ifndef strchr
+#define strchr index
+#endif
+#ifndef memcpy
+#define memcpy(d, s, n) bcopy((s), (d), (n))
+#endif
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+extern char **environ;
+
+/* Put STRING, which is of the form "NAME=VALUE", in the environment. */
+int
+putenv (string)
+ const char *string;
+{
+ char *name_end = strchr (string, '=');
+ register size_t size;
+ register char **ep;
+
+ if (name_end == NULL)
+ {
+ /* Remove the variable from the environment. */
+ size = strlen (string);
+ for (ep = environ; *ep != NULL; ++ep)
+ if (!strncmp (*ep, string, size) && (*ep)[size] == '=')
+ {
+ while (ep[1] != NULL)
+ {
+ ep[0] = ep[1];
+ ++ep;
+ }
+ *ep = NULL;
+ return 0;
+ }
+ }
+
+ size = 0;
+ for (ep = environ; *ep != NULL; ++ep)
+ if (!strncmp (*ep, string, name_end - string) &&
+ (*ep)[name_end - string] == '=')
+ break;
+ else
+ ++size;
+
+ if (*ep == NULL)
+ {
+ static char **last_environ = NULL;
+ char **new_environ = (char **) malloc ((size + 2) * sizeof (char *));
+ if (new_environ == NULL)
+ return -1;
+ memcpy ((char *) new_environ, (char *) environ, size * sizeof (char *));
+ new_environ[size] = (char *) string;
+ new_environ[size + 1] = NULL;
+ if (last_environ != NULL)
+ free ((char *) last_environ);
+ last_environ = new_environ;
+ environ = new_environ;
+ }
+ else
+ *ep = (char *) string;
+
+ return 0;
+}
diff --git a/lib/realpath.c b/lib/realpath.c
new file mode 100644
index 00000000..bbc2a488
--- /dev/null
+++ b/lib/realpath.c
@@ -0,0 +1,168 @@
+/*
+ * realpath.c -- canonicalize pathname by removing symlinks
+ * Copyright (C) 1993 Rick Sladkey <jrs@world.std.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU 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 Library Public License for more details.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <sys/types.h>
+#if defined(HAVE_UNISTD_H) || defined(STDC_HEADERS)
+#include <unistd.h>
+#endif
+#include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+#ifdef _POSIX_VERSION
+#include <limits.h> /* for PATH_MAX */
+#else
+#include <sys/param.h> /* for MAXPATHLEN */
+#endif
+#include <errno.h>
+
+#ifndef STDC_HEADERS
+extern int errno;
+#endif
+
+#include <sys/stat.h> /* for S_IFLNK */
+
+#ifndef PATH_MAX
+#ifdef _POSIX_VERSION
+#define PATH_MAX _POSIX_PATH_MAX
+#else
+#ifdef MAXPATHLEN
+#define PATH_MAX MAXPATHLEN
+#else
+#define PATH_MAX 1024
+#endif
+#endif
+#endif
+
+#define MAX_READLINKS 32
+
+#ifdef __STDC__
+char *realpath(const char *path, char resolved_path [])
+#else
+char *realpath(path, resolved_path)
+const char *path;
+char resolved_path [];
+#endif
+{
+ char copy_path[PATH_MAX];
+ char link_path[PATH_MAX];
+ char *new_path = resolved_path;
+ char *max_path;
+ int readlinks = 0;
+ int n;
+
+ /* Make a copy of the source path since we may need to modify it. */
+ strcpy(copy_path, path);
+ path = copy_path;
+ max_path = copy_path + PATH_MAX - 2;
+ /* If it's a relative pathname use getwd for starters. */
+ if (*path != '/') {
+#ifdef HAVE_GETCWD
+ getcwd(new_path, PATH_MAX - 1);
+#else
+ getwd(new_path);
+#endif
+ new_path += strlen(new_path);
+ if (new_path[-1] != '/')
+ *new_path++ = '/';
+ }
+ else {
+ *new_path++ = '/';
+ path++;
+ }
+ /* Expand each slash-separated pathname component. */
+ while (*path != '\0') {
+ /* Ignore stray "/". */
+ if (*path == '/') {
+ path++;
+ continue;
+ }
+ if (*path == '.') {
+ /* Ignore ".". */
+ if (path[1] == '\0' || path[1] == '/') {
+ path++;
+ continue;
+ }
+ if (path[1] == '.') {
+ if (path[2] == '\0' || path[2] == '/') {
+ path += 2;
+ /* Ignore ".." at root. */
+ if (new_path == resolved_path + 1)
+ continue;
+ /* Handle ".." by backing up. */
+ while ((--new_path)[-1] != '/')
+ ;
+ continue;
+ }
+ }
+ }
+ /* Safely copy the next pathname component. */
+ while (*path != '\0' && *path != '/') {
+ if (path > max_path) {
+ errno = ENAMETOOLONG;
+ return NULL;
+ }
+ *new_path++ = *path++;
+ }
+#ifdef S_IFLNK
+ /* Protect against infinite loops. */
+ if (readlinks++ > MAX_READLINKS) {
+ errno = ELOOP;
+ return NULL;
+ }
+ /* See if latest pathname component is a symlink. */
+ *new_path = '\0';
+ n = readlink(resolved_path, link_path, PATH_MAX - 1);
+ if (n < 0) {
+ /* EINVAL means the file exists but isn't a symlink. */
+ if (errno != EINVAL)
+ return NULL;
+ }
+ else {
+ /* Note: readlink doesn't add the null byte. */
+ link_path[n] = '\0';
+ if (*link_path == '/')
+ /* Start over for an absolute symlink. */
+ new_path = resolved_path;
+ else
+ /* Otherwise back up over this component. */
+ while (*(--new_path) != '/')
+ ;
+ /* Safe sex check. */
+ if (strlen(path) + n >= PATH_MAX) {
+ errno = ENAMETOOLONG;
+ return NULL;
+ }
+ /* Insert symlink contents into path. */
+ strcat(link_path, path);
+ strcpy(copy_path, link_path);
+ path = copy_path;
+ }
+#endif /* S_IFLNK */
+ *new_path++ = '/';
+ }
+ /* Delete trailing slash but don't whomp a lone slash. */
+ if (new_path != resolved_path + 1 && new_path[-1] == '/')
+ new_path--;
+ /* Make sure it's null terminated. */
+ *new_path = '\0';
+ return resolved_path;
+}
diff --git a/lib/rename.c b/lib/rename.c
new file mode 100644
index 00000000..90452cdc
--- /dev/null
+++ b/lib/rename.c
@@ -0,0 +1,42 @@
+/* rename -- rename a file
+ Copyright (C) 1992 Free Software Foundation, Inc.
+
+This file is part of the libiberty library.
+Libiberty 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.
+
+Libiberty is distributed in the hope that 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 libiberty; see the file COPYING.LIB. If
+not, write to the Free Software Foundation, Inc., 675 Mass Ave,
+Cambridge, MA 02139, USA. */
+
+/* Rename a file. */
+
+#include <errno.h>
+
+#ifndef STDC_HEADERS
+extern int errno;
+#endif
+
+int
+rename (zfrom, zto)
+ char *zfrom;
+ char *zto;
+{
+ if (link (zfrom, zto) < 0)
+ {
+ if (errno != EEXIST)
+ return -1;
+ if (unlink (zto) < 0
+ || link (zfrom, zto) < 0)
+ return -1;
+ }
+ return unlink (zfrom);
+}
diff --git a/lib/strappend.c b/lib/strappend.c
new file mode 100644
index 00000000..60d8ae1e
--- /dev/null
+++ b/lib/strappend.c
@@ -0,0 +1,78 @@
+/* strappend.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 */
+
+#if defined(STDC_HEADERS)
+# include <string.h>
+#elif defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#else /* no string(s) header */
+extern char *strcpy();
+#endif /* STDC_HEADERS */
+
+#ifdef __STDC__
+# include <stdarg.h>
+# define VOID void
+# define VA_START va_start (ap, str)
+#else
+# include <varargs.h>
+# define VOID char
+# define VA_START va_start (ap)
+#endif
+
+extern VOID *xrealloc(void *p, size_t n);
+
+/* append strings to first argument, which is realloced to the correct size
+ first arg may be NULL */
+#ifdef __STDC__
+char *strappend (char *str, ...)
+#else
+char *strappend (str, va_alist)
+ char *str;
+ va_dcl
+#endif
+{
+ va_list ap;
+ int len, newlen;
+ char *next, *end;
+
+ len = str ? strlen (str) : 0;
+
+ VA_START;
+ newlen = len + 1;
+ while ((next = va_arg (ap, char *)))
+ newlen += strlen (next);
+ va_end (ap);
+
+ str = xrealloc (str, newlen);
+ end = str + len;
+
+ VA_START;
+ while ((next = va_arg (ap, char *))) {
+ strcpy (end, next);
+ end += strlen (next);
+ }
+ va_end (ap);
+
+ return str;
+}
diff --git a/lib/strcspn.c b/lib/strcspn.c
new file mode 100644
index 00000000..1b9337fa
--- /dev/null
+++ b/lib/strcspn.c
@@ -0,0 +1,46 @@
+/* Copyright (C) 1991, 1994 Free Software Foundation, Inc.
+
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; 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 */
+
+#if defined (HAVE_STRING_H)
+# include <string.h>
+#elif defined (HAVE_STRINGS_H)
+# include <strings.h>
+#endif /* HAVE_STRING_H */
+
+/* Return the length of the maximum inital segment of S
+ which contains no characters from REJECT. */
+size_t
+strcspn (s, reject)
+ register const char *s;
+ register const char *reject;
+{
+ register size_t count = 0;
+
+ while (*s != '\0')
+ if (strchr (reject, *s++) == NULL)
+ ++count;
+ else
+ return count;
+
+ return count;
+}
diff --git a/lib/strsep.c b/lib/strsep.c
new file mode 100644
index 00000000..7adc7a2e
--- /dev/null
+++ b/lib/strsep.c
@@ -0,0 +1,48 @@
+/* Copyright (C) 1992, 1993 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; 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 "ansidecl.h"
+
+#if defined (HAVE_STRING_H)
+# include <string.h>
+#elif defined (HAVE_STRINGS_H)
+# include <strings.h>
+#endif /* HAVE_STRING_H */
+
+char *
+DEFUN(strsep, (stringp, delim),
+ char **stringp AND CONST char *delim)
+{
+ char *begin, *end;
+
+ begin = *stringp + strspn (*stringp, delim);
+ end = *stringp + strcspn (*stringp, delim);
+
+ if (end == *stringp)
+ return NULL;
+
+ if (*end != '\0')
+ *end++ = '\0';
+ *stringp = end;
+
+ return begin;
+}
diff --git a/lib/strspn.c b/lib/strspn.c
new file mode 100644
index 00000000..d8412b0c
--- /dev/null
+++ b/lib/strspn.c
@@ -0,0 +1,52 @@
+/* Copyright (C) 1991 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; 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 "ansidecl.h"
+
+#if defined (HAVE_STRING_H)
+# include <string.h>
+#elif defined (HAVE_STRINGS_H)
+# include <strings.h>
+#endif /* HAVE_STRING_H */
+
+/* Return the length of the maximum initial segment
+ of S which contains only characters in ACCEPT. */
+size_t
+DEFUN(strspn, (s, accept), CONST char *s AND CONST char *accept)
+{
+ register CONST char *p;
+ register CONST char *a;
+ register size_t count = 0;
+
+ for (p = s; *p != '\0'; ++p)
+ {
+ for (a = accept; *a != '\0'; ++a)
+ if (*p == *a)
+ break;
+ if (*a == '\0')
+ return count;
+ else
+ ++count;
+ }
+
+ return count;
+}
diff --git a/lib/strstr.c b/lib/strstr.c
new file mode 100644
index 00000000..d4444c79
--- /dev/null
+++ b/lib/strstr.c
@@ -0,0 +1,65 @@
+/* Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+This file is part of the GNU C Library.
+
+The GNU C Library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Library General Public License as
+published by the Free Software Foundation; either version 2 of the
+License, or (at your option) any later version.
+
+The GNU C Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Library General Public License for more details.
+
+You should have received a copy of the GNU Library General Public
+License along with the GNU C Library; 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 "ansidecl.h"
+#include <stddef.h>
+
+#if defined (HAVE_STRING_H)
+# include <string.h>
+#elif defined (HAVE_STRINGS_H)
+# include <strings.h>
+#endif /* HAVE_STRING_H */
+
+/* Return the first ocurrence of NEEDLE in HAYSTACK. */
+char *
+DEFUN(strstr, (haystack, needle),
+ CONST char *CONST haystack AND
+ CONST char *CONST needle)
+{
+ register CONST char *CONST needle_end = strchr(needle, '\0');
+ register CONST char *CONST haystack_end = strchr(haystack, '\0');
+ register CONST size_t needle_len = needle_end - needle;
+ register CONST size_t needle_last = needle_len - 1;
+ register CONST char *begin;
+
+ if (needle_len == 0)
+ return (char *) haystack; /* ANSI 4.11.5.7, line 25. */
+ if ((size_t) (haystack_end - haystack) < needle_len)
+ return NULL;
+
+ for (begin = &haystack[needle_last]; begin < haystack_end; ++begin)
+ {
+ register CONST char *n = &needle[needle_last];
+ register CONST char *h = begin;
+
+ do
+ if (*h != *n)
+ goto loop; /* continue for loop */
+ while (--n >= needle && --h >= haystack);
+
+ return (char *) h;
+
+ loop:;
+ }
+
+ return NULL;
+}
diff --git a/lib/tempnam.c b/lib/tempnam.c
new file mode 100644
index 00000000..c7cd4f20
--- /dev/null
+++ b/lib/tempnam.c
@@ -0,0 +1,107 @@
+/*
+ * tempnam.c: generate file name for temporary files
+ *
+ * Copyright (C), 1994, 1995, Carl Edman
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+
+#if defined(STDC_HEADERS)
+# include <string.h>
+# include <stdlib.h>
+#elif defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#else /* no string(s) header */
+extern char *strchr(), *strcat(), *getenv();
+#endif /* STDC_HEADERS */
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#if HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#define TEMPNAM_PFX ""
+
+static int isokdir(char *name)
+ {
+ struct stat buf;
+
+ if (name==NULL) return 0;
+ if (access(name, R_OK|W_OK|X_OK)==-1) return 0;
+ if (stat(name,&buf)==-1) return 0;
+ if (buf.st_mode&S_IFDIR==0) return 0;
+
+ return 1;
+ }
+
+/* return filename for temporary file */
+char *tempnam (char *dir, char *pfx)
+ {
+ int n;
+ struct timeval tp;
+ struct timezone tzp;
+ char *ret;
+
+ if (!isokdir(dir)) dir=NULL;
+
+ if (dir==NULL)
+ {
+ dir=getenv("TMPDIR");
+ if (!isokdir(dir)) dir=NULL;
+ }
+
+#ifdef P_tmpdir
+ if (dir==NULL)
+ {
+ dir=P_tmpdir;
+ if (!isokdir(dir)) dir=NULL;
+ }
+#endif
+
+ if (dir==NULL)
+ {
+ dir="/tmp";
+ if (!isokdir(dir)) dir=NULL;
+ }
+
+ if (dir==NULL) return NULL;
+
+ if (pfx==NULL) pfx=TEMPNAM_PFX;
+
+ ret=malloc(strlen(dir)+1+strlen(pfx)+8+1);
+ if (ret==NULL) return NULL;
+
+ n=getpid();
+ sprintf(ret,"%s/%s%08d",dir,pfx,n);
+
+ while (access(ret,F_OK)!=-1)
+ {
+ char number[11];
+ gettimeofday(&tp,&tzp);
+ sprintf(number,"%d",n^tp.tv_usec^tp.tv_sec);
+ sprintf(ret,"%s/%s%08.8s",dir,pfx,number);
+ }
+
+ return ret;
+ }
diff --git a/lib/waitpid.c b/lib/waitpid.c
new file mode 100644
index 00000000..bb3f95d5
--- /dev/null
+++ b/lib/waitpid.c
@@ -0,0 +1,32 @@
+/* waitpid -- emulate waitpid with wait3
+ Copyright (C) 1995 Carl Edman
+
+This file is part of the libiberty library.
+Libiberty 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.
+
+Libiberty is distributed in the hope that 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 libiberty; 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
+
+#include <sys/types.h>
+#include <sys/resource.h>
+#include <sys/wait.h>
+
+int waitpid(int pid, int *statusp, int options)
+ {
+ if (pid==-1 || pid==0) return wait3((union wait *)statusp,options,0);
+ return wait4(pid>0 ? pid : -pid,(union wait *)statusp,options,0);
+ }
diff --git a/lib/xmalloc.c b/lib/xmalloc.c
new file mode 100644
index 00000000..144efb62
--- /dev/null
+++ b/lib/xmalloc.c
@@ -0,0 +1,95 @@
+/* xmalloc.c -- malloc with out of memory checking
+ Copyright (C) 1990, 91, 92, 93, 94 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#if __STDC__
+#define VOID void
+#else
+#define VOID char
+#endif
+
+#include <sys/types.h>
+
+#if STDC_HEADERS
+#include <stdlib.h>
+#else
+VOID *malloc ();
+VOID *realloc ();
+void free ();
+#endif
+
+#ifndef EXIT_FAILURE
+#define EXIT_FAILURE 1
+#endif
+
+/* Exit value when the requested amount of memory is not available.
+ The caller may set it to some other value. */
+int xmalloc_exit_failure = EXIT_FAILURE;
+
+#if __STDC__ && (HAVE_VPRINTF || HAVE_DOPRNT)
+void error (int, int, const char *, ...);
+#else
+void error ();
+#endif
+
+static VOID *
+fixup_null_alloc (n)
+ size_t n;
+{
+ VOID *p;
+
+ p = 0;
+ if (n == 0)
+ p = malloc ((size_t) 1);
+ if (p == 0)
+ error (xmalloc_exit_failure, 0, "memory exhausted");
+ return p;
+}
+
+/* Allocate N bytes of memory dynamically, with error checking. */
+
+VOID *
+xmalloc (n)
+ size_t n;
+{
+ VOID *p;
+
+ p = malloc (n);
+ if (p == 0)
+ p = fixup_null_alloc (n);
+ return p;
+}
+
+/* Change the size of an allocated block of memory P to N bytes,
+ with error checking.
+ If P is NULL, run xmalloc. */
+
+VOID *
+xrealloc (p, n)
+ VOID *p;
+ size_t n;
+{
+ if (p == 0)
+ return xmalloc (n);
+ p = realloc (p, n);
+ if (p == 0)
+ p = fixup_null_alloc (n);
+ return p;
+}
diff --git a/lib/xstrdup.c b/lib/xstrdup.c
new file mode 100644
index 00000000..44c9b4af
--- /dev/null
+++ b/lib/xstrdup.c
@@ -0,0 +1,44 @@
+/* xstrdup.c -- copy a string with out of memory checking
+ Copyright (C) 1990 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
+#include <string.h>
+#else
+#include <strings.h>
+#endif
+
+#if __STDC__
+#define VOID void
+#else
+#define VOID char
+#endif
+
+VOID *xmalloc ();
+
+/* Return a newly allocated copy of STRING. */
+
+char *
+xstrdup (string)
+ char *string;
+{
+ if ( ! string ) return 0;
+ return strcpy (xmalloc (strlen (string) + 1), string);
+}
diff --git a/libdb/COPYING.LIB b/libdb/COPYING.LIB
new file mode 100644
index 00000000..bbe3fe19
--- /dev/null
+++ b/libdb/COPYING.LIB
@@ -0,0 +1,481 @@
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL. It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it. You can use it for
+your libraries, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library. If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software. To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+ Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs. This
+license, the GNU Library General Public License, applies to certain
+designated libraries. This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+ The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it. Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program. However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+ Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries. We
+concluded that weaker conditions might promote sharing better.
+
+ However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves. This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them. (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.) The hope is that this
+will lead to faster development of free libraries.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+ Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+
+ GNU LIBRARY GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License"). Each licensee is
+addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ c) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ d) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ 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; if not, write to the Free
+ Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
diff --git a/libdb/Makefile.in b/libdb/Makefile.in
new file mode 100644
index 00000000..376ead54
--- /dev/null
+++ b/libdb/Makefile.in
@@ -0,0 +1,90 @@
+# Database library Makefile for the man package.
+#
+# Copyright (C) 1994, 1995, Graeme Wilford.
+#
+# You may distribute under the terms of the GNU General Public
+# License as specified in the COPYING file that comes with this
+# distribution.
+#
+# Wed June 6 15:44:47 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk):
+
+library = libmandb.a
+
+srcdir = @srcdir@
+VPATH = @srcdir@
+top_srcdir = @top_srcdir@
+
+include ../include/Defines
+
+.PHONY: $(DEFAULT_TARGETS)
+
+# The default programs to build
+ALL = db_store.o db_delete.o db_lookup.o \
+ db_ver.o db_btree.o db_gdbm.o db_ndbm.o
+
+# This is just to make sure that things are done in the right order
+ifeq ($(nls),on)
+all:
+ $(make_in_root)
+else
+
+# The default programs to build
+all: $(library)
+
+# If we want any kind of NLS message catalogue support, nls must != off
+# this is exported from the master Makefile.
+ ifneq ($(nls),off)
+NLS = -DNLS
+
+MSGS = db_store.m db_delete.m db_lookup.m db_ver.m
+MSG_PATHS = $(addprefix $(MSG_DIR)/, $(MSGS))
+
+local_gencat = ../gencat/gencat
+
+$(srcdir)/man_db-nls.h: $(srcdir)/stamp-h
+$(srcdir)/stamp-h: $(MSG_PATHS)
+ test -f $(gencat) || $(MAKE) -C ../gencat
+ $(gencat) -new /dev/null $^ -h $(srcdir)/man_db-nls.h
+ rm -f $@
+ date > $@
+
+$(MSG_PATHS): $(MSG_DIR)/%.m: $(srcdir)/%.c
+ test -f ../xcat/xcat || $(MAKE) -C ../xcat
+ ../xcat/xcat $(top_srcdir)/xcat/Register < $< > $@
+
+ endif
+endif
+
+override CPPFLAGS := $(DEFS) $(NLS) -I../include -I$(top_srcdir) \
+ -I$(srcdir) -I- $(CPPFLAGS)
+
+
+$(library): $(library)($(ALL))
+ -$(RANLIB) $@
+
+# The standard targets
+install uninstall:
+
+clean mostlyclean:
+ rm -f *~ core $(ALL) $(library)
+
+distclean: clean
+ rm -f *.d Makefile
+
+realclean: distclean
+ rm -f tags stamp-h
+
+TAGS:
+ $(MKTAGS) $(srcdir)/*.[ch]
+
+# These lines sort out proper dependencies, done if --enable-debug
+# passed to configure. To override uncomment the following line.
+#debug=on
+ifneq ($(clean),yes)
+
+ ifeq ($(debug),on)
+ SRCS = $(notdir $(wildcard $(srcdir)/*.c))
+ include $(SRCS:.c=.d)
+ endif
+
+endif
diff --git a/libdb/README b/libdb/README
new file mode 100644
index 00000000..894d7956
--- /dev/null
+++ b/libdb/README
@@ -0,0 +1,7 @@
+This directory contains the database management routines required by the
+man_db package.
+
+* You may distribute under the terms of the GNU Library General Public
+* License as specified in the file COPYING.LIB that comes with the man
+* distribution.
+
diff --git a/libdb/db_btree.c b/libdb/db_btree.c
new file mode 100644
index 00000000..51ef8834
--- /dev/null
+++ b/libdb/db_btree.c
@@ -0,0 +1,333 @@
+/*
+ * db_btree.c: low level btree interface routines for man.
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU Library General Public
+ * License as specified in the file COPYING.LIB that comes with this
+ * distribution.
+ *
+ * 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 */
+
+/* below this line are routines only useful for the BTREE interface */
+#ifdef BTREE
+
+#include <stdio.h>
+
+#if HAVE_SYS_FILE_H
+# include <sys/file.h> /* for flock() */
+#endif
+
+#include <sys/types.h> /* for open() */
+#include <sys/stat.h>
+
+#if HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#include "manconfig.h"
+#include "lib/error.h"
+#include "lib/flock.h"
+#include "mydbm.h"
+#include "db_storage.h"
+
+/* the Berkeley database libraries do nothing to arbitrate between concurrent
+ database accesses, so we do a simple flock(). If the db is opened in
+ anything but O_RDONLY mode, an exclusive lock is enabled. Otherwise, the
+ lock is shared. A file cannot have both locks at once, and the non
+ blocking method is used ": Try again". This adopts GNU dbm's approach. */
+
+#ifdef FAST_BTREE
+#define B_FLAGS R_DUP /* R_DUP: allow duplicates in tree */
+
+void test_insert(int line, const datum key, const datum cont)
+{
+ fprintf(stderr, "(%d) key: \"%s\", cont: \"%.40s\"\n", line, key.dptr,
+ cont.dptr);
+}
+#else /* !FAST_BTREE */
+#define B_FLAGS 0 /* do not allow any duplicate keys */
+#endif /* FAST_BTREE */
+
+/* release the lock and close the database */
+int btree_close(DB *dbf)
+{
+ (void) flock((dbf->fd)(dbf), LOCK_UN);
+ return (dbf->close)(dbf);
+}
+
+/* open a btree type database, with file locking. */
+DB *btree_flopen(char *filename, int flags, int mode)
+{
+ DB *dbf;
+ BTREEINFO b;
+ int lock_op;
+ int lock_failed;
+
+ b.flags = B_FLAGS;
+
+ b.cachesize = 0; /* default size */
+ b.maxkeypage = 0; /* default */
+ b.minkeypage = 0; /* default */
+ b.psize = 0; /* default page size (2048?) */
+ b.compare = NULL; /* builtin compare() function */
+ b.prefix = NULL; /* builtin function */
+ b.lorder = 0; /* byte order of host */
+
+ if (flags & ~O_RDONLY) {
+ /* flags includes O_RDWR or O_WRONLY, need an exclusive lock */
+ lock_op = LOCK_EX | LOCK_NB;
+ } else {
+ lock_op = LOCK_SH | LOCK_NB;
+ }
+
+ if (flags & O_TRUNC) {
+ /* opening the db is destructive, need to lock first */
+ int fd;
+
+ dbf = NULL;
+ lock_failed = 1;
+ fd = open (filename, flags & ~O_TRUNC, mode);
+ if (fd != -1) {
+ if (!(lock_failed = flock (fd, lock_op)))
+ dbf = dbopen(filename, flags, mode, DB_BTREE, &b);
+ close (fd);
+ }
+ } else {
+ dbf = dbopen(filename, flags, mode, DB_BTREE, &b);
+ if (dbf)
+ lock_failed = flock((dbf->fd)(dbf), lock_op);
+ }
+
+ if (!dbf)
+ return NULL;
+
+ if (lock_failed) {
+ gripe_lock(filename);
+ btree_close(dbf);
+ return NULL;
+ }
+
+ return dbf;
+}
+
+/* do a replace when we have the duplicate flag set on the database -
+ we must do a del and insert, as a direct insert will not wipe out the
+ old entry */
+int btree_replace(DB *dbf, datum key, datum cont)
+{
+#ifdef FAST_BTREE
+ test_insert(__LINE__, key, cont);
+ return (dbf->put)(dbf, (DBT *) &key, (DBT *) &cont, R_CURSOR);
+#else /* normal BTREE */
+ return (dbf->put)(dbf, (DBT *) &key, (DBT *) &cont, 0);
+#endif /* FAST_BTREE */
+}
+
+int btree_insert(DB *dbf, datum key, datum cont)
+{
+ return (dbf->put)(dbf, (DBT *) &key, (DBT *) &cont, R_NOOVERWRITE);
+}
+
+/* generic fetch routine for the btree database */
+datum btree_fetch(DB *dbf, datum key)
+{
+ datum data;
+
+ if ((dbf->get)(dbf, (DBT *) &key, (DBT *) &data, 0)) {
+ data.dptr = NULL;
+ data.dsize = 0;
+ return data;
+ }
+
+ return copy_datum(data);
+}
+
+/* return 1 if the key exists, 0 otherwise */
+int btree_exists(DB *dbf, datum key)
+{
+ datum data;
+ return ( (dbf->get)(dbf, (DBT *) &key, (DBT *) &data, 0) ? 0 : 1);
+}
+
+/* initiate a sequential access */
+static __inline__ datum btree_findkey(DB *dbf, u_int flags)
+{
+ datum key, data;
+
+ if (((dbf->seq)(dbf, (DBT *) &key, (DBT *) &data, flags))) {
+ key.dptr = NULL;
+ key.dsize = 0;
+ return key;
+ }
+
+ return copy_datum(key);
+}
+
+/* return the first key in the db */
+datum btree_firstkey(DB *dbf)
+{
+ return btree_findkey(dbf, R_FIRST);
+}
+
+/* return the next key in the db. NB. This routine only works if the cursor
+ has been previously set by btree_firstkey() since it was last opened. So
+ if we close/reopen a db mid search, we have to manually set up the
+ cursor again. */
+datum btree_nextkey(DB *dbf)
+{
+ return btree_findkey(dbf, R_NEXT);
+}
+
+/* compound nextkey routine, initialising key and content */
+int btree_nextkeydata(DB *dbf, datum *key, datum *cont)
+{
+ int status;
+
+ if ((status = (dbf->seq)(dbf, (DBT *) key, (DBT *) cont, R_NEXT)) != 0)
+ return status;
+
+ *key = copy_datum(*key);
+ *cont = copy_datum(*cont);
+
+ return 0;
+}
+
+#ifdef FAST_BTREE
+
+/* EXTREMELY experimental and broken code, leave well alone for the time
+ being */
+
+#define free(x)
+
+void gripe_get(int lineno)
+{
+ error (0, 0, "Oops, bad fetch, line %d ", lineno);
+}
+
+/* the simplified storage routine */
+int dbstore(struct mandata *in, char *basename)
+{
+ datum key, cont;
+ int status;
+
+ key.dsize = strlen(basename) + 1;
+
+ if (key.dsize == 1) {
+ if (debug)
+ dbprintf(in);
+ return 2;
+ }
+
+ key.dptr = basename;
+
+ /* initialise the cursor to (possibly) our key/cont */
+ status = (dbf->seq)(dbf, (DBT *) &key, (DBT *) &cont, R_CURSOR);
+
+ if (status == -1)
+ gripe_get(__LINE__);
+
+ /* either nothing was found or the key was not an exact match */
+ else if (status == 1 || strcmp(key.dptr, basename) != 0) {
+ cont = make_content(in);
+ key.dptr = basename;
+ key.dsize = strlen(basename) + 1;
+ test_insert(__LINE__, key, cont);
+ status = (dbf->put)(dbf, (DBT *) &key, (DBT *) &cont, 0);
+ free(cont.dptr);
+
+ /* There is already a key with this name */
+ } else {
+ /* find an exact match and see if it needs replacing or put
+ our new key in */
+ while (1) {
+ struct mandata old;
+
+ cont = copy_datum(cont);
+ split_content(cont.dptr, &old);
+ if (strcmp(in->ext, old.ext) == 0) {
+ cont = make_content(in);
+ status = replace_if_necessary(in, &old, key, cont);
+ free(cont.dptr);
+ free(old.addr);
+ break;
+ }
+ free(old.addr);
+ status = (dbf->seq)(dbf, (DBT *) &key, (DBT *) &cont, R_NEXT);
+ if (strcmp(key.dptr, basename) != 0) {
+ key.dptr = basename;
+ key.dsize = strlen(basename) + 1;
+ cont = make_content(in);
+ test_insert(__LINE__, key, cont);
+ status = (dbf->put)(dbf, (DBT *) &key,
+ (DBT *) &cont, 0);
+ free(cont.dptr);
+ break;
+ }
+ }
+ }
+
+ return status;
+}
+
+/* FIXME: I'm broken as I don't return properly */
+static struct mandata *dblookup(char *page, char *section, int flags)
+{
+ struct mandata *info, *ret = NULL, **null_me;
+ datum key, cont;
+ int status;
+
+ key.dptr = page;
+ key.dsize = strlen(page) + 1;
+
+ /* initialise the cursor to (possibly) our key/cont */
+ status = (dbf->seq)(dbf, (DBT *) &key, (DBT *) &cont, R_CURSOR);
+
+ /* either nothing was found or the key was not an exact match */
+ if (status == 1 || strcmp(page, key.dptr) != 0)
+ return NULL;
+ if (status == -1)
+ gripe_get(__LINE__);
+
+ ret = info = infoalloc();
+ null_me = &(info->next);
+
+ do {
+ cont = copy_datum(cont);
+ split_content(cont.dptr, info);
+
+ if ( !(section == NULL ||
+ strncmp(section, info->ext,
+ flags & EXACT ? strlen(info->ext)
+ : strlen(section)) == 0) ) {
+ free(info->addr);
+ } else {
+ null_me = &(info->next);
+ info = (info->next = infoalloc());
+ }
+
+ /* get next in the db */
+ status = (dbf->seq)(dbf, (DBT *) &key, (DBT *) &cont, R_NEXT);
+
+ if (status == -1)
+ gripe_get(__LINE__);
+
+ /* run out of identical keys */
+ } while ( !(status == 1 || strcmp(page, key.dptr) != 0) );
+
+ free(info);
+ *null_me = NULL;
+ return ret;
+}
+
+#endif /* FAST_BTREE */
+#endif /* BTREE */
diff --git a/libdb/db_delete.c b/libdb/db_delete.c
new file mode 100644
index 00000000..8d218a2e
--- /dev/null
+++ b/libdb/db_delete.c
@@ -0,0 +1,142 @@
+/*
+ * db_delete.c: dbdelete(), database delete routine.
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU Library General Public
+ * License as specified in the file COPYING.LIB that comes with this
+ * distribution.
+ *
+ * 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 <stdio.h>
+#include <assert.h>
+
+#if defined(STDC_HEADERS)
+#include <string.h>
+#include <stdlib.h>
+#elif defined(HAVE_STRING_H)
+#include <string.h>
+#elif defined(HAVE_STRINGS_H)
+#include <strings.h>
+#else /* no string(s) header file */
+extern char *strtok();
+extern char *strsep();
+#endif /* STDC_HEADERS */
+
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#ifndef STDC_HEADERS
+extern long atol();
+extern char *strsep();
+#endif /* not STDC_HEADERS */
+
+#define NLS_SET db_deleteSet
+#include <libintl.h>
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+#include "lib/error.h"
+#include "mydbm.h"
+#include "db_storage.h"
+
+/* Delete an entry for a page.
+ Again, 3 possibilities:
+
+ 1) page is singular reference, just delete it :)
+ 2) page has 2+ companions. Delete page and alter multi entry to not
+ point to it anymore.
+ 3) page has 1 companion. Could do as (2), but we'd waste an entry in
+ the db. Should delete page, extract friend and reinsert as singular,
+ overwriting the old multi entry.
+*/
+
+#define NO_ENTRY 1;
+
+int dbdelete(char *name, struct mandata *info)
+{
+ datum key, cont;
+
+ /* get entry for info */
+
+ if (debug)
+ fprintf(stderr, "Attempting delete of %s(%s) entry.\n",
+ name, info->ext);
+
+ key.dptr = name;
+ key.dsize = strlen(key.dptr) + 1;
+ cont = MYDBM_FETCH(dbf, key);
+
+ if (!cont.dptr) { /* 0 entries */
+ return NO_ENTRY;
+ } else if (*cont.dptr != '\t') { /* 1 entry */
+ MYDBM_DELETE(dbf, key);
+ MYDBM_FREE(cont.dptr);
+ } else { /* 2+ entries */
+ char *ext[ENTRIES], **e;
+ char *multi_content = NULL;
+ datum multi_key;
+ int refs;
+
+ /* Extract all of the extensions associated with
+ this key */
+
+ refs = list_extensions(cont.dptr + 1, e = ext);
+
+ while (*e && strcmp(*e, info->ext) != 0)
+ e++;
+
+ if (!*e) {
+ MYDBM_FREE(cont.dptr);
+ return NO_ENTRY;
+ }
+
+ multi_key = make_multi_key(name, *e);
+ if (!MYDBM_EXISTS(dbf, multi_key)) {
+ error (0, 0,
+ _( "multi key %s does not exist"),
+ multi_key.dptr);
+ gripe_corrupt_data();
+ }
+ MYDBM_DELETE(dbf, multi_key);
+ free(multi_key.dptr);
+ **e = '\0';
+
+ /* refs *may* be 1 if all manual pages with this name
+ have been deleted. In this case, we'll have to remove
+ the key too */
+
+ if (refs == 1) {
+ MYDBM_FREE(cont.dptr);
+ MYDBM_DELETE(dbf, key);
+ return 0;
+ }
+
+ /* create our new multi content */
+ for (e = ext; *e; e++) {
+ if (**e)
+ multi_content = strappend(multi_content,
+ "\t", *e, NULL);
+ }
+
+ MYDBM_FREE(cont.dptr);
+
+ /* if refs = 2 do something else. Doesn't really matter as
+ the gdbm db file does not shrink any after a deletion
+ anyway */
+
+ cont.dptr = multi_content;
+ cont.dsize = strlen(cont.dptr) + 1;
+
+ if (MYDBM_REPLACE(dbf, key, cont))
+ gripe_replace_key(key.dptr);
+ }
+ return 0;
+}
diff --git a/libdb/db_gdbm.c b/libdb/db_gdbm.c
new file mode 100644
index 00000000..2a920ffb
--- /dev/null
+++ b/libdb/db_gdbm.c
@@ -0,0 +1,38 @@
+/*
+ * db_gdbm.c: low level gdbm interface routines for man.
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU Library General Public
+ * License as specified in the file COPYING.LIB that comes with this
+ * distribution.
+ *
+ * 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 */
+
+#if defined(GDBM) && !defined(HAVE_GDBM_EXISTS)
+
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+#endif /* STDC_HEADERS */
+
+#include "manconfig.h"
+#include "mydbm.h"
+
+int gdbm_exists(GDBM_FILE dbf, datum key)
+{
+ char *memory;
+
+ memory = gdbm_fetch(dbf, key).dptr;
+ if (memory) {
+ free(memory);
+ return 1;
+ }
+
+ return 0;
+}
+#endif /* GDBM && !HAVE_GDBM_EXISTS*/
diff --git a/libdb/db_lookup.c b/libdb/db_lookup.c
new file mode 100644
index 00000000..74e42979
--- /dev/null
+++ b/libdb/db_lookup.c
@@ -0,0 +1,342 @@
+/*
+ * db_lookup.c: low level database interface routines for man.
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU Library General Public
+ * License as specified in the file COPYING.LIB that comes with this
+ * distribution.
+ *
+ * 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 <stdio.h>
+#include <assert.h>
+#include <errno.h>
+
+#if defined(STDC_HEADERS)
+#include <string.h>
+#include <stdlib.h>
+#elif defined(HAVE_STRING_H)
+#include <string.h>
+#elif defined(HAVE_STRINGS_H)
+#include <strings.h>
+#else /* no string(s) header file */
+extern char *strtok();
+extern char *strsep();
+#endif /* STDC_HEADERS */
+
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#ifndef STDC_HEADERS
+extern long atol();
+extern char *strsep();
+extern int errno;
+#endif /* not STDC_HEADERS */
+
+#define NLS_SET db_lookupSet
+
+#include <libintl.h>
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+#include "lib/error.h"
+#include "mydbm.h"
+#include "db_storage.h"
+
+/* If using ndbm or BTREE, copy the static storage before doing anything
+ interesting with it */
+#if defined(NDBM) || defined (BTREE)
+datum copy_datum (datum dat)
+{
+ if (dat.dptr)
+ dat.dptr = memcpy (xmalloc (dat.dsize), dat.dptr, dat.dsize);
+ return dat;
+}
+
+void gripe_lock(char *filename)
+{
+ error (0, errno,
+ _( "can't lock index cache %s"),
+ filename);
+}
+#endif /* NDBM || BTREE */
+
+/* issue fatal message, then exit */
+void gripe_corrupt_data(void)
+{
+ error (FATAL, 0,
+ _( "index cache %s corrupt"),
+ database);
+}
+
+/* deal with situation where we cannot replace a key */
+void gripe_replace_key(char *data)
+{
+ error (0, 0,
+ _( "cannot replace key %s"),
+ data);
+ gripe_corrupt_data();
+}
+
+/* Just print out what would be stored in the db */
+void dbprintf(struct mandata *info)
+{
+ fprintf(stderr,
+ "sec. ext: %s\n"
+ "section: %s\n"
+ "comp. ext: %s\n"
+ "id: %c\n"
+ "st_mtime %ld\n"
+ "pointer: %s\n"
+ "filter: %s\n"
+ "whatis: %s\n\n",
+ info->ext, info->sec, info->comp,
+ info->id, (long)info->_st_mtime,
+ info->pointer, info->filter, info->whatis);
+}
+
+/* Form a multi-style key from page and extension info */
+datum make_multi_key(char *page, char *ext)
+{
+ datum key;
+
+ key.dsize = strlen(page) + strlen(ext) + 2;
+ key.dptr = (char *) xmalloc (key.dsize);
+ sprintf(key.dptr, "%s\t%s", page, ext);
+ return key;
+}
+
+/* allocate a mandata structure */
+struct mandata *infoalloc(void)
+{
+ return (struct mandata *) xmalloc (sizeof(struct mandata));
+}
+
+/* go through the linked list of structures, free()ing the `content' and the
+ structs themselves */
+void free_mandata_struct(struct mandata *pinfo)
+{
+ while(pinfo) {
+ struct mandata *next;
+
+ next = pinfo->next;
+ if (pinfo->addr)
+ free(pinfo->addr); /* free the `content' */
+ free(pinfo); /* free the structure */
+ pinfo = next;
+ }
+}
+
+/* return char ptr array to the data's fields */
+char **split_data(char *content, char *start[])
+{
+ int count;
+
+ /* initialise pointers to first N-1 fields */
+ for (count = 0; count < FIELDS - 1 ; count++) {
+ start[count] = strsep(&content, "\t");
+ if (!start[count]) {
+ error (0, 0,
+ _( "only %d fields in content"),
+ count);
+ gripe_corrupt_data();
+ }
+ }
+
+ /* initialise pointer to Nth field (whatis) */
+ start[FIELDS - 1] = content;
+
+ return start;
+}
+
+/* Parse the db-returned data and put it into a mandata format */
+void split_content(char *cont_ptr, struct mandata *pinfo)
+{
+ char *start[FIELDS];
+ char **data;
+
+ data = split_data(cont_ptr, start);
+
+ pinfo->ext = *(data++);
+ pinfo->sec = *(data++);
+ pinfo->_st_mtime = (time_t) atol(*(data++)); /* time_t format */
+ pinfo->id = **(data++); /* single char id */
+ pinfo->pointer = *(data++);
+ pinfo->filter = *(data++);
+ pinfo->comp = *(data++);
+ pinfo->whatis = *(data);
+
+ pinfo->addr = cont_ptr;
+ pinfo->next = (struct mandata *) NULL;
+}
+
+/* The compliment of split_content */
+datum make_content(struct mandata *in)
+{
+ datum cont;
+ static char dash[] = "-";
+
+ if (!in->pointer)
+ in->pointer = dash;
+ if (!in->filter)
+ in->filter = dash;
+ if (!in->comp)
+ in->comp = dash;
+ if (!in->whatis)
+ in->whatis = dash + 1;
+
+ cont.dsize = strlen(in->ext) +
+ strlen(in->sec) +
+ /* strlen(in->_st_mtime) */ + 11 +
+ /* strlen(in->id) */ + 1 +
+ strlen(in->pointer) +
+ strlen(in->filter) +
+ strlen(in->comp) +
+ strlen(in->whatis) + 7;
+ cont.dptr = (char *) xmalloc (cont.dsize);
+#ifdef ANSI_SPRINTF
+ cont.dsize = 1 + sprintf(cont.dptr, "%s\t%s\t%ld\t%c\t%s\t%s\t%s\t%s",
+ in->ext,
+ in->sec,
+ in->_st_mtime,
+ in->id,
+ in->pointer,
+ in->filter,
+ in->comp,
+ in->whatis);
+
+ assert(strlen(cont.dptr) + 1 == cont.dsize);
+#else /* !ANSI_SPRINTF */
+ sprintf(cont.dptr, "%s\t%s\t%ld\t%c\t%s\t%s\t%s\t%s",
+ in->ext,
+ in->sec,
+ (long)in->_st_mtime,
+ in->id,
+ in->pointer,
+ in->filter,
+ in->comp,
+ in->whatis);
+
+ cont.dsize = strlen(cont.dptr) + 1; /* to be sure (st_mtime) */
+#endif /* ANSI_SPRINTF */
+
+#ifdef NDBM
+ /* limit of 4096 bytes of data using ndbm */
+ if (cont.dsize > 4095) {
+ cont.dptr[4095] = '\0';
+ cont.dsize = 4096;
+ }
+#endif
+ return cont;
+}
+
+/* Extract all of the extensions associated with this key */
+int list_extensions(char *data, char *ext[])
+{
+ int count = 0;
+
+ while ( (ext[count] = strsep(&data, "\t")) )
+ count++;
+
+ if (debug)
+ fprintf(stderr, "found %d extensions\n", count);
+ return count;
+}
+
+#define EXACT 1
+#define ALL 0
+
+/*
+ There are three possibilities on lookup:
+
+ 1) No data exists, lookup will fail, returned structure will be NULL.
+ 2) One data item exists. Item is returned as first in set of structures.
+ 3) Many items exist. They are all returned, in a multiple structure set.
+ */
+#ifndef FAST_BTREE
+static struct mandata *dblookup(char *page, char *section, int flags)
+{
+ struct mandata *info = NULL;
+ datum key, cont;
+
+ key.dptr = page;
+ key.dsize = strlen(page) + 1;
+ cont = MYDBM_FETCH(dbf, key);
+
+ if (cont.dptr == NULL) { /* No entries at all */
+ return info; /* indicate no entries */
+ } else if (*cont.dptr != '\t') { /* Just one entry */
+ info = infoalloc();
+ split_content(cont.dptr, info);
+ if (section == NULL ||
+ strncmp(section, info->ext,
+ flags & EXACT ? strlen(info->ext) :
+ strlen(section)) == 0) {
+ return info;
+ }
+ free_mandata_struct(info);
+ return NULL;
+ } else { /* multiple entries */
+ char *ext[ENTRIES], **e;
+ struct mandata *ret = NULL;
+
+ /* Extract all of the extensions associated with this key */
+
+ (void) list_extensions(cont.dptr + 1, e = ext);
+
+ /* Make the multi keys and look them up */
+
+ while (*e) {
+ if (section == NULL ||
+ strncmp(section, *e,
+ flags & EXACT ? strlen(*e)
+ : strlen(section)) == 0) {
+ datum multi_cont;
+
+ key = make_multi_key(page, *e);
+ if (debug)
+ fprintf(stderr,
+ "multi key lookup (%s)\n",
+ key.dptr);
+ multi_cont = MYDBM_FETCH(dbf, key);
+ if (multi_cont.dptr == NULL) {
+ error (0, 0,
+ _(
+ "bad fetch on multi key %s"),
+ key.dptr);
+ gripe_corrupt_data();
+ }
+ free(key.dptr);
+
+ /* allocate info struct, fill it in and
+ point info to the next in the list */
+ if (!ret)
+ ret = info = infoalloc();
+ else
+ info = info->next = infoalloc();
+ split_content(multi_cont.dptr, info);
+ }
+ e++;
+ }
+ MYDBM_FREE(cont.dptr);
+ return ret;
+ }
+}
+#endif /* !FAST_BTREE */
+
+struct mandata *dblookup_all(char *page, char *section)
+{
+ return dblookup(page, section, ALL);
+}
+
+struct mandata *dblookup_exact(char *page, char *section)
+{
+ return dblookup(page, section, EXACT);
+}
diff --git a/libdb/db_ndbm.c b/libdb/db_ndbm.c
new file mode 100644
index 00000000..fae80f7f
--- /dev/null
+++ b/libdb/db_ndbm.c
@@ -0,0 +1,101 @@
+/*
+ * db_ndbm.c: low level ndbm interface routines for man.
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU Library General Public
+ * License as specified in the file COPYING.LIB that comes with this
+ * distribution.
+ *
+ * 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 */
+
+#ifdef NDBM
+
+#include <stdio.h>
+
+#if HAVE_SYS_FILE_H
+# include <sys/file.h> /* for flock() */
+#endif
+
+#include <sys/types.h> /* for open() */
+#include <sys/stat.h>
+
+#if HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#endif /* STDC_HEADERS */
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#include "manconfig.h"
+#include "lib/flock.h"
+#include "mydbm.h"
+#include "db_storage.h"
+
+/* release the lock and close the database */
+int ndbm_flclose(DBM *dbf)
+{
+ flock(dbm_dirfno(dbf), LOCK_UN);
+ dbm_close(dbf);
+ return 0;
+}
+
+/* open a ndbm type database, with file locking. */
+DBM* ndbm_flopen(char *filename, int flags, int mode)
+{
+ DBM *dbf;
+ int lock_op;
+ int lock_failed;
+
+ if (flags & ~O_RDONLY) {
+ /* flags includes O_RDWR or O_WRONLY, need an exclusive lock */
+ lock_op = LOCK_EX | LOCK_NB;
+ } else {
+ lock_op = LOCK_SH | LOCK_NB;
+ }
+
+ if (flags & O_TRUNC) {
+ /* opening the db is destructive, need to lock first */
+ char *dir_fname;
+ int dir_fd;
+
+ dbf = NULL;
+ lock_failed = 1;
+ dir_fname = xmalloc (strlen(filename) + 5);
+ sprintf (dir_fname, "%s.dir", filename);
+ dir_fd = open (dir_fname, flags & ~O_TRUNC, mode);
+ free(dir_fname);
+ if (dir_fd != -1) {
+ if (!(lock_failed = flock (dir_fd, lock_op)))
+ dbf = dbm_open(filename, flags, mode);
+ close (dir_fd);
+ }
+ } else {
+ dbf = dbm_open(filename, flags, mode);
+ if (dbf)
+ lock_failed = flock(dbm_dirfno(dbf), lock_op);
+ }
+
+ if (!dbf)
+ return NULL;
+
+ if (lock_failed) {
+ gripe_lock(filename);
+ dbm_close(dbf);
+ return NULL;
+ }
+
+ return dbf;
+}
+
+#endif /* NDBM */
diff --git a/libdb/db_storage.h b/libdb/db_storage.h
new file mode 100644
index 00000000..53705b0c
--- /dev/null
+++ b/libdb/db_storage.h
@@ -0,0 +1,69 @@
+/*
+ * db_storage.h: define mandata structure, some macros and prototypes
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#ifndef DB_STORAGE_H
+#define DB_STORAGE_H
+
+/* These definitions give an inherent precedence to each particular type
+ of manual page:
+
+ ULT_MAN: ultimate manual page, the full source nroff file.
+ SO_MAN: source nroff file containing .so request to an ULT_MAN.
+ WHATIS_MAN: virtual `whatis referenced' page pointing to an ULT_MAN.
+ STRAY_CAT: pre-formatted manual page with no source.
+ WHATIS_CAT: virtual `whatis referenced' page pointing to a STRAY_CAT. */
+
+#define ULT_MAN 'A'
+#define SO_MAN 'B'
+#define WHATIS_MAN 'C'
+#define STRAY_CAT 'D'
+#define WHATIS_CAT 'E'
+
+#define ENTRIES 50 /* Max unique extensions per manual page name */
+#define FIELDS 8 /* No of fields in each database page `content' */
+
+#include "sys/time.h" /* for time_t */
+
+struct mandata {
+ struct mandata *next; /* ptr to next structure, if any */
+ char *addr; /* ptr to memory containing the fields */
+
+ char *ext; /* Filename ext w/o comp ext */
+ char *sec; /* Section name/number */
+ char id; /* id for this entry */
+ char *pointer; /* id related file pointer */
+ char *comp; /* Compression extension */
+ char *filter; /* filters needed for the page */
+ char *whatis; /* whatis description for page */
+ time_t _st_mtime; /* mod time for file */
+};
+
+/* used by the world */
+extern __inline__ struct mandata *dblookup_all(char *page, char *section);
+extern __inline__ struct mandata *dblookup_exact(char *page, char *section);
+extern int dbstore(struct mandata *in, char *basename);
+extern int dbdelete(char *name, struct mandata *in);
+extern void dbprintf(struct mandata *info);
+extern void free_mandata_struct(struct mandata *info);
+extern void split_content(char *cont_ptr, struct mandata *pinfo);
+
+/* local to db routines */
+extern __inline__ void gripe_lock(char *filename);
+extern __inline__ void gripe_corrupt_data(void);
+extern datum make_multi_key(char *page, char *ext);
+extern __inline__ struct mandata *infoalloc(void);
+extern char **split_data(char *content, char *start[]);
+extern datum make_content(struct mandata *in);
+extern int list_extensions(char *data, char *ext[]);
+extern void gripe_replace_key(char *data);
+
+#endif
diff --git a/libdb/db_store.c b/libdb/db_store.c
new file mode 100644
index 00000000..2ccf88d0
--- /dev/null
+++ b/libdb/db_store.c
@@ -0,0 +1,254 @@
+/*
+ * db_store.c: dbstore(), database storage routine.
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU Library General Public
+ * License as specified in the file COPYING.LIB that comes with this
+ * distribution.
+ *
+ * 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 <stdio.h>
+#include <assert.h>
+
+#if defined(STDC_HEADERS)
+#include <string.h>
+#include <stdlib.h>
+#elif defined(HAVE_STRING_H)
+#include <string.h>
+#elif defined(HAVE_STRINGS_H)
+#include <strings.h>
+#else /* no string(s) header file */
+extern char *strtok();
+extern char *strsep();
+#endif /* STDC_HEADERS */
+
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#ifndef STDC_HEADERS
+extern long atol();
+extern char *strsep();
+#endif /* not STDC_HEADERS */
+
+#define NLS_SET db_storeSet
+#include <libintl.h>
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+#include "lib/error.h"
+#include "mydbm.h"
+#include "db_storage.h"
+
+/* deal with situation where we cannot insert an unused key */
+static void gripe_insert_unused(char *data)
+{
+ error (0, 0,
+ _( "cannot insert unused key %s"),
+ data);
+ gripe_corrupt_data();
+}
+
+/* The do_we_replace logic */
+static int replace_if_necessary(struct mandata *in, struct mandata *info,
+ datum newkey, datum newcont)
+{
+#ifndef FAVOUR_STRAYCATS
+ if (in->id < info->id) {
+#else /* FAVOUR_STRAYCATS */
+ if (in->id < info->id ||
+ (in->id == STRAY_CAT && info->id == WHATIS_MAN)) {
+#endif /* !FAVOUR_STRAYCATS */
+ if (MYDBM_REPLACE(dbf, newkey, newcont))
+ gripe_replace_key(newkey.dptr);
+ } else if (in->id == info->id)
+ if (debug)
+ fprintf(stderr,
+ "ignoring identical multi key: %s\n",
+ newkey.dptr);
+
+ if (in->id == info->id &&
+ in->id == ULT_MAN) {
+ if (strcmp(in->comp ? in->comp : "-", info->comp) == 0) {
+ if (in->_st_mtime != info->_st_mtime) {
+ if (debug)
+ fprintf(stderr, "replace_if_necessary(): replace\n");
+ if (MYDBM_REPLACE(dbf, newkey, newcont))
+ gripe_replace_key(newkey.dptr);
+ }
+ return 0; /* same file */
+ } else
+ return 1; /* differing ext's */
+ }
+
+ return 0; /* not physical file anyway */
+}
+
+/*
+ Any one of three situations can occur when storing some data.
+
+ 1) no simple key is found.
+ store as singular reference.
+ 2) simple key already exists, content starts with a '\t'.
+ Already multiple reference. Add our new item in multiple format
+ and update the simple key content, to point to our new one also.
+ 3) simple key already exists, content does not start with a '\t'.
+ First we have to reformat the simple key into a multi key for the
+ old item, and insert. Then we have to insert the new data as a
+ multi key. Lastly we must create the simple key and do a replace
+ on it.
+
+ Use precedence algorithm on inserts. If we already have a key assigned
+ to the new value, check priority of page using id. If new page is higher
+ (lower value), replace old with new, otherwise ignore new page.
+
+ If we have two ULT_MAN pages competing for the same key, we must have
+ more than one of foo.sec, foo.sec.comp1, foo.sec.comp2. OR we have a
+ replacement page. If the st_mtimes differ, throw out the old struct and
+ replace it with the new, if the comp exts differ, oops, this is bad,
+ keep one and return appropriate error code.
+
+ If we have two WHATIS_MAN pages or a WHATIS_MAN and a SO_MAN page
+ competing for the same key, don't worry. This will happen a lot and is
+ not a problem.
+
+ return errorcode or 0 on success.
+*/
+#ifndef FAST_BTREE
+int dbstore(struct mandata *in, char *basename)
+{
+ datum oldkey, oldcont;
+
+ /* create a simple key */
+ oldkey.dsize = strlen(basename) + 1;
+
+ if (oldkey.dsize == 1) {
+ if (debug)
+ dbprintf(in);
+ return 2;
+ }
+
+ oldkey.dptr = basename;
+
+ /* get the content for the simple key */
+
+ oldcont = MYDBM_FETCH(dbf, oldkey);
+
+ if (oldcont.dptr == NULL) { /* situation (1) */
+ oldcont = make_content(in);
+ if (MYDBM_INSERT(dbf, oldkey, oldcont))
+ gripe_insert_unused(oldkey.dptr);
+ free(oldcont.dptr);
+ } else if (*oldcont.dptr == '\t') { /* situation (2) */
+ datum newkey, newcont;
+
+ newkey = make_multi_key(oldkey.dptr, in->ext);
+ newcont = make_content(in);
+
+ /* Try to insert the new multi data */
+
+ if (MYDBM_INSERT(dbf, newkey, newcont)) {
+ datum cont;
+ struct mandata info;
+ int ret;
+
+ MYDBM_FREE(oldcont.dptr);
+ cont = MYDBM_FETCH(dbf, newkey);
+ split_content(cont.dptr, &info);
+ ret = replace_if_necessary(in, &info, newkey, newcont);
+ /* MYDBM_FREE(cont.dptr); */
+ free(info.addr);
+ free(newkey.dptr);
+ free(newcont.dptr);
+
+ return ret;
+ }
+
+ /* Now lets add some info to the simple key's cont. */
+
+ /* This next bit needs to be done first as we'll wipe out
+ oldcont.dptr otherwise (for NDBM only!) */
+
+ free(newkey.dptr);
+ free(newcont.dptr);
+
+ newcont.dsize = oldcont.dsize + strlen(in->ext) + 1;
+ newcont.dptr = (char *) xmalloc(newcont.dsize);
+
+ sprintf(newcont.dptr, "%s\t%s", oldcont.dptr, in->ext);
+ MYDBM_FREE(oldcont.dptr);
+
+ /* Try to replace the old simple data with the new stuff */
+
+ if (MYDBM_REPLACE(dbf, oldkey, newcont))
+ gripe_replace_key(oldkey.dptr);
+
+ free(newcont.dptr);
+ } else { /* situation (3) */
+ datum newkey, newcont, lastkey, lastcont;
+ struct mandata old;
+
+ /* Extract the old singular reference */
+
+ split_content(oldcont.dptr, &old);
+
+ /* Create multi keys for both
+ and new items, create new content */
+
+ lastkey = make_multi_key(oldkey.dptr, old.ext);
+ newkey = make_multi_key(oldkey.dptr, in->ext);
+ newcont = make_content(in);
+
+ /* Check against identical multi keys before inserting
+ into db */
+
+ if (strcmp(lastkey.dptr, newkey.dptr) == 0) {
+ int ret;
+
+ ret = replace_if_necessary(in, &old, oldkey, newcont);
+ /* MYDBM_FREE(oldcont.dptr); */
+ free(old.addr);
+ free(newcont.dptr);
+ free(newkey.dptr);
+ free(lastkey.dptr);
+
+ return ret;
+ }
+
+ lastcont = make_content(&old);
+
+ if (MYDBM_INSERT(dbf, lastkey, lastcont))
+ gripe_insert_unused(lastkey.dptr);
+
+ free(lastkey.dptr);
+ free(lastcont.dptr);
+
+ if (MYDBM_INSERT(dbf, newkey, newcont))
+ gripe_insert_unused(newkey.dptr);
+
+ free(newkey.dptr);
+ free(newcont.dptr);
+
+ /* Now build a simple reference to the above two items */
+
+ newcont.dsize = strlen(old.ext) + strlen(in->ext) + 3;
+ newcont.dptr = (char *) xmalloc (newcont.dsize);
+ sprintf(newcont.dptr, "\t%s\t%s", old.ext, in->ext);
+
+ if (MYDBM_REPLACE(dbf, oldkey, newcont))
+ gripe_replace_key(oldkey.dptr);
+
+ /* MYDBM_FREE(oldcont.dptr); */
+ free(old.addr);
+ free(newcont.dptr);
+ }
+ return 0;
+}
+#endif /* !FAST_BTREE */
diff --git a/libdb/db_ver.c b/libdb/db_ver.c
new file mode 100644
index 00000000..0af99da9
--- /dev/null
+++ b/libdb/db_ver.c
@@ -0,0 +1,86 @@
+/*
+ * dbver.c: code to read, write and identify the database version no.
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU Library General Public
+ * License as specified in the file COPYING.LIB that comes with this
+ * distribution.
+ *
+ * Mon Aug 18 20:35:30 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#endif /* STDC_HEADERS */
+
+#define NLS_SET db_verSet
+#include <libintl.h>
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+#include "lib/error.h"
+#include "mydbm.h"
+
+static datum content;
+
+static int dbver(MYDBM_FILE dbf)
+{
+ datum key;
+
+ key.dptr = VER_KEY;
+ key.dsize = sizeof VER_KEY;
+
+ content = MYDBM_FETCH(dbf, key);
+
+ if (content.dptr == NULL)
+ return -1;
+ else if (strcmp(content.dptr, VER_ID) != 0)
+ return 1;
+ else
+ return 0;
+
+}
+
+void dbver_wr(MYDBM_FILE dbf)
+{
+ datum key, content;
+
+ key.dptr = VER_KEY;
+ key.dsize = sizeof VER_KEY;
+ content.dptr = VER_ID;
+ content.dsize = sizeof VER_ID;
+
+ if (MYDBM_INSERT(dbf, key, content) != 0)
+ error (FATAL, 0,
+ _(
+ "fatal: unable to insert version identifier into %s"),
+ database);
+}
+
+int dbver_rd(MYDBM_FILE dbf)
+{
+ int status;
+
+ status = dbver(dbf);
+
+ if (status == -1)
+ error (0, 0, _( "warning: %s has no version identifier"),
+ database);
+ else if (status == 1)
+ error (0, 0,
+ _( "warning: %s is version %s, expecting %s"),
+ database, content.dptr, VER_ID);
+ else {
+ MYDBM_FREE(content.dptr);
+ return 0;
+ }
+
+ return 1;
+}
diff --git a/libdb/man_db-nls.h b/libdb/man_db-nls.h
new file mode 100644
index 00000000..65074614
--- /dev/null
+++ b/libdb/man_db-nls.h
@@ -0,0 +1,18 @@
+
+#define db_verSet 0x65
+#define db_ver_WR_VERS 0x1
+#define db_ver_NO_VERS 0x2
+#define db_ver_BAD_VERS 0x3
+
+#define db_storeSet 0x66
+#define db_store_INS_UNUSED 0x1
+
+#define db_deleteSet 0x67
+#define db_delete_NO_MULTI 0x1
+
+#define db_lookupSet 0x68
+#define db_lookup_LOCK_DB 0x1
+#define db_lookup_CORRUPT 0x2
+#define db_lookup_REPLACE 0x3
+#define db_lookup_FEW_FIELDS 0x4
+#define db_lookup_BAD_MULTI 0x5
diff --git a/libdb/mydbm.h b/libdb/mydbm.h
new file mode 100644
index 00000000..38bf4a31
--- /dev/null
+++ b/libdb/mydbm.h
@@ -0,0 +1,145 @@
+/*
+ * mydbm.h: database interface definitions and prototypes.
+ *
+ * Copyright (C) 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * Header file to make programming independent of db type used
+ *
+ * Currently satisfies:
+ *
+ * *hash based*
+ * GNU dbm: (gdbm & ndbm)
+ * Berkeley db: (ndbm)
+ * `native': (ndbm)
+ *
+ * *binary tree based*
+ * Berkeley db: (BTREE)
+ *
+ * Tue Apr 26 12:56:44 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#ifndef MYDBM_H
+# define MYDBM_H
+
+# if defined(GDBM) && !defined(NDBM) && !defined(BTREE)
+
+# include <gdbm.h>
+
+# ifndef HAVE_GDBM_EXISTS
+extern __inline__ int gdbm_exists(GDBM_FILE dbf, datum key);
+# endif /* !HAVE_GDBM_EXISTS */
+
+# define BLK_SIZE 0 /* to invoke normal fs block size */
+# define DB_EXT ".db"
+# define MYDBM_FILE GDBM_FILE
+# define MYDBM_CTRWOPEN(file) gdbm_open(file, BLK_SIZE,\
+ GDBM_NEWDB|GDBM_FAST, DBMODE, 0)
+# define MYDBM_CRWOPEN(file) gdbm_open(file, BLK_SIZE,\
+ GDBM_WRCREAT|GDBM_FAST, DBMODE, 0)
+# define MYDBM_RWOPEN(file) gdbm_open(file, BLK_SIZE,\
+ GDBM_WRITER|GDBM_FAST, DBMODE, 0)
+# define MYDBM_RDOPEN(file) gdbm_open(file, BLK_SIZE,\
+ GDBM_READER, DBMODE, 0)
+# define MYDBM_INSERT(dbf, key, cont) gdbm_store(dbf, key, cont, GDBM_INSERT)
+# define MYDBM_REPLACE(dbf, key, cont) gdbm_store(dbf, key, cont, GDBM_REPLACE)
+# define MYDBM_EXISTS(dbf, key) gdbm_exists(dbf, key)
+# define MYDBM_DELETE(dbf, key) gdbm_delete(dbf, key)
+# define MYDBM_FETCH(dbf, key) gdbm_fetch(dbf, key)
+# define MYDBM_CLOSE(dbf) gdbm_close(dbf)
+# define MYDBM_FIRSTKEY(dbf) gdbm_firstkey(dbf)
+# define MYDBM_NEXTKEY(dbf, key) gdbm_nextkey(dbf, key)
+# define MYDBM_REORG(dbf) gdbm_reorganize(dbf)
+# define MYDBM_FREE(x) free(x)
+
+# elif defined(NDBM) && !defined(GDBM) && !defined(BTREE)
+
+# include <ndbm.h>
+
+# if HAVE_FCNTL_H
+# include <fcntl.h>
+# endif
+
+/* Berkeley db routines emulate ndbm but don't add .dir & .pag, just .db! */
+# ifdef _DB_H_ /* has Berkeley db.h been included? */
+# define BERKELEY_DB
+# endif /* _DB_H_ */
+
+extern __inline__ datum copy_datum (datum dat);
+extern DBM *ndbm_flopen(char *file, int flags, int mode);
+extern int ndbm_flclose(DBM *dbf);
+
+# define DB_EXT ""
+# define MYDBM_FILE DBM*
+# define MYDBM_CTRWOPEN(file) ndbm_flopen(file, O_TRUNC|O_CREAT|O_RDWR, DBMODE)
+# define MYDBM_CRWOPEN(file) ndbm_flopen(file, O_CREAT|O_RDWR, DBMODE)
+# define MYDBM_RWOPEN(file) ndbm_flopen(file, O_RDWR, DBMODE)
+# define MYDBM_RDOPEN(file) ndbm_flopen(file, O_RDONLY, DBMODE)
+# define MYDBM_INSERT(dbf, key, cont) dbm_store(dbf, key, cont, DBM_INSERT)
+# define MYDBM_REPLACE(dbf, key, cont) dbm_store(dbf, key, cont, DBM_REPLACE)
+# define MYDBM_EXISTS(dbf, key) (dbm_fetch(dbf, key).dptr != NULL)
+# define MYDBM_DELETE(dbf, key) dbm_delete(dbf, key)
+# define MYDBM_FETCH(dbf, key) copy_datum(dbm_fetch(dbf, key))
+# define MYDBM_CLOSE(dbf) ndbm_flclose(dbf)
+# define MYDBM_FIRSTKEY(dbf) copy_datum(dbm_firstkey(dbf))
+# define MYDBM_NEXTKEY(dbf, key) copy_datum(dbm_nextkey(dbf))
+# define MYDBM_REORG(dbf) /* nothing - not implemented */
+# define MYDBM_FREE(x) free (x)
+
+# elif defined(BTREE) && !defined(NDBM) && !defined(GDBM)
+
+# include <sys/types.h>
+# include <fcntl.h>
+# include BDB_H
+# ifdef HAVE_LIMITS_H
+# include <limits.h>
+# endif
+
+typedef struct {
+ char *dptr;
+ int dsize;
+} datum;
+
+extern __inline__ datum copy_datum (datum dat);
+extern DB *btree_flopen(char *filename, int flags, int mode);
+extern __inline__ int btree_close(DB *dbf);
+extern __inline__ int btree_exists(DB *dbf, datum key);
+extern __inline__ datum btree_fetch(DB *dbf, datum key);
+extern int btree_insert(DB *dbf, datum key, datum cont);
+extern __inline__ datum btree_firstkey(DB *dbf);
+extern __inline__ datum btree_nextkey(DB *dbf);
+extern __inline__ int btree_replace(DB *dbf, datum key, datum content);
+extern __inline__ int btree_nextkeydata(DB *dbf, datum *key, datum *cont);
+
+# define DB_EXT ".bt"
+# define MYDBM_FILE DB*
+# define MYDBM_CTRWOPEN(file) btree_flopen(file, O_TRUNC|O_CREAT|O_RDWR, DBMODE)
+# define MYDBM_CRWOPEN(file) btree_flopen(file, O_CREAT|O_RDWR, DBMODE)
+# define MYDBM_RWOPEN(file) btree_flopen(file, O_RDWR, DBMODE)
+# define MYDBM_RDOPEN(file) btree_flopen(file, O_RDONLY, DBMODE)
+# define MYDBM_INSERT(dbf, key, cont) btree_insert(dbf, key, cont)
+# define MYDBM_REPLACE(dbf, key, cont) btree_replace(dbf, key, cont)
+# define MYDBM_EXISTS(dbf, key) btree_exists(dbf, key)
+# define MYDBM_DELETE(dbf, key) ((dbf->del)(dbf, (DBT *) &key, 0) ? -1 : 0)
+# define MYDBM_FETCH(dbf, key) btree_fetch(dbf, key)
+# define MYDBM_CLOSE(dbf) btree_close(dbf)
+# define MYDBM_FIRSTKEY(dbf) btree_firstkey(dbf)
+# define MYDBM_NEXTKEY(dbf, key) btree_nextkey(dbf)
+# define MYDBM_REORG(dbf) /* nothing - not implemented */
+# define MYDBM_FREE(x) free(x)
+
+# else /* not GDBM or NDBM or BTREE */
+# error Define either GDBM, NDBM or BTREE before including mydbm.h
+# endif /* not GDBM or NDBM or BTREE */
+
+extern char *database;
+extern MYDBM_FILE dbf;
+
+/* db_ver.c */
+extern void dbver_wr(MYDBM_FILE dbf);
+extern int dbver_rd(MYDBM_FILE dbf);
+
+#endif /* MYDBM_H */
diff --git a/libdb/stamp-h b/libdb/stamp-h
new file mode 100644
index 00000000..c80311d3
--- /dev/null
+++ b/libdb/stamp-h
@@ -0,0 +1 @@
+Wed Nov 20 21:50:50 EET 1996
diff --git a/man-db.gnu b/man-db.gnu
new file mode 100644
index 00000000..4f4cd90b
--- /dev/null
+++ b/man-db.gnu
@@ -0,0 +1,80 @@
+%%name: man-db
+
+%%short-description: reference manual pages database and browser
+
+%%full-description: This package provides the man command. This utility
+ is the primary way of examining the reference manual pages.
+ Other utilities provided include the whatis and apropos commands
+ for searching the manual page database, the manpath utility for
+ determining the manual page search path, and the maintenance
+ utilities mandb and zsoelim. This package uses the groff
+ suite of programs to format and display the manual pages.
+
+%%category: documentation browser.
+
+%%license: GPL
+
+%%maintainer: Fabrizio Polacco <fpolacco@debian.org>
+
+%%updated: 4 Jun 2000
+
+%%keywords: manpage, man, browser, database, groff
+
+%%interface: command-line
+
+%%programs: man, mandb, manpath, whatis, apropos, zsoelim, accessdb.
+
+%%GNU: why not?
+
+%%web-page: http://www.debian.org/Packages/unstable/doc/man-db.html
+
+%%support:
+
+%%doc:
+
+%%developers: John W. Eaton, Graeme Wilford, Fabrizio Polacco <fpolacco@debian.org>
+
+%%contributors:
+
+%%sponsors:
+
+%%source: ftp://ftp.debian.org/debian/dists/unstable/main/source/doc/man-db_*.tar.gz
+
+%%debian: ftp://ftp.debian.org/debian/dists/unstable/main/binary-i386/doc/man-db_*.deb
+
+%%redhat:
+
+%%repository:
+
+%%related:
+
+%%human-languages: cs, de, es, fr, it, ja.
+
+%%source-language: C, perl, lex.
+
+%%supported-languages:
+
+%%use-requirements: libdb2, groff
+
+%%build-prerequisites: libdb2-dev, perl.
+
+%%weak-prerequisites:
+
+%%source-prerequisites:
+
+%%version: 2.3.17 on 04 Jun 2000 for alpha, hurd-i386, i386, m68k, powerpc, sparc.
+
+%%announce-list: debian-devel-changes@lists.debian.org
+
+%%announce-news:
+
+%%help-list:
+
+%%help-news:
+
+%%dev-list:
+
+%%dev-news:
+
+%%bug-list: http://cgi.debian.org/cgi-bin/pkgreport.cgi?archive=no&pkg=man-db
+
diff --git a/man/Makefile.in b/man/Makefile.in
new file mode 100644
index 00000000..96c8131c
--- /dev/null
+++ b/man/Makefile.in
@@ -0,0 +1,151 @@
+# Manpage Makefile for the man_db package.
+#
+# Copyright (C) 1994, 1995, Graeme Wilford.
+#
+# You may distribute under the terms of the GNU General Public
+# License as specified in the COPYING file that comes with this
+# distribution.
+#
+# Sat Aug 6 13:28:44 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk):
+
+srcdir = @srcdir@
+VPATH = @srcdir@
+top_srcdir = @top_srcdir@
+INSTALL = @INSTALL@
+
+include ../include/Defines
+
+.PHONY: $(DEFAULT_TARGETS) dirs nlsinstall nlsuninstall
+
+ifeq ($(nls),on)
+all:
+ $(make_in_root)
+else
+ ifeq ($(nls),all)
+ NLS := $(notdir $(wildcard $(srcdir)/*_*))
+ else
+ ifneq ($(nls),off)
+ NLS := $(notdir $(wildcard $(srcdir)/$(nls)))
+ endif
+ endif
+endif
+
+# force these variables to be resolved here, rather than at each reference.
+man := $(man)
+mandb := $(mandb)
+whatis := $(whatis)
+apropos := $(apropos)
+catman := $(catman)
+manpath := $(manpath)
+zsoelim := $(zsoelim)
+
+# localized dates
+# date_it :=`LANG=it_IT date -d $(datemark) +'%d %B %Y'`
+# date_es :=`LANG=es_ES date -d $(datemark) +'%d %B %Y'`
+# date_de :=`LANG=de_DE date -d $(datemark) +'%d %B %Y'`
+# date_fr :=`LANG=fr_FR date -d $(datemark) +'%d %B %Y'`
+
+# looks like a nice place to define a `canned' command sequence.
+define process_manpage
+sed -e 's,%pager%,$(pager),g' \
+ -e 's,%troff%,$(troff),g' \
+ -e 's/%date%/$(date)/g' \
+ -e 's/%curdate%/$(curdate)/g' \
+ -e 's/%date_es%/$(date_es)/g' \
+ -e 's/%curdate_es%/$(curdate_es)/g' \
+ -e 's/%date_it%/$(date_it)/g' \
+ -e 's/%curdate_it%/$(curdate_it)/g' \
+ -e 's/%date_de%/$(date_de)/g' \
+ -e 's/%curdate_de%/$(curdate_de)/g' \
+ -e 's/%date_fr%/$(date_fr)/g' \
+ -e 's/%curdate_fr%/$(curdate_fr)/g' \
+ -e 's,%version%,$(version),g' \
+ -e 's,%zsoelim%,$(zsoelim),g' \
+ -e 's,%man%,$(man),g' \
+ -e 's,%mandb%,$(mandb),g' \
+ -e 's,%manpath%,$(manpath),g' \
+ -e 's,%catman%,$(catman),g' \
+ -e 's,%apropos%,$(apropos),g' \
+ -e 's,%whatis%,$(whatis),g' \
+ -e 's,%manpath_config_file%,$(config_file),g' \
+$< > $@
+endef
+
+man1 = man manpath apropos whatis zsoelim
+man5 = manpath
+man8 = mandb catman accessdb
+
+man1files = $(addprefix $(path)/man1/, $(addsuffix .1, $(man1)))
+man5files = $(addprefix $(path)/man5/, $(addsuffix .5, $(man5)))
+man8files = $(addprefix $(path)/man8/, $(addsuffix .8, $(man8)))
+
+allmanpages = $(foreach path, . $(NLS), $(man1files) $(man5files) $(man8files))
+
+# NB manpath.5 is not expanded
+man.1 = $(manroot)/$(nlspath)/$(man1dir)/$(man)$(man1ext)
+manpath.1 = $(manroot)/$(nlspath)/$(man1dir)/$(manpath)$(man1ext)
+apropos.1 = $(manroot)/$(nlspath)/$(man1dir)/$(apropos)$(man1ext)
+whatis.1 = $(manroot)/$(nlspath)/$(man1dir)/$(whatis)$(man1ext)
+zsoelim.1 = $(manroot)/$(nlspath)/$(man1dir)/$(zsoelim)$(man1ext)
+manpath.5 = $(manroot)/$(nlspath)/$(man5dir)/manpath$(man5ext)
+mandb.8 = $(manroot)/$(nlspath)/$(man8dir)/$(mandb)$(man8ext)
+catman.8 = $(manroot)/$(nlspath)/$(man8dir)/$(catman)$(man8ext)
+accessdb.8 = $(manroot)/$(nlspath)/$(man8dir)/accessdb$(man8ext)
+
+# Rules... We've got some rules 'round here.
+%.1 : %.man1
+ $(process_manpage)
+%.5 : %.man5
+ $(process_manpage)
+%.8 : %.man8
+ $(process_manpage)
+
+# The default programs to build
+ifeq ($(srcdir),.)
+all: $(allmanpages)
+else
+# Have to create output dirs if using alternate build directory
+all: dirs $(allmanpages)
+dirs:
+ $(MKINSTALLDIRS) $(foreach path, . $(NLS), $(path)/man1)
+ $(MKINSTALLDIRS) $(foreach path, . $(NLS), $(path)/man5)
+ $(MKINSTALLDIRS) $(foreach path, . $(NLS), $(path)/man8)
+endif
+
+# special targets
+nlsinstall:
+ $(MKINSTALLDIRS) $(manroot)/$(nlspath)/$(man1dir)
+ $(MKINSTALLDIRS) $(manroot)/$(nlspath)/$(man5dir)
+ $(MKINSTALLDIRS) $(manroot)/$(nlspath)/$(man8dir)
+ $(INSTALL_DATA) $(nlspath)/man1/man.1 $(man.1)
+ $(INSTALL_DATA) $(nlspath)/man1/manpath.1 $(manpath.1)
+ $(INSTALL_DATA) $(nlspath)/man1/apropos.1 $(apropos.1)
+ $(INSTALL_DATA) $(nlspath)/man1/whatis.1 $(whatis.1)
+ $(INSTALL_DATA) $(nlspath)/man1/zsoelim.1 $(zsoelim.1)
+ $(INSTALL_DATA) $(nlspath)/man5/manpath.5 $(manpath.5)
+ $(INSTALL_DATA) $(nlspath)/man8/mandb.8 $(mandb.8)
+ $(INSTALL_DATA) $(nlspath)/man8/catman.8 $(catman.8)
+ $(INSTALL_DATA) $(nlspath)/man8/accessdb.8 $(accessdb.8)
+
+nlsuninstall:
+ rm -f $(man.1) $(manpath.1) $(apropos.1) $(whatis.1) $(zsoelim.1)
+ rm -f $(manpath.5) $(mandb.8) $(catman.8) $(accessdb.8)
+
+# The standard targets
+install: all
+ for nlspath in . $(NLS); do \
+ $(MAKE) nlsinstall nlspath=$$nlspath; \
+ done
+
+uninstall:
+ for nlspath in . $(NLS); do \
+ $(MAKE) nlsuninstall nlspath=$$nlspath; \
+ done
+
+mostlyclean clean:
+ rm -f $(allmanpages) index.* */index.* *~ man*/*~ */man*/*~
+
+realclean distclean: clean
+ rm -f Makefile
+
+TAGS:
diff --git a/man/THANKS b/man/THANKS
new file mode 100644
index 00000000..1f12f2c4
--- /dev/null
+++ b/man/THANKS
@@ -0,0 +1,11 @@
+The following people have kindly donated translations to man_db:
+
+Anke Steuernagel <a_steuer@informatik.uni-kl.de> de_DE.ascii
+Nils Magnus <magnus@informatik.uni-kl.de> de_DE.88591
+Giovanni Bortolozzo <borto@dei.unipd.it> it_IT.88591
+Enrique Zanardi <ezanardi@noah.dfis.ull.es> es_ES.88591
+Cesar BALLARDINI <cballard@santafe.com.ar> es_ES.88591
+Luis Francisco Gonzalez <luisgh@cogs.susx.ac.uk> es_ES.88591
+Nicolás Lichtmaier <nick@feedback.net.ar> es_ES.88591
+Takeo NAKANO <nakano@apm.seikei.ac.jp> ja_JP.ujis
+Laurent Pelecq <laurent.pelecq@wanadoo.fr>, fr.po
diff --git a/man/de_DE.88591/man1/apropos.man1 b/man/de_DE.88591/man1/apropos.man1
new file mode 100644
index 00000000..c80d208a
--- /dev/null
+++ b/man/de_DE.88591/man1/apropos.man1
@@ -0,0 +1,135 @@
+.\" Man page for apropos
+.\"
+.\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.)
+.\" Deutsche Übersetzung von Anke Steuernagel und Nils Magnus
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the man
+.\" distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH apropos 1 "%date_de%" "%version%" "Manual Hilfsprogramme"
+.LO 1
+.SH NAME
+apropos \- sucht die Manualkurzbeschreibung in der Indexdatenbank
+.SH SYNTAX
+.B apropos
+.RB [\| \-dhV \|]
+.RB [\| \-e \||\| \-r \||\| \-w\c
+\|]
+.RB [\| \-m
+.IR System \|[\|,.\|.\|.\|]\|]
+.RB [ \-M
+.IR Pfad \|]
+.I Schlüsselwort
+\&.\|.\|.
+.SH BESCHREIBUNG
+Innerhalb jeder Manualseite ist eine Kurzbeschreibung vorhanden.
+.B apropos
+sucht das Schlüsselwort in den Kurzbeschreibungen der
+.I Indexdatenbank.
+Falls es eine solche nicht im Manualpfad gibt, durchsucht es die
+.I whatis-
+Datenbank nach
+.IR Schlüsselwort.
+Das Schlüsselwort kann Wildcards oder reguläre Ausdrücke enthalten. Bei der
+Standardsuche (nicht bei
+.B \-r
+oder
+.BR \-w )
+wird nach Treffern am Anfang von Worten in den Beschreibungen und in
+Befehlsnamen gesucht. Die Nicht-Standardsuche ist weiter unten beschrieben.
+.SH OPTIONEN
+.TP
+.B \-d, \-\-debug
+Ausgeben von Fehlerinformationen.
+.TP
+.B \-e, \-\-exact
+Sucht nach einem genau passenden Wort, im Gegensatz zu der sonst üblichen
+fuzzy-Übereinstimmung. Beispielsweise wird in diesem Fall das Schlüsselwort
+`string' nicht in dem Text `strings' gefunden. Ein Treffer muß also sowohl am
+Anfang als auch am Ende des Wortes übereinstimmen.
+.TP
+.B \-r, \-\-regex
+Interpretiert jedes Schlüsselwort als regulären Ausdruck. Jedes
+Schlüsselwort wird im Befehlsnamen und in der Beschreibung gesucht. Die
+Übereinstimmung ist nicht durch Wortgrenzen beschränkt.
+.TP
+.B \-w, \-\-wildcard
+Das Schlüsselwort kann Wildcards wie in der Shell (z. B. *, ?, ...)
+beinhalten. Das Schlüsselwort wird in den Befehlsnamen und in den
+Kurzbeschreibungen gesucht. Nur wenn ein expandiertes Schlüsselwort auf eine
+komplette Beschreibung oder einen Befehlsnamen paßt, wird eine
+Übereinstimmung gefunden.
+.PP
+.B \-m
+.I System\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= System\c
+\|[\|,.\|.\|.\|]
+.RS
+Wenn auch Manualseiten von einem anderen Betriebssystem installiert
+sind, so kann auf sie mit dieser Option zugegriffen werden. Um
+beispielsweise die Manualseiten von NewOS zu durchsuchen, muß
+.B \-m
+.BR NewOS
+angegeben werden.
+
+Das angegebene
+.I System
+kann eine durch Kommata abgetrennte Aufzählung von Betriebssystemnamen
+sein. Die normalen Seiten werden durch den Betriebssystemnamen
+.B man
+angesprochen. Diese Option überschreibt die Umgebungsvariable
+.RB $ SYSTEM.
+.RE
+.TP
+.BI \-M\ Pfad ,\ \-\-manpath= Pfad
+Gibt die Manualpfade an. Wenn mehrere Pfade angegeben werden, müssen diese
+durch Doppelpunkte getrennt sein. Als Default benutzt
+.B apropos
+.B manpath,
+um den Suchpfad zu bestimmen. Diese Option überschreibt die
+.RB $ MANPATH
+Umgebungsvariable.
+.TP
+.B \-h, \-\-help
+Zeigt einen Hilfstext an.
+.TP
+.B \-V, \-\-version
+Zeigt Programmversion und Autor an.
+.SH DATEIEN
+.TP
+.I /var/catman/\|.\|.\|.\|/index.(bt|db|dir|pag)
+Die
+.B FSSTND
+complianten globalen
+.I Indexdatenbanken.
+.TP
+.I /usr/man/\|.\|.\|.\|/whatis
+Traditionelle
+.I whatis
+Datenbank.
+.SH "SIEHE AUCH"
+.BR whatis "(1), " man "(1), " mandb (8).
+.SH FEHLER
+Wenn die
+.B \-r
+oder
+.B \-w
+Optionen benutzt werden und in einem
+.IR Schlüsselwort
+Shell-Metazeichen vorkommen, kann es notwendig sein,
+.I Schlüsselwort
+zu quoten, damit die Shell nicht versucht, diese Zeichen zu interpretieren.
+Die
+.B \-r
+und
+.B \-w
+Optionen können verwirrende Ausgaben erzeugen.
+.SH AUTOR
+Wilf. (G.Wilford@ee.surrey.ac.uk),
+die deutsche Übersetzung ist von
+Anke Steuernagel (a_steuer@informatik.uni-kl.de) und
+Nils Magnus (magnus@informatik.uni-kl.de).
diff --git a/man/de_DE.88591/man1/man.man1 b/man/de_DE.88591/man1/man.man1
new file mode 100644
index 00000000..811ae583
--- /dev/null
+++ b/man/de_DE.88591/man1/man.man1
@@ -0,0 +1,841 @@
+'\" t
+.\" ** The above line should force tbl to be a preprocessor **
+.\" Man page for man
+.\"
+.\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.)
+.\" Deutsche Übersetzung von Anke Steuernagel und Nils Magnus
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the man
+.\" distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH man 1 "%date_de%" "%version%" "Manual Hilfsprogramme"
+.LO 1
+.SH NAME
+man \- Programm zum Einsehen der Online-Manuale
+.SH SYNTAX
+.\" Die allgemeine Kommandozeile
+.\".TP \w`man\ `u
+.B man
+.RB [\| \-acdhwutZV \|]
+.RB [\| \-m
+.IR System \|[\|,.\|.\|.\|]\|]
+.RB [\| \-L
+.IR locale \|]
+.RB [\| \-p
+.IR Zeichenkette \|]
+.RB [\| \-M
+.IR Pfad \|]
+.RB [\| \-P
+.IR Pager \|]
+.RB [\| \-r
+.IR Prompt \|]
+.RB [\| \-T
+.IR Format \|]
+.RB [\| \-S
+.IR Liste \|]
+.RB [\| \-e
+.IR Erweiterung \|]
+.RI [\|[\| Abschnitt \|]
+.IR Seite \ .\|.\|.\|]\ .\|.\|.
+.\" The --local command line
+.br
+.B man
+.B \-l
+.RB [\| \-tZ \|]
+.RB [\| \-p
+.IR Zeichenkette \|]
+.RB [\| \-P
+.IR Pager \|]
+.RB [\| \-r
+.IR Prompt \|]
+.RB [\| -T
+.IR Format \|]
+.I Datei
+\&.\|.\|.
+.\" The apropos command line
+.br
+.B man
+.B \-k
+.I Schlüsselwort
+\&.\|.\|.
+.\" The whatis command line
+.br
+.B man
+.B \-f
+.I Seite
+\&.\|.\|.
+.SH BESCHREIBUNG
+.B man
+ist der Manualbrowser des Systems. Jedes Argument
+.I Seite
+ist normalerweise der Name eines Programmes oder einer
+Funktion. Gefunden und angezeigt wird die
+.I Manualseite,
+die auf alle Argumente paßt. Wenn ein
+.IR Abschnitt
+angegeben wird, sucht
+.B man
+nur in diesem
+.I Abschnitt
+der Manualseiten. Ohne Angabe eine explizite Angabe werden alle verfügbaren
+.IR Abschnitte
+in einer vorher definierten Reihenfolge durchsucht.
+Wenn die
+.I Seite
+in mehreren
+.IR Abschnitten
+vorkommt, wird nur die jeweils erste
+.I Seite
+angezeigt, die gefunden wird.
+
+Die folgende Tabelle zeigt die Nummern der
+.I Abschnitte
+der Manualseiten gefolgt vom Typ der dort zu findenden Seiten.
+
+.TS
+tab (@);
+l l.
+1@Ausführbare Programme oder Shellbefehle
+2@Systemaufrufe (Kernelfunktionen)
+3@Bibliotheksaufrufe (Funktionen in System-Bibliotheken)
+4@Spezielle Dateien (gewöhnlich in \fI/dev\fR)
+5@Dateiformate und Konventionen, z. B. \fI/etc/passwd\fR
+6@Spiele
+7@Makropakete und Konventionen, z. B. \fBman\fR(7), \fBgroff\fR(7)
+8@Systemadministrationsbefehle (in der Regel nur für root)
+9@Kernelroutinen [\|Nicht Standard\|]
+n@neu [\|veraltet\|]
+l@lokal [\|veraltet\|]
+p@öffentlich [\|veraltet\|]
+o@alt [\|veraltet\|]
+.TE
+
+Eine Manualseite besteht aus mehreren Teilen. Die üblichen
+Bezeichnungen sind u. a.
+.BR NAME ,
+.BR SYNTAX ,
+.BR BESCHREIBUNG ,
+.BR OPTIONEN ,
+.BR DATEIEN ,
+.BR SIEHE\ AUCH ,
+.BR FEHLER ,
+und
+.BR AUTOR .
+
+Die folgenden Konventionen gelten für den Abschnitt
+.B SYNTAX
+und können für andere Abschnitte als Anleitung benutzt werden.
+
+.TS
+tab (@);
+l l.
+\fBbold text\fR@Literale Angaben wie in der Anzeige.
+\fIitalic text\fR@Ersetzen durch passendes Argument.
+[\|\fB\-abc\fR\|]@Ein oder mehrere Argumente innerhalb der [ ] sind optional.
+\fB\-a\|\fR|\|\fB\-b\fR@Optionen, die durch | abgegrenzt sind, können nicht zusammen benutzt werden.
+\fIArgument\fB .\|.\|.@\fIArgument\fR kann wiederholt werden.
+[\|\fIAusdruck\fR\|]\fB .\|.\|.@\fRgesamter \fIAusdruck\fR\ innerhalb [ ] kann wiederholt werden.
+.TE
+
+Die Befehls- oder Funktionsbeispiele sind Muster, die auf alle möglichen
+Aufrufe passen sollten. In manchen Fällen ist es ratsam, die verschiedenen
+sich ausschließenden Aufrufe zu illustrieren, wie es im
+.B SYNTAX
+Abschnitt dieser Manualseite gezeigt ist.
+.SH BEISPIELE
+.TP \w'man\ 'u
+.BI man \ ls
+zeigt die Manualseite für das Programm
+.IR ls
+an.
+.TP
+.BI man\ \-a \ intro
+zeigt alle vorhandenen
+.I intro
+Manualseiten an. Mit (q)uit ist es möglich, das aufeinanderfolgendende
+Anzeigen der Seiten abzubrechen oder mit (s)kip eine Seite zu überspringen.
+.TP
+\fBman \-t \fIalias \fR|\fI lpr -Pps
+Formatiert die Manualseite, die sich auf
+.RI alias
+bezieht, in das Default
+.B troff
+oder
+.B groff
+Format und schickt es an den Drucker
+.IR ps .
+Die Defaultausgabe für
+.B groff
+ist Postscript. Das Default für
+.B troff
+\- ditroff, benötigt weitere Bearbeitung durch grops, bevor es von einem
+Postscriptdrucker gedruckt werden kann.
+.B man \-\-help
+sollte zu bestimmen helfen, welcher Prozessor an die
+.B \-t
+Option gebunden ist.
+.TP
+.BI man\ \-l\ \-T dvi\ ./foo.1x.gz \ >\ ./foo.1x.dvi
+Dieser Befehl formatiert die komprimierte nroff-Manualseite
+.I ./foo.1x.gz
+in eine
+.B device independent (dvi)
+Datei. Diese Datei wird zuerst dekomprimiert, bevor sie durch passende Filter
+und Programme bearbeitet wird. Die Umlenkung ist notwendig, da die
+.B \-T
+Option die Ausgabe unformatiert an die
+.B Standardausgabe
+schickt. Die Ausgabe kann mit einem Programm wie
+.B xdvi
+betrachtet oder mit einem Programm wie
+.BR dvips
+in Postscript weiterverarbeitet werden.
+.TP
+.BI man\ \-k \ printf
+Sucht die Kurzbeschreibungen und die Namen der Manualseiten zum
+.I Schlüsselwort
+.IR printf
+und gibt alle Treffer aus.
+.TP
+.BI man\ \-f \ smail
+Sucht die Manualseiten, die sich auf
+.I smail
+beziehen und gibt alle gefundenen Kurzbeschreibungen aus.
+.SH UEBERSICHT
+Um dem Benutzer eine größtmögliche Flexibilität zu bieten, sind in
+.B man
+viele Optionen verfügbar. Veränderungen können am Suchpfad, in der
+Reihenfolge der Abschnitte oder am Ausgabeprozessor vorgenommen werden. Andere
+Verhaltensweisen und Operationen sind weiter unten beschrieben.
+
+Um die Arbeitsweise von
+.BR man
+zu bestimmen, werden verschiedene Umgebungsvariablen benutzt. Mit
+dieser Version ist es möglich, die Variable
+.RB $ MANOPT
+auf einen Ausdruck im Kommandozeilenformat zu setzen. Es gibt folgende
+Ausnahme: Da jede Option in
+.RB $ MANOPT
+von Leerzeichen eingeschlossen ist, müssen Leerzeichen, die Teil eines
+Argumentes sind, gequotet werden.
+.B man
+bearbeitet diese Variable vor der eigenen Kommandozeile. Die Optionen, die ein
+Argument benötigen, können durch die gleichen Optionen in der Kommandozeile
+überschrieben werden.
+Um alle Optionen zurückzusetzen, die in
+.RB $ MANOPT
+gesetzt werden, kann
+.B \-D
+als initiale Kommandozeilen-Option angegeben werden.
+Dies erlaubt
+.B man
+alle Optionen zu `überschreiben', die in
+.RB $ MANOPT
+gesetzt werden, obwohl diese weiterhin gelten. Damit wird die größtmögliche
+Flexibilität für einen Benutzer erzeugt, der
+.B man
+auf seine eigenen Bedürfnisse anpassen will, ohne zahllose
+Optionen bei der Suche einer Manualseite einzugeben.
+
+Die Hilfsprogramme, die im
+.B man_db-
+Paket zusammengefaßt sind, machen umfassenden Gebrauch von
+.I Indexdatenbanken.
+Diese Zwischenspeicher enthalten Informationen über den Ort und
+die zugehörige
+.I whatis
+Information (einzeilige Kurzbeschreibung der Manualseite), sowie darüber,
+wo sich eine Manualseite im Dateisystem befindet. Eine Aufgabe von
+.B man
+ist die Konsistenzsicherung der Datenbank. Die Datenbanken verhindern die
+Notwendigkeit einer manuellen Bearbeitung zur Aktualisierung der
+.I whatis-
+Textdatenbank und erlauben
+.B man
+schneller zu arbeiten, als bei der Suche nach der passenden
+Manualseite im gesamten Dateisystem.
+
+Wenn
+.B man
+keine von
+.B mandb
+erstellte
+.I Indexdatenbank
+zu einer speziellen Manualhierarchie finden kann, wird dennoch nach der
+gewünschten Manualseite gesucht. In diesem Fall ist es jedoch wieder nötig,
+nach der alten Methode alle in Frage kommenden Verzeichnisse zu durchsuchen
+(sog. globbing). Wenn
+.B whatis
+oder
+.B apropos
+keine
+.I Indexdatenbank
+finden können, versucht es die Information aus der
+.I whatis-
+Datenbank zu beziehen.
+Auch anwenderspezifische Manualhierarchien werden während der Benutzung in
+.I Indexdatenbanken
+zusammengefaßt.
+
+Die Hilfsprogramme unterstützen komprimierte nroff-Quelldateien,
+die normalerweise die Erweiterung
+.BR .Z ", " .z " oder " .gz
+besitzen. Jede andere Erweiterung kann unterstützt werden, wenn sie zur
+Übersetzungszeit bekannt ist. Als Default werden alle cat-Seiten mit
+.BR gzip
+komprimiert. Jede globale Manualhierarchie wie
+.I /usr/man
+oder
+.I /usr/X11R6/man
+kann jedes Verzeichnis als cat-Seiten-Hierarchie besitzen.
+Üblicherweise werden cat-Seiten unter der gleichen Hierarchie wie die
+Manualseiten gespeichert. Allerdings kann es aus Gründen, die im
+.BR "Linux File System Standard (FSSTND)"
+erläutert sind, besser sein, sie an anderer Stelle zu speichern.
+Details, wann dies der Fall ist, beschreibt
+.BR manpath (5).
+Für Details, warum dies empfohlen wird, siehe den
+.BR "Linux File System Standard (FSSTND)" .
+
+Dieses Paket unterstützt internationale Anpassungen (sog. NLS-Support, Native
+Language Support). Durch den Gebrauch von
+.I locale
+Funktionen ist es möglich, Manualseiten der Landessprache zu verwalten, wenn
+sie auf dem System vorhanden sind. Um diese Unterstützung zu aktivieren, muß
+man entweder in
+.RB $ LC_MESSAGES ,
+.RB $ LANG
+oder anderen systemabhängigen Umgebungsvariablen die gewünschte Sprache
+einstellen. Die Sprache wird normalerweise in dem durch
+.B POSIX 1003.1
+definierten Format angegeben:
+.\"
+.\" Need a \c to make sure we don't get a space where we don't want one
+.\"
+.RI < Sprache >[\|\c
+.B _\c
+.RI < Region >\|[\|\c
+.B .\c
+.RI < Zeichensatz >\|[\|\c
+.B ,\c
+.RI < Version >\|]\|]\|]
+
+Wenn die angeforderte Seite in der
+.IR locale
+vorhanden ist, wird sie anstelle der Standardseite (normalerweise in
+amerikanischem Englisch) angezeigt. Darüber hinaus werden auch Sammlungen von
+landessprachlichen Systemmeldungen unterstützt und auf dieselbe Weise
+aktiviert - ebenfalls unter der Vorraussetzung, daß die übersetzten
+Meldungen vorliegen. Wer diese Manualseiten und die Ausgaben der
+Hilfsprogramme gerne in seiner Landessprache hätte, aber diese nicht
+vorfindet, ist aufgefordert, eine Übersetzung anzufertigen und sie dem Autor
+zuzusenden, damit spätere Versionen davon profitieren können.
+
+Die anderen Eigenschaften und Erweiterungen von
+.B man
+sind in den beiliegenden Dokumenten beschrieben. Einen umfassenden Einblick
+in die
+.B mandb
+zugrundeliegenden Konzepte sind in der Dokumentation
+.I man_db-2.3 - the database cached manual pager suite
+beschrieben. Die Dokumentation sollte auf denselben Server wie das
+.B mandb-
+Paket selbst zu finden sein.
+.SH NORMALEINSTELLUNGEN
+.B man
+sucht nach der gewüschten Manualseite in der
+.I Indexdatenbank.
+Wenn die Suche fehlschlägt, wird ein Konsistenztest durchgeführt, um die
+korrekte Wiedergabe des Dateisystems zu sichern. Nachdem die Datenbanken
+erzeugt wurden, ist es i. A. nicht notwendig,
+.B mandb
+zu starten, es sei denn, die Datenbank wurde verfälscht.
+
+Wenn eine Manualseite gefunden wurde, wird getestet, ob dazu bereits eine
+vorformatierte cat-Seite existiert und diese neuer als die nroff-Datei ist.
+In diesem Fall wird die vorformatierte Datei
+dekomprimiert und mit einem Browser angezeigt. Die Auswahl des Browsers kann
+auf unterschiedliche Weise erfolgen (für Details siehe
+.B \-P
+Option).
+Wenn keine cat-Seite gefunden wird oder wenn sie älter als die nroff-Datei
+ist, wird die nroff-Datei durch diverse Programme gefiltert und
+entweder sofort angezeigt oder zuerst als komprimierte cat-Datei gespeichert
+und dann angezeigt.
+
+Eine cat-Datei wird erzeugt, wenn ein relatives cat-Verzeichnis existiert und
+.B man
+dort das Schreibrecht hat.
+
+Die Filter werden in mehreren Schritten zusammengestellt: Zuerst wird
+die Kommandozeilen-Option
+.B \-p
+oder die Umgebungsvariable
+.RB $ MANROFFSEQ
+untersucht. Wenn
+.B \-p
+nicht benutzt wird und die Umgebungsvariable nicht gesetzt ist, wird die
+Anfangszeile der nroff-Datei nach einer Zeichenkette für den Präprozessor
+untersucht. Eine solche Präprozessor-Zeichenkette muß folgendes Aussehen
+haben:
+
+.B '\e"
+.RB < Zeichenkette >
+
+wobei
+.B Zeichenkette
+jede Kombination von Buchstaben sein kann, die unter Option
+.B \-p
+weiter unten beschrieben sind.
+
+Wenn keine der obigen Methoden eine Filter-Information enthält, wird
+.B tbl
+als Default verwendet.
+
+Als primärer Formatierer wird entweder
+.BR nroff ,
+.B troff
+oder
+.B groff
+gestartet.
+.\" ********************************************************************
+.SH OPTIONEN
+Eine Argumentoption, die entweder in der Kommandozeile, in
+.RB $ MANOPT
+oder in beiden doppelt vorkommt , ist nicht schädlich. Für Optionen,
+die ein Argument benötigen, überschreibt jedes Duplikat den
+vorhergehenden Wert.
+.TP
+.B \-l, \-\-local-file
+Aktiviert den lokalen Modus. Formatiert und zeigt lokale Manualdateien an,
+anstatt die System-Manualsammlung zu durchsuchen. Jedes
+Manualseiten-Argument wird als nroff-Quelle im richtigen Format
+interpretiert. Komprimierte nroff-Quelldateien mit einer unterstützten
+Kompressions-Erweiterung werden von
+.B man
+dekomprimiert, bevor sie über den üblichen Filter angezeigt werden. Es wird
+keine cat-Datei erzeugt. Wenn eines der Argumente `\-' ist, wird die Eingabe
+von der Standardeingabe übernommen.
+.TP
+.BI \-L\ locale ,\ \-\-locale= locale
+Normalerweise bestimmt
+.B man
+die aktuelle
+.B locale
+durch einen Aufruf der C Funktion
+.B setlocale (3),
+die diverse Umgebungsvariablen, darunter u. U.
+.RB $ LC_MESSAGES
+und
+.RB $ LANG
+untersucht.
+Diese Funktion kann dazu verwendet werden, kurzzeitig den so gefundenen Wert
+zu überschreiben. Dazu kann diese Option mit einer Zeichenkette, die die
+temporäre
+.B locale
+enthält, angegeben werden. Man beachte, daß dieser Effekt
+erst beim konkreten Suchen der Seite in Erscheinung tritt. Daher werden
+Ausgaben wie die Hilfeseite immer in der ursprünglichen Sprache ausgegeben.
+.TP
+.B \-D, \-\-default
+Diese Option wird normalerweise nur als allererste angegeben und setzt das
+Verhalten von
+.B man
+in allen Belangen wieder zum Normalverhalten zurück. Der Zweck dieser Option
+ist es, Optionen wieder rückgängig zu machen, die bereits in der
+Umgebungsvariable
+.RB $ MANOPT
+gesetzt sind. Alle Optionen, die
+.B \-D
+folgen, haben wieder ihren gewohnten Effekt.
+.TP
+.BI \-M\ Pfad ,\ \-\-manpath= Pfad
+Ermöglicht es, einen alternativen Manualpfad anzugeben. Normalerweise
+verwendet
+.B man
+dieselben Methoden wie in
+.B manpath,
+um den Suchpfad zu ermitteln. Diese Option überschreibt die Umgebungsvariable
+.RB $ MANPATH.
+.TP
+.BI \-P\ Pager ,\ \-\-pager= Pager
+Gibt an, welcher Pager verwendet wird. Die Normaleinstellung ist
+.BR %pager% .
+Diese Option überschreibt die Umgebungsvariable
+.RB $ PAGER
+und wird nicht in Zusammenhang mit
+.B \-f
+oder
+.BR \-k
+verwendet.
+.TP
+.BI \-r\ Prompt ,\ \-\-prompt= Prompt
+Wenn eine hinreichend neue Version von
+.B less
+als Pager verwendet wird, versucht
+.B man
+dort einige sinnvolle Optionen zu setzen. Die Eingabeaufforderung in der
+letzten Zeile sieht in dem Fall so aus:
+
+.B \ Manual page\c
+.IB \ name ( sec )\c
+.BI \ line \ x,
+
+wobei
+.I name
+die Manualseite bezeichnet, die gerade angezeigt wird,
+.I sec
+der Abschnitt ist, in dem sie gefunden wurde, und
+.IR x
+die aktuelle Zeilennummer ist.
+Diese Anzeige wird durch Verwendung der Umgebungsvariable
+.RB $ LESS
+erreicht.
+Man beachte, daß einzelne Bezeichnungen sich bei der Verwendung von
+landessprachlichen Meldungen ändern können.
+Die Option
+.B \-r
+ermöglicht es, durch Angabe einer Formatierungszeichenkette, das
+Ausgabeformat selbst zu bestimmen. Wenn diese Zeichenkette
+.B $MAN_PN
+enthält, wird dieser Text durch den Namen der Manualseite gefolgt von der
+Abschnittsnummer in runden Klammern ersetzt. Die Zeichenkette, die im
+Normalfall verwendet wird ist:
+
+.B \e\ Manual\e\ page\e\ \e$MAN_PN\e\ ?ltline\e\ %lt?L/%L.:
+.br
+.B byte\e\ %bB?s/%s..?\e\ (END):?pB\ %pB\e\e%..
+
+Die zweizeilige Darstellung wurde nur der besseren Lesbarkeit wegen
+gewählt. Nähere Informationen liefert
+.BR less (1).
+Da die Zeichenkette zuerst vom Kommandointerpreter ausgewertet wird, müssen
+entsprechende Zeichen durch einen Backslash geschützt werden. Weitere
+Optionen für
+.B less
+können nach einem geschützten $ am Ende der Zeichenkette hinzugefügt
+werden. Der Default ist hier
+.B \-ix8.
+.TP
+.BI \-S\ Liste ,\ \-\-sections= Liste
+Eine durch Doppelpunkte getrennte Liste von Abschnitten definiert bei
+Benutzung dieser Option die Reihenfolge, in der die Abschnitte durchsucht
+werden. Diese Option überschreibt die Umgebungsvariable
+.RB $ MANSECT.
+.TP
+.B \-a, \-\-all
+Wird eine Manualseite in einem Abschnitt gefunden, so terminiert
+.B man
+nach Anzeige dieser Seite. Wird jedoch diese Option angegeben, so werden alle
+passenden Manualseiten nacheinander angezeigt.
+.TP
+.B \-c, \-\-catman
+Diese Option überprüft nur, ob die zur angegebenen Manualseite passende
+cat-Seite aktuell ist und erzeugt ggf. eine neue. Es wird dabei nichts
+angezeigt.
+.TP
+.B \-d, \-\-debug
+Bei dieser Option werden keine Manualseiten angezeigt, sondern nur
+eine Menge von Diagnoseinformation.
+.TP
+.BI \-e\ Erweiterung ,\ \-\-extension= Erweiterung
+Einige Systeme enthalten große Pakete an Manualseiten, wie z. B. in dem
+.B Tcl
+Paket, die in die normalen Manualabschnitte integriert werden. Um
+beispielsweise das Problem zweier unterschiedlicher Manualseiten mit gleichem
+Namen, wie
+.BR exit (3),
+zu lösen, wurden früher alle
+.B Tcl
+Seiten dem Abschnitt
+.BR l
+zugeordnet. Dieses erwies sich als keine gute Lösung. Bei dieser Version von
+.B man
+ist es möglich, die Seiten in die richtigen Abschnitte einzuordnen und ihrem
+Seitennamen eine spezifische Erweiterung, hier z. B.
+.BR exit (3tcl)
+anzuhängen. Unter normalen Umständen zeigt
+.B man
+bevorzugt
+.BR exit (3)
+gegenüber
+.BR exit (3tcl)
+an. Um dieses Verhalten umzukehren, ist
+.B man
+die Zeichenkette
+.I Erweiterung
+zu übergeben, die angibt, in welchem Paket die Manualseite zu finden ist. Im
+obigen Fall beschränkt
+.B man
+seine Suche auf Seiten mit der Erweiterung
+.BR *tcl,
+wenn es mit
+.B \-e\ tcl
+aufgerufen wurde. Die Suche wird dabei in allen Abschnitten durchgeführt.
+.TP
+.B \-f, \-\-whatis
+Diese Option ist das Äquivalent zu
+.BR whatis .
+Es wird eine Kurzbeschreibung der gewünschten Manualseite angezeigt, wenn
+sie gefunden wurde. Zu Details siehe
+.BR whatis (1).
+Mit dieser Option ist nur eine Standardsuche möglich. Verbesserte
+Suchmöglichkeiten bieten die Optionen von
+.B whatis.
+.TP
+.B \-k, \-\-apropos
+Diese Option ist das Äquivalent zu
+.BR apropos .
+Es werden die Kurzbeschreibungen zu allen Manualseiten nach dem angegebenen
+Stichwort durchsucht. Zu Details siehe
+.BR apropos (1).
+Mit dieser Option ist nur eine Standardsuche möglich. Verbesserte
+Suchmöglichkeiten bieten die Optionen von
+.B apropos.
+.PP
+.B \-m
+.I System\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= System\c
+\|[\|,.\|.\|.\|]
+.RS
+Wenn auch Manualseiten von einem anderen Betriebssystem installiert
+sind, so kann auf sie mit dieser Option zugegriffen werden. Um
+beispielsweise die Manualseiten von NewOS zu durchsuchen, muß
+.B \-m
+.BR NewOS
+angegeben werden.
+
+Das angegebene
+.I System
+kann eine durch Kommata abgetrennte Aufzählung von Betriebssystemnamen
+sein. Die normalen Seiten werden durch den Betriebssystemnamen
+.B man
+angesprochen. Diese Option überschreibt die Umgebungsvariable
+.RB $ SYSTEM.
+.RE
+.TP
+.BI \-p\ Zeichenkette ,\ \-\-preprocessor= Zeichenkette
+Diese Option gibt die Reihenfolge an, in der die Präprozessoren vor
+.B nroff
+oder
+.BR troff / groff
+abgearbeitet werden. Nicht alle Installationen haben notwendigerweise alle
+Präprozessoren. Einige der Präprozessoren und die Zeichen, um sie zu
+repräsentieren, sind:
+.BR eqn " (" e ),
+.BR grap " (" g ),
+.BR pic " (" p ),
+.BR tbl " (" t ),
+.BR vgrind " (" v ),
+.BR refer " (" r ).
+Diese Option überschreibt die Umgebungsvariable
+.RB $ MANROFFSEQ.
+Der Präprozessor
+.B zsoelim
+wird immer als erster gestartet.
+.TP
+.B \-u, \-\-update
+Die
+.I Indexdatenbanken
+werden immer während des laufenden Betriebes auf neuestem Stand gehalten, was
+insbesondere bedeutet, daß
+.B mandb
+nicht benötigt wird, um sie konsistent zu halten. Wenn die ausgewählte
+Manualseite nicht im Index gefunden wurde oder die
+.B \-a
+Option verwendet wurde, macht
+.B man
+einen Konsistenztest auf Verzeichnisebene, um sicherzustellen, daß der Index
+immer noch eine gültige Repräsentation der Manualseiten im Dateisystem
+darstellt. Wenn dieser Test auf Inode-Ebene durchgeführt werden soll, muß
+man die Option
+.BR \-u
+benutzen.
+.TP
+.B \-t, \-\-troff
+Mit dieser Option wird
+.I %troff%
+verwendet, um die Manualseite zu formatieren und an die Standardausgabe
+zu liefern. Im Zusammenhang mit
+.B \-T
+oder
+.BR \-Z
+ist diese Option nicht nötig.
+.PP
+.BI \-T\ Format ,\ \-\-troff-device
+.RI [\| =Format \|]
+.RS
+Diese Option wird dazu verwendet, um das Ausgabeformat von
+.B groff
+(oder möglicherweise
+.BR troff )
+zu ändern. Diese Option impliziert die Angabe von
+.BR \-t .
+Verfügbare Ausgabeformate (von Groff-1.09) beinhalten
+.BR dvi ", " latin1 ,
+.BR X75 " und " X100 .
+.RE
+.TP
+.B \-Z, \-\-ditroff
+Das traditionelle
+.B troff
+erzeugt ditroff.
+.B groff
+startet zunächst
+.B troff
+und leitet danach dessen Ausgabe an einen für das gewählte Ausgabeformat
+geeigneten Postprozessor weiter. Wenn
+.I %troff%
+.BR groff
+ist, zwingt diese Option
+.B groff
+dazu, traditionelles
+.B troff
+zu emulieren und impliziert
+.BR \-t ,
+andernfalls wird es ignoriert.
+.TP
+.B \-w, \-\-where, \-\-location
+Zeigt nicht die Manualseiten, sondern die Position der Dateien im
+Dateisystem an, die formatiert oder angezeigt würden. Wenn die Datei eine
+cat-Seite ist, wird auch der Ort ihrer nroff-Quelldatei angezeigt.
+.TP
+.B \-h, \-\-help
+Zeigt einen Hilfstext an.
+.TP
+.B \-V, \-\-version
+Zeigt Programmversion und Autor an.
+.SH UMGEBUNG
+.\".TP \w'MANROFFSEQ\ \ 'u
+.TP
+.B MANPATH
+Wenn
+.RB $ MANPATH
+gesetzt ist, wird dessen Wert als Suchpfad für die Manualseiten benutzt.
+.TP
+.B MANROFFSEQ
+Wenn
+.RB $ MANROFFSEQ
+gesetzt ist, wird dessen Wert benutzt, um die Abfolge der Präprozessoren zu
+bestimmen, die jede Manualseite vor
+.B nroff
+oder
+.BR troff
+durchläuft.
+Als Default durchlaufen die Seiten den
+.BR tbl " (" t )
+Präprozessor.
+.TP
+.B MANSEC
+Wenn der Wert von
+.RB $ MANSEC
+eine durch Doppelpunkte getrennte Liste von Abschnitten ist,
+wird dieser Wert dazu benutzt, um die zu durchsuchenden Abschnitte und
+deren Reihenfolge zu bestimmen.
+.TP
+.B PAGER
+Wenn
+.RB $ PAGER
+gesetzt ist, wird dieses Programm zur Anzeige benutzt. Default ist
+.B %pager%.
+.TP
+.B SYSTEM
+Wenn
+.RB $ SYSTEM
+gesetzt ist, hat dies den gleichen Effekt wie die Option
+.B \-m
+.I System
+wobei
+.I System
+als Inhalt der Umgebungsvariable
+.RB $ SYSTEM
+benutzt wird.
+.TP
+.B MANOPT
+Wenn
+.RB $ MANOPT
+gesetzt ist, wird der Wert dieser Variablen vor der
+.B man
+Kommandozeile durchsucht und abgearbeitet. Wie auch alle
+anderen Umgebungsvariablen, die als Kommandozeilen-Optionen ausgedrückt
+werden können, ist es möglich, den Inhalt von
+.RB $ MANOPT
+durch die Kommandozeile zu überschreiben.
+Alle Leerzeichen, die Teil eines Argumentes sind, müssen gequotet werden.
+.TP
+.BR LANG , " LC_MESSAGES"
+Abhängig von System und Implementation werden entweder
+.RB $ LANG
+oder
+.RB $ LC_MESSAGES
+oder beide nach der gegenwärtigen
+.I locale
+Information durchsucht.
+.B man
+wird (wenn möglich) seine Nachrichten in dieser
+.I locale
+anzeigen. Für Details
+siehe
+.BR setlocale (3).
+.SH DATEIEN
+.TP
+.I %manpath_config_file%
+Die Manualkonfigurationsdatei.
+.TP
+.I /usr/\|.\|.\|.\|/man
+Globale Manualhierarchien.
+.TP
+.I /var/catman/\|.\|.\|.\|/index.(bt|db|dir|pag)
+Die
+.B FSSTND
+complianten globalen
+.I Indexdatenbanken.
+.SH "SIEHE AUCH"
+.BR mandb (8),
+.BR manpath (1),
+.BR manpath (5),
+.BR apropos (1),
+.BR whatis (1),
+.BR catman (8),
+.BR less (1),
+.BR nroff (1),
+.BR troff (1),
+.BR groff (1),
+.BR zsoelim (1),
+.BR setlocale (3).
+.SH FEHLER
+Die Option
+.B \-t
+funktioniert nur, wenn ein troff-ähnliches Programm installiert ist.
+
+Die Option
+.B \-e
+funktioniert momentan nur in Manualhierarchien, für die mit
+.B mandb
+eine
+.I Indexdatenbank
+erzeugt wurde.
+
+Manualseiten, die die erweiterte Darstellung im Zusammenhang mit der Option
+.B \-e
+unterstützen, dürfen keinen Punkt beinhalten, denn sonst
+werden diese Seiten als fehlerhaft zurückgewiesen.
+.SH GESCHICHTE
+1990, 1991 \- Originale geschrieben von John W. Eaton (jwe@che.utexas.edu).
+
+23. Dez. 1992: Fehlerbereinigung durch Rik Faith (faith@cs.unc.edu)
+unterstützt durch Willem Kasdorp (wkasdo@nikhefk.nikef.nl).
+
+Zwischen dem 30. April 1994 und dem %date_de% hat Wilf
+(G.Wilford@ee.surrey.ac.uk) unter Mithilfe von einigen wenigen engagierten
+Menschen dieses Paket entwickelt und weitergeführt.
+
+Die deutsche Übersetzung wurde von
+Anke Steuernagel (a_steuer@informatik.uni-kl.de) und
+Nils Magnus (magnus@informatik.uni-kl.de) angefertigt.
+
+Für persönliche Würdigungen und Zusätze siehe Quelltexte.
diff --git a/man/de_DE.88591/man1/manpath.man1 b/man/de_DE.88591/man1/manpath.man1
new file mode 100644
index 00000000..48e71096
--- /dev/null
+++ b/man/de_DE.88591/man1/manpath.man1
@@ -0,0 +1,125 @@
+.\" Man page for manpath
+.\"
+.\" Copyright (c) 1990, 1991, John W. Eaton.
+.\" Deutsche Übersetzung von Anke Steuernagel und Nils Magnus
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the README file that comes with the man 1.0
+.\" distribution.
+.\"
+.\" John W. Eaton
+.\" jwe@che.utexas.edu
+.\" Department of Chemical Engineering
+.\" The University of Texas at Austin
+.\" Austin, Texas 78712
+.\"
+.TH manpath 1 "%date_de%" "%version%" "Manual Hilfsprogramme"
+.LO 1
+.SH NAME
+manpath \- ermittelt den aktuellen Suchpfad für die Manualseiten
+.SH SYNTAX
+.B manpath
+.RB [\| \-qgdc \|]
+.RB [\| \-m
+.IR System \|[\|,.\|.\|.\|]\|]
+.SH BESCHREIBUNG
+.B manpath
+versucht den aktuellen Suchpfad der Manualseiten aus den Standardeinstellungen
+und der Umgebungsvariable
+.RB $ PATH
+zu ermitteln. Das Ergebnis wird auf der Standardausgabe
+ausgegeben, Warnungen und Fehler auf der Standardfehlerausgabe. Wenn
+ein Verzeichnis nicht in der Konfigurationsdatei aufgelistet ist, sucht
+.B manpath
+nach den Unterverzeichnissen `man' und `MAN'. Wenn diese existieren, werden
+sie dem Suchpfad hinzugefügt.
+
+Da
+.B manpath
+von
+.B man
+benutzt wird, um den Suchpfad zu bestimmen, ist es für einen Benutzer im
+Normalfall nicht notwendig, die Umgebungsvariable
+.RB $ MANPATH
+direkt zu setzen.
+.SH OPTIONEN
+.TP
+.B \-q, \-\-quiet
+Gibt nur den endgültigen Manualpfad aus.
+.TP
+.B \-d, \-\-debug
+Ausgeben von Fehlerinformationen.
+.TP
+.B \-c, \-\-catpath
+Erzeugt einen cat-Suchpfad. Vorhandene
+Manualpfade werden in relative cat-Suchpfade umgewandelt. Diese Option
+kann mit
+.BR \-g
+kombiniert werden.
+.TP
+.B \-g, \-\-global
+Erzeugt einen Manualpfad, der aus allen Pfaden besteht, die in der
+Konfigurationsdatei als global bezeichnet sind. Diese Option kann mit
+.BR \-c
+kombiniert werden.
+.PP
+.B \-m
+.I System\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= System\c
+\|[\|,.\|.\|.\|]
+.RS
+Wenn auch Manualseiten von einem anderen Betriebssystem installiert
+sind, so kann auf sie mit dieser Option zugegriffen werden. Um
+beispielsweise die Manualseiten von NewOS zu durchsuchen, muß
+.B \-m
+.BR NewOS
+angegeben werden.
+
+Das angegebene
+.I System
+kann eine durch Kommata abgetrennte Aufzählung von Betriebssystemnamen
+sein. Die normalen Seiten werden durch den Betriebssystemnamen
+.B man
+angesprochen. Diese Option überschreibt die Umgebungsvariable
+.RB $ SYSTEM.
+.RE
+.TP
+.B \-h, \-\-help
+Zeigt einen Hilfstext an.
+.TP
+.B \-V, \-\-version
+Zeigt Programmversion und Autor an.
+.SH UMGEBUNG
+.\".TP \w'MANPATH\ \ 'u
+.TP
+.B MANPATH
+Wenn
+.RB $ MANPATH
+gesetzt ist, gibt
+.B manpath
+diesen Wert auf die Standardausgabe aus. Warnungen werden auf die
+Standardfehlerausgabe ausgegeben.
+.TP
+.B SYSTEM
+Wenn
+.RB $ SYSTEM
+gesetzt ist, hat dies die gleiche Wirkung wie die Option
+.B \-m
+.I System
+wobei
+.I System
+als Inhalt von
+.RB $ SYSTEM
+angenommen wird.
+.SH DATEIEN
+.TP
+.I %manpath_config_file%
+Die Manualkonfigurationsdatei.
+.SH "SIEHE AUCH"
+.BR apropos "(1), " whatis "(1), " man (1).
+.SH AUTOR
+Wilf. (G.Wilford@ee.surrey.ac.uk),
+die deutsche Übersetzung ist von
+Anke Steuernagel (a_steuer@informatik.uni-kl.de) und
+Nils Magnus (magnus@informatik.uni-kl.de).
diff --git a/man/de_DE.88591/man1/whatis.man1 b/man/de_DE.88591/man1/whatis.man1
new file mode 100644
index 00000000..5c8f4e86
--- /dev/null
+++ b/man/de_DE.88591/man1/whatis.man1
@@ -0,0 +1,148 @@
+.\" Man page for whatis
+.\"
+.\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.)
+.\" Deutsche Übersetzung von Anke Steuernagel und Nils Magnus
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the man
+.\" distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH whatis 1 "%date_de%" "%version%" "Manual Hilfsprogramme"
+.LO 1
+.SH NAME
+whatis \- durchsucht die Indexdatenbank nach Kurzbeschreibungen
+.SH SYNTAX
+.B whatis
+.RB [\| \-dhV \|]
+.RB [\| \-r \||\| \-w\c
+\|]
+.RB [\| \-m
+.IR System \|[\|,.\|.\|.\|]\|]
+.RB [\| \-M
+.IR Pfad \|]
+.I Schlüsselwort
+\&.\|.\|.
+
+.SH BESCHREIBUNG
+Innerhalb jeder Manualseite ist eine Kurzbeschreibung vorhanden.
+.B whatis
+sucht
+.I Schlüsselwort
+in den Kurzbeschreibungen der
+.I Indexdatenbank.
+Falls es eine solche nicht im Manualpfad
+gibt, durchsucht es die
+.I whatis-
+Datenbank nach
+.IR Schlüsselwort.
+Diese Version von
+.B whatis
+kann Schlüsselwörter suchen, die Wildcards oder reguläre
+Ausdrücke enthalten.
+
+.B mandb
+erzeugt die
+.I Indexdatenbank
+für jeden Manualpfad. Um eine Datei im alten Stil als
+.I whatis-
+Datenbank aus der
+.I Indexdatenbank
+zu erzeugen, ist folgender Befehl einzugeben
+
+.B whatis \-M
+.I Pfad
+.B \-w '*' | sort >
+.I manpath/whatis
+
+wobei
+.I Pfad
+eine Manualhierarchie wie
+.IR /usr/man
+ist.
+.SH OPTIONEN
+.TP
+.B \-d, \-\-debug
+Ausgeben von Fehlerinformationen.
+.TP
+.B \-r, \-\-regex
+Interpretiert jedes Schlüsselwort als regulären Ausdruck.
+Wenn ein Schlüsselwort irgendeinem Teil eines Seitennamens
+entspricht, wird eine Übereinstimmung gefunden.
+.TP
+.B \-w, \-\-wildcard
+Das Schlüsselwort kann Wildcards wie in der Shell beinhalten.
+Um eine Übereinstimmung zu finden, muß ein expandiertes
+Schlüsselwort mit einem kompletten Seitennamen übereinstimmen.
+.PP
+.B \-m
+.I System\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= System\c
+\|[\|,.\|.\|.\|]
+.RS
+Wenn auch Manualseiten von einem anderen Betriebssystem installiert
+sind, so kann auf sie mit dieser Option zugegriffen werden. Um
+beispielsweise die Manualseiten von NewOS zu durchsuchen, muß
+.B \-m
+.BR NewOS
+angegeben werden.
+
+Das angegebene
+.I System
+kann eine durch Kommata abgetrennte Aufzählung von Betriebssystemnamen
+sein. Die normalen Seiten werden durch den Betriebssystemnamen
+.B man
+angesprochen. Diese Option überschreibt die Umgebungsvariable
+.RB $ SYSTEM.
+.RE
+.TP
+.BI \-M\ Pfad ,\ \-\-manpath= Pfad
+Gibt die Manualpfade an. Wenn mehrere Pfade angegeben werden, müssen
+diese durch Doppelpunkte getrennt sein. Als Default benutzt
+.B whatis
+.B manpath,
+um den Suchpfad zu bestimmen. Diese Option überschreibt die Umgebungsvariable
+.RB $ MANPATH.
+.TP
+.B \-h, \-\-help
+Zeigt einen Hilfstext an.
+.TP
+.B \-V, \-\-version
+Zeigt Programmversion und Autor an.
+.SH DATEIEN
+.TP
+.I /var/catman/\|.\|.\|.\|/index.(bt|db|dir|pag)
+Die
+.B FSSTND
+complianten globalen
+.I Indexdatenbanken.
+.TP
+.I /usr/man/\|.\|.\|.\|/whatis
+Traditionelle
+.I whatis
+Datenbank.
+.SH "SIEHE AUCH"
+.BR apropos "(1), " man "(1), " mandb (8).
+.SH FEHLER
+Wenn die
+.B \-r
+oder
+.B \-w
+Optionen benutzt werden und Shell-Metazeichen in einem
+.IR Schlüsselwort
+vorkommen, kann es notwendig sein,
+.I Schlüsselwort
+zu quoten, damit die Shell nicht versucht, diese Zeichen zu interpretieren.
+
+Die
+.B \-r
+und
+.B \-w
+Optionen können verwirrende Ausgaben erzeugen und verlangsamen die Suche.
+.SH AUTOR
+Wilf. (G.Wilford@ee.surrey.ac.uk),
+die deutsche Übersetzung ist von
+Anke Steuernagel (a_steuer@informatik.uni-kl.de) und
+Nils Magnus (magnus@informatik.uni-kl.de).
diff --git a/man/de_DE.88591/man1/zsoelim.man1 b/man/de_DE.88591/man1/zsoelim.man1
new file mode 100644
index 00000000..e55ac452
--- /dev/null
+++ b/man/de_DE.88591/man1/zsoelim.man1
@@ -0,0 +1,82 @@
+.\" Man page for zsoelim
+.\"
+.\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.)
+.\" Deutsche Übersetzung von Anke Steuernagel und Nils Magnus
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the man
+.\" distribution.
+.\"
+.\" Sat Dec 10 19:33:32 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH zsoelim 1 "%date_de%" "%version%" "Manual Hilfsprogramme"
+.LO 1
+.SH NAME
+zsoelim \- interpretiert .so Steuerzeilen von nroff-Quellen
+.SH SYNTAX
+.B zsoelim
+.RB [\| \-CVh \|]
+.RI [\| Datei
+\&.\|.\|.\|]
+.SH BESCHREIBUNG
+.B zsoelim
+bearbeitet in denen durch
+.I Datei
+angegebenen Argumente oder, wenn keine angegeben sind, die Standardeingabe
+die Zeilen der Form
+
+.B .so
+.RI <\| Dateiname \|>
+
+Diese Einträge werden durch die Inhalte der so spezifizierten Datei
+ersetzt. Falls
+.I Datei
+nicht gefunden wird, sucht
+.B zsoelim
+nach
+.I Datei.Ext
+wobei die Erweiterung
+.I .Ext
+entweder
+.B .gz,
+.B .Z
+oder
+.B .z
+sein kann. Andere Erweiterungen können unterstützt werden, müssen
+aber zur Übersetzungszeit bekannt sein. Wenn eine Datei mit
+Erweiterung gefunden wurde, wird das dazu passende Programm
+aufgerufen und dessen Ausgabe wird verwendet, um die eigentliche Zeile
+zu ersetzen.
+
+Die Hauptaufgabe für
+.B zsoelim
+besteht darin, Präprozessoren die Bearbeitung der referenzierten
+Dateien zu ermöglichen. Diese spezielle Version wurde geschrieben, um
+einige Probleme im Zusammenhang mit komprimierten Quelldateien zu
+beheben, die ansonsten bei der Bearbeitung von cat-Manualseiten
+entstehen würden.
+
+.SH OPTIONEN
+.TP
+.B \-C
+Diese Option ist zur Kompatibilität mit anderen
+.B zsoelim
+Programmen und dient dazu, nach einer .so-Zeile auch andere Zeichen
+außer Whitespace zu erlauben. Da dies sowieso das Normalverhalten
+ist, wird diese Option ignoriert.
+.TP
+.B \-h
+Zeigt einen Hilfstext an.
+.TP
+.B \-V
+Zeigt Programmversion und Autor an.
+.SH "SIEHE AUCH"
+.BR nroff (1),
+.BR troff (1),
+.BR groff (1),
+.BR man (1).
+.SH AUTOR
+Wilf. (G.Wilford@ee.surrey.ac.uk),
+die deutsche Übersetzung ist von
+Anke Steuernagel (a_steuer@informatik.uni-kl.de) und
+Nils Magnus (magnus@informatik.uni-kl.de).
diff --git a/man/de_DE.88591/man5/manpath.man5 b/man/de_DE.88591/man5/manpath.man5
new file mode 100644
index 00000000..1ed79b4f
--- /dev/null
+++ b/man/de_DE.88591/man5/manpath.man5
@@ -0,0 +1,118 @@
+.\" Man page for format of the manpath.config data file
+.\"
+.\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.)
+.\" Deutsche Übersetzung von Anke Steuernagel und Nils Magnus
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the man
+.\" distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH man 5 "%date_de%" "%version%" "%manpath_config_file%"
+.LO 5
+.SH NAME
+manpath \- Format der %manpath_config_file% Datei
+.SH BESCHREIBUNG
+Die beschriebene Konfigurationsdatei wird von
+.BR man ,
+.B mandb
+und
+.B manpath
+benutzt, um den Benutzer-Manualpfad zur Laufzeit zu bestimmen und um
+den globale Manualhierarchien die zugehörigen
+cat-Verzeichnisse zuzuordnen.
+.SH FORMAT
+Die folgenden Feldtypen werden erkannt:
+.TP
+.B MANDATORY_MANPATH Manualpfad
+Zeilen dieser Form zeigen die Manualpfade an, die jede automatisch generierte
+.RB $ MANPATH
+Variable beinhalten sollte.
+.TP
+.B MANPATH_MAP Pfad Manualpfad
+Zeilen dieser Form wandeln
+.RB $ PATH
+in die entsprechende
+.RB $ MANPATH
+Syntax um.
+.RB $ MANPATH
+wird um die zu Pfade ergänzt, die zu den Pfaden in
+.RB $ PATH
+korrespondieren.
+
+Dies überschreibt nicht die Umgebungsvariable
+.RB $ MANPATH,
+wenn diese gesetzt ist.
+.TP
+.BR MANDB_MAP\ Manualpfad \ \|[\| cat-Pfad \|]
+Zeilen dieser Form geben die Manualpfade an, die als global angesehen
+werden. Normalerweise beinhalten diese die systemweit lesbaren Manualpfade
+in
+.IR /usr .
+
+Zum Vorteil des System-Administrators kann jedes
+Verzeichnis, in das
+.B man
+schreiben kann, als
+.B cat-Pfad
+definiert werden. Um den
+.BR FSSTND
+einzuhalten, kann das Schlüsselwort
+.RB ` FSSTND '
+anstelle eines Verzeichnisses benutzt werden. In diesem Fall verwendet
+.B man
+das zugehörige
+.B FSSTND
+compliante Verzeichnis. Wenn
+.B cat-Pfad
+fehlt, übernimmt
+.B cat-Pfad
+den Wert von
+.B Manualpfad.
+Diese Funktion ist auch mit Nicht-
+.B Linux-FSSTND
+complianten Systemen möglich.
+
+Es ist notwendig,
+.B alle
+globalen Manualpfade, einschließlich spezieller Pfade auf anderen
+Systeme, wie z. B.
+.I /usr/man/sun,
+und alle
+.B lokale
+Pfade, wie
+.IR /usr/man/de_DE.88591,
+anzugeben. Für
+.B man
+ist es notwendig, daß diese Pfade existieren, um dort cat-Dateien zu
+erstellen.
+
+Zusätzlich ist es notwendig, daß Manualpfade, die wiederum in anderen
+Manualpfaden
+.B enthalten
+sind,
+.B zuerst
+aufgezählt werden. Also muß z. B.
+.I /usr/man/de_DE.88591
+vor
+.IR /usr/man
+aufgelistet werden.
+
+Wenn cat-Seiten nicht ständig benötigt werden, kann der
+.B cat-Pfad
+entfallen. Dabei ist zu beachten, daß die Verzeichnisse
+.I <Manualpfad>/cat*
+nicht existieren. Um das Erzeugen von cat-Seiten zeitweilig zu unterbinden,
+kann man das Schreiben in die cat-Verzeichnisse verbieten.
+Wenn
+.B cat-Pfad
+auf ein ungültiges Verzeichnis wie
+.IR /dev/null
+gesetzt wird, hat dies den gleichen Effekt. Dadurch wird aber der Zugriff der
+Manual-Hilfsprogramme auf die
+.I Indexdatenbank
+dieses Manualpfades verweigert.
+.SH HINWEIS
+Es ist wichtig, daß diese Regeln genau befolgt werden, damit die
+Manual-Hilfsprogramme wie gewünscht funktionieren.
diff --git a/man/de_DE.88591/man8/accessdb.man8 b/man/de_DE.88591/man8/accessdb.man8
new file mode 100644
index 00000000..282cc6cc
--- /dev/null
+++ b/man/de_DE.88591/man8/accessdb.man8
@@ -0,0 +1,43 @@
+.\" Man page for accessdb
+.\"
+.\" Copyright (c) 1998 Fabrizio Polacco <fpolacco@debian.org
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Tue, 24 Feb 1998 18:18:36 +0200
+.\"
+.TH accessdb 8 "%date%" "%version%" "Manual pager utils"
+.SH NAME
+accessdb \- dumps the content of a man-db database in a human readable
+format.
+.SH SYNOPSIS
+.B /usr/sbin/accessdb
+.RI [ <index-file> ]
+.SH DESCRIPTION
+.B accessdb
+will output the data contained within a man_db database in a
+human readable form. By default, it will dump the data from
+.B /var/catman/index.<db-type>,
+where <db-type> is dependent on the database library in use.
+
+Supplying an argument to accessdb will override this
+default.
+
+.nf
+$mtime$ -> "795987034"
+$version$ -> "2.3.1"
+apropos -> "1 1 795981542 A - - search the manual page names and descriptions"
+catman -> "8 8 795981544 A - - create or update the pre-formatted manual pages"
+man -> "1 1 795981542 A - - an interface to the on-line reference manuals"
+mandb -> "8 8 795981544 A - - create or update the manual page index caches"
+manpath -> " 1 5"
+manpath~1 -> "1 1 795981542 A - - determine search path for manual pages"
+manpath~5 -> "5 5 795981543 A - - format of the /etc/man_db.config file"
+whatis -> "1 1 795981543 A - - search the manual page names"
+zsoelim -> "1 1 795981543 A - - satisfy .so requests in roff input"
+.fi
+
+.SH AUTHOR
+Wilf. (G.Wilford@ee.surrey.ac.uk)
diff --git a/man/de_DE.88591/man8/catman.man8 b/man/de_DE.88591/man8/catman.man8
new file mode 100644
index 00000000..ea2f0115
--- /dev/null
+++ b/man/de_DE.88591/man8/catman.man8
@@ -0,0 +1,116 @@
+.\" Man page for catman
+.\"
+.\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.)
+.\" Deutsche Übersetzung von Anke Steuernagel und Nils Magnus
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the man
+.\" distribution.
+.\"
+.\" Sat Dec 10 14:17:29 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH catman 8 "%date_de%" "%version%" "Manual Hilfsprogramme"
+.LO 1
+.SH NAME
+catman \- erzeugt oder aktualisiert die formatierten Manualseiten
+.SH SYNTAX
+.B catman
+.RB [\| \-dhV \|]
+.RB [\| \-M
+.IR Pfad \|]
+.RI [\| Abschnitt \|]
+\&.\|.\|.
+.SH BESCHREIBUNG
+.B catman
+wird benutzt, um einen aktuellen Satz von vorformatierten Manualseiten zu
+erzeugen, die als cat-Seiten bezeichnet werden. Die cat-Seiten werden
+wesentlich schneller angezeigt als die unformatierten Manualseiten, benötigen
+aber zusätzlichen Speicherplatz auf der Festplatte. Die Entscheidung zur
+Unterstützung von cat-Seiten liegt beim lokalen Administrator, der für diese
+Seiten passende Verzeichnisse anlegen muß.
+
+Die Optionen für
+.B catman
+geben die Manualseiten und die Abschnitte an, die vorformatiert werden
+sollen. Im Normalfall werden die Manualseiten verwendet, die in der
+Manualkonfigurationsdatei beschrieben sind. Normalerweise werden die
+Abschnitte formatiert, die entweder in der Umgebungsvariable
+.RB $ MANSEC
+stehen oder fest in
+.BR man (1)
+einkompiliert sind, wenn
+.RB $ MANSEC
+undefiniert ist. Wird
+.B catman
+eine durch Whitespace abgetrennte Liste von Abschnitten übergeben, so werden
+nur die Manualseiten in den betreffenden Abschnitten bearbeitet.
+
+Um festzustellen, welche Dateien formatiert werden müssen, macht
+.B catman
+Gebrauch von den
+.I Indexdatenbanken
+der jeweiligen Manualseiten.
+.SH OPTIONEN
+.TP
+.B \-d, \-\-debug
+Ausgeben von Fehlerinformationen.
+.TP
+.BI \-M\ Pfad ,\ \-\-manpath= Pfad
+Gibt einen alternativen Manualpfad an.
+Als Default sind dies alle Pfade, die in der Manualkonfigurationsdatei
+als global deklariert sind. Die Umgebungsvariable
+.RB $ MANPATH
+wird von
+.BR catman
+nicht benutzt.
+.TP
+.B \-h, \-\-help
+Zeigt einen Hilfstext an.
+.TP
+.B \-V, \-\-version
+Zeigt Programmversion und Autor an.
+.SH DATEIEN
+.TP
+.I /var/catman/\|.\|.\|.\|/index.(bt|db|dir|pag)
+Die
+.B FSSTND
+complianten globalen
+.I Indexdatenbanken.
+.TP
+.I /usr/man/\|.\|.\|.\|/whatis
+Traditionelle
+.I whatis
+Datenbank.
+.SH "SIEHE AUCH"
+.BR man (1),
+.BR manpath (5),
+.BR mandb (8).
+.SH FEHLER
+Auf Systemen mit kleinem (~4 kByte) Zwischenspeicher für Argumente von
+.BR execve (2)
+kann es nötig sein, daß
+.B catman
+mehrere kleine im Gegensatz zu wenigen großen Batchjobs ausführen muß.
+In diesem Fall ist es für
+.B man
+möglich, diesen Eintrag (korrekt) aus einer Datenbank zu löschen (vielleicht
+existiert er in Wirklichkeit gar nicht mehr), der vom aktuellen Aufruf von
+.B catman
+benötigt wird, um die nächste Seite zu bestimmen. Wenn die
+.I Indexdatenbank
+einen Hashtable-Lookup (ndbm, gdbm) benutzt, führt dies zu einem `sich am
+eigenen Schopf aus dem Sumpf ziehen'. Obgleich dies selten auftritt, führt es
+dazu, daß
+.B catman
+nicht mehr die weiteren Seiten des Abschnittes bearbeitet.
+
+Hinweis:
+.B Linux
+hat einen Zwischenspeicher von 128 kByte für
+.B execve (2)
+Argumente.
+.SH AUTOR
+Wilf. (G.Wilford@ee.surrey.ac.uk),
+die deutsche Übersetzung ist von
+Anke Steuernagel (a_steuer@informatik.uni-kl.de) und
+Nils Magnus (magnus@informatik.uni-kl.de).
diff --git a/man/de_DE.88591/man8/mandb.man8 b/man/de_DE.88591/man8/mandb.man8
new file mode 100644
index 00000000..f54731eb
--- /dev/null
+++ b/man/de_DE.88591/man8/mandb.man8
@@ -0,0 +1,123 @@
+'\" t
+.\" Man page for mandb
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\" Deutsche Übersetzung von Anke Steuernagel und Nils Magnus
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Tue Apr 26 12:56:44 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH mandb 8 "%date_de%" "%version%" "Manual Hilfsprogramme"
+.SH NAME
+mandb \- erzeugt oder aktualisiert die Indexdatenbank
+.SH SYNTAX
+.B mandb
+.RB [\| \-dqsuc \||\| \-h \||\| \-V\c
+.RI "\|] [\|" Pfad \|]
+.SH BESCHREIBUNG
+Um die interne
+.I Indexdatenbank,
+die von
+.B man
+verwendet wird, zu initialisieren oder auf den neusten Stand zu bringen,
+wird
+.B mandb
+verwendet. Die
+.I Indexdatenbank
+enthält Informationen über den aktuellen Zustand der Manualseiten.
+
+Wenn eine
+.I Indexdatenbank
+erzeugt oder erneuert werden soll, warnt
+.B mandb
+vor möglichen Inkonsistenzen, Seiten ohne nroff-Quelle oder Seiten ohne
+.B whatis-
+Beschreibungen.
+
+Wenn
+.B mandb
+beim Aufruf ein optionaler, durch Doppelpunkte abgetrennter Pfad
+übergeben wird, so wird der interne durch die Konfigurationsdatei
+bestimmte Manualpfad verdeckt.
+.SH INDEXDATENBANKEN
+Von
+.B mandb
+wird einer der folgenden Datenbanktypen verwendet (Auswahl während
+der Übersetzungszeit):
+
+.TS
+tab (@);
+l l l l.
+Name@Typ@asyncron@Dateiname
+_
+Berkeley db@Binärbaum@Ja@\fIindex.bt\fR
+GNU gdbm v >= 1.6@Hashtabelle@Ja@\fIindex.db\fR
+GNU gdbm v < 1.6@Hashtabelle@Nein@\fIindex.db\fR
+UNIX ndbm@Hashtabelle@Nein@\fIindex.(dir|pag)\fR
+.TE
+
+Die Datenbanktypen, die asyncrone Veränderungen erlauben, erlauben eine
+höhere Geschwindigkeit zulasten der Möglichkeit, daß bei einer
+nichtgewöhlichen Beendung des Programms die Datenbank fehlerhaft sein
+kann.
+
+In diesem seltenen Fall kann es nötig sein,
+.B mandb
+mit der
+.B \-c
+Option zu starten, um die Datenbanken von Grund auf neu zu erstellen.
+.SH OPTIONEN
+.TP
+.B \-d, \-\-debug
+Erzeugt Debug-Informationen.
+.TP
+.B \-q, \-\-quiet
+Unterdrückt die Warnungen.
+.TP
+.B \-s, \-\-no-straycats
+Beachtet beim Aufbau keine cat-Seiten ohne zugehörige
+nroff-Quellen (sog.
+.I stray-cats).
+.TP
+.B \-c, \-\-create
+Im Normalfall versucht
+.B mandb
+zunächst eine bestehende Datenbank auf den aktuellen Stand zu bringen
+und erzeugt eine neue nur dann, wenn noch keine solche
+existiert. Durch Angabe dieser Option wird
+.B mandb
+dazu gezwungen, die Datenbank von Grund auf neu zu erstellen.
+.TP
+.B \-u, \-\-user-db
+Erzeugt nur die benutzerspezifischen Datenbanken, selbst wenn
+Schreibrechte auf systemweite Manualhierarchien bestehen.
+.TP
+.B \-h, \-\-help
+Zeigt einen Hilfstext an.
+.TP
+.B \-V, \-\-version
+Zeigt Programmversion und Autor an.
+.SH DATEIEN
+.TP
+.I /var/catman/\|.\|.\|.\|/index.(bt|db|dir|pag)
+Die
+.B FSSTND
+complianten globalen
+.I Indexdatenbanken.
+.TP
+.I /usr/man/\|.\|.\|.\|/whatis
+Traditionelle
+.I whatis
+Datenbank.
+.SH "SIEHE AUCH"
+.BR man (1),
+.BR manpath (5),
+.BR catman (8).
+.SH AUTOR
+Wilf. (G.Wilford@ee.surrey.ac.uk),
+die deutsche Übersetzung ist von
+Anke Steuernagel (a_steuer@informatik.uni-kl.de) und
+Nils Magnus (magnus@informatik.uni-kl.de).
diff --git a/man/de_DE.ascii/man1/apropos.man1 b/man/de_DE.ascii/man1/apropos.man1
new file mode 100644
index 00000000..8b4ba247
--- /dev/null
+++ b/man/de_DE.ascii/man1/apropos.man1
@@ -0,0 +1,135 @@
+.\" Man page for apropos
+.\"
+.\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.)
+.\" Deutsche Uebersetzung von Anke Steuernagel und Nils Magnus
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the man
+.\" distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH apropos 1 "%date%" "%version%" "Manual Hilfsprogramme"
+.LO 1
+.SH NAME
+apropos \- sucht die Manualkurzbeschreibung in der Indexdatenbank
+.SH SYNTAX
+.B apropos
+.RB [\| \-dhV \|]
+.RB [\| \-e \||\| \-r \||\| \-w\c
+\|]
+.RB [\| \-m
+.IR System \|[\|,.\|.\|.\|]\|]
+.RB [ \-M
+.IR Pfad \|]
+.I Schluesselwort
+\&.\|.\|.
+.SH BESCHREIBUNG
+Innerhalb jeder Manualseite ist eine Kurzbeschreibung vorhanden.
+.B apropos
+sucht das Schluesselwort in den Kurzbeschreibungen der
+.I Indexdatenbank.
+Falls es eine solche nicht im Manualpfad gibt, durchsucht es die
+.I whatis-
+Datenbank nach
+.IR Schluesselwort.
+Das Schluesselwort kann Wildcards oder regulaere Ausdruecke enthalten. Bei der
+Standardsuche (nicht bei
+.B \-r
+oder
+.BR \-w )
+wird nach Treffern am Anfang von Worten in den Beschreibungen und in
+Befehlsnamen gesucht. Die Nicht-Standardsuche ist weiter unten beschrieben.
+.SH OPTIONEN
+.TP
+.B \-d, \-\-debug
+Ausgeben von Fehlerinformationen.
+.TP
+.B \-e, \-\-exact
+Sucht nach einem genau passenden Wort, im Gegensatz zu der sonst ueblichen
+fuzzy-Uebereinstimmung. Beispielsweise wird in diesem Fall das Schluesselwort
+`string' nicht in dem Text `strings' gefunden. Ein Treffer muss also sowohl am
+Anfang als auch am Ende des Wortes uebereinstimmen.
+.TP
+.B \-r, \-\-regex
+Interpretiert jedes Schluesselwort als regulaeren Ausdruck. Jedes
+Schluesselwort wird im Befehlsnamen und in der Beschreibung gesucht. Die
+Uebereinstimmung ist nicht durch Wortgrenzen beschraenkt.
+.TP
+.B \-w, \-\-wildcard
+Das Schluesselwort kann Wildcards wie in der Shell (z. B. *, ?, ...)
+beinhalten. Das Schluesselwort wird in den Befehlsnamen und in den
+Kurzbeschreibungen gesucht. Nur wenn ein expandiertes Schluesselwort auf eine
+komplette Beschreibung oder einen Befehlsnamen passt, wird eine
+Uebereinstimmung gefunden.
+.PP
+.B \-m
+.I System\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= System\c
+\|[\|,.\|.\|.\|]
+.RS
+Wenn auch Manualseiten von einem anderen Betriebssystem installiert
+sind, so kann auf sie mit dieser Option zugegriffen werden. Um
+beispielsweise die Manualseiten von NewOS zu durchsuchen, muss
+.B \-m
+.BR NewOS
+angegeben werden.
+
+Das angegebene
+.I System
+kann eine durch Kommata abgetrennte Aufzaehlung von Betriebssystemnamen
+sein. Die normalen Seiten werden durch den Betriebssystemnamen
+.B man
+angesprochen. Diese Option ueberschreibt die Umgebungsvariable
+.RB $ SYSTEM.
+.RE
+.TP
+.BI \-M\ Pfad ,\ \-\-manpath= Pfad
+Gibt die Manualpfade an. Wenn mehrere Pfade angegeben werden, muessen diese
+durch Doppelpunkte getrennt sein. Als Default benutzt
+.B apropos
+.B manpath,
+um den Suchpfad zu bestimmen. Diese Option ueberschreibt die
+.RB $ MANPATH
+Umgebungsvariable.
+.TP
+.B \-h, \-\-help
+Zeigt einen Hilfstext an.
+.TP
+.B \-V, \-\-version
+Zeigt Programmversion und Autor an.
+.SH DATEIEN
+.TP
+.I /var/catman/\|.\|.\|.\|/index.(bt|db|dir|pag)
+Die
+.B FSSTND
+complianten globalen
+.I Indexdatenbanken.
+.TP
+.I /usr/man/\|.\|.\|.\|/whatis
+Traditionelle
+.I whatis
+Datenbank.
+.SH "SIEHE AUCH"
+.BR whatis "(1), " man "(1), " mandb (8).
+.SH FEHLER
+Wenn die
+.B \-r
+oder
+.B \-w
+Optionen benutzt werden und in einem
+.IR Schluesselwort
+Shell-Metazeichen vorkommen, kann es notwendig sein,
+.I Schluesselwort
+zu quoten, damit die Shell nicht versucht, diese Zeichen zu interpretieren.
+Die
+.B \-r
+und
+.B \-w
+Optionen koennen verwirrende Ausgaben erzeugen.
+.SH AUTOR
+Wilf. (G.Wilford@ee.surrey.ac.uk),
+die deutsche Uebersetzung ist von
+Anke Steuernagel (a_steuer@informatik.uni-kl.de) und
+Nils Magnus (magnus@informatik.uni-kl.de).
diff --git a/man/de_DE.ascii/man1/man.man1 b/man/de_DE.ascii/man1/man.man1
new file mode 100644
index 00000000..46789d22
--- /dev/null
+++ b/man/de_DE.ascii/man1/man.man1
@@ -0,0 +1,841 @@
+'\" t
+.\" ** The above line should force tbl to be a preprocessor **
+.\" Man page for man
+.\"
+.\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.)
+.\" Deutsche Uebersetzung von Anke Steuernagel und Nils Magnus
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the man
+.\" distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH man 1 "%date%" "%version%" "Manual Hilfsprogramme"
+.LO 1
+.SH NAME
+man \- Programm zum Einsehen der Online-Manuale
+.SH SYNTAX
+.\" Die allgemeine Kommandozeile
+.\".TP \w`man\ `u
+.B man
+.RB [\| \-acdhwutZV \|]
+.RB [\| \-m
+.IR System \|[\|,.\|.\|.\|]\|]
+.RB [\| \-L
+.IR locale \|]
+.RB [\| \-p
+.IR Zeichenkette \|]
+.RB [\| \-M
+.IR Pfad \|]
+.RB [\| \-P
+.IR Pager \|]
+.RB [\| \-r
+.IR Prompt \|]
+.RB [\| \-T
+.IR Format \|]
+.RB [\| \-S
+.IR Liste \|]
+.RB [\| \-e
+.IR Erweiterung \|]
+.RI [\|[\| Abschnitt \|]
+.IR Seite \ .\|.\|.\|]\ .\|.\|.
+.\" The --local command line
+.br
+.B man
+.B \-l
+.RB [\| \-tZ \|]
+.RB [\| \-p
+.IR Zeichenkette \|]
+.RB [\| \-P
+.IR Pager \|]
+.RB [\| \-r
+.IR Prompt \|]
+.RB [\| -T
+.IR Format \|]
+.I Datei
+\&.\|.\|.
+.\" The apropos command line
+.br
+.B man
+.B \-k
+.I Schluesselwort
+\&.\|.\|.
+.\" The whatis command line
+.br
+.B man
+.B \-f
+.I Seite
+\&.\|.\|.
+.SH BESCHREIBUNG
+.B man
+ist der Manualbrowser des Systems. Jedes Argument
+.I Seite
+ist normalerweise der Name eines Programmes oder einer
+Funktion. Gefunden und angezeigt wird die
+.I Manualseite,
+die auf alle Argumente passt. Wenn ein
+.IR Abschnitt
+angegeben wird, sucht
+.B man
+nur in diesem
+.I Abschnitt
+der Manualseiten. Ohne Angabe eine explizite Angabe werden alle verfuegbaren
+.IR Abschnitte
+in einer vorher definierten Reihenfolge durchsucht.
+Wenn die
+.I Seite
+in mehreren
+.IR Abschnitten
+vorkommt, wird nur die jeweils erste
+.I Seite
+angezeigt, die gefunden wird.
+
+Die folgende Tabelle zeigt die Nummern der
+.I Abschnitte
+der Manualseiten gefolgt vom Typ der dort zu findenden Seiten.
+
+.TS
+tab (@);
+l l.
+1@Ausfuehrbare Programme oder Shellbefehle
+2@Systemaufrufe (Kernelfunktionen)
+3@Bibliotheksaufrufe (Funktionen in System-Bibliotheken)
+4@Spezielle Dateien (gewoehnlich in \fI/dev\fR)
+5@Dateiformate und Konventionen, z. B. \fI/etc/passwd\fR
+6@Spiele
+7@Makropakete und Konventionen, z. B. \fBman\fR(7), \fBgroff\fR(7)
+8@Systemadministrationsbefehle (in der Regel nur fuer root)
+9@Kernelroutinen [\|Nicht Standard\|]
+n@neu [\|veraltet\|]
+l@lokal [\|veraltet\|]
+p@oeffentlich [\|veraltet\|]
+o@alt [\|veraltet\|]
+.TE
+
+Eine Manualseite besteht aus mehreren Teilen. Die ueblichen
+Bezeichnungen sind u. a.
+.BR NAME ,
+.BR SYNTAX ,
+.BR BESCHREIBUNG ,
+.BR OPTIONEN ,
+.BR DATEIEN ,
+.BR SIEHE\ AUCH ,
+.BR FEHLER ,
+und
+.BR AUTOR .
+
+Die folgenden Konventionen gelten fuer den Abschnitt
+.B SYNTAX
+und koennen fuer andere Abschnitte als Anleitung benutzt werden.
+
+.TS
+tab (@);
+l l.
+\fBbold text\fR@Literale Angaben wie in der Anzeige.
+\fIitalic text\fR@Ersetzen durch passendes Argument.
+[\|\fB\-abc\fR\|]@Ein oder mehrere Argumente innerhalb der [ ] sind optional.
+\fB\-a\|\fR|\|\fB\-b\fR@Optionen, die durch | abgegrenzt sind, koennen nicht zusammen benutzt werden.
+\fIArgument\fB .\|.\|.@\fIArgument\fR kann wiederholt werden.
+[\|\fIAusdruck\fR\|]\fB .\|.\|.@\fRgesamter \fIAusdruck\fR\ innerhalb [ ] kann wiederholt werden.
+.TE
+
+Die Befehls- oder Funktionsbeispiele sind Muster, die auf alle moeglichen
+Aufrufe passen sollten. In manchen Faellen ist es ratsam, die verschiedenen
+sich ausschliessenden Aufrufe zu illustrieren, wie es im
+.B SYNTAX
+Abschnitt dieser Manualseite gezeigt ist.
+.SH BEISPIELE
+.TP \w'man\ 'u
+.BI man \ ls
+zeigt die Manualseite fuer das Programm
+.IR ls
+an.
+.TP
+.BI man\ \-a \ intro
+zeigt alle vorhandenen
+.I intro
+Manualseiten an. Mit (q)uit ist es moeglich, das aufeinanderfolgendende
+Anzeigen der Seiten abzubrechen oder mit (s)kip eine Seite zu ueberspringen.
+.TP
+\fBman \-t \fIalias \fR|\fI lpr -Pps
+Formatiert die Manualseite, die sich auf
+.RI alias
+bezieht, in das Default
+.B troff
+oder
+.B groff
+Format und schickt es an den Drucker
+.IR ps .
+Die Defaultausgabe fuer
+.B groff
+ist Postscript. Das Default fuer
+.B troff
+\- ditroff, benoetigt weitere Bearbeitung durch grops, bevor es von einem
+Postscriptdrucker gedruckt werden kann.
+.B man \-\-help
+sollte zu bestimmen helfen, welcher Prozessor an die
+.B \-t
+Option gebunden ist.
+.TP
+.BI man\ \-l\ \-T dvi\ ./foo.1x.gz \ >\ ./foo.1x.dvi
+Dieser Befehl formatiert die komprimierte nroff-Manualseite
+.I ./foo.1x.gz
+in eine
+.B device independent (dvi)
+Datei. Diese Datei wird zuerst dekomprimiert, bevor sie durch passende Filter
+und Programme bearbeitet wird. Die Umlenkung ist notwendig, da die
+.B \-T
+Option die Ausgabe unformatiert an die
+.B Standardausgabe
+schickt. Die Ausgabe kann mit einem Programm wie
+.B xdvi
+betrachtet oder mit einem Programm wie
+.BR dvips
+in Postscript weiterverarbeitet werden.
+.TP
+.BI man\ \-k \ printf
+Sucht die Kurzbeschreibungen und die Namen der Manualseiten zum
+.I Schluesselwort
+.IR printf
+und gibt alle Treffer aus.
+.TP
+.BI man\ \-f \ smail
+Sucht die Manualseiten, die sich auf
+.I smail
+beziehen und gibt alle gefundenen Kurzbeschreibungen aus.
+.SH UEBERSICHT
+Um dem Benutzer eine groesstmoegliche Flexibilitaet zu bieten, sind in
+.B man
+viele Optionen verfuegbar. Veraenderungen koennen am Suchpfad, in der
+Reihenfolge der Abschnitte oder am Ausgabeprozessor vorgenommen werden. Andere
+Verhaltensweisen und Operationen sind weiter unten beschrieben.
+
+Um die Arbeitsweise von
+.BR man
+zu bestimmen, werden verschiedene Umgebungsvariablen benutzt. Mit
+dieser Version ist es moeglich, die Variable
+.RB $ MANOPT
+auf einen Ausdruck im Kommandozeilenformat zu setzen. Es gibt folgende
+Ausnahme: Da jede Option in
+.RB $ MANOPT
+von Leerzeichen eingeschlossen ist, muessen Leerzeichen, die Teil eines
+Argumentes sind, gequotet werden.
+.B man
+bearbeitet diese Variable vor der eigenen Kommandozeile. Die Optionen, die ein
+Argument benoetigen, koennen durch die gleichen Optionen in der Kommandozeile
+ueberschrieben werden.
+Um alle Optionen zurueckzusetzen, die in
+.RB $ MANOPT
+gesetzt werden, kann
+.B \-D
+als initiale Kommandozeilen-Option angegeben werden.
+Dies erlaubt
+.B man
+alle Optionen zu `ueberschreiben', die in
+.RB $ MANOPT
+gesetzt werden, obwohl diese weiterhin gelten. Damit wird die groesstmoegliche
+Flexibilitaet fuer einen Benutzer erzeugt, der
+.B man
+auf seine eigenen Beduerfnisse anpassen will, ohne zahllose
+Optionen bei der Suche einer Manualseite einzugeben.
+
+Die Hilfsprogramme, die im
+.B man_db-
+Paket zusammengefasst sind, machen umfassenden Gebrauch von
+.I Indexdatenbanken.
+Diese Zwischenspeicher enthalten Informationen ueber den Ort und
+die zugehoerige
+.I whatis
+Information (einzeilige Kurzbeschreibung der Manualseite), sowie darueber,
+wo sich eine Manualseite im Dateisystem befindet. Eine Aufgabe von
+.B man
+ist die Konsistenzsicherung der Datenbank. Die Datenbanken verhindern die
+Notwendigkeit einer manuellen Bearbeitung zur Aktualisierung der
+.I whatis-
+Textdatenbank und erlauben
+.B man
+schneller zu arbeiten, als bei der Suche nach der passenden
+Manualseite im gesamten Dateisystem.
+
+Wenn
+.B man
+keine von
+.B mandb
+erstellte
+.I Indexdatenbank
+zu einer speziellen Manualhierarchie finden kann, wird dennoch nach der
+gewuenschten Manualseite gesucht. In diesem Fall ist es jedoch wieder noetig,
+nach der alten Methode alle in Frage kommenden Verzeichnisse zu durchsuchen
+(sog. globbing). Wenn
+.B whatis
+oder
+.B apropos
+keine
+.I Indexdatenbank
+finden koennen, versucht es die Information aus der
+.I whatis-
+Datenbank zu beziehen.
+Auch anwenderspezifische Manualhierarchien werden waehrend der Benutzung in
+.I Indexdatenbanken
+zusammengefasst.
+
+Die Hilfsprogramme unterstuetzen komprimierte nroff-Quelldateien,
+die normalerweise die Erweiterung
+.BR .Z ", " .z " oder " .gz
+besitzen. Jede andere Erweiterung kann unterstuetzt werden, wenn sie zur
+Uebersetzungszeit bekannt ist. Als Default werden alle cat-Seiten mit
+.BR gzip
+komprimiert. Jede globale Manualhierarchie wie
+.I /usr/man
+oder
+.I /usr/X11R6/man
+kann jedes Verzeichnis als cat-Seiten-Hierarchie besitzen.
+Ueblicherweise werden cat-Seiten unter der gleichen Hierarchie wie die
+Manualseiten gespeichert. Allerdings kann es aus Gruenden, die im
+.BR "Linux File System Standard (FSSTND)"
+erlaeutert sind, besser sein, sie an anderer Stelle zu speichern.
+Details, wann dies der Fall ist, beschreibt
+.BR manpath (5).
+Fuer Details, warum dies empfohlen wird, siehe den
+.BR "Linux File System Standard (FSSTND)" .
+
+Dieses Paket unterstuetzt internationale Anpassungen (sog. NLS-Support, Native
+Language Support). Durch den Gebrauch von
+.I locale
+Funktionen ist es moeglich, Manualseiten der Landessprache zu verwalten, wenn
+sie auf dem System vorhanden sind. Um diese Unterstuetzung zu aktivieren, muss
+man entweder in
+.RB $ LC_MESSAGES ,
+.RB $ LANG
+oder anderen systemabhaengigen Umgebungsvariablen die gewuenschte Sprache
+einstellen. Die Sprache wird normalerweise in dem durch
+.B POSIX 1003.1
+definierten Format angegeben:
+.\"
+.\" Need a \c to make sure we don't get a space where we don't want one
+.\"
+.RI < Sprache >[\|\c
+.B _\c
+.RI < Region >\|[\|\c
+.B .\c
+.RI < Zeichensatz >\|[\|\c
+.B ,\c
+.RI < Version >\|]\|]\|]
+
+Wenn die angeforderte Seite in der
+.IR locale
+vorhanden ist, wird sie anstelle der Standardseite (normalerweise in
+amerikanischem Englisch) angezeigt. Darueber hinaus werden auch Sammlungen von
+landessprachlichen Systemmeldungen unterstuetzt und auf dieselbe Weise
+aktiviert - ebenfalls unter der Vorraussetzung, dass die uebersetzten
+Meldungen vorliegen. Wer diese Manualseiten und die Ausgaben der
+Hilfsprogramme gerne in seiner Landessprache haette, aber diese nicht
+vorfindet, ist aufgefordert, eine Uebersetzung anzufertigen und sie dem Autor
+zuzusenden, damit spaetere Versionen davon profitieren koennen.
+
+Die anderen Eigenschaften und Erweiterungen von
+.B man
+sind in den beiliegenden Dokumenten beschrieben. Einen umfassenden Einblick
+in die
+.B mandb
+zugrundeliegenden Konzepte sind in der Dokumentation
+.I man_db-2.3 - the database cached manual pager suite
+beschrieben. Die Dokumentation sollte auf denselben Server wie das
+.B mandb-
+Paket selbst zu finden sein.
+.SH NORMALEINSTELLUNGEN
+.B man
+sucht nach der gewueschten Manualseite in der
+.I Indexdatenbank.
+Wenn die Suche fehlschlaegt, wird ein Konsistenztest durchgefuehrt, um die
+korrekte Wiedergabe des Dateisystems zu sichern. Nachdem die Datenbanken
+erzeugt wurden, ist es i. A. nicht notwendig,
+.B mandb
+zu starten, es sei denn, die Datenbank wurde verfaelscht.
+
+Wenn eine Manualseite gefunden wurde, wird getestet, ob dazu bereits eine
+vorformatierte cat-Seite existiert und diese neuer als die nroff-Datei ist.
+In diesem Fall wird die vorformatierte Datei
+dekomprimiert und mit einem Browser angezeigt. Die Auswahl des Browsers kann
+auf unterschiedliche Weise erfolgen (fuer Details siehe
+.B \-P
+Option).
+Wenn keine cat-Seite gefunden wird oder wenn sie aelter als die nroff-Datei
+ist, wird die nroff-Datei durch diverse Programme gefiltert und
+entweder sofort angezeigt oder zuerst als komprimierte cat-Datei gespeichert
+und dann angezeigt.
+
+Eine cat-Datei wird erzeugt, wenn ein relatives cat-Verzeichnis existiert und
+.B man
+dort das Schreibrecht hat.
+
+Die Filter werden in mehreren Schritten zusammengestellt: Zuerst wird
+die Kommandozeilen-Option
+.B \-p
+oder die Umgebungsvariable
+.RB $ MANROFFSEQ
+untersucht. Wenn
+.B \-p
+nicht benutzt wird und die Umgebungsvariable nicht gesetzt ist, wird die
+Anfangszeile der nroff-Datei nach einer Zeichenkette fuer den Praeprozessor
+untersucht. Eine solche Praeprozessor-Zeichenkette muss folgendes Aussehen
+haben:
+
+.B '\e"
+.RB < Zeichenkette >
+
+wobei
+.B Zeichenkette
+jede Kombination von Buchstaben sein kann, die unter Option
+.B \-p
+weiter unten beschrieben sind.
+
+Wenn keine der obigen Methoden eine Filter-Information enthaelt, wird
+.B tbl
+als Default verwendet.
+
+Als primaerer Formatierer wird entweder
+.BR nroff ,
+.B troff
+oder
+.B groff
+gestartet.
+.\" ********************************************************************
+.SH OPTIONEN
+Eine Argumentoption, die entweder in der Kommandozeile, in
+.RB $ MANOPT
+oder in beiden doppelt vorkommt , ist nicht schaedlich. Fuer Optionen,
+die ein Argument benoetigen, ueberschreibt jedes Duplikat den
+vorhergehenden Wert.
+.TP
+.B \-l, \-\-local-file
+Aktiviert den lokalen Modus. Formatiert und zeigt lokale Manualdateien an,
+anstatt die System-Manualsammlung zu durchsuchen. Jedes
+Manualseiten-Argument wird als nroff-Quelle im richtigen Format
+interpretiert. Komprimierte nroff-Quelldateien mit einer unterstuetzten
+Kompressions-Erweiterung werden von
+.B man
+dekomprimiert, bevor sie ueber den ueblichen Filter angezeigt werden. Es wird
+keine cat-Datei erzeugt. Wenn eines der Argumente `\-' ist, wird die Eingabe
+von der Standardeingabe uebernommen.
+.TP
+.BI \-L\ locale ,\ \-\-locale= locale
+Normalerweise bestimmt
+.B man
+die aktuelle
+.B locale
+durch einen Aufruf der C Funktion
+.B setlocale (3),
+die diverse Umgebungsvariablen, darunter u. U.
+.RB $ LC_MESSAGES
+und
+.RB $ LANG
+untersucht.
+Diese Funktion kann dazu verwendet werden, kurzzeitig den so gefundenen Wert
+zu ueberschreiben. Dazu kann diese Option mit einer Zeichenkette, die die
+temporaere
+.B locale
+enthaelt, angegeben werden. Man beachte, dass dieser Effekt
+erst beim konkreten Suchen der Seite in Erscheinung tritt. Daher werden
+Ausgaben wie die Hilfeseite immer in der urspruenglichen Sprache ausgegeben.
+.TP
+.B \-D, \-\-default
+Diese Option wird normalerweise nur als allererste angegeben und setzt das
+Verhalten von
+.B man
+in allen Belangen wieder zum Normalverhalten zurueck. Der Zweck dieser Option
+ist es, Optionen wieder rueckgaengig zu machen, die bereits in der
+Umgebungsvariable
+.RB $ MANOPT
+gesetzt sind. Alle Optionen, die
+.B \-D
+folgen, haben wieder ihren gewohnten Effekt.
+.TP
+.BI \-M\ Pfad ,\ \-\-manpath= Pfad
+Ermoeglicht es, einen alternativen Manualpfad anzugeben. Normalerweise
+verwendet
+.B man
+dieselben Methoden wie in
+.B manpath,
+um den Suchpfad zu ermitteln. Diese Option ueberschreibt die Umgebungsvariable
+.RB $ MANPATH.
+.TP
+.BI \-P\ Pager ,\ \-\-pager= Pager
+Gibt an, welcher Pager verwendet wird. Die Normaleinstellung ist
+.BR %pager% .
+Diese Option ueberschreibt die Umgebungsvariable
+.RB $ PAGER
+und wird nicht in Zusammenhang mit
+.B \-f
+oder
+.BR \-k
+verwendet.
+.TP
+.BI \-r\ Prompt ,\ \-\-prompt= Prompt
+Wenn eine hinreichend neue Version von
+.B less
+als Pager verwendet wird, versucht
+.B man
+dort einige sinnvolle Optionen zu setzen. Die Eingabeaufforderung in der
+letzten Zeile sieht in dem Fall so aus:
+
+.B \ Manual page\c
+.IB \ name ( sec )\c
+.BI \ line \ x,
+
+wobei
+.I name
+die Manualseite bezeichnet, die gerade angezeigt wird,
+.I sec
+der Abschnitt ist, in dem sie gefunden wurde, und
+.IR x
+die aktuelle Zeilennummer ist.
+Diese Anzeige wird durch Verwendung der Umgebungsvariable
+.RB $ LESS
+erreicht.
+Man beachte, dass einzelne Bezeichnungen sich bei der Verwendung von
+landessprachlichen Meldungen aendern koennen.
+Die Option
+.B \-r
+ermoeglicht es, durch Angabe einer Formatierungszeichenkette, das
+Ausgabeformat selbst zu bestimmen. Wenn diese Zeichenkette
+.B $MAN_PN
+enthaelt, wird dieser Text durch den Namen der Manualseite gefolgt von der
+Abschnittsnummer in runden Klammern ersetzt. Die Zeichenkette, die im
+Normalfall verwendet wird ist:
+
+.B \e\ Manual\e\ page\e\ \e$MAN_PN\e\ ?ltline\e\ %lt?L/%L.:
+.br
+.B byte\e\ %bB?s/%s..?\e\ (END):?pB\ %pB\e\e%..
+
+Die zweizeilige Darstellung wurde nur der besseren Lesbarkeit wegen
+gewaehlt. Naehere Informationen liefert
+.BR less (1).
+Da die Zeichenkette zuerst vom Kommandointerpreter ausgewertet wird, muessen
+entsprechende Zeichen durch einen Backslash geschuetzt werden. Weitere
+Optionen fuer
+.B less
+koennen nach einem geschuetzten $ am Ende der Zeichenkette hinzugefuegt
+werden. Der Default ist hier
+.B \-ix8.
+.TP
+.BI \-S\ Liste ,\ \-\-sections= Liste
+Eine durch Doppelpunkte getrennte Liste von Abschnitten definiert bei
+Benutzung dieser Option die Reihenfolge, in der die Abschnitte durchsucht
+werden. Diese Option ueberschreibt die Umgebungsvariable
+.RB $ MANSECT.
+.TP
+.B \-a, \-\-all
+Wird eine Manualseite in einem Abschnitt gefunden, so terminiert
+.B man
+nach Anzeige dieser Seite. Wird jedoch diese Option angegeben, so werden alle
+passenden Manualseiten nacheinander angezeigt.
+.TP
+.B \-c, \-\-catman
+Diese Option ueberprueft nur, ob die zur angegebenen Manualseite passende
+cat-Seite aktuell ist und erzeugt ggf. eine neue. Es wird dabei nichts
+angezeigt.
+.TP
+.B \-d, \-\-debug
+Bei dieser Option werden keine Manualseiten angezeigt, sondern nur
+eine Menge von Diagnoseinformation.
+.TP
+.BI \-e\ Erweiterung ,\ \-\-extension= Erweiterung
+Einige Systeme enthalten grosse Pakete an Manualseiten, wie z. B. in dem
+.B Tcl
+Paket, die in die normalen Manualabschnitte integriert werden. Um
+beispielsweise das Problem zweier unterschiedlicher Manualseiten mit gleichem
+Namen, wie
+.BR exit (3),
+zu loesen, wurden frueher alle
+.B Tcl
+Seiten dem Abschnitt
+.BR l
+zugeordnet. Dieses erwies sich als keine gute Loesung. Bei dieser Version von
+.B man
+ist es moeglich, die Seiten in die richtigen Abschnitte einzuordnen und ihrem
+Seitennamen eine spezifische Erweiterung, hier z. B.
+.BR exit (3tcl)
+anzuhaengen. Unter normalen Umstaenden zeigt
+.B man
+bevorzugt
+.BR exit (3)
+gegenueber
+.BR exit (3tcl)
+an. Um dieses Verhalten umzukehren, ist
+.B man
+die Zeichenkette
+.I Erweiterung
+zu uebergeben, die angibt, in welchem Paket die Manualseite zu finden ist. Im
+obigen Fall beschraenkt
+.B man
+seine Suche auf Seiten mit der Erweiterung
+.BR *tcl,
+wenn es mit
+.B \-e\ tcl
+aufgerufen wurde. Die Suche wird dabei in allen Abschnitten durchgefuehrt.
+.TP
+.B \-f, \-\-whatis
+Diese Option ist das Aequivalent zu
+.BR whatis .
+Es wird eine Kurzbeschreibung der gewuenschten Manualseite angezeigt, wenn
+sie gefunden wurde. Zu Details siehe
+.BR whatis (1).
+Mit dieser Option ist nur eine Standardsuche moeglich. Verbesserte
+Suchmoeglichkeiten bieten die Optionen von
+.B whatis.
+.TP
+.B \-k, \-\-apropos
+Diese Option ist das Aequivalent zu
+.BR apropos .
+Es werden die Kurzbeschreibungen zu allen Manualseiten nach dem angegebenen
+Stichwort durchsucht. Zu Details siehe
+.BR apropos (1).
+Mit dieser Option ist nur eine Standardsuche moeglich. Verbesserte
+Suchmoeglichkeiten bieten die Optionen von
+.B apropos.
+.PP
+.B \-m
+.I System\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= System\c
+\|[\|,.\|.\|.\|]
+.RS
+Wenn auch Manualseiten von einem anderen Betriebssystem installiert
+sind, so kann auf sie mit dieser Option zugegriffen werden. Um
+beispielsweise die Manualseiten von NewOS zu durchsuchen, muss
+.B \-m
+.BR NewOS
+angegeben werden.
+
+Das angegebene
+.I System
+kann eine durch Kommata abgetrennte Aufzaehlung von Betriebssystemnamen
+sein. Die normalen Seiten werden durch den Betriebssystemnamen
+.B man
+angesprochen. Diese Option ueberschreibt die Umgebungsvariable
+.RB $ SYSTEM.
+.RE
+.TP
+.BI \-p\ Zeichenkette ,\ \-\-preprocessor= Zeichenkette
+Diese Option gibt die Reihenfolge an, in der die Praeprozessoren vor
+.B nroff
+oder
+.BR troff / groff
+abgearbeitet werden. Nicht alle Installationen haben notwendigerweise alle
+Praeprozessoren. Einige der Praeprozessoren und die Zeichen, um sie zu
+repraesentieren, sind:
+.BR eqn " (" e ),
+.BR grap " (" g ),
+.BR pic " (" p ),
+.BR tbl " (" t ),
+.BR vgrind " (" v ),
+.BR refer " (" r ).
+Diese Option ueberschreibt die Umgebungsvariable
+.RB $ MANROFFSEQ.
+Der Praeprozessor
+.B zsoelim
+wird immer als erster gestartet.
+.TP
+.B \-u, \-\-update
+Die
+.I Indexdatenbanken
+werden immer waehrend des laufenden Betriebes auf neuestem Stand gehalten, was
+insbesondere bedeutet, dass
+.B mandb
+nicht benoetigt wird, um sie konsistent zu halten. Wenn die ausgewaehlte
+Manualseite nicht im Index gefunden wurde oder die
+.B \-a
+Option verwendet wurde, macht
+.B man
+einen Konsistenztest auf Verzeichnisebene, um sicherzustellen, dass der Index
+immer noch eine gueltige Repraesentation der Manualseiten im Dateisystem
+darstellt. Wenn dieser Test auf Inode-Ebene durchgefuehrt werden soll, muss
+man die Option
+.BR \-u
+benutzen.
+.TP
+.B \-t, \-\-troff
+Mit dieser Option wird
+.I %troff%
+verwendet, um die Manualseite zu formatieren und an die Standardausgabe
+zu liefern. Im Zusammenhang mit
+.B \-T
+oder
+.BR \-Z
+ist diese Option nicht noetig.
+.PP
+.BI \-T\ Format ,\ \-\-troff-device
+.RI [\| =Format \|]
+.RS
+Diese Option wird dazu verwendet, um das Ausgabeformat von
+.B groff
+(oder moeglicherweise
+.BR troff )
+zu aendern. Diese Option impliziert die Angabe von
+.BR \-t .
+Verfuegbare Ausgabeformate (von Groff-1.09) beinhalten
+.BR dvi ", " latin1 ,
+.BR X75 " und " X100 .
+.RE
+.TP
+.B \-Z, \-\-ditroff
+Das traditionelle
+.B troff
+erzeugt ditroff.
+.B groff
+startet zunaechst
+.B troff
+und leitet danach dessen Ausgabe an einen fuer das gewaehlte Ausgabeformat
+geeigneten Postprozessor weiter. Wenn
+.I %troff%
+.BR groff
+ist, zwingt diese Option
+.B groff
+dazu, traditionelles
+.B troff
+zu emulieren und impliziert
+.BR \-t ,
+andernfalls wird es ignoriert.
+.TP
+.B \-w, \-\-where, \-\-location
+Zeigt nicht die Manualseiten, sondern die Position der Dateien im
+Dateisystem an, die formatiert oder angezeigt wuerden. Wenn die Datei eine
+cat-Seite ist, wird auch der Ort ihrer nroff-Quelldatei angezeigt.
+.TP
+.B \-h, \-\-help
+Zeigt einen Hilfstext an.
+.TP
+.B \-V, \-\-version
+Zeigt Programmversion und Autor an.
+.SH UMGEBUNG
+.\".TP \w'MANROFFSEQ\ \ 'u
+.TP
+.B MANPATH
+Wenn
+.RB $ MANPATH
+gesetzt ist, wird dessen Wert als Suchpfad fuer die Manualseiten benutzt.
+.TP
+.B MANROFFSEQ
+Wenn
+.RB $ MANROFFSEQ
+gesetzt ist, wird dessen Wert benutzt, um die Abfolge der Praeprozessoren zu
+bestimmen, die jede Manualseite vor
+.B nroff
+oder
+.BR troff
+durchlaeuft.
+Als Default durchlaufen die Seiten den
+.BR tbl " (" t )
+Praeprozessor.
+.TP
+.B MANSEC
+Wenn der Wert von
+.RB $ MANSEC
+eine durch Doppelpunkte getrennte Liste von Abschnitten ist,
+wird dieser Wert dazu benutzt, um die zu durchsuchenden Abschnitte und
+deren Reihenfolge zu bestimmen.
+.TP
+.B PAGER
+Wenn
+.RB $ PAGER
+gesetzt ist, wird dieses Programm zur Anzeige benutzt. Default ist
+.B %pager%.
+.TP
+.B SYSTEM
+Wenn
+.RB $ SYSTEM
+gesetzt ist, hat dies den gleichen Effekt wie die Option
+.B \-m
+.I System
+wobei
+.I System
+als Inhalt der Umgebungsvariable
+.RB $ SYSTEM
+benutzt wird.
+.TP
+.B MANOPT
+Wenn
+.RB $ MANOPT
+gesetzt ist, wird der Wert dieser Variablen vor der
+.B man
+Kommandozeile durchsucht und abgearbeitet. Wie auch alle
+anderen Umgebungsvariablen, die als Kommandozeilen-Optionen ausgedrueckt
+werden koennen, ist es moeglich, den Inhalt von
+.RB $ MANOPT
+durch die Kommandozeile zu ueberschreiben.
+Alle Leerzeichen, die Teil eines Argumentes sind, muessen gequotet werden.
+.TP
+.BR LANG , " LC_MESSAGES"
+Abhaengig von System und Implementation werden entweder
+.RB $ LANG
+oder
+.RB $ LC_MESSAGES
+oder beide nach der gegenwaertigen
+.I locale
+Information durchsucht.
+.B man
+wird (wenn moeglich) seine Nachrichten in dieser
+.I locale
+anzeigen. Fuer Details
+siehe
+.BR setlocale (3).
+.SH DATEIEN
+.TP
+.I %manpath_config_file%
+Die Manualkonfigurationsdatei.
+.TP
+.I /usr/\|.\|.\|.\|/man
+Globale Manualhierarchien.
+.TP
+.I /var/catman/\|.\|.\|.\|/index.(bt|db|dir|pag)
+Die
+.B FSSTND
+complianten globalen
+.I Indexdatenbanken.
+.SH "SIEHE AUCH"
+.BR mandb (8),
+.BR manpath (1),
+.BR manpath (5),
+.BR apropos (1),
+.BR whatis (1),
+.BR catman (8),
+.BR less (1),
+.BR nroff (1),
+.BR troff (1),
+.BR groff (1),
+.BR zsoelim (1),
+.BR setlocale (3).
+.SH FEHLER
+Die Option
+.B \-t
+funktioniert nur, wenn ein troff-aehnliches Programm installiert ist.
+
+Die Option
+.B \-e
+funktioniert momentan nur in Manualhierarchien, fuer die mit
+.B mandb
+eine
+.I Indexdatenbank
+erzeugt wurde.
+
+Manualseiten, die die erweiterte Darstellung im Zusammenhang mit der Option
+.B \-e
+unterstuetzen, duerfen keinen Punkt beinhalten, denn sonst
+werden diese Seiten als fehlerhaft zurueckgewiesen.
+.SH GESCHICHTE
+1990, 1991 \- Originale geschrieben von John W. Eaton (jwe@che.utexas.edu).
+
+23. Dez. 1992: Fehlerbereinigung durch Rik Faith (faith@cs.unc.edu)
+unterstuetzt durch Willem Kasdorp (wkasdo@nikhefk.nikef.nl).
+
+Zwischen dem 30. April 1994 und dem %date% hat Wilf
+(G.Wilford@ee.surrey.ac.uk) unter Mithilfe von einigen wenigen engagierten
+Menschen dieses Paket entwickelt und weitergefuehrt.
+
+Die deutsche Uebersetzung wurde von
+Anke Steuernagel (a_steuer@informatik.uni-kl.de) und
+Nils Magnus (magnus@informatik.uni-kl.de) angefertigt.
+
+Fuer persoenliche Wuerdigungen und Zusaetze siehe Quelltexte.
diff --git a/man/de_DE.ascii/man1/manpath.man1 b/man/de_DE.ascii/man1/manpath.man1
new file mode 100644
index 00000000..09f5f544
--- /dev/null
+++ b/man/de_DE.ascii/man1/manpath.man1
@@ -0,0 +1,125 @@
+.\" Man page for manpath
+.\"
+.\" Copyright (c) 1990, 1991, John W. Eaton.
+.\" Deutsche Uebersetzung von Anke Steuernagel und Nils Magnus
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the README file that comes with the man 1.0
+.\" distribution.
+.\"
+.\" John W. Eaton
+.\" jwe@che.utexas.edu
+.\" Department of Chemical Engineering
+.\" The University of Texas at Austin
+.\" Austin, Texas 78712
+.\"
+.TH manpath 1 "%date%" "%version%" "Manual Hilfsprogramme"
+.LO 1
+.SH NAME
+manpath \- ermittelt den aktuellen Suchpfad fuer die Manualseiten
+.SH SYNTAX
+.B manpath
+.RB [\| \-qgdc \|]
+.RB [\| \-m
+.IR System \|[\|,.\|.\|.\|]\|]
+.SH BESCHREIBUNG
+.B manpath
+versucht den aktuellen Suchpfad der Manualseiten aus den Standardeinstellungen
+und der Umgebungsvariable
+.RB $ PATH
+zu ermitteln. Das Ergebnis wird auf der Standardausgabe
+ausgegeben, Warnungen und Fehler auf der Standardfehlerausgabe. Wenn
+ein Verzeichnis nicht in der Konfigurationsdatei aufgelistet ist, sucht
+.B manpath
+nach den Unterverzeichnissen `man' und `MAN'. Wenn diese existieren, werden
+sie dem Suchpfad hinzugefuegt.
+
+Da
+.B manpath
+von
+.B man
+benutzt wird, um den Suchpfad zu bestimmen, ist es fuer einen Benutzer im
+Normalfall nicht notwendig, die Umgebungsvariable
+.RB $ MANPATH
+direkt zu setzen.
+.SH OPTIONEN
+.TP
+.B \-q, \-\-quiet
+Gibt nur den endgueltigen Manualpfad aus.
+.TP
+.B \-d, \-\-debug
+Ausgeben von Fehlerinformationen.
+.TP
+.B \-c, \-\-catpath
+Erzeugt einen cat-Suchpfad. Vorhandene
+Manualpfade werden in relative cat-Suchpfade umgewandelt. Diese Option
+kann mit
+.BR \-g
+kombiniert werden.
+.TP
+.B \-g, \-\-global
+Erzeugt einen Manualpfad, der aus allen Pfaden besteht, die in der
+Konfigurationsdatei als global bezeichnet sind. Diese Option kann mit
+.BR \-c
+kombiniert werden.
+.PP
+.B \-m
+.I System\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= System\c
+\|[\|,.\|.\|.\|]
+.RS
+Wenn auch Manualseiten von einem anderen Betriebssystem installiert
+sind, so kann auf sie mit dieser Option zugegriffen werden. Um
+beispielsweise die Manualseiten von NewOS zu durchsuchen, muss
+.B \-m
+.BR NewOS
+angegeben werden.
+
+Das angegebene
+.I System
+kann eine durch Kommata abgetrennte Aufzaehlung von Betriebssystemnamen
+sein. Die normalen Seiten werden durch den Betriebssystemnamen
+.B man
+angesprochen. Diese Option ueberschreibt die Umgebungsvariable
+.RB $ SYSTEM.
+.RE
+.TP
+.B \-h, \-\-help
+Zeigt einen Hilfstext an.
+.TP
+.B \-V, \-\-version
+Zeigt Programmversion und Autor an.
+.SH UMGEBUNG
+.\".TP \w'MANPATH\ \ 'u
+.TP
+.B MANPATH
+Wenn
+.RB $ MANPATH
+gesetzt ist, gibt
+.B manpath
+diesen Wert auf die Standardausgabe aus. Warnungen werden auf die
+Standardfehlerausgabe ausgegeben.
+.TP
+.B SYSTEM
+Wenn
+.RB $ SYSTEM
+gesetzt ist, hat dies die gleiche Wirkung wie die Option
+.B \-m
+.I System
+wobei
+.I System
+als Inhalt von
+.RB $ SYSTEM
+angenommen wird.
+.SH DATEIEN
+.TP
+.I %manpath_config_file%
+Die Manualkonfigurationsdatei.
+.SH "SIEHE AUCH"
+.BR apropos "(1), " whatis "(1), " man (1).
+.SH AUTOR
+Wilf. (G.Wilford@ee.surrey.ac.uk),
+die deutsche Uebersetzung ist von
+Anke Steuernagel (a_steuer@informatik.uni-kl.de) und
+Nils Magnus (magnus@informatik.uni-kl.de).
diff --git a/man/de_DE.ascii/man1/whatis.man1 b/man/de_DE.ascii/man1/whatis.man1
new file mode 100644
index 00000000..1f1417c9
--- /dev/null
+++ b/man/de_DE.ascii/man1/whatis.man1
@@ -0,0 +1,148 @@
+.\" Man page for whatis
+.\"
+.\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.)
+.\" Deutsche Uebersetzung von Anke Steuernagel und Nils Magnus
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the man
+.\" distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH whatis 1 "%date%" "%version%" "Manual Hilfsprogramme"
+.LO 1
+.SH NAME
+whatis \- durchsucht die Indexdatenbank nach Kurzbeschreibungen
+.SH SYNTAX
+.B whatis
+.RB [\| \-dhV \|]
+.RB [\| \-r \||\| \-w\c
+\|]
+.RB [\| \-m
+.IR System \|[\|,.\|.\|.\|]\|]
+.RB [\| \-M
+.IR Pfad \|]
+.I Schluesselwort
+\&.\|.\|.
+
+.SH BESCHREIBUNG
+Innerhalb jeder Manualseite ist eine Kurzbeschreibung vorhanden.
+.B whatis
+sucht
+.I Schluesselwort
+in den Kurzbeschreibungen der
+.I Indexdatenbank.
+Falls es eine solche nicht im Manualpfad
+gibt, durchsucht es die
+.I whatis-
+Datenbank nach
+.IR Schluesselwort.
+Diese Version von
+.B whatis
+kann Schluesselwoerter suchen, die Wildcards oder regulaere
+Ausdruecke enthalten.
+
+.B mandb
+erzeugt die
+.I Indexdatenbank
+fuer jeden Manualpfad. Um eine Datei im alten Stil als
+.I whatis-
+Datenbank aus der
+.I Indexdatenbank
+zu erzeugen, ist folgender Befehl einzugeben
+
+.B whatis \-M
+.I Pfad
+.B \-w '*' | sort >
+.I manpath/whatis
+
+wobei
+.I Pfad
+eine Manualhierarchie wie
+.IR /usr/man
+ist.
+.SH OPTIONEN
+.TP
+.B \-d, \-\-debug
+Ausgeben von Fehlerinformationen.
+.TP
+.B \-r, \-\-regex
+Interpretiert jedes Schluesselwort als regulaeren Ausdruck.
+Wenn ein Schluesselwort irgendeinem Teil eines Seitennamens
+entspricht, wird eine Uebereinstimmung gefunden.
+.TP
+.B \-w, \-\-wildcard
+Das Schluesselwort kann Wildcards wie in der Shell beinhalten.
+Um eine Uebereinstimmung zu finden, muss ein expandiertes
+Schluesselwort mit einem kompletten Seitennamen uebereinstimmen.
+.PP
+.B \-m
+.I System\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= System\c
+\|[\|,.\|.\|.\|]
+.RS
+Wenn auch Manualseiten von einem anderen Betriebssystem installiert
+sind, so kann auf sie mit dieser Option zugegriffen werden. Um
+beispielsweise die Manualseiten von NewOS zu durchsuchen, muss
+.B \-m
+.BR NewOS
+angegeben werden.
+
+Das angegebene
+.I System
+kann eine durch Kommata abgetrennte Aufzaehlung von Betriebssystemnamen
+sein. Die normalen Seiten werden durch den Betriebssystemnamen
+.B man
+angesprochen. Diese Option ueberschreibt die Umgebungsvariable
+.RB $ SYSTEM.
+.RE
+.TP
+.BI \-M\ Pfad ,\ \-\-manpath= Pfad
+Gibt die Manualpfade an. Wenn mehrere Pfade angegeben werden, muessen
+diese durch Doppelpunkte getrennt sein. Als Default benutzt
+.B whatis
+.B manpath,
+um den Suchpfad zu bestimmen. Diese Option ueberschreibt die Umgebungsvariable
+.RB $ MANPATH.
+.TP
+.B \-h, \-\-help
+Zeigt einen Hilfstext an.
+.TP
+.B \-V, \-\-version
+Zeigt Programmversion und Autor an.
+.SH DATEIEN
+.TP
+.I /var/catman/\|.\|.\|.\|/index.(bt|db|dir|pag)
+Die
+.B FSSTND
+complianten globalen
+.I Indexdatenbanken.
+.TP
+.I /usr/man/\|.\|.\|.\|/whatis
+Traditionelle
+.I whatis
+Datenbank.
+.SH "SIEHE AUCH"
+.BR apropos "(1), " man "(1), " mandb (8).
+.SH FEHLER
+Wenn die
+.B \-r
+oder
+.B \-w
+Optionen benutzt werden und Shell-Metazeichen in einem
+.IR Schluesselwort
+vorkommen, kann es notwendig sein,
+.I Schluesselwort
+zu quoten, damit die Shell nicht versucht, diese Zeichen zu interpretieren.
+
+Die
+.B \-r
+und
+.B \-w
+Optionen koennen verwirrende Ausgaben erzeugen und verlangsamen die Suche.
+.SH AUTOR
+Wilf. (G.Wilford@ee.surrey.ac.uk),
+die deutsche Uebersetzung ist von
+Anke Steuernagel (a_steuer@informatik.uni-kl.de) und
+Nils Magnus (magnus@informatik.uni-kl.de).
diff --git a/man/de_DE.ascii/man1/zsoelim.man1 b/man/de_DE.ascii/man1/zsoelim.man1
new file mode 100644
index 00000000..d9e63c2b
--- /dev/null
+++ b/man/de_DE.ascii/man1/zsoelim.man1
@@ -0,0 +1,82 @@
+.\" Man page for zsoelim
+.\"
+.\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.)
+.\" Deutsche Uebersetzung von Anke Steuernagel und Nils Magnus
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the man
+.\" distribution.
+.\"
+.\" Sat Dec 10 19:33:32 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH zsoelim 1 "%date%" "%version%" "Manual Hilfsprogramme"
+.LO 1
+.SH NAME
+zsoelim \- interpretiert .so Steuerzeilen von nroff-Quellen
+.SH SYNTAX
+.B zsoelim
+.RB [\| \-CVh \|]
+.RI [\| Datei
+\&.\|.\|.\|]
+.SH BESCHREIBUNG
+.B zsoelim
+bearbeitet in denen durch
+.I Datei
+angegebenen Argumente oder, wenn keine angegeben sind, die Standardeingabe
+die Zeilen der Form
+
+.B .so
+.RI <\| Dateiname \|>
+
+Diese Eintraege werden durch die Inhalte der so spezifizierten Datei
+ersetzt. Falls
+.I Datei
+nicht gefunden wird, sucht
+.B zsoelim
+nach
+.I Datei.Ext
+wobei die Erweiterung
+.I .Ext
+entweder
+.B .gz,
+.B .Z
+oder
+.B .z
+sein kann. Andere Erweiterungen koennen unterstuetzt werden, muessen
+aber zur Uebersetzungszeit bekannt sein. Wenn eine Datei mit
+Erweiterung gefunden wurde, wird das dazu passende Programm
+aufgerufen und dessen Ausgabe wird verwendet, um die eigentliche Zeile
+zu ersetzen.
+
+Die Hauptaufgabe fuer
+.B zsoelim
+besteht darin, Praeprozessoren die Bearbeitung der referenzierten
+Dateien zu ermoeglichen. Diese spezielle Version wurde geschrieben, um
+einige Probleme im Zusammenhang mit komprimierten Quelldateien zu
+beheben, die ansonsten bei der Bearbeitung von cat-Manualseiten
+entstehen wuerden.
+
+.SH OPTIONEN
+.TP
+.B \-C
+Diese Option ist zur Kompatibilitaet mit anderen
+.B zsoelim
+Programmen und dient dazu, nach einer .so-Zeile auch andere Zeichen
+ausser Whitespace zu erlauben. Da dies sowieso das Normalverhalten
+ist, wird diese Option ignoriert.
+.TP
+.B \-h
+Zeigt einen Hilfstext an.
+.TP
+.B \-V
+Zeigt Programmversion und Autor an.
+.SH "SIEHE AUCH"
+.BR nroff (1),
+.BR troff (1),
+.BR groff (1),
+.BR man (1).
+.SH AUTOR
+Wilf. (G.Wilford@ee.surrey.ac.uk),
+die deutsche Uebersetzung ist von
+Anke Steuernagel (a_steuer@informatik.uni-kl.de) und
+Nils Magnus (magnus@informatik.uni-kl.de).
diff --git a/man/de_DE.ascii/man5/manpath.man5 b/man/de_DE.ascii/man5/manpath.man5
new file mode 100644
index 00000000..4c8386be
--- /dev/null
+++ b/man/de_DE.ascii/man5/manpath.man5
@@ -0,0 +1,118 @@
+.\" Man page for format of the manpath.config data file
+.\"
+.\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.)
+.\" Deutsche Uebersetzung von Anke Steuernagel und Nils Magnus
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the man
+.\" distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH man 5 "%date%" "%version%" "%manpath_config_file%"
+.LO 5
+.SH NAME
+manpath \- Format der %manpath_config_file% Datei
+.SH BESCHREIBUNG
+Die beschriebene Konfigurationsdatei wird von
+.BR man ,
+.B mandb
+und
+.B manpath
+benutzt, um den Benutzer-Manualpfad zur Laufzeit zu bestimmen und um
+den globale Manualhierarchien die zugehoerigen
+cat-Verzeichnisse zuzuordnen.
+.SH FORMAT
+Die folgenden Feldtypen werden erkannt:
+.TP
+.B MANDATORY_MANPATH Manualpfad
+Zeilen dieser Form zeigen die Manualpfade an, die jede automatisch generierte
+.RB $ MANPATH
+Variable beinhalten sollte.
+.TP
+.B MANPATH_MAP Pfad Manualpfad
+Zeilen dieser Form wandeln
+.RB $ PATH
+in die entsprechende
+.RB $ MANPATH
+Syntax um.
+.RB $ MANPATH
+wird um die zu Pfade ergaenzt, die zu den Pfaden in
+.RB $ PATH
+korrespondieren.
+
+Dies ueberschreibt nicht die Umgebungsvariable
+.RB $ MANPATH,
+wenn diese gesetzt ist.
+.TP
+.BR MANDB_MAP\ Manualpfad \ \|[\| cat-Pfad \|]
+Zeilen dieser Form geben die Manualpfade an, die als global angesehen
+werden. Normalerweise beinhalten diese die systemweit lesbaren Manualpfade
+in
+.IR /usr .
+
+Zum Vorteil des System-Administrators kann jedes
+Verzeichnis, in das
+.B man
+schreiben kann, als
+.B cat-Pfad
+definiert werden. Um den
+.BR FSSTND
+einzuhalten, kann das Schluesselwort
+.RB ` FSSTND '
+anstelle eines Verzeichnisses benutzt werden. In diesem Fall verwendet
+.B man
+das zugehoerige
+.B FSSTND
+compliante Verzeichnis. Wenn
+.B cat-Pfad
+fehlt, uebernimmt
+.B cat-Pfad
+den Wert von
+.B Manualpfad.
+Diese Funktion ist auch mit Nicht-
+.B Linux-FSSTND
+complianten Systemen moeglich.
+
+Es ist notwendig,
+.B alle
+globalen Manualpfade, einschliesslich spezieller Pfade auf anderen
+Systeme, wie z. B.
+.I /usr/man/sun,
+und alle
+.B lokale
+Pfade, wie
+.IR /usr/man/de_DE.88591,
+anzugeben. Fuer
+.B man
+ist es notwendig, dass diese Pfade existieren, um dort cat-Dateien zu
+erstellen.
+
+Zusaetzlich ist es notwendig, dass Manualpfade, die wiederum in anderen
+Manualpfaden
+.B enthalten
+sind,
+.B zuerst
+aufgezaehlt werden. Also muss z. B.
+.I /usr/man/de_DE.88591
+vor
+.IR /usr/man
+aufgelistet werden.
+
+Wenn cat-Seiten nicht staendig benoetigt werden, kann der
+.B cat-Pfad
+entfallen. Dabei ist zu beachten, dass die Verzeichnisse
+.I <Manualpfad>/cat*
+nicht existieren. Um das Erzeugen von cat-Seiten zeitweilig zu unterbinden,
+kann man das Schreiben in die cat-Verzeichnisse verbieten.
+Wenn
+.B cat-Pfad
+auf ein ungueltiges Verzeichnis wie
+.IR /dev/null
+gesetzt wird, hat dies den gleichen Effekt. Dadurch wird aber der Zugriff der
+Manual-Hilfsprogramme auf die
+.I Indexdatenbank
+dieses Manualpfades verweigert.
+.SH HINWEIS
+Es ist wichtig, dass diese Regeln genau befolgt werden, damit die
+Manual-Hilfsprogramme wie gewuenscht funktionieren.
diff --git a/man/de_DE.ascii/man8/accessdb.man8 b/man/de_DE.ascii/man8/accessdb.man8
new file mode 100644
index 00000000..282cc6cc
--- /dev/null
+++ b/man/de_DE.ascii/man8/accessdb.man8
@@ -0,0 +1,43 @@
+.\" Man page for accessdb
+.\"
+.\" Copyright (c) 1998 Fabrizio Polacco <fpolacco@debian.org
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Tue, 24 Feb 1998 18:18:36 +0200
+.\"
+.TH accessdb 8 "%date%" "%version%" "Manual pager utils"
+.SH NAME
+accessdb \- dumps the content of a man-db database in a human readable
+format.
+.SH SYNOPSIS
+.B /usr/sbin/accessdb
+.RI [ <index-file> ]
+.SH DESCRIPTION
+.B accessdb
+will output the data contained within a man_db database in a
+human readable form. By default, it will dump the data from
+.B /var/catman/index.<db-type>,
+where <db-type> is dependent on the database library in use.
+
+Supplying an argument to accessdb will override this
+default.
+
+.nf
+$mtime$ -> "795987034"
+$version$ -> "2.3.1"
+apropos -> "1 1 795981542 A - - search the manual page names and descriptions"
+catman -> "8 8 795981544 A - - create or update the pre-formatted manual pages"
+man -> "1 1 795981542 A - - an interface to the on-line reference manuals"
+mandb -> "8 8 795981544 A - - create or update the manual page index caches"
+manpath -> " 1 5"
+manpath~1 -> "1 1 795981542 A - - determine search path for manual pages"
+manpath~5 -> "5 5 795981543 A - - format of the /etc/man_db.config file"
+whatis -> "1 1 795981543 A - - search the manual page names"
+zsoelim -> "1 1 795981543 A - - satisfy .so requests in roff input"
+.fi
+
+.SH AUTHOR
+Wilf. (G.Wilford@ee.surrey.ac.uk)
diff --git a/man/de_DE.ascii/man8/catman.man8 b/man/de_DE.ascii/man8/catman.man8
new file mode 100644
index 00000000..5c23d3ba
--- /dev/null
+++ b/man/de_DE.ascii/man8/catman.man8
@@ -0,0 +1,116 @@
+.\" Man page for catman
+.\"
+.\" Copyright (C), 1994, Graeme W. Wilford. (Wilf.)
+.\" Deutsche Uebersetzung von Anke Steuernagel und Nils Magnus
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the man
+.\" distribution.
+.\"
+.\" Sat Dec 10 14:17:29 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH catman 8 "%date%" "%version%" "Manual Hilfsprogramme"
+.LO 1
+.SH NAME
+catman \- erzeugt oder aktualisiert die formatierten Manualseiten
+.SH SYNTAX
+.B catman
+.RB [\| \-dhV \|]
+.RB [\| \-M
+.IR Pfad \|]
+.RI [\| Abschnitt \|]
+\&.\|.\|.
+.SH BESCHREIBUNG
+.B catman
+wird benutzt, um einen aktuellen Satz von vorformatierten Manualseiten zu
+erzeugen, die als cat-Seiten bezeichnet werden. Die cat-Seiten werden
+wesentlich schneller angezeigt als die unformatierten Manualseiten, benoetigen
+aber zusaetzlichen Speicherplatz auf der Festplatte. Die Entscheidung zur
+Unterstuetzung von cat-Seiten liegt beim lokalen Administrator, der fuer diese
+Seiten passende Verzeichnisse anlegen muss.
+
+Die Optionen fuer
+.B catman
+geben die Manualseiten und die Abschnitte an, die vorformatiert werden
+sollen. Im Normalfall werden die Manualseiten verwendet, die in der
+Manualkonfigurationsdatei beschrieben sind. Normalerweise werden die
+Abschnitte formatiert, die entweder in der Umgebungsvariable
+.RB $ MANSEC
+stehen oder fest in
+.BR man (1)
+einkompiliert sind, wenn
+.RB $ MANSEC
+undefiniert ist. Wird
+.B catman
+eine durch Whitespace abgetrennte Liste von Abschnitten uebergeben, so werden
+nur die Manualseiten in den betreffenden Abschnitten bearbeitet.
+
+Um festzustellen, welche Dateien formatiert werden muessen, macht
+.B catman
+Gebrauch von den
+.I Indexdatenbanken
+der jeweiligen Manualseiten.
+.SH OPTIONEN
+.TP
+.B \-d, \-\-debug
+Ausgeben von Fehlerinformationen.
+.TP
+.BI \-M\ Pfad ,\ \-\-manpath= Pfad
+Gibt einen alternativen Manualpfad an.
+Als Default sind dies alle Pfade, die in der Manualkonfigurationsdatei
+als global deklariert sind. Die Umgebungsvariable
+.RB $ MANPATH
+wird von
+.BR catman
+nicht benutzt.
+.TP
+.B \-h, \-\-help
+Zeigt einen Hilfstext an.
+.TP
+.B \-V, \-\-version
+Zeigt Programmversion und Autor an.
+.SH DATEIEN
+.TP
+.I /var/catman/\|.\|.\|.\|/index.(bt|db|dir|pag)
+Die
+.B FSSTND
+complianten globalen
+.I Indexdatenbanken.
+.TP
+.I /usr/man/\|.\|.\|.\|/whatis
+Traditionelle
+.I whatis
+Datenbank.
+.SH "SIEHE AUCH"
+.BR man (1),
+.BR manpath (5),
+.BR mandb (8).
+.SH FEHLER
+Auf Systemen mit kleinem (~4 kByte) Zwischenspeicher fuer Argumente von
+.BR execve (2)
+kann es noetig sein, dass
+.B catman
+mehrere kleine im Gegensatz zu wenigen grossen Batchjobs ausfuehren muss.
+In diesem Fall ist es fuer
+.B man
+moeglich, diesen Eintrag (korrekt) aus einer Datenbank zu loeschen (vielleicht
+existiert er in Wirklichkeit gar nicht mehr), der vom aktuellen Aufruf von
+.B catman
+benoetigt wird, um die naechste Seite zu bestimmen. Wenn die
+.I Indexdatenbank
+einen Hashtable-Lookup (ndbm, gdbm) benutzt, fuehrt dies zu einem `sich am
+eigenen Schopf aus dem Sumpf ziehen'. Obgleich dies selten auftritt, fuehrt es
+dazu, dass
+.B catman
+nicht mehr die weiteren Seiten des Abschnittes bearbeitet.
+
+Hinweis:
+.B Linux
+hat einen Zwischenspeicher von 128 kByte fuer
+.B execve (2)
+Argumente.
+.SH AUTOR
+Wilf. (G.Wilford@ee.surrey.ac.uk),
+die deutsche Uebersetzung ist von
+Anke Steuernagel (a_steuer@informatik.uni-kl.de) und
+Nils Magnus (magnus@informatik.uni-kl.de).
diff --git a/man/de_DE.ascii/man8/mandb.man8 b/man/de_DE.ascii/man8/mandb.man8
new file mode 100644
index 00000000..e8ccdc3e
--- /dev/null
+++ b/man/de_DE.ascii/man8/mandb.man8
@@ -0,0 +1,123 @@
+'\" t
+.\" Man page for mandb
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\" Deutsche Uebersetzung von Anke Steuernagel und Nils Magnus
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Tue Apr 26 12:56:44 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH mandb 8 "%date%" "%version%" "Manual Hilfsprogramme"
+.SH NAME
+mandb \- erzeugt oder aktualisiert die Indexdatenbank
+.SH SYNTAX
+.B mandb
+.RB [\| \-dqsuc \||\| \-h \||\| \-V\c
+.RI "\|] [\|" Pfad \|]
+.SH BESCHREIBUNG
+Um die interne
+.I Indexdatenbank,
+die von
+.B man
+verwendet wird, zu initialisieren oder auf den neusten Stand zu bringen,
+wird
+.B mandb
+verwendet. Die
+.I Indexdatenbank
+enthaelt Informationen ueber den aktuellen Zustand der Manualseiten.
+
+Wenn eine
+.I Indexdatenbank
+erzeugt oder erneuert werden soll, warnt
+.B mandb
+vor moeglichen Inkonsistenzen, Seiten ohne nroff-Quelle oder Seiten ohne
+.B whatis-
+Beschreibungen.
+
+Wenn
+.B mandb
+beim Aufruf ein optionaler, durch Doppelpunkte abgetrennter Pfad
+uebergeben wird, so wird der interne durch die Konfigurationsdatei
+bestimmte Manualpfad verdeckt.
+.SH INDEXDATENBANKEN
+Von
+.B mandb
+wird einer der folgenden Datenbanktypen verwendet (Auswahl waehrend
+der Uebersetzungszeit):
+
+.TS
+tab (@);
+l l l l.
+Name@Typ@asyncron@Dateiname
+_
+Berkeley db@Binaerbaum@Ja@\fIindex.bt\fR
+GNU gdbm v >= 1.6@Hashtabelle@Ja@\fIindex.db\fR
+GNU gdbm v < 1.6@Hashtabelle@Nein@\fIindex.db\fR
+UNIX ndbm@Hashtabelle@Nein@\fIindex.(dir|pag)\fR
+.TE
+
+Die Datenbanktypen, die asyncrone Veraenderungen erlauben, erlauben eine
+hoehere Geschwindigkeit zulasten der Moeglichkeit, dass bei einer
+nichtgewoehlichen Beendung des Programms die Datenbank fehlerhaft sein
+kann.
+
+In diesem seltenen Fall kann es noetig sein,
+.B mandb
+mit der
+.B \-c
+Option zu starten, um die Datenbanken von Grund auf neu zu erstellen.
+.SH OPTIONEN
+.TP
+.B \-d, \-\-debug
+Erzeugt Debug-Informationen.
+.TP
+.B \-q, \-\-quiet
+Unterdrueckt die Warnungen.
+.TP
+.B \-s, \-\-no-straycats
+Beachtet beim Aufbau keine cat-Seiten ohne zugehoerige
+nroff-Quellen (sog.
+.I stray-cats).
+.TP
+.B \-c, \-\-create
+Im Normalfall versucht
+.B mandb
+zunaechst eine bestehende Datenbank auf den aktuellen Stand zu bringen
+und erzeugt eine neue nur dann, wenn noch keine solche
+existiert. Durch Angabe dieser Option wird
+.B mandb
+dazu gezwungen, die Datenbank von Grund auf neu zu erstellen.
+.TP
+.B \-u, \-\-user-db
+Erzeugt nur die benutzerspezifischen Datenbanken, selbst wenn
+Schreibrechte auf systemweite Manualhierarchien bestehen.
+.TP
+.B \-h, \-\-help
+Zeigt einen Hilfstext an.
+.TP
+.B \-V, \-\-version
+Zeigt Programmversion und Autor an.
+.SH DATEIEN
+.TP
+.I /var/catman/\|.\|.\|.\|/index.(bt|db|dir|pag)
+Die
+.B FSSTND
+complianten globalen
+.I Indexdatenbanken.
+.TP
+.I /usr/man/\|.\|.\|.\|/whatis
+Traditionelle
+.I whatis
+Datenbank.
+.SH "SIEHE AUCH"
+.BR man (1),
+.BR manpath (5),
+.BR catman (8).
+.SH AUTOR
+Wilf. (G.Wilford@ee.surrey.ac.uk),
+die deutsche Uebersetzung ist von
+Anke Steuernagel (a_steuer@informatik.uni-kl.de) und
+Nils Magnus (magnus@informatik.uni-kl.de).
diff --git a/man/es_ES.88591/man1/apropos.man1 b/man/es_ES.88591/man1/apropos.man1
new file mode 100644
index 00000000..544b2dd4
--- /dev/null
+++ b/man/es_ES.88591/man1/apropos.man1
@@ -0,0 +1,171 @@
+.\" Man page for %apropos%
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH %apropos% 1 "%date_es%" "%version%" "Útiles de Páginas de Manual"
+.SH NOMBRE
+%apropos% \- buscar entre las páginas del manual y las descripciones
+.SH SINOPSIS
+.B %apropos%
+.RB [\| \-dhV \|]
+.RB [\| \-r \||\| \-w\c
+\|]
+.RB [\| \-m
+.IR sistema \|[\|,.\|.\|.\|]\|]
+.RB [ \-M
+.IR ruta \|]
+.I palabra_clave
+\&.\|.\|.
+.SH DESCRIPCIÓN
+Cada página de manual contiene una pequeña descripción.
+.B %apropos%
+busca dentro de esas descripciones la presencia de la
+.IR palabra_clave .
+
+La
+.I palabra_clave
+puede contener caracteres comodín
+.RB ( \-w )
+o puede ser una expresión regular
+.RB ( \-r ).
+Cuando se usan estas opciones,
+puede ser necesario entrecomillar la
+.I palabra_clave
+o anteponer (\\) a los caracteres especiales para evitar que la shell los
+interprete.
+
+Las reglas estándar permiten buscar nombres de página y
+palabras completas en la descripción.
+.SH OPCIONES
+.TP
+.B \-d, \-\-debug
+Imprime información de depurado.
+.TP
+.B \-r, \-\-regex
+Interpreta cada palabra clave como una expresión regular. Cada palabra clave
+va a tratar de casar independientemente con los nombres de las páginas
+y con las descripciones.
+.TP
+.B \-w, \-\-wildcard
+Interpreta cada palabra clave como patrones que incluyen caracteres comodín.
+Cada palabra clave será cuadrada con nombres de páginas y las descripciones
+de forma independiente. Sólo se cuandran nombres completos de página que
+correspondan con el resultado de expandir la palabra clave.
+.\"
+.\" Due to the rather silly limit of 6 args per request in some `native'
+.\" *roff compilers, we have do the following to get the two-line
+.\" hanging tag on one line. .PP to begin a new paragraph, then the
+.\" tag, then .RS (start relative indent), the text, finally .RE
+.\" (end relative indent).
+.\"
+.PP
+.B \-m
+.I sistema\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= sistema\c
+\|[\|,.\|.\|.\|]
+.RS
+Si este sistema puede acceder a las páginas de manual de otro sistema
+operativo, se puede activar su búsqueda mediante esta opción.
+Para buscar en las páginas de NuevoSO, use la opción
+.B \-m
+.BR NuevoSO
+.
+
+El
+.I sistema
+especificado puede ser en realidad una lista separada por comas, de
+nombres de sistemas operativos.
+Para incluir la base de datos de descripciones
+.B whatis
+del sistema operativo nativo en la búsqueda basta incluir
+.B man
+como nombre de sistema en la lista de argumentos.
+
+El valor de esta opción sobreescribe el contenido de la variable
+del entorno
+.RB $ SYSTEM.
+.RE
+.TP
+.BI \-M\ ruta ,\ \-\-manpath= ruta
+Especifica un conjunto de jerarquías de páginas de manual
+separados por "dos puntos".
+
+Por defecto
+.B %apropos%
+utiliza la variable del entorno
+.RB $ MANPATH
+a menos que esté vacía o desactivada en cuyo caso determinará
+la ruta para el manual apropiado, basándose en su variable de entorno
+.RB $ PATH .
+Esta opción se preferirá al contenido de
+.RB $ MANPATH .
+.TP
+.B \-h, \-\-help
+Imprime un mensaje de ayuda y termina.
+.TP
+.B \-V, \-\-version
+Presenta la información sobre la version y el autor.
+
+.SH "ESTADO DE SALIDA"
+.TP
+.B 0
+Ejecución terminada con éxito.
+.TP
+.B 1
+Error de uso, sintaxis o de fichero de configuración.
+.TP
+.B 2
+Error operacional.
+.TP
+.B 16
+No se ha encontrado nada que cuadre con los criterios especificados.
+.SH ENTORNO
+.TP
+.B SYSTEM
+Si se activa
+.RB $ SYSTEM ,
+tendrá el mismo efecto que si se especifica su contenido como argumento
+de la opción
+.B \-m
+.
+.TP
+.B MANPATH
+Si se activa
+.RB $ MANPATH ,
+su valor es interpretado como un conjuto de jerarquías de
+páginas a usar separadas por "dos puntos".
+.TP
+.B POSIXLY_CORRECT
+Si
+.RB $ POSIXLY_CORRECT
+está activada, incluso si su valor es nulo,
+.B %apropos%
+ejecutará por defecto una búsqueda como expresión regular.
+.RB ( \-r ).
+.SH FICHEROS
+.TP
+.I /usr/man/index.(bt|db|dir|pag)
+.I índice
+de la base de datos caché tradicional.
+.TP
+.I /var/catman/index.(bt|db|dir|pag)
+.I índice
+de la base de datos caché global alternativa o de acuerdo al FSSTND.
+.TP
+.I /usr/man/\|.\|.\|.\|/whatis
+Base de datos tipo texto
+.B whatis
+tradicional.
+.SH "TAMBIÉN VER"
+.BR %whatis% (1),
+.BR %man% (1).
+.SH AUTOR
+Wilf. (G.Wilford@ee.surrey.ac.uk)
+Traducción realizada por Luis F. González (luisgh@cogs.susx.ac.uk)
diff --git a/man/es_ES.88591/man1/man.man1 b/man/es_ES.88591/man1/man.man1
new file mode 100644
index 00000000..b6685d88
--- /dev/null
+++ b/man/es_ES.88591/man1/man.man1
@@ -0,0 +1,928 @@
+'\" t
+.\" ** The above line should force tbl to be a preprocessor **
+.\" Man page for man
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH %man% 1 "%date_es%" "%version%" "Útiles de Páginas de Manual"
+.SH NOMBRE
+%man% \- una interfaz de los manuales de referencia electrónicos
+.SH SINOPSIS
+.\" The general command line
+.B %man%
+.RB [\| \-c \||\| \-w \||\| \-tZT
+.IR dispositivo \|]
+.RB [\| \-adhu7V \|]
+.RB [\| \-m
+.IR sistema \|[\|,.\|.\|.\|]\|]
+.RB [\| \-L
+.IR locale \|]
+.RB [\| \-p
+.IR cadena \|]
+.RB [\| \-M
+.IR ruta \|]
+.RB [\| \-P
+.IR paginador \|]
+.RB [\| \-r
+.IR prompt \|]
+.RB [\| \-S
+.IR lista \|]
+.RB [\| \-e
+.IR extension \|]
+.RI [\|[\| sección \|]
+.IR pagina \ .\|.\|.\|]\ .\|.\|.
+.\" The --local command line
+.br
+.B %man%
+.B \-l
+.RB [\| \-7 \|]
+.RB [\| \-tZT
+.IR dispositivo \|]
+.RB [\| \-p
+.IR cadena \|]
+.RB [\| \-P
+.IR paginador \|]
+.RB [\| \-r
+.IR prompt \|]
+.I fichero
+\&.\|.\|.
+.\" The apropos command line
+.br
+.B %man%
+.B \-k
+.RB [\| \-M
+.IR ruta \|]
+.I palabra_clave
+\&.\|.\|.
+.\" The whatis command line
+.br
+.B %man%
+.B \-f
+.RB [\| \-M
+.IR ruta \|]
+.I pagina
+\&.\|.\|.
+.SH DESCRIPCIÓN
+.B %man%
+es el paginador del manual del sistema. Las
+.I páginas
+usadas como argumentos al ejecutar
+.B %man%
+suelen ser normalmente nombres de programas, útiles o funciones.
+La
+.I página de manual
+associada con cada uno de esos argumentos es buscada y presentada.
+Si la llamada da también la
+.IR sección ,
+.B %man%
+buscará sólo en dicha
+.I sección
+del manual.
+Normalmente, la búsqueda se lleva a cabo en todas las
+.IR secciones
+de manual disponibles según un orden predeterminado, y sólo se
+presenta la primera
+.I página
+encontrada, incluso si esa
+.I página
+se encuentra en varias
+.IR secciones.
+
+La siguiente tabla muestra los números de
+.I sección
+del manual y los tipos de páginas que contienen.
+
+.TS
+tab (@);
+l l.
+1@Programas ejecutables y guiones del intérprete de
+@órdenes
+2@Llamadas del sistema (funciones servidas por el núcleo)
+3@Llamadas de la biblioteca (funciones contenidas en las
+@bibliotecas del sistema)
+4@Ficheros especiales (se encuentran generalmente en \fI/dev\fR)
+5@Formato de ficheros y convenios p.ej. \I/etc/passwd\fR
+6@Juegos
+7@Paquetes de macros y convenios p.ej. \fBman\fR(7), \fBgroff\fR(7).
+8@Órdenes de admistración del sistema (generalmente solo son
+@para root)
+9@Rutinas del núcleo [\|No es estándar\|]
+n@nuevo [\|obsoleto\|]
+l@local [\|obsoleto\|]
+p@público [\|obsoleto\|]
+o@viejo [\|obsoleto\|]
+.TE
+
+Una
+.I página
+de manual tiene varias partes.
+
+Éstas están etiquetadas como
+.BR NOMBRE ,
+.BR SINOPSIS ,
+.BR DESCRIPCIÓN ,
+.BR OPCIONES ,
+.BR FICHEROS ,
+.BR "VÉASE TAMBIÉN" ,
+.BR BUGS ,
+y
+.BR AUTOR .
+
+En la sección
+.B SINOPSIS
+se siguen los siguientes convenios que pueden servir de guía para otras
+secciones.
+
+.TS
+tab (@);
+l l.
+\fBtexto en negrita\fR@debe teclear esto exactamente.
+\fItexto en cursiva\fR@reemplace esto por el argumento apropiado.
+[\|\fB\-abc\fR\|]@uno o todos los argumentos entre corchetes
+@son opcionales.
+\fB\-a\|\fR|\|\fB\-b\fR@las opciones separadas por | no pueden
+@usarse conjuntamente.
+\fIargumento\fB .\|.\|.@\fIargumento\fR es repetible.
+[\|\fIexpresión\fR\|]\fB .\|.\|.@\fRla \fIexpresión\fR\ entre corchetes completa
+@es repetible.
+.TE
+
+El ejemplo del empleo de la orden o función debe recogerá
+todos los posibles usos. En algunos casos es recomendable ilustrar
+algunos usos exclusivos como se puede ver en la
+.B SINOPSIS
+de esta página de manual.
+.SH EJEMPLOS
+.TP \w'%man%\ 'u
+.BI %man% \ ls
+Presenta la página de manual del
+.I elemento
+(programa)
+.IR ls .
+.TP
+.BI %man%\ \-a \ intro
+Presenta, secuencialmente, todas las páginas de
+.I intro
+disponibles en el manual. Entre página y página se puede decidir saltar a
+la siguiente o salir del paginador completamente.
+
+.TP
+\fB%man% \-t \fIalias \fR|\fI lpr -Pps
+Formatea la página de manual referenciada por
+.RI ` alias ',
+generalmente una página de manual de tipo shell, usando el formato
+predeterminado
+.B troff
+o
+.B groff
+y redirige la salida a la impresora llamada
+.IR ps .
+La salida predeterminada de
+.B groff
+generalmente es PostScript.
+.B %man% \-\-help
+debería informarle de que procesador está siendo usado con la opción
+.B \-t
+.
+.TP
+.BI %man%\ \-l\ \-T dvi\ ./foo.1x.gz \ >\ ./foo.1x.dvi
+Esta orden descomprime y formatea el fichero fuente nroff de la página
+de manual
+.I ./foo.1x.gz
+y lo convierte en un fichero con formato
+.B independiente de dispositivo (dvi)
+. Es necesario usar la redirección pues la opción
+.B \-T
+dirige la salida al
+.B stdout
+sin paginador. La salida puede verse mediante un programa como
+.B xdvi
+o puede incluso convertirse al formato PostScript usando un programa como
+.BR dvips.
+.TP
+.BI %man%\ \-k \ printf
+Busca la
+.I palabra clave
+.IR printf
+entre las descripciones breves y las páginas de manual y presenta todas las
+que casen.
+.TP
+.BI %man%\ \-f \ smail
+Busca las páginas de manual referenciadas por
+.I smail
+e imprime la descripcion breve de las que encuentre.
+.SH DESCRIPCIÓN DETALLADA
+Existen muchas opciones en
+.B %man%
+cuyo objeto es dar la mayor flexibilidad posible al usuario. Se puede cambiar
+la ruta, el orden de las secciones, el procesador de salida y otras
+propiedades y operaciones descritas a continuación.
+
+Si se activan, varias variables de entorno son interrogadas para determinar
+el modo en que opera
+.BR %man% .
+Se puede activar la variable `conjunta'
+.RB $ MANOPT
+asignándole cualquier cadena en formato de línea de órdenes con la excepción
+de que cualquier espacio en un argumento ha de ser precedido de `\\'.
+.B %man%
+analizará
+.RB $ MANOPT
+antes de analizar su propia línea de órdenes. Aquellas opciones que tengan
+argumentos, se pueden cambiar si se incluyen al invocar man.
+Para desactivar todas las opciones activas en
+.RB $ MANOPT ,
+basta usar
+.B \-D
+como primera opción en la línea de órdenes. Esto hace que %man% `olvide' las
+opciones de
+.RB $ MANOPT
+aunque el contenido de la variable tiene que ser de todos modos el correcto.
+
+Los útiles de páginas de manual incluidos en el paquete
+.B man_db
+hacen uso extenso de cachés
+.B índices
+de las bases de datos. Estos cachés contienen información sobre donde
+se encuentra cada una de las páginas del manual en el sistema de
+ficheros y lo que contiene el
+.I whatis
+(breve descripción de una línea de la página de manual). Uno de los
+cometidos de
+.B %man%
+es asegurarse de que los cachés son siempre consistentes.
+Las bases de datos caché permiten obviar el uso de software que
+actualice las bases de datos tipo texto
+.I whatis
+tradicionales, e incrementan la velocidad de ejecución de
+.B %man%
+si se compara con lo que tardaría si tuviese que buscar todo el
+sistema de ficheros cada vez que necesitase encontrar la página de
+manual adecuada.
+
+Cuando
+.B %man%
+no encuentra un fichero
+.B índice
+de la base de datos creado por
+.B %mandb%
+para una jerarquía de páginas de manual dada, se efectuará una búsqueda pero
+será necesario usar expansión de caracteres comodín para buscar dentro de
+dicha jerarquía.
+
+Si
+.B %whatis%
+o
+.B %apropos%
+no encuentran un
+.B fichero índice
+intentarán extraer la información de una base de datos
+.I whatis
+tradicional.
+.\"`User' manual page hierarchies will have
+.\".B index
+.\"caches created `on the fly'.
+
+Estos útiles permiten el uso de ficheros fuente nroff comprimidos
+(con extensiones
+.BR .Z ", " .z " y " .gz ).
+Es posible utilizar cualquier extensión para las páginas comprimidas pero
+es necesario conocer esta información durante la compilación.
+También, de forma predeterminada, cualquier página cat generada, se
+comprime utilizando
+.BR gzip .
+Cualquier jerarquía de páginas de manual `global' como
+.I /usr/man
+o
+.I /usr/X11R6/man
+puede utilizar cualquier directorio como raíz de su jerarquía de páginas
+cat. De forma tradicional, se acostumbra a almacenarlas bajo la
+misma jerarquía que las man, pero por razones del tipo de las mencionadas
+en el
+.BR "Estándar del Sistema de Ficheros Linux (FSSTND)" ,
+puede ser más apropiado almacenarlas en otros lugares.
+
+Si precisa más detalles de cómo se hace, por favor, refiérase a la
+página de
+.BR manpath (5).
+Si lo que quiere es enteder las razones, refiérase al estándar.
+
+Este paquete tiene sorporte internacional. Las páginas en lengua nativa
+pueden accederse (si se encuentran disponibles) mediante el
+uso de las funciones
+.I locale .
+Para usarlo, debe bien activar las variables
+.RB $ LC_MESSAGES ,
+.RB $ LANG
+o cualquier variable de entorno del sistema asignándoles el valor
+correspondiente a su idioma,
+generalmente usando el formato especificado por el estándar
+.B POSIX 1003.1 :
+
+.\"
+.\" Need a \c to make sure we don't get a space where we don't want one
+.\"
+.RI < idioma >[\|\c
+.B _\c
+.RI < territorio >\|[\|\c
+.B .\c
+.RI < conjunto-de-caracteres >\|[\|\c
+.B ,\c
+.RI < versión >\|]\|]\|]
+
+Si la página deseada esta disponible en sus informaciones
+.IR locale ,
+se presentará en vez de la página estándar (generalmente en inglés
+americano).
+
+Este paquete también incorpora el soporte de catálogos de mensajes
+internacionales y es activado del mismo modo, siempre y cuando esté
+disponible.
+En el caso de que las páginas de manual y los catálogos de mensajes que
+acompañan este paquete no estén disponibles en su lengua nativa y si
+quisiese colaborar en su traducción, por favor póngase en contacto
+con el autor que actúa de coordinador.
+
+Si necesita más información sobre otras características y extensiones
+disponibles con este paginador de manual, por favor refiérase a los documentos
+que se suministran con este paquete.
+
+.SH "VALORES PREDETERMINADOS"
+.B %man%
+busca las páginas del manual deseadas en los
+.I índices
+bases de datos caché. Si la `busqueda' es infructuosa, se ejecuta una
+comprobación de la consistencia de la base de datos caché
+para asegurarse de que el caché refleja fielmente el sistema de ficheros.
+Generalmente no es necesario ejecutar
+.B %mandb%
+una vez que se ha creado el caché inicial salvo que este quede corrompido.
+
+Una vez se localice una página de manual, se intenta determinar si existe una
+página relativa preformateada `cat' más reciente que el fichero nroff.
+En caso afirmativo, esta página (generalmente) se descomprime y se
+presenta mediante el paginador. Este paginador puede bien especificarse de
+uno de los diversos modos o bien se usará el predeterminado (ver opción
+.B \-P
+para más detalles).
+Si no existe página cat, o si es más antigua que el fichero nroff, éste último
+es filtrado y presentando de forma inmediata.
+
+Si se puede generar un fichero cat (existe un directorio cat relativo y tiene
+los permisos apropiados),
+.B %man%
+comprimirá y almacenará el fichero en segundo plano.
+
+Los filtros son descifrados de diversos modos. Primeramente, se intenta usar
+el valor de la opción de la línea de órdenes
+.B \-p
+o el contenido de la variable de entorno
+.RB $ MANROFFSEQ .
+Si no se ha usado
+.B \-p
+ni tampoco se ha activado la variable de entorno, la primera línea del fichero
+en formato nroff es analizada en busca de una cadena de preprocesador. Para que
+esta línea contenga una cadena de preprocesador válida, su aspecto debe
+asemejarse a
+
+.B '\e"
+.RB < cadena >
+
+donde
+.B cadena
+puede ser cualquier combinación letras descritas para la opción
+.B \-p
+más abajo.
+
+Si ninguno de los métodos anteriores proporciona información de filtrado, se
+usa el conjunto predeterminado.
+
+Se genera una tubería compuesta por los filtros y el formateador primario
+.RB ( nroff
+o
+.RB [ tg ] roff
+con
+.BR \-t )
+y se ejecuta.
+Alternativamente, si existe en la raiz del árbol man, un programa
+ejecutable
+.I mandb_nfmt
+(o
+.I mandb_tfmt
+con
+.BR \-t )
+será éste el que se ejecute. Los argumentos que recibirá son la página de
+manual fuente, la cadena de preprocesador y, de forma opcional el dispositivo
+que se especifique mediante el argumento
+.B \-T .
+.\" ********************************************************************
+.SH OPCIONES
+La duplicación de opciones sin argumento tanto en la línea de órdenes, en
+.RB $ MANOPT ,
+o en ámbos, no tiene ningún efecto dañino. Para aquellas opciones que
+requieren un argumento, cada duplicado sobreescribe el valor anterior
+del argumento.
+.TP
+.B \-l, \-\-local-file
+Activa el modo `local'. Formatéa e imprime las páginas de manual locales en
+vez de buscarlas entre la colección de manuales del sistema.
+Cada página de manual argumento se supone fichero fuente en formato
+nroff.
+.\" Compressed nroff source files with a supported compression.
+.\" extension will be decompressed by man prior to being displaying via the
+.\" usual filters.
+No se genera un fichero cat.
+Si se añade '\-' a la lista de argumentos, se toma la entrada del stdin.
+.TP
+.BI \-L\ locales ,\ \-\-locale= locales
+.B %man%
+normalmente determina su estado de locales actual mediante una llamada a la
+función de la biblioteca C
+.BR setlocale (3)
+que interroga varias variables de entorno, entre otras
+.RB $ LC_MESSAGES
+y
+.RB $ LANG .
+Para sobreescribir temporalmente el valor determinado, puede usar esta opción
+y suplir la cadena de
+.I locales
+directamente a
+.BR %man% .
+Es necesario notar que el cambio no tendrá lugar hasta que comience la
+búsqueda propiamente dicha.
+Salidas como el mensaje de ayuda siempre aparecen según los locales
+determinados inicialmente.
+.TP
+.B \-D, \-\-default
+Esta opción se usa generalmente la primera y restaura el comportamiento de
+.B %man%
+al modo predeterminado. Se usa para restaurar las opciones modificadas
+mediante
+.RB $ MANOPT .
+Cualquier opción que siga a
+.B \-D
+producirá el efecto usual.
+.TP
+.BI \-M\ ruta ,\ \-\-manpath= ruta
+Especifica una ruta de manual alternativa. De forma predeterminada,
+.B %man%
+utiliza código derivado de
+.B %manpath%
+para determinar la ruta de búsqueda. Esta opción sobreescribe el valor de
+la variable de entorno
+.RB $ MANPATH
+y hace que la opción
+.B \-m
+sea ignorada.
+.TP
+.BI \-P\ paginador ,\ \-\-pager= paginador
+Especifica que paginador de salida se ha de usar. De forma predeterminada,
+.B %man%
+usa
+.BR %pager% .
+Esta opción sobreescribe el valor de la variable de entorno
+.RB $ PAGER
+y no se puede usar a la vez que
+.B \-f
+o
+.BR \-k .
+.TP
+.BI \-r\ prompt ,\ \-\-prompt= prompt
+Si se usa una versión reciente del paginador
+.B less ,
+.B %man%
+intentará fijar el prompt y alguna de sus opciones de forma inteligente.
+El prompt predeterminado será
+
+.B \ Página de Manual\c
+.IB \ nombre ( sección )\c
+.BI \ línea \ x
+
+donde
+.I nombre
+denota el nombre de la página de manual,
+.I sección
+denota la sección en la que se ha encontrado dicha página y
+.IR x ,
+el renglón actual.
+.\"The default options are
+.\".BR \-six8 .
+Esto se consigue usando la variable de entorno
+.RB $ LESS .
+.\"The actual default will depend on your chosen
+.\".BR locale .
+
+Si se suministra una cadena mediante la opción
+.B \-r
+se sobreescribe este comportamiento predeterminado.
+.\"You may need to do this if your
+.\"version of
+.\".B less
+.\"rejects the default options or if you prefer a different prompt.
+La cadena puede contener el texto
+.B $MAN_PN
+que se convertirá en el nombre de la página de manual presentada y su sección
+rodeada de `(' y `)'. Así, la cadena que produce el comportamiento
+predeterminado se podría expresar como
+
+.B \e\ Página\e\ de\e\Manual\e\ \e$MAN_PN\e\ ?ltlínea\e\ %lt?L/%L.:
+.br
+.B byte\e\ %bB?s/%s..?\e\ (END):?pB\ %pB\e\e%..
+
+La cadena se presenta en dos líneas para facilitar su lectura sólamente.
+Para entender su significado por favor vea la página de manual de
+.BR less (1) .
+La cadena de prompt es evaluada primero por la shell. Todas las dobles comillas
+comillas invertidas y barras invertidas del prompt deben ser precedidas de
+`\\'. Si se termina la cadena de prompt con `\e$', se podrán añadir
+posteriormente más opciones de less.
+De forma predeterminada
+.B %man%
+usa las opciones
+.B \-ix8 .
+.TP
+.B \-7, \-\-ascii
+Si está viendo una página de manual en código
+.IR ascii (7)
+puro o en una terminal o emulador de terminal de 7 bits,
+algunos caracteres puede que no se impriman correctamente si usa el
+descriptor de dispositivo
+.IR latin1 (7)
+con
+.B GNU
+.BR nroff .
+Esta opción permite que las páginas en puro
+.I ascii
+puedan ser presentadas en
+.I ascii
+en un dispositivo
+.I latin1 .
+No traducira ningún texto en
+.I latin1 .
+La siguiente tabla explica las traducciones que se realizan.
+
+.TS
+tab (@);
+l c c c.
+Descripción@Octal@latin1@ascii
+_
+guión de continuación@255@\[char173]@-
+marcador (punto medio)@267@\(bu@o
+acento agudo@264@\(aa@'
+signo de multiplicar@327@\(mu@x
+.TE
+
+Si la columna de
+.I latin1
+se imprime correctamente, su terminal puede ser usada con el conjunto
+.I latin1
+de caracteres y esta opción no es necesaria.
+Si las columnas
+.I latin1
+y
+.I ascii
+son idénticas, está leyendo la página usando esta opción o bien
+.B %man%
+no ha formateado la página usando la descripción de dispositivo
+.I latin1 .
+Si la columna
+.I latin1
+no existe o está mal impresa, es posible que necesite esta opción.
+
+Esta opción es ignorada cuando se usa a la vez que
+.BR \-t ,
+.B \-T
+o
+.B \-Z
+y puede ser completamente inútil si el
+.B nroff
+usado es distinto del de
+.BR GNU .
+.TP
+.BI \-S\ lista ,\ \-\-sections= lista
+Lista es un compendio de secciones separadas por "dos puntos" que determina
+el orden en el que se consultan las secciones del manual. Esta opción
+sobreescribe el valor de la variable de entorno
+.RB $ MANSECT .
+.TP
+.B \-a, \-\-all
+Por defecto,
+.B %man%
+termina después de presentar la página de manual que considera más apropiada
+de entre las encontradas. Si usa esta opción, forzará a
+.B %man%
+a presentar todas las páginas de manual cuyos nombres respondan a los
+criterios de la búsqueda.
+.TP
+.B \-c, \-\-catman
+Esta opción no es de uso general y debería ser usada únicamente por el
+programa
+.B %catman% .
+.TP
+.B \-d, \-\-debug
+En vez de presentar páginas de manual, imprime información de depurado.
+.TP
+.BI \-e\ sub-extensión ,\ \-\-extension= sub-extensión
+Algunos sistemas como por ejemplo el paquete
+.B Tcl
+incorporan grandes paquetes de páginas de manual a la jerarquía principal.
+Para evitar tener dos páginas con un mismo nombre como por ejemplo
+.BR exit (3),
+las páginas de
+.B Tcl
+han sido por lo general asignadas a la sección
+.BR l .
+Esta solución es desafortunada y actualmente es posible poner las páginas en
+la sección correcta y asignarles una `extensión' específica, en este caso,
+.BR exit (3tcl).
+En condiciones normales,
+.B %man%
+preferirá presentar
+.BR exit (3)
+a
+.BR exit (3tcl).
+Para solventar esta situación y evitar tener que saber a que sección pertenece
+la páguina requerida, es posible darle a
+.B %man%
+una extensión
+.l sub-extension
+indicando a que paquete tiene que pertenecer dicha página. Así con el ejemplo
+anterior, basta suministrar la opción
+.B \-e\ tcl
+a
+.B %man%
+para que se restrinja la búsqueda a páginas que tengan
+.BR *tcl
+como extensión.
+.TP
+.B \-f, \-\-whatis
+Es equivalente a
+.BR %whatis% .
+Presenta una breve descripción tomada de la página de manual cuando ésta está
+disponible. Véase
+.BR %whatis% (1)
+para más detalles.
+.TP
+.B \-h, \-\-help
+Imprime un mensaje de ayuda y termina.
+.TP
+.B \-k, \-\-apropos
+Es equivalente a
+.BR %apropos% .
+Realiza una busqueda de palabras clave entre las descripciones breves de las
+páginas de manual y presenta las páginas identificadas. Véase
+.BR %apropos% (1)
+para más detalles.
+.\"
+.\" Due to the rather silly limit of 6 args per request in some `native'
+.\" *roff compilers, we have do the following to get the two-line
+.\" hanging tag on one line. .PP to begin a new paragraph, then the
+.\" tag, then .RS (start relative indent), the text, finally .RE
+.\" (end relative indent).
+.\"
+.PP
+.B \-m
+.I sistema\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= sistema\c
+\|[\|,.\|.\|.\|]
+.RS
+Si este sistema tiene acceso a las páginas de manual de otro sistema
+operativo, se puede activar su búsqueda mediante esta opción.
+Para buscar en las páginas de NuevoSO, use la opción
+.B \-m
+.BR NuevoSO .
+El
+.I sistema
+especificado puede ser una lista de
+nombres de sistemas operativos separada por comas.
+Para incluir el sistema operativo nativo en la búsqueda basta incluir
+.B man
+como nombre de sistema en la lista de argumentos.
+
+El valor de esta opción sobreescribe el contenido de la variable
+del entorno
+.RB $ SYSTEM.
+.RE
+.TP
+.BI \-p\ cadena ,\ \-\-preprocessor= cadena
+Especifica la secuencia de preprocesadores a ejecutar antes de
+.B nroff
+o
+.BR troff / groff .
+No todas las instalaciones tienen el conjunto completo de preprocesadores.
+Algunos de los preprocesadores y de las letras usadas para designarlos son:
+.BR eqn " (" e ),
+.BR grap " (" g ),
+.BR pic " (" p ),
+.BR tbl " (" t ),
+.BR vgrind " (" v ),
+.BR refer " (" r ).
+El valor de esta opción sobreescribe al contenido de la variable
+del entorno
+.RB $ MANROFFSEQ .
+.B %zsoelim%
+es ejecutado siempre en primer lugar.
+.TP
+.B \-u, \-\-update
+Los cachés de los
+.B índices
+de las bases de datos son acutalizados `sobre la marcha', es decir, no es
+necesario que
+.B %mandb%
+se ejecute periódicamente para mantener la consistencia. Si la página que
+busca no se encuentra en los cachés o si se emplea la opción
+.B \-a ,
+.B %man%
+automáticamente comprobará la consistencia de los directorios para asegurar
+que los cachés son una representación fiel del sistema de ficheros.
+Para forzar una comprobación de consistencia de los `inodos' anterior a la
+búsqueda, use la opción
+.BR \-u .
+.TP
+.B \-t, \-\-troff
+Usa
+.I %troff%
+para formatear las páginas de manual y escribirlas en el stdout.
+Esta opción es innecesaria en conjunción con
+.B \-T
+o
+.BR \-Z .
+.PP
+.BI \-T\ dispositivo ,\ \-\-troff-device
+.RI [\| =dispositivo \|]
+.RS
+Esta opción permite cambiar la salida generada por
+.B groff
+(o incluso la de
+.BR troff )
+de forma que sea más apropiada para un dispositivo diferente del
+predeterminado.
+Implica la opción
+.BR \-t .
+Posibles ejemplos (incluidos en Groff-1.09) son,
+.BR dvi ", " latin1 ,
+.BR X75 " and " X100 .
+.RE
+.TP
+.B \-Z, \-\-ditroff
+.B groff
+ejecuta
+.B troff
+y usa un post-procesador para generar la salida apropiada para el dispositivo
+seleccionado. Si
+.I %troff%
+es
+.BR groff ,
+esta opción se pasa a
+.B groff
+evitando el uso de un post-procesador.
+Implica la opción
+.BR \-t .
+.TP
+.B \-w, \-\-where, \-\-location
+En vez de imprimir las páginas de manual, sólo imprime el/los lugar(es) en los
+que se encuentran los ficheros que serían formateados o impresos. Si se trata
+de un fichero cat, se imprime también la situación del fichero fuente nroff.
+.TP
+.B \-V, \-\-version
+Imprime la versión y el autor.
+.SH "ESTADO DE SALIDA"
+.TP
+.B 0
+La ejecución del programa ha terminado con éxito.
+.TP
+.B 1
+Error de uso, sintaxis o del fichero de configuración.
+.TP
+.B 2
+Error operacional.
+.TP
+.B 3
+Un proceso hijo ha terminado con estatus no-nulo.
+.TP
+.B 16
+Al menos una de las/los páginas/ficheros/palabras clave no existe o no ha
+producido ninguna identificación positiva.
+.SH ENTORNO
+.\".TP \w'MANROFFSEQ\ \ 'u
+.TP
+.B MANPATH
+Si se activa
+.RB $ MANPATH ,
+su valor determina cual es la ruta de búsqueda para las páginas del manual.
+.TP
+.B MANROFFSEQ
+Si se activa
+.RB $ MANROFFSEQ ,
+su valor determina el conjunto de preprocesadores que filtran cada página de
+manual. La lista predeterminada de preprocesadores depende del sistema.
+.TP
+.B MANSECT
+Si se activa
+.RB $ MANSECT ,
+su valor es una lista de secciones delimitadas por "dos puntos" que permite
+determinar qué secciones de manual se usan en la búsqueda y en qué orden.
+.TP
+.B PAGER
+Si se activa
+.RB $ PAGER ,
+su valor determina el nombre del programa usado para presentar la página de
+manual. El sistema, de forma predeterminada, usará
+.B %pager% .
+.TP
+.B SYSTEM
+Si se activa
+.RB $ SYSTEM ,
+tiene el mismo efecto que la opción
+.B \-m "cadena"
+donde cadena es el contenido de la variable
+.RB $ SYSTEM .
+.TP
+.B MANOPT
+Si se activa
+.RB $ MANOPT ,
+se analiza antes que la línea de órdenes de
+.B %man% ,
+suponiéndose que el formato es similar. Como quiera que todas las demás
+variables de entorno específicas de
+.B %man%
+pueden expresarse como argumentos de la línea de órdenes y pueden por tanto
+ser incluidas en
+.RB $ MANOPT ,
+se espera que se vuelvan obsoletas.
+N.B.: Todos los espacios que formen parte del argumento de una opción deben
+ir precedidos de `\'.
+
+.TP
+.BR LANG , " LC_MESSAGES"
+Dependiendo del sistema y la implementación, una o ambas
+.RB $ LANG
+y
+.RB $ LC_MESSAGES
+son usadas para determinar los mensajes locales que se van a usar.
+.B %man%
+imprime los mensajes en dichos locales (si están disponibles). Veáse
+.BR setlocale (3)
+para más detalles.
+.SH FICHEROS
+.TP
+.I %manpath_config_file%
+fichero de configuración de man_db.
+.TP
+.I /usr/man
+Una jerarquía global de páginas de manual
+.TP
+.I /usr/man/index.(bt|db|dir|pag)
+Caché de
+.I índice
+de base de datos global tradicional.
+.TP
+.I /var/catman/index.(bt|db|dir|pag)
+Caché del
+.I Índice
+de base de datos alternativo o conforme al FSSTND.
+.TP
+.I /usr/man/mandb_nfmt
+Ejemplo de un guión opcional
+.B nroff
+de formateo por jerarquía.
+.TP
+.I /usr/man/mandb_tfmt
+Ejemplo de un guión opcional
+.RB [ tg ] roff
+de formateo por jerarquía para usar con
+.BR \-t .
+.SH "VÉASE TAMBIÉN"
+.BR %mandb% (8),
+.BR %manpath% (1),
+.BR manpath (5),
+.BR %apropos% (1),
+.BR %whatis% (1),
+.BR %catman% (8),
+.BR less (1),
+.BR nroff (1),
+.BR troff (1),
+.BR groff (1),
+.BR %zsoelim% (1),
+.BR setlocale (3),
+.BR ascii (7),
+.BR latin1 (7),
+.BR FSSTND .
+.SH HISTORIA
+1990, 1991 \- Escrito originalmente por John W. Eaton (jwe@che.utexas.edu).
+
+23 de Diciembre de 1992: Rik Faith (faith@cs.unc.edu) subsanó unos errores
+mediante las correcciones proporcionadas por Willem Kasdorp
+(wkasdo@nikhefk.nikef.nl).
+
+30 de Abril de 1994 - %date_es%: Wilf.
+(G.Wilford@ee.surrey.ac.uk) ha ido desarrollando y manteniendo este paquete con la ayuda de algunas personas con gran dedicación.
+
+Traducción realizada por Luis F. González (luisgh@cogs.susx.ac.uk)
diff --git a/man/es_ES.88591/man1/manpath.man1 b/man/es_ES.88591/man1/manpath.man1
new file mode 100644
index 00000000..31ab329c
--- /dev/null
+++ b/man/es_ES.88591/man1/manpath.man1
@@ -0,0 +1,118 @@
+.\" Man page for manpath
+.\"
+.\" Copyright (C), 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the COPYING file that comes with the
+.\" man_db distribution.
+.\"
+.\" Sun Jan 22 22:15:17 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH %manpath% 1 "%date_es%" "%version%" "Útiles de Páginas de Manual"
+.SH NAME
+%manpath% \- determinar la ruta para las páginas de manual
+.SH SINOPSIS
+.B %manpath%
+.RB [\| \-qgdc \|]
+.RB [\| \-m
+.IR sistema \|[\|,.\|.\|.\|]\|]
+.SH DESCRIPCIÓN
+Si
+.RB $ MANPATH
+está activa,
+.B %manpath%
+simplemente presenta su contenido y un mensaje de advertencia.
+En caso contrario,
+.B %manpath%
+determina una ruta adecuada de jerarquías de páginas de manual y presenta
+los resultados.
+
+La ruta, delimitada por "dos puntos", se determina en base a la información
+contenida en el fichero de configuración de
+man_db -
+.RI ( "%manpath_config_file%" )
+y el entorno del usuario.
+.SH OPCIONES
+.TP
+.B \-q, \-\-quiet
+No imprime advertencias.
+.TP
+.B \-d, \-\-debug
+Genera información de depurado.
+.TP
+.B \-c, \-\-catpath
+Determina la ruta de cat en vez de la de manual. Una vez que la ruta de
+manual ha sido determinada, cada elemento de la ruta es convertido a su
+ruta cat relativa.
+.TP
+.B \-g, \-\-global
+Determina la ruta de manual formada por todas las rutas que han sido
+marcadas como `global' en el fichero de configuración de man_db.
+.\"
+.\" Due to the rather silly limit of 6 args per request in some `native'
+.\" *roff compilers, we have do the following to get the two-line
+.\" hanging tag on one line. .PP to begin a new paragraph, then the
+.\" tag, then .RS (start relative indent), the text, finally .RE
+.\" (end relative indent).
+.\"
+.PP
+.B \-m
+.I sistema\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= sistema\c
+\|[\|,.\|.\|.\|]
+.RS
+Si este sistema tiene acceso a las jerarquías de páginas de manual de otro
+sistema operativo, se puede usar esta opción para incluirlas en la salida de
+.BR %manpath% .
+
+Para incluir las jerarquías de páginas de manual de NuevoSO,
+use la opción
+.B \-m
+.BR NuevoSO .
+
+El
+.I sistema
+especificado puede en realidad ser una combinación de nombres de
+sistemas operativos separados por "comas".
+
+Para incluir en la búsqueda las jerarquías de páginas del sistema
+operativo nativo, debe incluir el nombre de sistema
+.B man
+en la cadena de argumentos.
+El valor dado en esta opción es utlizado por el sistema en lugar
+de la variable del entorno
+.RB $ SYSTEM .
+.RE
+.TP
+.B \-h, \-\-help
+Imprime un mensaje de ayuda y termina.
+.TP
+.B \-V, \-\-version
+Presenta la información sobre el autor y la versión.
+.SH ENTORNO
+.TP
+.B MANPATH
+Si la variable
+.RB $ MANPATH
+está activa,
+.B %manpath%
+imprime su contenido en vez de determinar la ruta sobre la marcha.
+.TP
+.B SYSTEM
+Si la variable
+.RB $ SYSTEM
+está activa, tendrá el mismo efecto que si su contenido hubiese sido usado
+como argumento de la opción
+.B \-m .
+.SH FICHEROS
+.TP \w'%manpath_config_file%'u+2n
+.I %manpath_config_file%
+Fichero de configuración del sistema.
+.SH "VÉASE TAMBIÉN"
+.BR %apropos% (1),
+.BR %whatis% (1),
+.BR %man% (1).
+.SH AUTOR
+Wilf. (G.Wilford@ee.surrey.ac.uk)
+Traducción realizada por Luis F. González (luisgh@cogs.susx.ac.uk)
diff --git a/man/es_ES.88591/man1/whatis.man1 b/man/es_ES.88591/man1/whatis.man1
new file mode 100644
index 00000000..e73aea3f
--- /dev/null
+++ b/man/es_ES.88591/man1/whatis.man1
@@ -0,0 +1,195 @@
+.\" Man page for whatis
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH %whatis% 1 "%date_es%" "%version%" "Útiles de Páginas de Manual"
+.SH NOMBRE
+%whatis% \- imprime descripciones de páginas de manual
+.SH SINOPSIS
+.B %whatis%
+.RB [\| \-dhV \|]
+.RB [\| \-r \||\| \-w\c
+\|]
+.RB [\| \-m
+.IR sistema \|[\|,.\|.\|.\|]\|]
+.RB [\| \-M
+.IR ruta \|]
+.I nombre
+\&.\|.\|.
+.SH DESCRIPCIÓN
+Cada página de manual contiene una pequeña descripción.
+.B %whatis%
+realiza una búsqueda entre los nombres de las páginas de manual,
+mostrando aquellos que se asemejen al
+.I nombre
+dado.
+
+.I nombre
+puede contener caracteres comodín
+.RB ( \-w )
+o puede tratarse de una expresión regular
+.RB ( \-r ).
+Si se usa una de estas opciones,
+puede resultar necesario entrecomillar el
+.I nombre
+o anteponer `\\' a dichos caracteres para evitar que el intérprete de
+órdenes los sustituya.
+
+Las bases de datos
+.B índices
+son usadas durante la búsqueda.
+Para generar una base de datos
+.B whatis
+antigua tipo texto de la base
+.B index
+índice, basta usar la orden:
+
+.B %whatis% \-M
+.I ruta_de_manual
+.B \-w '*' | sort >
+.I ruta_de_manual/whatis
+
+donde
+.I ruta_de_manual
+es una jerarquía de páginas de manual como, por ejemplo,
+.IR /usr/man .
+.SH OPCIONES
+.TP
+.B \-d, \-\-debug
+Imprime información de depurado.
+.TP
+.B \-r, \-\-regex
+Interpreta cada
+.I nombre
+como una expresión regular.
+Si un
+.I nombre
+se asemeja a cualquier parte del nombre de una página, se interpretará como
+una identificación positiva.
+Esta opción hace que
+.B %whatis%
+funcione algo más lento dada la naturaleza de las búsquedas en
+bases de datos.
+.TP
+.B \-w, \-\-wildcard
+Interpreta cada
+.I nombre
+como un patrón que contiene caracteres comodín al estílo del
+intérprete de órdenes.
+Para que se produzca una identificación positiva, el
+.I nombre
+expandido debe corresponder al nombre de la página completo.
+Esta opción hace que
+.B %whatis%
+funcione algo más lento dada la naturaleza de las búsquedas en bases de datos.
+
+.\"
+.\" Due to the rather silly limit of 6 args per request in some `native'
+.\" *roff compilers, we have do the following to get the two-line
+.\" hanging tag on one line. .PP to begin a new paragraph, then the
+.\" tag, then .RS (start relative indent), the text, finally .RE
+.\" (end relative indent).
+.\"
+.PP
+.B \-m
+.I sistema\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= sistema\c
+\|[\|,.\|.\|.\|]
+.RS
+Si este sistema tiene acceso a los nombres de páginas del manual de otro
+sistema operativo, se puede acceder a ellos mediante esta opción.
+Para buscar entre las páginas de NuevoSO,
+use la opción
+.B \-m
+.BR NuevoSO .
+
+El
+.I sistema
+especificado puede en realidad ser una combinación de nombres de
+sistemas operativos separados por "comas".
+
+Para incluir en la búsqueda las páginas del sistema operativo nativo,
+incluya el nombre de sistema
+.B man
+en la cadena de argumentos.
+El valor dado en esta opción es utlizado por el sistema en lugar
+de la variable del entorno
+.RB $ SYSTEM .
+.RE
+.TP
+.BI \-M\ ruta ,\ \-\-manpath= ruta
+Especifica un conjunto de jerarquías de páginas de manual delimitado
+por "dos puntos" en el que se realizará la búsqueda.
+Por defecto,
+.B %apropos%
+usa la variable de entorno
+.RB $ MANPATH
+a menos que ésta esté vacía o desactivada, en cuyo caso se determinará la
+ruta de manual apropiada en base al contenido de la variable de entorno
+.RB $ PATH .
+El valor dado en esta opción es utlizado por el sistema en lugar
+de la variable del entorno
+.RB $ MANPATH .
+.TP
+.B \-h, \-\-help
+Imprime un mensaje de ayuda y termina.
+.TP
+.B \-V, \-\-version
+Presenta la información sobre el autor y la versión.
+.SH "ESTADO DE SALIDA"
+.TP
+.B 0
+La ejecución del programa ha terminado con éxito.
+.TP
+.B 1
+Error de uso, sintaxis o del fichero de configuración.
+.TP
+.B 2
+Error operacional.
+.TP
+.B 16
+No se han encontrado páginas de manual que se asemejen a los
+criterios especificados.
+.SH ENTORNO
+.TP
+.B SYSTEM
+Si la variable
+.RB $ SYSTEM
+está activa, tendrá el mismo efecto que si su contenido hubiese sido usado
+como argumento con la opción
+.B \-m .
+.TP
+.B MANPATH
+Si la variable
+.RB $ MANPATH
+está activa, su valor se interpreta como la lista de sucesivas
+jerarquías de páginas de manual separadas por "dos puntos",
+que se usará en la búsqueda.
+.SH FICHEROS
+.TP
+.I /usr/man/index.(bt|db|dir|pag)
+.I Índice
+tradicional global del caché de la base de datos.
+.TP
+.I /var/catman/index.(bt|db|dir|pag)
+.I Índice
+global alternativo o de acuerdo al FSSTND del caché de la base de datos.
+
+.TP
+.I /usr/man/\|.\|.\|.\|/whatis
+Base de datos
+.B whatis
+tradicional tipo texto.
+.SH "VÉASE TAMBIÉN"
+.BR %apropos% (1),
+.BR %man% (1).
+.SH AUTOR
+Wilf. (G.Wilford@ee.surrey.ac.uk)
+Traducción realizada por Luis F. González (luisgh@cogs.susx.ac.uk)
diff --git a/man/es_ES.88591/man1/zsoelim.man1 b/man/es_ES.88591/man1/zsoelim.man1
new file mode 100644
index 00000000..be03da3b
--- /dev/null
+++ b/man/es_ES.88591/man1/zsoelim.man1
@@ -0,0 +1,75 @@
+.\" Man page for %zsoelim%
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Dec 10 19:33:32 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH %zsoelim% 1 "%date_es%" "%version%" "Útiles para las Páginas del Manual"
+.SH NOMBRE
+%zsoelim% \- satisface peticiones .so en la entrada suministrada a roff
+.SH SINOPSIS
+.B %zsoelim%
+.RB [\| \-CVh \|]
+.RI [\| fichero
+\&.\|.\|.\|]
+.SH DESCRIPCIÓN
+.B %zsoelim%
+analiza los
+.I ficheros
+indicados como argumentos, o si no se ha especificado ninguno, su entrada
+estandar, buscando líneas de la forma:
+
+.B .so
+.RI <\| nombre_de_fichero \|>
+
+Estas peticiones se sustituyen por los contenidos del
+.I fichero
+especificado. Si la petición no se puede cumplir,
+.B %zsoelim%
+buscará el fichero
+.I nombre_de_fichero.ext
+donde
+.I .ext
+puede ser
+.BR .gz ,
+.BR .Z
+o
+.BR .z .
+Otros tipos de extensiones pueden estar soportadas dependiendo de las opciones
+especificadas a la hora de compilar el programa.
+Si la petición puede cumplirse con un fichero comprimido, este fichero se
+descomprime usando un descompresor apropiado, y su salida se usa para
+satisfacer la petición.
+
+Tradicionalmente, los programas
+.B soelim
+se usaban para permitir que los preprocesadores roff preprocesasen los
+ficheros a los que hacían referencia las peticiones. Esta versión en
+particular fue escrita para evitar los problemas creados a la hora
+de soportar páginas del manual comprimidas.
+.SH OPCIONES
+.TP
+.B \-C
+Esta opción está disponible por compatibilidad con otros programas
+.B soelim.
+Se usa para permitir peticiones .so seguidas de algo distinto de un
+espacio en blanco. Como éste es el comportamiento original, esta opción
+no se tiene en cuenta.
+.TP
+.B \-h
+Muestra un mensaje de ayuda y termina.
+.TP
+.B \-V
+Muestra información sobre el autor y la versión.
+.SH "VÉASE TAMBIÉN"
+.BR nroff (1),
+.BR troff (1),
+.BR groff (1),
+.BR %man% (1).
+.SH AUTOR
+Wilf. (G.Wilford@ee.surrey.ac.uk).
+Traducción realizada por Enrique Zanardi (ezanardi@ull.es)
diff --git a/man/es_ES.88591/man5/manpath.man5 b/man/es_ES.88591/man5/manpath.man5
new file mode 100644
index 00000000..3b90e239
--- /dev/null
+++ b/man/es_ES.88591/man5/manpath.man5
@@ -0,0 +1,109 @@
+.\" Man page for format of the manpath.config data file
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH manpath 5 "%date_es%" "%version%" "%manpath_config_file%"
+.SH NOMBRE
+manpath \- formato del fichero %manpath_config_file%
+.SH DESCRIPCIÓN
+El fichero de configuración de rutas de manual se usa por los útiles de las
+páginas
+de manual para obtener las rutas a los manuales para cada usuario a la
+hora de ejecutar dichos útiles, para indicar que jerarquías de páginas
+de manuales (rutas a los manuales o "manpaths") se deben tratar como
+`globales' y para asignarles directorios a usar para almacenar los
+ficheros cat.
+
+Si la variable de entorno
+.RB $ MANPATH
+ya ha sido definida, la información contenida en %manpath_config_file% no
+tendrá precedencia sobre ella.
+.SH FORMATO
+Los siguientes tipos de campo estan reconocidos actualmente:
+.TP
+.BI # \ comentario
+Las líneas en blanco o las que comienzan con
+.B #
+serán tratadas como comentarios y no serán procesadas.
+.TP
+.BI MANDATORY_MANPATH \ elemento_de_ruta_de_manual
+Las líneas de esta forma indican rutas de manual que cualquier
+.RB $ MANPATH
+generado automáticamente debe contener. Esto incluirá típicamente
+.IR /usr/man .
+.TP
+.BI MANPATH_MAP \ elemento_de_ruta\ elemento_de_ruta_de_manual
+Las líneas de esta forma definen las correspondencias entre
+.RB $ PATH
+y
+.RB $ MANPATH .
+Para cada
+.I elemento_de_ruta
+que se encuentre en el
+.RB $ PATH
+del usuario, se añadira
+.I elemento_de_ruta_de_manual
+al
+.RB $ MANPATH .
+.TP
+\fBMANDB_MAP \fIelemento_de_ruta_de_manual \fR\|[\| \fIelemento_de_ruta_de_cat\fR \|]
+Las líneas de esta forma indican qué rutas de manual se deben tratar como
+`globales' y opcionalmente, donde se deben almacenar sus ficheros cat.
+Este tipo de fichero es particularmente importante si
+.B man
+es un programa setuid, ya que esto indica cuáles jerarquías de páginas de
+manual se deben acceder como el usuario setuid y cuáles como el usuario
+que ejecuta el programa.
+
+Las jerarquías de páginas de manual `globales' suelen ser aquellas
+almacenadas bajo
+.I /usr
+como
+.IR /usr/man ,
+.I /usr/local/man
+y
+.IR /usr/X11R6/man .
+
+Si las páginas cat de un
+.I elemento_de_ruta_de_manual
+no deben ser almacenadas, o se deben almacenar en su lugar tradicional,
+.I elemento_de_ruta_de_cat
+puede omitirse.
+
+El almacenamiento en el lugar tradicional para cat puede ser imposible
+para jerarquías de páginas de manual montadas para sólo lectura, y a causa
+de esto es posible especificar cualquier jerarquía de directorios válida
+para su almacenamiento. Para cumplir el
+.B FSSTND de Linux
+la palabra clave
+.RB ` FSSTND '
+puede usarse en lugar de un directorio real.
+
+Desafortunadamente, es necesario especificar
+.B todas
+las rutas `globales' del árbol de rutas de manual, incluyendo las
+rutas para sistemas alternativos como
+.I /usr/man/sun
+y cualesquiera rutas para
+.B NLS locale
+como
+.IR /usr/man/de_DE.88591 .
+
+Como la información se procesa línea a línea en el orden en que fue escrita,
+es necesario que cualquier ruta de manual que sea una subjerarquía de otra
+jerarquía aparezca primero en el listado, de otro modo se asociarán de
+forma incorrecta.
+Un ejemplo es que
+.I /usr/man/de_DE.88591
+debe aparecer primero que
+.IR /usr/man .
+.SH BUGS
+A menos que las reglas descritas se sigan estrictamente, los útiles para
+las páginas de manual no funcionarán como se desea. Las reglas son muy
+complicadas.
diff --git a/man/es_ES.88591/man8/accessdb.man8 b/man/es_ES.88591/man8/accessdb.man8
new file mode 100644
index 00000000..282cc6cc
--- /dev/null
+++ b/man/es_ES.88591/man8/accessdb.man8
@@ -0,0 +1,43 @@
+.\" Man page for accessdb
+.\"
+.\" Copyright (c) 1998 Fabrizio Polacco <fpolacco@debian.org
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Tue, 24 Feb 1998 18:18:36 +0200
+.\"
+.TH accessdb 8 "%date%" "%version%" "Manual pager utils"
+.SH NAME
+accessdb \- dumps the content of a man-db database in a human readable
+format.
+.SH SYNOPSIS
+.B /usr/sbin/accessdb
+.RI [ <index-file> ]
+.SH DESCRIPTION
+.B accessdb
+will output the data contained within a man_db database in a
+human readable form. By default, it will dump the data from
+.B /var/catman/index.<db-type>,
+where <db-type> is dependent on the database library in use.
+
+Supplying an argument to accessdb will override this
+default.
+
+.nf
+$mtime$ -> "795987034"
+$version$ -> "2.3.1"
+apropos -> "1 1 795981542 A - - search the manual page names and descriptions"
+catman -> "8 8 795981544 A - - create or update the pre-formatted manual pages"
+man -> "1 1 795981542 A - - an interface to the on-line reference manuals"
+mandb -> "8 8 795981544 A - - create or update the manual page index caches"
+manpath -> " 1 5"
+manpath~1 -> "1 1 795981542 A - - determine search path for manual pages"
+manpath~5 -> "5 5 795981543 A - - format of the /etc/man_db.config file"
+whatis -> "1 1 795981543 A - - search the manual page names"
+zsoelim -> "1 1 795981543 A - - satisfy .so requests in roff input"
+.fi
+
+.SH AUTHOR
+Wilf. (G.Wilford@ee.surrey.ac.uk)
diff --git a/man/es_ES.88591/man8/catman.man8 b/man/es_ES.88591/man8/catman.man8
new file mode 100644
index 00000000..5e73388b
--- /dev/null
+++ b/man/es_ES.88591/man8/catman.man8
@@ -0,0 +1,99 @@
+.\" Man page for catman
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Dec 10 14:17:29 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH %catman% 8 "%date_es%" "%version%" "Útiles para las Páginas del Manual"
+.SH NOMBRE
+%catman% \- crea o actualiza las páginas del manual preformateadas
+.SH SINOPSIS
+.B %catman%
+.RB [\| \-dhV \|]
+.RB [\| \-M
+.IR ruta \|]
+.RI [\| sección \|]
+\&.\|.\|.
+.SH DESCRIPCIÓN
+.B %catman%
+se usa para crear un conjunto actualizado de páginas de manual prefromateadas,
+conocido como páginas cat.
+Las páginas cat se muestran generalmente mucho más rápido que las páginas
+del manual originales. La decisión de admitir páginas cat es del administrador
+local, que debe suministrar directorios apropiados para contenerlas.
+
+Las opciones disponibles para
+.B %catman%
+son las jerarquías y secciones de páginas del manual a preformatear. Las
+jerarquías por omisión son las especificadas como `globales' en el fichero
+de configuración de man_db y las secciones por omisión son, o bien
+los contenidos de la variable de entorno
+.RB $ MANSECT
+delimitados por dos puntos (:), o el conjunto estandar compilado dentro de
+.B %man%
+si
+.RB $ MANSECT
+no está definido. Si se le suministra a
+.B %catman%
+un conjunto de nombres de sección separados por espacios, tendrá precedencia
+sobre los dos anteriores.
+
+.B %catman%
+hace uso de la base de datos temporal de
+.B índice
+asociada con cada jerarquía para determinar qué ficheros tienen que ser
+formateados.
+.SH OPCIONES
+.TP
+.B \-d, \-\-debug
+Muestra información de depurado.
+.TP
+.BI \-M\ ruta ,\ \-\-manpath= ruta
+Especifica una ruta de búsqueda alternativa para la jerarquía de páginas
+del manual, delimitado por dos puntos (:). Por omisión ésta consiste en
+todas las
+rutas indicados como `globales' en el fichero de configuración de man_db.
+.TP
+.B \-h, \-\-help
+Muestra un mensaje de ayuda y termina.
+.TP
+.B \-V, \-\-version
+Muestra información sobre la versión y el autor.
+.SH ENTORNO
+.TP
+.B MANSECT
+SI
+.RB $ MANSECT
+está definida, su valor es una lista de secciones delimitadas por dos puntos
+(:) y se usa para determinar qué secciones del manual buscar y en qué orden.
+.TP
+.B MANPATH
+Si
+.RB $ MANPATH
+está definida, su valor se interpreta como la ruta de búsqueda a usar
+para la jerarquía de páginas del manual, delimitado por dos puntos (:).
+.SH FICHEROS
+.TP
+.I %manpath_config_file%
+fichero de configuración de man_db.
+.TP
+.I /usr/man/index.(bt|db|dir|pag)
+Una base de datos temporal de
+.I índice
+tradicional.
+.TP
+.I /var/catman/index.(bt|db|dir|pag)
+Una base de datos temporal de
+.I índice
+alternativa o acorde con el FSSTND.
+.SH "VÉASE TAMBIÉN"
+.BR %man% (1),
+.BR manpath (5),
+.BR %mandb% (8).
+.SH AUTOR
+Wilf. (G.Wilford@ee.surrey.ac.uk).
+Traducción realizada por Enrique Zanardi (ezanardi@ull.es)
diff --git a/man/es_ES.88591/man8/mandb.man8 b/man/es_ES.88591/man8/mandb.man8
new file mode 100644
index 00000000..2c7d95a5
--- /dev/null
+++ b/man/es_ES.88591/man8/mandb.man8
@@ -0,0 +1,154 @@
+'\" t
+.\" Man page for mandb
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Tue Apr 26 12:56:44 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH %mandb% 8 "%date_es%" "%version%" "útiles para las Páginas del Manual"
+.SH NOMBRE
+%mandb% \- crea o actualiza los índices temporales de páginas del manual
+.SH SINOPSIS
+.B %mandb%
+.RB [\| \-dqsuc \||\| \-h \||\| \-V\c
+.RI "\|] [\|" ruta al manual \|]
+.SH DESCRIPCIÓN
+.B %mandb%
+se usa para crear o actualizar manualmente la base de datos temporal de
+.B índices
+que usualmente mantiene la utilidad
+.BR %man% .
+Estos índices temporales contienen información sobre el estado actual
+del sistema de páginas del manual, y la infomación contenida en ellos
+se usa por las utilidades man_db para mejorar su velocidad y funcionalidad.
+
+Cuando se crea o actualiza un
+.BR índice,
+.B %mandb%
+le avisará de peticiones ROFF .so incorrectas, nombres falsos de páginas
+de manual y páginas cuyos
+.B whatis
+(descripciones cortas) no pudieron analizarse.
+
+Si se le suministra a
+.B %mandb%
+una ruta opcional, delimitada con dos puntos (:), no usará la ruta
+de búsqueda `global' interna para la jerarquía depáginas del manual,
+que se determina a partir de la información que se encuentra
+en el fichero de configuración de man_db.
+.SH "BASES DE DATOS TEMPORALES"
+.B %mandb%
+puede compilarse con soporte para cualquiera de los siguientes tipos
+de bases de datos.
+
+.TS
+tab (@);
+l l l l.
+Nombre@Tipo@Asinc@Nombre de fichero
+_
+Berkeley db@Árbol binario@Sí@\fIindex.bt\fR
+GNU gdbm v >= 1.6@"Hashed"@Sí@\fIindex.db\fR
+GNU gdbm v < 1.6@"Hashed"@No@\fIindex.db\fR
+UNIX ndbm@"Hashed"@No@\fIindex.(dir|pag)\fR
+.TE
+
+Los tipos de base de datos que soportan actualizaciones asíncronas
+permiten mayor velocidad, a costa de posible corrupción en caso de
+una interrupción inusual.
+En el caso inusual de que esto ocurra, puede ser necesario volver a
+ejecutar
+.B %mandb%
+con la opción
+.B \-c
+para volver a crear las bases de datos desde cero.
+.SH OPTCIONES
+.TP
+.B \-d, \-\-debug
+Muestra información de depurado.
+.TP
+.B \-q, \-\-quiet
+No muestra ningún aviso.
+.TP
+.B \-s, \-\-no-straycats
+No dedica tiempo a buscar o añadir información a las bases de datos
+sobre páginas "cat" sin su correspondiente página fuente.
+.TP
+.B \-c, \-\-create
+Por defecto,
+.B %mandb%
+intentará actualizar cualquier base de datos creada previamente.
+Si una base de datos no existe, la creará. Esta opción fuerza a
+.B %mandb%
+a que borre las bases de datos previas, y las cree de nuevo desde cero.
+Esto puede ser necesario si la base de datos se corrompe o si un nuevo
+esquema de almacenamiento de base de datos se introduce en el futuro.
+.TP
+.B \-u, \-\-user-db
+Crea bases de datos del usuario únicamente, incluso si tiene los permisos
+de escritura necesarios para crear bases de datos `globales'.
+.TP
+.B \-h, \-\-help
+Muestra el mensaje de uso, y termina.
+.TP
+.B \-V, \-\-version
+Muestra la versión, y termina.
+.SH DIAGNÓSTICOS
+Los siguientes mensajes de aviso pueden omitirse durante la construcción
+de las bases de datos.
+.TP
+.B <filename>: whatis parse for page(sec) failed
+(<fichero>: El análisis del "whatis" para la página(sección) falló).
+El intento de extraer la línea o líneas de descripción breve del
+<fichero> dado falló. Esto se debe usualmente a que la página de manual
+está pobremente escrita, pero si se emiten muchos mensajes como este, es
+probable que el sistema contenga páginas de manual no estandar que sean
+incompatibles con el analizador de whatis de man_db.
+.TP
+.B <filename>: is a dangling symlink
+(<fichero>: es un enlace perdido)
+<fichero> no existe, pero un enlace simbólico hace referencia a él.
+Usualmente se emiten más diagnósticos para identificar el nombre de
+fichero del enlace problemático.
+.TP
+.B <filename>: bad symlink or ROFF `.so' request
+(<fichero>: enlace simbólico o petición ROFF `.so' incorrectos)
+<fichero> es o bien un enlace simbólico a, o contiene una petición
+ROFF para incluir, un fichero no existente.
+.TP
+.B <filename>: ignoring bogus filename
+(<fichero>: ignorando nombre falso)
+El <fichero> puede o no ser una página de manual válida, pero su nombre
+no es válido. Esto se debe usualmente a páginas de manual con la extensión
+de sección <x> que se han puesto en la sección <y>.
+.TP
+.B <filename_mask>: competing extensions
+(<máscara_de_nombre_de_fichero>: extensiones que compiten)
+La "wildcard" <máscara_de_nombre_de_fichero> no es única. Esto está
+causado usualmente por la existencia de ambas versiones, comprimida
+y no comprimida, de la misma página del manual. Se usará sólo la más
+reciente.
+.SH FICHEROS
+.TP
+.I %manpath_config_file%
+fichero de configuración de man_db.
+.TP
+.I /usr/man/index.(bt|db|dir|pag)
+Una base de datos temporal de
+.I índices
+tradicional.
+.TP
+.I /var/catman/index.(bt|db|dir|pag)
+Una base de datos temporal de
+.I índices
+alternativa o conforme al FSSTND.
+.SH "VÉASE TAMBIÉN"
+.BR %man% (1),
+.BR manpath (5),
+.BR %catman% (8).
+.SH AUTOR
+Wilf. (G.Wilford@ee.surrey.ac.uk)
+Traducción realizada por Enrique Zanardi (ezanardi@ull.es)
diff --git a/man/it_IT.88591/man1/apropos.man1 b/man/it_IT.88591/man1/apropos.man1
new file mode 100644
index 00000000..c98ae736
--- /dev/null
+++ b/man/it_IT.88591/man1/apropos.man1
@@ -0,0 +1,189 @@
+.\" Man page for apropos
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" Traduzione di Bortolozzo Giovanni <borto@pluto.linux.it>
+.\" Febbraio 1997
+.\" 1^ Revisione Marzo 1997
+.\" 2^ Revisione Agosto 1999
+.\" 3^ Revisione e aggiornamento Settembre 1999
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.\"" for hilit19
+.TH %apropos% 1 "%date_it%" "%version%" "Utility per le Pagine di Manuale"
+.SH NOME
+%apropos% \- ricerca nei nomi e nelle descrizioni delle pagine di manuale
+.SH SINTASSI
+.B %apropos%
+.RB [\| \-dhV \|]
+.RB [\| \-e \||\| \-w \||\| \-r\c
+\|]
+.RB [\| \-m
+.IR sistema \|[\|,.\|.\|.\|]\|]
+.RB [ \-M
+.IR percorso \|]
+.I parola_chiave
+\&.\|.\|.
+.SH DESCRIZIONE
+Ogni pagina di manuale ha disponibile al suo interno una breve
+descrizione.
+.B %apropos%
+ricerca nelle descrizioni le istanze di
+.IR parola_chiave .
+
+.I parola_chiave
+è solitamente una espressione regolare, come se fosse usata l'opzione
+.RB \-r \ ,
+oppure può contenere wildcard ("caratteri jolly")
+.RB ( \-w )
+o corrispondere esattamente ad una parola
+.RB ( \-e ) \ .
+Usando queste opzioni, potrebbe essere necessario racchiudere tra
+virgolette (') la
+.I parola_chiave
+o far precedere da backslash (\\) i caratteri speciali per evitare che
+la shell provi a interpretarla(i).
+
+Le regole di corrispondenza predefinite permettono la ricerca della
+corrispondenza nel nome della pagina ed in parole intere nella
+descrizione.
+.SH OPZIONI
+.TP
+.B \-d, \-\-debug
+Mostra informazioni utili al debug.
+.TP
+.B \-r, \-\-regex
+Interpreta ogni parola chiave come un'espressione regolare. Questo è
+il comportamento predefinito. Di ogni parola chiave sarà cercata la
+corrispondenza fra i nomi delle pagine e le descrizioni
+indipendentemente. Può corrispondere ad una parte qualsiasi di
+entrambe. La corrispondenza non è limitata a parole intere.
+.TP
+.B \-w, \-\-wildcard
+Interpreta ogni parola chiave come un modello (pattern) contenente
+wildcard nello stile della shell. Di ogni parola chiave sarà cercata
+la corrispondenza fra i nomi delle pagine e le descrizioni
+indipendentemente. È trovata una corrispondenza solo se la parola
+chiave espansa corrisponde ad un'intera descrizione o nome di pagina.
+.TP
+.B \-e, \-\-exact
+Di ogni parola chiave sarà cercata la corrispondenza esatta tra i nomi
+delle pagine e le descrizioni.
+.\"
+.\" Due to the rather silly limit of 6 args per request in some `native'
+.\" *roff compilers, we have do the following to get the two-line
+.\" hanging tag on one line. .PP to begin a new paragraph, then the
+.\" tag, then .RS (start relative indent), the text, finally .RE
+.\" (end relative indent).
+.\""
+.PP
+.B \-m
+.I sistema\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= sistema\c
+\|[\|,.\|.\|.\|]
+.RS
+Se il sistema ha accesso alle descrizioni delle pagine di manuale di
+altri sistemi operativi, usando questa opzione può essere fatta una
+ricerca anche in tali descrizioni. Per ricercare nelle descrizioni
+delle pagine di manuale di NewOS, usare l'opzione
+.B \-m
+.BR NewOS .
+
+Il
+.I sistema
+specificato può essere una combinazione qualsiasi di nomi di sistemi
+operativi separati da virgole. Per includere una ricerca nelle
+descrizioni
+.B whatis
+del sistema operativo nativo, si includa il nome di sistema
+.B man
+nella stringa argomento.
+Usando questa opzione verrà ignorata la variabile d'ambiente
+.RB $ SYSTEM .
+.RE
+.TP
+.BI \-M\ percorso ,\ \-\-manpath= percorso
+Specifica un'insieme di ricerca alternativo di gerarchie di percorsi
+di pagine di manuale separate da `:'. Di default,
+.B %apropos%
+usa la variabile d'ambiente
+.RB $ MANPATH
+finché questa non è vuota o non definita, nel qual caso determinerà
+un'appropriato percorso basato sulla propria variabile d'ambiente
+.RB $ PATH .
+Usando questa opzione verrà ignorato il contenuto di
+.RB $ MANPATH .
+.TP
+.B \-h, \-\-help
+Mostra un messaggio d'aiuto ed esce.
+.TP
+.B \-V, \-\-version
+Mostra informazioni sulla versione e sull'autore.
+.SH "STATI D'USCITA"
+.TP
+.B 0
+L'esecuzione del programma ha avuto successo.
+.TP
+.B 1
+Errore d'uso, di sintassi o nel file di configurazione.
+.TP
+.B 2
+Errore operativo.
+.TP
+.B 16
+Non è stato trovato niente che corrisponde al criterio specificato.
+.SH VARIABILI D'AMBIENTE
+.TP
+.B SYSTEM
+Se
+.RB $ SYSTEM
+è impostata, il suo valore avrà lo stesso effetto che fosse
+specificato come argomento dell'opzione
+.BR \-m .
+.TP
+.B MANPATH
+Se
+.RB $ MANPATH
+è impostata, il suo valore è interpretato come una lista di percorsi di
+ricerca, separati da `:', di gerarchie di pagine di manuale da usare.
+.TP
+.B POSIXLY_CORRECT
+Se
+.RB $ POSIXLY_CORRECT
+è impostata, anche ad un valore nullo, il metodo di ricerca
+predefinito di
+.B %apropos%
+sarà considerare la parola chiave come una espressione regolare
+estesa
+.RB ( \-r ) \ .
+Questo comunque è il comportamento predefinito.
+.SH FILE
+.TP
+.I /usr/share/man/index.(bt|db|dir|pag)
+Una cache della base di dati globale
+.I index
+tradizionale.
+.TP
+.I /var/cache/man/index.(bt|db|dir|pag)
+Una cache della base di dati globale
+.I index
+alternativa e conforme con FHS.
+.TP
+.I /usr/share/man/\|.\|.\|.\|/whatis
+Una tradizionale base di dati
+.BR whatis .
+.SH "VEDERE ANCHE"
+.BR %whatis% (1),
+.BR %man% (1).
+.SH AUTORI
+Wilf. (G.Wilford@ee.surrey.ac.uk).
+.br
+Fabrizio Polacco (fpolacco@debian.org).
+.br
+Traduzione di Bortolozzo Giovanni (borto@pluto.linux.it)
diff --git a/man/it_IT.88591/man1/man.man1 b/man/it_IT.88591/man1/man.man1
new file mode 100644
index 00000000..2c671ffa
--- /dev/null
+++ b/man/it_IT.88591/man1/man.man1
@@ -0,0 +1,925 @@
+'\" t
+.\" ** The above line should force tbl to be a preprocessor **
+.\" Man page for man
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" Traduzione di Bortolozzo Giovanni <borto@pluto.linux.it>
+.\" Febbraio 1997
+.\" 1^ Revisione Marzo 1997
+.\" 2^ Revisione Agosto 1999
+.\" 3^ Revisione e aggionamento Settembre 1999
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.\"" for hilit19
+.TH %man% 1 "%date_it%" "%version%" "Utility per le Pagine di Manuale"
+.SH NOME
+%man% \- un'interfaccia ai manuali di riferimento in linea
+.SH SINTASSI
+.\"" The general command line
+.B %man%
+.RB [\| \-c \||\| \-w \||\| \-tZT
+.IR dispositivo \|]
+.RB [\| \-adhu7V \|]
+.RB [\| \-m
+.IR sistema \|[\|,.\|.\|.\|]\|]
+.RB [\| \-L
+.IR locale \|]
+.RB [\| \-p
+.IR stringa \|]
+.RB [\| \-M
+.IR percorso \|]
+.RB [\| \-P
+.IR paginatore \|]
+.RB [\| \-r
+.IR prompt \|]
+.RB [\| \-S
+.IR lista \|]
+.RB [\| \-e
+.IR estensione \|]
+.RI [\|[\| sezione \|]
+.IR pagina \ .\|.\|.\|]\ .\|.\|.
+.\"" The --local command line
+.br
+.B %man%
+.B \-l
+.RB [\| \-7 \|]
+.RB [\| \-tZT
+.IR dispositivo \|]
+.RB [\| \-p
+.IR stringa \|]
+.RB [\| \-P
+.IR paginatore \|]
+.RB [\| \-r
+.IR prompt \|]
+.I file
+\&.\|.\|.
+.\"" The apropos command line
+.br
+.RI [\| apropos
+.IR opzioni \|]
+.I espr_reg
+\&.\|.\|.
+.\"" The whatis command line
+.br
+.RI [\| whatis
+.IR opzioni \|]
+.I pagina
+\&.\|.\|.
+.SH DESCRIZIONE
+.B %man%
+è il paginatore dei manuali del sistema. Di solito ognuno degli argomenti
+.I pagina
+dati a
+.B %man%
+è il nome di un programma, di un'utility o di una funzione.
+La
+.I pagina di manuale
+associata con ognuno di questi argomenti è poi trovata e mostrata. Una
+.IR sezione ,
+se fornita, indirizzerà
+.B %man%
+a guardare solo in quella
+.I sezione
+del manuale.
+L'azione predefinita è di ricercare in tutte le
+.I sezioni
+disponibili seguendo un ordine predefinito e di mostrare solo la
+prima
+.I pagina
+trovata, anche se
+.I pagina
+esiste in diverse
+.IR sezioni .
+
+La seguente tabella mostra i numeri delle
+.I sezioni
+del manuale seguiti dai tipi di pagine che contengono
+
+.TS
+tab (@);
+l l.
+1@Programmi eseguibili e comandi della shell
+2@Chiamate al sistema (funzioni fornite dal kernel)
+3@Chiamate alle librerie (funzioni all'interno delle
+@librerie di sistema)
+4@File speciali (di solito trovabili in \fI/dev\fR)
+5@Formati dei file e convenzioni p.es. \fI/etc/passwd\fR
+6@Giochi
+7@Pacchetti di macro e convenzioni p.es. \fBman\fR(7), \fBgroff\fR(7).
+8@Comandi per l'amministrazione del sistema (solitamente
+@solo per root)
+9@Routine del kernel [\|Non standard\|]
+.TE
+
+Una
+.I pagina
+di manuale consta di diverse parti.
+
+Queste possono essere etichettate
+.BR NOME " (NAME),"
+.BR SINTASSI " (SYNOPSIS),"
+.BR DESCRIZIONE " (DESCRIPTION),"
+.BR OPZIONI " (OPTIONS),"
+.BR FILE " (FILES),"
+.BR "VEDERE ANCHE" " (SEE\ ALSO),"
+.BR PROBLEMI " (BUGS),"
+e
+.BR AUTORE " (AUTHOR)."
+
+Le seguenti convenzioni si applicano alla sezione
+.B SINTASSI
+e possono essere usate come una guida per le altre sezioni.
+
+.TS
+tab (@);
+l l.
+\fBtesto in grossetto\fR@scrivere esattamente come mostrato.
+\fItesto in corsivo\fR@rimpiazzare con un argomento appropriato.
+[\|\fB\-abc\fR\|]@ognuno o tutti gli argomenti all'interno
+@di [ ] sono opzionali.
+\fB\-a\|\fR|\|\fB\-b\fR@opzioni separate da | non possono essere
+@usate assieme.
+\fIargomento\fB .\|.\|.@\fIargomento\fR è ripetibile.
+[\|\fIespressione\fR\|]\fB .\|.\|.@\fRl'intera \fIespressione\fR\ all'interno
+ @di [ ] è ripetibile.
+.TE
+
+L'illustrazione del comando o funzione è un modello che dovrebbe
+corrispondere a tutte le possibili invocazioni. In alcuni casi è
+preferibile illustrare diverse invocazioni esclusive come mostrato
+nella sezione
+.B SINTASSI
+di questa pagina di manuale.
+.SH ESEMPI
+.TP \w'%man%\ 'u
+.BI %man% \ ls
+Mostra la pagina di manuale per la
+.I voce
+(programma)
+.IR ls .
+.TP
+.BI %man%\ \-a \ intro
+Mostra, in successione, tutte le pagine di manuale
+.I intro
+disponibili contenute nel manuale. È possibile uscire tra due
+visualizzazioni successive o saltarne una qualsiasi.
+.TP
+\fB%man% \-t \fIalias \fR|\fI lpr -Pps
+Formatta la pagina di manuale indicata da
+.RI ` alias ',
+solitamente una pagina di manuale della shell, nel formato predefinito di
+.B troff
+o
+.B groff
+e la redireziona, tramite pipe, alla stampante chiamata
+.IR ps .
+L'output predefinito per
+.B groff
+è di solito in PostScript.
+.B %man% \-\-help
+dovrebbe mostrare quale preprocessore è collegato con l'opzione
+.BR \-t .
+.TP
+.BI %man%\ \-l\ \-T dvi\ ./foo.1x.gz \ >\ ./foo.1x.dvi
+Questo comando decomprime e formatta il sorgente nroff della pagina di
+manuale
+.I ./foo.1x.gz
+in un file
+.BR "device independent (dvi) " .
+La redirezione è necessaria in quanto l'opzione
+.B \-T
+fa sì che l'output sia diretto verso lo
+.B stdout
+senza nessun paginatore. L'output può essere visto con un programma tipo
+.B xdvi
+o ulteriormente convertito in PostScript usando un programma tipo
+.BR dvips.
+.TP
+.BI %man%\ \-k \ printf
+Cerca la parola chiave
+.I printf
+nelle descrizioni brevi e nei nomi delle pagine considerandola una
+espressione regolare.
+Mostra qualsiasi corrispondenza.
+Equivalente a
+.BI %apropos%\ \-r \ printf .
+.TP
+.BI %man%\ \-f \ smail
+Cerca le pagine di manuale indicate da
+.I smail
+e mostra una breve descrizione di tutte quelle trovate.
+Equivalente a
+.BI %whatis%\ \-r \ smail .
+.SH PANORAMICA
+Molte sono le opzioni disponibili a
+.B %man%
+in modo da fornire all'utente la maggior flessibilità
+possibile. Possono essere fatti cambiamenti al percorso di ricerca,
+all'ordine delle sezioni, al preprocessore per l'output, e ad altri
+comportamenti e operazioni elencati in dettaglio più avanti.
+
+Se impostate, le varie variabili d'ambiente sono interrogate per
+determinare le operazioni di
+.BR %man% .
+È possibile impostare la variabile "omni comprensiva"
+.RB $ MANOPT
+ad una stringa qualsiasi nel formato della riga di comando, con
+l'eccezione che ogni spazio che sia parte integrante dell'argomento
+di un'opzione deve essere preceduto da un backslash (`\\').
+.B %man%
+analizzerà
+.RB $ MANOPT
+prima di analizzare la propria riga di comando. Quelle opzioni che
+richiedono un argomento, saranno ridefinite se le stesse opzioni si
+trovano anche nella riga di comando. Per inizializzare tutte le
+opzioni impostate in
+.RB $ MANOPT ,
+può essere specificato
+.B \-D
+come opzione iniziale della riga di comando.
+Ciò permette a %man% di "dimenticare" le opzioni specificate in
+.RB $ MANOPT
+sebbene debbano restare ancora valide.
+
+Le utility per le pagine di manuale raggruppate nel pacchetto
+.B man_db
+fanno un uso intenso delle cache delle basi di dati
+.BR index .
+Tali cache contengono informazioni come la posizione di ogni pagina di
+manuale nel filesystem e cosa contiene il relativo
+.I whatis
+(breve descrizione della pagina di manuale). Uno dei compiti di
+.B %man%
+è assicurare che tali cache rimangano consistenti. Queste cache delle
+basi di dati evitano il bisogno di dover lanciare manualmente del
+software per aggiornare le tradizionali basi di dati
+.I whatis
+in formato testo, ed inoltre permettono a
+.B %man%
+di girare più veloce di quello che farebbe se dovesse ogni volta
+cercare la pagina di manuale appropriata.
+
+Se
+.B %man%
+non può trovare una base di dati
+.B index
+inizializzata da
+.B %mandb%
+per una particolare gerarchia di pagine di manuale, cercherà comunque
+la pagina di manuale richiesta sebbene sarà necessario un globbing dei
+file per effettuare la ricerca all'interno di quella gerarchia (N.d.T:
+con globbing [jargon] si intende l'espansione dei caratteri speciali
+all'interno di un nome costruito con wildcard \- caratteri jolly).
+Invece se
+.B %whatis%
+o
+.B %apropos%
+non trovano la base di dati
+.BR index ,
+proveranno comunque a estrarre le informazioni dalla base di dati
+.I whatis
+tradizionale.
+.\"`User' manual page hierarchies will have
+.\".B index
+.\"caches created `on the fly'.
+.\""
+
+Queste utility supportano i file sorgente nroff compressi, che abbiano,
+di default, una fra le seguenti estensioni
+.BR .Z ", " .z " e " .gz .
+È possibile trattare con qualsiasi estensione di file compresso, ma
+questa informazione deve essere nota al momento della compilazione.
+Inoltre, di default, qualsiasi pagina cat prodotta è compressa usando
+.BR gzip .
+Ognuna delle gerarchie `globali' delle pagine di manuale, come
+.I /usr/share/man
+o
+.IR /usr/X11R6/man ,
+può avere una directory qualsiasi come gerarchia delle pagine cat.
+Tradizionalmente le pagine cat sono salvate sotto la stessa gerarchia
+delle pagine di manuale, ma per ragioni come quelle specificate nel
+.BR "Linux File System Standard (FSSTND)" ,
+è meglio salvarle da qualche altra parte. Per i dettagli su come ciò
+sia possibile, si legga
+.BR manpath (5).
+Per i dettagli sul perché fare ciò, si legga lo standard.
+
+Con questo pacchetto è disponibile il ``supporto internazionale'': le
+pagine di manuale nella lingua nativa sono accessibili (se disponibili
+nel proprio sistema) usando le funzioni
+.IR locale .
+Per attivare tale supporto, è necessario impostare
+.RB $ LC_MESSAGES " e "
+.RB $ LANG
+o qualche altra variabile d'ambiente dipendente dal sistema, al proprio
+linguaggio locale, solitamente specificato nel formato basato sul
+.BR "POSIX 1003.1" :
+
+.\"
+.\" Need a \c to make sure we don't get a space where we don't want one
+.\""
+.RI < linguaggio >[\|\c
+.B _\c
+.RI < zona >\|[\|\c
+.B .\c
+.RI < set-di-caratteri >\|[\|\c
+.B ,\c
+.RI < versione >\|]\|]\|]
+
+Se la pagina desiderata è disponibile nel proprio
+.IR locale ,
+sarà mostrata al posto della pagina standard (di solito in Inglese
+Americano).
+
+Il supporto internazionale per i cataloghi di messaggi è un'altra
+caratteristica di questo pacchetto e può essere attivato, sempre se
+disponibile, nello stesso modo. Se si trova che le pagine di manuale e
+i cataloghi dei messaggi forniti con questo pacchetto non sono
+disponibili per la propria lingua e si vuole fornirli, si contatti
+il manutentore il quale coordinerà tali attività.
+
+Per informazioni riguardanti altre caratteristiche ed estensioni
+disponibili con questo paginatore dei manuali, si leggano i documenti
+forniti con il pacchetto.
+.SH COMPORTAMENTO PREDEFINITO
+.B %man%
+cercherà la pagina di manuale desiderata all'interno delle cache delle
+basi di dati
+.IR index .
+Se tale ricerca non ha successo, è eseguita una verifica della
+consistenza della cache per assicurarsi che le basi di dati riflettano
+accuratamente il filesystem. Non è generalmente necessario eseguire
+.B %mandb%
+dopo che le cache sono state create inizialmente, finché una di questa
+non sia in qualche modo corrotta.
+
+Una volta che una pagina di manuale è stata localizzata, è eseguita
+una verifica per scoprire se il relativo file `cat' preformattato
+esiste già e se è più recente del file nroff. Se è così, questo file
+preformattato è (di solito) decompresso e poi visualizzato tramite un
+paginatore. Il paginatore può essere specificato in diversi modi
+oppure viene usato quello predefinito (si veda l'opzione
+.B \-P
+per i dettagli). Se non c'è la pagina cat o è più vecchia del file
+nroff, quest'ultimo è filtrato attraverso vari programmi ed è mostrato
+immediatamente.
+
+Se può essere prodotto un file cat (esiste la relativa directory cat e
+ha i permessi appropriati),
+.B %man%
+comprimerà e salverà il file cat in background.
+
+Quanti e quali filtri usare viene determinato in svariati modi. Per prima cosa è
+interrogata l'opzione della riga di comando
+.B \-p
+o la variabile d'ambiente
+.RB $ MANROFFSEQ .
+Se
+.B \-p
+non è usata e la variabile d'ambiente non è settata, viene analizzata
+la riga iniziale del file troff per cercare una "stringa
+preprocessore". Per contenere una stringa preprocessore valida, la
+prima riga deve assomigliare a
+
+.B '\e"
+.\""
+.RB < stringa >
+
+dove
+.B stringa
+può essere una combinazione qualsiasi delle lettere descritte più
+avanti dall'opzione
+.BR \-p .
+
+Se nessuno dei metodi suddetti fornisce informazioni sui filtri, ne è
+usato un insieme predefinito.
+
+Una pipeline di formattazione è creata dai filtri al formattatore
+primario
+.RB ( nroff
+o
+.RB [ tg ] roff
+con
+.BR \-t )
+ed eseguita.
+Alternativamente, se esiste un programma eseguibile
+.I mandb_nfmt
+(o
+.I mandb_tfmt
+con
+.BR \-t )
+nella radice dell'albero dei manuali, questi è eseguito. A questi è
+passato il file sorgente del manuale, la stringa preprocessore, ed
+eventualmente il dispositivo specificato come argomento di
+.BR \-T .
+.\"" ********************************************************************
+.SH OPZIONI
+Nessun argomento delle opzioni che non sia duplicato nelle riga di
+comando, in
+.RB $ MANOPT ,
+o in entrambe è dannoso. Per le opzioni che richiedono un argomento,
+ogni duplicazione annullerà il valore del precendente argomento.
+.TP
+.B \-l, \-\-local-file
+Attiva il modo `locale'. Formatta e visualizza file di manuale locali
+invece di effettuare una ricerca nella collezione di manuali del
+sistema. Ogni argomento pagina sarà interpretato come un file sorgente
+nroff nel formato corretto.
+.\" File sorgente nroff con estensione di
+.\" compressione supportata, saranno decompressi da %man% prima di essere
+.\" visualizzati tramite i soliti filtri.
+.\""
+Non è creato il file cat. Se '\-' è elencato fra gli argomenti,
+l'input sarà preso dallo stdin.
+Quando non è usata questa opzione, e man non trova la pagina
+richiesta, prima di mostrare un messaggio d'errore, prova a
+comportarsi come se fosse fornita questa opzione, usando il nome come
+nome di un file e cercando una corrispondenza esatta.
+.TP
+.BI \-L\ locale ,\ \-\-locale= locale
+.B %man%
+di solito determinerà il proprio locale attuale chiamando la funzione C
+.BR setlocale (3)
+che interroga diverse variabili d'ambiente, tra le quali
+.RB $ LC_MESSAGES
+e
+.RB $ LANG .
+Per ridefinire temporaneamente il valore così determinato, si usi
+questa opzione per fornire direttamente una stringa
+.I locale
+a
+.BR %man% .
+Si noti che ciò non avrà effetto finché non è iniziata realmente una
+ricerca. L'output, come ad esempio il messaggio d'aiuto, sarà sempre
+visualizzato nel locale determinato inizialmente.
+.TP
+.B \-D, \-\-default
+Questa opzione è solitamente data come prima opzione e reinizializza
+il comportamento di
+.B %man%
+a quello predefinito. È usata per reinizializzare quelle opzioni che possono
+essere state impostate in
+.RB $ MANOPT .
+Qualsiasi opzione successiva
+.B \-D
+avrà il solito effetto.
+.TP
+.BI \-M\ percorso ,\ \-\-manpath= percorso
+Specifica un percorso man alternativo. Di default,
+.B %man%
+usa
+il codice derivato da
+.B %manpath%
+per determinare il percorso di ricerca. Questa opzione ha priorità
+sulla variabile d'ambiente
+.RB $ MANPATH
+e fa sì che questa e l'opzione
+.B \-m
+siano ignorate.
+.TP
+.BI \-P\ paginatore ,\ \-\-pager= paginatore
+Specifica quale paginatore dell'output usare. Di default,
+.B %man%
+usa
+.BR %pager% .
+Questa opzione ha priorità sulla variabile d'ambiente
+.RB $ PAGER
+e non va usata assieme con
+.B \-f
+o
+.BR \-k .
+.TP
+.BI \-r\ prompt ,\ \-\-prompt= prompt
+Se una versione recente di
+.B less
+è usata come paginatore,
+.B %man%
+proverà ad impostare il suo prompt e alcune sue opzioni.
+Il prompt predefinito assomiglierà a
+
+.B \ Pagina di Manuale\c
+.IB \ nome ( sez )\c
+.BI \ riga \ x
+
+dove
+.I nome
+denota il nome della pagina di manuale,
+.I sez
+denota la sezione in cui è stata trovata e
+.IR x
+il numero di riga corrente.
+Ciò è ottenuto usando la variabile d'ambiente
+.RB $ LESS .
+
+Fornendo l'opzione
+.B \-r
+seguita da una stringa si può modificare il prompt predefinito.
+La stringa può contenere il testo
+.B $MAN_PN
+il quale sarà espanso nel nome della pagina di manuale corrente e il
+nome della sua sezione racchiuso tra `(' e `)'. La stringa usata per
+produrre il default potrebbe essere espressa come
+
+.B \e\ Pagina\e\ di\e\ Manuale\e\ \e$MAN_PN\e\ ?ltriga\e\ %lt?L/%L.:
+.br
+.B byte\e\ %bB?s/%s..?\e\ (FINE):?pB\ %pB\e\e%..
+
+È stata spezzata in due righe solo per migliorarne la leggibilità. Per
+il suo significato si veda la pagina di manuale
+.BR less (1).
+La stringa di prompt per prima cosa è valutata dalla shell. Perciò le
+doppie virgolette `"', le virgolette rovesce ``' e i backslash `\\'
+devono essere precedute da `\\'. La stringa di prompt potrebbe
+terminare con un `\\$' il quale può essere seguito da ulteriori
+opzioni per less. Di default
+.B %man%
+setta le opzioni
+.BR \-ix8 .
+.TP
+.\""
+.B \-7, \-\-ascii
+Quando visualizza una pagina di manuale in
+.IR ascii (7)
+puro su di un terminale a 7 bit o su un emulatore di terminale, alcuni
+caratteri potrebbero non essere visualizzati correttamente se si usa
+il descrittore di dispositivo
+.IR latin1 (7)
+con il
+.B GNU
+.BR nroff .
+Questa opzione permette alle pagine di manuale in
+.I ascii
+puro di essere visualizzate in
+.I ascii
+con il dispositivo
+.IR latin1 .
+Non tradurrà alcun testo
+.IR latin1 .
+La seguente tabella mostra le traduzioni effettuate.
+
+.TS
+tab (@);
+l c c c.
+Descrizione@Ottale@latin1@ascii
+_
+trattino di continuazione@255@\[char173]@-
+bullet (middle dot)@267@\(bu@o
+accento acuto@264@\(aa@'
+segno di moltiplicazione@327@\(mu@x
+.TE
+
+Se la colonna
+.I latin1
+è visualizzata correttamente, il proprio terminale può essere
+configurato per i caratteri
+.I latin1
+e questa opzione non è necessaria.
+Se le colonne
+.I latin1
+e
+.I ascii
+sono identiche, si sta leggendo questa pagina usando questa opzione
+oppure
+.B %man%
+non l'ha formattata usando il descrittore di dispositivo
+.IR latin1 .
+Se manca la colonna
+.I latin1
+o è corrotta, può essere necessario visualizzare le pagine di manuale
+usando questa opzione.
+
+Questa opzione è ignorata quando si usano le opzioni
+.BR \-t ,
+.B \-T
+o
+.B \-Z
+e può essere inutile per
+.B nroff
+diversi dalla versione
+.BR GNU .
+.TP
+.BI \-S\ lista ,\ \-\-sections= lista
+Lista è un elenco ordinato di sezioni di manuale separate da `:' su
+cui effettuare la ricerca. Usando questa opzione viene ignorata la
+variabile d'ambiente
+.RB $ MANSECT .
+.TP
+.B \-a, \-\-all
+Di default,
+.B %man%
+uscirà dopo aver visualizzato la pagina di manuale più adatta che
+trova. Usando questa opzione si forza
+.B %man%
+a visualizzare tutte le pagine di manuale con i nomi che corrispondono
+al criterio di ricerca.
+.TP
+.B \-c, \-\-catman
+Questa opzione non è di uso generale e dovrebbe essere usata solo dal
+programma
+.BR %catman% .
+.TP
+.B \-d, \-\-debug
+Non mostra alcuna pagina di manuale, ma mostra un sacco di
+informazioni per il debug.
+.TP
+.BI \-e\ sotto-estensione ,\ \-\-extension= sotto-estensione
+Alcuni sistemi incorporano nella gerarchia principale delle pagine di
+manuale grossi pacchetti di pagine di manuale, come quelle che
+accompagnano il pacchetto
+.BR Tcl .
+Per ovviare ai problemi dovuti alla presenza di pagine di manuale con
+lo stesso nome come
+.BR exit (3),
+le pagine di
+.B Tcl
+sono di solito assegnate alla sezione
+.BR l .
+Poiché questa non è una scelta fortunata, è ora possibile mettere le
+pagine nella sezione corretta, ed in questo caso assegnare
+l'estensione specifica
+.BR exit (3tcl).
+Durante il funzionamento normale,
+.B %man%
+visualizzerà
+.BR exit (3)
+piuttosto che
+.BR exit (3tcl).
+Per trattare questa situazione ed evitare la necessità di sapere in
+quale sezione di trova la pagina di manuale richiesta, è ora possibile
+dare a
+.B %man%
+una stringa di
+.l sotto-estensione
+che indica a quale pacchetto deve appartenere la pagina. Usando il
+precedente esempio, passando l'opzione
+.B \-e\ tcl
+a
+.B %man%
+verrà ristretta la ricerca alle pagine che hanno estensione
+.BR *tcl .
+.TP
+.B \-f, \-\-whatis
+Equivalente a
+.BR %whatis% .
+Mostra, se disponibile, una breve descrizione tratta della pagine di
+manuale. Si veda
+.BR %whatis% (1)
+per i dettagli.
+.TP
+.B \-h, \-\-help
+Mostra un messaggio d'aiuto ed esce.
+.TP
+.B \-k, \-\-apropos
+Equivalente a
+.BR %apropos% .
+Cerca nelle descrizioni brevi delle pagine di manuale le occorrenze
+delle parole chiave e visualizza qualsiasi corrispondenza. Si veda
+.BR %apropos% (1)
+per i dettagli.
+.\"
+.\" Due to the rather silly limit of 6 args per request in some `native'
+.\" *roff compilers, we have do the following to get the two-line
+.\" hanging tag on one line. .PP to begin a new paragraph, then the
+.\" tag, then .RS (start relative indent), the text, finally .RE
+.\" (end relative indent).
+.\""
+.PP
+.B \-m
+.I sistema\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= sistema\c
+\|[\|,.\|.\|.\|]
+.RS
+Se questo sistema ha accesso alle pagine di manuale di altri sistemi
+operativi, si può accedere a quest'ultime usando questa opzione. Per
+cercare una pagina di manuale nella collezione delle pagine di manuale
+di NewOS, si usi l'opzione
+.B \-m
+.BR NewOS .
+
+Il
+.I sistema
+specificato può essere una combinazione di nomi di sistemi operativi
+separati da virgole. Per includere una ricerca fra le pagine di
+manuale del sistema operativo nativo, si includa il nome di sistema
+.B man
+nella stringa argomento. Usando questa opzione verrà ignorata la
+variabile d'ambiente
+.RB $ SYSTEM .
+.RE
+.TP
+.BI \-p\ stringa ,\ \-\-preprocessor= stringa
+Specifica la sequenza di preprocessori da lanciare prima di
+.B nroff
+o
+.BR troff / groff .
+Non tutte le installazioni avranno l'insieme completo di
+preprocessori. Alcuni dei preprocessori e le lettere che li designano
+sono:
+.BR eqn " (" e ),
+.BR grap " (" g ),
+.BR pic " (" p ),
+.BR tbl " (" t ),
+.BR vgrind " (" v ),
+.BR refer " (" r ).
+Usando questa opzione viene ignorata la variabile d'ambiente
+.RB $ MANROFFSEQ .
+.B %zsoelim%
+è sempre lanciato come primo preprocessore.
+.TP
+.B \-u, \-\-update
+Le cache delle basi di dati
+.B index
+sono aggiornate `al volo', cioè non è necessario che
+.B %mandb%
+sia lanciato periodicamente per mantenerle consistenti. Se la pagina
+di manuale richiesta non è trovata all'interno della cache o è usata
+l'opzione
+.BR \-a ,
+.B %man%
+farà una verifica della consistenza a livello directory per
+assicurarsi che le proprie cache siano una rappresentazione accurata
+del filesystem. Per forzare una verifica della consistenza a livello
+inode prima di trovare alcuna pagina di manuale, si usi l'opzione
+.BR \-u .
+.TP
+.B \-t, \-\-troff
+Usa
+.I %troff%
+per formattare le pagine di manuale nello stdout. Questa opzione non è
+richiesta assieme a
+.B \-T
+o
+.BR \-Z .
+.PP
+.BI \-T\ dispositivo ,\ \-\-troff-device
+.RI [\| =dispositivo \|]
+.RS
+Questa opzione è usata per cambiare l'output di
+.B groff
+(o se possibile quello di
+.BR troff )
+per adattarlo ad un dispositivo diverso da quello predefinito. Implica
+.BR \-t .
+Esempi (forniti con Groff-1.09) comprendono
+.BR dvi ", " latin1 ,
+.BR X75 " e " X100 .
+.RE
+.TP
+.B \-Z, \-\-ditroff
+.B groff
+lancerà
+.B troff
+e poi userà un appropriato post-processore per produrre un output
+adatto per il dispositivo scelto. Se
+.I %troff%
+.BR groff ,
+questa opzione è passata a
+.B groff
+e verrà soppresso l'uso del post-processore. Implica
+.BR \-t .
+.TP
+.B \-w, \-\-where, \-\-location
+Non mostra veramente le pagine di manuale, ma stampa le posizioni dei
+file che sarebbero stati formattati o visualizzati. Se il file è
+un file cat, mostra anche la posizione del suo file sorgente nroff.
+.TP
+.B \-V, \-\-version
+Mostra informazioni sulla versione e l'autore.
+.SH STATI D'USCITA
+.TP
+.B 0
+L'esecuzione del programma ha avuto successo.
+.TP
+.B 1
+Errore d'uso, di sintassi o nel file di configurazione.
+.TP
+.B 2
+Errore operativo.
+.TP
+.B 3
+Un processo figlio ha restituito uno stato d'uscita diverso da zero.
+.TP
+.B 16
+Almeno una delle pagine/file/parole chiave non esisteva e non aveva
+corrispondenza.
+.SH VARIABLI D'AMBIENTE
+.\".TP \w'MANROFFSEQ\ \ 'u
+.\""
+.TP
+.B MANPATH
+Se
+.RB $ MANPATH
+è impostata, il suo valore è usato come percorso per la ricerca delle
+pagine di manuale.
+.TP
+.B MANROFFSEQ
+Se
+.RB $ MANROFFSEQ
+è impostata, il suo valore è usato per determinare l'insieme dei
+preprocessori attraverso i quali va passata la pagina di manuale. La
+lista dei preprocessori predefiniti dipende dal sistema.
+.TP
+.B MANSECT
+Se
+.RB $ MANSECT
+è impostata, il suo valore è una lista separata da `:' di sezioni ed è
+usata per determinare in quali sezioni di manuale cercare e in quale
+ordine.
+.TP
+.B PAGER
+Se
+.RB $ PAGER
+è impostata, il suo valore è usato come il nome del programma da usare
+per visualizzare la pagina di manuale. Di default, è usato
+.BR %pager% .
+.TP
+.B SYSTEM
+Se
+.RB $ SYSTEM
+è impostata, avrà lo stesso effetto dell'opzione
+.B \-m stringa
+dove stringa sarà preso come il contenuto di
+.RB $ SYSTEM .
+.TP
+.B MANOPT
+Se
+.RB $ MANOPT
+è impostata, sarà analizzata prima della riga di comando di
+.B %man%
+ed è supposta essere in formato simile. Poiché tutte le altre
+variabili d'ambiente specifiche di
+.B %man%
+possono essere specificate come opzioni della riga di comando, e sono
+quindi candidate per essere incluse in
+.RB $ MANOPT
+ci si può aspettare che diventeranno obsolete.
+N.B.: Tutti gli spazi che dovrebbero essere interpretati come parte
+dell'argomento di un opzione devono essere preceduti da `\\'.
+.TP
+.BR LANG , " LC_MESSAGES"
+A seconda del sistema e dell'implementazione, una o entrambe le variabili
+.RB $ LANG
+e
+.RB $ LC_MESSAGES
+saranno interrogate per determinare il locale corrente.
+.B %man%
+visualizzerà i suoi messaggi usando quel locale (se disponibile). Si veda
+.BR setlocale (3)
+per i dettagli.
+.SH FILE
+.TP
+.I %manpath_config_file%
+File di configurazione di man_db.
+.TP
+.I /usr/share/man
+Una gerarchia di pagine di manuale globale.
+.TP
+.I /usr/share/man/index.(bt|db|dir|pag)
+Una cache della base di dati globale
+.I index
+tradizionale.
+.TP
+.I /var/cache/man/index.(bt|db|dir|pag)
+Una cache della base di dati globale
+.I index
+alternativa e conforme con FHS.
+.SH "VEDERE ANCHE"
+.BR %mandb% (8),
+.BR %manpath% (1),
+.BR manpath (5),
+.BR %apropos% (1),
+.BR %whatis% (1),
+.BR %catman% (8),
+.BR less (1),
+.BR nroff (1),
+.BR troff (1),
+.BR groff (1),
+.BR %zsoelim% (1),
+.BR setlocale (3),
+.BR ascii (7),
+.BR latin1 (7),
+.BR FSSTND .
+.SH STORIA
+1990, 1991 \- Originalmente scritta da John W. Eaton (jwe@che.utexas.edu).
+
+23 Dicembre 1992: Rik Faith (faith@cs.unc.edu) applica le soluzioni ai
+problemi fornite da Willem Kasdorp (wkasdo@nikhefk.nikef.nl).
+
+30 Aprile 1994 - %date_it%: Wilf.
+(G.Wilford@ee.surrey.ac.uk) ha iniziato lo sviluppo e il mantenimento
+di questo pacchetto con l'aiuto di un po' di gente.
+
+
+30th Ottobre, 1996 - %curdate%: Fabrizio Polacco <fpolacco@debian.org>
+mantiene e migliora questo pacchetto per il progetto Debian, con
+l'aiuto di tutta la comunità.
+
+Traduzione di Bortolozzo Giovanni (borto@pluto.linux.it)
diff --git a/man/it_IT.88591/man1/manpath.man1 b/man/it_IT.88591/man1/manpath.man1
new file mode 100644
index 00000000..d087c80e
--- /dev/null
+++ b/man/it_IT.88591/man1/manpath.man1
@@ -0,0 +1,135 @@
+.\" Man page for manpath
+.\"
+.\" Copyright (C), 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" Traduzione di Bortolozzo Giovanni <borto@pluto.linux.it>
+.\" Febbraio 1997
+.\" 1° Revisione Marzo 1997
+.\" 2° Revisione Agosto 1999
+.\" 3^ Revisione e aggionamento Settembre 1999
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the COPYING file that comes with the
+.\" man_db distribution.
+.\"
+.\" Sun Jan 22 22:15:17 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.\"" for hilit19
+.TH %manpath% 1 "%date_it%" "%version%" "Utility per le Pagine di Manuale"
+.SH NOME
+%manpath% \- determina il percorso di ricerca delle pagine di manuale
+.SH SINTASSI
+.B %manpath%
+.RB [\| \-qgdc \|]
+.RB [\| \-m
+.IR sistema \|[\|,.\|.\|.\|]\|]
+.SH DESCRIZIONE
+Se
+.RB $ %MANPATH%
+è impostata,
+.B %manpath%
+ne mostrerà semplicemente il contenuto e genererà un avviso.
+Se non lo è,
+.B %manpath%
+determinerà un percorso di ricerca di gerarchie di pagine di manuale
+adatto e mostrerà il risultato.
+
+I percorsi separati da `:' sono determinati usando le informazioni
+ottenute dal file di configurazione di man_db
+.RI ( "%manpath_config_file%" )
+e dall'ambiente degli utenti.
+.SH OPZIONI
+.TP
+.B \-q, \-\-quiet
+Non genera nessun avviso.
+.TP
+.B \-d, \-\-debug
+Produce informazioni utili al debug.
+.TP
+.B \-c, \-\-catpath
+Produce un percorso cat invece di uno man. Una volta che è determinato
+il percorso man, ogni elemento di percorso è convertito nel suo
+percorso cat relativo.
+.TP
+.B \-g, \-\-global
+Produce un percorso man constituito da tutti i percorsi denominati
+globali all'interno del file di configurazione di man_db.
+.\"
+.\" Due to the rather silly limit of 6 args per request in some `native'
+.\" *roff compilers, we have do the following to get the two-line
+.\" hanging tag on one line. .PP to begin a new paragraph, then the
+.\" tag, then .RS (start relative indent), the text, finally .RE
+.\" (end relative indent).
+.\""
+.PP
+.B \-m
+.I sistema\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= sistema\c
+\|[\|,.\|.\|.\|]
+.RS
+Se questo sistema ha accesso alle gerarchie di pagine di manuale di
+altri sistemi operativi, questa opzione può essere usata per includerle
+nell'output di
+.BR %manpath% .
+Per includere le gerarchie di pagine di manuale di NewOS, usare
+l'opzione
+.B \-m
+.BR NewOS .
+
+Il
+.I sistema
+specificato può essere una combinazione qualsiasi di nomi di sistemi
+operativi separati da virgole. Per includere le gerachie di pagine di
+manuale del sistema operativo nativo, si deve includere il nome di
+sistema
+.B man
+nella stringa argomento.
+Usando questa opzione verrà ignorata la variabile d'ambiente
+.RB $ SYSTEM .
+.RE
+.TP
+.B \-h, \-\-help
+Mostra un messaggio d'aiuto ed esce.
+.TP
+.B \-V, \-\-version
+Mostra informazioni sulla versione e sull'autore.
+.SH VARIABILI D'AMBIENTE
+.TP
+.B %MANPATH%
+Se
+.RB $ %MANPATH%
+è impostata,
+.B %manpath%
+ne mostra il valore invece che determinarlo al momento. Se
+.RB $ MANPATH
+inizia con un `due punti' (`:'), allora il valore della variabile è
+accodato all'elenco determinato dal contenuto dei file di
+configurazione. Se i `due punti' sono alla fine del valore della
+variabile, allora è l'elenco determinato dai file di configurazione ad
+essere accodato al valore della variabile. Se il valore della
+variabile contiene un doppio `due punti'
+.RB ( :: ),
+allora l'elenco determinato dai file di configurazione è inserito nel
+mezzo del valore, tra i due `due punti'.
+.TP
+.B SYSTEM
+Se
+.RB $ SYSTEM
+è impostata, avrà lo stesso effetto che fosse specificata come argomento
+dell'opzione
+.BR \-m .
+.SH FILE
+.TP \w'%manpath_config_file%'u+2n
+.I %manpath_config_file%
+File di configurazione di sistema.
+.SH "VEDERE ANCHE"
+.BR %apropos% (1),
+.BR %whatis% (1),
+.BR %man% (1).
+.SH AUTORE
+Wilf. (G.Wilford@ee.surrey.ac.uk)
+.br
+Fabrizio Polacco (fpolacco@debian.org).
+.br
+Traduzione di Bortolozzo Giovanni (borto@pluto.linux.it)
diff --git a/man/it_IT.88591/man1/whatis.man1 b/man/it_IT.88591/man1/whatis.man1
new file mode 100644
index 00000000..c6076351
--- /dev/null
+++ b/man/it_IT.88591/man1/whatis.man1
@@ -0,0 +1,197 @@
+.\" Man page for whatis
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" Traduzione di Bortolozzo Giovanni <borto@pluto.linux.it>
+.\" Febbraio 1997
+.\" 1° Revisione Marzo 1997
+.\" 2° Revisione Agosto 1999
+.\" 3^ Revisione e aggionamento Settembre 1999
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.\"" for hilit19
+.TH %whatis% 1 "%date_it%" "%version%" "Utility per le Pagine di Manuale"
+.SH NOME
+%whatis% \- mostra le descrizioni delle pagine di manuale
+.SH SINTASSI
+.B %whatis%
+.RB [\| \-dhV \|]
+.RB [\| \-r \||\| \-w\c
+\|]
+.RB [\| \-m
+.IR sistema \|[\|,.\|.\|.\|]\|]
+.RB [\| \-M
+.IR percorso \|]
+.I nome
+\&.\|.\|.
+.SH DESCRIZIONE
+Ogni pagina di manuale ha disponibile al suo interno una breve
+descrizione.
+.B %whatis%
+ricerca i nomi e le descrizioni delle pagine di manuale che
+corrispondono a
+.IR nome .
+
+.I nome
+può contenere wildcard (caratteri jolly)
+.RB ( \-w )
+o essere un'espressione regolare
+.RB ( \-r ).
+Usando queste opzioni, potrebbe essere necessario racchiudere tra
+virgolette (') la
+.I parola_chiave
+o far precedere da backslash (\\) i caratteri speciali per evitare che
+la shell provi a interpretarla(i).
+
+Durante la ricerca sono usate le basi di dati
+.BR index .
+Per generare dalla base di dati
+.B index
+la corrispondente base di dati vecchio stile
+.B %whatis%
+in formato testo, si può usare il comando:
+
+.B %whatis% \-M
+.I percorso_man
+.B \-w '*' | sort >
+.I percorso_man/%whatis%
+
+dove
+.I percorso_man
+è una gerarchia di pagine di manuale come ad esempio
+.IR /usr/man .
+.SH OPZIONI
+.TP
+.B \-d, \-\-debug
+Mostra informazioni utili al debug.
+.TP
+.B \-r, \-\-regex
+Interpreta ogni
+.I nome
+come un'espressione regolare.
+Verrà trovata una corrispondenza se
+.I nome
+corrisponde ad una parte qualsiasi del nome della pagina.
+Questa opzione fa sì che
+.B %whatis%
+sia un po' più lento a causa della natura della ricerca nella base di dati.
+.TP
+.B \-w, \-\-wildcard
+Interpreta ogni
+.I nome
+come un modello contenente wildcard nello stile della shell.
+Affinché ci sia una corrispondenza, un
+.I nome
+espanso deve corrispondere al nome completo di una pagina di manuale.
+Questa opzione fa sì che
+.B %whatis%
+sia un po' più lento a causa della natura della ricerca nella base di dati.
+.\"
+.\" Due to the rather silly limit of 6 args per request in some `native'
+.\" *roff compilers, we have do the following to get the two-line
+.\" hanging tag on one line. .PP to begin a new paragraph, then the
+.\" tag, then .RS (start relative indent), the text, finally .RE
+.\" (end relative indent).
+.\""
+.PP
+.B \-m
+.I sistema\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= sistema\c
+\|[\|,.\|.\|.\|]
+.RS
+Se questo sistema ha accesso ai nomi delle pagine di manuale di altri
+sistemi operativi, può essere fatto un accesso a quest'ultimi usando
+questa opzione. Per effettuare una ricerca nei nomi delle pagine di
+manuale di NewOS, usare l'opzione
+.B \-m
+.BR NewOS .
+
+Il
+.I sistema
+può essere una combinazione qualsiasi di nomi di sistemi
+operativi separati da virgole. Per includere la ricerca nei nomi delle
+pagine di manuale del sistema operativo nativo, si includa il nome di
+sistema
+.B man
+nella stringa argomento.
+Usando questa opzione verrà ignorata la variabile d'ambiente
+.RB $ SYSTEM .
+.RE
+.TP
+.BI \-M\ percorso ,\ \-\-manpath= percorso
+Specifica un insieme alternativo di gerarchie di pagine di manuale,
+separate da `:', nelle quali fare la ricerca.
+Di default,
+.B %whatis%
+usa la variabile d'ambiente
+.RB $ MANPATH
+finché questa non è vuota o non impostata, nel qual caso determinerà un
+percorso man appropriato basandosi sulla variabile d'ambiente
+.RB $ PATH
+dell'utente. Usando questa opzione verrà ignorato il contenuto della
+variabile d'ambiente
+.RB $ MANPATH .
+.TP
+.B \-h, \-\-help
+Mostra un messaggio d'aiuto ed esce.
+.TP
+.B \-V, \-\-version
+Mostra informazioni sulla versione e sull'autore.
+.SH "STATI D?USCITA"
+.TP
+.B 0
+L'esecuzione del programma ha avuto successo.
+.TP
+.B 1
+Errore d'uso, di sintassi o nel file di configurazione.
+.TP
+.B 2
+Errore operativo.
+.TP
+.B 16
+Non è stata trovata alcuna pagina di manuale che corrisponde al
+criterio specificato.
+.SH VARIABILI D'AMBIENTE
+.TP
+.B SYSTEM
+Se
+.RB $ SYSTEM
+è impostata, avrà lo stesso effetto che fosse specificata come argomento
+dell'opzione
+.BR \-m .
+.TP
+.B MANPATH
+Se
+.RB $ MANPATH
+è impostata, il suo valore è interpretato come una lista di percorsi,
+separati da `:', di gerarchie di pagine di manuale da usare nella ricerca.
+.SH FILE
+.TP
+.I /usr/share/man/index.(bt|db|dir|pag)
+Una cache della base di dati globale
+.I index
+tradizionale.
+.TP
+.I /var/cache/man/index.(bt|db|dir|pag)
+Una cache della base di dati globale
+.I index
+alternativa e conforme con FHS.
+.TP
+.I /usr/share/man/\|.\|.\|.\|/whatis
+Una tradizionale base di dati
+.BR whatis .
+.SH "VEDERE ANCHE"
+.BR %apropos% (1),
+.BR %man% (1).
+.SH AUTORE
+Wilf. (G.Wilford@ee.surrey.ac.uk).
+.br
+Fabrizio Polacco (fpolacco@debian.org).
+.br
+Traduzione di Giovanni Bortolozzo (borto@pluto.linux.it)
diff --git a/man/it_IT.88591/man1/zsoelim.man1 b/man/it_IT.88591/man1/zsoelim.man1
new file mode 100644
index 00000000..3db4f652
--- /dev/null
+++ b/man/it_IT.88591/man1/zsoelim.man1
@@ -0,0 +1,86 @@
+.\" Man page for zsoelim
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" Traduzione di Bortolozzo Giovanni <borto@pluto.linux.it>
+.\" Febbraio 1997
+.\" 1° Revisione Marzo 1997
+.\" 2° Revisione Agosto 1999
+.\" 3^ Revisione e aggionamento Settembre 1999
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Dec 10 19:33:32 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.\"" for hilit19
+.TH %zsoelim% 1 "%date_it%" "%version%" "Utility per le Pagine di Manuale"
+.SH NOME
+%zsoelim% \- soddisfa le richieste .so nell'input roff
+.SH SINTASSI
+.B %zsoelim%
+.RB [\| \-CVh \|]
+.RI [\| file
+\&.\|.\|.\|]
+.SH DESCRIZIONE
+.B %zsoelim%
+analizza il
+.I file
+argomento, o, se non ne è specificato nessuno, il suo standard input
+cercando righe del tipo:
+
+.B .so
+.RI <\| nomefile \|>
+
+Queste richieste sono rimpiazzate dal contenuto del file
+.I nomefile
+specificato. Se la richiesta non può essere soddisfatta,
+.B %zsoelim%
+cerca il file
+.I nomefile.ext
+dove
+.I .ext
+può essere una tra
+.BR .gz ,
+.BR .Z
+o
+.BR .z .
+Altri tipi di estensioni possono essere supportate a seconda delle
+opzioni in fase di compilazione. Se la richiesta può essere accolta
+con un file compresso, questo file è decompresso usando un
+decompressore appropriato e il suo output è usato per soddisfare la
+richiesta.
+
+Tradizionalmente, i programmi
+.B soelim
+erano usati per permettere al preprocessore roff di essere in grado di
+preprocessare file riferiti tramite le richieste. Questa particolare
+versione è stata scritta per risolvere i problemi creati dal supporto
+per le pagine di manuale compresse.
+.SH OPZIONI
+.TP
+.B \-C
+Questo flag è disponibile per compatibilità con gli altri programmi
+.BR soelim .
+È usato per abilitare richieste .so seguite da qualcos'altro
+oltre uno spazio bianco. Poiché questo è già il comportamento
+standard, è ignorato.
+.TP
+.B \-h
+Mostra un messaggio d'aiuto ed esce.
+.TP
+.B \-V
+Mostra informazioni sulla versione e l'autore.
+.SH "VEDERE ANCHE"
+.BR nroff (1),
+.BR troff (1),
+.BR groff (1),
+.BR %man% (1).
+.SH AUTORE
+Wilf. (G.Wilford@ee.surrey.ac.uk).
+.br
+Fabrizio Polacco (fpolacco@debian.org).
+.br
+Traduzione di Bortolozzo Giovanni (borto@pluto.linux.it).
+
diff --git a/man/it_IT.88591/man5/manpath.man5 b/man/it_IT.88591/man5/manpath.man5
new file mode 100644
index 00000000..6b0f28a9
--- /dev/null
+++ b/man/it_IT.88591/man5/manpath.man5
@@ -0,0 +1,110 @@
+.\" Man page for format of the manpath.config data file
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" Traduzione di Bortolozzo Giovanni <borto@pluto.linux.it>
+.\" Febbraio 1997
+.\" 1° Revisione Marzo 1997
+.\" 2° Revisione Agosto 1999
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.\"" for hilit19
+.TH manpath 5 "%date_it%" "%version%" "%manpath_config_file%"
+.SH NOME
+manpath \- formato del file %manpath_config_file%
+.SH DESCRIZIONE
+Il file di configurazione dei percorsi man è usato dalle utility per
+le pagine di manuale per stabilire in esecuzione i percorsi man
+dell'utente, per indicare quali gerarchie di pagine di manuale
+(percorsi man) devono essere trattati come globali e per assegnare a
+quest'ultimi delle directory da usare per salvare i cat file.
+
+Se la variabile d'ambiente
+.RB $ MANPATH
+è già settata, le informazioni contenute all'interno di
+%manpath_config_file% non la ridefiniranno.
+.SH FORMATO
+Attualmente sono riconosciuti i seguenti tipi di campi:
+.TP
+.BI # \ commento
+Righe vuote o che iniziano con un
+.B #
+saranno trattate come commenti ed ignorate.
+.TP
+.BI MANDATORY_MANPATH \ elemento_percorso_man
+Righe di questo tipo indicano percorsi man che ogni
+.RB $ MANPATH
+generato automaticamente dovrebbe contenere. Tipicamente include
+.IR /usr/man .
+.TP
+.BI MANPATH_MAP \ elemento_percorso\ elemento_percorso_man
+Righe di questo tipo definiscono la mappatura da
+.RB $ PATH
+a
+.RB $ MANPATH .
+Per ognuno degli
+.I elemento_percorso
+trovati nella variabile
+.RB $ PATH
+dell'utente,
+.I elemento_percorso_man
+sarà aggiunto a
+.RB $ MANPATH .
+.TP
+\fBMANDB_MAP \fIelemento_percorso_man \fR\|[\|\fIelemento_percorso_cat\fR \|]
+Righe di questo tipo indicano quali percorsi man devono essere
+trattati come globali e opzionalmente, dove dovrebbero essere salvati
+i loro file cat. Questo campo è particolarmente importante se
+.B man
+è un programma setuid, in quanto indica a quali gerarchie di pagine di
+manuale accedere come utente setuid e a quali come l'utente invocante.
+
+Le gerarchie di pagine di manuale sono solitamente quelle
+immagazzinate sotto a
+.I /usr
+come, ad esempio,
+.IR /usr/man ,
+.I /usr/local/man
+e
+.IR /usr/X11R6/man .
+
+Se le pagine cat di un particolare
+.I elemento_percorso_man
+non devono essere salvate o sono salvate nelle posizione tradizionale,
+.I elemento_percorso_cat
+può essere omesso.
+
+Posizioni cat tradizionali potrebbero essere impossibili per gerarchie
+di pagine di manuale montate in sola lettura e a causa di ciò è
+impossibile specificare una valida gerarchia di directory per il loro
+salvataggio. Per osservare il
+.B Linux FSSTND
+la parola chiave
+.RB ` FSSTND '
+può essere usata al posto di una reale directory.
+
+Sfortunatamente, è necessario specificare
+.B tutti
+i percorsi man globali, inclusi i percorsi di sistema alternativi come
+.I /usr/man/sun
+o qualsiasi percorso
+.B NLS locale
+come
+.IR /usr/man/it_IT .
+
+Poiché le informazioni sono analizzate riga per riga nell'ordine in cui
+sono scritte, è necessario che ognuno dei percorsi man che sia una
+sotto gerarchia di un'altra gerarchia sia elencato prima, altrimenti
+sarà fatta una corrispondenza non corretta. Ad esempio
+.I /usr/man/it_IT
+deve venire prima di
+.IR /usr/man .
+.SH PROBLEMI
+Finché le suddette regole non sono seguite e osservate precisamente,
+le utility per le pagine di manuale non funzioneranno correttamente. Le
+regole sono eccessivamente complicate.
diff --git a/man/it_IT.88591/man8/accessdb.man8 b/man/it_IT.88591/man8/accessdb.man8
new file mode 100644
index 00000000..bf9c5d28
--- /dev/null
+++ b/man/it_IT.88591/man8/accessdb.man8
@@ -0,0 +1,50 @@
+.\" Man page for accessdb
+.\"
+.\" Copyright (c) 1998 Fabrizio Polacco <fpolacco@debian.org
+.\"
+.\" Traduzione di Bortolozzo Giovanni <borto@pluto.linux.it>
+.\" Agosto 1999
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Tue, 24 Feb 1998 18:18:36 +0200
+.\"
+.TH accessdb 8 "%date%" "%version%" "Utility per le Pagine di Manuale"
+.SH NAME
+accessdb \- mostra il contenuto di una base di dati man-db in un
+formato comprensibile.
+.Sh SINTASSI
+.B /usr/sbin/accessdb
+.RI [ <file-index> ]
+.SH DESCRIZIONE
+.B accessdb
+mostretà i dati contenuti all'interno di una base di dati di man_db in
+un formato comprensibile (all'uomo :). Di default, mosterà i dati di
+.B /var/catman/index.<tipo-db>,
+dove <tipo-db> dipende dalla libreria di basi di dati in uso.
+
+Fornendo un argomento ad accessdb di modificherà questo comportamento predefinito.
+
+.nf
+$mtime$ -> "795987034"
+$version$ -> "2.3.1"
+apropos -> "1 1 795981542 A - - ricerca nei nomi e nelle descrizioni delle pagine di manuale
+catman -> "8 8 795981544 A - - crea o aggiorna le pagine di manuale preformattate"
+man -> "1 1 795981542 A - - un'interfaccia ai manuali di riferimento in linea"
+mandb -> "8 8 795981544 A - - crea o aggiorna le cache index delle pagine di manuale"
+manpath -> " 1 5"
+manpath~1 -> "1 1 795981542 A - - determina il percorso di ricerca delle pagine di manuale"
+manpath~5 -> "5 5 795981543 A - - formato del file /etc/manpath.config"
+whatis -> "1 1 795981543 A - - mostra le descrizioni delle pagine di manuale"
+zsoelim -> "1 1 795981543 A - - soddisfa le richieste .so nell'input roff"
+.fi
+
+.SH AUTORE
+Wilf. (G.Wilford@ee.surrey.ac.uk)
+.br
+Fabrizio Polacco (fpolacco@debian.org).
+.br
+Traduzione di Giovanni Bortolozzo (borto@pluto.linux.it)
+
diff --git a/man/it_IT.88591/man8/catman.man8 b/man/it_IT.88591/man8/catman.man8
new file mode 100644
index 00000000..1f47e39c
--- /dev/null
+++ b/man/it_IT.88591/man8/catman.man8
@@ -0,0 +1,112 @@
+.\" Man page for catman
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" Traduzione in Italiano di Bortolozzo Giovanni <borto@pluto.linux.it>
+.\" Febbraio 1997
+.\" 1° Revisione Marzo 1997
+.\" 2° Revisione Agosto 1999
+.\" 3^ Revisione e aggionamento Settembre 1999
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Dec 10 14:17:29 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.\"" for hilit19
+.TH %catman% 8 "%date_it%" "%version%" "Utility per le Pagine di Manuale"
+.SH NOME
+%catman% \- crea o aggiorna le pagine di manuale preformattate
+.SH SINTASSI
+.B %catman%
+.RB [\| \-dhV \|]
+.RB [\| \-M
+.IR percorso \|]
+.RI [\| sezione \|]
+\&.\|.\|.
+.SH DESCRIZIONE
+.B %catman%
+è usato per creare un insieme aggiornato di pagine di manuale
+preformattate dette anche
+.BR "cat page" .
+Le cat page sono generalmente più veloci da visualizzare rispetto alle
+pagine di manuale originali, ma richiedono ulteriore spazio per essere
+memorizzate. La decisione di supportare le cat page è
+dell'amministratore locale, il quale deve fornire anche le directory
+adatte per contenerle.
+
+Le opzioni disponibili a
+.B %catman%
+sono le gerarchie delle pagine di manuale e le sezioni da
+preformattare. Le gerarchie predefinite sono quelle specificate come
+globali nel file di configurazione di man_db e le sezioni predefinite
+sono gli elementi separati da `:' nella variabile d'ambiente
+.RB $ MANSECT
+oppure, se
+.RB $ MANSECT
+non è definita, un insieme predefinito in fase di compilazione all'interno di
+.BR %man% .
+Fornendo a
+.B %catman%
+un insieme di nomi di sezioni separati da spazi bianchi le due
+precedenti liste di sezioni verranno ignorate.
+
+.B %catman%
+fa uso della cache della base di dati
+.B index
+associata con ognuna delle gerarchie per determinare quali file hanno
+bisogno della formattazione.
+.SH OPZIONI
+.TP
+.B \-d, \-\-debug
+Mostra informazioni utili al debug.
+.TP
+.BI \-M\ percorso ,\ \-\-manpath= percorso
+Specifica una lista alternativa di percorsi di ricerca separati da
+`:'. Di default, questi sono tutti i percorsi indicati come globali
+nel file di configurazione di man_db.
+.TP
+.B \-h, \-\-help
+Mostra un messaggio d'aiuto ed esce.
+.TP
+.B \-V, \-\-version
+Mostra informazioni sulla versione e sull'autore.
+.SH VARIABILI D'AMBIENTE
+.TP
+.B MANSECT
+Se
+.RB $ MANSECT
+è definita, il suo valore è una lista separata da `:' di sezioni ed è
+usato per determinare in quali sezioni di manuali fare la ricerca e in
+che ordine.
+.TP
+.B MANPATH
+Se
+.RB $ MANPATH
+è definita, il suo valore è interpretato come una lista di percorsi di
+ricerca separati da `:' di gerarchie di pagine di manuale.
+.SH FILE
+.TP
+.I %manpath_config_file%
+File di configurazione di man_db.
+.TP
+.I /usr/man/index.(bt|db|dir|pag)
+Una cache della base di dati globale
+.I index
+tradizionale.
+.TP
+.I /var/catman/index.(bt|db|dir|pag)
+Una cache della base di dati globale
+.I index
+alternativa e conforme con FSSTND.
+.SH "VEDERE ANCHE"
+.BR %man% (1),
+.BR manpath (5),
+.BR %mandb% (8).
+.SH AUTORE
+Wilf. (G.Wilford@ee.surrey.ac.uk).
+.br
+Fabrizio Polacco (fpolacco@debian.org).
+.br
+Traduzione di Bortolozzo Giovanni (borto@pluto.linux.it)
diff --git a/man/it_IT.88591/man8/mandb.man8 b/man/it_IT.88591/man8/mandb.man8
new file mode 100644
index 00000000..81277e69
--- /dev/null
+++ b/man/it_IT.88591/man8/mandb.man8
@@ -0,0 +1,163 @@
+'\" t
+.\" Man page for mandb
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" Traduzione in Italiano di Bortolozzo Giovanni <borto@pluto.linux.it>
+.\" Febbraio 1997
+.\" 1° Revisione Marzo 1997
+.\" 2° Revisione Agosto 1999
+.\" 3^ Revisione e aggionamento Settembre 1999
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Tue Apr 26 12:56:44 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.\"" for hilit19
+.TH %mandb% 8 "%date_it%" "%version%" "Utility per le Pagine di Manuale"
+.SH NOME
+%mandb% \- crea o aggiorna le cache index delle pagine di manuale
+.SH SINTASSI
+.B %mandb%
+.RB [\| \-dqsuc \||\| \-h \||\| \-V\c
+.RI "\|] [\|" percorso \|]
+.SH DESCRIZIONE
+.B %mandb%
+è usato per inizializzare o aggiornare manualmente le cache delle basi
+di dati
+.B index
+solitamente mantenute da
+.BR %man% .
+Le cache contengono importanti informazioni sullo stato corrente del
+sistema di pagine di manuale e le informazioni immagazzinate al loro
+interno sono usate dalle utility man_db per aumentare la loro velocità
+e funzionalità.
+
+Quando crea o aggiorna un
+.BR index ,
+.B %mandb%
+genererà un avviso nel caso di richieste ROFF .so errate, di nomi di
+pagine di manuale fasulli e di pagine di manuale dalle quali non può
+essere estratto il
+.BR whatis .
+
+Fornendo a
+.B %mandb%
+una lista opzionale di percorsi separati da `:' verrà ignorata la
+gerarchia globale interna dei percorsi di ricerca, determinata dalle
+informazioni contenute nel file di configurazione di man_db.
+.SH "CACHE DELLE BASI DI DATI"
+.B %mandb%
+può essere compilato con il supporto per qualsiasi fra seguenti tipi
+di basi di dati.
+
+.TS
+tab (@);
+l l l l.
+Nome@Tipo@Asinc@NomeFile
+_
+Berkeley db@Binary tree@Sì@\fIindex.bt\fR
+GNU gdbm v >= 1.6@Hashed@Sì@\fIindex.db\fR
+GNU gdbm v < 1.6@Hashed@No@\fIindex.db\fR
+UNIX ndbm@Hashed@No@\fIindex.(dir|pag)\fR
+.TE
+
+Questi tipi di basi di dati supportano aggiornamenti asincroni
+privilegiando la velocità a spese di eventuali corruzioni nel caso di
+terminazioni inusuali.
+Nel caso che ciò succeda, potrebbe essere necessario rilanciare
+.B %mandb%
+con l'opzione
+.B \-c
+per ricreare le nuove basi di dati.
+.SH OPZIONI
+.TP
+.B \-d, \-\-debug
+Produce informazioni utili al debug.
+.TP
+.B \-q, \-\-quiet
+Non produce nessun avviso.
+.TP
+.B \-s, \-\-no-straycats
+Non perde tempo a cercare o ad aggiungere informazioni ai database
+riguardanti le pagine di manuale delle quali non esiste il file
+sorgente. (N.d.T.: tali pagine di manuale sono dette in gergo
+.I "stray cat"
+page.)
+.TP
+.B \-c, \-\-create
+Di default,
+.B %mandb%
+proverà ad aggiornare le basi di dati precedentemente create. Se una
+base di dati non esiste, la creerà. Questa opzione forza
+.B %mandb%
+a cancellare le basi di dati precedenti e ricrearle. Ciò
+potrebbe essere necessario se una base di dati è rovinata o se un
+nuovo schema di immagazzinamento di dati verrà introdotto in futuro.
+.TP
+.B \-u, \-\-user-db
+Crea solo le basi di dati dell'utente, anche se ha i permessi per
+creare le basi di dati globali.
+.TP
+.B \-h, \-\-help
+Mostra un messaggio d'aiuto, poi esce.
+.TP
+.B \-V, \-\-version
+Mostra la versione, poi esce.
+.SH DIAGNOSTICI
+Durante la costruzione delle basi di dati possono essere emessi i
+seguenti messaggi di avviso:
+.TP
+.B <nomefile>: analisi whatis per pagina(sez) fallita
+Un tentativo di estrarre la riga o le righe whatis per il dato
+<nomefile> è fallita. Ciò solitamente è dovuto a una pagina di manuale
+scritta in modo scadente, ma se sono emessi molti di questi messaggi
+allora probabilmente il sistema contiene delle pagine di manuale non
+standard che sono incompatibili con l'analizzatore whatis di man_db.
+.TP
+.B <nomefile>: è un link simbolico penzolante
+<nomefile> non esiste ma è riferito con un link simbolico. Ulteriori
+messaggi diagnotici sono solitamente prodotti per identificare il
+<nomefile> del link violante.
+.TP
+.B <nomefile>: link simbolico o richiesta ROFF `.so' errata
+<nomefile> è o un link simbolico a, oppure contiene una richiesta di
+inclusione ROFF di un file non esistente.
+.TP
+.B <nomefile>: nomefile fasullo ignorato
+Il <nomefile> potrebbe o meno essere un valido nome di pagina di
+manuale ma il suo nome non è valido. Ciò solitamente è dovuto a una
+pagina di manuale con estensione di sezione <x> che è stata messa
+nella sezione <y> delle pagine di manuale.
+.TP
+.B <nomefile_mask>: estensioni in conflitto
+La wildcard <nomefile_mask> non è unica. Ciò è causato solitamente
+dall'esistenza della versione compressa e non compressa della stessa
+pagina di manuale. Sono ignorate tutte quante tranne la più recente.
+.SH FILE
+.TP
+.I %manpath_config_file%
+File di configurazione di man_db.
+.TP
+.I /usr/man/index.(bt|db|dir|pag)
+Una cache della base di dati globale
+.I index
+tradizionale.
+.TP
+.I /var/catman/index.(bt|db|dir|pag)
+Una cache della base di dati globale
+.I index
+alternativa e conforme con FSSTND.
+.SH "VEDERE ANCHE"
+.BR %man% (1),
+.BR manpath (5),
+.BR %catman% (8).
+.SH AUTORE
+Wilf. (G.Wilford@ee.surrey.ac.uk).
+.br
+Fabrizio Polacco (fpolacco@debian.org).
+.br
+Traduzione di Bortolozzo Giovanni (borto@pluto.linux.it)
+
diff --git a/man/ja_JP.ujis/man1/apropos.man1 b/man/ja_JP.ujis/man1/apropos.man1
new file mode 100644
index 00000000..c5de71bd
--- /dev/null
+++ b/man/ja_JP.ujis/man1/apropos.man1
@@ -0,0 +1,169 @@
+.\" Man page for apropos
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
+.\" Translated Fri 25 Sep 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\" Modified Sun 6 Dec 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\"
+.\"WORD: hierarchy ³¬ÁØ
+.\"WORD: description Í×Ìó(ʸ)
+.\"
+.TH apropos 1 "July 12th, 1995" "2.3.10" "Manual pager utils"
+.SH ̾Á°
+apropos \- ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î̾Á°¤ÈÆâÍƤò¸¡º÷¤¹¤ë
+.SH ½ñ¼°
+.B apropos
+.RB [\| \-dhV \|]
+.RB [\| \-r \||\| \-w\c
+\|]
+.RB [\| \-m
+.IR system \|[\|,.\|.\|.\|]\|]
+.RB [ \-M
+.IR path \|]
+.I keyword
+\&.\|.\|.
+.SH ÀâÌÀ
+¤½¤ì¤¾¤ì¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë¤Ï¡¢ÆâÍƤòÀâÌÀ¤¹¤ëÍ×Ìóʸ¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë¡£
+.B apropos
+¤Ï¡¢¤³¤ÎÍ×Ìóʸ¤òÂоݤˤ·¤Æ
+.I keyword
+¤ò¸¡º÷¤¹¤ë¡£
+.I keyword
+¤Ë¤Ï¥ï¥¤¥ë¥É¥«¡¼¥É
+.RB ( \-w )
+¤äÀµµ¬É½¸½
+.RB ( \-r )
+¤òÍѤ¤¤ë¤³¤È¤â¤Ç¤­¤ë¡£
+¤³¤ì¤é¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤È¤­¤Ë¤Ï¡¢¥·¥§¥ë¤Ë¤è¤ë²ò¼á¤òËɤ°¤¿¤á¤Ë¡¢
+.I keyword
+¤ò°úÍÑÉä¤Ç°Ï¤à¤«¡¢Æüìʸ»ú¤ò¥¨¥¹¥±¡¼¥×¤¹¤ë (\\) ɬÍפ¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
+
+ɸ½àŪ¤Ê¥Þ¥Ã¥Á¥ó¥°¥Ñ¥¿¡¼¥ó¤ò»ØÄꤹ¤ì¤Ð¡¢
+Í×ÌóʸÃæ¤Îñ¸ì¤Î¶­³¦¤ä¥Ú¡¼¥¸¤Î̾Á°¤â¥Þ¥Ã¥Á¤ÎÂоݤȤʤ롣
+.SH ¥ª¥×¥·¥ç¥ó
+.TP
+.B \-d, \-\-debug
+¥Ç¥Ð¥Ã¥°¾ðÊó¤òɽ¼¨¤¹¤ë¡£
+.TP
+.B \-r, \-\-regex
+¥­¡¼¥ï¡¼¥É¤ò¤½¤ì¤¾¤ìÀµµ¬É½¸½¤È¤·¤Æ°·¤¦¡£¥Ú¡¼¥¸¤Î̾Á°¤È
+Í×Ìóʸ¤È¤¬¡¢¤½¤ì¤¾¤ìÆÈΩ¤Ë¥­¡¼¥ï¡¼¥É¥Þ¥Ã¥Á¤ÎÂоݤˤʤ롣¥­¡¼¥ï¡¼¥É¤Ï
+³Æ¡¹¤Î¤¢¤é¤æ¤ëÉôʬ¤Ë¥Þ¥Ã¥Á¤¹¤ë¡£¥Þ¥Ã¥Á¤Ïñ¸ì¤Î¶­³¦¤Ë±Æ¶Á¤µ¤ì¤Ê¤¤¡£
+.TP
+.B \-w, \-\-wildcard
+¤½¤ì¤¾¤ì¤Î¥­¡¼¥ï¡¼¥É¤ò¡¢¥·¥§¥ë·Á¼°¤Î¥ï¥¤¥ë¥É¥«¡¼¥É¤ò´Þ¤ó¤À¥Ñ¥¿¡¼¥ó
+¤È¤·¤Æ°·¤¦¡£¥Ú¡¼¥¸¤Î̾Á°¤È
+Í×Ìóʸ¤È¤¬¡¢¤½¤ì¤¾¤ìÆÈΩ¤Ë¥­¡¼¥ï¡¼¥É¥Þ¥Ã¥Á¤ÎÂоݤˤʤ롣
+Ÿ³«¤µ¤ì¤¿¥­¡¼¥ï¡¼¥É¤¬¥Ú¡¼¥¸¤Þ¤¿¤Ïµ­½Ò¤ÎÁ´ÂΤ˥ޥåÁ¤¹¤ë¾ì¹ç¤Ë¤Î¤ß¡¢
+¥Þ¥Ã¥Á¤·¤¿¤ÈȽÄꤵ¤ì¤ë¡£
+.\"
+.\" Due to the rather silly limit of 6 args per request in some `native'
+.\" *roff compilers, we have do the following to get the two-line
+.\" hanging tag on one line. .PP to begin a new paragraph, then the
+.\" tag, then .RS (start relative indent), the text, finally .RE
+.\" (end relative indent).
+.\"
+.PP
+.B \-m
+.I system\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= system\c
+\|[\|,.\|.\|.\|]
+.RS
+¸½ºß¤Î¥·¥¹¥Æ¥à¤«¤é¡¢Â¾¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Ë¤Ä¤¤¤Æ¤Î¥Þ¥Ë¥å¥¢¥ë¤Ë
+¥¢¥¯¥»¥¹¤Ç¤­¤ë¾ì¹ç¤Ë¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤ë¤È¤½¤ì¤é¤Î¥Þ¥Ë¥å¥¢¥ë¤¬
+¸¡º÷¤µ¤ì¤ë¡£
+NewOS ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò¸¡º÷¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢
+.B \-m
+.B NewOS
+¤Î¤è¤¦¤Ê¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¡£
+
+.I system
+¤Ë¤ÏÊ£¿ô¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤ò¥³¥ó¥Þ¤Ç¶èÀڤä¿·Á¼°¤Ç»ØÄê¤Ç¤­¤ë¡£
+¥Í¥¤¥Æ¥£¥Ö¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Î
+.B whatis
+Í×Ìóʸ¤ò¸¡º÷¤ÎÂоݤ˴ޤá¤ë¤¿¤á¤Ë¤Ï¡¢¥·¥¹¥Æ¥à̾
+.B man
+¤ò°ú¤­¿ôʸ»úÎó¤Ë²Ã¤¨¤ë¡£
+¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï
+.RB $ SYSTEM
+´Ä¶­ÊÑ¿ô¤ò¾å½ñ¤­¤¹¤ë¡£
+.RE
+.TP
+.BI \-M\ path ,\ \-\-manpath= path
+¸¡º÷Âоݤˤ¹¤ë¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î³¬ÁØ (hierarchy) ¤òÊѤ¨¤¿¤¤¾ì¹ç¡¢¤½¤ì
+¤é¤ò¥³¥í¥ó¤Ç¶èÀڤä¿·Á¼°¤Ç»ØÄꤹ¤ë¡£
+¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢
+.B apropos
+¤Ï´Ä¶­ÊÑ¿ô
+.RB $ MANPATH
+¤òÍѤ¤¤ë¡£¤³¤ì¤¬¶õ¤À¤Ã¤¿¤êÀßÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢
+.RB $ PATH
+´Ä¶­ÊÑ¿ô¤Ë´ð¤Å¤¤¤Æ¡¢Å¬ÀÚ¤Ê manpath ¤ò·è¤á¤è¤¦¤È»î¤ß¤ë¡£
+¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï
+.RB $ MANPATH
+¤ÎÆâÍƤò¾å½ñ¤­¤¹¤ë¡£
+.TP
+.B \-h, \-\-help
+¥Ø¥ë¥×¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Æ½ªÎ»¤¹¤ë¡£
+.TP
+.B \-V, \-\-version
+¥Ð¡¼¥¸¥ç¥ó¤ÈÃø¼Ô¤Ë´Ø¤¹¤ë¾ðÊó¤òɽ¼¨¤¹¤ë¡£
+.SH ÊÖ¤êÃÍ
+.TP
+.B 0
+¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤ËÀ®¸ù¤·¤¿¡£
+.TP
+.B 1
+»ÈÍÑË¡¡¢Ê¸Ë¡¡¢ÀßÄê¥Õ¥¡¥¤¥ë¤Î¤¤¤º¤ì¤«¤Ë¥¨¥é¡¼¤¬¤¢¤ë¡£
+.TP
+.B 2
+¼Â¹Ô»þ¥¨¥é¡¼¡£
+.TP
+.B 16
+»ØÄꤷ¤¿¥­¡¼¥ï¡¼¥É¤Ë¥Þ¥Ã¥Á¤¹¤ë¤â¤Î¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£
+.SH ´Ä¶­ÊÑ¿ô
+.TP
+.B SYSTEM
+.RB $ SYSTEM
+´Ä¶­ÊÑ¿ô¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¤½¤ÎÆâÍƤ¬
+.B \-m
+¥ª¥×¥·¥ç¥ó¤Î°ú¤­¿ô¤È¤·¤Æ»ØÄꤵ¤ì¤¿¾ì¹ç¤ÈƱ¤¸¸úÎϤò»ý¤Ä¡£
+.TP
+.B MANPATH
+.RB $ MANPATH
+¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¤½¤ÎÆâÍƤϸ¡º÷ÂоݤȤ¹¤ë¥Þ¥Ë¥å¥¢¥ë¤Î³¬Áؤò
+¥³¥í¥ó¤Ç¶èÀڤ俥ꥹ¥È¤È¤ß¤Ê¤µ¤ì¤ë¡£
+.TP
+.B POSIXLY_CORRECT
+.RB $ POSIXLY_CORRECT
+¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤È (ÆâÍƤ¬¶õ¤Ç¤¢¤Ã¤Æ¤â)¡¢¥Ç¥Õ¥©¥ë¥È¤Î
+.B apropos
+¤Î¸¡º÷¤Ï³ÈÄ¥Àµµ¬É½¸½·Á¼°
+.RB ( \-r )
+¤Ç¹Ô¤ï¤ì¤ë¡£
+.SH ¥Õ¥¡¥¤¥ë
+.TP
+.I /usr/man/index.(bt|db|dir|pag)
+½¾Íè·Á¼°¤Î¡¢ global ¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹¥­¥ã¥Ã¥·¥å¤Î
+¥¤¥ó¥Ç¥Ã¥¯¥¹¡£
+.TP
+.I /var/catman/index.(bt|db|dir|pag)
+¿·¤·¤¤ (FSSTND ½àµò¤Î)¡¢ global ¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹¥­¥ã¥Ã¥·¥å¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¡£
+.TP
+.I /usr/man/\|.\|.\|.\|/whatis
+½¾Íè·Á¼°¤Î¡¢
+.B whatis
+¥Æ¥­¥¹¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¡£
+.SH ´ØÏ¢¹àÌÜ
+.BR whatis (1),
+.BR man (1)
+.SH Ãø¼Ô
+Wilf. (G.Wilford@ee.surrey.ac.uk)
diff --git a/man/ja_JP.ujis/man1/man.man1 b/man/ja_JP.ujis/man1/man.man1
new file mode 100644
index 00000000..0e5616b0
--- /dev/null
+++ b/man/ja_JP.ujis/man1/man.man1
@@ -0,0 +1,940 @@
+'\" t
+.\" ** The above line should force tbl to be a preprocessor **
+.\" Man page for man
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
+.\" Translated Fri 25 Sep 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\" Modified Sun 6 Dec 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\"
+.\"WORD: hierarchy ³¬ÁØ
+.\"WORD: (short) description Í×Ìó(ʸ)
+.\"
+.TH man 1 "July 12th, 1995" "2.3.10" "Manual pager utils"
+.SH ̾Á°
+man \- ¥ª¥ó¥é¥¤¥ó¥ê¥Õ¥¡¥ì¥ó¥¹¥Þ¥Ë¥å¥¢¥ë¤Î¥¤¥ó¥¿¡¼¥Õ¥§¡¼¥¹
+.SH ½ñ¼° aa
+.\" The general command line
+.B man
+.RB [\| \-c \||\| \-w \||\| \-tZT
+.IR device \|]
+.RB [\| \-adhu7V \|]
+.RB [\| \-m
+.IR system \|[\|,.\|.\|.\|]\|]
+.RB [\| \-L
+.IR locale \|]
+.RB [\| \-p
+.IR string \|]
+.RB [\| \-M
+.IR path \|]
+.RB [\| \-P
+.IR pager \|]
+.RB [\| \-r
+.IR prompt \|]
+.RB [\| \-S
+.IR list \|]
+.RB [\| \-e
+.IR extension \|]
+.RI [\|[\| section \|]
+.IR page \ .\|.\|.\|]\ .\|.\|.
+.\" The --local command line
+.br
+.B man
+.B \-l
+.RB [\| \-7 \|]
+.RB [\| \-tZT
+.IR device \|]
+.RB [\| \-p
+.IR string \|]
+.RB [\| \-P
+.IR pager \|]
+.RB [\| \-r
+.IR prompt \|]
+.I file
+\&.\|.\|.
+.\" The apropos command line
+.br
+.B man
+.B \-k
+.RB [\| \-M
+.IR path \|]
+.I keyword
+\&.\|.\|.
+.\" The whatis command line
+.br
+.B man
+.B \-f
+.RB [\| \-M
+.IR path \|]
+.I page
+\&.\|.\|.
+.SH ÀâÌÀ
+.B man
+¤Ï¥·¥¹¥Æ¥à¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¥ã¡¼¤Ç¤¢¤ë¡£
+.B man
+¤ËÍ¿¤¨¤é¤ì¤ë°ú¤­¿ô
+.I page
+¤Ï¡¢Ä̾ï¤Ï¥×¥í¥°¥é¥à¤ä¥æ¡¼¥Æ¥£¥ê¥Æ¥£¡¢´Ø¿ô¤Ê¤É¤Î̾Á°¤Ç¤¢¤ë¡£
+¤³¤ì¤é¤Î°ú¤­¿ô¤½¤ì¤¾¤ì¤ËÂбþ¤¹¤ë
+.I ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸
+¤¬¸¡º÷¡¦É½¼¨¤µ¤ì¤ë¡£
+.I section
+¤¬»ØÄꤵ¤ì¤ë¤È¡¢
+.B man
+¤Ï¥Þ¥Ë¥å¥¢¥ë¤ò¸¡º÷¤¹¤ëÂоݤò¤½¤Î¥»¥¯¥·¥ç¥ó¤Ë¸ÂÄꤹ¤ë¡£
+¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ç¤Ï¡¢¤¹¤Ù¤Æ¤Î¥»¥¯¥·¥ç¥ó¤ò´ûÄê¤Î½ç½ø¤Ç¸¡º÷¤·¡¢
+ºÇ½é¤Ë¸«¤Ä¤«¤Ã¤¿
+.I page
+¤À¤±¤òɽ¼¨¤¹¤ë¡£Ê£¿ô¤Î¥»¥¯¥·¥ç¥ó¤ËƱ¤¸Ì¾Á°¤Î
+.I page
+¤¬Â¸ºß¤¹¤ë¾ì¹ç¤Ç¤â¡¢É½¼¨¤µ¤ì¤ë¤Î¤ÏºÇ½é¤Î°ì¤Ä¤À¤±¤È¤Ê¤ë¡£
+
+°Ê²¼¤Îɽ¤Ë¥Þ¥Ë¥å¥¢¥ë¤Î
+.I section
+ÈÖ¹æ¤ò¼¨¤¹¡£¤½¤ì¤¾¤ì¤Î
+.I section
+¤Ë¡¢¤É¤Î¤è¤¦¤Ê¥Ú¡¼¥¸¤¬´Þ¤Þ¤ì¤ë¤«¤â¤¢¤ï¤»¤Æ¼¨¤¹¡£
+
+.TS
+tab (@);
+l l.
+1@¼Â¹Ô¥×¥í¥°¥é¥à¤Þ¤¿¤Ï¥·¥§¥ë¤Î¥³¥Þ¥ó¥É
+2@¥·¥¹¥Æ¥à¥³¡¼¥ë (¥«¡¼¥Í¥ë¤¬Ä󶡤¹¤ë´Ø¿ô)
+3@¥é¥¤¥Ö¥é¥ê¥³¡¼¥ë (¥·¥¹¥Æ¥à¥é¥¤¥Ö¥é¥ê¤Ë´Þ¤Þ¤ì¤ë´Ø¿ô)
+4@Æüì¤Ê¥Õ¥¡¥¤¥ë (Ä̾ï \fI/dev\fR ¤ËÃÖ¤«¤ì¤Æ¤¤¤ë¤â¤Î)
+5@¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È¤ÈÌó«»ö¡£Î㤨¤Ð \fI/etc/passwd\fR ¤Ê¤É
+6@¥²¡¼¥à
+7@¥Þ¥¯¥í¤Î¥Ñ¥Ã¥±¡¼¥¸¤È¤½¤ÎÌó«»ö¡£Î㤨¤Ð \fBman\fR(7), \fBgroff\fR(7) ¤Ê¤É
+8@¥·¥¹¥Æ¥à´ÉÍýÍѤΥ³¥Þ¥ó¥É
+9@¥«¡¼¥Í¥ë¥ë¡¼¥Á¥ó [\|Èóɸ½à\|]
+n@¿·¤·¤¤¤â¤Î [\|ºÇ¶á¤Ç¤Ï»È¤ï¤ì¤Ê¤¤\|]
+l@¥·¥¹¥Æ¥à¥í¡¼¥«¥ë¤Ê¤â¤Î [\|ºÇ¶á¤Ç¤Ï»È¤ï¤ì¤Ê¤¤\|]
+p@¥Ñ¥Ö¥ê¥Ã¥¯¤Ê¤â¤Î [\|ºÇ¶á¤Ç¤Ï»È¤ï¤ì¤Ê¤¤\|]
+o@¸Å¤¤¤â¤Î [\|ºÇ¶á¤Ç¤Ï»È¤ï¤ì¤Ê¤¤\|]
+.TE
+
+¤½¤ì¤¾¤ì¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ï¡¢¤¤¤¯¤Ä¤«¤Î¾Ï¤«¤é¤Ê¤ë¡£
+
+¤½¤ì¤¾¤ì¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ê̾Á°¤¬¤Ä¤¤¤Æ¤¤¤ë¡£
+.BR "̾Á° (NAME)" ,
+.BR "½ñ¼° (SYNOPSIS)" ,
+.BR "ÀâÌÀ (DESCRIPTION)" ,
+.BR "¥ª¥×¥·¥ç¥ó (OPTION)" ,
+.BR "¥Õ¥¡¥¤¥ë (FILES) ,
+.BR "´ØÏ¢¹àÌÜ (SEE ALSO)" ,
+.BR "¥Ð¥° (BUGS)" ,
+.BR "Ãø¼Ô (AUTHOR)"
+
+.B ½ñ¼°
+¤Î¾Ï¤Ë¤Ï°Ê²¼¤Î¤è¤¦¤Ê·Á¼°¤¬ÍѤ¤¤é¤ì¤Æ¤¤¤ë¡£
+¾¤Î¾Ï¤Ç¤âƱÍͤΥ롼¥ë¤òÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
+
+.TS
+tab (@);
+ l l.
+\fB¥Ü¡¼¥ë¥ÉÂÎ (bold)\fR@¤½¤Î¤Þ¤Þ¥¿¥¤¥×¤¹¤ë¡£
+\fI¥¤¥¿¥ê¥Ã¥¯ÂÎ (italic)\fR@ŬÀڤʰú¤­¿ô¤ËÃÖ¤­Â夨¤ë¡£
+[\|\fB\-abc\fR\|]@[ ] ÆâÉô¤Î°ú¤­¿ô¤Ï¤¹¤Ù¤Æ¾Êά¤Ç¤­¤ë¡£
+\fB\-a\|\fR|\|\fB\-b\fR@ | ¤Ç¶èÀÚ¤é¤ì¤¿¥ª¥×¥·¥ç¥ó¤ÏƱ»þ¤Ë¤Ï»ØÄê¤Ç¤­¤Ê¤¤¡£
+\fIargument\fB .\|.\|.@\fIargument\fR ¤Ï·«¤êÊÖ¤·»ØÄê¤Ç¤­¤ë¡£
+[\|\fIexpression\fR\|]\fB .\|.\|.@\fR [ ] ÆâÉô¤Î \fIexpression\fR\ Á´ÂΤò·«¤êÊÖ¤·»ØÄê¤Ç¤­¤ë¡£
+.TE
+
+¥³¥Þ¥ó¥É¤ä´Ø¿ô¤Ï¡¢¤³¤ì¤é¤Î¥Ñ¥¿¡¼¥ó¤ÎÁȤߤ¢¤ï¤»¤Ë¤è¤Ã¤Æ¡¢µ¯Æ°²Äǽ¤Ê½ñ¼°¤Î
+¤¹¤Ù¤Æ¤òÌÖÍ夷¤Æ¤¤¤ë¤Ù¤­¤Ç¤¢¤ë¡£Ê£¿ô¤¢¤ëµ¯Æ°ÊýË¡¤Î¤¦¤Á¤ÎÇÓ¾Ū¤Ê¤â¤Î¤Ï¡¢
+¾ì¹ç¤Ë¤è¤Ã¤Æ¤ÏÊÌ¡¹¤Ë¼¨¤·¤¿Êý¤¬Îɤ¤¤«¤â¤·¤ì¤Ê¤¤ (¤³¤Î¥Ú¡¼¥¸¤Î
+.B ½ñ¼°
+¥»¥¯¥·¥ç¥ó¤Ç¤Ï¤½¤Î¤è¤¦¤Ë¤·¤Æ¤¤¤ë)¡£
+.SH Îã
+.TP \w'man\ 'u
+.BI man \ ls
+(¥×¥í¥°¥é¥à)
+.I ls
+¤Ë´Ø¤¹¤ë¥Ú¡¼¥¸¤òɽ¼¨¤¹¤ë¡£
+.TP
+.BI man\ \-a \ intro
+¥Þ¥Ë¥å¥¢¥ë¤Ë¤¢¤ë
+.I intro
+¤Î¥Ú¡¼¥¸¤ò¤¹¤Ù¤Æ¡¢½çÈÖ¤Ëɽ¼¨¤¹¤ë¡£¼¡¤Î¥Ú¡¼¥¸¤Ë°Ü¤ë¤È¤­¤Ë¡¢°Ê¹ß¤Îɽ¼¨
+¤òÃæ»ß¤·¤¿¤ê¡¢¸«¤¿¤¯¤Ê¤¤¤â¤Î¤ò¥¹¥­¥Ã¥×¤¹¤ë¤³¤È¤â¤Ç¤­¤ë¡£
+.TP
+\fBman \-t \fIalias \fR|\fI lpr \-Pps
+.I alias
+¤Ç»²¾È¤µ¤ì¤ë¥Ú¡¼¥¸ (Ä̾ï¤Ï¥·¥§¥ë¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤À¤í¤¦) ¤ò¡¢
+.B troff
+¤Þ¤¿¤Ï
+.B nroff
+¤Î¥Ç¥Õ¥©¥ë¥È½ÐÎÏ¥Õ¥©¡¼¥Þ¥Ã¥È¤ËÀ°·Á¤·¤Æ¡¢
+.I ps
+¤È¤¤¤¦Ì¾Á°¤Î¥×¥ê¥ó¥¿¡¼¤Ë¥Ñ¥¤¥×¤·¤Æ¤¤¤ë¡£
+.B groff
+¤Î¥Ç¥Õ¥©¥ë¥È½ÐÎϤÏÄ̾ï PostScript ¤Ç¤¢¤ë¡£
+.B man \-\-help
+¤È¤¹¤ì¤Ð¡¢
+.B \-t
+¥ª¥×¥·¥ç¥ó¤Ë¤è¤Ã¤Æµ¯Æ°¤µ¤ì¤ëÀ°·Á¥³¥Þ¥ó¥É¤Ë´Ø¤¹¤ë¾ðÊó¤¬ÆÀ¤é¤ì¤ë¡£
+.TP
+.BI man\ \-l\ \-T dvi\ ./foo.1x.gz \ >\ ./foo.1x.dvi
+¤³¤Î¥³¥Þ¥ó¥É¤Ï nroff ¥½¡¼¥¹¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸
+.I ./foo.1x.gz
+¤òŸ³«¤·¤Æ¡¢
+.B ¥Ç¥Ð¥¤¥¹Èó°Í¸ (dvi)
+¤Ê¥Õ¥¡¥¤¥ë¤Ë¥Õ¥©¡¼¥Þ¥Ã¥È¤¹¤ë¡£
+.B \-T
+¥ª¥×¥·¥ç¥ó¤Ë¤è¤Ã¤Æ¡¢¥Õ¥©¡¼¥Þ¥Ã¥È¤Î·ë²Ì¤Ï
+.B stdout
+¤Ë¥Ú¡¼¥¸¥ã¡¼¤Ê¤·¤Ç½ÐÎϤµ¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢¤³¤Î¾ì¹ç¥ê¥À¥¤¥ì¥¯¥·¥ç¥ó¤¬
+ɬÍפǤ¢¤ë¡£¤³¤Î½ÐÎÏ·ë²Ì¤Ï
+.B xdvi
+¤Î¤è¤¦¤Ê¥×¥í¥°¥é¥à¤Ç¸«¤ë¤³¤È¤¬¤Ç¤­¤ë¡£¤Þ¤¿
+.B dvips
+¤Î¤è¤¦¤Ê¥×¥í¥°¥é¥à¤òÍѤ¤¤ì¤Ð¡¢¤µ¤é¤Ë PostScript ¤ËÊÑ´¹¤¹¤ë¤³¤È¤â
+¤Ç¤­¤ë¡£
+.TP
+.BI man\ \-k \ printf
+¥­¡¼¥ï¡¼¥É
+.I printf
+¤Ç¡¢¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÎÍ×Ìóʸ¤È¥Ú¡¼¥¸Ì¾¤ò¸¡º÷¤·¡¢
+¥Þ¥Ã¥Á¤·¤¿·ë²Ì¤òɽ¼¨¤¹¤ë¡£
+.TP
+.BI man\ \-f \ smail
+.I smail
+¤È¸À¤¦Ì¾Á°¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤òõ¤·¡¢
+¸«¤Ä¤«¤Ã¤¿¤â¤Î¤½¤ì¤¾¤ì¤ËÂФ·¤ÆÍ×Ìóʸ¤òɽ¼¨¤¹¤ë¡£
+.SH ³µÍ×
+.B man
+¤Ë¤Ï¿¤¯¤Î¥ª¥×¥·¥ç¥ó¤¬Â¸ºß¤·¡¢¥æ¡¼¥¶¡¼¤Ë²Äǽ¤Ê¸Â¤ê¤Î½ÀÆðÀ­¤òÄ󶡤·¤Æ¤¤
+¤ë¡£¸¡º÷¥Ñ¥¹¡¢¥»¥¯¥·¥ç¥ó¤Î¸¡º÷½ç¡¢½ÐÎÏ¥×¥í¥»¥Ã¥µ¡¢¤½¤Î¾¤Î¿¶¤ëÉñ¤¤¤ä
+Æ°ºî¤Ê¤É¤¬¡¢°Ê²¼¤Ë¾ÜºÙ¤Ë½Ò¤Ù¤é¤ì¤Æ¤¤¤ë¡£
+
+¤Þ¤¿
+.B man
+¤ÎÆ°ºî¤Ë±Æ¶Á¤òµÚ¤Ü¤¹´Ä¶­ÊÑ¿ô¤â¿ô¿¤¯Â¸ºß¤¹¤ë¡£
+¡ÖËüǽ¡×¤Ê´Ä¶­ÊÑ¿ô¤Ç¤¢¤ë
+.RB $ MANOPT
+¤òÍѤ¤¤ì¤Ð¡¢¥³¥Þ¥ó¥É¥é¥¤¥ó¤ÈƱ¤¸·Á¼°¤Îʸ»úÎó¤òÀßÄꤹ¤ë¤³¤È¤â¤Ç¤­¤ë¡£
+¤¿¤À¤·¥ª¥×¥·¥ç¥ó¤Î°ú¤­¿ô¤Î°ìÉô¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¥¹¥Ú¡¼¥¹¤Ï¡¢
+¤¹¤Ù¤Æ¥¨¥¹¥±¡¼¥×¤¹¤ë (¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤òÁ°ÃÖ¤¹¤ë) ɬÍפ¬¤¢¤ë¡£
+.B man
+¤Ï¡¢
+.RB $ MANOPT
+¤ò¥³¥Þ¥ó¥É¥é¥¤¥ó¤ÎÁ°¤Ë²ò¼á¤¹¤ë¡£°ú¤­¿ô¤òɬÍפȤ¹¤ë¥ª¥×¥·¥ç¥ó¤Ë´Ø¤·¤Æ
+¤Ï¡¢Æ±¤¸¤â¤Î¤¬¥³¥Þ¥ó¥É¥é¥¤¥ó¤Ë¤â¸ºß¤¹¤ì¤Ð¡¢¥³¥Þ¥ó¥É¥é¥¤¥ó¤ÎÊý¤¬Í¥À褵
+¤ì¤ë¡£
+.RB $ MANOPT
+¤ËÀßÄꤵ¤ì¤¿¥ª¥×¥·¥ç¥ó¤ò¤¹¤Ù¤Æ¥ê¥»¥Ã¥È¤¹¤ë¤Ë¤Ï¡¢¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó
+¤ÎºÇ½é¤Ë
+.B \-D
+¤ò»ØÄꤹ¤ì¤Ð¤è¤¤¡£
+¤³¤ì¤Ë¤è¤Ã¤Æ
+.B man
+¤Ï°ì»þŪ¤Ë
+.RB $MANOPT
+¤ÎÆâÍƤò¡Ö˺¤ì¤ë¡×¤¬¡¢´Ä¶­ÊÑ¿ô¤ÎÆâÍƼ«ÂΤÏÍ­¸ú¤Ê¤Þ¤Þ»Ä¤ë¡£
+.B man_db
+¥Ñ¥Ã¥±¡¼¥¸¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£·²¤ÎÆ°ºî¤Ï¡¢
+.B index
+¥Ç¡¼¥¿¥Ù¡¼¥¹¥­¥ã¥Ã¥·¥å¤Ë¤è¤Ã¤Æ¡¢Èó¾ï¤Ë¸úΨ²½¤µ¤ì¤Æ¤¤¤ë¡£
+¤³¤ì¤é¤Î¥­¥ã¥Ã¥·¥å¤Ë¤Ï¡¢³Æ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤Ç¤Î°ÌÃÖ¤È
+¤½¤Î¥Ú¡¼¥¸¤Î
+.I whatis
+(¤½¤Î¥Ú¡¼¥¸¤ÎÍ×Ìó) ¤¬ÊÝ»ý¤µ¤ì¤Æ¤¤¤ë¡£
+.B man
+¤Î»Å»ö¤Î°ì¤Ä¤Ï¡¢¤³¤Î¥­¥ã¥Ã¥·¥å¤ÎÀ°¹çÀ­¤òÊݾڤ¹¤ë¤³¤È¤Ç¤¢¤ë¡£
+¤³¤ì¤Þ¤ÇÍѤ¤¤é¤ì¤Æ¤¤¤¿
+.I whatis
+¥Æ¥­¥¹¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ç¤Ï¡¢¼êÆ°¤Ç¥½¥Õ¥È¥¦¥§¥¢¤òÆ°ºî¤µ¤»¤Æ¹¹¿·ºî¶È¤ò¹Ô¤¦
+ɬÍפ¬¤¢¤Ã¤¿¤ï¤±¤À¤¬¡¢¤³¤Î¿·¤·¤¤¥Ç¡¼¥¿¥Ù¡¼¥¹¥­¥ã¥Ã¥·¥å¤Ë¤è¤Ã¤Æ¡¢¤³¤ì¤Ï
+ɬÍפʤ¯¤Ê¤Ã¤¿¡£¤Þ¤¿¡¢Ëè²ó¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ò¸¡º÷¤·¤ÆɬÍפʥޥ˥奢¥ë¥Ú¡¼
+¥¸¤òõ¤¹É¬Íפ¬¤Ê¤¯¤Ê¤Ã¤¿¤Î¤Ç¡¢
+.B man
+¤ÎÆ°ºî¤¬Â®¤¯¤Ê¤Ã¤¿¡£
+
+¸¡º÷ÂоݤȤʤäƤ¤¤ë¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸³¬ÁØ (hierarchy) ¤Ë¡¢
+.B mandb
+¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿
+.B index
+¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬Â¸ºß¤·¤Ê¤¤¾ì¹ç¤Ç¤â¡¢
+.B man
+¤ÏÍ׵ᤵ¤ì¤¿¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¸¡º÷¤ò³¤±¤ë¡£¤¿¤À¤·¤½¤Î³¬ÁؤÎÃæ¤Ç¤Ï
+¥Õ¥¡¥¤¥ë̾¤ÎŸ³« (glob) ¤¬É¬ÍפȤʤ롣
+.\"`User' manual page hierarchies will have
+.\".B index
+.\"caches created `on the fly'.
+.B whatis
+¤ä
+.B apropos
+¤¬
+.B index
+¤ò¸«¤Ä¤±¤é¤ì¤Ê¤¤¾ì¹ç¡¢¤½¤ì¤é¤Ï½¾Íè·Á¼°¤Î
+.I whatis
+¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÂå¤ï¤ê¤ËÍѤ¤¤Æ¡¢¤½¤³¤«¤é¾ðÊó¤ò°ú¤­¤À¤½¤¦¤È¤¹¤ë¡£
+`user' ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸³¬Áؤˤϡ¢¡Ö¤½¤Î¾ì¡×¤ÇÀ¸À®¤µ¤ì¤¿
+.B index
+¥­¥ã¥Ã¥·¥å¤¬´Þ¤Þ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¤À¤í¤¦¡£
+
+¤³¤ì¤é¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ç¤Ï¡¢°µ½Ì¤µ¤ì¤¿ nroff ¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤â°·¤¦¤³¤È
+¤¬¤Ç¤­¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢³ÈÄ¥»Ò¤¬
+.BR .Z ", " .z ", " .gz
+¤Î¥Õ¥¡¥¤¥ë¤¬ÍøÍѤǤ­¤ë¡£
+Ǥ°Õ¤Î°µ½Ì³ÈÄ¥»Ò¤ò°·¤¦¤³¤È¤¬¤Ç¤­¤ë¤¬¡¢
+¤³¤Î¾ðÊó¤Ï¥³¥ó¥Ñ¥¤¥ë»þ¤ËÍ¿¤¨¤Ê¤¯¤Æ¤Ï¤Ê¤é¤Ê¤¤¡£
+¤Þ¤¿¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢À¸À®¤µ¤ì¤¿ cat ¥Ú¡¼¥¸¤Ï¤¹¤Ù¤Æ
+.B gzip
+¤òÍѤ¤¤Æ°µ½Ì¤µ¤ì¤ë¡£
+.I /usr/man
+¤ä
+.I /usr/X11R6/man
+¤Î¤è¤¦¤Ê¡¢ `global' ¤Ê¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸³¬ÁؤǤϡ¢
+Âбþ¤¹¤ë cat ¥Ú¡¼¥¸³¬ÁؤȤ·¤ÆÊ̤Υǥ£¥ì¥¯¥È¥ê¤ò»È¤¦¤³¤È¤¬¤Ç¤­¤ë¡£
+½¾Íè¤Ï¡¢ cat ¥Ú¡¼¥¸¤Ï man ¥Ú¡¼¥¸¤ÈƱ¤¸³¬ÁؤËÊݸ¤µ¤ì¤Æ¤¤¤¿¡£
+¤·¤«¤·
+.B "Linux File System Standard (FSSTND)"
+¤Ëµ­½Ò¤µ¤ì¤Æ¤¤¤ë¤è¤¦¤ÊÍýͳ¤«¤é¡¢ cat ¥Ú¡¼¥¸¤Ï¾¤Î¾ì½ê¤ËÃÖ¤¯Êý¤¬Îɤ¤
+¤«¤â¤·¤ì¤Ê¤¤¡£¤³¤¦¤·¤¿¤¤¾ì¹ç¤ÎÊýË¡¤Ë¤Ä¤¤¤Æ¤Ï¡¢
+.BR manpath (5)
+¤òÆɤó¤ÇÍߤ·¤¤¡£Íýͳ¤Ë´Ø¤·¤Æ¤Ï
+.B FSSTND
+ʸ½ñ¤ò»²¾È¤Î¤³¤È¡£
+
+¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ç¤Ï¡¢¹ñºÝ²½¤ò¥µ¥Ý¡¼¥È¤·¤Æ¤¤¤ë¡£
+.I locale
+¤Îµ¡Ç½¤òÍѤ¤¤ë¤³¤È¤Ë¤è¤Ã¤Æ¡¢Êì¹ñ¸ì¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë¥¢¥¯¥»
+¥¹¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë (¤â¤Á¤í¤ó¥·¥¹¥Æ¥à¤Ë¸ºß¤·¤Æ¤¤¤ì¤Ð¡¢¤Ç¤¢¤ë¤¬)¡£
+¤³¤Îµ¡Ç½¤òÍ­¸ú¤Ë¤¹¤ë¤Ë¤Ï¡¢
+.RB $ LC_MESSAGES ,
+.RB $ LANG
+¤Î¤¤¤º¤ì¤«¤«¡¢Â¾¤Î (¥·¥¹¥Æ¥à°Í¸¤Î) ´Ä¶­ÊÑ¿ô¤ò¡¢»ÈÍѤ·¤Æ¤¤¤ë
+¸À¸ì¤Î¥í¥±¡¼¥ë¤ËÀßÄꤹ¤ëɬÍפ¬¤¢¤ë¡£Ä̾ï¸À¸ì¥í¥±¡¼¥ë¤Ï
+.B POSIX 1003.1
+¤Ë´ð¤Å¤¤¤¿¥Õ¥©¡¼¥Þ¥Ã¥È¤Ç»ØÄꤹ¤ë:
+
+.\"
+.\" Need a \c to make sure we don't get a space where we don't want one
+.\"
+.RI < language >[\|\c
+.B _\c
+.RI < territory >\|[\|\c
+.B .\c
+.RI < character-set >\|[\|\c
+.B ,\c
+.RI < version >\|]\|]\|]
+
+Í׵ᤷ¤¿¥Ú¡¼¥¸¤ËÂФ·¤Æ¡¢»ÈÍѤ·¤Æ¤¤¤ë
+.I locale
+¤Î¤â¤Î¤¬Â¸ºß¤¹¤ì¤Ð¡¢¤½¤Î¥Ú¡¼¥¸¤¬É¸½à¤Î¥Ú¡¼¥¸ (Ä̾ï¤Ï¥¢¥á¥ê¥«±Ñ¸ì) ¤Î
+Âå¤ï¤ê¤Ëɽ¼¨¤µ¤ì¤ë¡£
+
+¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ç¤Ï¡¢¹ñºÝ²½¤µ¤ì¤¿¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤âÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¡¢
+¾åµ­¤ÈƱÍͤÎÊýË¡¤ÇÍ­¸ú¤Ë¤Ç¤­¤ë (¤â¤Á¤í¤ó¥«¥¿¥í¥°¤¬Â¸ºß¤¹¤ì¤Ð¡¢¤À¤¬)¡£
+¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤Ë¡¢¤¢¤Ê¤¿¤Î¥Í¥¤¥Æ¥£¥Ö¤Ê¸À¸ì¤ËÂбþ¤·¤¿¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸
+¤ä¥á¥Ã¥»¡¼¥¸¥«¥¿¥í¥°¤¬¤Ê¤¯¡¢¤³¤ì¤òÄɲä·¤¿¤¤¤È»×¤¦¿Í¤Ï¡¢Ãø¼Ô¤ËÏ¢Íí¤·¤Æ
+Íߤ·¤¤¡£¤³¤Î¤è¤¦¤ÊÅØÎϤò¤Þ¤È¤á¤¿¤¤¤È»×¤Ã¤Æ¤¤¤ë¡£
+
+¤³¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¥ã¡¼¤ÇÍѤ¤¤ë¤³¤È¤Î¤Ç¤­¤ë¡¢¤½¤Î¾¤Îµ¡Ç½¤ä³ÈÄ¥¤Ë¤Ä¤¤¤Æ¤Ï¡¢
+¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤ËÉÕ°¤·¤Æ¤¤¤ë¥É¥­¥å¥á¥ó¥È¤òÆɤó¤ÇÍߤ·¤¤¡£
+.SH ¥Ç¥Õ¥©¥ë¥È
+.B man
+¤Ï
+.I index
+¥Ç¡¼¥¿¥Ù¡¼¥¹¥­¥ã¥Ã¥·¥å¤ò¸¡º÷¤·¤Æ¡¢Í׵ᤵ¤ì¤¿¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò¸«¤Ä¤±¤è
+¤¦¤È¤¹¤ë¡£¤³¤ì¤Ë¼ºÇÔ¤¹¤ë¤È¡¢¥­¥ã¥Ã¥·¥å¤ÎÀ°¹çÀ­¤Î¥Á¥§¥Ã¥¯¤¬¹Ô¤ï¤ì¡¢¥Ç¡¼
+¥¿¥Ù¡¼¥¹¤¬¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¤ÈÀµ¤·¤¯Âбþ¤·¤Æ¤¤¤ë¤³¤È¤ò³Îǧ¤¹¤ë¡£
+ºÇ½é¤Ë¥­¥ã¥Ã¥·¥å¤òÀ¸À®¤·¤¿¤¢¤È¤Ï¡¢Ä̾ï
+.B mandb
+¤ò¼Â¹Ô¤¹¤ëɬÍפϤʤ¤ (¤¿¤À¤·¥­¥ã¥Ã¥·¥å¤¬²õ¤ì¤¿¾ì¹ç¤ÏÊ̤Ǥ¢¤ë)¡£
+
+¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î°ÌÃÖ¤¬¤ï¤«¤Ã¤¿¤é¡¢¤³¤ì¤ËÂФ·¤Æ¤¹¤Ç¤ËÀ°·ÁºÑ¤ß¤Î `cat'
+¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë¤«¤É¤¦¤«¡¢¤³¤ì¤¬ nroff ¥Õ¥¡¥¤¥ë¤è¤ê¤â¿·¤·¤¤¤«¤É¤¦¤«
+¤¬¥Á¥§¥Ã¥¯¤µ¤ì¤ë¡£Î¾Êý¤È¤â¿¿¤Ç¤¢¤ë¾ì¹ç¤Ï¡¢¤³¤ÎÀ°·ÁºÑ¤ß¥Õ¥¡¥¤¥ë¤¬ (Ä̾ï
+¤Ï) ¿­Ä¹¤µ¤ì¤Æ¤«¤é¥Ú¡¼¥¸¥ã¡¼¤Çɽ¼¨¤µ¤ì¤ë¡£¥Ú¡¼¥¸¥ã¡¼¤Ï¿§¡¹¤ÊÊýË¡¤Ç»ØÄê
+¤Ç¤­¤ë¡£²¿¤â»ØÄꤷ¤Ê¤±¤ì¤Ð¥Ç¥Õ¥©¥ë¥È¤Î¤â¤Î¤¬ÍѤ¤¤é¤ì¤ë (¾ÜºÙ¤Ï¥ª¥×¥·¥ç¥ó
+.B \-P
+¤ÎÉôʬ¤ò»²¾È¤Î¤³¤È)¡£
+cat ¤¬¤Ê¤¤¾ì¹ç¡¢¤¢¤ë¤¤¤Ï nroff ¥Õ¥¡¥¤¥ë¤è¤ê¤â¸Å¤¤¾ì¹ç¤Ï¡¢ nroff ¤¬¤¤¤í
+¤¤¤í¤Ê¥Õ¥£¥ë¥¿¥×¥í¥°¥é¥à¤ÇÀ°·Á¤µ¤ì¤Æ¤«¤é¡¢¤½¤Î¾ì¤Çɽ¼¨¤µ¤ì¤ë¡£
+
+cat ¥Õ¥¡¥¤¥ë¤¬ºîÀ®¤Ç¤­¤ë (Âбþ¤¹¤ë cat ¥Ç¥£¥ì¥¯¥È¥ê¤¬Â¸ºß¤·¤Æ¤¤¤Æ¡¢½ñ
+¤­¹þ¤ß¸¢¸Â¤¬¤¢¤ë) ¾ì¹ç¤Ë¤Ï¡¢
+.B man
+¤Ï¥Ð¥Ã¥¯¥°¥é¥¦¥ó¥É¤Ç cat ¥Õ¥¡¥¤¥ë¤ò°µ½Ì¤·¤ÆÊݸ¤¹¤ë¡£
+
+¥Õ¥£¥ë¥¿¤Ï¤¤¤í¤¤¤í¤ÊÊýË¡¤Ç»ØÄê¤Ç¤­¤ë¡£¤Þ¤º¡¢¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó
+.B \-p
+¤Þ¤¿¤Ï´Ä¶­ÊÑ¿ô
+.RB $ MANROFFSEQ
+¤Ë¤è¤ë»ØÄ꤬¤Ç¤­¤ë¡£
+.B \-p
+¥ª¥×¥·¥ç¥ó¤â´Ä¶­ÊÑ¿ô¤â»ØÄꤵ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç¤Ï¡¢nroff ¥Õ¥¡¥¤¥ë¤ÎÀèƬ¹Ô¤¬¥×¥ê
+¥×¥í¥»¥Ã¥µÊ¸»úÎó (preprocessor string) ¤È¤·¤Æ²ò¼á¤µ¤ì¤ë¡£¥×¥ê¥×¥í¥»¥Ã
+¥µÊ¸»úÎó¤È¤·¤ÆÍ­¸ú¤Ê¤â¤Î¤Ç¤¢¤ë¤¿¤á¤Ë¤Ï¡¢ÀèƬ¹Ô¤Ï°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤Ê¤±
+¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
+
+.B '\e"
+.RB < string >
+
+¤³¤³¤Ç
+.B string
+¤Ï¡¢°Ê²¼¤Î
+.B \-p
+¥ª¥×¥·¥ç¥ó¤Î¹àÌܤǵ­½Ò¤µ¤ì¤Æ¤¤¤ëʸ»ú¤ÎǤ°Õ¤ÎÁȤ߹ç¤ï¤»¤Ç¤¢¤ë¡£
+
+¾åµ­¤Î¤¤¤º¤ì¤Î¼êË¡¤âÍѤ¤¤é¤ì¤º¡¢¥Õ¥£¥ë¥¿¤Î¾ðÊó¤¬Í¿¤¨¤é¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ï¡¢
+¥Ç¥Õ¥©¥ë¥È¤Î¥Õ¥£¥ë¥¿·²¤¬ÍѤ¤¤é¤ì¤ë¡£
+
+À°·Á¥×¥í¥»¥¹¤Î¥Ñ¥¤¥×¥é¥¤¥ó¤Ï¡¢¥Õ¥£¥ë¥¿·²¤È´ðËÜÀ°·Á¥×¥í¥°¥é¥à
+.RB ( nroff
+¤Þ¤¿¤Ï
+.RB [ tg ] roff
++ ¥ª¥×¥·¥ç¥ó
+.B \-t)
+¤Ë¤è¤Ã¤Æ¹½À®¤µ¤ì¡¢¤³¤ì¤¬¼Â¹Ô¤µ¤ì¤ë¡£
+¤¢¤ë¤¤¤Ï¡¢¼Â¹Ô²Äǽ¤Ê¥×¥í¥°¥é¥à
+.I mandb_nfmt
+(¤Þ¤¿¤Ï
+.B \-t
+¥ª¥×¥·¥ç¥ó¤Î»ÈÍÑ»þ¤Ë¤Ï
+.I mandb_tfmt
+)
+¤¬ man ³¬Áإĥ꡼¤Î¥ë¡¼¥È¤Ë¤¢¤ë¾ì¹ç¤Ï¡¢¤³¤ì¤¬Âå¤ï¤ê¤Ë¼Â¹Ô¤µ¤ì¤ë¡£
+¤³¤Î¥×¥í¥°¥é¥à¤Ï¥Þ¥Ë¥å¥¢¥ë¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤È¥×¥ê¥×¥í¥»¥Ã¥µÊ¸»úÎó¤È¤ò
+°ú¤­¿ô¤Ë¼è¤ë¡£¾Êά²Äǽ¤Ç¤¢¤ë¤¬
+.B \-T
+¤Ë¤è¤ë¥Ç¥Ð¥¤¥¹»ØÄê¤ò¹Ô¤¦¤³¤È¤â¤Ç¤­¤ë¡£
+.\" ********************************************************************
+.SH ¥ª¥×¥·¥ç¥ó
+°ú¤­¿ô¤ò¼è¤é¤Ê¤¤¥ª¥×¥·¥ç¥ó¤Ï¡¢¥³¥Þ¥ó¥É¥é¥¤¥ó¡¢
+.RB $ MANOPT
+´Ä¶­ÊÑ¿ô¤Î¤É¤Á¤é¤Ç¤Ç¤â»ØÄê¤Ç¤­¤ë¡£¤¢¤ë¤¤¤Ï¤½¤ÎξÊý¤Ç»ØÄꤷ¤Æ¤â¤«¤Þ¤ï¤Ê¤¤¡£
+°ú¤­¿ô¤ò¤È¤ë¥ª¥×¥·¥ç¥ó¤¬½Å¤Ê¤Ã¤¿¾ì¹ç¤Ï¡¢
+¸å¤«¤é»ØÄꤵ¤ì¤¿¤â¤Î¤¬Í¥À褵¤ì¤ë¡£
+.TP
+.B \-l, \-\-local-file
+`local' ¥â¡¼¥É¤òÍ­¸ú¤Ë¤¹¤ë¡£¥·¥¹¥Æ¥à¤Î¥Þ¥Ë¥å¥¢¥ë¤ò
+¸¡º÷¤¹¤ëÂå¤ï¤ê¤Ë¡¢¥í¡¼¥«¥ë¤Ê¥Þ ¥Ë¥å¥¢¥ë¥Õ¥¡¥¤¥ë¤òÀ°·Á¤·¤Æɽ¼¨¤¹¤ë¡£
+¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î°ú¤­¿ô¤Ï¡¢Àµ¤·¤¤¥Õ¥©¡¼¥Þ¥Ã¥È¤ò»ý¤Ã¤¿
+nroff ¤Î¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤Ç¤¢¤ë¤È¤ß¤Ê¤µ¤ì¤ë¡£
+.\" Compressed nroff source files with a supported compression.
+.\" extension will be decompressed by man prior to being displaying via the
+.\" usual filters.
+cat ¥Õ¥¡¥¤¥ë¤ÏÀ¸À®¤µ¤ì¤Ê¤¤¡£ `\-' ¤¬°ú¤­¿ô¤Ë»ØÄꤵ¤ì¤¿¾ì¹ç¤Ï¡¢
+ɸ½àÆþÎϤ«¤éÆþÎϤ¬Í¿¤¨¤é¤ì¤ë¤È¤ß¤Ê¤µ¤ì¤ë¡£
+.TP
+.BI \-L\ locale ,\ \-\-locale= locale
+.B man
+¤ÏÄ̾¸½ºß¤Î¥í¥±¡¼¥ë¤ò C ´Ø¿ô
+.BR setlocale (3)
+¤ò¸Æ¤Ö¤³¤È¤Ë¤è¤Ã¤Æ·èÄꤷ¤è¤¦¤È¤¹¤ë¡£¤³¤Î´Ø¿ô¤ÎÆ°ºî¤Ï¡¢Î㤨¤Ð
+.RB $ LC_MESSAGES
+¤ä
+.RB $ LANG
+¤Ê¤É¤Î¤è¤¦¤Ê¡¢ÍÍ¡¹¤Ê´Ä¶­ÊÑ¿ô¤Ë¤è¤Ã¤Æ±Æ¶Á¤µ¤ì¤ë¡£
+¤³¤ÎÃͤò°ì»þŪ¤Ë¾å½ñ¤­¤¹¤ë¤Ë¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»È¤Ã¤Æ
+.B man
+¤ËľÀÜ
+.I locale
+ʸ»úÎó¤òÅϤ»¤ÐÎɤ¤¡£
+¤³¤Î¥ª¥×¥·¥ç¥ó¤¬¸úÎϤò»ý¤Ä¤Î¤Ï¡¢¼ÂºÝ¤Î¥Ú¡¼¥¸¤Î¸¡º÷¤¬»Ï¤Þ¤Ã¤Æ¤«¤é¤Ç¤¢¤ë
+¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£¥Ø¥ë¥×¥á¥Ã¥»¡¼¥¸¤Ê¤É¤Î½ÐÎϤϡ¢µ¯Æ°Á°¤ËÄê¤Þ¤Ã¤Æ¤¤¤¿
+¥í¥±¡¼¥ë¤Ç½ÐÎϤµ¤ì¤ë¡£
+.TP
+.B \-D, \-\-default
+¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢Ä̾ïÀèƬ¤Ë»ØÄꤷ¤Æ¡¢
+.B man
+¤Î¤Õ¤ë¤Þ¤¤¤ò¥Ç¥Õ¥©¥ë¥È¤Ë¥ê¥»¥Ã¥È¤¹¤ë¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤ÎÌÜŪ¤Ï¡¢
+.RB $ MANOPT
+¤Ç»ØÄꤵ¤ì¤Æ¤¤¤ë¤«¤â¤·¤ì¤Ê¤¤¥ª¥×¥·¥ç¥ó¤ò¥ê¥»¥Ã¥È¤¹¤ë¤³¤È¤Ç¤¢¤ë¡£
+¤³¤Î
+.B \-D
+°Ê¹ß¤Ë»ØÄꤵ¤ì¤¿¥ª¥×¥·¥ç¥ó¤Ï¡¢Ä̾ïÄ̤ê¤Î¸ú²Ì¤ò»ý¤Ä¡£
+.TP
+.BI \-M\ path ,\ \-\-manpath= path
+Ä̾ï¤ÎÂå¤ï¤ê¤ËÍѤ¤¤ë manpath ¤ò»ØÄꤹ¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢
+.B man
+¤Ï¸¡º÷¥Ñ¥¹¤Î·èÄê¤Ë
+.B manpath
+ͳÍè¤Î¥³¡¼¥É¤òÍѤ¤¤Æ¤¤¤ë¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï¡¢
+.RB $ MANPATH
+´Ä¶­ÊÑ¿ô¤ò¾å½ñ¤­¤¹¤ë¡£¤Þ¤¿¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢
+.B \-m
+¥ª¥×¥·¥ç¥ó¤Ï̵»ë¤µ¤ì¤ë¡£
+.TP
+.BI \-P\ pager ,\ \-\-pager= pager
+½ÐÎϤËÍѤ¤¤ë¥Ú¡¼¥¸¥ã¡¼¤ò»ØÄꤹ¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢
+.B man
+¤Ï
+.BR "exec /usr/bin/pager \-s"
+¤òÍѤ¤¤ë¡£
+¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï
+.RB $ PAGER
+´Ä¶­ÊÑ¿ô¤ò¾å½ñ¤­¤¹¤ë¡£¤Þ¤¿¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï
+.B \-f
+¤ä
+.B \-k
+¤ÈƱ»þ¤ËÍѤ¤¤ë¤³¤È¤Ï¤Ç¤­¤Ê¤¤¡£
+.TP
+.BI \-r\ prompt ,\ \-\-prompt= prompt
+¥Ú¡¼¥¸¥ã¤È¤·¤ÆºÇ¶á¤ÎÈǤÎ
+.B less
+¤¬ÍѤ¤¤é¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢
+.B man
+¤Ï
+.B less
+¤Î¥×¥í¥ó¥×¥È¤ä¥ª¥×¥·¥ç¥ó¤òÀßÄꤷ¤è¤¦¤È¤¹¤ë¡£
+¥Ç¥Õ¥©¥ë¥È¤Ï°Ê²¼¤Î¤è¤¦¤Ê¤â¤Î¤Ç¤¢¤ë¡£
+
+.B \ Manual page\c
+.IB \ name ( sec )\c
+.BI \ line \ x
+
+¤³¤³¤Ç
+.I name
+¤Ï¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î̾Á°¡¢
+.I sec
+¤Ï¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤¬¸«¤Ä¤«¤Ã¤¿¥»¥¯¥·¥ç¥ó¡¢
+.I x
+¤Ï¸½ºß¤Î¹ÔÈÖ¹æ¤Ç¤¢¤ë¡£
+.\"The default options are
+.\".BR \-six8 .
+.\"The actual default will depend on your chosen
+.\".BR locale .
+¥Ç¥Õ¥©¥ë¥È¤Î¥ª¥×¥·¥ç¥ó¤Ï
+.B \-six8
+¤Ç¤¢¤ë¡£¤³¤ì¤Ï´Ä¶­ÊÑ¿ô
+.RB $ LESS
+¤òÄ̤·¤ÆÀßÄꤵ¤ì¤ë¡£¼ÂºÝ¤Î¥Ç¥Õ¥©¥ë¥È¤Ï
+.B locale
+¤ÎÁªÂò¤Ë°Í¸¤¹¤ë¡£
+
+.\"You may need to do this if your
+.\"version of
+.\".B less
+.\"rejects the default options or if you prefer a different prompt.
+¥ª¥×¥·¥ç¥ó
+.B \-r
+¤Çʸ»úÎó¤ò»ØÄꤹ¤ë¤È¡¢¥Ç¥Õ¥©¥ë¥È¤ò¾å½ñ¤­¤Ç¤­¤ë¡£
+»ÈÍѤ·¤Æ¤¤¤ë
+.B less
+¤¬¥Ç¥Õ¥©¥ë¥È¤Î¥ª¥×¥·¥ç¥ó¤ò¼õ¤±ÉÕ¤±¤Ê¤«¤Ã¤¿¤ê¡¢
+¥×¥í¥ó¥×¥È¤òÊѹ¹¤·¤¿¤¤¾ì¹ç¤Ë¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ëɬÍפ¬¤¢¤ë¤À¤í¤¦¡£
+ʸ»úÎó¤Ë
+.B $MAN_PN
+¤È¤¤¤¦¥Æ¥­¥¹¥È¤òÆþ¤ì¤ë¤È¡¢¸½ºß¤Î¥Þ¥Ë¥å¥¢¥ë̾¤È¡¢¥»¥¯¥·¥ç¥ó¤ò
+`(' ¤È `)' ¤Ç³ç¤Ã¤¿¤â¤Î¤È¤ËŸ³«¤µ¤ì¤ë¡£
+¥Ç¥Õ¥©¥ë¥È¤Î½ÐÎϤȤʤë¤è¤¦¤Êʸ»úÎó¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ëɽ¸½¤Ç¤­¤ë¡£
+
+.B \e\ Manual\e\ page\e\ \e$MAN_PN\e\ ?ltline\e\ %lt?L/%L.:
+.br
+.B byte\e\ %bB?s/%s..?\e\ (END):?pB\ %pB\e\e%..
+
+¤³¤³¤ÇÆó¹Ô¤Ëʬ³ä¤µ¤ì¤Æ¤¤¤ë¤Î¤Ï¡¢Ã±¤Ë²ÄÆÉÀ­¤Î¤¿¤á¤Ç¤¢¤ë¡£¤³¤ì¤é¤Î°ÕÌ£¤Ë
+´Ø¤·¤Æ¤Ï
+.BR less (1)
+¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò¸«¤ë¤³¤È¡£¤³¤Î¥×¥í¥ó¥×¥Èʸ»úÎó¤Ï¡¢¤Þ¤º¥·¥§¥ë¤Ë¤è¤Ã¤Æ
+²ò¼á¤µ¤ì¤ë¡£
+¥×¥í¥ó¥×¥ÈÃæ¤Ë¸ºß¤¹¤ë¥À¥Ö¥ë¥¯¥©¡¼¥È¡¢¥Ð¥Ã¥¯¥¯¥©¡¼¥È¡¢¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å
+¤Ï¡¢¤¹¤Ù¤Æ¥Ð¥Ã¥¯¥¹¥é¥Ã¥·¥å¤òÁ°ÃÖ¤·¤Æ¥¨¥¹¥±¡¼¥×¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¥×¥í¥ó¥×
+¥Èʸ»úÎó¤Ï¥¨¥¹¥±¡¼¥×¤µ¤ì¤¿ $ ¤Ç½ª¤ï¤ê¡¢¤³¤ì°Ê¹ß¤Ï less ¤ËÍ¿¤¨¤ëÄɲåª
+¥×¥·¥ç¥ó¤Ë¤Ê¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢
+.B man
+¤Ï
+.B \-ix8
+¤ò¥ª¥×¥·¥ç¥ó¤È¤·¤Æ»ØÄꤹ¤ë¡£
+.TP
+.B \-7, \-\-ascii
+½ã¿è¤Ê
+.IR ascii (7)
+¥³¡¼¥É¤Çµ­½Ò¤µ¤ì¤¿¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò 7 ¥Ó¥Ã¥ÈüËö (¤äüËö¥¨¥ß¥å¥ì¡¼¥¿)
+¤ÇÆɤà¾ì¹ç¡¢
+.B "GNU nroff"
+¤Î
+.IR latin1 (7)
+¥Ç¥Ð¥¤¥¹É½¼¨¤òÍѤ¤¤ë¤È¡¢Ê¸»ú¤Ë¤è¤Ã¤Æ¤ÏÀµ¤·¤¯É½¼¨¤µ¤ì¤Ê¤¤²ÄǽÀ­¤¬¤¢¤ë¡£
+¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤È¡¢½ã¿è¤Ê
+.I ascii
+¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò¡¢
+.I latin1
+¥Ç¥Ð¥¤¥¹¤Ç¤â
+.I ascii
+¤Çɽ¼¨¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
+¤³¤ì¤Ï
+.I latin1
+¥Æ¥­¥¹¥È¤ÏÊÑ´¹¤·¤Ê¤¤¡£°Ê²¼¤Îɽ¤Ë¡¢¹Ô¤ï¤ì¤ëÊÑ´¹¤ÎÍͻҤò
+¼¨¤¹¡£
+
+.TS
+tab (@);
+l c c c.
+Description@Octal@latin1@ascii
+_
+continuation hyphen@255@\[char173]@-
+bullet (middle dot)@267@\(bu@o
+acute accent@264@\(aa@'
+multiplication sign@327@\(mu@x
+.\"
+.\"Ϣ³¥Ï¥¤¥Õ¥ó@255@\[char173]@-
+.\"ÃæÅÀ (bullet)@267@\(bu@o
+.\"¥¢¥­¥å¡¼¥È¥¢¥¯¥»¥ó¥È@264@\(aa@'
+.\"ÀÑÉä¹æ@326@\(mu@x
+.TE
+
+.I latin1
+¥«¥é¥à¤Îɽ¼¨¤¬Àµ¤·¤¤¾ì¹ç¤Ï¡¢¤¢¤Ê¤¿¤¬¸½ºß»È¤Ã¤Æ¤¤¤ëüËö¤Ï
+.I latin1
+ʸ»ú¸þ¤±¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¤Î¤Ç¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ÏɬÍפʤ¤¡£
+.I latin1
+¤È
+.I ascii
+¥«¥é¥à¤¬Æ±°ì¤Ç¤¢¤ë¾ì¹ç¤Ï¡¢¤¢¤Ê¤¿¤Ï¸½ºß¤³¤Î¥Ú¡¼¥¸¤ò¤³¤Î¥ª¥×¥·¥ç¥ó¤Ç
+¸«¤Æ¤¤¤ë¤«¡¢¤¢¤ë¤¤¤Ï
+.B man
+¤¬¤³¤Î¥Ú¡¼¥¸¤ÎÀ°·Á¤Ë
+.I latin1
+¥Ç¥Ð¥¤¥¹¤Î»ØÄê¤òÍѤ¤¤Æ¤¤¤Ê¤¤¤³¤È¤Ë¤Ê¤ë¡£
+.I latin1
+¥«¥é¥à¤¬¶õ¤Ç¤¢¤ë¤«¡¢ÊѤÊɽ¼¨¤Ë¤Ê¤Ã¤Æ¤¤¤ë¾ì¹ç¤Ï¡¢¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò¸«¤ë
+¾ì¹ç¤Ë¤Ï¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¡£
+
+¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï
+.BR \-t ", " \-T ", " \-Z
+¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤Æ¤¤¤ë¾ì¹ç¤Ï̵»ë¤µ¤ì¤ë¡£¤Þ¤¿
+.B GNU
+°Ê³°¤Î
+.B nroff
+¤òÍѤ¤¤Æ¤¤¤ë¾ì¹ç¤â¡¢¤ª¤½¤é¤¯»ØÄꤹ¤ë°ÕÌ£¤Ï¤Ê¤¤¡£
+.TP
+.BI \-S\ list ,\ \-\-sections= list
+°ú¤­¿ô
+.I list
+¤Ë¤Ï¡¢¸¡º÷ÂоݤȤ¹¤ë¥»¥¯¥·¥ç¥ó¤ò¥³¥í¥ó¶èÀÚ¤ê¤Ç»ØÄꤹ¤ë¡£¸¡º÷¤Ï
+»ØÄꤷ¤¿½ç½ø¤Ç¤Ê¤µ¤ì¤ë¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï
+.RB $ MANSECT
+´Ä¶­ÊÑ¿ô¤ò¾å½ñ¤­¤¹¤ë¡£
+.TP
+.B \-a, \-\-all
+¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï
+.B man
+¤Ï¸¡º÷¤Ç¸«¤Ä¤«¤Ã¤¿¥Ú¡¼¥¸¤Î¤¦¤Á¡¢¤â¤Ã¤È¤âŬÀÚ¤ÈȽÃǤ·¤¿¤â¤Î¤ò°ì¤Ä¤À¤±
+ɽ¼¨¤·¤Æ½ªÎ»¤¹¤ë¡£¤³¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤ë¤È¡¢
+.B man
+¤Ï¸¡º÷¾ò·ï¤Ë¥Þ¥Ã¥Á¤¹¤ë̾Á°¤ò»ý¤Ä¤¹¤Ù¤Æ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤òɽ¼¨¤¹¤ë¡£
+.TP
+.B \-c, \-\-catman
+¤³¤Î¥ª¥×¥·¥ç¥ó¤ÏÄ̾ï¤ÎÍÑÅÓ¤ÇÍѤ¤¤ë¤â¤Î¤Ç¤Ï¤Ê¤¤¡£
+.B catman
+¥×¥í¥°¥é¥à¤Ë¤è¤Ã¤Æ¤Î¤ßÍѤ¤¤é¤ì¤ë¡£
+.TP
+.B \-d, \-\-debug
+¼ÂºÝ¤Ë¤Ï¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤òɽ¼¨¤»¤º¡¢Âå¤ï¤ê¤ËÂçÎ̤ΥǥХå°¾ðÊó¤ò½ÐÎϤ¹
+¤ë¡£
+.TP
+.BI \-e\ sub-extension ,\ \-\-extension= sub-extension
+(Î㤨¤Ð
+.B Tcl
+¤Ê¤É¤¬¤½¤¦¤À¤¬)
+¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ¤Ï¡¢Â礭¤Ê¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥Ñ¥Ã¥±¡¼¥¸¤ò¡¢
+¥á¥¤¥ó¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸³¬Áؤ˥¤¥ó¥¹¥È¡¼¥ë¤¹¤ë¤è¤¦¤Ê¤â¤Î¤¬¤¢¤ë¡£
+Ʊ¤¸Ì¾Á°¤Î¥Ú¡¼¥¸ (Î㤨¤Ð
+.BR exit (3)
+¤Ê¤É) ¤¬Æó¤Ä¸ºß¤·¤Æ¤·¤Þ¤¦¤³¤È¤òÈò¤±¤ë¤¿¤á¤Ë¡¢Ä̾ï
+.B Tcl
+¤Î¥Ú¡¼¥¸¤Ï
+.B l
+¤È¤¤¤¦¥»¥¯¥·¥ç¥ó¤Ë³ä¤êÅö¤Æ¤é¤ì¤Æ¤¤¤¿¡£
+¤³¤ì¤Ï˾¤Þ¤·¤¯¤Ê¤¤¤Î¤Ç¡¢¥Ú¡¼¥¸¤òÀµ¤·¤¤¥»¥¯¥·¥ç¥ó¤ËÆþ¤ì¡¢¤½¤ì¤é¤ËÆÃÄê¤Î
+¡Ö³ÈÄ¥¡×¤òÄɲ乤뤳¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£Î㤨¤Ð¤³¤Î¾ì¹ç¤Ê¤é
+.BR exit (3tcl)
+¤Î¤è¤¦¤Ë¤Ê¤ë¡£
+Ä̾ï¤ÎÆ°ºî¤Ç¤Ï¡¢
+.B man
+¤Ï
+.BR exit (3)
+¤ò
+.BR exit (3tcl)
+¤è¤êÍ¥À褷¤Æɽ¼¨¤¹¤ë¡£
+¤³¤Î¾õ¶·¤ò¤¦¤Þ¤¯½èÍý¤·¡¢ÌÜŪ¤È¤¹¤ë¥Ú¡¼¥¸¤¬¤É¤Î¥»¥¯¥·¥ç¥ó¤Ë¤¢¤ë¤Î¤«¤ò¤¤¤Á¤¤¤Á
+µ­²±¤·¤Æ¤ª¤«¤Ê¤¯¤Æ¤â¤¹¤à¤è¤¦¤Ë¡¢
+.B man
+¤Ë
+.I sub-extension
+ʸ»úÎó¤òÍ¿¤¨¤ë¤³¤È¤¬¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£¤³¤Îʸ»úÎó¤Ï¡¢¥Ú¡¼¥¸¤¬
+½ê°¤¹¤ë¥Ñ¥Ã¥±¡¼¥¸¤ò»ØÄꤹ¤ë¤â¤Î¤Ç¤¢¤ë¡£¾åµ­¤ÎÎã¤Ê¤é¡¢¥ª¥×¥·¥ç¥ó¤È¤·¤Æ
+.B \-e\ tcl
+¤ò
+.B man
+¤ËÍ¿¤¨¤ì¤Ð¡¢¸¡º÷ÂоݤȤ¹¤ë¥Ú¡¼¥¸¤Ï³ÈÄ¥»Ò¤¬
+.B *tcl
+¤Î¤â¤Î¤Ë¸Â¤é¤ì¤ë¤è¤¦¤Ë¤Ê¤ë¡£
+.TP
+.B \-f, \-\-whatis
+.B whatis
+¤ÈÅù²Á¡£»ØÄꤷ¤¿¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¥¬Â¸ºß¤¹¤ì¤Ð¡¢¤½¤Î¥Ú¡¼¥¸¤ÎÍ×Ìóʸ¤òɽ¼¨¤¹¤ë¡£
+¾ÜºÙ¤Ï
+.BR whatis (1)
+¤ò¸«¤è¡£
+.TP
+.B \-h, \-\-help
+¥Ø¥ë¥×¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Æ½ªÎ»¤¹¤ë¡£
+.TP
+.B \-k, \-\-apropos
+.B apropos
+¤ÈÅù²Á¡£ keyword ¤Ç¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÎÍ×Ìóʸ¤ò¸¡º÷¤·¡¢
+¥Þ¥Ã¥Á¤·¤¿¤â¤Î¤ò¤¹¤Ù¤Æɽ¼¨¤¹¤ë¡£
+¾ÜºÙ¤Ï
+.BR apropos (1)
+¤ò¸«¤è¡£
+.\"
+.\" Due to the rather silly limit of 6 args per request in some `native'
+.\" *roff compilers, we have do the following to get the two-line
+.\" hanging tag on one line. .PP to begin a new paragraph, then the
+.\" tag, then .RS (start relative indent), the text, finally .RE
+.\" (end relative indent).
+.\"
+.PP
+.B \-m
+.I system\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= system\c
+\|[\|,.\|.\|.\|]
+.RS
+¸½ºß¤Î¥·¥¹¥Æ¥à¤«¤é¡¢Â¾¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Ë¤Ä¤¤¤Æ¤Î¥Þ¥Ë¥å¥¢¥ë¤Ë
+¥¢¥¯¥»¥¹¤Ç¤­¤ë¾ì¹ç¤Ë¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤ë¤È¤½¤ì¤é¤Î¥Þ¥Ë¥å¥¢¥ë¤¬
+¸¡º÷¤µ¤ì¤ë¡£
+NewOS ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò¸¡º÷¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢
+.B \-m
+.B NewOS
+¤Î¤è¤¦¤Ê¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¡£
+
+.I system
+¤Ë¤ÏÊ£¿ô¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤ò¥³¥ó¥Þ¤Ç¶èÀڤä¿·Á¼°¤Ç»ØÄê¤Ç¤­¤ë¡£
+¥Í¥¤¥Æ¥£¥Ö¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò
+¸¡º÷¤ÎÂоݤ˴ޤá¤ë¤¿¤á¤Ë¤Ï¡¢¥·¥¹¥Æ¥à̾
+.B man
+¤ò°ú¤­¿ôʸ»úÎó¤Ë²Ã¤¨¤ë¡£
+¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï
+.RB $ SYSTEM
+´Ä¶­ÊÑ¿ô¤ò¾å½ñ¤­¤¹¤ë¡£
+.RE
+.TP
+.BI \-p\ string ,\ \-\-preprocessor= string
+.B nroff
+¤Þ¤¿¤Ï
+.BR troff / groff
+¤ÎÁ°¤Ë¼Â¹Ô¤¹¤ë¥×¥ê¥×¥í¥»¥Ã¥µ¤Î¥·¡¼¥±¥ó¥¹¤ò»ØÄꤹ¤ë¡£
+¤¹¤Ù¤Æ¤Î¥¤¥ó¥¹¥È¡¼¥ë´Ä¶­¤Ç¡¢°Ê²¼¤¹¤Ù¤Æ¤Î¥×¥ê¥×¥í¥»¥Ã¥µ¤¬»È¤¨¤ë¤ï¤±¤Ç¤Ï¤Ê¤¤¡£
+¥×¥ê¥×¥í¥»¥Ã¥µ¤È¡¢¤½¤ì¤ò»ØÄꤹ¤ëʸ»ú¤Î¤¤¤¯¤Ä¤«¤ò°Ê²¼¤Ëµó¤²¤ë¡£
+.BR eqn " (" e ),
+.BR grap " (" g ),
+.BR pic " (" p ),
+.BR tbl " (" t ),
+.BR vgrind " (" v ),
+.BR refer " (" r )
+¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï
+.RB $ MANROFFSEQ
+´Ä¶­ÊÑ¿ô¤ò¾å½ñ¤­¤¹¤ë¡£
+.B zsoelim
+¤Ï¡¢¾ï¤Ë¾¤Î¥×¥ê¥×¥í¥»¥Ã¥µ¤¹¤Ù¤Æ¤ËÀèΩ¤Ã¤Æ¼Â¹Ô¤µ¤ì¤ë¡£
+.TP
+.B \-u, \-\-update
+.B index
+¥Ç¡¼¥¿¥Ù¡¼¥¹¥­¥ã¥Ã¥·¥å¤Ï¡¢Ä̾ï¡Ö¤½¤Î¾ì¡×¤Ç¹¹¿·¤µ¤ì¤ë¡£¤Ä¤Þ¤ê¡¢¥­¥ã¥Ã¥·¥å
+¤ÎÀ°¹çÀ­¤òÊݤĤ¿¤á¤Ë
+.B mandb
+¤òÄê´üŪ¤Ë¼Â¹Ô¤¹¤ëɬÍפϤʤ¤¡£¤â¤·ÁªÂò¤·¤¿¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤¬
+¥­¥ã¥Ã¥·¥å¤Ë¸ºß¤·¤Ê¤«¤Ã¤¿¾ì¹ç¤ä¡¢
+.B \-a
+¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤¿¾ì¹ç¤Ë¤Ï¡¢
+.B man
+¤Ï¡Ö¥Ç¥£¥ì¥¯¥È¥ê¥ì¥Ù¥ë¡×¤Ç¤ÎÀ°¹çÀ­¥Á¥§¥Ã¥¯¤ò¹Ô¤¤¡¢¥­¥ã¥Ã¥·¥å¤¬¥Õ¥¡¥¤¥ë
+¥·¥¹¥Æ¥à¤òÀµ¤·¤¯È¿±Ç¤·¤¿¤â¤Î¤Ë¤Ê¤Ã¤Æ¤¤¤ë¤³¤È¤ò³Îǧ¤¹¤ë¡£
+¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¸¡º÷¤ËÀèΩ¤Á¡¢¡Öi\-¥Î¡¼¥É¥ì¥Ù¥ë¡×¤Ç¤ÎÀ°¹çÀ­¥Á¥§¥Ã¥¯
+¤ò¹Ô¤¤¤¿¤¤¾ì¹ç¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó
+.B \-u
+¤ò»ØÄꤹ¤ë¡£
+.TP
+.B \-t, \-\-troff
+¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÎÀ°·Á¤È¡¢É¸½à½ÐÎϤؤÎɽ¼¨¤Ë
+.I "/usr/bin/groff -mandoc"
+¤òÍѤ¤¤ë¡£
+.B \-T
+¤ä
+.B \-Z
+¥ª¥×¥·¥ç¥ó¤Î»ØÄê»þ¤Ë¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ëɬÍפϤʤ¤¡£
+.PP
+.BI \-T\ device ,\ \-\-troff-device
+.RI [\| =device \|]
+.RS
+¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï
+.B groff
+(¤¢¤ë¤¤¤Ï¾¤Î
+.BR troff )
+¤Î½ÐÎϤò¡¢¥Ç¥Õ¥©¥ë¥È¤«¤éÍѤ¤¤ë¥Ç¥Ð¥¤¥¹¤Ë¤¢¤ï¤»¤ÆÊѹ¹¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£
+.B \-t
+¤¬°ÅÌۤΤ¦¤Á¤Ë»ØÄꤵ¤ì¤ë¡£Îã¤È¤·¤Æ¤Ï (Groff-1.09 ¤Ç¤Î¤â¤Î)¡¢
+.BR dvi ", " latin1 ", " X75 ", " X100
+¤Ê¤É¤¬µó¤²¤é¤ì¤ë¡£
+.RE
+.TP
+.B \-Z, \-\-ditroff
+.B groff
+¤Ï
+.B troff
+¤ò¼Â¹Ô¤·¡¢¤½¤Î¸åŬÀڤʥݥ¹¥È¥×¥í¥»¥Ã¥µ¤òÍѤ¤¤ÆÁªÂò¤·¤¿¥Ç¥Ð¥¤¥¹¤Ë±þ¤¸¤¿
+½ÐÎϤòÀ¸À®¤¹¤ë¡£¤â¤·
+.I "/usr/bin/groff -mandoc"
+¤¬
+.B groff
+¤Ç¤¢¤ë¤Ê¤é¤Ð¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï
+.B groff
+¤ËÅϤµ¤ì¤Æ¡¢¥Ý¥¹¥È¥×¥í¥»¥Ã¥µ¤ÎÍøÍѤòÍÞÀ©¤¹¤ë¡£
+.B \-t
+¤¬°ÅÌۤΤ¦¤Á¤Ë»ØÄꤵ¤ì¤ë¡£
+.TP
+.B \-w, \-\-where, \-\-location
+¼ÂºÝ¤Ë¤Ï¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤òɽ¼¨¤»¤º¡¢À°·Á¡¦É½¼¨¤µ¤ì¤ë¤³¤È¤Ë¤Ê¤ë¥Õ¥¡¥¤¥ë
+¤Î°ÌÃÖ¤òɽ¼¨¤¹¤ë¡£Ê£¿ô¤Î¥Õ¥¡¥¤¥ë¤¬É½¼¨¤µ¤ì¤ë¤³¤È¤â¤¢¤ë¡£¥Õ¥¡¥¤¥ë¤¬ cat
+¥Õ¥¡¥¤¥ë¤Î¾ì¹ç¤Ï¡¢¥½¡¼¥¹¤Ç¤¢¤ë nroff ¥Õ¥¡¥¤¥ë¤Î°ÌÃÖ¤âɽ¼¨¤µ¤ì¤ë¡£
+.TP
+.B \-V, \-\-version
+¥Ð¡¼¥¸¥ç¥ó¤ÈÃø¼Ô¤Ë´Ø¤¹¤ë¾ðÊó¤òɽ¼¨¤¹¤ë¡£
+.SH ÊÖ¤êÃÍ
+.TP
+.B 0
+¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤ËÀ®¸ù¤·¤¿¡£
+.TP
+.B 1
+»ÈÍÑË¡¡¢Ê¸Ë¡¡¢ÀßÄê¥Õ¥¡¥¤¥ë¤Î¤¤¤º¤ì¤«¤Ë¥¨¥é¡¼¤¬¤¢¤ë¡£
+.TP
+.B 2
+¼Â¹Ô»þ¥¨¥é¡¼¡£
+.TP
+.B 3
+»Ò¥×¥í¥»¥¹¤ÎÊÖ¤êÃͤ¬Èó¥¼¥í¤À¤Ã¤¿¡£
+.TP
+.B 16
+¾¯¤Ê¤¯¤È¤â¡¢¥Ú¡¼¥¸¡¢¥Õ¥¡¥¤¥ë¡¢¥­¡¼¥ï¡¼¥É¤Î¤É¤ì¤«°ì¤Ä¤¬Â¸ºß¤·¤Ê¤¤¤«¡¢¥Þ¥Ã
+¥Á¤·¤Ê¤«¤Ã¤¿¡£
+.SH ´Ä¶­ÊÑ¿ô
+.\".TP \w'MANROFFSEQ\ \ 'u
+.TP
+.B MANPATH
+.RB $ MANPATH
+¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¤½¤ÎÃͤ¬¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¸¡º÷¥Ñ¥¹¤È¤·¤ÆÍÑ
+¤¤¤é¤ì¤ë¡£
+.TP
+.B MANROFFSEQ
+.RB $ MANROFFSEQ
+¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¤½¤ÎÃͤϳơ¹¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò½èÍý
+¤¹¤ë¥×¥ê¥×¥í¥»¥Ã¥µ¤Î¥»¥Ã¥È¤òÄêµÁ¤¹¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Î¥×¥ê¥×¥í¥»¥Ã¥µ¤Î
+¥»¥Ã¥È
+¤Ï¥·¥¹¥Æ¥à¤Ë¤è¤Ã¤Æ°Û¤Ê¤ë¡£
+.TP
+.B MANSECT
+.RB $ MANSECT
+¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¤½¤ÎÃͤϥ»¥¯¥·¥ç¥ó¤Î¥ê¥¹¥È (¥³¥í¥ó¶èÀÚ¤ê) ¤È
+¤·¤Æ°·¤ï¤ì¡¢¥Þ¥Ë¥å¥¢¥ë¤Î¤É¤Î¥»¥¯¥·¥ç¥ó¤ò¸¡º÷¤¹¤ë¤«¤ò·èÄꤹ¤ëºÝ¤ËÍѤ¤¤é
+¤ì¤ë¡£¥»¥¯¥·¥ç¥ó¤Ï»ØÄꤵ¤ì¤¿½ç½ø¤Ç¸¡º÷¤µ¤ì¤ë¡£
+.TP
+.B PAGER
+.RB $ PAGER
+¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¤½¤ÎÃͤ¬¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤òɽ¼¨¤¹¤ë¥×¥í¥°¥é¥à
+¤Î̾Á°¤È¤·¤ÆÍѤ¤¤é¤ì¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï
+.B "exec /usr/bin/pager -s"
+¤¬ÍѤ¤¤é¤ì¤ë¡£
+.TP
+.B SYSTEM
+.RB $ SYSTEM
+´Ä¶­ÊÑ¿ô¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢
+.B \-m "string"
+¥ª¥×¥·¥ç¥ó¤ÈƱ¤¸¸ú²Ì¤ò»ý¤Ä¡£ string ¤¬
+.RB $ SYSTEM
+¤ÎÆâÍƤǤ¢¤ë¡£
+.TP
+.B MANOPT
+.RB $ MANOPT
+¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¤½¤ÎÆâÍƤ¬
+.B man
+¤Î¥³¥Þ¥ó¥É¥é¥¤¥ó¤ËÀèΩ¤Ã¤Æ²ò¼á¤µ¤ì¤ë¡£·Á¼°¤Ï¥³¥Þ¥ó¥É¥é¥¤¥ó¤Î¤â¤Î¤ÈƱ¤¸
+¤Ç¤¢¤ë¡£
+.B man
+¤Ë±Æ¶Á¤¹¤ë¾¤Î¤¹¤Ù¤Æ¤Î´Ä¶­ÊÑ¿ô¤Ë¤Ï¡¢Æ±¤¸¸ú²Ì¤ò»ý¤Ä¥³¥Þ¥ó¥É¥é¥¤¥ó¥ª¥×¥·¥ç¥ó
+¤¬Â¸ºß¤·¡¢¤·¤¿¤¬¤Ã¤Æ
+.RB $ MANOPT
+¤Ëµ­½Ò¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¤Î¤Ç¡¢¤³¤ì¤é¤Î´Ä¶­ÊÑ¿ô¤Ï¤¤¤º¤ì»ÈÍѤµ¤ì¤Ê¤¯¤Ê¤ë
+¤À¤í¤¦¡£
+¥ª¥×¥·¥ç¥ó¤Î°ú¤­¿ô¤Î°ìÉô¤È¤·¤Æ²ò¼á¤µ¤»¤¿¤¤¤¹¤Ù¤Æ¤Î¥¹¥Ú¡¼¥¹¤Ï¡¢¥¨¥¹¥±¡¼¥×
+¤¹¤ëɬÍפ¬¤¢¤ë¤³¤È¤ËÃí°Õ¤¹¤ë¤³¤È¡£
+.TP
+.BR LANG , " LC_MESSAGES"
+¥·¥¹¥Æ¥à¤È¼ÂÁõ¤Ë°Í¸¤¹¤ë¤¬¡¢
+¥á¥Ã¥»¡¼¥¸¥í¥±¡¼¥ë¤Î»ØÄê¤Ë¤Ï
+.RB $ LANG
+¤È
+.RB $ LC_MESSAGES
+¤Î¤É¤Á¤é¤«°ìÊý¡¢¤¢¤ë¤¤¤ÏξÊý¤¬ÍѤ¤¤é¤ì¤ë¡£
+.B man
+¤¬½ÐÎϤ¹¤ë¥á¥Ã¥»¡¼¥¸¤Ë¤Ï¡¢(²Äǽ¤Ê¤é) ¤½¤Î¥í¥±¡¼¥ë¤¬»ÈÍѤµ¤ì¤ë¡£
+Àµ³Î¤ÊÆâÍƤÏ
+.BR setlocale (3)
+¤ò¸«¤è¡£
+.SH ¥Õ¥¡¥¤¥ë
+.TP
+.I /etc/manpath.config
+man_db ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¡£
+.TP
+.I /usr/man
+global ¤Ê¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î³¬ÁØ¡£
+.TP
+.I /usr/man/index.(bt|db|dir|pag)
+½¾Íè·Á¼°¤Î¡¢ global ¤Ê
+.I index
+¥Ç¡¼¥¿¥Ù¡¼¥¹¥­¥ã¥Ã¥·¥å¡£
+.TP
+.I /var/catman/index.(bt|db|dir|pag)
+¿·¤·¤¤ (FSSTND ½àµò¤Î)¡¢ global ¤Ê
+.I index
+¥Ç¡¼¥¿¥Ù¡¼¥¹¥­¥ã¥Ã¥·¥å¡£
+.TP
+.I /usr/man/mandb_nfmt
+ÆÃÄê¤Î³¬ÁؤËÀìÍѤÎÀ°·Á¥¹¥¯¥ê¥×¥È¤òÍÑ°Õ¤¹¤ëÎã¡£
+.B nroff
+¥Ù¡¼¥¹¤Î¤â¤Î¤Ë¤Ê¤Ã¤Æ¤¤¤ë¡£
+.TP
+.I /usr/man/mandb_tfmt
+ÆÃÄê¤Î³¬ÁؤËÀìÍѤÎÀ°·Á¥¹¥¯¥ê¥×¥È¤òÍÑ°Õ¤¹¤ëÎã¡£
+.RB [ tg ] roff
+.B \-t
+¥ª¥×¥·¥ç¥ó¤¬»ØÄꤵ¤ì¤¿¤È¤­¤ËÍѤ¤¤é¤ì¤ë¡£
+.SH ´ØÏ¢¹àÌÜ
+.BR mandb (8),
+.BR manpath (1),
+.BR manpath (5),
+.BR apropos (1),
+.BR whatis (1),
+.BR catman (8),
+.BR less (1),
+.BR nroff (1),
+.BR troff (1),
+.BR groff (1),
+.BR zsoelim (1),
+.BR setlocale (3),
+.BR ascii (7),
+.BR latin1 (7),
+.B FSSTND
+.SH ÍúÎò
+1990, 1991 \- ¥ª¥ê¥¸¥Ê¥ë¤ÎÃø¼Ô¤Ï John W. Eaton (jwe@che.utexas.edu) ¤Ç
+¤¢¤Ã¤¿¡£
+
+Dec 23 1992: Rik Faith (faith@cs.unc.edu) ¤¬ Willem Kasdorp
+(wkasdo@nikhefk.nikef.nl) ¤Î¥Ð¥°¥Õ¥£¥Ã¥¯¥¹¤òÅö¤Æ¤¿¡£
+
+April 30th, 1994 \- July 12th 1995:
+Wilf. (G.Wilford@ee.surrey.ac.uk) ¤¬²¿¿Í¤«¤Î¿Í¡¹¤Î½õÎϤΤâ¤È¡¢
+¤³¤Î¥Ñ¥Ã¥±¡¼¥¸¤ò³«È¯¡¦Êݼ餷¤Æ¤¤¤ë¡£
diff --git a/man/ja_JP.ujis/man1/manpath.man1 b/man/ja_JP.ujis/man1/manpath.man1
new file mode 100644
index 00000000..60ef55e0
--- /dev/null
+++ b/man/ja_JP.ujis/man1/manpath.man1
@@ -0,0 +1,115 @@
+.\" Man page for manpath
+.\"
+.\" Copyright (C), 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the COPYING file that comes with the
+.\" man_db distribution.
+.\"
+.\" Sun Jan 22 22:15:17 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
+.\" Translated Fri 25 Sep 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\" Modified Sun 6 Dec 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\"
+.\"WORD: hierarchy ³¬ÁØ
+.\"
+.TH manpath 1 "July 12th, 1995" "2.3.10" "Manual pager utils"
+.SH ̾Á°
+manpath \- ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¸¡º÷¥Ñ¥¹¤ò·èÄꤹ¤ë
+.SH ½ñ¼°
+.B manpath
+.RB [\| \-qgdc \|]
+.RB [\| \-m
+.IR system \|[\|,.\|.\|.\|]\|]
+.SH ÀâÌÀ
+.B manpath
+¤Ï¡¢´Ä¶­ÊÑ¿ô
+.RB $ MANPATH
+¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¤½¤ÎÆâÍƤòɽ¼¨¤·¤Æ·Ù¹ð¤ò½Ð¤¹¡£
+¤½¤ì°Ê³°¤Î¾ì¹ç¤Ë¤Ï¡¢¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸³¬ÁØ (hierarchy)
+¤Î¸¡º÷¥Ñ¥¹¤òŬÀڤ˷èÄꤷ¤Æ¡¢¤½¤Î·ë²Ì¤òɽ¼¨¤¹¤ë¡£
+
+¥³¥í¥ó¤Ç¶èÀÚ¤é¤ì¤¿¥Ñ¥¹¤Î¥ê¥¹¥È¤¬¡¢
+man_db ¤ÎÀßÄê¥Õ¥¡¥¤¥ë
+.RI ( "/etc/manpath.config" )
+¤È¡¢¥æ¡¼¥¶¡¼¤Î´Ä¶­¤È¤«¤é·èÄꤵ¤ì¤ë¡£
+.SH ¥ª¥×¥·¥ç¥ó
+.TP
+.B \-q, \-\-quiet
+·Ù¹ð¤òɽ¼¨¤·¤Ê¤¤¡£
+.TP
+.B \-d, \-\-debug
+¥Ç¥Ð¥Ã¥°¾ðÊó¤òÀ¸À®¤¹¤ë¡£
+.TP
+.B \-c, \-\-catpath
+.\"??
+manpath ¤ËÂФ·¤Æ catpath ¤òÀ¸À®¤¹¤ë¡£
+¤Þ¤º manpath ¤ò·èÄꤷ¤Æ¡¢¤½¤ì¤Ë´Þ¤Þ¤ì¤ë¥Ñ¥¹Í×ÁǤò¡¢
+¤½¤ì¤¾¤ìÂбþ¤¹¤ë catpath ¤ËÊÑ´¹¤¹¤ë¡£
+.TP
+.B \-g, \-\-global
+man_db ¤ÎÀßÄê¥Õ¥¡¥¤¥ëÃæ¤Ç¡¢ `global' ¤È¤¤¤¦Ì¾Á°¤¬¤Ä¤¤¤Æ¤¤¤ë¤â¤Î¤ò
+¤¹¤Ù¤Æ´Þ¤ó¤À manpath ¤òÀ¸À®¤¹¤ë¡£
+.\"
+.\" Due to the rather silly limit of 6 args per request in some `native'
+.\" *roff compilers, we have do the following to get the two-line
+.\" hanging tag on one line. .PP to begin a new paragraph, then the
+.\" tag, then .RS (start relative indent), the text, finally .RE
+.\" (end relative indent).
+.\"
+.PP
+.B \-m
+.I system\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= system\c
+\|[\|,.\|.\|.\|]
+.RS
+¸½ºß¤Î¥·¥¹¥Æ¥à¤«¤é¡¢Â¾¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Ë¤Ä¤¤¤Æ¤Î¥Þ¥Ë¥å¥¢¥ë
+³¬Áؤ˥¢¥¯¥»¥¹¤Ç¤­¤ë¾ì¹ç¤Ë¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤ì¤Ð¤½¤ì¤é¤¬
+.BR manpath
+¤Î½ÐÎϤ˴ޤޤì¤ë¡£
+Î㤨¤Ð NewOS ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸³¬Áؤò¸¡º÷¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢
+.B \-m
+.B NewOS
+¤Î¤è¤¦¤Ê¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ì¤Ð¤è¤¤¡£
+
+.I system
+¤Ë¤ÏÊ£¿ô¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤ò¥³¥ó¥Þ¤Ç¶èÀڤä¿·Á¼°¤Ç»ØÄê¤Ç¤­¤ë¡£
+¥Í¥¤¥Æ¥£¥Ö¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸³¬Áؤò
+´Þ¤Þ¤»¤ë¾ì¹ç¤Ï¡¢¥·¥¹¥Æ¥à̾¤È¤·¤Æ
+.B man
+¤ò°ú¤­¿ôʸ»úÎó¤Ë²Ã¤¨¤ëɬÍפ¬¤¢¤ë¡£
+¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï
+.BR $ SYSTEM
+´Ä¶­ÊÑ¿ô¤ò¾å½ñ¤­¤¹¤ë¡£
+.RE
+.TP
+.B \-h, \-\-help
+¥Ø¥ë¥×¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Æ½ªÎ»¤¹¤ë¡£
+.TP
+.B \-V, \-\-version
+¥Ð¡¼¥¸¥ç¥ó¤ÈÃø¼Ô¤Ë´Ø¤¹¤ë¾ðÊó¤òɽ¼¨¤¹¤ë¡£
+.SH ´Ä¶­ÊÑ¿ô
+.TP
+.B SYSTEM
+.RB $ SYSTEM
+´Ä¶­ÊÑ¿ô¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¤½¤ÎÆâÍƤ¬
+.B \-m
+¥ª¥×¥·¥ç¥ó¤Î°ú¤­¿ô¤È¤·¤Æ»ØÄꤵ¤ì¤¿¾ì¹ç¤ÈƱ¤¸¸úÎϤò»ý¤Ä¡£
+.TP
+.B MANPATH
+.RB $ MANPATH
+¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢
+.B manpath
+¤Ï¤½¤ÎÃͤòɽ¼¨¤·¡¢¸¡º÷¥Ñ¥¹¤ò¤½¤Î¾ì¤Ç·èÄꤹ¤ë¤³¤È¤Ï¤·¤Ê¤¤¡£
+.SH ¥Õ¥¡¥¤¥ë
+.TP \w'/etc/manpath.config'u+2n
+.I /etc/manpath.config
+¥·¥¹¥Æ¥à¤ÎÀßÄê¥Õ¥¡¥¤¥ë¡£
+.SH ´ØÏ¢¹àÌÜ
+.BR apropos (1),
+.BR whatis (1),
+.BR man (1)
+.SH Ãø¼Ô
+Wilf. (G.Wilford@ee.surrey.ac.uk)
diff --git a/man/ja_JP.ujis/man1/whatis.man1 b/man/ja_JP.ujis/man1/whatis.man1
new file mode 100644
index 00000000..7d8f0fe7
--- /dev/null
+++ b/man/ja_JP.ujis/man1/whatis.man1
@@ -0,0 +1,183 @@
+.\" Man page for whatis
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
+.\" Translated Fri 25 Sep 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\" Modified Sun 6 Dec 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\"
+.\"WORD: hierarchy ³¬ÁØ
+.\"WORD: description Í×Ìó(ʸ)
+.\"
+.TH whatis 1 "July 12th, 1995" "2.3.10" "Manual pager utils"
+.SH ̾Á°
+whatis \- ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ÎÍ×Ìó¤òɽ¼¨¤¹¤ë
+.SH ½ñ¼°
+.RB [\| \-dhV \|]
+.RB [\| \-r \||\| \-w\c
+\|]
+.RB [\| \-m
+.IR system \|[\|,.\|.\|.\|]\|]
+.RB [\| \-M
+.IR path \|]
+.I name
+\&.\|.\|.
+.SH ÀâÌÀ
+¤½¤ì¤¾¤ì¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ë¤Ï¡¢ÀèƬ¤Ëû¤¤Í×Ìóʸ¤¬½ñ¤«¤ì¤Æ¤¤¤ë¡£
+.B whatis
+¤Ï¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î̾Á°¤ò¸¡º÷¤·¡¢
+.I name
+¤Ë¥Þ¥Ã¥Á¤·¤¿¤¹¤Ù¤Æ¤Î¥Þ¥Ë¥å¥¢¥ë¤«¤é¡¢¤³¤ÎÍ×Ìóʸ¤ò¼è¤ê½Ð¤·¤Æɽ¼¨¤¹¤ë¡£
+
+.I name
+¤Ë¤Ï¥ï¥¤¥ë¥É¥«¡¼¥É
+.RB ( \-w )
+¤äÀµµ¬É½¸½
+.RB ( \-r )
+¤òÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
+¤³¤ì¤é¤Î¥ª¥×¥·¥ç¥ó¤òÍѤ¤¤¿ºÝ¤Ë¤Ï¡¢
+.I name
+¤ò¥¯¥©¡¼¥È¤¹¤ë¤«¡¢Æü쥭¥ã¥é¥¯¥¿¤ò¥¨¥¹¥±¡¼¥× (\\) ¤·¤Æ¡¢
+¥·¥§¥ë¤Ë¤è¤Ã¤Æ²ò¼á¤µ¤ì¤Ê¤¤¤è¤¦¤Ë¤¹¤ëɬÍפ¬¤¢¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
+
+.B index
+¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬¸¡º÷¤ÎºÝ¤ËÍѤ¤¤é¤ì¤ë¡£¸Å¤¤¥¹¥¿¥¤¥ë¤Î
+.B whatis
+¥Æ¥­¥¹¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¡¢Âбþ¤¹¤ë
+.B index
+¥Ç¡¼¥¿¥Ù¡¼¥¹¤«¤éºî¤ê¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢°Ê²¼¤Î¤è¤¦¤Ê¥³¥Þ¥ó¥É¤ò¼Â¹Ô¤¹¤ì¤Ð¤è¤¤¡£
+
+.B whatis \-M
+.I manpath
+.B \-w '*' | sort >
+.I manpath/whatis
+
+¤³¤³¤Ç
+.I manpath
+¤Ë¤Ï
+.I /usr/man
+¤Î¤è¤¦¤Ê¡¢¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î³¬ÁØ (hierarchy) ¤ò»ØÄꤹ¤ë¡£
+.SH ¥ª¥×¥·¥ç¥ó
+.TP
+.B \-d, \-\-debug
+¥Ç¥Ð¥Ã¥°¾ðÊó¤òɽ¼¨¤¹¤ë¡£
+.TP
+.B \-r, \-\-regex
+.I name
+¤òÀµµ¬É½¸½¤È¤·¤Æ²ò¼á¤¹¤ë¡£
+.I name
+¤¬¥Ú¡¼¥¸Ì¾¤Î°ìÉôʬ¤Ë¥Þ¥Ã¥Á¤¹¤ì¤Ð¡¢¥Þ¥Ã¥Á¤·¤¿¤È¤ß¤Ê¤µ¤ì¤ë¡£
+¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¸¡º÷¤ÎÀ­¼Á¾å¡¢
+.B whatis
+¤ÎÆ°ºî¤¬Â¿¾¯ÃÙ¤¯¤Ê¤ë¡£
+.TP
+.B \-w, \-\-wildcard
+.I name
+¤ò¥·¥§¥ë·Á¼°¤Î¥ï¥¤¥ë¥É¥«¡¼¥É¤ò´Þ¤à¥Ñ¥¿¡¼¥ó¤È¤·¤Æ²ò¼á¤¹¤ë¡£
+¥Þ¥Ã¥Á¤¹¤ë¤¿¤á¤Ë¤Ï¡¢Å¸³«¤µ¤ì¤¿
+.I name
+¤¬¥Ú¡¼¥¸Ì¾¤ÎÁ´ÂΤ˥ޥåÁ¤·¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
+¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¸¡º÷¤ÎÀ­¼Á¾å¡¢
+.B whatis
+¤ÎÆ°ºî¤¬Â¿¾¯ÃÙ¤¯¤Ê¤ë¡£
+.\"
+.\" Due to the rather silly limit of 6 args per request in some `native'
+.\" *roff compilers, we have do the following to get the two-line
+.\" hanging tag on one line. .PP to begin a new paragraph, then the
+.\" tag, then .RS (start relative indent), the text, finally .RE
+.\" (end relative indent).
+.\"
+.PP
+.B \-m
+.I system\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= system\c
+\|[\|,.\|.\|.\|]
+.RS
+¸½ºß¤Î¥·¥¹¥Æ¥à¤«¤é¡¢Â¾¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Ë¤Ä¤¤¤Æ¤Î¥Þ¥Ë¥å¥¢¥ë¤Ë
+¥¢¥¯¥»¥¹¤Ç¤­¤ë¾ì¹ç¤Ë¤Ï¡¢¤³¤Î¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤ë¤È¤½¤ì¤é¤Î¥Þ¥Ë¥å¥¢¥ë¤¬
+¸¡º÷¤µ¤ì¤ë¡£
+NewOS ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò¸¡º÷¤¹¤ë¾ì¹ç¤Ë¤Ï¡¢
+.B \-m
+.B NewOS
+¤Î¤è¤¦¤Ê¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¡£
+
+.I system
+¤Ë¤ÏÊ£¿ô¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤ò¥³¥ó¥Þ¤Ç¶èÀڤä¿·Á¼°¤Ç»ØÄê¤Ç¤­¤ë¡£
+¥Í¥¤¥Æ¥£¥Ö¤Î¥ª¥Ú¥ì¡¼¥Æ¥£¥ó¥°¥·¥¹¥Æ¥à¤Î
+¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸Ì¾¤ò¸¡º÷¤ÎÂоݤ˴ޤá¤ë¤¿¤á¤Ë¤Ï¡¢¥·¥¹¥Æ¥à̾
+.B man
+¤ò°ú¤­¿ôʸ»úÎó¤Ë²Ã¤¨¤ë¡£
+¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï
+.RB $ SYSTEM
+´Ä¶­ÊÑ¿ô¤ò¾å½ñ¤­¤¹¤ë¡£
+.RE
+.TP
+.BI \-M\ path ,\ \-\-manpath= path
+¸¡º÷Âоݤˤ¹¤ë¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î³¬ÁؤòÊѤ¨¤¿¤¤¾ì¹ç¡¢¤½¤ì¤é¤ò¥³¥í¥ó¤Ç
+¶èÀڤä¿·Á¼°¤Ç»ØÄꤹ¤ë¡£
+¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢
+.B whatis
+¤Ï´Ä¶­ÊÑ¿ô
+.RB $ MANPATH
+¤òÍѤ¤¤ë¡£¤³¤ì¤¬¶õ¤À¤Ã¤¿¤êÀßÄꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢
+.RB $ PATH
+´Ä¶­ÊÑ¿ô¤Ë´ð¤Å¤¤¤Æ¡¢Å¬ÀÚ¤Ê manpath ¤ò·è¤á¤è¤¦¤È»î¤ß¤ë¡£
+¤³¤Î¥ª¥×¥·¥ç¥ó¤Ï
+.RB $ MANPATH
+¤ÎÆâÍƤò¾å½ñ¤­¤¹¤ë¡£
+.TP
+.B \-h, \-\-help
+¥Ø¥ë¥×¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Æ½ªÎ»¤¹¤ë¡£
+.TP
+.B \-V, \-\-version
+¥Ð¡¼¥¸¥ç¥ó¤ÈÃø¼Ô¤Ë´Ø¤¹¤ë¾ðÊó¤òɽ¼¨¤¹¤ë¡£
+.SH ÊÖ¤êÃÍ
+.TP
+.B 0
+¥×¥í¥°¥é¥à¤Î¼Â¹Ô¤ËÀ®¸ù¤·¤¿¡£
+.TP
+.B 1
+»ÈÍÑË¡¡¢Ê¸Ë¡¡¢ÀßÄê¥Õ¥¡¥¤¥ë¤Î¤¤¤º¤ì¤«¤Ë¥¨¥é¡¼¤¬¤¢¤ë¡£
+.TP
+.B 2
+¼Â¹Ô»þ¥¨¥é¡¼¡£
+.TP
+.B 16
+»ØÄꤷ¤¿¥­¡¼¥ï¡¼¥É¤Ë¥Þ¥Ã¥Á¤¹¤ë¤â¤Î¤¬¸«¤Ä¤«¤é¤Ê¤«¤Ã¤¿¡£
+.SH ´Ä¶­ÊÑ¿ô
+.TP
+.B SYSTEM
+.RB $ SYSTEM
+´Ä¶­ÊÑ¿ô¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¤½¤ÎÆâÍƤ¬
+.B \-m
+¥ª¥×¥·¥ç¥ó¤Î°ú¤­¿ô¤È¤·¤Æ»ØÄꤵ¤ì¤¿¾ì¹ç¤ÈƱ¤¸¸úÎϤò»ý¤Ä¡£
+.TP
+.B MANPATH
+.RB $ MANPATH
+¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢¤½¤ÎÆâÍƤϡ¢¸¡º÷ÂоݤȤ¹¤ë¥Þ¥Ë¥å¥¢¥ë¤Î³¬Áؤò
+¥³¥í¥ó¤Ç¶èÀڤ俥ꥹ¥È¤È¤ß¤Ê¤µ¤ì¤ë¡£
+.SH ¥Õ¥¡¥¤¥ë
+.TP
+.I /usr/man/index.(bt|db|dir|pag)
+½¾Íè·Á¼°¤Î¡¢ global ¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹¥­¥ã¥Ã¥·¥å¤Î
+¥¤¥ó¥Ç¥Ã¥¯¥¹¡£
+.TP
+.I /var/catman/index.(bt|db|dir|pag)
+¿·¤·¤¤ (FSSTND ½àµò¤Î)¡¢ global ¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹¥­¥ã¥Ã¥·¥å¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¡£
+.TP
+.I /usr/man/\|.\|.\|.\|/whatis
+½¾Íè·Á¼°¤Î¡¢
+.B whatis
+¥Æ¥­¥¹¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¡£
+.SH ´ØÏ¢¹àÌÜ
+.BR apropos (1),
+.BR man (1)
+.SH Ãø¼Ô
+Wilf. (G.Wilford@ee.surrey.ac.uk)
diff --git a/man/ja_JP.ujis/man1/zsoelim.man1 b/man/ja_JP.ujis/man1/zsoelim.man1
new file mode 100644
index 00000000..5c0dc0ed
--- /dev/null
+++ b/man/ja_JP.ujis/man1/zsoelim.man1
@@ -0,0 +1,74 @@
+.\" Man page for zsoelim
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Dec 10 19:33:32 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
+.\" Translated Fri 25 Sep 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\" Modified Sun 6 Dec 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\"
+.TH zsoelim 1 "July 12th, 1995" "2.3.10" "Manual pager utils"
+.SH ̾Á°
+zsoelim \- roff ¤ÎÆþÎϤˤª¤±¤ë .so Ì¿Îá¤ò¼Â¹Ô¤¹¤ë¡£
+.SH ½ñ¼°
+.B zsoelim
+.RB [\| \-CVh \|]
+.RI [\| file
+\&.\|.\|.\|]
+.SH ÀâÌÀ
+.B zsoelim
+¤Ï
+.I file
+°ú¤­¿ô¤ÇÍ¿¤¨¤é¤ì¤¿¥Õ¥¡¥¤¥ë (²¿¤âÍ¿¤¨¤é¤ì¤Ê¤«¤Ã¤¿¾ì¹ç¤Ïɸ½àÆþÎÏ) ¤ò
+Æɤ߹þ¤ß¡¢°Ê²¼¤Î¤è¤¦¤Ê·Á¼°¤Î¹Ô¤òŸ³«¤¹¤ë¡£
+
+.B .so
+.RI <\| filename \|>
+
+¤³¤Î¤è¤¦¤ÊÌ¿Îá¹Ô¤Ï¡¢»ØÄꤵ¤ì¤¿
+.I filename
+¤ÎÆâÍƤÇÃÖ¤­Â夨¤é¤ì¤ë¡£»ØÄꤵ¤ì¤¿¥Õ¥¡¥¤¥ë¤¬¸«¤Ä¤«¤é¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢
+.B zsoelim
+¤Ï
+.I filename.ext
+¤È¤¤¤¦·Á¼°¤Î¥Õ¥¡¥¤¥ë¤òõ¤¹¡£¤³¤³¤Ç
+.I .ext
+¤Ï
+.BR .gz ", " .Z ", " .z
+¤Î¤É¤ì¤«¤Ç¤¢¤ë¡£
+¾¤Î·Á¼°¤Î³ÈÄ¥»Ò¤¬¥µ¥Ý¡¼¥È¤µ¤ì¤Æ¤¤¤ë¤³¤È¤â¤¢¤ë¡£
+¤³¤ì¤Ï¥³¥ó¥Ñ¥¤¥ë»þ¤Î»ØÄê¤Ë¤è¤ë¡£
+Ì¿Îá¤Ë¤è¤Ã¤Æ¸«¤Ä¤«¤Ã¤¿¥Õ¥¡¥¤¥ë¤¬°µ½Ì·Á¼°¤À¤Ã¤¿¾ì¹ç¤Ë¤Ï¡¢
+¤³¤Î¥Õ¥¡¥¤¥ë¤ÏŬÀÚ¤Ê¥×¥í¥°¥é¥à¤ÇŸ³«¤µ¤ì¡¢¤½¤Î½ÐÎϤ¬ÍѤ¤¤é¤ì¤ë¡£
+
+¤³¤Î¤è¤¦¤ÊÌ¿Îá¤Ç»²¾È¤µ¤ì¤¿¥Õ¥¡¥¤¥ë¤ò roff ¥×¥ê¥×¥í¥»¥Ã¥µ¤ËÅϤ·¤Æ
+Á°½èÍý¤ò¹Ô¤ï¤»¤ëºî¶È¤Ë¤Ï¡¢½¾Íè¤Ï
+.B soelim
+¤È¤¤¤¦¥×¥í¥°¥é¥à¤¬ÍѤ¤¤é¤ì¤¿¡£¤³¤ÎÆüì¤Ê¥Ð¡¼¥¸¥ç¥ó¤Ï¡¢
+°µ½Ì¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò¥µ¥Ý¡¼¥È¤·¤¿¤³¤È¤ÇÀ¸¤¸¤ëÌäÂê¤ò²óÈò¤¹¤ë¤¿¤á¤Ë½ñ¤«¤ì¤¿¡£¡£
+.SH ¥ª¥×¥·¥ç¥ó
+.TP
+.B \-C
+¤³¤Î¥Õ¥é¥°¤Ï¡¢Â¾¤Î
+.B zsoelim
+¥×¥í¥°¥é¥à¤È¤Î¸ß´¹À­¤Î¤¿¤á¤ËÍÑ°Õ¤µ¤ì¤Æ¤¤¤ë¡£¤³¤Î¥Õ¥é¥°¤ÎÌÜŪ¤Ï¡¢ .so ¤Ë
+¶õÇò°Ê³°¤Îʸ»ú¤¬Â³¤¤¤¿Ì¿Îá¤òÍ­¸ú¤Ë¤¹¤ë¤³¤È¤Ç¤¢¤ë¤¬¡¢
+¤³¤Î¥×¥í¥°¥é¥à¤Ç¤Ï¤½¤â¤½¤â¥Ç¥Õ¥©¥ë¥È¤ÎÆ°ºî¤Ê¤Î¤Ç¡¢Ã±¤Ë̵»ë¤µ¤ì¤ë¡£
+.TP
+.B \-h
+¥Ø¥ë¥×¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Æ½ªÎ»¤¹¤ë¡£
+.TP
+.B \-V
+¥Ð¡¼¥¸¥ç¥ó¤ÈÃø¼Ô¤Ë´Ø¤¹¤ë¾ðÊó¤òɽ¼¨¤¹¤ë¡£
+.SH ´ØÏ¢¹àÌÜ
+.BR nroff (1),
+.BR troff (1),
+.BR groff (1),
+.BR man (1).
+.SH Ãø¼Ô
+Wilf. (G.Wilford@ee.surrey.ac.uk)
diff --git a/man/ja_JP.ujis/man5/manpath.man5 b/man/ja_JP.ujis/man5/manpath.man5
new file mode 100644
index 00000000..e5c791b6
--- /dev/null
+++ b/man/ja_JP.ujis/man5/manpath.man5
@@ -0,0 +1,113 @@
+.\" Man page for format of the manpath.config data file
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
+.\" Translated Fri 25 Sep 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\" Modified Sun 6 Dec 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\"
+.\"WORD: hierarchy ³¬ÁØ
+.\"
+.TH manpath 5 "July 12th, 1995" "2.3.10" "/etc/manpath.config"
+.SH ̾Á°
+manpath \- /etc/manpath.config ¥Õ¥¡¥¤¥ë¤Î¥Õ¥©¡¼¥Þ¥Ã¥È
+.SH ÀâÌÀ
+manpath ÀßÄê¥Õ¥¡¥¤¥ë¤Ï¡¢¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥æ¡¼¥Æ¥£¥ê¥Æ¥£¤Ë¤è¤Ã¤ÆÍѤ¤¤é
+¤ì¤ë¡£¥æ¡¼¥¶¤Î manpath ¤ò¼Â¹Ô»þ¤Ëɾ²Á¤·¤¿¤ê¡¢¤É¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸³¬ÁØ
+(hierarchy) ¤¹¤Ê¤ï¤Á manpath ¤ò `global' ¤È¤·¤Æ°·¤¦¤«¤òȽÃǤ·¤¿¤ê¡¢
+¤É¤Î¥Ç¥£¥ì¥¯¥È¥ê¤ò cat ¥Õ¥¡¥¤¥ë¤òÊݴɤ¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤È¤·¤ÆÍѤ¤¤ë¤«¤ò
+·èÄꤷ¤¿¤ê¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£
+
+´Ä¶­ÊÑ¿ô
+.RB $ MANPATH
+¤¬¤¹¤Ç¤ËÀßÄꤵ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢ /etc/manpath.config ¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë
+¾ðÊó¤Ï¤½¤ì¤ò¾å½ñ¤­¤·¤Ê¤¤¡£
+.SH ¥Õ¥©¡¼¥Þ¥Ã¥È
+¸½ºß¤Î¤È¤³¤í¡¢°Ê²¼¤Î¥Õ¥£¡¼¥ë¥É¥¿¥¤¥×¤¬Ç§¼±¤µ¤ì¤ë¡£
+.TP
+.BI # \ comment
+¶õ¹Ô¤ä
+.B #
+¤Ç»Ï¤Þ¤ë¹Ô¤Ï¥³¥á¥ó¥È¤È¤ß¤Ê¤µ¤ì¡¢Ìµ»ë¤µ¤ì¤ë¡£
+.TP
+.BI MANDATORY_MANPATH \ manpath_element
+¤³¤Î·Á¼°¤Î¹Ô¤Ï¡¢¼«Æ°Åª¤ËÀ¸À®¤µ¤ì¤ë
+.RB $ MANPATH
+¤Ë¤Ïɬ¤º´Þ¤Þ¤ì¤Æ¤¤¤ë¤Ù¤­ manpath ¤ò¼¨¤¹¡£
+.I /usr/man
+¤Ê¤É¤¬Åµ·¿¤Ç¤¢¤ë¡£
+.TP
+.BI MANPATH_MAP \ path_element\ manpath_element
+¤³¤Î·Á¼°¤Î¹Ô¤Ï
+.RB $ PATH
+¤«¤é
+.RB $ MANPATH
+¤Ø¤Î¥Þ¥Ã¥Ô¥ó¥°¤òÀßÄꤹ¤ë¡£¤½¤ì¤¾¤ì¤Î
+.I path_element
+¤¬¥æ¡¼¥¶¤Î
+.RB $ PATH
+¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¤È¡¢
+.I manpath_element
+¤¬
+.RB $ MANPATH
+¤ËÄɲ䵤ì¤ë¡£
+.TP
+\fBMANDB_MAP \fImanpath_element \fR\|[\| \fIcatpath_element\fR \|]
+¤³¤Î·Á¼°¤Î¹Ô¤Ï¡¢¤É¤Î manpath ¤ò `global' ¤È¤·¤Æ°·¤¤¡¢¤Þ¤¿¤½¤ì¤é¤Î cat
+¥Ú¡¼¥¸¤ò¤É¤³¤ËÊݸ¤¹¤ë¤«¤ò»ØÄꤹ¤ë (¸åȾ¤Ï¾Êά²Ä)¡£¤³¤Î·Á¼°¤Î¥Õ¥£¡¼¥ë
+¥É¤Ï¡¢
+.B man
+¤¬ setuid ¤µ¤ì¤¿¥×¥í¥°¥é¥à¤Ç¤¢¤ë¾ì¹ç¤ËÆä˽ÅÍפǤ¢¤ë¡£¤Ê¤¼¤Ê¤é¡¢¤³¤ì¤Ï
+¤É¤Î³¬Áؤò setuid ¤µ¤ì¤¿¥æ¡¼¥¶¡¼¸¢¸Â¤Ç¥¢¥¯¥»¥¹¤·¡¢¤É¤ì¤òµ¯Æ°¥æ¡¼¥¶¡¼¤Î
+¸¢¸Â¤Ç¥¢¥¯¥»¥¹¤¹¤ë¤«¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤Ê¤ë¤«¤é¤Ç¤¢¤ë¡£
+
+`global' ¤Ê¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î³¬Áؤϡ¢Ä̾ï
+.I /usr
+°Ê²¼¤ËÊݴɤµ¤ì¤Æ¤¤¤ë¡£Î㤨¤Ð
+.IR /usr/man ,
+.IR /usr/local/man ,
+.I /usr/X11R6/man
+¤Ê¤É¤¬¤³¤ì¤Ë¤¢¤¿¤ë¡£
+
+ÆÃÄê¤Î
+.I manpath_element
+¤«¤é¤Î cat ¥Ú¡¼¥¸¤ÏÊݴɤ·¤¿¤¯¤Ê¤¤¾ì¹ç¤ä¡¢½¾Íè¤Î°ÌÃÖ¤ËÊݴɤ·¤¿¤¤¾ì¹ç¤Ë¤Ï¡¢
+.I catpath_element
+¤Ï¾Êά¤¹¤ë¡£
+
+½¾ÍèÍѤ¤¤é¤ì¤Æ¤¤¤¿ cat ¥Õ¥¡¥¤¥ë¤ÎÊݴɾì½ê (/usr/man/cat?/ ¤Ê¤É) ¤Ï¡¢
+¥ê¡¼¥É¥ª¥ó¥ê¡¼¤Ç¥Þ¥¦¥ó¥È¤µ¤ì¤Æ¤¤¤ë¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î³¬Áز¼¤Ë
+ÃÖ¤¯¤³¤È¤Ï¤Ç¤­¤Ê¤«¤Ã¤¿¡£¤³¤ÎÍýͳ¤«¤é¡¢Êݴɾì½ê¤È¤·¤Æ
+Ǥ°Õ¤Î¥Ç¥£¥ì¥¯¥È¥ê³¬Áؤò»ØÄꤹ¤ë¤³¤È¤¬²Äǽ¤Ë¤Ê¤Ã¤Æ¤¤¤ë (¤â¤Á¤í¤ó»ØÄꤷ¤¿
+¥Ç¥£¥ì¥¯¥È¥ê¤ÏÍ­¸ú¤Ê¤â¤Î¤Ç¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤)¡£
+.B Linux FSSTND
+¤Ë½¾¤¦¾ì¹ç¤Ë¤Ï¡¢
+¥­¡¼¥ï¡¼¥É
+.RB ` FSSTND '
+¤ò¼ÂºÝ¤Î¥Ç¥£¥ì¥¯¥È¥ê̾¤ÎÂå¤ï¤ê¤ËÍѤ¤¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
+
+»ÄÇ°¤Ê¤¬¤é¡¢ `global' ¤Ê man ¤Î¥Ä¥ê¡¼¥Ñ¥¹¤Ï¤¹¤Ù¤Æ»ØÄꤷ¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
+¾¤Î¥·¥¹¥Æ¥à¥Ñ¥¹ (
+.I /usr/man/sun
+¤Î¤è¤¦¤Ê¤â¤Î) ¤ä¤¹¤Ù¤Æ¤Î
+.B NLS ¥í¥±¡¼¥ë
+¥Ñ¥¹ (
+.I /usr/man/de_DE.88591
+¤Î¤è¤¦¤Ê¤â¤Î) ¤â¡¢¤½¤ì¤¾¤ì¤¹¤Ù¤Æ»ØÄꤹ¤ëɬÍפ¬¤¢¤ë¡£
+
+¾ðÊó¤Ï½ñ¤«¤ì¤¿½ç¤Ë°ì¹Ô¤º¤Äɾ²Á¤µ¤ì¤ë¤Î¤Ç¡¢Â¾¤Î³¬ÁؤΥµ¥Ö¥Ä¥ê¡¼¤È¤Ê¤Ã¤Æ
+¤¤¤ë¤è¤¦¤Ê manpath ¤ÏÀè¤Ë½ñ¤«¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£¤½¤¦¤·¤Ê¤¤¤È¥Þ¥Ã¥Á¤¬
+Àµ¤·¤¯¹Ô¤ï¤ì¤Ê¤¤²ÄǽÀ­¤¬¤¢¤ë¡£Î㤨¤Ð
+.I /usr/man/de_DE.88591
+¤Ï
+.I /usr/man
+¤è¤êÀè¤ËÍè¤Ê¤±¤ì¤Ð¤Ê¤é¤Ê¤¤¡£
+.SH ¥Ð¥°
+¾åµ­¤Î¥ë¡¼¥ë¤¬Àµ¤·¤¯¼é¤é¤ì¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¥ã¡¼¤Îµ¡Ç½¤Ï
+Àµ¤·¤¯Æ°ºî¤·¤Ê¤¤¡£¤³¤ì¤é¤Î¥ë¡¼¥ë¤ÏÉÔɬÍפËÆñ¤·¤¤¡£
diff --git a/man/ja_JP.ujis/man8/accessdb.man8 b/man/ja_JP.ujis/man8/accessdb.man8
new file mode 100644
index 00000000..c768c87e
--- /dev/null
+++ b/man/ja_JP.ujis/man8/accessdb.man8
@@ -0,0 +1,45 @@
+.\" Man page for accessdb
+.\"
+.\" Copyright (c) 1998 Fabrizio Polacco <fpolacco@debian.org
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Tue, 24 Feb 1998 18:18:36 +0200
+.\"
+.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
+.\" Translated Fri 25 Sep 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\" Modified Sun 6 Dec 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\"
+.TH accessdb 8 "July 12th, 1995" "2.3.10" "Manual pager utils"
+.SH ̾Á°
+accessdb \- man-db ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ÎÆâÍƤò¡¢¿Í´Ö¤Ë²ÄÆɤʷÁ¼°¤Ç¥À¥ó¥×¤¹¤ë¡£
+.SH ½ñ¼°
+.B /usr/sbin/accessdb
+.RI [ <index-file> ]
+.SH ÀâÌÀ
+.B accessdb
+¤Ï man_db ¥Ç¡¼¥¿¥Ù¡¼¥¹¤Ë´Þ¤Þ¤ì¤Æ¤¤¤ë¥Ç¡¼¥¿¤ò¿Í´Ö¤Ë²ÄÆɤʤ«¤¿¤Á¤Ç½ÐÎϤ¹¤ë¡£
+¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢
+.B /var/catman/index/<db-type>
+¤Î¥Ç¡¼¥¿¤ò¥À¥ó¥×¤¹¤ë¡£ <db-type> ¤ÏÍѤ¤¤Æ¤¤¤ë¥Ç¡¼¥¿¥Ù¡¼¥¹¥é¥¤¥Ö¥é¥ê¤Ë°Í¸¤¹¤ë¡£
+
+accessdb ¤Ë°ú¤­¿ô¤òÅϤ¹¤È¡¢¤³¤Î¥Ç¥Õ¥©¥ë¥È¤Ï¾å½ñ¤­¤µ¤ì¤ë¡£
+
+.nf
+$mtime$ -> "795987034"
+$version$ -> "2.3.1"
+apropos -> "1 1 795981542 A - - search the manual page names and descriptions"
+catman -> "8 8 795981544 A - - create or update the pre-formatted manual pages"
+man -> "1 1 795981542 A - - an interface to the on-line reference manuals"
+mandb -> "8 8 795981544 A - - create or update the manual page index caches"
+manpath -> " 1 5"
+manpath~1 -> "1 1 795981542 A - - determine search path for manual pages"
+manpath~5 -> "5 5 795981543 A - - format of the /etc/man_db.config file"
+whatis -> "1 1 795981543 A - - search the manual page names"
+zsoelim -> "1 1 795981543 A - - satisfy .so requests in roff input"
+.fi
+
+.SH Ãø¼Ô
+Wilf. (G.Wilford@ee.surrey.ac.uk)
diff --git a/man/ja_JP.ujis/man8/catman.man8 b/man/ja_JP.ujis/man8/catman.man8
new file mode 100644
index 00000000..ab91f74f
--- /dev/null
+++ b/man/ja_JP.ujis/man8/catman.man8
@@ -0,0 +1,99 @@
+.\" Man page for catman
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Dec 10 14:17:29 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
+.\" Translated Fri 25 Sep 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\" Modified Sun 6 Dec 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\"
+.\"WORD: hierarchy ³¬ÁØ
+.\"
+.TH catman 8 "July 12th, 1995" "2.3.10" "Manual pager utils"
+.SH ̾Á°
+catman \- ¥Õ¥©¡¼¥Þ¥Ã¥È¤µ¤ì¤¿¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤òÀ¸À®¡¦¹¹¿·¤¹¤ë
+.SH ½ñ¼°
+.B catman
+.RB [\| \-dhV \|]
+.RB [\| \-M
+.IR path \|]
+.RI [\| section \|]
+\&.\|.\|.
+.SH ÀâÌÀ
+.B catman
+¤Ï¡¢¥Õ¥©¡¼¥Þ¥Ã¥ÈºÑ¤ß¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸ (cat ¥Ú¡¼¥¸¤È¸Æ¤Ð¤ì¤ë) ¤ÎºÇ¿·¤Î
+¥»¥Ã¥È¤òÀ¸À®¤¹¤ë¤¿¤á¤ËÍѤ¤¤é¤ì¤ë¡£
+Ä̾ï cat ¥Ú¡¼¥¸¤Ï¥ª¥ê¥¸¥Ê¥ë¤Î man ¥Ú¡¼¥¸¤è¤ê¤â¤º¤Ã¤È®¤¯É½¼¨¤Ç¤­¤ë¤¬¡¢
+;ʬ¤ÊÊݸÎΰ褬ɬÍפȤµ¤ì¤ë¡£ cat ¥Ú¡¼¥¸¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤«¤É¤¦¤«¤Ï¡¢
+¥í¡¼¥«¥ë¤Ê´ÉÍý¼Ô (cat ¥Ú¡¼¥¸¤òÊݸ¤¹¤ë¥Ç¥£¥ì¥¯¥È¥ê¤Ë´Ø¤¹¤ë¸¢¸Â¤ò»ý¤Ã¤Æ
+¤¤¤ë¿Í) ¤ÎȽÃǤˤè¤ë¡£
+
+.B catman
+¤ËÍ¿¤¨¤ë¤³¤È¤Î¤Ç¤­¤ë¥ª¥×¥·¥ç¥ó¤Ï¡¢¥Õ¥©¡¼¥Þ¥Ã¥È¤ò¹Ô¤¦¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î
+³¬ÁØ (hierarchy) ¤È¥»¥¯¥·¥ç¥ó¤Ç¤¢¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Î³¬Áؤϡ¢ man_db ¤ÎÀß
+Äê¥Õ¥¡¥¤¥ë¤Ç
+`global' »ØÄꤵ¤ì¤Æ¤¤¤ë¤â¤Î¤Ç¤¢¤ë¡£¥Ç¥Õ¥©¥ë¥È¤Î¥»¥¯¥·¥ç¥ó¤Ï¡¢´Ä¶­ÊÑ¿ô
+.RB $ MANSECT
+¤¬Í¿¤¨¤é¤ì¤Æ¤¤¤ì¤Ð¡¢¤½¤ÎÆâÍƤò¥³¥í¥ó¶èÀÚ¤ê¤Ç¥Ñ¡¼¥¹¤·¤¿¤â¤Î¤Ë¤Ê¤ê¡¢
+Í¿¤¨¤é¤ì¤Æ¤¤¤Ê¤±¤ì¤Ð
+.B man
+¤Î¥³¥ó¥Ñ¥¤¥ë»þ¤Ë»ØÄꤵ¤ì¤Æ¤¤¤ëɸ½àŪ¤Ê¥»¥Ã¥È¤È¤Ê¤ë¡£
+.B catman
+¤Î¼Â¹Ô»þ¤Ë¥»¥¯¥·¥ç¥ó¤Î̾Á°¤ò¥¹¥Ú¡¼¥¹¤Ç¶èÀڤäÆÍ¿¤¨¤ì¤Ð¡¢
+¤³¤ì¤é¤ÎξÊý¤ò¾å½ñ¤­¤¹¤ë¡£
+
+.B catman
+¤Ï¤½¤ì¤¾¤ì¤Î³¬Áؤˤª¤±¤ë
+.B index
+¥Ç¡¼¥¿¥Ù¡¼¥¹¥­¥ã¥Ã¥·¥å¤òÍøÍѤ·¤Æ¡¢¤É¤Î¥Õ¥¡¥¤¥ë¤ò¥Õ¥©¡¼¥Þ¥Ã¥È¤¹¤Ù¤­¤«¤ò
+·èÄꤹ¤ë¡£
+.SH ¥ª¥×¥·¥ç¥ó
+.TP
+.B \-d, \-\-debug
+¥Ç¥Ð¥Ã¥°¾ðÊó¤òɽ¼¨¤¹¤ë¡£
+.TP
+.BI \-M\ path ,\ \-\-manpath= path
+¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸³¬ÁؤΥµ¡¼¥Á¥Ñ¥¹¤È¤·¤ÆÍѤ¤¤ë¥³¥í¥ó¶èÀÚ¤ê¤Î¥ê¥¹¥È¤ò»ØÄꤹ¤ë¡£
+¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢ man_db ÀßÄê¥Õ¥¡¥¤¥ë¤Ç `global' »ØÄꤵ¤ì¤Æ¤¤¤ë¤¹¤Ù¤Æ¤Î¥Ñ
+¥¹¤òÂоݤȤ¹¤ë¡£
+.TP
+.B \-h, \-\-help
+¥Ø¥ë¥×¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Æ½ªÎ»¤¹¤ë¡£
+.TP
+.B \-V, \-\-version
+¥Ð¡¼¥¸¥ç¥ó¤ÈÃø¼Ô¤Ë´Ø¤¹¤ë¾ðÊó¤òɽ¼¨¤¹¤ë¡£
+.SH ´Ä¶­ÊÑ¿ô
+.TP
+.B MANSECT
+.RB $ MANSECT
+¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢¤½¤ÎÃͤϥ»¥¯¥·¥ç¥ó¤Î¥ê¥¹¥È (¥³¥í¥ó¶èÀÚ¤ê) ¤È¤·¤Æ°·¤ï¤ì¡¢
+¥Þ¥Ë¥å¥¢¥ë¤Î¤É¤Î¥»¥¯¥·¥ç¥ó¤ò¸¡º÷¤¹¤ë¤«¤ò·èÄꤹ¤ëºÝ¤ËÍѤ¤¤é¤ì¤ë¡£¥»¥¯¥·¥ç
+¥ó¤Ï»ØÄꤵ¤ì¤¿½ç½ø¤Ç¸¡º÷¤µ¤ì¤ë¡£
+.TP
+.B MANPATH
+.RB $ MANPATH
+¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤È¡¢¤½¤ÎÆâÍƤϸ¡º÷ÂоݤȤ¹¤ë¥Þ¥Ë¥å¥¢¥ë¤Î³¬Áؤò
+¥³¥í¥ó¤Ç¶èÀڤ俥ꥹ¥È¤È¤ß¤Ê¤µ¤ì¤ë¡£
+.SH ¥Õ¥¡¥¤¥ë
+.TP
+.I /etc/manpath.config
+man_db ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¡£
+.TP
+.I /usr/man/index.(bt|db|dir|pag)
+½¾Íè·Á¼°¤Î¡¢ global ¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹¥­¥ã¥Ã¥·¥å¤Î
+¥¤¥ó¥Ç¥Ã¥¯¥¹¡£
+.TP
+.I /var/catman/index.(bt|db|dir|pag)
+¿·¤·¤¤ (FSSTND ½àµò¤Î)¡¢ global ¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹¥­¥ã¥Ã¥·¥å¤Î
+¥¤¥ó¥Ç¥Ã¥¯¥¹¡£
+.SH ´ØÏ¢¹àÌÜ
+.BR man (1),
+.BR manpath (5),
+.BR mandb (8)
+.SH Ãø¼Ô
+Wilf. (G.Wilford@ee.surrey.ac.uk)
diff --git a/man/ja_JP.ujis/man8/mandb.man8 b/man/ja_JP.ujis/man8/mandb.man8
new file mode 100644
index 00000000..351c9409
--- /dev/null
+++ b/man/ja_JP.ujis/man8/mandb.man8
@@ -0,0 +1,150 @@
+'\" t
+.\" Man page for mandb
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Tue Apr 26 12:56:44 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.\" Japanese Version Copyright (c) 1998 NAKANO Takeo all rights reserved.
+.\" Translated Fri 25 Sep 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\" Modified Sun 6 Dec 1998 by NAKANO Takeo <nakano@apm.seikei.ac.jp>
+.\"
+.\"WORD: hierarchy ³¬ÁØ
+.\"
+.TH mandb 8 "July 12th, 1995" "2.3.10" "Manual pager utils"
+.SH ̾Á°
+mandb \- ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥¤¥ó¥Ç¥Ã¥¯¥¹¥­¥ã¥Ã¥·¥å¤òºîÀ®¡¦¹¹¿·¤¹¤ë¡£
+.SH ½ñ¼°
+.B mandb
+.RB [\| \-dqsuc \||\| \-h \||\| \-V\c
+.RI "\|] [\|" manpath \|]
+.SH ÀâÌÀ
+.B mandb
+¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¥­¥ã¥Ã¥·¥å
+.B index
+¤ò½é´ü²½¤·¤¿¤ê¡¢¼êÆ°¤Ç¹¹¿·¤¹¤ë¤È¤­¤ËÍѤ¤¤ë¡£Ä̾ï¤Ï¤³¤Î¥­¥ã¥Ã¥·¥å¤Ï
+.B man
+¤Ë¤è¤Ã¤Æ´ÉÍý¤µ¤ì¤Æ¤¤¤ë¡£
+¥­¥ã¥Ã¥·¥å¤Ë¤Ï¡¢¸½ºß¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¥·¥¹¥Æ¥à¤Ë´Ø¤¹¤ë¾ðÊ󤬴ޤޤì¤Æ¤¤¤ë¡£
+¤³¤Î¾ðÊó¤Ï man_db ¥æ¡¼¥Æ¥£¥ê¥Æ¥£·²¤Ë¤è¤Ã¤ÆÍѤ¤¤é¤ì¡¢Â®Å٤ȵ¡Ç½¤Î¸þ¾å¤Ë
+¹×¸¥¤·¤Æ¤¤¤ë¡£
+
+.B index
+¤¬À¸À®¡¦¹¹¿·¤µ¤ì¤ë¤È¤­¡¢
+.B mandb
+¤Ï ROFF ¤Î .so Ì¿Îá¤Î´Ö°ã¤¤¤ä¡¢¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥Õ¥¡¥¤¥ë̾¤Î½ÅÊ£¡¢
+.B whatis
+¤Ë¤è¤Ã¤Æ¾ðÊó¤òÃê½Ð¤Ç¤­¤Ê¤¤¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ê¤É¤Ë¤¿¤¤¤·¤Æ·Ù¹ð¤òȯ¤¹¤ë¡£
+
+.B mandb
+¤Ë¡¢¥³¥í¥ó¤Ç¶èÀڤ俥ѥ¹¤Î¥ê¥¹¥È¤òÍ¿¤¨¤ë¤³¤È¤â¤Ç¤­¤ë¡£
+¤³¤ì¤Ï man_db ÀßÄê¥Õ¥¡¥¤¥ë¤Î¾ðÊ󤫤é·èÄꤵ¤ì¤¿¡¢¥×¥í¥°¥é¥à
+ÆâÉô¤Î `global' ¤Ê¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸³¬Áظ¡º÷¥Ñ¥¹¤ò¾å½ñ¤­¤¹¤ë¡£
+
+.SS ¥Ç¡¼¥¿¥Ù¡¼¥¹¥­¥ã¥Ã¥·¥å
+.B mandb
+¤Ï°Ê²¼¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹·Á¼°¤Î¤¤¤º¤ì¤«°ì¤Ä¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤è¤¦¤Ë
+¥³¥ó¥Ñ¥¤¥ë¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
+
+.TS
+tab (@);
+l l l l.
+̾Á°@·Á¼°@ÈóƱ´ü@¥Õ¥¡¥¤¥ë̾
+_
+Berkeley db@ÆóʬÌÚ@²Ä@\fIindex.bt\fR
+GNU gdbm v >= 1.6@¥Ï¥Ã¥·¥å@²Ä@\fIindex.db\fR
+GNU gdbm v < 1.6@¥Ï¥Ã¥·¥å@ÉÔ²Ä@\fIindex.db\fR
+UNIX ndbm@¥Ï¥Ã¥·¥å@ÉÔ²Ä@\fIindex.(dir|pag)\fR
+.TE
+
+¤³¤ì¤é¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹·Á¼°¤Î¤¦¤ÁÈóƱ´ü¤Ê¹¹¿·¤¬¤Ç¤­¤ë¤â¤Î¤Ç¤Ï¡¢
+®Å٤ϸþ¾å¤¹¤ë¤¬¡¢Í½´ü¤·¤Ê¤¤ÃæÃǤ¬µ¯¤³¤Ã¤¿¤È¤­¤Ë¥Ç¡¼¥¿¤¬²õ¤ì¤ë¤«¤â¤·¤ì¤Ê¤¤¡£
+¤³¤Î¤è¤¦¤ÊÇ˲õ¤¬µ¯¤³¤Ã¤¿¤È¤­¤Ë¤Ï¡¢
+.B mandb
+¤ò
+.B \-c
+¥ª¥×¥·¥ç¥ó¤ò¤Ä¤±¤Æ¼Â¹Ô¤·¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤òºÆ¹½À®¤·¤Ê¤ª¤¹É¬Íפ¬
+¤¢¤ë¤À¤í¤¦¡£
+.SH ¥ª¥×¥·¥ç¥ó
+.TP
+.B \-d, \-\-debug
+¥Ç¥Ð¥Ã¥°¾ðÊó¤òÀ¸À®¤¹¤ë¡£
+.TP
+.B \-q, \-\-quiet
+·Ù¹ð¤òȯ¤·¤Ê¤¤¡£
+.TP
+.B \-s, \-\-no-straycats
+stray cat (ÌõÃí: ¤ª¤½¤é¤¯Âбþ¤¹¤ë roff ¥½¡¼¥¹¤Î¤Ê¤¤ cat ¥Ú¡¼¥¸¤Î¤³¤È
+¤Ç¤·¤ç¤¦) ¤òõ¤·¤¿¤ê¡¢¤½¤ì¤Ë´Ø¤¹¤ë¾ðÊó¤ò¥Ç¡¼¥¿¤ËÄɲ䷤褦¤È¤Ï»î¤ß¤Ê¤¤¡£
+.\"??? stray cats?
+.TP
+.B \-c, \-\-create
+¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢
+.B mandb
+¤Ï°ÊÁ°¤ËÀ¸À®¤µ¤ì¤¿¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¹¹¿·¤·¤è¤¦¤È¤¹¤ë¡£¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬
+¸ºß¤·¤Ê¤¤¾ì¹ç¤Ë¤Ï¡¢»Ï¤á¤«¤éÀ¸À®¤¹¤ë¡£
+¤³¤Î¥ª¥×¥·¥ç¥ó¤ò»ØÄꤹ¤ë¤È¡¢
+.B mandb
+¤Ï°ÊÁ°¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¾Ãµî¤·¡¢¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¥¼¥í¤«¤éºÆ¹½À®¤¹¤ë¡£
+¤³¤ì¤Ï¥Ç¡¼¥¿¥Ù¡¼¥¹¤¬²õ¤ì¤¿¾ì¹ç¤ä¡¢¾­Íè¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î´ÉÍýÊýË¡¤¬
+¿·¤·¤¤¤â¤Î¤ËÊѤï¤Ã¤¿¤È¤­¤Ê¤É¤ËɬÍ×¤È¤Ê¤í¤¦¡£
+.TP
+.B \-u, \-\-user-db
+¥æ¡¼¥¶¡¼¤Î¥Ç¡¼¥¿¥Ù¡¼¥¹¤·¤«À¸À®¤·¤Ê¤¤¡£ `global' ¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹¤òºîÀ®¤¹
+¤ë¸¢¸Â¤¬¤¢¤Ã¤Æ¤â¡¢¤³¤Á¤é¤ÏÀ¸À®¤·¤Ê¤¤¡£
+.TP
+.B \-h, \-\-help
+»ÈÍÑË¡¤Ë´Ø¤¹¤ë¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤·¤Æ½ªÎ»¤¹¤ë¡£
+.TP
+.B \-V, \-\-version
+¥Ð¡¼¥¸¥ç¥ó¤òɽ¼¨¤·¤Æ½ªÎ»¤¹¤ë¡£
+.SH ¿ÇÃÇ¥á¥Ã¥»¡¼¥¸
+¥Ç¡¼¥¿¥Ù¡¼¥¹¤Î¹½ÃÛÃæ¤Ë¡¢°Ê²¼¤Î¤è¤¦¤Ê·Ù¹ð¥á¥Ã¥»¡¼¥¸¤¬½ÐÎϤµ¤ì¤ë¤³¤È¤¬¤¢
+¤ë¡£
+.TP
+.B <filename>: whatis parse for page(sec) failed
+<filename> ¤«¤é whatis ¤ËɬÍפʹԤò¼è¤ê½Ð¤¹¤Î¤Ë¼ºÇÔ¤·¤¿¡£¤³¤ì¤ÏÄ̾ï¥Þ
+¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î½ñ¤­Êý¤¬°­¤¤¤«¤é¤Ç¤¢¤ë¤³¤È¤¬Â¿¤¤¤¬¡¢¤³¤Î¤è¤¦¤Ê¥á¥Ã¥»¡¼
+¥¸¤¬Â¿¤¯½Ð¤ë¤è¤¦¤Ç¤¢¤ì¤Ð¡¢¤½¤Î¥·¥¹¥Æ¥à¤Ë¤Ï man_db ¤Î whatis ¥Ñ¡¼¥¶¡¼¤È
+¸ß´¹À­¤Î¤Ê¤¤¡¢Èóɸ½àŪ¤Ê¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤¬´Þ¤Þ¤ì¤Æ¤¤¤ë²ÄǽÀ­¤¬¹â¤¤¡£
+.TP
+.B <filename>: is a dangling symlink
+<filename> ¤¬¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ë¤è¤Ã¤Æ»²¾È¤µ¤ì¤Æ¤¤¤ë¤¬¡¢Â¸ºß¤·¤Æ¤¤¤Ê
+¤¤¡£Ä̾ <filename> ¤ò´Ö°ã¤Ã¤Æ¥ê¥ó¥¯ÂоݤȤ·¤Æ¤·¤Þ¤Ã¤Æ¤¤¤ë¥ê¥ó¥¯¸µ¤Ë
+´Ø¤¹¤ë¿ÇÃÇ¥á¥Ã¥»¡¼¥¸¤¬Æ±»þ¤Ëɽ¼¨¤µ¤ì¤ë¡£
+.TP
+.B <filename>: bad symlink or ROFF `.so' request
+<filename> ¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤Ç¤¢¤ë¤«¡¢ ROFF ¤Î¥¤¥ó¥¯¥ë¡¼
+¥ÉÌ¿Îá¤ò´Þ¤ó¤Ç¤¤¤ë¤¬¡¢¥ê¥ó¥¯À衦Æɤ߹þ¤ßÀè¤Î¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤·¤Æ¤¤¤Ê¤¤¡£
+.TP
+.B <filename>: ignoring bogus filename
+<filename> ¤ÏÀµ¤·¤¤ (¤¢¤ë¤¤¤ÏÀµ¤·¤¯¤Ê¤¤) ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Ç¤¢¤ë¤¬¡¢
+̾Á°¤¬Àµ¤·¤¯¤Ê¤¤¡£Ä̾盧¤ì¤Ï¡¢¥»¥¯¥·¥ç¥ó³ÈÄ¥»Ò <x> ¤Î¥Õ¥¡¥¤¥ë¤¬¡¢
+¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¥»¥¯¥·¥ç¥ó <y> ¤ËÃÖ¤«¤ì¤Æ¤¤¤ë¾ì¹ç¤Ëµ¯¤³¤ë¡£
+.TP
+.B <filename_mask>: competing extensions
+¥ï¥¤¥ë¥É¥«¡¼¥É <filename_mask> ¤¬¥æ¥Ë¡¼¥¯¤Ê̾Á°¤Ç¤Ê¤¤¡£¤³¤ì¤ÏÄ̾Ʊ
+¤¸¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ËÂФ·¤Æ¡¢°µ½Ì¤µ¤ì¤¿¥Ð¡¼¥¸¥ç¥ó¤È¤µ¤ì¤Æ¤¤¤Ê¤¤¥Ð¡¼¥¸¥ç
+¥ó¤¬¶¦Â¸¤·¤Æ¤¤¤ë¾ì¹ç¤Ëµ¯¤³¤ë¡£ºÇ¿·¤Î¤â¤Î°Ê³°¤Ï̵»ë¤µ¤ì¤ë¡£
+.SH ¥Õ¥¡¥¤¥ë
+.TP
+.I /etc/manpath.config
+man_db ¤ÎÀßÄê¥Õ¥¡¥¤¥ë¡£
+.TP
+.I /usr/man/index.(bt|db|dir|pag)
+½¾Íè·Á¼°¤Î¡¢ global ¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹¥­¥ã¥Ã¥·¥å¤Î
+¥¤¥ó¥Ç¥Ã¥¯¥¹¡£
+.TP
+.I /var/catman/index.(bt|db|dir|pag)
+¿·¤·¤¤ (FSSTND ½àµò¤Î)¡¢ global ¤Ê¥Ç¡¼¥¿¥Ù¡¼¥¹¥­¥ã¥Ã¥·¥å¤Î
+¥¤¥ó¥Ç¥Ã¥¯¥¹¡£
+.SH ´ØÏ¢¹àÌÜ
+.BR man (1),
+.BR manpath (5),
+.BR catman (8)
+.SH Ãø¼Ô
+Wilf. (G.Wilford@ee.surrey.ac.uk)
diff --git a/man/man1/apropos.man1 b/man/man1/apropos.man1
new file mode 100644
index 00000000..5fc9bf91
--- /dev/null
+++ b/man/man1/apropos.man1
@@ -0,0 +1,181 @@
+.\" Man page for %apropos%
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH %apropos% 1 "%date%" "%version%" "Manual pager utils"
+.SH NAME
+%apropos% \- search the manual page names and descriptions
+.SH SYNOPSIS
+.B %apropos%
+.RB [\| \-dhV \|]
+.RB [\| \-e \||\| \-w \||\| \-r\c
+\|]
+.RB [\| \-m
+.IR system \|[\|,.\|.\|.\|]\|]
+.RB [ \-M
+.IR path \|]
+.I keyword
+\&.\|.\|.
+.SH DESCRIPTION
+Each manual page has a short description available within
+it.
+.B %apropos%
+searches the descriptions for instances of
+.IR keyword .
+
+.I keyword
+is usually a regular expression, as if
+.RB ( \-r )
+was used, or
+may contain wildcards
+.RB ( \-w ) \ ,
+or match the exact keyword
+.RB ( \-e ) \ .
+Using these options,
+it may be
+necessary to quote the
+.I keyword
+or escape (\\) the special characters to stop the shell from interpreting them.
+
+The standard matching rules allow matches to
+be made against the page name and word boundaries in
+the description.
+.SH OPTIONS
+.TP
+.B \-d, \-\-debug
+Print debugging information.
+.TP
+.B \-r, \-\-regex
+Interpret each keyword as a regular expression. This is the default
+behaviour.
+Each keyword will be matched against the page names and the descriptions
+independently. It can match any part of either. The match is not limited to
+word boundaries.
+.TP
+.B \-w, \-\-wildcard
+Interpret each keyword as a pattern containing shell style wildcards.
+Each keyword will be matched against the page names and the descriptions
+independently. Only if an expanded keyword matches an entire description or
+page name, will a match be found.
+.TP
+.B \-e, \-\-exact
+Each keyword will be exactly matched against the page names and the descriptions.
+.\"
+.\" Due to the rather silly limit of 6 args per request in some `native'
+.\" *roff compilers, we have do the following to get the two-line
+.\" hanging tag on one line. .PP to begin a new paragraph, then the
+.\" tag, then .RS (start relative indent), the text, finally .RE
+.\" (end relative indent).
+.\"
+.PP
+.B \-m
+.I system\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= system\c
+\|[\|,.\|.\|.\|]
+.RS
+If this system has access to other operating system's manual page
+descriptions, they can be searched using this option.
+To search NewOS's manual page descriptions,
+use the option
+.B \-m
+.BR NewOS .
+
+The
+.I system
+specified can be a combination of comma delimited operating
+system names.
+To include a search of the native operating system's
+.B whatis
+descriptions, include the system name
+.B man
+in the argument string.
+This option will override the
+.RB $ SYSTEM
+environment variable.
+.RE
+.TP
+.BI \-M\ path ,\ \-\-manpath= path
+Specify an alternate set of colon delimited, manual page hierarchies to search.
+By default,
+.B %apropos%
+uses the
+.RB $ MANPATH
+environment variable unless it is empty or unset in which case it will
+determine an appropriate manpath based on your
+.RB $ PATH
+environment variable.
+This option overrides the contents of
+.RB $ MANPATH .
+.TP
+.B \-h, \-\-help
+Print a help message and exit.
+.TP
+.B \-V, \-\-version
+Display version and author information.
+.SH "EXIT STATUS"
+.TP
+.B 0
+Successful program execution.
+.TP
+.B 1
+Usage, syntax or configuration file error.
+.TP
+.B 2
+Operational error.
+.TP
+.B 16
+Nothing was found that matched the criteria specified.
+.SH ENVIRONMENT
+.TP
+.B SYSTEM
+If
+.RB $ SYSTEM
+is set, it will have the same effect as if it had been specified as the
+argument to the
+.B \-m
+option.
+.TP
+.B MANPATH
+If
+.RB $ MANPATH
+is set, its value is interpreted as the colon delimited, manual page hierarchy
+search path to use.
+.TP
+.B POSIXLY_CORRECT
+If
+.RB $ POSIXLY_CORRECT
+is set, even to a null value, the default
+.B %apropos%
+search will be as an extended regex
+.RB ( \-r ) \ .
+This is anyway the default behaviour.
+.SH FILES
+.TP
+.I /usr/share/man/index.(bt|db|dir|pag)
+A traditional global
+.I index
+database cache.
+.TP
+.I /var/cache/man/index.(bt|db|dir|pag)
+An alternate or FHS
+compliant global
+.I index
+database cache.
+.TP
+.I /usr/share/man/\|.\|.\|.\|/whatis
+A traditional
+.B whatis
+text database.
+.SH "SEE ALSO"
+.BR %whatis% (1),
+.BR %man% (1).
+.SH AUTHOR
+Wilf. (G.Wilford@ee.surrey.ac.uk).
+Fabrizio Polacco (fpolacco@debian.org).
diff --git a/man/man1/man.man1 b/man/man1/man.man1
new file mode 100644
index 00000000..6285390c
--- /dev/null
+++ b/man/man1/man.man1
@@ -0,0 +1,919 @@
+'\" t
+.\" ** The above line should force tbl to be a preprocessor **
+.\" Man page for man
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH %man% 1 "%date%" "%version%" "Manual pager utils"
+.SH NAME
+%man% \- an interface to the on-line reference manuals
+.SH SYNOPSIS
+.\" The general command line
+.B %man%
+.RB [\| \-c \||\| \-w \||\| \-tZT
+.IR device \|]
+.RB [\| \-adhu7V \|]
+.RB [\| \-m
+.IR system \|[\|,.\|.\|.\|]\|]
+.RB [\| \-L
+.IR locale \|]
+.RB [\| \-p
+.IR string \|]
+.RB [\| \-M
+.IR path \|]
+.RB [\| \-P
+.IR pager \|]
+.RB [\| \-r
+.IR prompt \|]
+.RB [\| \-S
+.IR list \|]
+.RB [\| \-e
+.IR extension \|]
+.RI [\|[\| section \|]
+.IR page \ .\|.\|.\|]\ .\|.\|.
+.\" The --local command line
+.br
+.B %man%
+.B \-l
+.RB [\| \-7 \|]
+.RB [\| \-tZT
+.IR device \|]
+.RB [\| \-p
+.IR string \|]
+.RB [\| \-P
+.IR pager \|]
+.RB [\| \-r
+.IR prompt \|]
+.I file
+\&.\|.\|.
+.\" The apropos command line
+.br
+.B %man%
+.B \-k
+.RI [\| apropos
+.IR options \|]
+.I regexp
+\&.\|.\|.
+.\" The whatis command line
+.br
+.B %man%
+.B \-f
+.RI [\| whatis
+.IR options \|]
+.I page
+\&.\|.\|.
+.SH DESCRIPTION
+.B %man%
+is the system's manual pager. Each
+.I page
+argument given to
+.B %man%
+is normally the name of a program, utility or function.
+The
+.I manual page
+associated with each of these arguments is then found and
+displayed. A
+.IR section ,
+if provided, will direct
+.B %man%
+to look
+only in that
+.I section
+of the manual.
+The default action is to search in all of the available
+.IR sections ,
+following a pre-defined order and to show only the first
+.I page
+found, even if
+.I page
+exists in several
+.IR sections .
+
+The table below shows the
+.I section
+numbers of the manual followed by the types of pages they contain.
+
+.TS
+tab (@);
+l l.
+1@Executable programs or shell commands
+2@System calls (functions provided by the kernel)
+3@Library calls (functions within system libraries)
+4@Special files (usually found in \fI/dev\fR)
+5@File formats and conventions eg \fI/etc/passwd\fR
+6@Games
+7@Macro packages and conventions eg \fBman\fR(7), \fBgroff\fR(7).
+8@System administration commands (usually only for root)
+9@Kernel routines [\|Non standard\|]
+.TE
+
+A manual
+.I page
+consists of several parts.
+
+They may be labelled
+.BR NAME ,
+.BR SYNOPSIS ,
+.BR DESCRIPTION ,
+.BR OPTIONS ,
+.BR FILES ,
+.BR SEE\ ALSO ,
+.BR BUGS ,
+and
+.BR AUTHOR .
+
+The following conventions apply to the
+.B SYNOPSIS
+section and can be used as a guide in other sections.
+
+.TS
+tab (@);
+l l.
+\fBbold text\fR@type exactly as shown.
+\fIitalic text\fR@replace with appropriate argument.
+[\|\fB\-abc\fR\|]@any or all arguments within [ ] are optional.
+\fB\-a\|\fR|\|\fB\-b\fR@options delimited by | cannot be used together.
+\fIargument\fB .\|.\|.@\fIargument\fR is repeatable.
+[\|\fIexpression\fR\|]\fB .\|.\|.@\fRentire \fIexpression\fR\ within [ ] is repeatable.
+.TE
+
+The command or function illustration is a pattern that should match all
+possible invocations. In some cases it is advisable to illustrate
+several exclusive invocations as is shown in the
+.B SYNOPSIS
+section of this manual page.
+.SH EXAMPLES
+.TP \w'%man%\ 'u
+.BI %man% \ ls
+Display the manual page for the
+.I item
+(program)
+.IR ls .
+.TP
+.BI %man%\ \-a \ intro
+Display, in succession, all of the available
+.I intro
+manual pages contained within the manual. It is possible to quit between
+successive displays or skip any of them.
+.TP
+\fB%man% \-t \fIalias \fR|\fI lpr -Pps
+Format the manual page referenced by
+.RI ` alias ',
+usually a shell manual page, into the default
+.B troff
+or
+.B groff
+format and pipe it to the printer named
+.IR ps .
+The default output for
+.B groff
+is usually PostScript.
+.B %man% \-\-help
+should advise as to which processor is bound to the
+.B \-t
+option.
+.TP
+.BI %man%\ \-l\ \-T dvi\ ./foo.1x.gz \ >\ ./foo.1x.dvi
+This command will decompress and format the nroff source manual page
+.I ./foo.1x.gz
+into a
+.B device independent (dvi)
+file. The redirection is necessary as the
+.B \-T
+flag causes output to be directed to
+.B stdout
+with no pager. The output could be viewed with a program such as
+.B xdvi
+or further processed into PostScript using a program such as
+.BR dvips.
+.TP
+.BI %man%\ \-k \ printf
+Search the short descriptions and manual page names for the keyword
+.I printf
+as regular expression.
+Print out any matches.
+Equivalent to
+.BI %apropos%\ \-r \ printf .
+.TP
+.BI %man%\ \-f \ smail
+Lookup the manual pages referenced by
+.I smail
+and print out the short descriptions of any found.
+Equivalent to
+.BI %whatis%\ \-r \ smail .
+.SH OVERVIEW
+Many options are available to
+.B %man%
+in order to give as much
+flexibility as possible to the user. Changes can be made to the search
+path, section order, output processor, and other behaviours and operations
+detailed below.
+
+If set, various environment variables are interrogated to determine
+the operation of
+.BR %man% .
+It is possible to set the `catch all' variable
+.RB $ MANOPT
+to any string in command line format with the exception that any spaces
+used as part of an option's argument must be escaped (preceded by a
+backslash).
+.B %man%
+will parse
+.RB $ MANOPT
+prior to parsing
+its own command line. Those options requiring an argument,
+will be overridden by the same options found on the command line.
+To reset all of the options set in
+.RB $ MANOPT ,
+.B \-D
+can be specified as the initial command line option.
+This will allow %man% to
+`forget' about the options specified in
+.RB $ MANOPT
+although they must still have been valid.
+
+The manual pager utilities packaged as
+.B man_db
+make extensive use of
+.B index
+database caches. These caches contain information such
+as where each manual page can be found on the filesystem and what its
+.I whatis
+(short one line description of the man page) contains. One of
+.B %man%'s
+jobs is to ensure that the caches remain consistent.
+These database caches obviate the need for having to manually run software
+to update traditional
+.I whatis
+text databases, and also allow
+.B %man%
+to run faster than if it had to
+search the filesystem each time to find the appropriate manual page.
+
+If
+.B %man%
+cannot find a
+.B %mandb%
+initiated
+.B index
+database for a particular manual page hierarchy, it will still
+search for the requested manual pages although file globbing will be
+necessary to search within that hierarchy.
+If
+.B %whatis%
+or
+.B %apropos%
+fails to find an
+.B index
+it will try to extract information from a
+traditional
+.I whatis
+database instead.
+.\"`User' manual page hierarchies will have
+.\".B index
+.\"caches created `on the fly'.
+
+These utilities support compressed source nroff files having, by default, the
+extensions of
+.BR .Z ", " .z " and " .gz .
+It is possible to deal with any compression extension, but this information
+must be known at compile time.
+Also, by default, any cat pages produced are compressed using
+.BR gzip .
+Each `global' manual page hierarchy such as
+.I /usr/share/man
+or
+.I /usr/X11R6/man
+may have any directory as its cat page hierarchy.
+Traditionally the cat pages are
+stored under the same hierarchy as the man pages, but for reasons such as
+those specified in the
+.BR "File Hierarchy Standard (FHS)" ,
+it may be better to store them elsewhere.
+For details on how to do this, please read
+.BR manpath (5).
+For details on why to do this, read the standard.
+
+International support is available with this package. Native language
+manual pages are accessible (if available on your system) via use of
+.I locale
+functions.
+To activate such support, it is necessary to set either
+.RB $ LC_MESSAGES ,
+.RB $ LANG
+or another system dependent environment variable
+to your language locale, usually specified in the
+.B POSIX 1003.1
+based format:
+
+.\"
+.\" Need a \c to make sure we don't get a space where we don't want one
+.\"
+.RI < language >[\|\c
+.B _\c
+.RI < territory >\|[\|\c
+.B .\c
+.RI < character-set >\|[\|\c
+.B ,\c
+.RI < version >\|]\|]\|]
+
+If the desired page is available in your
+.IR locale,
+it will be displayed in lieu of the standard (usually American English)
+page.
+
+Support for international message catalogues is also featured in this
+package and can be activated in the same way, again if available.
+If you find that the manual pages and message catalogues supplied with this
+package are not available in your native language and you would like to
+supply them, please contact the maintainer who will be coordinating such
+activity.
+
+For information regarding other features and extensions available with this
+manual pager, please read the documents supplied with the package.
+.SH DEFAULTS
+.B %man%
+will search for the desired manual pages within the
+.I index
+database caches. If the `lookup' is unsuccessful, a cache consistency check
+is performed to ensure the databases accurately reflect the filesystem. It
+is not generally necessary to run
+.B %mandb%
+after the caches are initially created, unless a cache becomes corrupt.
+
+Once a manual page has been located, a check is performed to find out if a
+relative preformatted `cat' file already exists and is newer than the nroff
+file. If it does and is, this preformatted file is (usually) decompressed
+and then displayed, via use of a pager. The pager can be specified in a
+number of ways or the default is used (see option
+.B \-P
+for details).
+If no cat is found or is older than the nroff file, the nroff is filtered
+through various programs and is shown immediately.
+
+If a cat file can be produced (a relative cat directory exists and has
+appropriate permissions),
+.B %man%
+will compress and store the cat file in the background.
+
+The filters are deciphered by a number of means. Firstly, the command
+line option
+.B \-p
+or the environment variable
+.RB $ MANROFFSEQ
+is interrogated. If
+.B \-p
+was not used and the environment variable was not set, the initial line of
+the nroff file is parsed for a preprocessor string. To contain a valid
+preprocessor string, the first line must resemble
+
+.B '\e"
+.RB < string >
+
+where
+.B string
+can be any combination of letters described by option
+.B \-p
+below.
+
+If none of the above methods provide any filter information, a default set
+is used.
+
+A formatting pipeline is formed from the filters and the primary
+formatter
+.RB ( nroff
+or
+.RB [ tg ] roff
+with
+.BR \-t )
+and executed.
+Alternatively, if an executable program
+.I mandb_nfmt
+(or
+.I mandb_tfmt
+with
+.BR \-t )
+exists in the man tree root, it is executed instead. It
+gets passed the manual source file, the preprocessor string, and
+optionally the device specified with
+.B \-T
+as arguments.
+.\" ********************************************************************
+.SH OPTIONS
+Non argument options that are duplicated either on the command line, in
+.RB $ MANOPT ,
+or both, are not harmful. For options that require an
+argument, each duplication will override the previous argument value.
+.TP
+.B \-l, \-\-local-file
+Activate `local' mode. Format and display local manual files instead of
+searching through the system's manual collection.
+Each manual page argument will be interpreted as an nroff source file in the
+correct format.
+.\" Compressed nroff source files with a supported compression.
+.\" extension will be decompressed by man prior to being displaying via the
+.\" usual filters.
+No cat
+file is produced. If '\-' is listed as one of the arguments, input will be
+taken from stdin.
+When this option is not used, and man fails to find the page required,
+before displaying the error message, it attempts to act as if this
+option was supplyed, using the name as a filename and looking for an
+exact match.
+.TP
+.BI \-L\ locale ,\ \-\-locale= locale
+.B %man%
+will normally determine your current locale by a call to the C function
+.BR setlocale (3)
+which interrogates various environment variables, possibly including
+.RB $ LC_MESSAGES
+and
+.RB $ LANG .
+To temporarily override the determined value, use this option to supply a
+.I locale
+string directly to
+.BR %man% .
+Note that it will not take effect until the search for pages actually
+begins.
+Output such as the help message will always be displayed in the initially
+determined locale.
+.TP
+.B \-D, \-\-default
+This option is normally issued as the very first option and resets
+.B %man%'s
+behaviour to its default. It's use is to reset those options that may have
+been set in
+.RB $ MANOPT .
+Any options that follow
+.B \-D
+will have their usual effect.
+.TP
+.BI \-M\ path ,\ \-\-manpath= path
+Specify an alternate manpath to use. By default,
+.B %man%
+uses
+.B %manpath%
+derived code to determine the path to search. This option overrides the
+.RB $ MANPATH
+environment variable and causes option
+.B \-m
+to be ignored.
+.TP
+.BI \-P\ pager ,\ \-\-pager= pager
+Specify which output pager to use. By default,
+.B %man%
+uses
+.BR %pager% .
+This option overrides the
+.RB $ PAGER
+environment variable and is not used in conjunction with
+.B \-f
+or
+.BR \-k .
+.TP
+.BI \-r\ prompt ,\ \-\-prompt= prompt
+If a recent version of
+.B less
+is used as the pager,
+.B %man%
+will attempt to set its prompt
+and some sensible options.
+The default prompt looks like
+
+.B \ Manual page\c
+.IB \ name ( sec )\c
+.BI \ line \ x
+
+where
+.I name
+denotes the manual page name,
+.I sec
+denotes the section it was found under
+and
+.IR x ,
+the current line number.
+.\"The default options are
+.\".BR \-six8 .
+This is achieved by using the
+.RB $ LESS
+environment variable.
+.\"The actual default will depend on your chosen
+.\".BR locale .
+
+Supplying
+.B \-r
+with a string will override this default.
+.\"You may need to do this if your
+.\"version of
+.\".B less
+.\"rejects the default options or if you prefer a different prompt.
+The string may contain the text
+.B $MAN_PN
+which will be expanded to the name of the current manual page and its
+section name encompassed by `(' and `)'. The string used to produce the
+default could be expressed as
+
+.B \e\ Manual\e\ page\e\ \e$MAN_PN\e\ ?ltline\e\ %lt?L/%L.:
+.br
+.B byte\e\ %bB?s/%s..?\e\ (END):?pB\ %pB\e\e%..
+
+It is broken into two lines here for the sake of readability only.
+For its meaning see the
+.BR less (1)
+manual page. The prompt string is first evaluated by
+the shell.
+All double quotes, back-quotes and
+backslashes in the prompt must be escaped by a preceding backslash. The
+prompt string may end in an escaped $ which may be followed by further
+options for less. By default
+.B %man%
+sets the
+.B \-ix8
+options.
+.TP
+.B \-7, \-\-ascii
+When viewing a pure
+.IR ascii (7)
+manual page on a 7 bit terminal or terminal
+emulator, some characters may not display correctly when using the
+.IR latin1 (7)
+device description with
+.B GNU
+.BR nroff .
+This option allows pure
+.I ascii
+manual pages to
+be displayed in
+.I ascii
+with the
+.I latin1
+device. It will not translate any
+.I latin1
+text. The following table shows the translations performed.
+
+.TS
+tab (@);
+l c c c.
+Description@Octal@latin1@ascii
+_
+continuation hyphen@255@\[char173]@-
+bullet (middle dot)@267@\(bu@o
+acute accent@264@\(aa@'
+multiplication sign@327@\(mu@x
+.TE
+
+If the
+.I latin1
+column displays correctly, your terminal may be set up for
+.I latin1
+characters and this option is not necessary.
+If the
+.I latin1
+and
+.I ascii
+columns are identical, you are reading this page
+using this option or
+.B %man%
+did not format this page using the
+.I latin1
+device description.
+If the
+.I latin1
+column is missing or corrupt,
+you may need to view manual pages with this option.
+
+This option is ignored when using options
+.BR \-t ,
+.B \-T
+or
+.B \-Z
+and may be useless for
+.B nroff
+other than
+.BR GNU's .
+.TP
+.BI \-S\ list ,\ \-\-sections= list
+List is a colon separated list of `order specific' manual sections to search.
+This option overrides the
+.RB $ MANSECT
+environment variable.
+.TP
+.B \-a, \-\-all
+By default,
+.B %man%
+will exit after displaying the most suitable manual page it
+finds. Using this option forces
+.B %man%
+to display all the manual pages with
+names that match the search criteria.
+.TP
+.B \-c, \-\-catman
+This option is not for general use and should only be used by the
+.B %catman%
+program.
+.TP
+.B \-d, \-\-debug
+Don't actually display any manual pages, but do print lots of debugging
+information.
+.TP
+.BI \-e\ sub-extension ,\ \-\-extension= sub-extension
+Some systems incorporate large packages of manual pages, such as those that
+accompany the
+.B Tcl
+package, into the main manual page hierarchy. To get around the problem of
+having two manual pages with the same name such as
+.BR exit (3),
+the
+.B Tcl
+pages were usually all assigned to section
+.BR l .
+As this is unfortunate, it is now possible to put the pages in the correct
+section, and to assign a specific `extension' to them, in this case,
+.BR exit (3tcl).
+Under normal operation,
+.B %man%
+will display
+.BR exit (3)
+in preference to
+.BR exit (3tcl).
+To negotiate this situation and to avoid having to know which section the page
+you require resides in, it is now possible to give
+.B %man%
+a
+.l sub-extension
+string indicating which package the page must belong to. Using the above
+example, supplying
+the option
+.B \-e\ tcl
+to
+.B %man%
+will restrict the search to pages having an extension of
+.BR *tcl .
+.TP
+.B \-f, \-\-whatis
+Equivalent to
+.BR %whatis% .
+Display a short description from the manual page, if available. See
+.BR %whatis% (1)
+for details.
+.TP
+.B \-h, \-\-help
+Print a help message and exit.
+.TP
+.B \-k, \-\-apropos
+Equivalent to
+.BR %apropos% .
+Search the short manual page descriptions for keywords and display any
+matches. See
+.BR %apropos% (1)
+for details.
+.\"
+.\" Due to the rather silly limit of 6 args per request in some `native'
+.\" *roff compilers, we have do the following to get the two-line
+.\" hanging tag on one line. .PP to begin a new paragraph, then the
+.\" tag, then .RS (start relative indent), the text, finally .RE
+.\" (end relative indent).
+.\"
+.PP
+.B \-m
+.I system\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= system\c
+\|[\|,.\|.\|.\|]
+.RS
+If this system has access to other operating system's manual pages, they can
+be accessed using this option.
+To search for a manual page from NewOS's manual page collection,
+use the option
+.B \-m
+.BR NewOS .
+
+The
+.I system
+specified can be a combination of comma delimited operating
+system names.
+To include a search of the native operating system's
+manual pages, include the system name
+.B man
+in the argument string.
+This option will override the
+.RB $ SYSTEM
+environment variable.
+.RE
+.TP
+.BI \-p\ string ,\ \-\-preprocessor= string
+Specify the sequence of preprocessors to run before
+.B nroff
+or
+.BR troff / groff .
+Not all installations will have a full set of preprocessors.
+Some of the preprocessors and the letters used to designate them are:
+.BR eqn " (" e ),
+.BR grap " (" g ),
+.BR pic " (" p ),
+.BR tbl " (" t ),
+.BR vgrind " (" v ),
+.BR refer " (" r ).
+This option overrides the
+.RB $ MANROFFSEQ
+environment variable.
+.B %zsoelim%
+is always run as the very first preprocessor.
+.TP
+.B \-u, \-\-update
+The
+.B index
+database caches are updated `on the fly', that is, they do not require
+.B %mandb%
+to be run periodically to be kept consistent. If your chosen manual page is
+not located within the cache or the
+.B \-a
+option is used,
+.B %man%
+will do a `directory level' consistency check to ensure that its caches
+are an accurate representation of the filesystem.
+To force an `inode level' consistency check prior to
+finding any manual pages, use option
+.BR \-u .
+.TP
+.B \-t, \-\-troff
+Use
+.I %troff%
+to format the manual page to stdout.
+This option is not required in conjunction with either
+.B \-T
+or
+.BR \-Z .
+.PP
+.BI \-T\ device ,\ \-\-troff-device
+.RI [\| =device \|]
+.RS
+This option is used
+to change
+.B groff
+(or possibly
+.BR troff's )
+output to be suitable for a device
+other than the default.
+It implies
+.BR \-t .
+Examples (provided with Groff-1.09) include
+.BR dvi ", " latin1 ,
+.BR X75 " and " X100 .
+.RE
+.TP
+.B \-Z, \-\-ditroff
+.B groff
+will run
+.B troff
+and then use an appropriate post-processor to produce output suitable for
+the chosen device. If
+.I %troff%
+is
+.BR groff ,
+this option is passed to
+.B groff
+and will suppress the use of a post-processor.
+It implies
+.BR \-t .
+.TP
+.B \-w, \-\-where, \-\-location
+Don't actually display the manual pages, but do print the location(s) of
+the files that would be formatted or displayed. If the file is a cat
+file, also show the location of its source nroff file.
+.TP
+.B \-V, \-\-version
+Display version and author information.
+.SH "EXIT STATUS"
+.TP
+.B 0
+Successful program execution.
+.TP
+.B 1
+Usage, syntax or configuration file error.
+.TP
+.B 2
+Operational error.
+.TP
+.B 3
+A child process returned a non-zero exit status.
+.TP
+.B 16
+At least one of the pages/files/keywords didn't exist or wasn't
+matched.
+.SH ENVIRONMENT
+.\".TP \w'MANROFFSEQ\ \ 'u
+.TP
+.B MANPATH
+If
+.RB $ MANPATH
+is set, its value is used as the path to search for manual pages.
+.TP
+.B MANROFFSEQ
+If
+.RB $ MANROFFSEQ
+is set, its value is used to determine the set of preprocessors to pass
+each manual page through.
+The default preprocessor list is system dependent.
+.TP
+.B MANSECT
+If
+.RB $ MANSECT
+is set, its value is a colon delimited list of sections and it is used to
+determine which manual sections to search and in what order.
+.TP
+.B PAGER
+If
+.RB $ PAGER
+is set, its value is used as the name of the program used to display
+the manual page. By default,
+.B %pager%
+is used.
+.TP
+.B SYSTEM
+If
+.RB $ SYSTEM
+is set, it will have the same effect as option
+.B \-m "string"
+where string will be taken as
+.RB $ SYSTEM 's
+contents.
+.TP
+.B MANOPT
+If
+.RB $ MANOPT
+is set, it will be parsed prior to
+.B %man%'s
+command line and is expected to be in a similar format. As all of the
+other
+.B %man%
+specific environment variables can be expressed as command line options, and
+are thus candidates for being included in
+.RB $ MANOPT
+it is expected that they will become obsolete.
+N.B. All spaces that should be interpreted as part of an option's argument
+must be escaped.
+.TP
+.BR LANG , " LC_MESSAGES"
+Depending on system and implementation, either or both of
+.RB $ LANG
+and
+.RB $ LC_MESSAGES
+will be interrogated for the current message locale.
+.B %man%
+will display its messages in that locale (if available). See
+.BR setlocale (3)
+for precise details.
+.SH FILES
+.TP
+.I %manpath_config_file%
+man_db configuration file.
+.TP
+.I /usr/share/man
+A global manual page hierarchy.
+.TP
+.I /usr/share/man/index.(bt|db|dir|pag)
+A traditional global
+.I index
+database cache.
+.TP
+.I /var/cache/man/index.(bt|db|dir|pag)
+An alternate or FHS
+compliant global
+.I index
+database cache.
+.SH "SEE ALSO"
+.BR %mandb% (8),
+.BR %manpath% (1),
+.BR manpath (5),
+.BR %apropos% (1),
+.BR %whatis% (1),
+.BR %catman% (8),
+.BR less (1),
+.BR nroff (1),
+.BR troff (1),
+.BR groff (1),
+.BR %zsoelim% (1),
+.BR setlocale (3),
+.BR ascii (7),
+.BR latin1 (7),
+.BR FSSTND .
+.SH HISTORY
+1990, 1991 \- Originally written by John W. Eaton (jwe@che.utexas.edu).
+
+Dec 23 1992: Rik Faith (faith@cs.unc.edu) applied bug fixes
+supplied by Willem Kasdorp (wkasdo@nikhefk.nikef.nl).
+
+April 30th, 1994 - %date%: Wilf.
+(G.Wilford@ee.surrey.ac.uk) has been developing and maintaining this package
+with the help of a few dedicated people.
+
+30th Oct, 1996 - %curdate%: Fabrizio Polacco <fpolacco@debian.org> is
+maintaining and enhancing this package for the Debian project, with the
+help of all the community.
diff --git a/man/man1/manpath.man1 b/man/man1/manpath.man1
new file mode 100644
index 00000000..99289aff
--- /dev/null
+++ b/man/man1/manpath.man1
@@ -0,0 +1,125 @@
+.\" Man page for manpath
+.\"
+.\" Copyright (C), 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the COPYING file that comes with the
+.\" man_db distribution.
+.\"
+.\" Sun Jan 22 22:15:17 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH %manpath% 1 "%date%" "%version%" "Manual pager utils"
+.SH NAME
+%manpath% \- determine search path for manual pages
+.SH SYNOPSIS
+.B %manpath%
+.RB [\| \-qgdc \|]
+.RB [\| \-m
+.IR system \|[\|,.\|.\|.\|]\|]
+.SH DESCRIPTION
+If
+.RB $ MANPATH
+is set,
+.B %manpath%
+will simply display its contents and issue a warning.
+If not,
+.B %manpath%
+will determine a suitable manual page hierarchy search path and display the
+results.
+
+The colon delimited path is determined using information gained from the
+man_db configuration file -
+.RI ( "%manpath_config_file%" )
+and the user's environment.
+.SH OPTIONS
+.TP
+.B \-q, \-\-quiet
+Do not issue warnings.
+.TP
+.B \-d, \-\-debug
+Produce debugging information.
+.TP
+.B \-c, \-\-catpath
+Produce a catpath as opposed to a manpath.
+Once the manpath is determined,
+each path element is converted to its relative catpath.
+.TP
+.B \-g, \-\-global
+Produce a manpath consisting of all paths named as `global' within the
+man_db configuration file.
+.\"
+.\" Due to the rather silly limit of 6 args per request in some `native'
+.\" *roff compilers, we have do the following to get the two-line
+.\" hanging tag on one line. .PP to begin a new paragraph, then the
+.\" tag, then .RS (start relative indent), the text, finally .RE
+.\" (end relative indent).
+.\"
+.PP
+.B \-m
+.I system\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= system\c
+\|[\|,.\|.\|.\|]
+.RS
+If this system has access to other operating system's manual hierarchies,
+this option can be used to include them in the output of
+.BR %manpath% .
+To include NewOS's manual page hierarchies use the option
+.B \-m
+.BR NewOS .
+
+The
+.I system
+specified can be a combination of comma delimited operating
+system names.
+To include the native operating system's manual page hierarchies,
+the system name
+.B man
+must be included in the argument string.
+This option will override the
+.RB $ SYSTEM
+environment variable.
+.RE
+.TP
+.B \-h, \-\-help
+Print a help message and exit.
+.TP
+.B \-V, \-\-version
+Display version and author information.
+.SH ENVIRONMENT
+.TP
+.B MANPATH
+If
+.RB $ MANPATH
+is set,
+.B %manpath%
+displays its value rather than determining it on the fly.
+If
+.RB $ MANPATH
+is prefixed by a semicolon, then the value of the variable is appended
+to the list determined from the content of the configuration files. If
+the semicolon comes at the end of the value in the variable, then the
+determined list is appended after the content of the variable. If the
+value of the variable contains a double semicolon
+.RB ( :: ),
+then the determined list is inserted in the middle of the value, between
+the two semicolons.
+.TP
+.B SYSTEM
+If
+.RB $ SYSTEM
+is set, it will have the same effect as if it had been specified as the
+argument to the
+.B \-m
+option.
+.SH FILES
+.TP \w'%manpath_config_file%'u+2n
+.I %manpath_config_file%
+System configuration file.
+.SH "SEE ALSO"
+.BR %apropos% (1),
+.BR %whatis% (1),
+.BR %man% (1).
+.SH AUTHOR
+Wilf. (G.Wilford@ee.surrey.ac.uk).
+Fabrizio Polacco (fpolacco@debian.org).
diff --git a/man/man1/whatis.man1 b/man/man1/whatis.man1
new file mode 100644
index 00000000..55554aa8
--- /dev/null
+++ b/man/man1/whatis.man1
@@ -0,0 +1,192 @@
+.\" Man page for whatis
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH %whatis% 1 "%date%" "%version%" "Manual pager utils"
+.SH NAME
+%whatis% \- display manual page descriptions
+.SH SYNOPSIS
+.B %whatis%
+.RB [\| \-dhV \|]
+.RB [\| \-r \||\| \-w\c
+\|]
+.RB [\| \-m
+.IR system \|[\|,.\|.\|.\|]\|]
+.RB [\| \-M
+.IR path \|]
+.I name
+\&.\|.\|.
+.SH DESCRIPTION
+Each manual page has a short description available within
+it.
+.B %whatis%
+searches the manual page names and displays the manual page descriptions
+of any
+.I name
+matched.
+
+.I name
+may contain wildcards
+.RB ( \-w )
+or be a regular expression
+.RB ( \-r ).
+Using these options,
+it may be
+necessary to quote the
+.I name
+or escape (\\) the special characters to stop the shell from interpreting
+them.
+
+.B index
+databases are used during the search.
+To produce an old style text
+.B whatis
+database from the relative
+.B index
+database, issue the command:
+
+.B %whatis% \-M
+.I manpath
+.B \-w '*' | sort >
+.I manpath/whatis
+
+where
+.I manpath
+is a manual page hierarchy such as
+.IR /usr/man .
+.SH OPTIONS
+.TP
+.B \-d, \-\-debug
+Print debugging information.
+.TP
+.B \-r, \-\-regex
+Interpret each
+.I name
+as a regular expression.
+If a
+.I name
+matches any part of a page name, a match will be made.
+This option causes
+.B %whatis%
+to be somewhat slower due to the nature of database searches.
+.TP
+.B \-w, \-\-wildcard
+Interpret each
+.I name
+as a pattern containing shell style wildcards.
+For a match to be made, an expanded
+.I name
+must match the entire page name.
+This option causes
+.B %whatis%
+to be somewhat slower due to the nature of database searches.
+.\"
+.\" Due to the rather silly limit of 6 args per request in some `native'
+.\" *roff compilers, we have do the following to get the two-line
+.\" hanging tag on one line. .PP to begin a new paragraph, then the
+.\" tag, then .RS (start relative indent), the text, finally .RE
+.\" (end relative indent).
+.\"
+.PP
+.B \-m
+.I system\c
+.RB \|[\|,.\|.\|.\|]\| ,
+.BI \-\-systems= system\c
+\|[\|,.\|.\|.\|]
+.RS
+If this system has access to other operating system's manual page names,
+they can be accessed using this option.
+To search NewOS's manual page names,
+use the option
+.B \-m
+.BR NewOS .
+
+The
+.I system
+specified can be a combination of comma delimited operating
+system names.
+To include a search of the native operating system's
+manual page names, include the system name
+.B man
+in the argument string.
+This option will override the
+.RB $ SYSTEM
+environment variable.
+.RE
+.TP
+.BI \-M\ path ,\ \-\-manpath= path
+Specify an alternate set of colon delimited, manual page hierarchies to
+search.
+By default,
+.B %apropos%
+uses the
+.RB $ MANPATH
+environment variable unless it is empty or unset in which case it will
+determine an appropriate manpath based on your
+.RB $ PATH
+environment variable.
+This option overrides the contents of
+.RB $ MANPATH .
+.TP
+.B \-h, \-\-help
+Print a help message and exit.
+.TP
+.B \-V, \-\-version
+Display version and author information.
+.SH "EXIT STATUS"
+.TP
+.B 0
+Successful program execution.
+.TP
+.B 1
+Usage, syntax or configuration file error.
+.TP
+.B 2
+Operational error.
+.TP
+.B 16
+No manual pages were found that matched the criteria specified.
+.SH ENVIRONMENT
+.TP
+.B SYSTEM
+If
+.RB $ SYSTEM
+is set, it will have the same effect as if it had been specified as the
+argument to the
+.B \-m
+option.
+.TP
+.B MANPATH
+If
+.RB $ MANPATH
+is set, its value is interpreted as the colon delimited, manual page
+hierarchy search path to use.
+.SH FILES
+.TP
+.I /usr/share/man/index.(bt|db|dir|pag)
+A traditional global
+.I index
+database cache.
+.TP
+.I /var/cache/man/index.(bt|db|dir|pag)
+An alternate or FSSTND
+compliant global
+.I index
+database cache.
+.TP
+.I /usr/share/man/\|.\|.\|.\|/whatis
+A traditional
+.B whatis
+text database.
+.SH "SEE ALSO"
+.BR %apropos% (1),
+.BR %man% (1).
+.SH AUTHOR
+Wilf. (G.Wilford@ee.surrey.ac.uk).
+Fabrizio Polacco (fpolacco@debian.org).
diff --git a/man/man1/zsoelim.man1 b/man/man1/zsoelim.man1
new file mode 100644
index 00000000..eee5471e
--- /dev/null
+++ b/man/man1/zsoelim.man1
@@ -0,0 +1,72 @@
+.\" Man page for %zsoelim%
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Dec 10 19:33:32 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH %zsoelim% 1 "%date%" "%version%" "Manual pager utils"
+.SH NAME
+%zsoelim% \- satisfy .so requests in roff input
+.SH SYNOPSIS
+.B %zsoelim%
+.RB [\| \-CVh \|]
+.RI [\| file
+\&.\|.\|.\|]
+.SH DESCRIPTION
+.B %zsoelim%
+parses
+.I file
+arguments, or if none are specified, its standard input for lines of the
+form:
+
+.B .so
+.RI <\| filename \|>
+
+These requests are replaced by the contents of the
+.I filename
+specified. If the request cannot be met,
+.B %zsoelim%
+looks for
+.I filename.ext
+where
+.I .ext
+can be one of
+.BR .gz ,
+.BR .Z
+or
+.BR .z .
+Other extension types may be supported depending upon compile time options.
+If the request can be met by a compressed file, this file is decompressed
+using an appropriate decompressor and its output is used to satisfy
+the request.
+
+Traditionally,
+.B soelim
+programs were used to allow roff preprocessors to be able to preprocess the
+files referred to by the requests. This particular version was written
+to circumvent problems created by support for compressed manual pages.
+.SH OPTIONS
+.TP
+.B \-C
+This flag is available for compatibility with other
+.B soelim
+programs. It's use is to enable .so requests followed by something other than
+whitespace. As this is already the default behaviour, it is ignored.
+.TP
+.B \-h
+Print a help message and exit.
+.TP
+.B \-V
+Display version and author information.
+.SH "SEE ALSO"
+.BR nroff (1),
+.BR troff (1),
+.BR groff (1),
+.BR %man% (1).
+.SH AUTHOR
+Wilf. (G.Wilford@ee.surrey.ac.uk).
+Fabrizio Polacco (fpolacco@debian.org).
diff --git a/man/man5/manpath.man5 b/man/man5/manpath.man5
new file mode 100644
index 00000000..50a313ee
--- /dev/null
+++ b/man/man5/manpath.man5
@@ -0,0 +1,102 @@
+.\" Man page for format of the manpath.config data file
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH manpath 5 "%date%" "%version%" "%manpath_config_file%"
+.SH NAME
+manpath \- format of the %manpath_config_file% file
+.SH DESCRIPTION
+The manpath configuration file is used by the manual page utilities
+to assess users' manpaths at run time, to indicate which manual page
+hierarchies (manpaths) are to be
+treated as `global' and to assign them directories to be used for storing
+cat files.
+
+If the environment variable
+.RB $ MANPATH
+is already set, the information contained within %manpath_config_file% will
+not override it.
+.SH FORMAT
+The following field types are currently recognised:
+.TP
+.BI # \ comment
+Blank lines or those beginning with a
+.B #
+will be treated as comments and ignored.
+.TP
+.BI MANDATORY_MANPATH \ manpath_element
+Lines of this form indicate manpaths that every automatically generated
+.RB $ MANPATH
+should contain. This will typically include
+.IR /usr/man .
+.TP
+.BI MANPATH_MAP \ path_element\ manpath_element
+Lines of this form set up
+.RB $ PATH
+to
+.RB $ MANPATH
+mappings. For each
+.I path_element
+found in the user's
+.RB $ PATH ,
+.I manpath_element
+will be added to the
+.RB $ MANPATH .
+.TP
+\fBMANDB_MAP \fImanpath_element \fR\|[\| \fIcatpath_element\fR \|]
+Lines of this form indicate which manpaths are to be treated as `global'
+and optionally, where their cat files should be stored.
+This field type is particularly important if
+.B man
+is a setuid program, as it indicates
+which manual page hierarchies to access as the setuid user and which as the
+invoking user.
+
+The `global' manual page hierarchies are usually those stored under
+.I /usr
+such as
+.IR /usr/man ,
+.I /usr/local/man
+and
+.IR /usr/X11R6/man .
+
+If cat pages from a particular
+.I manpath_element
+are not to be stored or are to be stored in the traditional location,
+.I catpath_element
+may be omitted.
+
+Traditional cat placement would be impossible for read only mounted manual
+page hierarchies and because of this it is possible to specify any valid
+directory hierarchy for their storage. To observe the
+.B Linux FSSTND
+the keyword
+.RB ` FSSTND '
+can be used in place of an actual directory.
+
+Unfortunately, it is necessary to specify
+.B all
+`global' man tree paths, including alternate system paths such as
+.I /usr/man/sun
+and any
+.B NLS locale
+paths such as
+.IR /usr/man/de_DE.88591 .
+
+As the information is parsed line by line in the order written, it is
+necessary for any
+manpath that is a sub-hierarchy of another hierarchy to be listed
+first, otherwise an incorrect match will be made.
+An example is that
+.I /usr/man/de_DE.88591
+must come before
+.IR /usr/man .
+.SH BUGS
+Unless the rules above are followed and observed precisely, the manual pager
+utilities will not function as desired. The rules are overly complicated.
diff --git a/man/man8/accessdb.man8 b/man/man8/accessdb.man8
new file mode 100644
index 00000000..431a7fa7
--- /dev/null
+++ b/man/man8/accessdb.man8
@@ -0,0 +1,44 @@
+.\" Man page for accessdb
+.\"
+.\" Copyright (c) 1998 Fabrizio Polacco <fpolacco@debian.org
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Tue, 24 Feb 1998 18:18:36 +0200
+.\"
+.TH accessdb 8 "%date%" "%version%" "Manual pager utils"
+.SH NAME
+accessdb \- dumps the content of a man-db database in a human readable
+format.
+.SH SYNOPSIS
+.B /usr/sbin/accessdb
+.RI [ <index-file> ]
+.SH DESCRIPTION
+.B accessdb
+will output the data contained within a man_db database in a
+human readable form. By default, it will dump the data from
+.B /var/catman/index.<db-type>,
+where <db-type> is dependent on the database library in use.
+
+Supplying an argument to accessdb will override this
+default.
+
+.nf
+$mtime$ -> "795987034"
+$version$ -> "2.3.1"
+apropos -> "1 1 795981542 A - - search the manual page names and descriptions"
+catman -> "8 8 795981544 A - - create or update the pre-formatted manual pages"
+man -> "1 1 795981542 A - - an interface to the on-line reference manuals"
+mandb -> "8 8 795981544 A - - create or update the manual page index caches"
+manpath -> " 1 5"
+manpath~1 -> "1 1 795981542 A - - determine search path for manual pages"
+manpath~5 -> "5 5 795981543 A - - format of the /etc/man_db.config file"
+whatis -> "1 1 795981543 A - - search the manual page names"
+zsoelim -> "1 1 795981543 A - - satisfy .so requests in roff input"
+.fi
+
+.SH AUTHOR
+Wilf. (G.Wilford@ee.surrey.ac.uk).
+Fabrizio Polacco (fpolacco@debian.org).
diff --git a/man/man8/catman.man8 b/man/man8/catman.man8
new file mode 100644
index 00000000..b5410b55
--- /dev/null
+++ b/man/man8/catman.man8
@@ -0,0 +1,100 @@
+.\" Man page for catman
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Sat Dec 10 14:17:29 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH %catman% 8 "%date%" "%version%" "Manual pager utils"
+.SH NAME
+%catman% \- create or update the pre-formatted manual pages
+.SH SYNOPSIS
+.B %catman%
+.RB [\| \-dhV \|]
+.RB [\| \-M
+.IR path \|]
+.RI [\| section \|]
+\&.\|.\|.
+.SH DESCRIPTION
+.B %catman%
+is used to create an up to date set of pre-formatted manual pages known as
+cat pages.
+Cat pages are generally much faster to display than the original
+manual pages, but require extra storage space. The decision to
+support cat pages is that of the local administrator, who must provide
+suitable directories to contain them.
+
+The options available to
+.B %catman%
+are the manual page hierarchies and sections to pre-format. The
+default hierarchies are those specified as `global' in the man_db
+configuration file and the default sections are either
+the colon delimited contents of the environment variable
+.RB $ MANSECT
+or the standard set compiled into
+.B %man%
+if
+.RB $ MANSECT
+is undefined. Supplying
+.B %catman%
+with a set of whitespace delimited section names will override both of
+the above.
+
+.B %catman%
+makes use of the
+.B index
+database cache associated with each hierarchy to determine which files
+need to be formatted.
+.SH OPTIONS
+.TP
+.B \-d, \-\-debug
+Print debugging information.
+.TP
+.BI \-M\ path ,\ \-\-manpath= path
+Specify an alternate colon delimited manual page hierarchy search path.
+By default, this is all paths indicated as `global'
+in the man_db configuration file.
+.TP
+.B \-h, \-\-help
+Print a help message and exit.
+.TP
+.B \-V, \-\-version
+Display version and author information.
+.SH ENVIRONMENT
+.TP
+.B MANSECT
+If
+.RB $ MANSECT
+is set, its value is a colon delimited list of sections and it is used to
+determine which manual sections to search and in what order.
+.TP
+.B MANPATH
+If
+.RB $ MANPATH
+is set, its value is interpreted as the colon delimited, manual page
+hierarchy search path to use.
+.SH FILES
+.TP
+.I %manpath_config_file%
+man_db configuration file.
+.TP
+.I /usr/man/index.(bt|db|dir|pag)
+A traditional global
+.I index
+database cache.
+.TP
+.I /var/catman/index.(bt|db|dir|pag)
+An alternate or FSSTND
+compliant global
+.I index
+database cache.
+.SH "SEE ALSO"
+.BR %man% (1),
+.BR manpath (5),
+.BR %mandb% (8).
+.SH AUTHOR
+Wilf. (G.Wilford@ee.surrey.ac.uk).
+Fabrizio Polacco (fpolacco@debian.org).
diff --git a/man/man8/mandb.man8 b/man/man8/mandb.man8
new file mode 100644
index 00000000..6a2cfa3e
--- /dev/null
+++ b/man/man8/mandb.man8
@@ -0,0 +1,145 @@
+'\" t
+.\" Man page for mandb
+.\"
+.\" Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+.\"
+.\" You may distribute under the terms of the GNU General Public
+.\" License as specified in the file COPYING that comes with the
+.\" man_db distribution.
+.\"
+.\" Tue Apr 26 12:56:44 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+.\"
+.TH %mandb% 8 "%date%" "%version%" "Manual pager utils"
+.SH NAME
+%mandb% \- create or update the manual page index caches
+.SH SYNOPSIS
+.B %mandb%
+.RB [\| \-dqsuc \||\| \-h \||\| \-V\c
+.RI "\|] [\|" manpath \|]
+.SH DESCRIPTION
+.B %mandb%
+is used to initialise or manually update
+.B index
+database caches that are usually maintained by
+.BR %man% .
+The caches contain information relevant to the current state of the manual
+page system and the information stored within them is used by the man_db
+utilities to enhance their speed and functionality.
+
+When creating or updating an
+.BR index ,
+.B %mandb%
+will warn of bad ROFF .so requests, bogus manual page filenames and
+manual pages from which the
+.B whatis
+cannot be parsed.
+
+Supplying
+.B %mandb%
+with an optional colon delimited path will override the internal `global'
+manual page hierarchy search path, determined from information found within
+the man_db configuration file.
+.SH "DATABASE CACHES"
+.B %mandb%
+can be compiled with support for any one of the following database types.
+
+.TS
+tab (@);
+l l l l.
+Name@Type@Async@Filename
+_
+Berkeley db@Binary tree@Yes@\fIindex.bt\fR
+GNU gdbm v >= 1.6@Hashed@Yes@\fIindex.db\fR
+GNU gdbm v < 1.6@Hashed@No@\fIindex.db\fR
+UNIX ndbm@Hashed@No@\fIindex.(dir|pag)\fR
+.TE
+
+Those database types that support asynchronous updates provide enhanced
+speed at the cost of possible corruption in the event of unusual
+termination.
+In an unusual case where this has occured, it may be necessary to rerun
+.B %mandb%
+with the
+.B \-c
+option to re-create the databases from scratch.
+.SH OPTIONS
+.TP
+.B \-d, \-\-debug
+Produce debugging information.
+.TP
+.B \-q, \-\-quiet
+Produce no warnings.
+.TP
+.B \-s, \-\-no-straycats
+Do not spend time looking for or adding information to the databases
+regarding stray cats.
+.TP
+.B \-c, \-\-create
+By default,
+.B %mandb%
+will try to update any previously created databases. If a database
+does not exist, it will create it. This option forces
+.B %mandb%
+to delete previous databases and re-create them from scratch. This may be
+necessary if a database becomes corrupt or if a new database storage scheme
+is introduced in the future.
+.TP
+.B \-u, \-\-user-db
+Create user databases only, even with write permissions necessary to create
+`global' databases.
+.TP
+.B \-h, \-\-help
+Show the usage message, then exit.
+.TP
+.B \-V, \-\-version
+Show the version, then exit.
+.SH DIAGNOSTICS
+The following warning messages can be emitted during database building.
+.TP
+.B <filename>: whatis parse for page(sec) failed
+An attempt to extract whatis line(s) from the given
+<filename> failed. This is usually due to a poorly written manual
+page, but if many such messages are emitted it is likely that the
+system contains non-standard manual pages which are incompatible with
+the man_db whatis parser.
+.TP
+.B <filename>: is a dangling symlink
+<filename> does not exist but is referenced by a symbolic link.
+Further diagnostics are usually emitted to identify the <filename> of the
+offending link.
+.TP
+.B <filename>: bad symlink or ROFF `.so' request
+<filename> is either a symbolic link to, or contains a ROFF include
+request to, a non existent file.
+.TP
+.B <filename>: ignoring bogus filename
+The <filename> may or may not be a valid manual page but its name is
+invalid. This is usually due to a manual page with sectional extension <x>
+being put in manual page section <y>.
+.TP
+.B <filename_mask>: competing extensions
+The wildcard <filename_mask> is not unique. This is usually caused by
+the existance of both a compressed and uncompressed version of the same
+manual page. All but the most recent are ignored.
+.SH FILES
+.TP
+.I %manpath_config_file%
+man_db configuration file.
+.TP
+.I /usr/man/index.(bt|db|dir|pag)
+A traditional global
+.I index
+database cache.
+.TP
+.I /var/catman/index.(bt|db|dir|pag)
+An alternate or FSSTND
+compliant global
+.I index
+database cache.
+.SH "SEE ALSO"
+.BR %man% (1),
+.BR manpath (5),
+.BR %catman% (8).
+.SH AUTHOR
+Wilf. (G.Wilford@ee.surrey.ac.uk).
+Fabrizio Polacco (fpolacco@debian.org).
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
new file mode 100644
index 00000000..37ca4db1
--- /dev/null
+++ b/po/Makefile.in.in
@@ -0,0 +1,247 @@
+# Makefile for program source directory in GNU NLS utilities package.
+# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+#
+# This file file be copied and used freely without restrictions. It can
+# be used in projects which are not available under the GNU Public License
+# but which still want to provide support for the GNU gettext functionality.
+# Please note that the actual code is *not* freely available.
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+SHELL = /bin/sh
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datadir = $(prefix)/@DATADIRNAME@
+localedir = $(datadir)/locale
+gnulocaledir = $(prefix)/share/locale
+gettextsrcdir = $(prefix)/share/gettext/po
+subdir = po
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@
+
+CC = @CC@
+GENCAT = @GENCAT@
+GMSGFMT = PATH=../src:$$PATH @GMSGFMT@
+MSGFMT = @MSGFMT@
+XGETTEXT = PATH=../src:$$PATH @XGETTEXT@
+MSGMERGE = PATH=../src:$$PATH msgmerge
+
+DEFS = @DEFS@
+CFLAGS = @CFLAGS@
+CPPFLAGS = @CPPFLAGS@
+
+INCLUDES = -I.. -I$(top_srcdir)/intl
+
+COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS)
+
+SOURCES = cat-id-tbl.c
+POFILES = @POFILES@
+GMOFILES = @GMOFILES@
+DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \
+stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES)
+
+POTFILES = \
+
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
+INSTOBJEXT = @INSTOBJEXT@
+
+.SUFFIXES:
+.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat
+
+.c.o:
+ $(COMPILE) $<
+
+.po.pox:
+ $(MAKE) $(PACKAGE).pot
+ $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox
+
+.po.mo:
+ $(MSGFMT) -o $@ $<
+
+.po.gmo:
+ file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \
+ && rm -f $$file && $(GMSGFMT) -o $$file $<
+
+.po.cat:
+ sed -f ../intl/po2msg.sed < $< > $*.msg \
+ && rm -f $@ && $(GENCAT) $@ $*.msg
+
+
+all: all-@USE_NLS@
+
+all-yes: cat-id-tbl.c $(CATALOGS)
+all-no:
+
+$(srcdir)/$(PACKAGE).pot: $(POTFILES)
+ $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
+ --add-comments --keyword=_ --keyword=N_ \
+ --files-from=$(srcdir)/POTFILES.in
+ rm -f $(srcdir)/$(PACKAGE).pot
+ mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
+
+$(srcdir)/cat-id-tbl.c: stamp-cat-id; @:
+$(srcdir)/stamp-cat-id: $(PACKAGE).pot
+ rm -f cat-id-tbl.tmp
+ sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \
+ | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp
+ if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \
+ rm cat-id-tbl.tmp; \
+ else \
+ echo cat-id-tbl.c changed; \
+ rm -f $(srcdir)/cat-id-tbl.c; \
+ mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \
+ fi
+ cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id
+
+
+install: install-exec install-data
+install-exec:
+install-data: install-data-@USE_NLS@
+install-data-no: all
+install-data-yes: all
+ if test -r $(MKINSTALLDIRS); then \
+ $(MKINSTALLDIRS) $(datadir); \
+ else \
+ $(top_srcdir)/mkinstalldirs $(datadir); \
+ fi
+ @catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ case "$$cat" in \
+ *.gmo) destdir=$(gnulocaledir);; \
+ *) destdir=$(localedir);; \
+ esac; \
+ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+ dir=$$destdir/$$lang/LC_MESSAGES; \
+ if test -r $(MKINSTALLDIRS); then \
+ $(MKINSTALLDIRS) $$dir; \
+ else \
+ $(top_srcdir)/mkinstalldirs $$dir; \
+ fi; \
+ if test -r $$cat; then \
+ $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
+ echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \
+ else \
+ $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \
+ echo "installing $(srcdir)/$$cat as" \
+ "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \
+ fi; \
+ if test -r $$cat.m; then \
+ $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
+ echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
+ else \
+ if test -r $(srcdir)/$$cat.m ; then \
+ $(INSTALL_DATA) $(srcdir)/$$cat.m \
+ $$dir/$(PACKAGE)$(INSTOBJEXT).m; \
+ echo "installing $(srcdir)/$$cat as" \
+ "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \
+ else \
+ true; \
+ fi; \
+ fi; \
+ done
+ if test "$(PACKAGE)" = "gettext"; then \
+ if test -r $(MKINSTALLDIRS); then \
+ $(MKINSTALLDIRS) $(gettextsrcdir); \
+ else \
+ $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \
+ fi; \
+ $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
+ $(gettextsrcdir)/Makefile.in.in; \
+ else \
+ : ; \
+ fi
+
+# Define this as empty until I found a useful application.
+installcheck:
+
+uninstall:
+ catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+ rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
+ rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
+ rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \
+ rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \
+ done
+ rm -f $(gettextsrcdir)/po-Makefile.in.in
+
+check: all
+
+cat-id-tbl.o: ../intl/libgettext.h
+
+dvi info tags TAGS ID:
+
+mostlyclean:
+ rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp
+ rm -fr *.o
+
+clean: mostlyclean
+
+distclean: clean
+ rm -f Makefile Makefile.in POTFILES *.mo *.gmo *.msg *.cat *.cat.m
+
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ rm -f $(GMOFILES)
+
+distdir = ../$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir: update-po $(DISTFILES)
+ dists="$(DISTFILES)"; \
+ for file in $$dists; do \
+ ln $(srcdir)/$$file $(distdir) 2> /dev/null \
+ || cp -p $(srcdir)/$$file $(distdir); \
+ done
+
+update-po: Makefile
+ $(MAKE) $(PACKAGE).pot
+ PATH=`pwd`/../src:$$PATH; \
+ cd $(srcdir); \
+ catalogs='$(CATALOGS)'; \
+ for cat in $$catalogs; do \
+ cat=`basename $$cat`; \
+ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
+ mv $$lang.po $$lang.old.po; \
+ echo "$$lang:"; \
+ if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \
+ rm -f $$lang.old.po; \
+ else \
+ echo "msgmerge for $$cat failed!"; \
+ rm -f $$lang.po; \
+ mv $$lang.old.po $$lang.po; \
+ fi; \
+ done
+
+POTFILES: POTFILES.in
+ ( if test 'x$(srcdir)' != 'x.'; then \
+ posrcprefix='$(top_srcdir)/'; \
+ else \
+ posrcprefix="../"; \
+ fi; \
+ rm -f $@-t $@ \
+ && (sed -e '/^#/d' -e '/^[ ]*$$/d' \
+ -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \
+ | sed -e '$$s/\\$$//') > $@-t \
+ && chmod a-w $@-t \
+ && mv $@-t $@ )
+
+Makefile: Makefile.in.in ../config.status POTFILES
+ cd .. \
+ && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
+ $(SHELL) ./config.status
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644
index 00000000..fa8f4ffe
--- /dev/null
+++ b/po/POTFILES.in
@@ -0,0 +1,18 @@
+libdb/db_delete.c
+libdb/db_lookup.c
+libdb/db_store.c
+libdb/db_ver.c
+src/catman.c
+src/check_mandirs.c
+src/compression.c
+src/convert_name.c
+src/lexgrog.l
+src/man.c
+src/mandb.c
+src/manp.c
+src/manpath.c
+src/security.c
+src/straycats.c
+src/ult_src.c
+src/version.c
+src/whatis.c
diff --git a/po/cs.po b/po/cs.po
new file mode 100644
index 00000000..b056ae07
--- /dev/null
+++ b/po/cs.po
@@ -0,0 +1,735 @@
+# Czech message catalog for man-db.
+# Vladimir Michl <Vladimir.Michl@seznam.cz>, 1998.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: man-db 2.3.16\n"
+"POT-Creation-Date: 2000-04-06 10:08+0200\n"
+"PO-Revision-Date: 2000-04-07 08:32+02:00\n"
+"Last-Translator: Vladimir Michl <Vladimir.Michl@seznam.cz>\n"
+"Language-Team: Czech <cs@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-2\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: libdb/db_delete.c:104
+#, c-format
+msgid "multi key %s does not exist"
+msgstr "multiklíè %s neexistuje"
+
+#: libdb/db_lookup.c:66
+#, c-format
+msgid "can't lock index cache %s"
+msgstr "rejstøík %s nelze zamèít"
+
+#: libdb/db_lookup.c:75
+#, c-format
+msgid "index cache %s corrupt"
+msgstr "rejstøík %s je po¹kozen"
+
+#: libdb/db_lookup.c:83
+#, c-format
+msgid "cannot replace key %s"
+msgstr "klíè %s nelze nahradit"
+
+#: libdb/db_lookup.c:146
+#, c-format
+msgid "only %d fields in content"
+msgstr "polo¾ek v obsahu: %d"
+
+#: libdb/db_lookup.c:305
+#, c-format
+msgid "bad fetch on multi key %s"
+msgstr "multiklíè %s nelze vyzvednout"
+
+#: libdb/db_store.c:54
+#, c-format
+msgid "cannot insert unused key %s"
+msgstr "nepou¾itý klíè %s nelze vlo¾it"
+
+#: libdb/db_ver.c:63
+#, c-format
+msgid "fatal: unable to insert version identifier into %s"
+msgstr "chyba: identifikátor verze nelze do souboru %s vlo¾it"
+
+#: libdb/db_ver.c:74
+#, c-format
+msgid "warning: %s has no version identifier"
+msgstr "varování: soubor %s nemá identifikátor verze"
+
+#: libdb/db_ver.c:78
+#, c-format
+msgid "warning: %s is version %s, expecting %s"
+msgstr "varování: soubor %s je verze %s, ale oèekávána je verze %s"
+
+#: src/catman.c:121
+#, c-format
+msgid "usage: %s [-dhV] [-M manpath] [section] ...\n"
+msgstr "Pou¾ití: %s [-dhV] [-M cesta_k_man_stránkám] [sekce] ...\n"
+
+#: src/catman.c:123
+msgid ""
+"-d --debug produce debugging info.\n"
+"-M --manpath path set search path for manual pages to `path'.\n"
+"-V --version show version.\n"
+"-h --help show this usage message.\n"
+msgstr ""
+"-d --debug vypisuje ladící informace\n"
+"-M --manpath cesta nastaví vyhledávací cestu pro manuálové "
+"stránky.\n"
+"-V --version vypí¹e oznaèení verze a skonèí\n"
+"-h --help vypí¹e tuto nápovìdu a skonèí\n"
+
+#: src/catman.c:136
+#, c-format
+msgid "cannot read database %s"
+msgstr "databázi %s nelze èíst"
+
+#: src/catman.c:162
+msgid "fork failed"
+msgstr "funkce fork havarovala"
+
+#: src/catman.c:174
+msgid "can't get man command's exit status"
+msgstr "návratový kód pøíkazu man nelze pøevzít"
+
+#: src/catman.c:176
+#, c-format
+msgid "man command failed with exit status %d"
+msgstr "pøíkaz man skonèil s návratovým kódem %d"
+
+#: src/catman.c:228
+#, c-format
+msgid "unable to reset cursor position in %s"
+msgstr "kurzor v souboru %s nelze nastavit"
+
+#: src/catman.c:282
+#, c-format
+msgid "NULL content for key: %s"
+msgstr "polo¾ka pod klíèem %s je prázdná"
+
+#: src/catman.c:297
+#, c-format
+msgid ""
+"\n"
+"Updating cat files for section %s of man hierarchy %s\n"
+msgstr ""
+"\n"
+"Aktualizuji cat soubory pro sekci %s v adresáøi %s\n"
+
+#: src/catman.c:353
+#, c-format
+msgid "cannot write within %s"
+msgstr "do %s nelze zapisovat"
+
+#: src/catman.c:495
+#, c-format
+msgid "unable to update %s"
+msgstr "%s nelze aktualizovat"
+
+#: src/check_mandirs.c:74 src/straycats.c:120 src/straycats.c:146
+#, c-format
+msgid "warning: %s: ignoring bogus filename"
+msgstr "varování: %s: ignoruji"
+
+#: src/check_mandirs.c:81
+#, c-format
+msgid "warning: %s/man%s/%s.%s*: competing extensions"
+msgstr "varování: %s/man%s/%s.%s*: více pøípon"
+
+#: src/check_mandirs.c:290
+#, c-format
+msgid "warning: %s: bad symlink or ROFF `.so' request"
+msgstr "varování: %s: chybný symbolický odkaz nebo `.so' po¾adavek pro ROFF"
+
+#: src/check_mandirs.c:359
+#, c-format
+msgid "warning: %s: ignoring empty file"
+msgstr "varování: %s: ignoruji prázdný soubor"
+
+#: src/check_mandirs.c:364 src/straycats.c:252
+#, c-format
+msgid "warning: %s: whatis parse for %s(%s) failed"
+msgstr "varování: %s: pøíkaz whatis %s(%s) nenalezl"
+
+#: src/check_mandirs.c:392 src/check_mandirs.c:427 src/straycats.c:91
+#: src/straycats.c:277 src/ult_src.c:109
+#, c-format
+msgid "can't search directory %s"
+msgstr "adresáø %s nelze prohledat"
+
+#: src/check_mandirs.c:450 src/check_mandirs.c:492 src/man.c:2187
+#, c-format
+msgid "can't update index cache %s"
+msgstr "restøík %s nelze aktualizovat"
+
+#: src/check_mandirs.c:456
+#, c-format
+msgid "Updating index cache for path `%s'. Wait..."
+msgstr "Aktualizuji rejstøík pro adresáø `%s'. Prosím èekejte..."
+
+#: src/check_mandirs.c:549
+#, c-format
+msgid "can't create index cache %s"
+msgstr "rejstøík %s nelze vytvoøit"
+
+#: src/check_mandirs.c:562 src/check_mandirs.c:594
+msgid "done.\n"
+msgstr "dokonèeno.\n"
+
+#: src/compression.c:69 src/man.c:1231
+msgid "can't create a temporary filename"
+msgstr "doèasný soubor nelze vytvoøit"
+
+#: src/convert_name.c:44
+#, c-format
+msgid "Can't convert %s to cat name"
+msgstr "%s nelze pøevést na jméno cat souboru"
+
+#: src/lexgrog.l:204
+#, c-format
+msgid "warning: whatis for %s exceeds %d bytes, truncating."
+msgstr "varování: whatis argument %s je del¹í o bajtù: %d (bude zkrácen)"
+
+#: src/lexgrog.l:241 src/ult_src.c:298 src/ult_src.c:304
+#, c-format
+msgid "can't open %s"
+msgstr "soubor %s nelze otevøít"
+
+#: src/man.c:326
+msgid "can't popen"
+msgstr "rouru nelze otevøít"
+
+#: src/man.c:364
+#, c-format
+msgid "command exited with status %d: %s"
+msgstr "pøíkaz skonèil s návratovým kódem %d: %s"
+
+#: src/man.c:499
+#, c-format
+msgid ""
+"usage: %s [-c|-f|-k|-w|-tZT device] [-adlhu7V] [-Mpath] [-Ppager] [-Slist]\n"
+" [-msystem] [-pstring] [-Llocale] [-eextension] [section] page "
+"...\n"
+msgstr ""
+"Pou¾ití: %s [-c|-f|-k|-w|-tZT zaøízení] [-adlhu7V] [-Mcesta] [-Ppapír]\n"
+" [-Sseznam] [-msystém] [-pøetìzec] [-Llokalizace] [-epøípona]\n"
+" [sekce] stánka ...\n"
+
+#: src/man.c:504
+#, c-format
+msgid ""
+"usage: %s [-c|-f|-k|-w] [-adlhu7V] [-Mpath] [-Ppager] [-Slist] [-msystem]\n"
+" [-pstring] [-Llocale] [-eextension] [section] page ...\n"
+msgstr ""
+"Pou¾ití: %s [-c|-f|-k|-w] [-adlhu7V] [-Mcesta] [-Ppapír] [-Sseznam] "
+"[-msystém]\n"
+" [-pøetìzec] [-Llokalizace] [-epøípona] [sekce] stránka ...\n"
+
+#: src/man.c:510
+msgid ""
+"-a, --all find all matching manual pages.\n"
+"-d, --debug emit debugging messages.\n"
+"-e, --extension limit search to extension type `extension'.\n"
+"-f, --whatis equivalent to whatis.\n"
+"-k, --apropos equivalent to apropos.\n"
+"-w, --where, --location print physical location of man page(s).\n"
+"-l, --local-file interpret `page' argument(s) as local "
+"filename(s).\n"
+"-u, --update force a cache consistency check.\n"
+"-r, --prompt string provide the `less' pager with a prompt\n"
+"-c, --catman used by catman to reformat out of date cat "
+"pages.\n"
+"-7, --ascii display ASCII translation of certain latin1 "
+"chars."
+msgstr ""
+"-a, --all nalezne v¹echny odpovídající manuálové stránky\n"
+"-d, --debug vypisuje ladící informace\n"
+"-e, --extension pøípona omezí vyhledávání na pøíponu `pøípona'\n"
+"-f, --whatis chová se jako pøíkaz whatis\n"
+"-k, --apropos chová se jako pøíkaz apropos\n"
+"-w, --where, --location vypisuje fyzické umístìní manuálových stránek\n"
+"-l, --local-file bere argument `stránka' jako jméno lokálního\n"
+" souboru\n"
+"-u, --update vnutí aktualizaci rejstøíku\n"
+"-r, --prompt øetìzec øekne prohlí¾eèi `less', aby zobrazoval zprávu\n"
+" \"øetìzec\" na dolním øádku terminálu\n"
+"-c, --catman pou¾íván programem catman k pøeformátování "
+"stránek\n"
+"-7, --ascii provádí pøeklad nìkterých latin1 znakù do ASCII"
+
+#: src/man.c:523
+#, c-format
+msgid ""
+"-t, --troff use %s to format pages.\n"
+"-T, --troff-device device use %s with selected device.\n"
+msgstr ""
+"-t, --troff pou¾ije %s pro formátování stránek\n"
+"-T, --troff-device device pou¾ije %s pro zvolené zaøízení\n"
+
+#: src/man.c:528
+msgid ""
+"-H, --html use lynx or argument to display html output.\n"
+msgstr ""
+"-H, --html pou¾ije lynx nebo argument pro zobrazení html\n"
+" výstupu.\n"
+
+#: src/man.c:530
+msgid "-Z, --ditroff use groff and force it to produce ditroff."
+msgstr ""
+"-Z, --ditroff pou¾ije groff a pøinutí ho produkovat ditroff"
+
+#: src/man.c:535
+msgid ""
+"-D, --default reset all options to their default values.\n"
+"-M, --manpath path set search path for manual pages to `path'.\n"
+"-P, --pager pager use program `pager' to display output.\n"
+"-S, --sections list use colon separated section list.\n"
+"-m, --systems system search for man pages from other unix system(s).\n"
+"-L, --locale locale define the locale for this particular man "
+"search.\n"
+"-p, --preprocessor string string indicates which preprocessors to run."
+msgstr ""
+"-D, --default nastaví v¹echny pøepínaèe na jejich implicitní\n"
+" hodnoty\n"
+"-M, --manpath cesta nastaví cestu pro vyhledávání manuálových "
+"stránek \n"
+"-P, --pager stránkovaè pou¾ije program `stránkovaè' pro zobrazení "
+"výsledku\n"
+"-S, --sections seznam bude hledat pouze v sekcích ze seznamu "
+"(jednotlivé\n"
+" sekce oddìleny od sebe èárkou)\n"
+"-m, --systems systém hledá manuálové stránky pro jiný unixový "
+"systém(y)\n"
+"-L, --locale lokalizace definuje lokalizaci, pro kterou stránku "
+"po¾adujeme\n"
+"-p, --preprocessor øetìzec øetìzec oznaèující, který preprocesor spustit."
+
+#: src/man.c:545
+msgid ""
+"-V, --version show version.\n"
+"-h, --help show this usage message."
+msgstr ""
+"-V, --version vypí¹e oznaèení verze\n"
+"-h, --help vypí¹e tuto nápovìdu"
+
+#: src/man.c:558
+#, c-format
+msgid "What manual page do you want from section %s?\n"
+msgstr "Kterou manuálovou stránku ze sekce %s si pøejete?\n"
+
+#: src/man.c:560
+msgid "What manual page do you want?\n"
+msgstr "Kterou manuálovou stránku si pøejete?\n"
+
+#: src/man.c:590
+#, c-format
+msgid "No source manual entry for %s"
+msgstr "Zdrojová manuálová stránka pro %s nebyla nalezena"
+
+#: src/man.c:599
+#, c-format
+msgid "No manual entry for %s"
+msgstr "Manuálová stránka pro %s nebyla nalezena"
+
+#: src/man.c:604
+#, c-format
+msgid " in section %s\n"
+msgstr " v sekci %s\n"
+
+#: src/man.c:883
+msgid ""
+" Manual page $MAN_PN ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\\\\%.."
+msgstr ""
+" Manuálová stránka $MAN_PN ?ltøádek %lt?L/%L.:bajt %bB?s/%s..?e (KONEC):?pB "
+"%pB\\\\%.."
+
+#: src/man.c:1120
+msgid ": incompatible options"
+msgstr ": nekompatibilní pøepínaè(e)"
+
+#: src/man.c:1276
+msgid "error trying to read from stdin"
+msgstr "chyba, zkou¹eno ètení ze standardního vstupu"
+
+#: src/man.c:1288
+#, c-format
+msgid "error writing to temporary file %s"
+msgstr "chyba, zápis do doèasného souboru %s"
+
+#. didn't fail on roff
+#: src/man.c:1446
+#, c-format
+msgid "ignoring unknown preprocessor `%c'"
+msgstr "ignoruji neznámý preprocesor `%c'"
+
+#: src/man.c:1507 src/man.c:1555 src/mandb.c:227
+#, c-format
+msgid "can't chown %s"
+msgstr "chown %s nelze provést"
+
+#: src/man.c:1540 src/mandb.c:198
+#, c-format
+msgid "can't chmod %s"
+msgstr "chmod %s nelze provést"
+
+#: src/man.c:1567 src/mandb.c:167
+#, c-format
+msgid "can't rename %s to %s"
+msgstr "%s nelze pøejmenovat na %s"
+
+#: src/man.c:1576
+#, c-format
+msgid "can't unlink %s"
+msgstr "%s nelze smazat"
+
+#: src/man.c:1603
+msgid "can't create pipe"
+msgstr "rouru nelze vytvoøit"
+
+#: src/man.c:1611 src/security.c:208
+msgid "can't fork"
+msgstr "fork nelze provést"
+
+#: src/man.c:1628 src/man.c:1638
+msgid "can't dup2"
+msgstr "dup2 nelze provést"
+
+#: src/man.c:1635
+#, c-format
+msgid "can't create %s"
+msgstr "%s nelze vytvoøit"
+
+#: src/man.c:1657
+#, c-format
+msgid "can't exec %s"
+msgstr "exec %s nelze vykonat"
+
+#: src/man.c:1694
+#, c-format
+msgid "waiting for pid %u"
+msgstr "èekám na proces s èíslem %u"
+
+#: src/man.c:1744
+msgid "Still saving the page, please wait...\n"
+msgstr "Ukládám stránku na disk, prosím poèkejte chvíli...\n"
+
+#: src/man.c:1787
+#, c-format
+msgid "can't chdir to %s"
+msgstr "do adresáøe %s nelze vstoupit"
+
+#: src/man.c:1904
+#, c-format
+msgid ""
+"\n"
+"cannot write to %s in catman mode"
+msgstr ""
+"\n"
+"do %s nelze v módu catman zapsat"
+
+#: src/man.c:1944
+#, c-format
+msgid "Reformatting %s, please wait...\n"
+msgstr "Formátuji %s, prosím poèkejte chvíli...\n"
+
+#: src/man.c:2541
+#, c-format
+msgid "--Man-- next: %s [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]\n"
+msgstr ""
+"--Man-- dal¹í: %s [ prohlédn. (enter) | pøeskoèit (Ctrl-D) | ukonèit "
+"(Ctrl-C) ]\n"
+
+#: src/mandb.c:142
+#, c-format
+msgid "usage: %s [-dqsuc|-h|-V] [manpath]\n"
+msgstr "Pou¾ití: %s [-dqsuc|-h|-V] [cesta_k_manuálovým_stránkám]\n"
+
+#: src/mandb.c:144
+msgid ""
+"-d --debug produce debugging info.\n"
+"-q --quiet work quietly, except for 'bogus' warning.\n"
+"-s --no-straycats don't look for or add stray cats to the dbs.\n"
+"-u --user-db produce user databases only.\n"
+"-c --create create dbs from scratch, rather than updating.\n"
+"-V --version show version.\n"
+"-h --help show this usage message.\n"
+msgstr ""
+"-d --debug vypisuje ladící informace\n"
+"-q --quiet nic nevypisuje, kromì varování o fale¹ných\n"
+" souborech\n"
+"-s --no-straycats nehledá nebo nepøidává cat soubory bez zdrojové\n"
+" stránky do dbs\n"
+"-u --user-db podukuje pouze u¾ivatelské databáze\n"
+"-c --create vytvoøí databáze znovu, místo aktualizace\n"
+"-V --version vypí¹e oznaèení verze\n"
+"-h --help vypí¹e tuto nápovìdu\n"
+
+#: src/mandb.c:160 src/security.c:157
+#, c-format
+msgid "can't remove %s"
+msgstr "%s nelze pøejmenovat"
+
+#: src/mandb.c:284
+#, c-format
+msgid "Processing manual pages under %s...\n"
+msgstr "Zpracovávám manuálovou stránku v adresáøi %s...\n"
+
+#: src/mandb.c:413
+#, c-format
+msgid "the setuid man user \"%s\" does not exist"
+msgstr "manový u¾ivatel `%s' neexistuje"
+
+#: src/mandb.c:438
+#, c-format
+msgid "warning: no MANDB_MAP directives in %s, using your manpath"
+msgstr "varování: v souboru %s není direktiva MANDB%MAP, pou¾ívám manpath"
+
+#: src/mandb.c:479
+#, c-format
+msgid ""
+"%d man subdirectories contained newer manual pages.\n"
+"%d manual pages "
+msgstr ""
+"%d manuálových adresáøù obsahuje nové manuálové stránky.\n"
+"%d manuálových stránek "
+
+#: src/mandb.c:484
+#, c-format
+msgid "and %d stray cats "
+msgstr "a %d cat souborù bez zdroje "
+
+#: src/mandb.c:485
+msgid "were added."
+msgstr "bylo pøidáno."
+
+#: src/manp.c:115
+#, c-format
+msgid "can't make sense of the manpath configuration file %s"
+msgstr "z konfiguraèního souboru %s nelze zjistit cesty pro manuálové stránky"
+
+#: src/manp.c:121
+#, c-format
+msgid "warning: %s"
+msgstr "varování: %s"
+
+#: src/manp.c:127
+#, c-format
+msgid "warning: %s isn't a directory"
+msgstr "varování: %s není adresáø"
+
+#: src/manp.c:382
+msgid "warning: $PATH not set"
+msgstr "varování: $PATH není nastavena"
+
+#: src/manp.c:393
+msgid "warning: empty $PATH"
+msgstr "varování: prázdná $PATH"
+
+#: src/manp.c:424
+#, c-format
+msgid "warning: $MANPATH set, prepending %s"
+msgstr "varování: $MANPATH nastavena, %s pøidáno na zaèátek"
+
+#: src/manp.c:430
+#, c-format
+msgid "warning: $MANPATH set, appending %s"
+msgstr "varování: $MANPATH nastavena, %s pøidáno na konec"
+
+#: src/manp.c:437
+#, c-format
+msgid "warning: $MANPATH set, inserting '%s'"
+msgstr "varování: $MANPATH nastavena, vlo¾eno %s"
+
+#: src/manp.c:444
+#, c-format
+msgid "warning: $MANPATH set, ignoring %s"
+msgstr "varování: $MANPATH nastavena, %s ignorováno"
+
+#: src/manp.c:471 src/manp.c:496
+#, c-format
+msgid "warning: cannot create catdir %s"
+msgstr "varování: adresáø %s pro cat soubory nelze vytvoøit"
+
+#: src/manp.c:530
+msgid "too many entries in config file"
+msgstr "pøíli¹ mnoho polo¾ek v konfiguraèním souboru"
+
+#: src/manp.c:580
+#, c-format
+msgid "can't parse directory list `%s'"
+msgstr "seznam adresáøù `%s' nelze analyzovat"
+
+#: src/manp.c:594
+#, c-format
+msgid "can't open the manpath configuration file %s"
+msgstr "konfiguraèní soubor %s pro cesty k manuálovým stránkám nelze otevøít"
+
+#: src/manp.c:641
+#, c-format
+msgid "warning: mandatory directory %s doesn't exist"
+msgstr "varování: povinný adresáø %s neexistuje"
+
+#: src/manp.c:848
+msgid "can't determine current directory"
+msgstr "nelze zjistit aktuální adresáø"
+
+#: src/manp.c:861
+#, c-format
+msgid "warning: %s does not have a man tree component"
+msgstr "varování: %s neobsahuje øetìzec `/man'"
+
+#: src/manp.c:991
+#, c-format
+msgid "warning: %s does not begin with %s"
+msgstr "varování: cesta %s nezaèíná %s"
+
+#: src/manpath.c:86
+#, c-format
+msgid "usage: %s [[-gcdq] [-m system]] | [-V] | [-h]\n"
+msgstr "Pou¾ití: %s [[-gcdq] [-m systém]] | [-V] | [-h]\n"
+
+#: src/manpath.c:88
+msgid ""
+"-c --catpath show relative catpaths.\n"
+"-g --global show the entire global manpath.\n"
+"-d --debug produce debugging info.\n"
+"-q --quiet produce fewer warnings.\n"
+"-m --systems system express which `systems' to use.\n"
+"-V --version show version.\n"
+"-h --help show this usage message.\n"
+msgstr ""
+"-c --catpath vypisuje adresáøe cat souborù\n"
+"-g --global vypisuje adresáøe k manuálovým stránkám\n"
+"-d --debug vypisuje ladící informace\n"
+"-q --quiet vypisuje ménì varování\n"
+"-m --systems systém pro který systém\n"
+"-V --version vypí¹e oznaèení verze\n"
+"-h --help vypí¹e tuto nápovìdu\n"
+
+#: src/manpath.c:162
+#, c-format
+msgid "warning: no global manpaths set in config file %s"
+msgstr ""
+"varování: globální cesty k manuálovým stránkám nejsou v konfiguraèním\n"
+"souboru %s nastaveny"
+
+#: src/security.c:66
+msgid "can't set effective uid"
+msgstr "efektivní uid nelze nastavit"
+
+#: src/straycats.c:225 src/straycats.c:233 src/ult_src.c:146 src/ult_src.c:236
+#, c-format
+msgid "can't resolve %s"
+msgstr "cestu %s nelze analyzovat"
+
+#: src/straycats.c:231 src/ult_src.c:144
+#, c-format
+msgid "warning: %s is a dangling symlink"
+msgstr "varování: %s je symbolický odkaz ukazující na neexistující soubor"
+
+#: src/straycats.c:282
+#, c-format
+msgid "Checking for stray cats under %s...\n"
+msgstr "Kontrola cat stránek bez zdrojù v adresáøi %s...\n"
+
+#: src/straycats.c:321
+#, c-format
+msgid "warning: can't create temp file %s"
+msgstr "varování: doèasný soubor %s nelze vytvoøit"
+
+#: src/straycats.c:328
+#, c-format
+msgid "warning: can't update index cache %s"
+msgstr "varování: rejstøík %s nelze aktualizovat"
+
+#: src/ult_src.c:264
+#, c-format
+msgid "%s is self referencing"
+msgstr "stránka %s se odkazuje sama na sebe"
+
+#: src/version.c:28
+#, c-format
+msgid "%s, version %s, %s (fpolacco@debian.org)\n"
+msgstr "%s, verze %s, %s (fpolacco@debian.org)\n"
+
+#: src/whatis.c:127
+#, c-format
+msgid ""
+"usage: %s [-d] [-r|-w|-e] [-m systems] [-M manpath] | [-h] | [-V] keyword "
+"...\n"
+msgstr ""
+"Pou¾ití: %s [-d] [-r|-w|-e] [-m systém] [-M cesta_k_manuálovým_stránkám] | "
+"[-h]\n"
+"| [-V] klíèové_slovo ...\n"
+
+#: src/whatis.c:129
+msgid ""
+"-d --debug\t\tproduce debugging info.\n"
+"-r --regex \t\tinterpret each keyword as a regex (default).\n"
+"-e --exact \t\tsearch each keyword for exact match.\n"
+"-w --wildcard\t\tthe keyword(s) contain wildcards.\n"
+"-m --systems system\tinclude alternate systems man pages.\n"
+"-M --manpath path\tset search path for manual pages to `path'.\n"
+"-V --version\t\tshow version.\n"
+"-h --help\t\tshow this usage message.\n"
+msgstr ""
+"-d --debug\t\tvypisuje ladící informace\n"
+"-r --regex\t\tinterpretuje ka¾dé klíèové_slovo jako regulární výraz\n"
+" (implicitní)\n"
+"-e --exact hledání slova, které je pøesnì stejné se zadaným\n"
+"-w --wildcard\t\tklíèové_slovo zadáno hvìzdièkovou konvencí\n"
+"-m --systems systém\tprohledává man. stránky pro tento systém\n"
+"-M --manpath cesta\tprohledávání bude pouze v adresáøi(ích) `cesta'\n"
+"-V --version\t\tvypí¹e oznaèení verze\n"
+"-h --help\t\tvypí¹e tuto nápovìdu\n"
+
+#: src/whatis.c:144
+#, c-format
+msgid ""
+"usage: %s [-d] [-r|-w] [-m systems] [-M manpath] | [-h] | [-V] keyword ...\n"
+msgstr ""
+"Pou¾ití: %s [-d] [-r|-w] [-m systém] [-M cesta_k_manuálovým_stránkám] | [-h] "
+"|\n"
+"[-V] klíèové_slovo ...\n"
+
+#: src/whatis.c:146
+msgid ""
+"-d --debug\t\tproduce debugging info.\n"
+"-r --regex \t\tinterpret each keyword as a regex.\n"
+"-w --wildcard\t\tthe keyword(s) contain wildcards.\n"
+"-m --systems system\tinclude alternate systems man pages.\n"
+"-M --manpath path\tset search path for manual pages to `path'.\n"
+"-V --version\t\tshow version.\n"
+"-h --help\t\tshow this usage message.\n"
+msgstr ""
+"-d --debug\t\tvypisuje ladící informace\n"
+"-r --regex\t\tinterpretuje ka¾dé klíèové_slovo jako regulární výraz\n"
+"-w --wildcard\t\tklíèové_slovo zadáno hvìzdièkovou konvencí \n"
+"-m --systems systém\tprohledává man. stránky pro tento systém\n"
+"-M --manpath cesta\tprohledávání bude pouze v adresáøi(ích) `cesta'\n"
+"-V --version\t\tvypí¹e oznaèení verze\n"
+"-h --help\t\tvypí¹e tuto nápovìdu\n"
+
+#: src/whatis.c:186
+msgid "warning: can't read the fallback whatis text database."
+msgstr "varování: textovou databázi pro whatis nelze èíst."
+
+#: src/whatis.c:214 src/whatis.c:226
+msgid "(unknown)"
+msgstr "(není známo)"
+
+#: src/whatis.c:485
+#, c-format
+msgid "%s: nothing appropriate.\n"
+msgstr "%s: ¾ádná odpovídající\n"
+
+#: src/whatis.c:584
+#, c-format
+msgid "%s what?\n"
+msgstr "Co má pøíkaz %s provést?\n"
+
+#: src/whatis.c:607 src/whatis.c:617
+#, c-format
+msgid "fatal: regex `%s': %s"
+msgstr "Fatální: regvýr '%s': %s"
diff --git a/po/de.po b/po/de.po
new file mode 100644
index 00000000..3669879c
--- /dev/null
+++ b/po/de.po
@@ -0,0 +1,744 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: man-db 2.3.10\n"
+"POT-Creation-Date: 1998-03-09 08:18+0200\n"
+"PO-Revision-Date: 1998-03-09 08:18+0200\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: libdb/db_delete.c:104
+#, c-format
+msgid "multi key %s does not exist"
+msgstr "Suchschlüssel %s existiert nicht"
+
+#: libdb/db_lookup.c:66
+#, c-format
+msgid "can't lock index cache %s"
+msgstr ""
+"Kann Indexcachezugriff nicht sperren"
+
+#: libdb/db_lookup.c:75
+#, c-format
+msgid "index cache %s corrupt"
+msgstr ""
+"Indexcache %s fehlerhaft"
+
+#: libdb/db_lookup.c:83
+#, c-format
+msgid "cannot replace key %s"
+msgstr ""
+"Kann Suchschlüssel %s nicht ersetzen"
+
+#: libdb/db_lookup.c:146
+#, c-format
+msgid "only %d fields in content"
+msgstr ""
+"nur %d Felder im Dateneintrag enthalten"
+
+#: libdb/db_lookup.c:305
+#, c-format
+msgid "bad fetch on multi key %s"
+msgstr ""
+"Kann Suchschlüssel %s nicht einlesen"
+
+#: libdb/db_store.c:54
+#, c-format
+msgid "cannot insert unused key %s"
+msgstr ""
+"Kan unbenutzen Suchschlüssel %s nicht einfügen"
+
+#: libdb/db_ver.c:63
+#, c-format
+msgid "fatal: unable to insert version identifier into %s"
+msgstr ""
+"Fatal: Kann Versionsnummer nicht in %s einfügen"
+
+#: libdb/db_ver.c:74
+#, c-format
+msgid "warning: %s has no version identifier"
+msgstr ""
+"Warnung: %s hat keine Versionsnummer"
+
+#: libdb/db_ver.c:78
+#, c-format
+msgid "warning: %s is version %s, expecting %s"
+msgstr ""
+"Warnung: %s hat Versionsnummer %s, erwarte aber %s"
+
+#: src/catman.c:126
+#, c-format
+msgid "usage: %s [-dhV] [-M manpath] [section] ...\n"
+msgstr ""
+
+#: src/catman.c:128
+msgid ""
+"-d --debug produce debugging info.\n"
+"-M --manpath path set search path for manual pages to `path'.\n"
+"-V --version show version.\n"
+"-h --help show this usage message.\n"
+msgstr ""
+"-d --debug Erzeuge Debugging-Informationen.\n"
+"-M --manpath path Setze Suchpfad für Manual-Seiten auf `path'.\n"
+"-V --version Zeige Versionnummer an.\n"
+"-h --help Zeige diese Options-Zusammenfassung an.\n"
+
+#: src/catman.c:143
+#, c-format
+msgid "cannot read database %s"
+msgstr ""
+"Kann Datenbank %s nicht lesen"
+
+#: src/catman.c:169
+msgid "fork failed"
+msgstr ""
+"Prozeßerzeugung fehlgeschlagen"
+
+#: src/catman.c:183
+msgid "can't get man command's exit status"
+msgstr ""
+"Kann Exit-Status von Man-Kommando nicht auslesen"
+
+#: src/catman.c:187
+#, c-format
+msgid "man command failed with exit status %d"
+msgstr ""
+"Man-Kommando schlug fehl mit Exit-Status %d"
+
+#: src/catman.c:242
+#, c-format
+msgid "unable to reset cursor position in %s"
+msgstr ""
+"Kann Cursorposition nicht zurücksetzen in %s"
+
+#: src/catman.c:299
+#, c-format
+msgid "NULL content for key: %s"
+msgstr ""
+"Inhalt ist NULL für Suchschlüssel: %s"
+
+#: src/catman.c:316
+#, c-format
+msgid ""
+"\n"
+"Updating cat files for section %s of man hierarchy %s\n"
+msgstr ""
+"\nUpdate vorformatierte Dateien der Sektion %s von Man-Hierarchie %s\n"
+
+#: src/catman.c:373
+#, c-format
+msgid "cannot write within %s"
+msgstr ""
+"Kann innerhalb von %s nicht schreiben"
+
+#: src/catman.c:506
+#, c-format
+msgid "unable to update %s"
+msgstr ""
+"Kann %s nicht updaten"
+
+#: src/check_mandirs.c:76 src/straycats.c:116 src/straycats.c:144
+#, c-format
+msgid "warning: %s: ignoring bogus filename"
+msgstr ""
+"Warnung: %s: ignoriere seltsamen Dateinamen"
+
+#: src/check_mandirs.c:86
+#, c-format
+msgid "warning: %s/man%s/%s.%s*: competing extensions"
+msgstr ""
+"Warnung: %s/man%s/%s.%s*: konkurrierende Dateierweiterungen"
+
+#: src/check_mandirs.c:296
+#, c-format
+msgid "warning: %s: bad symlink or ROFF `.so' request"
+msgstr ""
+"Warnung: %s: ungültiger symbolischer Link oder falsche ROFF `.so' Anfrage"
+
+#: src/check_mandirs.c:367
+#, c-format
+msgid "warning: %s: ignoring empty file"
+msgstr ""
+"Warnung: %s: ignoriere leere Datei"
+
+#: src/check_mandirs.c:375 src/straycats.c:246
+#, c-format
+msgid "warning: %s: whatis parse for %s(%s) failed"
+msgstr ""
+"Warnung: %s: Kann keinen whatis Eintrag für %s(%s) erzeugen"
+
+#: src/check_mandirs.c:403 src/check_mandirs.c:440 src/straycats.c:85
+#: src/straycats.c:272 src/ult_src.c:112
+#, c-format
+msgid "can't search directory %s"
+msgstr ""
+"Kann Verzeichnis %s nicht durchsuchen"
+
+#: src/check_mandirs.c:465 src/check_mandirs.c:511 src/man.c:2044
+#, c-format
+msgid "can't update index cache %s"
+msgstr ""
+"Kann Indexcache %s nicht updaten"
+
+#: src/check_mandirs.c:473
+#, c-format
+msgid "\rUpdating index cache for path `%s'. Wait..."
+msgstr ""
+"\rUpdate Indexcache von Pfad `%s'. Bitte warten..."
+
+#: src/check_mandirs.c:570
+#, c-format
+msgid "can't create index cache %s"
+msgstr ""
+"Kann Indexcache %s nicht erzeugen"
+
+#: src/check_mandirs.c:584 src/check_mandirs.c:616
+msgid "done.\n"
+msgstr ""
+"fertig.\n"
+
+#: src/compression.c:72
+msgid "can't create a temporary filename"
+msgstr ""
+"Kann temporären Dateinamen nicht erzeugen"
+
+#: src/convert_name.c:47
+#, c-format
+msgid "Can't convert %s to cat name"
+msgstr ""
+"Kann %s nicht in Dateinamen für vorformatierte Manual-Seiten umwandeln"
+
+#: src/lexgrog.l:212
+#, c-format
+msgid "warning: whatis for %s exceeds %d bytes, truncating."
+msgstr ""
+"Warnung: whatis-Eintrag für %s ist grösser als %d Bytes, verkürze ihn."
+
+#: src/lexgrog.l:251 src/ult_src.c:310 src/ult_src.c:318
+#, c-format
+msgid "can't open %s"
+msgstr ""
+"Kann %s nicht öffnen"
+
+#: src/man.c:319
+msgid "can't popen"
+msgstr ""
+"Kann Datenübergabe nicht erzeugen"
+
+#: src/man.c:328
+#, c-format
+msgid "command exited with status %d: %s"
+msgstr ""
+"Kommando beendete sich mit Exit-Status %d: %s"
+
+#: src/man.c:459
+#, c-format
+msgid ""
+"usage: %s [-c|-f|-k|-w|-tZT device] [-adlhu7V] [-Mpath] [-Ppager] [-Slist]\n"
+" [-msystem] [-pstring] [-Llocale] [-eextension] [section] page "
+"...\n"
+msgstr ""
+"usage: %s [-c|-f|-k|-w|-tZT device] [-adlhu7V] [-Mpath] [-Ppager] [-Slist]\n"
+" [-msystem] [-pstring] [-Llocale] [-eextension] [section] page ...\n"
+
+#: src/man.c:464
+#, c-format
+msgid ""
+"usage: %s [-c|-f|-k|-w] [-adlhu7V] [-Mpath] [-Ppager] [-Slist] [-msystem]\n"
+" [-pstring] [-Llocale] [-eextension] [section] page ...\n"
+msgstr ""
+"usage: %s [-c|-f|-k|-w] [-adlhu7V] [-Mpath] [-Ppager] [-Slist] [-msystem]\n"
+" [-pstring] [-Llocale] [-eextension] [section] page ...\n"
+
+#: src/man.c:470
+msgid ""
+"-a, --all find all matching manual pages.\n"
+"-d, --debug emit debugging messages.\n"
+"-e, --extension limit search to extension type `extension'.\n"
+"-f, --whatis equivalent to whatis.\n"
+"-k, --apropos equivalent to apropos.\n"
+"-w, --where, --location print physical location of man page(s).\n"
+"-l, --local-file interpret `page' argument(s) as local "
+"filename(s).\n"
+"-u, --update force a cache consistency check.\n"
+"-r, --prompt string provide the `less' pager with a prompt\n"
+"-c, --catman used by catman to reformat out of date cat "
+"pages.\n"
+"-7, --ascii display ASCII translation of certain latin1 "
+"chars."
+msgstr ""
+"-a, --all Zeige alle passenden Manual-Seiten an.\n"
+"-d, --debug Erzeuge Debugging-Ausgaben.\n"
+"-e, --extension Schränke Suche auf Dateierweiterung `extension'\n"
+" ein.\n"
+"-f, --whatis Gleichwertig zu einem Aufruf von whatis.\n"
+"-k, --apropos Gleichwertig zu einem Aufruf von apropos.\n"
+"-w, --where, --location Zeige physikalische Position der Manual-Seiten an.\n"
+"-l, --local-file Interpretiere `page' Argumente als lokale\n"
+" Dateinamen.\n"
+"-u, --update Erzwinge einen Cache-Konsistenz-Test.\n"
+"-r, --prompt string Rufe den Seitenanzeiger `less' mit diesem Prompt\n"
+" auf.\n"
+"-c, --catman Benutzt von catman um veraltete vorformatierte Manual-\n"
+" Seiten neu zu formatieren.\n"
+"-7, --ascii Zeige ASCII-Übersetzung von bestimmten Latin1-\n"
+" Zeichen an."
+
+#: src/man.c:483
+#, c-format
+msgid ""
+"-t, --troff use %s to format pages.\n"
+"-T, --troff-device device use %s with selected device.\n"
+msgstr ""
+"-t, --troff Benutze %s um Seiten zu formatieren.\n"
+"-T, --troff-device device Benutze %s mit gewünschtem Gerät.\n"
+
+#: src/man.c:488
+msgid "-Z, --ditroff use groff and force it to produce ditroff."
+msgstr ""
+"-Z, --ditroff Benutze groff und erzwinge ditroff-Ausgabe."
+
+#: src/man.c:493
+msgid ""
+"-D, --default reset all options to their default values.\n"
+"-M, --manpath path set search path for manual pages to `path'.\n"
+"-P, --pager pager use program `pager' to display output.\n"
+"-S, --sections list use colon separated section list.\n"
+"-m, --systems system search for man pages from other unix system(s).\n"
+"-L, --locale locale define the locale for this particular man "
+"search.\n"
+"-p, --preprocessor string string indicates which preprocessors to run."
+msgstr ""
+"-D, --default Setze alle Optionen auf ihre Standardwerte zurück.\n"
+"-M, --manpath path Setze Suchpfad für Manual-Seiten auf `path'.\n"
+"-P, --pager pager Benutze Programm `pager' zum Anzeigen der Ausgabe.\n"
+"-S, --sections list Benutze durch Doppelpunkt getrennte Sektions-Liste.\n"
+"-m, --systems system Suche in Manual-Seiten von anderen Unixsystemen.\n"
+"-L, --locale locale Definiere zu benutzende Sprachdefinition für diese\n"
+" Suche.\n"
+"-p, --preprocessor string Zeichenkette gibt an, mit welchem Programm die\n"
+" Manual-Seiten vorher bearbeitet werden sollen."
+
+#: src/man.c:503
+msgid ""
+"-V, --version show version.\n"
+"-h, --help show this usage message."
+msgstr ""
+"-V, --version Zeige Versionsnummer an.\n"
+"-h, --help Zeige diese Options-Zusammenfassung an."
+
+#: src/man.c:517
+#, c-format
+msgid "What manual page do you want from section %s?\n"
+msgstr ""
+"Welche Manual-Seiten wollen Sie aus Sektion %s haben?\n"
+
+#: src/man.c:520
+msgid "What manual page do you want?\n"
+msgstr ""
+"Welche Manual-Seite wollen Sie haben?\n"
+
+#: src/man.c:548
+#, c-format
+msgid "No source manual entry for %s"
+msgstr ""
+"Kein Quellcode-Eintrag für %s vorhanden"
+
+#: src/man.c:558
+#, c-format
+msgid "No manual entry for %s"
+msgstr ""
+"Kein Manual-Eintrag für %s vorhanden"
+
+#: src/man.c:563
+#, c-format
+msgid " in section %s\n"
+msgstr ""
+" in Sektion %s\n"
+
+#: src/man.c:818
+msgid ""
+" Manual page $MAN_PN ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\\\\%.."
+msgstr ""
+"Manual-Seite $MAN_PN "
+"?ltzeile %lt?L/%L.:byte %bB?s/%s..?e (ENDE):"
+"?pB %pB\\\\%.."
+
+#: src/man.c:1071
+msgid ": incompatible options"
+msgstr ""
+": inkompatible Optionen"
+
+#: src/man.c:1286
+#, c-format
+msgid "ignoring unknown preprocessor `%c'"
+msgstr ""
+"Ignoriere unbekannten Preprozessor `%c'"
+
+#: src/man.c:1348 src/man.c:1399 src/mandb.c:209
+#, c-format
+msgid "can't chown %s"
+msgstr ""
+"Kann Besitzer und/oder Gruppe von %s nicht ändern"
+
+#: src/man.c:1382 src/mandb.c:180
+#, c-format
+msgid "can't chmod %s"
+msgstr ""
+"Kann Zugriffsrechte von %s nicht ändern"
+
+#: src/man.c:1414 src/mandb.c:171
+#, c-format
+msgid "can't rename %s to %s"
+msgstr ""
+"Kann %s nicht in %s umbenennen"
+
+#: src/man.c:1426
+#, c-format
+msgid "can't unlink %s"
+msgstr ""
+"Kann %s nicht löschen"
+
+#: src/man.c:1454
+msgid "can't create pipe"
+msgstr ""
+"Kann Datenübergabe nicht erzeugen"
+
+#: src/man.c:1462 src/security.c:212
+msgid "can't fork"
+msgstr ""
+"Kann keinen neuen Prozess erzeugen"
+
+#: src/man.c:1479 src/man.c:1491
+msgid "can't dup2"
+msgstr ""
+"Kann Dateideskriptor nicht duplizieren"
+
+#: src/man.c:1487
+#, c-format
+msgid "can't create %s"
+msgstr ""
+"Kann %s nicht erzeugen"
+
+#: src/man.c:1511
+#, c-format
+msgid "can't exec %s"
+msgstr ""
+"Kann %s nicht ausführen"
+
+#: src/man.c:1550
+#, c-format
+msgid "waiting for pid %u"
+msgstr ""
+"Warte auf Prozess Nummer %u"
+
+#: src/man.c:1603
+msgid "Still saving the page, please wait...\n"
+msgstr ""
+"Speichern der Manual-Seite noch nicht beendet, bitte warten...\n"
+
+#: src/man.c:1645
+#, c-format
+msgid "can't chdir to %s"
+msgstr ""
+"Kann nicht ins Verzeichnis %s wechseln"
+
+#: src/man.c:1757
+#, c-format
+msgid ""
+"\n"
+"cannot write to %s in catman mode"
+msgstr ""
+"\nKann im catman Modus nicht nach %s schreiben"
+
+#: src/man.c:1800
+#, c-format
+msgid "Reformatting %s, please wait...\n"
+msgstr ""
+"Formatiere %s neu, bitte warten...\n"
+
+#: src/man.c:2398
+#, c-format
+msgid "--Man-- next: %s [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]\n"
+msgstr ""
+"--Man-- nächste Manual-Seite: %s\n"
+"[ Anzeigen (return) | Überspringen (Ctrl-D) | Beenden (Ctrl-C) ]\n"
+
+#: src/mandb.c:145
+#, c-format
+msgid "usage: %s [-dqsuc|-h|-V] [manpath]\n"
+msgstr ""
+"usage: %s [-dqsuc|-h|-V] [manpath]\n"
+
+#: src/mandb.c:147
+msgid ""
+"-d --debug produce debugging info.\n"
+"-q --quiet work quietly, except for 'bogus' warning.\n"
+"-s --no-straycats don't look for or add stray cats to the dbs.\n"
+"-u --user-db produce user databases only.\n"
+"-c --create create dbs from scratch, rather than updating.\n"
+"-V --version show version.\n"
+"-h --help show this usage message.\n"
+msgstr ""
+"-d --debug Erzeuge Debugging-Ausgaben.\n"
+"-q --quiet Arbeite ohne Ausgabe, bis auf seltsame Fehler\n"
+" meldungen.\n"
+"-s --no-straycats Füge Manual-Seiten ohne Quellcode nicht in die\n"
+" Datenbanken ein.\n"
+"-u --user-db Erzeuge nur Benutzer-Datenbanken.\n"
+"-c --create Erzeuge Datenbanken völlig neu.\n"
+"-V --version Zeige Versionnummer an.\n"
+"-h --help Zeige diese Options-Zusammenfassung an.\n"
+
+#: src/mandb.c:163 src/security.c:160
+#, c-format
+msgid "can't remove %s"
+msgstr ""
+"Kann %s nicht löschen"
+
+#: src/mandb.c:267
+#, c-format
+msgid "Processing manual pages under %s...\n"
+msgstr ""
+"Bearbeite Manual-Seiten unter %s...\n"
+
+#: src/mandb.c:382
+#, c-format
+msgid "the setuid man user \"%s\" does not exist"
+msgstr ""
+"Der von Man benutze User %s existiert nicht"
+
+#: src/mandb.c:406
+#, c-format
+msgid "warning: no MANDB_MAP directives in %s, using your manpath"
+msgstr ""
+"Warnung: Keine MANDB_MAP Anweisung in %s, benutze den Manualpfad (MANPATH)"
+
+#: src/mandb.c:446
+#, c-format
+msgid ""
+"%d man subdirectories contained newer manual pages.\n"
+"%d manual pages "
+msgstr ""
+"%d Manual-Verzeichnisse enthielten neuere Manual-Seiten.\n"
+"%d Manual-Seiten "
+
+#: src/mandb.c:451
+#, c-format
+msgid "and %d stray cats "
+msgstr ""
+"und %d Manual-Seiten ohne Quellcode "
+
+#: src/mandb.c:452
+msgid "were added."
+msgstr ""
+"wurden hinzugefügt."
+
+#: src/manp.c:119
+#, c-format
+msgid "can't make sense of the manpath configuration file %s"
+msgstr ""
+"Kann Manualpfad-Konfigurationsdatei %s nicht verstehen"
+
+#: src/manp.c:127
+#, c-format
+msgid "warning: %s"
+msgstr ""
+"Warnung: %s"
+
+#: src/manp.c:134
+#, c-format
+msgid "warning: %s isn't a directory"
+msgstr ""
+"Warnung: %s ist kein Verzeichnis"
+
+#: src/manp.c:362
+#, c-format
+msgid "warning: $MANPATH set, ignoring %s"
+msgstr ""
+"Warnung: $MANPATH ist gesetzt, ignoriere %s"
+
+#: src/manp.c:378
+msgid "warning: $PATH not set"
+msgstr ""
+"Warnung: $PATH nicht gesetzt"
+
+#: src/manp.c:391
+msgid "warning: empty $PATH"
+msgstr ""
+"Warnung: $PATH ist leer"
+
+#: src/manp.c:418 src/manp.c:440
+#, c-format
+msgid "warning: cannot create catdir %s"
+msgstr ""
+
+#: src/manp.c:464
+#, c-format
+msgid "can't open the manpath configuration file %s"
+msgstr ""
+"Kann Manualpfad-Konfigurationsdatei %s nicht öffnen"
+
+#: src/manp.c:516
+#, c-format
+msgid "can't parse directory list `%s'"
+msgstr ""
+"Kann Verzeichnisliste `%s' nicht verstehen"
+
+#: src/manp.c:563
+#, c-format
+msgid "warning: mandatory directory %s doesn't exist"
+msgstr ""
+"Warnung: Verzeichnis %s existiert nicht"
+
+#: src/manp.c:778
+msgid "can't determine current directory"
+msgstr ""
+"Kann momentanes Verzeichnis nicht feststellen"
+
+#: src/manp.c:792
+#, c-format
+msgid "warning: %s does not have a man tree component"
+msgstr ""
+"Warnung: %s hat keine Manual-Verzeichniskomponente"
+
+#: src/manp.c:925
+#, c-format
+msgid "warning: %s does not begin with %s"
+msgstr ""
+"Warnung: %s fängt nicht mit %s an"
+
+#: src/manpath.c:64
+#, c-format
+msgid "usage: %s [[-gcdq] [-m system]] | [-V] | [-h]\n"
+msgstr ""
+"usage: %s [[-gcdq] [-m system]] | [-V] | [-h]\n"
+
+#: src/manpath.c:66
+msgid ""
+"-c --catpath show relative catpaths.\n"
+"-g --global show the entire global manpath.\n"
+"-d --debug produce debugging info.\n"
+"-q --quiet produce fewer warnings.\n"
+"-m --systems system express which `systems' to use.\n"
+"-V --version show version.\n"
+"-h --help show this usage message.\n"
+msgstr ""
+"-c --catpath Zeige entsprechende Pfade der vorformatierten\n"
+" Seiten an.\n"
+"-g --global Zeige den gesamten globalen Manualpfad an.\n"
+"-d --debug Erzeuge Debugging-Ausgaben.\n"
+"-q --quiet Erzeuge weniger Warnungen.\n"
+"-m --systems system Berücksichtige Manual-Seiten von anderen\n"
+" Unixsystemen.\n"
+"-V --version Zeige Versionsnummer an.\n"
+"-h --help Zeige diese Options-Zusammenfassung an.\n"
+
+#: src/manpath.c:132
+#, c-format
+msgid "warning: no global manpaths set in config file %s"
+msgstr ""
+"Warnung: Keine globalen Manualpfade in der Konfigurationsdatei gesetzt"
+
+#: src/security.c:68
+msgid "can't set effective uid"
+msgstr ""
+"Kann effektive Benutzerkennung nicht setzen"
+
+#: src/straycats.c:225 src/ult_src.c:150
+#, c-format
+msgid "warning: %s is a dangling symlink"
+msgstr ""
+
+#: src/straycats.c:229 src/ult_src.c:154 src/ult_src.c:246
+#, c-format
+msgid "can't resolve %s"
+msgstr ""
+
+#: src/straycats.c:279
+#, c-format
+msgid "Checking for stray cats under %s...\n"
+msgstr ""
+"Suche nach Manual-Seiten ohne Quellcode...\n"
+
+#: src/straycats.c:317
+#, c-format
+msgid "warning: can't update index cache %s"
+msgstr ""
+"Warnung: Kann Indexcache %s nicht updaten"
+
+#: src/ult_src.c:274
+#, c-format
+msgid "%s is self referencing"
+msgstr ""
+"%s bezieht sich auf sich selbst"
+
+#: src/version.c:31
+#, c-format
+msgid "%s, version %s, db %s, %s (G.Wilford@ee.surrey.ac.uk)\n"
+msgstr ""
+
+#: src/version.c:35
+#, c-format
+msgid "\tdebian version %s, (%s), %s\n"
+msgstr ""
+
+#: src/whatis.c:130 src/whatis.c:146
+#, c-format
+msgid ""
+"usage: %s [-d] [-r|-w] [-m systems] [-M manpath] | [-h] | [-V] keyword ...\n"
+msgstr ""
+"usage: %s [-d] [-r|-w] [-m systems] [-M manpath] | [-h] | [-V] keyword ...\n"
+
+#: src/whatis.c:132 src/whatis.c:148
+msgid ""
+"-d --debug\t\tproduce debugging info.\n"
+"-r --regex \t\tinterpret each keyword as a regex.\n"
+"-w --wildcard\t\tthe keyword(s) contain wildcards.\n"
+"-m --systems system\tinclude alternate systems man pages.\n"
+"-M --manpath path\tset search path for manual pages to `path'.\n"
+"-V --version\t\tshow version.\n"
+"-h --help\t\tshow this usage message.\n"
+msgstr ""
+"-d --debug Erzeuge Debugging-Ausgaben.\n"
+"-r --regex interpret each keyword as a regex.\n"
+"-w --wildcard the keyword(s) contain wildcards.\n"
+"-m --systems system include alternate systems man pages.\n"
+"-M --manpath path Setze Suchpfad für Manual-Seiten auf `Path'..\n"
+"-V --version Zeige Versionsnummer an.\n"
+"-h --help Zeige diese Options-Zusammenfassung an.\n"
+
+#: src/whatis.c:190
+msgid "warning: can't read the fallback whatis text database."
+msgstr ""
+"Warnung: Kann whatis-Textdatenbank nicht lesen"
+
+#: src/whatis.c:219 src/whatis.c:231
+msgid "(unknown)"
+msgstr ""
+"(unbekannt)"
+
+#: src/whatis.c:491
+#, c-format
+msgid "%s: nothing appropriate.\n"
+msgstr ""
+"%s: nichts passendes.\n"
+
+#: src/whatis.c:555
+#, c-format
+msgid "%s what?\n"
+msgstr ""
+"%s was bitte?\n"
+
+#: src/whatis.c:580 src/whatis.c:593
+#, c-format
+msgid "fatal: regex `%s': %s"
+msgstr ""
+"Fatal: Suchausdruck `%s': %s"
diff --git a/po/es.po b/po/es.po
new file mode 100644
index 00000000..92249ecc
--- /dev/null
+++ b/po/es.po
@@ -0,0 +1,736 @@
+# Mensajes en español para man-db.
+# César Ballardini <cballard@santafe.com.ar>, 1998.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: man-db 2.3.10\n"
+"POT-Creation-Date: 1998-03-09 08:18+0200\n"
+"PO-Revision-Date: 1998-04-16 19:52+0200\n"
+"Last-Translator: César Ballardini <cballard@santafe.com.ar>\n"
+"Language-Team: debian-l10n-spanish@lists.debian.org\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: libdb/db_delete.c:104
+#, c-format
+msgid "multi key %s does not exist"
+msgstr "la clave múltiple %s no existe"
+
+#: libdb/db_lookup.c:66
+#, c-format
+msgid "can't lock index cache %s"
+msgstr ""
+"no se puede blolquear el caché de índices %s"
+
+#: libdb/db_lookup.c:75
+#, c-format
+msgid "index cache %s corrupt"
+msgstr ""
+"el caché de índices %s está dañado"
+
+#: libdb/db_lookup.c:83
+#, c-format
+msgid "cannot replace key %s"
+msgstr ""
+"no se puede reemplazar la clave %s"
+
+#: libdb/db_lookup.c:146
+#, c-format
+msgid "only %d fields in content"
+msgstr ""
+"sólo %d campos en el contenido"
+
+#: libdb/db_lookup.c:305
+#, c-format
+msgid "bad fetch on multi key %s"
+msgstr ""
+"no se ha encontrado la clave múltiple %s"
+
+#: libdb/db_store.c:54
+#, c-format
+msgid "cannot insert unused key %s"
+msgstr ""
+"no se puede insertar la clave no usada %s"
+
+#: libdb/db_ver.c:63
+#, c-format
+msgid "fatal: unable to insert version identifier into %s"
+msgstr ""
+"error grave: no se puede insertar identificador de versión en %s"
+
+#: libdb/db_ver.c:74
+#, c-format
+msgid "warning: %s has no version identifier"
+msgstr ""
+"aviso: %s no tiene identificador de versión"
+
+#: libdb/db_ver.c:78
+#, c-format
+msgid "warning: %s is version %s, expecting %s"
+msgstr ""
+"aviso: %s tiene la versión %s, se esperaba %s"
+
+#: src/catman.c:126
+#, c-format
+msgid "usage: %s [-dhV] [-M manpath] [section] ...\n"
+msgstr ""
+"uso: %s [-dhV] [-M ruta_manual] [sección] ...\n"
+
+#: src/catman.c:128
+msgid ""
+"-d --debug produce debugging info.\n"
+"-M --manpath path set search path for manual pages to `path'.\n"
+"-V --version show version.\n"
+"-h --help show this usage message.\n"
+msgstr ""
+"-d --debug muestra información de depurado.\n"
+"-M --manpath ruta especifica la ruta de búsqueda de págs. de man.\n"
+"-V --version muestra información de versión.\n"
+"-h --help muestra este mensaje de uso.\n"
+
+#: src/catman.c:143
+#, c-format
+msgid "cannot read database %s"
+msgstr ""
+"no se puede leer la base de datos %s"
+
+#: src/catman.c:169
+msgid "fork failed"
+msgstr ""
+"falló operación fork"
+
+#: src/catman.c:183
+msgid "can't get man command's exit status"
+msgstr ""
+"no se pudo obtener el código de retorno de la orden man"
+
+#: src/catman.c:187
+#, c-format
+msgid "man command failed with exit status %d"
+msgstr ""
+"la orden man falló con código de retorno %d"
+
+#: src/catman.c:242
+#, c-format
+msgid "unable to reset cursor position in %s"
+msgstr ""
+"no se puede reposicionar el cursor en %s"
+
+#: src/catman.c:299
+#, c-format
+msgid "NULL content for key: %s"
+msgstr ""
+"contenido NULL para la clave: %s"
+
+#: src/catman.c:316
+#, c-format
+msgid ""
+"\n"
+"Updating cat files for section %s of man hierarchy %s\n"
+msgstr ""
+"\nActualizando los ficheros cat para la sección %s de la jerarquía de manual %s\n"
+
+#: src/catman.c:373
+#, c-format
+msgid "cannot write within %s"
+msgstr ""
+"no se puede escribir en %s"
+
+#: src/catman.c:506
+#, c-format
+msgid "unable to update %s"
+msgstr ""
+"no se puede actualizar %s"
+
+#: src/check_mandirs.c:76 src/straycats.c:116 src/straycats.c:144
+#, c-format
+msgid "warning: %s: ignoring bogus filename"
+msgstr ""
+"aviso: %s: se ignora un nombre espurio de fichero"
+
+#: src/check_mandirs.c:86
+#, c-format
+msgid "warning: %s/man%s/%s.%s*: competing extensions"
+msgstr ""
+"aviso: %s/man%s/%s.%s*: extensiones en conflicto"
+
+#: src/check_mandirs.c:296
+#, c-format
+msgid "warning: %s: bad symlink or ROFF `.so' request"
+msgstr ""
+"aviso: %s: enlace simbólico o solicitud `.so' de ROFF incorrectos"
+
+#: src/check_mandirs.c:367
+#, c-format
+msgid "warning: %s: ignoring empty file"
+msgstr ""
+"aviso: %s: ignorando fichero vacío"
+
+#: src/check_mandirs.c:375 src/straycats.c:246
+#, c-format
+msgid "warning: %s: whatis parse for %s(%s) failed"
+msgstr ""
+"aviso: %s: falló la exploración de whatis para %s(%s)"
+
+#: src/check_mandirs.c:403 src/check_mandirs.c:440 src/straycats.c:85
+#: src/straycats.c:272 src/ult_src.c:112
+#, c-format
+msgid "can't search directory %s"
+msgstr ""
+"no se puede buscar en el directorio %s"
+
+#: src/check_mandirs.c:465 src/check_mandirs.c:511 src/man.c:2044
+#, c-format
+msgid "can't update index cache %s"
+msgstr ""
+"no se puede actualizar el caché de índices %s"
+
+#: src/check_mandirs.c:473
+#, c-format
+msgid "\rUpdating index cache for path `%s'. Wait..."
+msgstr ""
+"\rActualizando el caché de índices para la ruta `%s'. Aguarde..."
+
+#: src/check_mandirs.c:570
+#, c-format
+msgid "can't create index cache %s"
+msgstr ""
+"no se puede crear el caché de índices %s"
+
+#: src/check_mandirs.c:584 src/check_mandirs.c:616
+msgid "done.\n"
+msgstr ""
+"listo.\n"
+
+#: src/compression.c:72
+msgid "can't create a temporary filename"
+msgstr ""
+"no se puede crear un nombre de fichero temporal"
+
+#: src/convert_name.c:47
+#, c-format
+msgid "Can't convert %s to cat name"
+msgstr ""
+"No se puede convertir %s a un nombre tipo cat"
+
+#: src/lexgrog.l:212
+#, c-format
+msgid "warning: whatis for %s exceeds %d bytes, truncating."
+msgstr ""
+"aviso: whatis para %s excede %d bytes, se truncará el exceso."
+
+#: src/lexgrog.l:251 src/ult_src.c:310 src/ult_src.c:318
+#, c-format
+msgid "can't open %s"
+msgstr ""
+"no se puede abrir %s"
+
+#: src/man.c:319
+msgid "can't popen"
+msgstr ""
+"no se puede realizar el popen"
+
+#: src/man.c:328
+#, c-format
+msgid "command exited with status %d: %s"
+msgstr ""
+"la orden terminó y retornó %d: %s"
+
+#: src/man.c:459
+#, c-format
+msgid ""
+"usage: %s [-c|-f|-k|-w|-tZT device] [-adlhu7V] [-Mpath] [-Ppager] [-Slist]\n"
+" [-msystem] [-pstring] [-Llocale] [-eextension] [section] page "
+"...\n"
+msgstr ""
+"uso: %s [-c|-f|-k|-w|-tZT dispositivo] [-adlhu7V] [-Mruta] [-Phojeador] [-Slista]\n"
+" [-msistema] [-pcadena] [-Llocale] [-eextensión] [sección] página ...\n"
+
+#: src/man.c:464
+#, c-format
+msgid ""
+"usage: %s [-c|-f|-k|-w] [-adlhu7V] [-Mpath] [-Ppager] [-Slist] [-msystem]\n"
+" [-pstring] [-Llocale] [-eextension] [section] page ...\n"
+msgstr ""
+"uso: %s [-c|-f|-k|-w] [-adlhu7V] [-Mruta] [-Phojeador] [-Slista] [-msistema]\n"
+" [-pcadena] [-Llocale] [-eextensión] [sección] página ...\n"
+
+# Es `la' y no `las' conversiones, así como uno diría "el lado oscuro de los
+# hombres" y no "los lados oscuros de los hombres".. =) nl
+#: src/man.c:470
+msgid ""
+"-a, --all find all matching manual pages.\n"
+"-d, --debug emit debugging messages.\n"
+"-e, --extension limit search to extension type `extension'.\n"
+"-f, --whatis equivalent to whatis.\n"
+"-k, --apropos equivalent to apropos.\n"
+"-w, --where, --location print physical location of man page(s).\n"
+"-l, --local-file interpret `page' argument(s) as local "
+"filename(s).\n"
+"-u, --update force a cache consistency check.\n"
+"-r, --prompt string provide the `less' pager with a prompt\n"
+"-c, --catman used by catman to reformat out of date cat "
+"pages.\n"
+"-7, --ascii display ASCII translation of certain latin1 "
+"chars."
+msgstr ""
+"-a, --all encuentra todas las páginas de manual que concuerdan.\n"
+"-d, --debug muestra mensajes de depuración.\n"
+"-e, --extension limita búsqueda a extensiones `extensión'.\n"
+"-f, --whatis equivalente a whatis.\n"
+"-k, --apropos equivalente a apropos.\n"
+"-w, --where, --location muestra la ubicación física de la(s) página(s) man.\n"
+"-l, --local-file interpreta el(los) argumento(s) `página' como nombre(s) de fichero(s) local(es).\n"
+"-u, --update obliga un control de consistencia de caché.\n"
+"-r, --prompt cadena proporciona un prompt a `less'\n"
+"-c, --catman usado por catman para dar nuevo formato a páginas cat desactualizadas.\n"
+"-7, --ascii muestra la conversión ASCII de ciertos caracteres latin1."
+
+#: src/man.c:483
+#, c-format
+msgid ""
+"-t, --troff use %s to format pages.\n"
+"-T, --troff-device device use %s with selected device.\n"
+msgstr ""
+"-t, --troff usar %s para dar formato a las páginas.\n"
+"-T, --troff-device device usar %s con el dispositivo seleccionado.\n"
+
+#: src/man.c:488
+msgid "-Z, --ditroff use groff and force it to produce ditroff."
+msgstr ""
+"-Z, --ditroff usa groff y lo fuerza a generar ditroff."
+
+#: src/man.c:493
+msgid ""
+"-D, --default reset all options to their default values.\n"
+"-M, --manpath path set search path for manual pages to `path'.\n"
+"-P, --pager pager use program `pager' to display output.\n"
+"-S, --sections list use colon separated section list.\n"
+"-m, --systems system search for man pages from other unix system(s).\n"
+"-L, --locale locale define the locale for this particular man "
+"search.\n"
+"-p, --preprocessor string string indicates which preprocessors to run."
+msgstr ""
+"-D, --default todas las opciones toman sus valores predeterminados.\n"
+"-M, --manpath ruta `ruta' es donde se buscarán las páginas de manual.\n"
+"-P, --pager paginador usa el programa `paginador' para mostrar la salida.\n"
+"-S, --sections lista usa la lista de secciones separada por `:'.\n"
+"-m, --systems sistema busca páginas man de otros sistemas unix.\n"
+"-L, --locale locale define el locale para esta búsqueda en particular.\n"
+"-p, --preprocessor cadena la cadena indica que preprocesadores usar."
+
+#: src/man.c:503
+msgid ""
+"-V, --version show version.\n"
+"-h, --help show this usage message."
+msgstr ""
+"-V, --version muestra información de versión.\n"
+"-h, --help muestra este mensaje de uso."
+
+#: src/man.c:517
+#, c-format
+msgid "What manual page do you want from section %s?\n"
+msgstr ""
+"¿Qué página de manual de la sección %s desea?\n"
+
+#: src/man.c:520
+msgid "What manual page do you want?\n"
+msgstr ""
+"¿Qué página de manual desea?\n"
+
+#: src/man.c:548
+#, c-format
+msgid "No source manual entry for %s"
+msgstr ""
+"No existe una entrada de manual fuente para %s"
+
+#: src/man.c:558
+#, c-format
+msgid "No manual entry for %s"
+msgstr ""
+"No existe entrada de manual para %s"
+
+#: src/man.c:563
+#, c-format
+msgid " in section %s\n"
+msgstr ""
+" en la sección %s\n"
+
+#: src/man.c:818
+msgid ""
+" Manual page $MAN_PN ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\\\\%.."
+msgstr ""
+" Página de Manual $MAN_PN "
+"?ltlínea %lt?L/%L.:byte %bB?s/%s..?e (FIN):"
+"?pB %pB\\\\%.."
+
+#: src/man.c:1071
+msgid ": incompatible options"
+msgstr ""
+": opciones incompatibles"
+
+#: src/man.c:1286
+#, c-format
+msgid "ignoring unknown preprocessor `%c'"
+msgstr ""
+"se ignora el preprocesador desconocido `%c'"
+
+#: src/man.c:1348 src/man.c:1399 src/mandb.c:209
+#, c-format
+msgid "can't chown %s"
+msgstr ""
+"no se puede realizar el chown %s"
+
+#: src/man.c:1382 src/mandb.c:180
+#, c-format
+msgid "can't chmod %s"
+msgstr ""
+"no se puede realizar el chmod %s"
+
+#: src/man.c:1414 src/mandb.c:171
+#, c-format
+msgid "can't rename %s to %s"
+msgstr ""
+"no se puede cambiar el nombre %s a %s"
+
+#: src/man.c:1426
+#, c-format
+msgid "can't unlink %s"
+msgstr ""
+"no se puede eliminar %s"
+
+#: src/man.c:1454
+msgid "can't create pipe"
+msgstr ""
+"no se puede crear tubería"
+
+#: src/man.c:1462 src/security.c:212
+msgid "can't fork"
+msgstr ""
+"no se puede realizar la operación fork"
+
+#: src/man.c:1479 src/man.c:1491
+msgid "can't dup2"
+msgstr ""
+"no se puede realizar la operación dup2"
+
+#: src/man.c:1487
+#, c-format
+msgid "can't create %s"
+msgstr ""
+"no se puede crear %s"
+
+#: src/man.c:1511
+#, c-format
+msgid "can't exec %s"
+msgstr ""
+"no se puede realizar la operación exec %s"
+
+#: src/man.c:1550
+#, c-format
+msgid "waiting for pid %u"
+msgstr ""
+"aguardando el pid %u"
+
+#: src/man.c:1603
+msgid "Still saving the page, please wait...\n"
+msgstr ""
+"Aún se está grabando la página, aguarde por favor...\n"
+
+#: src/man.c:1645
+#, c-format
+msgid "can't chdir to %s"
+msgstr ""
+"no se puede cambiar al directorio %s"
+
+#: src/man.c:1757
+#, c-format
+msgid ""
+"\n"
+"cannot write to %s in catman mode"
+msgstr ""
+"\nno se puede escribir en %s en modo catman"
+
+# Sin `nuevo' describe mejor la operación realizada. nl
+#: src/man.c:1800
+#, c-format
+msgid "Reformatting %s, please wait...\n"
+msgstr ""
+"Dando formato a %s, aguarde por favor...\n"
+
+#: src/man.c:2398
+#, c-format
+msgid "--Man-- next: %s [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]\n"
+msgstr ""
+"--Man-- próximo: %s "
+"[ ver (return) | siguiente (Ctrl-D) | salir (Ctrl-C) ]\n"
+
+#: src/mandb.c:145
+#, c-format
+msgid "usage: %s [-dqsuc|-h|-V] [manpath]\n"
+msgstr ""
+"uso: %s [-dqsuc|-h|-V] [rutaman]\n"
+
+#: src/mandb.c:147
+msgid ""
+"-d --debug produce debugging info.\n"
+"-q --quiet work quietly, except for 'bogus' warning.\n"
+"-s --no-straycats don't look for or add stray cats to the dbs.\n"
+"-u --user-db produce user databases only.\n"
+"-c --create create dbs from scratch, rather than updating.\n"
+"-V --version show version.\n"
+"-h --help show this usage message.\n"
+msgstr ""
+"-d --debug genera información de depurado.\n"
+"-q --quiet trabaja silenciosamente, a excepción de avisos `espurios'.\n"
+"-s --no-straycats ni busca ni agrega cats sin fuentes a las bases.\n"
+"-u --user-db sólo genera bases de datos de usuario.\n"
+"-c --create crea las bases desde cero, en lugar de actualizarlas.\n"
+"-V --version muestra la versión.\n"
+"-h --help muestra este mensaje de uso.\n"
+
+#: src/mandb.c:163 src/security.c:160
+#, c-format
+msgid "can't remove %s"
+msgstr ""
+"no se puede borrar %s"
+
+#: src/mandb.c:267
+#, c-format
+msgid "Processing manual pages under %s...\n"
+msgstr ""
+"Procesando las páginas de manual bajo %s...\n"
+
+#: src/mandb.c:382
+#, c-format
+msgid "the setuid man user \"%s\" does not exist"
+msgstr ""
+"el usuario setuid a man `%s' no existe"
+
+# manpath es algo específico, debe estar presente. nl
+#: src/mandb.c:406
+#, c-format
+msgid "warning: no MANDB_MAP directives in %s, using your manpath"
+msgstr ""
+"aviso: no hay directivas MANDB_MAP en %s, se utilizará su ruta man (manpath)"
+
+#: src/mandb.c:446
+#, c-format
+msgid ""
+"%d man subdirectories contained newer manual pages.\n"
+"%d manual pages "
+msgstr ""
+"%d subdirectorios man tenían páginas de manual más recientes.\n"
+"%d páginas de manual"
+
+#: src/mandb.c:451
+#, c-format
+msgid "and %d stray cats "
+msgstr ""
+"y %d cats sin fuentes "
+
+#: src/mandb.c:452
+msgid "were added."
+msgstr ""
+"fueron agregados."
+
+#: src/manp.c:119
+#, c-format
+msgid "can't make sense of the manpath configuration file %s"
+msgstr ""
+"can't make sense of the manpath configuration file %s"
+
+#: src/manp.c:127
+#, c-format
+msgid "warning: %s"
+msgstr ""
+"aviso: %s"
+
+#: src/manp.c:134
+#, c-format
+msgid "warning: %s isn't a directory"
+msgstr ""
+"aviso: %s no es un directorio"
+
+#: src/manp.c:362
+#, c-format
+msgid "warning: $MANPATH set, ignoring %s"
+msgstr ""
+"aviso: $MANPATH asignada, ignorando %s"
+
+#: src/manp.c:378
+msgid "warning: $PATH not set"
+msgstr ""
+"aviso: $PATH no asignada"
+
+#: src/manp.c:391
+msgid "warning: empty $PATH"
+msgstr ""
+"aviso: $PATH está vacía"
+
+#: src/manp.c:418 src/manp.c:440
+#, c-format
+msgid "warning: cannot create catdir %s"
+msgstr "aviso: no se pudo crear catdir %s"
+
+#: src/manp.c:464
+#, c-format
+msgid "can't open the manpath configuration file %s"
+msgstr ""
+"no se puede abrir el fichero de configuración de ruta man %s"
+
+# `parse' no es explorar, es más parecido a `entender'. nl
+#: src/manp.c:516
+#, c-format
+msgid "can't parse directory list `%s'"
+msgstr ""
+"no se puede interpretar correctamente la lista de directorios `%s'"
+
+#: src/manp.c:563
+#, c-format
+msgid "warning: mandatory directory %s doesn't exist"
+msgstr ""
+"aviso: el directorio %s no existe y es obligatorio"
+
+#: src/manp.c:778
+msgid "can't determine current directory"
+msgstr ""
+"no se puede determinar el directorio actual"
+
+#: src/manp.c:792
+#, c-format
+msgid "warning: %s does not have a man tree component"
+msgstr ""
+"aviso: %s no tiene un componente de árbol de manual"
+
+#: src/manp.c:925
+#, c-format
+msgid "warning: %s does not begin with %s"
+msgstr ""
+"aviso: %s no comienza con %s"
+
+#: src/manpath.c:64
+#, c-format
+msgid "usage: %s [[-gcdq] [-m system]] | [-V] | [-h]\n"
+msgstr ""
+"uso: %s [[-gcdq] [-m sistema]] | [-V] | [-h]\n"
+
+#: src/manpath.c:66
+msgid ""
+"-c --catpath show relative catpaths.\n"
+"-g --global show the entire global manpath.\n"
+"-d --debug produce debugging info.\n"
+"-q --quiet produce fewer warnings.\n"
+"-m --systems system express which `systems' to use.\n"
+"-V --version show version.\n"
+"-h --help show this usage message.\n"
+msgstr ""
+"-c --catpath muestra las rutas de cat relativas.\n"
+"-g --global muestra la ruta global completa de man.\n"
+"-d --debug genera información de depurado.\n"
+"-q --quiet genera menos avisos.\n"
+"-m --systems sistema indica cuales `sistema's usar.\n"
+"-V --version muestra la versión.\n"
+"-h --help muestra este mensaje de uso.\n"
+
+#: src/manpath.c:132
+#, c-format
+msgid "warning: no global manpaths set in config file %s"
+msgstr "aviso: no se han asignado rutas man globales en el fichero de configuración %s"
+
+#: src/security.c:68
+msgid "can't set effective uid"
+msgstr "no se puede asignar el uid efectivo"
+
+#: src/straycats.c:225 src/ult_src.c:150
+#, c-format
+msgid "warning: %s is a dangling symlink"
+msgstr "aviso: %s es un enláce simbólico colgado"
+
+#: src/straycats.c:229 src/ult_src.c:154 src/ult_src.c:246
+#, c-format
+msgid "can't resolve %s"
+msgstr "Es imposible resolver %s"
+
+#: src/straycats.c:279
+#, c-format
+msgid "Checking for stray cats under %s...\n"
+msgstr ""
+"Controlando si hay páginas cat sin fuentes bajo %s...\n"
+
+#: src/straycats.c:317
+#, c-format
+msgid "warning: can't update index cache %s"
+msgstr ""
+"aviso: no se puede actualizar el caché de índices %s"
+
+#: src/ult_src.c:274
+#, c-format
+msgid "%s is self referencing"
+msgstr ""
+"%s es autoreferenciante"
+
+#: src/version.c:31
+#, c-format
+msgid "%s, version %s, db %s, %s (G.Wilford@ee.surrey.ac.uk)\n"
+msgstr ""
+"%s, versión %s, db %s, %s (G.Wilford@ee.surrey.ac.uk)\n"
+
+#: src/version.c:35
+#, c-format
+msgid "\tdebian version %s, (%s), %s\n"
+msgstr ""
+"\tversión Debian %s, (%s), %s\n"
+
+#: src/whatis.c:130 src/whatis.c:146
+#, c-format
+msgid ""
+"usage: %s [-d] [-r|-w] [-m systems] [-M manpath] | [-h] | [-V] keyword ...\n"
+msgstr ""
+"uso: %s [-d] [-r|-w] [-m sistema] [-M rutaman] | [-h] | [-V] palabra_clave ...\n"
+
+#: src/whatis.c:132 src/whatis.c:148
+msgid ""
+"-d --debug\t\tproduce debugging info.\n"
+"-r --regex \t\tinterpret each keyword as a regex.\n"
+"-w --wildcard\t\tthe keyword(s) contain wildcards.\n"
+"-m --systems system\tinclude alternate systems man pages.\n"
+"-M --manpath path\tset search path for manual pages to `path'.\n"
+"-V --version\t\tshow version.\n"
+"-h --help\t\tshow this usage message.\n"
+msgstr ""
+"-d --debug genera información de depurado.\n"
+"-r --regex interpreta cada palabra clave como regex.\n"
+"-w --wildcard la(s) palabra(s) clave contienen comodines.\n"
+"-m --systems sistema incluye páginas de manual de sistemas alternativos.\n"
+"-M --manpath ruta las páginas de manual se buscarán en `ruta'.\n"
+"-V --version muestra la versión.\n"
+"-h --help muestra este mensaje de uso.\n"
+
+#: src/whatis.c:190
+msgid "warning: can't read the fallback whatis text database."
+msgstr ""
+"aviso: no se puede leer la base de datos textual whatis para el caso general."
+
+#: src/whatis.c:219 src/whatis.c:231
+msgid "(unknown)"
+msgstr ""
+"(desconocido)"
+
+#: src/whatis.c:491
+#, c-format
+msgid "%s: nothing appropriate.\n"
+msgstr ""
+"%s: nada apropiado.\n"
+
+#: src/whatis.c:555
+#, c-format
+msgid "%s what?\n"
+msgstr ""
+"%s ¿qué?\n"
+
+#: src/whatis.c:580 src/whatis.c:593
+#, c-format
+msgid "fatal: regex `%s': %s"
+msgstr "error fatal: regex `%s': %s"
diff --git a/po/fr.po b/po/fr.po
new file mode 100644
index 00000000..890f31b0
--- /dev/null
+++ b/po/fr.po
@@ -0,0 +1,717 @@
+# French translation of man-db messages
+# Copyright (C) 1999 Free Software Foundation, Inc.
+# Laurent Pélecq <laurent.pelecq@wanadoo.fr>, 1999.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: man-db 2.3.10\n"
+"POT-Creation-Date: 1999-10-08 21:17+0200\n"
+"PO-Revision-Date: 1999-10-10 18:23+02:00\n"
+"Last-Translator: Laurent Pélecq <laurent.pelecq@wanadoo.fr>\n"
+"Language-Team: debian-l10n-french@lists.debian.org\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8-bit\n"
+
+#: libdb/db_delete.c:104
+#, c-format
+msgid "multi key %s does not exist"
+msgstr "la clef multiple %s n'existe pas"
+
+#: libdb/db_lookup.c:66
+#, c-format
+msgid "can't lock index cache %s"
+msgstr "impossible de verrouiller le cache d'index %s"
+
+#: libdb/db_lookup.c:75
+#, c-format
+msgid "index cache %s corrupt"
+msgstr "le cache d'index %s est endommagé"
+
+#: libdb/db_lookup.c:83
+#, c-format
+msgid "cannot replace key %s"
+msgstr "impossible de remplacer la clef %s"
+
+#: libdb/db_lookup.c:146
+#, c-format
+msgid "only %d fields in content"
+msgstr "il n'y a que %d champs dans le contenu"
+
+#: libdb/db_lookup.c:305
+#, c-format
+msgid "bad fetch on multi key %s"
+msgstr "mauvais accés sur la clef multiple %s"
+
+#: libdb/db_store.c:54
+#, c-format
+msgid "cannot insert unused key %s"
+msgstr "impossible d'insérer la clef non-utilisée %s"
+
+#: libdb/db_ver.c:63
+#, c-format
+msgid "fatal: unable to insert version identifier into %s"
+msgstr "fatal: imposible d'insérer l'identifiant de version dans %s"
+
+#: libdb/db_ver.c:74
+#, c-format
+msgid "warning: %s has no version identifier"
+msgstr "attention: %s n'a pas d'identifiant de version"
+
+#: libdb/db_ver.c:78
+#, c-format
+msgid "warning: %s is version %s, expecting %s"
+msgstr "attention: %s a pour version %s, on espérait la version %s"
+
+#: src/catman.c:121
+#, c-format
+msgid "usage: %s [-dhV] [-M manpath] [section] ...\n"
+msgstr "usage: %s [-dhV] [-M chemin_vers_le_manuel] [section]\n"
+
+#: src/catman.c:123
+msgid ""
+"-d --debug produce debugging info.\n"
+"-M --manpath path set search path for manual pages to `path'.\n"
+"-V --version show version.\n"
+"-h --help show this usage message.\n"
+msgstr ""
+"-d --debug affiche des informations de déboguage.\n"
+"-M --manpath chemin positionne le chemin pour atteindre les pages\n"
+" du manuel.\n"
+"-V --version affiche la version.\n"
+"-h --help affiche ce message-ci.\n"
+
+#: src/catman.c:136
+#, c-format
+msgid "cannot read database %s"
+msgstr "impossible de lire la base de données %s"
+
+#: src/catman.c:162
+msgid "fork failed"
+msgstr "le lancement d'un processus a échoué (fork)"
+
+#: src/catman.c:174
+msgid "can't get man command's exit status"
+msgstr "impossible d'obtenir le code de retour de la commande man"
+
+#: src/catman.c:176
+#, c-format
+msgid "man command failed with exit status %d"
+msgstr "la commande man a échoué avec %d comme code de retour"
+
+#: src/catman.c:228
+#, c-format
+msgid "unable to reset cursor position in %s"
+msgstr "impossible de repositionner le curseur dans %s"
+
+#: src/catman.c:282
+#, c-format
+msgid "NULL content for key: %s"
+msgstr "contenu vide (NULL) pour la clef: %s"
+
+#: src/catman.c:297
+#, c-format
+msgid ""
+"\n"
+"Updating cat files for section %s of man hierarchy %s\n"
+msgstr ""
+"\n"
+"Mise à jour des fichiers préformattés pour la section %s de %s\n"
+
+#: src/catman.c:353
+#, c-format
+msgid "cannot write within %s"
+msgstr "impossible d'écrire dans %s"
+
+#: src/catman.c:497
+#, c-format
+msgid "unable to update %s"
+msgstr "impossible de mettre %s à jour"
+
+#: src/check_mandirs.c:73 src/straycats.c:112 src/straycats.c:138
+#, c-format
+msgid "warning: %s: ignoring bogus filename"
+msgstr "attention: %s: nom de fichier erroné, ignoré"
+
+#: src/check_mandirs.c:80
+#, c-format
+msgid "warning: %s/man%s/%s.%s*: competing extensions"
+msgstr "attention: %s/man%s/%s.%s*: extentions en conflit"
+
+#: src/check_mandirs.c:288
+#, c-format
+msgid "warning: %s: bad symlink or ROFF `.so' request"
+msgstr "attention: %s: lien symbolique ou directive ROFF .so incorrect"
+
+#: src/check_mandirs.c:356
+#, c-format
+msgid "warning: %s: ignoring empty file"
+msgstr "attention: %s: fichier vide ignoré"
+
+#: src/check_mandirs.c:361 src/straycats.c:244
+#, c-format
+msgid "warning: %s: whatis parse for %s(%s) failed"
+msgstr "attention: %s: la recherche de whatis sur %s(%s) a échoué"
+
+#: src/check_mandirs.c:388 src/check_mandirs.c:423 src/straycats.c:83
+#: src/straycats.c:269 src/ult_src.c:109
+#, c-format
+msgid "can't search directory %s"
+msgstr "impossible de chercher dans le répertoire %s"
+
+#: src/check_mandirs.c:446 src/check_mandirs.c:486 src/man.c:2174
+#, c-format
+msgid "can't update index cache %s"
+msgstr "impossible de mettre à jour le cache d'index %s"
+
+#: src/check_mandirs.c:451
+#, c-format
+msgid "\rUpdating index cache for path `%s'. Wait..."
+msgstr "\rMise à jour du cache d'index pour le chemin `%s'. Attendez..."
+
+#: src/check_mandirs.c:543
+#, c-format
+msgid "can't create index cache %s"
+msgstr "impossible de créer le cache d'index %s"
+
+#: src/check_mandirs.c:556 src/check_mandirs.c:588
+msgid "done.\n"
+msgstr "terminé.\n"
+
+#: src/compression.c:70 src/man.c:1218
+msgid "can't create a temporary filename"
+msgstr "impossible de créer un nom de fichier temporaire"
+
+#: src/convert_name.c:44
+#, c-format
+msgid "Can't convert %s to cat name"
+msgstr "Impossible de convertir %s en nom de page préformattée"
+
+#: src/lexgrog.l:204
+#, c-format
+msgid "warning: whatis for %s exceeds %d bytes, truncating."
+msgstr "attention: whatis pour %s produit plus de %d octets, excédant tronqué."
+
+#: src/lexgrog.l:241 src/ult_src.c:298 src/ult_src.c:304
+#, c-format
+msgid "can't open %s"
+msgstr "impossible d'ouvrir %s"
+
+#: src/man.c:326
+msgid "can't popen"
+msgstr "impossible d'ouvrir un tube"
+
+#: src/man.c:364
+#, c-format
+msgid "command exited with status %d: %s"
+msgstr "commande terminée avec %d comme code de retour: %s"
+
+#: src/man.c:494
+#, c-format
+msgid ""
+"usage: %s [-c|-f|-k|-w|-tZT device] [-adlhu7V] [-Mpath] [-Ppager] [-Slist]\n"
+" [-msystem] [-pstring] [-Llocale] [-eextension] [section] page "
+"...\n"
+msgstr ""
+"usage: %s [-c|-f|-k|-w|-tZT périphérique] [-adlhu7V] [-Mchemin]\n"
+" [-Pvisualisateur] [-Sliste] [-msystème] [-pchaîne] [-Llocale]\n"
+" [-eextension] [section] page\n"
+" ...\n"
+
+#: src/man.c:499
+#, c-format
+msgid ""
+"usage: %s [-c|-f|-k|-w] [-adlhu7V] [-Mpath] [-Ppager] [-Slist] [-msystem]\n"
+" [-pstring] [-Llocale] [-eextension] [section] page ...\n"
+msgstr ""
+"usage: %s [-c|-f|-k|-w] [-adlhu7V] [-Mchemin] [-Pvisualisateur] [-Sliste]\n"
+" [-msystème] [-pchaîne] [-Llocale] [-eextension] [section] page ...\n"
+
+#: src/man.c:505
+msgid ""
+"-a, --all find all matching manual pages.\n"
+"-d, --debug emit debugging messages.\n"
+"-e, --extension limit search to extension type `extension'.\n"
+"-f, --whatis equivalent to whatis.\n"
+"-k, --apropos equivalent to apropos.\n"
+"-w, --where, --location print physical location of man page(s).\n"
+"-l, --local-file interpret `page' argument(s) as local "
+"filename(s).\n"
+"-u, --update force a cache consistency check.\n"
+"-r, --prompt string provide the `less' pager with a prompt\n"
+"-c, --catman used by catman to reformat out of date cat "
+"pages.\n"
+"-7, --ascii display ASCII translation of certain latin1 "
+"chars."
+msgstr ""
+"-a, --all trouve toutes les pages adéquates.\n"
+"-d, --debug affiches des messages de déboguage.\n"
+"-e, --extension limite la recherche au extension `extension'.\n"
+"-f, --whatis equivalent de whatis.\n"
+"-k, --apropos equivalent de apropos.\n"
+"-w, --where, --location affiche l'emplacement des pages du manuel.\n"
+"-l, --local-file interprète l'argument `page' comme un nom de\n"
+" fichier.\n"
+"-u, --update force une vérification de cohérence du cache.\n"
+"-r, --prompt string donne une chaîne d'invite au visualisateur `less'.\n"
+"-c, --catman utilisé par catman pour reformatter les pages\n"
+" trop vieilles.\n"
+"-7, --ascii affiche un équivalent ASCII de certains\n"
+" caractéres latin1."
+
+#: src/man.c:518
+#, c-format
+msgid ""
+"-t, --troff use %s to format pages.\n"
+"-T, --troff-device device use %s with selected device.\n"
+msgstr ""
+"-t, --troff utilise %s pour formatter les pages.\n"
+"-T, --troff-device device utilise %s avec le périphérique sélectionné.\n"
+
+#: src/man.c:523
+msgid "-Z, --ditroff use groff and force it to produce ditroff."
+msgstr "-Z, --ditroff utilise groff en le forçant à produire ditroff."
+
+#: src/man.c:528
+msgid ""
+"-D, --default reset all options to their default values.\n"
+"-M, --manpath path set search path for manual pages to `path'.\n"
+"-P, --pager pager use program `pager' to display output.\n"
+"-S, --sections list use colon separated section list.\n"
+"-m, --systems system search for man pages from other unix system(s).\n"
+"-L, --locale locale define the locale for this particular man "
+"search.\n"
+"-p, --preprocessor string string indicates which preprocessors to run."
+msgstr ""
+"-D, --default redonne leur valeur par défaut à toutes les\n"
+" options.\n"
+"-M, --manpath chemin positionne le chemin de recherche des pages.\n"
+"-P, --pager visualisateur utilise le programme `visualisateur' pour\n"
+" l'affichage des pages.\n"
+"-S, --sections liste utilise la liste des sections séparées par des\n"
+" virgules\n"
+"-m, --systems système cherche les pages du manuel provenant d'autres\n"
+" systèmes UNIX.\n"
+"-L, --locale locale défini la localisation pour cette recherche.\n"
+"-p, --preprocessor chaîne la chaîne indique le préprocesseur à utiliser."
+
+#: src/man.c:538
+msgid ""
+"-V, --version show version.\n"
+"-h, --help show this usage message."
+msgstr ""
+"-V, --version affiche la version.\n"
+"-h, --help affiche ce message-ci."
+
+#: src/man.c:551
+#, c-format
+msgid "What manual page do you want from section %s?\n"
+msgstr "Quelle page de manuel voulez-vous dans la section %s ?\n"
+
+#: src/man.c:553
+msgid "What manual page do you want?\n"
+msgstr "Quelle page de manuel voulez-vous ?\n"
+
+#: src/man.c:583
+#, c-format
+msgid "No source manual entry for %s"
+msgstr "Aucune entrée de source de manuel pour %s"
+
+#: src/man.c:592
+#, c-format
+msgid "No manual entry for %s"
+msgstr "Aucune entrée de manuel pour %s"
+
+#: src/man.c:597
+#, c-format
+msgid " in section %s\n"
+msgstr " dans la section %s\n"
+
+#: src/man.c:876
+msgid ""
+" Manual page $MAN_PN ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\\\\%.."
+msgstr " Page de manuel $MAN_PN ?ltligne %lt?L/%L.:octet %bB?s/%s..?e (FIN):?pB %pB\\\\%.."
+
+#: src/man.c:1107
+msgid ": incompatible options"
+msgstr ": options incompatibles"
+
+#: src/man.c:1263
+msgid "error trying to read from stdin"
+msgstr "erreur en essayant de lire sur l'entrée standard"
+
+#: src/man.c:1275
+#, c-format
+msgid "error writing to temporary file %s"
+msgstr "erreur lors de l'écriture vers le fichier temporaire %s"
+
+#. didn't fail on roff
+#: src/man.c:1433
+#, c-format
+msgid "ignoring unknown preprocessor `%c'"
+msgstr "le préprocesseur `%c' est inconnu et ignoré"
+
+#: src/man.c:1494 src/man.c:1542 src/mandb.c:203
+#, c-format
+msgid "can't chown %s"
+msgstr "impossible de changer le propriétaire de %s"
+
+#: src/man.c:1527 src/mandb.c:174
+#, c-format
+msgid "can't chmod %s"
+msgstr "impossible de changer les droits de %s"
+
+#: src/man.c:1554 src/mandb.c:165
+#, c-format
+msgid "can't rename %s to %s"
+msgstr "impossible de renommer %s en %s"
+
+#: src/man.c:1563
+#, c-format
+msgid "can't unlink %s"
+msgstr "impossible de supprimer %s"
+
+#: src/man.c:1590
+msgid "can't create pipe"
+msgstr "impossible de créer un tube"
+
+#: src/man.c:1598 src/security.c:208
+msgid "can't fork"
+msgstr "impossible de lancer un processus (fork)"
+
+#: src/man.c:1615 src/man.c:1625
+msgid "can't dup2"
+msgstr "impossible de dupliquer un descripteur de fichier (dup2)"
+
+#: src/man.c:1622
+#, c-format
+msgid "can't create %s"
+msgstr "impossible de créer %s"
+
+#: src/man.c:1644
+#, c-format
+msgid "can't exec %s"
+msgstr "impossible d'exécuter %s"
+
+#: src/man.c:1681
+#, c-format
+msgid "waiting for pid %u"
+msgstr "en attente du processus n°%u"
+
+#: src/man.c:1731
+msgid "Still saving the page, please wait...\n"
+msgstr "Toujours en train de sauvegarder la page, attendez SVP...\n"
+
+#: src/man.c:1774
+#, c-format
+msgid "can't chdir to %s"
+msgstr "impossible d'aller dans le répertoire %s"
+
+#: src/man.c:1891
+#, c-format
+msgid ""
+"\n"
+"cannot write to %s in catman mode"
+msgstr ""
+"\n"
+"impossible d'écrire vers %s en mode catman"
+
+#: src/man.c:1931
+#, c-format
+msgid "Reformatting %s, please wait...\n"
+msgstr "Remise en forme de %s, attendez SVP...\n"
+
+#: src/man.c:2528
+#, c-format
+msgid "--Man-- next: %s [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]\n"
+msgstr "--Man-- prochain: %s [ voir (return) | passer (Ctrl-D) | quitter (Ctrl-C) ]\n"
+
+#: src/mandb.c:140
+#, c-format
+msgid "usage: %s [-dqsuc|-h|-V] [manpath]\n"
+msgstr "usage: %s [-dqsuc|-h|-V] [chemin_de_manuel]\n"
+
+#: src/mandb.c:142
+msgid ""
+"-d --debug produce debugging info.\n"
+"-q --quiet work quietly, except for 'bogus' warning.\n"
+"-s --no-straycats don't look for or add stray cats to the dbs.\n"
+"-u --user-db produce user databases only.\n"
+"-c --create create dbs from scratch, rather than updating.\n"
+"-V --version show version.\n"
+"-h --help show this usage message.\n"
+msgstr ""
+"-d --debug affiche des infos de déboguage.\n"
+"-q --quiet n'affiche rien à part les indications `périmé'.\n"
+"-s --no-straycats ne cherche ni n'ajoute de page sans source dans\n"
+" la base.\n"
+"-u --user-db produit des bases utilisateur seulement.\n"
+"-c --create crée une base de zéro plutôt qu'une mise à jour.\n"
+"-V --version affiche la version.\n"
+"-h --help affiche ce message-ci.\n"
+
+#: src/mandb.c:158 src/security.c:157
+#, c-format
+msgid "can't remove %s"
+msgstr "impossible de supprimer %s"
+
+#: src/mandb.c:260
+#, c-format
+msgid "Processing manual pages under %s...\n"
+msgstr "Traitement des pages du manuel sous %s...\n"
+
+#: src/mandb.c:388
+#, c-format
+msgid "the setuid man user \"%s\" does not exist"
+msgstr "l'utilisateur privilégié (setuid) \"%s\" n'existe pas"
+
+#: src/mandb.c:408
+#, c-format
+msgid "warning: no MANDB_MAP directives in %s, using your manpath"
+msgstr "attention: aucune directive MANDB_MAP dans %s, votre chemin perso est utilisé"
+
+#: src/mandb.c:449
+#, c-format
+msgid ""
+"%d man subdirectories contained newer manual pages.\n"
+"%d manual pages "
+msgstr ""
+"%d sous-répertoires de manuel contiennent de nouvelles pages.\n"
+"%d pages de manuel "
+
+#: src/mandb.c:454
+#, c-format
+msgid "and %d stray cats "
+msgstr "et %d pages sans source "
+
+#: src/mandb.c:455
+msgid "were added."
+msgstr "ont été ajouteés"
+
+#: src/manp.c:115
+#, c-format
+msgid "can't make sense of the manpath configuration file %s"
+msgstr "le fichier de configuration de chemin %s est bizare"
+
+#: src/manp.c:121
+#, c-format
+msgid "warning: %s"
+msgstr "attention: %s"
+
+#: src/manp.c:127
+#, c-format
+msgid "warning: %s isn't a directory"
+msgstr "attention: %s n'est pas un répertoire"
+
+#: src/manp.c:356
+msgid "warning: $PATH not set"
+msgstr "attention: la variable $PATH n'est pas positionnée"
+
+#: src/manp.c:367
+msgid "warning: empty $PATH"
+msgstr "attention: la variable $PATH est vide"
+
+#: src/manp.c:398
+#, c-format
+msgid "warning: $MANPATH set, prepending %s"
+msgstr "attention: la variable $MANPATH est positionnée, on la fait précéder de %s"
+
+#: src/manp.c:404
+#, c-format
+msgid "warning: $MANPATH set, appending %s"
+msgstr "attention: la variable $MANPATH est positionnée, on la fait suivre de %s"
+
+#: src/manp.c:411
+#, c-format
+msgid "warning: $MANPATH set, inserting '%s'"
+msgstr "attention: la variable $MANPATH est positionnée, on insére '%s'"
+
+#: src/manp.c:418
+#, c-format
+msgid "warning: $MANPATH set, ignoring %s"
+msgstr "attention: la variable $MANPATH est positionnée, on ignore '%s'"
+
+#: src/manp.c:445 src/manp.c:470
+#, c-format
+msgid "warning: cannot create catdir %s"
+msgstr "attention: impossible de créer le répertoire de pages préformattées %s"
+
+#: src/manp.c:504
+msgid "too many entries in config file"
+msgstr "trop d'entrées dans le fichier de configuration"
+
+#: src/manp.c:556
+#, c-format
+msgid "can't parse directory list `%s'"
+msgstr "impossible de parcourir la liste de répertoire `%s'"
+
+#: src/manp.c:570
+#, c-format
+msgid "can't open the manpath configuration file %s"
+msgstr "impossible d'ouvrir le fichier de configuration des chemins %s"
+
+#: src/manp.c:617
+#, c-format
+msgid "warning: mandatory directory %s doesn't exist"
+msgstr "attention: le répertoire requis %s n'existe pas"
+
+#: src/manp.c:824
+msgid "can't determine current directory"
+msgstr "impossible de déterminer quel est le répertoire courant"
+
+#: src/manp.c:837
+#, c-format
+msgid "warning: %s does not have a man tree component"
+msgstr "attention: %s n'a pas de composant d'arborescence pour le manuel"
+
+#: src/manp.c:967
+#, c-format
+msgid "warning: %s does not begin with %s"
+msgstr "attention: %s ne commence pas par %s"
+
+#: src/manpath.c:86
+#, c-format
+msgid "usage: %s [[-gcdq] [-m system]] | [-V] | [-h]\n"
+msgstr "usage: %s [[-gcdq] [-m système]] | [-V] | [-h]\n"
+
+#: src/manpath.c:88
+msgid ""
+"-c --catpath show relative catpaths.\n"
+"-g --global show the entire global manpath.\n"
+"-d --debug produce debugging info.\n"
+"-q --quiet produce fewer warnings.\n"
+"-m --systems system express which `systems' to use.\n"
+"-V --version show version.\n"
+"-h --help show this usage message.\n"
+msgstr ""
+"-c --catpath affiche les chemins relatifs au fichiers\n"
+" préformattés.\n"
+"-g --global affiche tous les chemins de manuel.\n"
+"-d --debug affiche des infos de déboguage.\n"
+"-q --quiet produit le moins de messages possible.\n"
+"-m --systems système indique quel `système' utiliser.\n"
+"-V --version affiche la version.\n"
+"-h --help affiche ce message-ci.\n"
+
+#: src/manpath.c:165
+#, c-format
+msgid "warning: no global manpaths set in config file %s"
+msgstr "attention: aucun chemin spécifié pour le manuel dans le fichier %s"
+
+#: src/security.c:66
+msgid "can't set effective uid"
+msgstr "impossible de positionner le propriétaire effectif"
+
+#: src/straycats.c:217 src/straycats.c:225 src/ult_src.c:146 src/ult_src.c:236
+#, c-format
+msgid "can't resolve %s"
+msgstr "impossible de résoudre %s"
+
+#: src/straycats.c:223 src/ult_src.c:144
+#, c-format
+msgid "warning: %s is a dangling symlink"
+msgstr "attention: %s est un lien symbolique flottant"
+
+#: src/straycats.c:274
+#, c-format
+msgid "Checking for stray cats under %s...\n"
+msgstr "Recherche des fichiers préformattés sans sources sous %s...\n"
+
+#: src/straycats.c:311
+#, c-format
+msgid "warning: can't update index cache %s"
+msgstr "attention: impossible de mettre à jour le cache d'index %s"
+
+#: src/ult_src.c:264
+#, c-format
+msgid "%s is self referencing"
+msgstr "%s s'auto-référence"
+
+#: src/version.c:28
+#, c-format
+msgid "%s, version %s, db %s, %s (G.Wilford@ee.surrey.ac.uk)\n"
+msgstr "%s, version %s, db %s, %s (G.Wilford@ee.surrey.ac.uk)\n"
+
+#: src/version.c:31
+#, c-format
+msgid "\tdebian version %s, (%s), %s\n"
+msgstr "\tversion debian %s, (%s), %s\n"
+
+#: src/whatis.c:127
+#, c-format
+msgid ""
+"usage: %s [-d] [-r|-w|-e] [-m systems] [-M manpath] | [-h] | [-V] keyword "
+"...\n"
+msgstr ""
+"usage: %s [-d] [-r|-w|-e] [-m système] [-M chemin] | [-h] | [-V] mot_clef "
+"...\n"
+
+#: src/whatis.c:129
+msgid ""
+"-d --debug\t\tproduce debugging info.\n"
+"-r --regex \t\tinterpret each keyword as a regex (default).\n"
+"-e --exact \t\tsearch each keyword for exact match.\n"
+"-w --wildcard\t\tthe keyword(s) contain wildcards.\n"
+"-m --systems system\tinclude alternate systems man pages.\n"
+"-M --manpath path\tset search path for manual pages to `path'.\n"
+"-V --version\t\tshow version.\n"
+"-h --help\t\tshow this usage message.\n"
+msgstr ""
+"-d --debug\t\taffiche des infos de deboguage.\n"
+"-r --regex \t\tconsidère les mots-clef comme des expressions\n"
+"\t\t\trégulières (par défaut).\n"
+"-e --exact \t\trecherche exactement les mots-clef.\n"
+"-w --wildcard\t\tles mots-clef contiennent des caractères joker.\n"
+"-m --systems system\tinclus des pages de manuel d'autres systèmes.\n"
+"-M --manpath chemin\tpositionne le chemin du manuel à `chemin'.\n"
+"-V --version\t\taffiche la version.\n"
+"-h --help\t\taffiche ce message-ci.\n"
+
+#: src/whatis.c:144
+#, c-format
+msgid ""
+"usage: %s [-d] [-r|-w] [-m systems] [-M manpath] | [-h] | [-V] keyword ...\n"
+msgstr ""
+"usage: %s [-d] [-r|-w] [-m systèmes] [-M chemin] | [-h] | [-V] mot_clef ...\n"
+
+#: src/whatis.c:146
+msgid ""
+"-d --debug\t\tproduce debugging info.\n"
+"-r --regex \t\tinterpret each keyword as a regex.\n"
+"-w --wildcard\t\tthe keyword(s) contain wildcards.\n"
+"-m --systems system\tinclude alternate systems man pages.\n"
+"-M --manpath path\tset search path for manual pages to `path'.\n"
+"-V --version\t\tshow version.\n"
+"-h --help\t\tshow this usage message.\n"
+msgstr ""
+"-d --debug\t\taffiche des infos de déboguage.\n"
+"-r --regex \t\tconsidère les mots-clef comme des expressions\n"
+"\t\t\trégulières (par défaut).\n"
+"-w --wildcard\t\tles mots-clef contiennent des caractères joker.\n"
+"-m --systems system\tinclus des pages de manuel d'autres systèmes.\n"
+"-M --manpath chemin\tpositionne le chemin du manuel à `chemin'.\n"
+"-V --version\t\taffiche la version.\n"
+"-h --help\t\taffiche ce message-ci.\n"
+
+#: src/whatis.c:186
+msgid "warning: can't read the fallback whatis text database."
+msgstr "attention: impossible de lire la base de secours de whatis"
+
+#: src/whatis.c:214 src/whatis.c:226
+msgid "(unknown)"
+msgstr "(inconnu)"
+
+#: src/whatis.c:485
+#, c-format
+msgid "%s: nothing appropriate.\n"
+msgstr "%s: rien d'adéquat\n"
+
+#: src/whatis.c:586
+#, c-format
+msgid "%s what?\n"
+msgstr "%s comment ?\n"
+
+#: src/whatis.c:609 src/whatis.c:619
+#, c-format
+msgid "fatal: regex `%s': %s"
+msgstr "fatal: expression régulière `%s': %s"
diff --git a/po/it.po b/po/it.po
new file mode 100644
index 00000000..d30b349a
--- /dev/null
+++ b/po/it.po
@@ -0,0 +1,723 @@
+# Italian Messages for man-db.
+# Copyright (C) 1999 Free Software Foundation, Inc.
+# Giovanni Bortolozzo <borto@dei.unipd.it>, 1999.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: man-db 2.3.10-69i\n"
+"POT-Creation-Date: 1999-08-20 13:12+02:00\n"
+"PO-Revision-Date: 1999-08-20 13:12+02:00\n"
+"Last-Translator: Giovanni Bortolozzo <borto@pluto.linux.it>\n"
+"Language-Team: Italian <it@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charsetISO-8859-1\n"
+"Content-Transfer-Encoding: 8 bits\n"
+
+#: libdb/db_delete.c:104
+#, c-format
+msgid "multi key %s does not exist"
+msgstr "non esiste la chiave multipla %s"
+
+#: libdb/db_lookup.c:66
+#, c-format
+msgid "can't lock index cache %s"
+msgstr "impossibile bloccare la cache index %s"
+
+#: libdb/db_lookup.c:75
+#, c-format
+msgid "index cache %s corrupt"
+msgstr "cache index %s corrotta"
+
+#: libdb/db_lookup.c:83
+#, c-format
+msgid "cannot replace key %s"
+msgstr "impossibile rimpiazzare la chiave %s"
+
+#: libdb/db_lookup.c:146
+#, c-format
+msgid "only %d fields in content"
+msgstr "trovati solo %d campi"
+
+#: libdb/db_lookup.c:305
+#, c-format
+msgid "bad fetch on multi key %s"
+msgstr "fetch errato sulla chiave multipla %s"
+
+#: libdb/db_store.c:54
+#, c-format
+msgid "cannot insert unused key %s"
+msgstr "impossibile inserire la chiave non usata %s"
+
+#: libdb/db_ver.c:63
+#, c-format
+msgid "fatal: unable to insert version identifier into %s"
+msgstr "fatale: impossibile inserire l'identificatore di versione dentro a %s"
+
+#: libdb/db_ver.c:74
+#, c-format
+msgid "warning: %s has no version identifier"
+msgstr "attenzione: %s non ha identificatore di versione"
+
+#: libdb/db_ver.c:78
+#, c-format
+msgid "warning: %s is version %s, expecting %s"
+msgstr "attenzione: %s ha versione %s, invece dell'attesa %s"
+
+#: src/catman.c:121
+#, c-format
+msgid "usage: %s [-dhV] [-M manpath] [section] ...\n"
+msgstr "uso: %s [-dhV] [-M percorso_man] [sezione] ...\n"
+
+#: src/catman.c:123
+msgid ""
+"-d --debug produce debugging info.\n"
+"-M --manpath path set search path for manual pages to `path'.\n"
+"-V --version show version.\n"
+"-h --help show this usage message.\n"
+msgstr ""
+"-d --debug produce informazioni utili al debug.\n"
+"-M --manpath percorso imposta a `percorso' il percorso di ricerca delle\n"
+" pagine di manuale.\n"
+"-V --version mostra la versione.\n"
+"-h --help mostra questo messaggio d'aiuto.\n"
+
+#: src/catman.c:136
+#, c-format
+msgid "cannot read database %s"
+msgstr "impossibile leggere la base di dati %s"
+
+#: src/catman.c:162
+msgid "fork failed"
+msgstr "fork fallito"
+
+#: src/catman.c:174
+msgid "can't get man command's exit status"
+msgstr "impossibile ottenere lo stato d'uscita del comando man"
+
+#: src/catman.c:176
+#, c-format
+msgid "man command failed with exit status %d"
+msgstr "comando man fallito con stato d'uscita %d"
+
+#: src/catman.c:228
+#, c-format
+msgid "unable to reset cursor position in %s"
+msgstr "impossibile inizializzare la posizione del cursore in %s"
+
+#: src/catman.c:282
+#, c-format
+msgid "NULL content for key: %s"
+msgstr "contenuto NULL per la chiave: %s"
+
+#: src/catman.c:297
+#, c-format
+msgid ""
+"\n"
+"Updating cat files for section %s of man hierarchy %s\n"
+msgstr ""
+"\n"
+"Aggiornamento dei file cat della sezione %s della gerarchia di manuali %s\n"
+
+#: src/catman.c:353
+#, c-format
+msgid "cannot write within %s"
+msgstr "impossibile scrivere all'interno di %s"
+
+#: src/catman.c:497
+#, c-format
+msgid "unable to update %s"
+msgstr "impossibile aggiornare %s"
+
+#: src/check_mandirs.c:73 src/straycats.c:111 src/straycats.c:137
+#, c-format
+msgid "warning: %s: ignoring bogus filename"
+msgstr "attenzione: %s: sto ignorando i nomi di file fasulli"
+
+#: src/check_mandirs.c:80
+#, c-format
+msgid "warning: %s/man%s/%s.%s*: competing extensions"
+msgstr "attenzione: %s/man%s/%s.%s*: estensioni in conflitto"
+
+#: src/check_mandirs.c:288
+#, c-format
+msgid "warning: %s: bad symlink or ROFF `.so' request"
+msgstr "attenzione: %s: link simbolico o richiesta ROFF `.so' errato(a)"
+
+#: src/check_mandirs.c:356
+#, c-format
+msgid "warning: %s: ignoring empty file"
+msgstr "attenzione: %s: sto ignorando un file vuoto"
+
+#: src/check_mandirs.c:361 src/straycats.c:232
+#, c-format
+msgid "warning: %s: whatis parse for %s(%s) failed"
+msgstr "attenzione: %s: analisi whatis per %s(%s) fallita"
+
+#: src/check_mandirs.c:388 src/check_mandirs.c:423 src/straycats.c:82
+#: src/straycats.c:257 src/ult_src.c:109
+#, c-format
+msgid "can't search directory %s"
+msgstr "impossibile ricercare nella directory %s"
+
+#: src/check_mandirs.c:446 src/check_mandirs.c:486 src/man.c:2107
+#, c-format
+msgid "can't update index cache %s"
+msgstr "impossibile aggiornare la cache index %s"
+
+#: src/check_mandirs.c:451
+#, c-format
+msgid "\rUpdating index cache for path `%s'. Wait..."
+msgstr "Aggiornamento della cache index per il percorso `%s'. Attendere..."
+
+#: src/check_mandirs.c:543
+#, c-format
+msgid "can't create index cache %s"
+msgstr "impossibile creare la cache index %s"
+
+#: src/check_mandirs.c:556 src/check_mandirs.c:588
+msgid "done.\n"
+msgstr "fatto.\n"
+
+#: src/compression.c:70 src/man.c:1173
+msgid "can't create a temporary filename"
+msgstr "impossibile creare un nome file temporaneo"
+
+#: src/convert_name.c:44
+#, c-format
+msgid "Can't convert %s to cat name"
+msgstr "Impossibile convertire %s nel nome cat"
+
+#: src/lexgrog.l:204
+#, c-format
+msgid "warning: whatis for %s exceeds %d bytes, truncating."
+msgstr "attenzione: whatis per %s eccede di %d byte, lo sto troncando."
+
+#: src/lexgrog.l:241 src/ult_src.c:298 src/ult_src.c:304
+#, c-format
+msgid "can't open %s"
+msgstr "impossibile aprire %s"
+
+#: src/man.c:315
+msgid "can't popen"
+msgstr "impossibile fare popen"
+
+#: src/man.c:322
+#, c-format
+msgid "command exited with status %d: %s"
+msgstr "comando terminato con stato d'uscita %d: %s"
+
+#: src/man.c:452
+#, c-format
+msgid ""
+"usage: %s [-c|-f|-k|-w|-tZT device] [-adlhu7V] [-Mpath] [-Ppager] [-Slist]\n"
+" [-msystem] [-pstring] [-Llocale] [-eextension] [section] page "
+"...\n"
+msgstr ""
+"uso: %s [-c|-f|-k|-w|-tZT dispositivo] [-adlhu7V] [-Mpercorso] [-Ppaginatore]\n"
+" [-Selenco] [-msistema] [-pstringa] [-Llocale] [-eestensione]\n"
+" [sezione] pagina ...\n"
+
+#: src/man.c:457
+#, c-format
+msgid ""
+"usage: %s [-c|-f|-k|-w] [-adlhu7V] [-Mpath] [-Ppager] [-Slist] [-msystem]\n"
+" [-pstring] [-Llocale] [-eextension] [section] page ...\n"
+msgstr ""
+"uso: %s [-c|-f|-k|-w] [-adlhu7V] [-Mpercorso] [-Ppaginatore] [-Selenco]\n"
+" [-msistema] [-pstringa] [-Llocale] [-eestensione] [sezione] pagina "
+"...\n"
+
+#: src/man.c:463
+msgid ""
+"-a, --all find all matching manual pages.\n"
+"-d, --debug emit debugging messages.\n"
+"-e, --extension limit search to extension type `extension'.\n"
+"-f, --whatis equivalent to whatis.\n"
+"-k, --apropos equivalent to apropos.\n"
+"-w, --where, --location print physical location of man page(s).\n"
+"-l, --local-file interpret `page' argument(s) as local "
+"filename(s).\n"
+"-u, --update force a cache consistency check.\n"
+"-r, --prompt string provide the `less' pager with a prompt\n"
+"-c, --catman used by catman to reformat out of date cat "
+"pages.\n"
+"-7, --ascii display ASCII translation of certain latin1 "
+"chars."
+msgstr ""
+"-a, --all trova tutte le pagine di manuale "
+"corrispondenti.\n"
+"-d, --debug mostra messaggi utili al debug.\n"
+"-e, --extension limita la ricerca a estensioni di tipo "
+"`estensione'.\n"
+"-f, --whatis equivalente a whatis.\n"
+"-k, --apropos equivalente ad apropos.\n"
+"-w, --where, --location mostra la posizione fisica della(e) pagina(e)\n"
+" di manuale.\n"
+"-l, --local-file interpreta l'argomento(i) `pagina' come un "
+"nome(i)\n"
+" di file locale.\n"
+"-u, --update forza una verifica della consistenza della "
+"cache.\n"
+"-r, --prompt stringa fornisce il paginatore `less' con un prompt.\n"
+"-c, --catman usata da catman per riformattare pagine cat\n"
+" obsolete.\n"
+"-7, --ascii mostra l'equivalente ASCII di alcuni caratteri\n"
+" latin1."
+
+#: src/man.c:476
+#, c-format
+msgid ""
+"-t, --troff use %s to format pages.\n"
+"-T, --troff-device device use %s with selected device.\n"
+msgstr ""
+"-t, --troff usa %s per formattare le pagine.\n"
+"-T, --troff-device dispositivo usa %s con il dispositivo specificato.\n"
+
+#: src/man.c:481
+msgid "-Z, --ditroff use groff and force it to produce ditroff."
+msgstr "-Z, --ditroff usa groff e lo forza a produrre ditroff."
+
+#: src/man.c:486
+msgid ""
+"-D, --default reset all options to their default values.\n"
+"-M, --manpath path set search path for manual pages to `path'.\n"
+"-P, --pager pager use program `pager' to display output.\n"
+"-S, --sections list use colon separated section list.\n"
+"-m, --systems system search for man pages from other unix system(s).\n"
+"-L, --locale locale define the locale for this particular man "
+"search.\n"
+"-p, --preprocessor string string indicates which preprocessors to run."
+msgstr ""
+"-D, --default assegna a tutte le opzioni i loro valori\n"
+" di default.\n"
+"-M, --manpath percorso imposta a `percorso' il percorso di ricerca delle\n"
+" pagine di manuale.\n"
+"-P, --pager paginatore usa il programma `paginatore' per mostrare\n"
+" l'output.\n"
+"-S, --sections lista usa la lista di sezioni separate da `:'.\n"
+"-m, --systems sistema ricerca le pagine di manuale di un'altro(i)\n"
+" sistema(i) unix.\n"
+"-L, --locale locale definisce il locale per questa particolare ricerca\n"
+" di manuali.\n"
+"-p, --preprocessor stringa stringa indica quale preprocessore lanciare."
+
+#: src/man.c:496
+msgid ""
+"-V, --version show version.\n"
+"-h, --help show this usage message."
+msgstr ""
+"-V, --version mostra la versione.\n"
+"-h, --help mostra questo messaggio d'aiuto."
+
+#: src/man.c:509
+#, c-format
+msgid "What manual page do you want from section %s?\n"
+msgstr "Quale pagina di manuale vuoi della sezione %s?\n"
+
+#: src/man.c:511
+msgid "What manual page do you want?\n"
+msgstr "Quale pagina di manuale vuoi?\n"
+
+#: src/man.c:541
+#, c-format
+msgid "No source manual entry for %s"
+msgstr "Non c'è il sorgente del manuale per %s"
+
+#: src/man.c:550
+#, c-format
+msgid "No manual entry for %s"
+msgstr "Non c'è il manuale per %s"
+
+#: src/man.c:555
+#, c-format
+msgid " in section %s\n"
+msgstr " nella sezione %s\n"
+
+#: src/man.c:833
+msgid ""
+" Manual page $MAN_PN ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\\\\%.."
+msgstr ""
+"Pagina di manuale $MAN_PN ?ltriga %lt?L/%L.:byte %bB?s/%s..?e (FINE):?pB "
+"%pB\\\\%.."
+
+#: src/man.c:1062
+msgid ": incompatible options"
+msgstr ": opzioni incompatibili"
+
+#: src/man.c:1218
+msgid "error trying to read from stdin"
+msgstr "errore nel tentativo di lettura da stdin"
+
+#: src/man.c:1230
+#, c-format
+msgid "error writing to temporary file %s"
+msgstr "errore nella scrittura nel file temporaneo %s"
+
+#. didn't fail on roff
+#: src/man.c:1367
+#, c-format
+msgid "ignoring unknown preprocessor `%c'"
+msgstr "preprocessore `%c' sconosciuto, lo ignoro"
+
+#: src/man.c:1428 src/man.c:1476 src/mandb.c:203
+#, c-format
+msgid "can't chown %s"
+msgstr "impossibile fare chown su %s"
+
+#: src/man.c:1461 src/mandb.c:174
+#, c-format
+msgid "can't chmod %s"
+msgstr "impossibile fare chmod su %s"
+
+#: src/man.c:1488 src/mandb.c:165
+#, c-format
+msgid "can't rename %s to %s"
+msgstr "impossibile rinominare %s in %s"
+
+#: src/man.c:1497
+#, c-format
+msgid "can't unlink %s"
+msgstr "impossibile fare unlink di %s"
+
+#: src/man.c:1524
+msgid "can't create pipe"
+msgstr "impossibile creare la pipe"
+
+#: src/man.c:1532 src/security.c:208
+msgid "can't fork"
+msgstr "impossibile fare fork"
+
+#: src/man.c:1549 src/man.c:1559
+msgid "can't dup2"
+msgstr "impossibile fare dup2"
+
+#: src/man.c:1556
+#, c-format
+msgid "can't create %s"
+msgstr "impossibile creare %s"
+
+#: src/man.c:1578
+#, c-format
+msgid "can't exec %s"
+msgstr "impossibile eseguire %s"
+
+#: src/man.c:1615
+#, c-format
+msgid "waiting for pid %u"
+msgstr "sto aspettando il pid %u"
+
+#: src/man.c:1665
+msgid "Still saving the page, please wait...\n"
+msgstr "Sto ancora salvando la pagina, attendere prego...\n"
+
+#: src/man.c:1708
+#, c-format
+msgid "can't chdir to %s"
+msgstr "impossibile fare chdir a %s"
+
+#: src/man.c:1825
+#, c-format
+msgid ""
+"\n"
+"cannot write to %s in catman mode"
+msgstr "\nimpossibile scrivere in %s in modo catman"
+
+#: src/man.c:1865
+#, c-format
+msgid "Reformatting %s, please wait...\n"
+msgstr "Sto riformattando %s, attendere prego...\n"
+
+#: src/man.c:2460
+#, c-format
+msgid "--Man-- next: %s [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]\n"
+msgstr ""
+"--Man-- successivo: %s [ mostra (return) | salta (Ctrl-D) | esci (Ctrl-C) ]\n"
+
+#: src/mandb.c:140
+#, c-format
+msgid "usage: %s [-dqsuc|-h|-V] [manpath]\n"
+msgstr "uso: %s [-dqsuc|-h|-V] [percorso_man]\n"
+
+#: src/mandb.c:142
+msgid ""
+"-d --debug produce debugging info.\n"
+"-q --quiet work quietly, except for 'bogus' warning.\n"
+"-s --no-straycats don't look for or add stray cats to the dbs.\n"
+"-u --user-db produce user databases only.\n"
+"-c --create create dbs from scratch, rather than updating.\n"
+"-V --version show version.\n"
+"-h --help show this usage message.\n"
+msgstr ""
+"-d --debug produce informazioni per il debug.\n"
+"-q --quiet lavora silenziosamente.\n"
+"-s --no-straycats non cerca o non aggiunge gli stray cat\n"
+" nelle(alle) basi di dati.\n"
+"-u --user-db genera solo basi di dati utente.\n"
+"-c --create ricrea le basi di dati, invece che aggiornarle.\n"
+"-V --version mostra la versione.\n"
+"-h --help mostra questo messaggio d'aiuto.\n"
+
+#: src/mandb.c:158 src/security.c:157
+#, c-format
+msgid "can't remove %s"
+msgstr "impossibile rimuovere %s"
+
+#: src/mandb.c:260
+#, c-format
+msgid "Processing manual pages under %s...\n"
+msgstr "Sto processando le pagine di manuale sotto a %s...\n"
+
+#: src/mandb.c:388
+#, c-format
+msgid "the setuid man user \"%s\" does not exist"
+msgstr "non esiste l'utente man con setuid \"%s\""
+
+#: src/mandb.c:408
+#, c-format
+msgid "warning: no MANDB_MAP directives in %s, using your manpath"
+msgstr ""
+"attenzione: nessuna direttiva MANDB_MAP in %s, sto usando il tuo percorso_man"
+
+#: src/mandb.c:449
+#, c-format
+msgid ""
+"%d man subdirectories contained newer manual pages.\n"
+"%d manual pages "
+msgstr ""
+"%d sottodirectory man contenevano nuove pagine di manuale.\n"
+"Sono state aggiunte %d pagine di manuale"
+
+#: src/mandb.c:454
+#, c-format
+msgid "and %d stray cats "
+msgstr " e %d stray cat"
+
+#: src/mandb.c:455
+msgid "were added."
+msgstr "."
+
+#: src/manp.c:115
+#, c-format
+msgid "can't make sense of the manpath configuration file %s"
+msgstr "il file di configurazione dei percorsi man %s non ha senso"
+
+#: src/manp.c:121
+#, c-format
+msgid "warning: %s"
+msgstr "attenzione: %s"
+
+#: src/manp.c:127
+#, c-format
+msgid "warning: %s isn't a directory"
+msgstr "attenzione: %s non è una directory"
+
+#: src/manp.c:343
+msgid "warning: $PATH not set"
+msgstr "attenzione: $PATH non impostata"
+
+#: src/manp.c:354
+msgid "warning: empty $PATH"
+msgstr "attenzione: $PATH vuota"
+
+#: src/manp.c:385
+#, c-format
+msgid "warning: $MANPATH set, prepending %s"
+msgstr "attenzione: $MANPATH già impostata, aggiungo in testa %s"
+
+#: src/manp.c:391
+#, c-format
+msgid "warning: $MANPATH set, appending %s"
+msgstr "attenzione: $MANPATH già impostata, aggiungo in coda %s"
+
+#: src/manp.c:398
+#, c-format
+msgid "warning: $MANPATH set, inserting '%s'"
+msgstr "attenzione: $MANPATH già impostata, inserisco '%s'"
+
+#: src/manp.c:405
+#, c-format
+msgid "warning: $MANPATH set, ignoring %s"
+msgstr "attenzione: $MANPATH già impostata, sto ignoro %s"
+
+#: src/manp.c:432 src/manp.c:457
+#, c-format
+msgid "warning: cannot create catdir %s"
+msgstr "attenzione: impossibile creare la directory %s"
+
+#: src/manp.c:534
+#, c-format
+msgid "can't parse directory list `%s'"
+msgstr "impossibile analizzare la lista di directory `%s'"
+
+#: src/manp.c:548
+#, c-format
+msgid "can't open the manpath configuration file %s"
+msgstr "impossibile aprire il file di configurazione dei percorsi man %s"
+
+#: src/manp.c:595
+#, c-format
+msgid "warning: mandatory directory %s doesn't exist"
+msgstr "attenzione: la directory essenziale %s non esiste"
+
+#: src/manp.c:802
+msgid "can't determine current directory"
+msgstr "impossibile determinare la directory corrente"
+
+#: src/manp.c:815
+#, c-format
+msgid "warning: %s does not have a man tree component"
+msgstr "attenzione: %s non ha un componente man nell'albero"
+
+#: src/manp.c:945
+#, c-format
+msgid "warning: %s does not begin with %s"
+msgstr "attenzione: %s non inizia con %s"
+
+#: src/manpath.c:86
+#, c-format
+msgid "usage: %s [[-gcdq] [-m system]] | [-V] | [-h]\n"
+msgstr "uso: %s [[-gcdq] [-m sistema]] | [-V] | [-h]\n"
+
+#: src/manpath.c:88
+msgid ""
+"-c --catpath show relative catpaths.\n"
+"-g --global show the entire global manpath.\n"
+"-d --debug produce debugging info.\n"
+"-q --quiet produce fewer warnings.\n"
+"-m --systems system express which `systems' to use.\n"
+"-V --version show version.\n"
+"-h --help show this usage message.\n"
+msgstr ""
+"-c --catpath mostra i percorsi cat relativi.\n"
+"-g --global mostra tutti i percorsi man globali.\n"
+"-d --debug produce informazioni per il debug.\n"
+"-q --quiet produce meno avvertimenti.\n"
+"-m --systems sistema indica quale `sistema' usare.\n"
+"-V --version mostra la versione.\n"
+"-h --help mostra questo messaggio d'aiuto ed esce.\n"
+
+#: src/manpath.c:165
+#, c-format
+msgid "warning: no global manpaths set in config file %s"
+msgstr "attenzione: nessun percorso man globale impostato nel file di configurazione %s"
+
+#: src/security.c:66
+msgid "can't set effective uid"
+msgstr "impossibile impostare lo uid effettivo"
+
+#: src/straycats.c:216 src/ult_src.c:144
+#, c-format
+msgid "warning: %s is a dangling symlink"
+msgstr "attenzione: %s è un link simbolico spezzato"
+
+#: src/straycats.c:218 src/ult_src.c:146 src/ult_src.c:236
+#, c-format
+msgid "can't resolve %s"
+msgstr "impossibile risolvere %s"
+
+#: src/straycats.c:262
+#, c-format
+msgid "Checking for stray cats under %s...\n"
+msgstr "Sto cercando gli stray cat sotto a %s...\n"
+
+#: src/straycats.c:299
+#, c-format
+msgid "warning: can't update index cache %s"
+msgstr "attenzione: impossibile aggiornare la cache index %s"
+
+#: src/ult_src.c:264
+#, c-format
+msgid "%s is self referencing"
+msgstr "%s è auto referenziante"
+
+#: src/version.c:28
+#, c-format
+msgid "%s, version %s, db %s, %s (G.Wilford@ee.surrey.ac.uk)\n"
+msgstr "%s, versione %s, db %s, %s (G.Wilford@ee.surrey.ac.uk)\n"
+
+#: src/version.c:31
+#, c-format
+msgid "\tdebian version %s, (%s), %s\n"
+msgstr "\tversione Debian %s, (%s), %s\n"
+
+#: src/whatis.c:127
+#, c-format
+msgid ""
+"usage: %s [-d] [-r|-w|-e] [-m systems] [-M manpath] | [-h] | [-V] keyword "
+"...\n"
+msgstr ""
+"uso: %s [-d] [-r|-w] [-m sistema] [-M percorso_man] |\n"
+" [-h] | [-V] parola_chiave ...\n"
+
+#: src/whatis.c:129
+msgid ""
+"-d --debug\t\tproduce debugging info.\n"
+"-r --regex \t\tinterpret each keyword as a regex (default).\n"
+"-e --exact \t\tsearch each keyword for exact match.\n"
+"-w --wildcard\t\tthe keyword(s) contain wildcards.\n"
+"-m --systems system\tinclude alternate systems man pages.\n"
+"-M --manpath path\tset search path for manual pages to `path'.\n"
+"-V --version\t\tshow version.\n"
+"-h --help\t\tshow this usage message.\n"
+msgstr ""
+"-d --debug produce informazioni per il debug.\n"
+"-r --regex interpreta ogni parola chiave come un'espressione\n"
+" regolare (default).\n"
+"-e --exact cerca la corrispondenza esatta di ogni parola chiave.\n"
+"-w --wildcard le parole chiave contengono caratteri jolly.\n"
+"-m --systems sistema include le pagine di manuale di `sistema'.\n"
+"-M --manpath percorso imposta il percorso di ricerca delle pagine di manuale\n"
+" a `percorso'.\n"
+"-V --version mostra la versione.\n"
+"-h --help mostra questo messaggio d'aiuto.\n"
+
+#: src/whatis.c:144
+#, c-format
+msgid ""
+"usage: %s [-d] [-r|-w] [-m systems] [-M manpath] | [-h] | [-V] keyword ...\n"
+msgstr ""
+"uso: %s [-d] [-r|-w] [-m sistema] [-M percorso_man] |\n"
+" [-h] | [-V] parola_chiave ...\n"
+
+#: src/whatis.c:146
+msgid ""
+"-d --debug\t\tproduce debugging info.\n"
+"-r --regex \t\tinterpret each keyword as a regex.\n"
+"-w --wildcard\t\tthe keyword(s) contain wildcards.\n"
+"-m --systems system\tinclude alternate systems man pages.\n"
+"-M --manpath path\tset search path for manual pages to `path'.\n"
+"-V --version\t\tshow version.\n"
+"-h --help\t\tshow this usage message.\n"
+msgstr ""
+"-d --debug produce informazioni per il debug.\n"
+"-r --regex interpreta ogni parola chiave come un'espressione\n"
+" regolare.\n"
+"-w --wildcard le parole chiave contengono caratteri jolly.\n"
+"-m --systems sistema include le pagine di manuale di `sistema'.\n"
+"-M --manpath percorso imposta il percorso di ricerca delle pagine di manuale\n"
+" a `percorso'.\n"
+"-V --version mostra la versione.\n"
+"-h --help mostra questo messaggio d'aiuto.\n"
+
+#: src/whatis.c:186
+msgid "warning: can't read the fallback whatis text database."
+msgstr "attenzione: impossibile leggere la base di dati testuale whatis di ripiego."
+
+#: src/whatis.c:214 src/whatis.c:226
+msgid "(unknown)"
+msgstr "(sconosciuto)"
+
+#: src/whatis.c:485
+#, c-format
+msgid "%s: nothing appropriate.\n"
+msgstr "%s: niente di appropriato.\n"
+
+#: src/whatis.c:586
+#, c-format
+msgid "%s what?\n"
+msgstr "%s cosa?\n"
+
+#: src/whatis.c:609 src/whatis.c:619
+#, c-format
+msgid "fatal: regex `%s': %s"
+msgstr "fatal: regex `%s': %s"
diff --git a/po/ja.po b/po/ja.po
new file mode 100644
index 00000000..72f915bd
--- /dev/null
+++ b/po/ja.po
@@ -0,0 +1,641 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: 2.3.10\n"
+"POT-Creation-Date: 1998-06-09 14:14+0900\n"
+"PO-Revision-Date: 1998-12-13 17:02+09:00\n"
+"Last-Translator: Hidenobu NABETANI <nabetani@kern.phys.sci.osaka-u.ac.jp>\n"
+"Language-Team: debian-doc <debian-doc@debian.or.jp>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=euc-jp\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: libdb/db_delete.c:104
+#, c-format
+msgid "multi key %s does not exist"
+msgstr "Ê£¹ç¥­¡¼ %s ¤Ï¸ºß¤·¤Þ¤»¤ó"
+
+#: libdb/db_lookup.c:66
+#, c-format
+msgid "can't lock index cache %s"
+msgstr "index ¥­¥ã¥Ã¥·¥å %s ¤ò¥í¥Ã¥¯¤Ç¤­¤Þ¤»¤ó"
+
+#: libdb/db_lookup.c:75
+#, c-format
+msgid "index cache %s corrupt"
+msgstr "index ¥­¥ã¥Ã¥·¥å %s ¤¬²õ¤ì¤Æ¤¤¤Þ¤¹"
+
+#: libdb/db_lookup.c:83
+#, c-format
+msgid "cannot replace key %s"
+msgstr "¥­¡¼ %s ¤òÃÖ¤­´¹¤¨¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó"
+
+#: libdb/db_lookup.c:146
+#, c-format
+msgid "only %d fields in content"
+msgstr "Ãæ¿È¤¬ %d ¥Õ¥£¡¼¥ë¥É¤·¤«¤¢¤ê¤Þ¤»¤ó"
+
+#: libdb/db_lookup.c:305
+#, c-format
+msgid "bad fetch on multi key %s"
+msgstr "Ê£¹ç¥­¡¼ %s ¤ÏÉÔÀµ¤Ê¸Æ¤Ó½Ð¤·¤Ç¤¹"
+
+#: libdb/db_store.c:54
+#, c-format
+msgid "cannot insert unused key %s"
+msgstr "̤»ÈÍÑ¥­¡¼ %s ¤òÁÞÆþ¤Ç¤­¤Þ¤»¤ó"
+
+#: libdb/db_ver.c:63
+#, c-format
+msgid "fatal: unable to insert version identifier into %s"
+msgstr "Ã×̿Ū¥¨¥é¡¼: ¥Ð¡¼¥¸¥ç¥ó¼±Ê̻ҾðÊó %s ¤ò½ñ¤­¹þ¤á¤Þ¤»¤ó"
+
+#: libdb/db_ver.c:74
+#, c-format
+msgid "warning: %s has no version identifier"
+msgstr "·Ù¹ð: %s ¤Ë¥Ð¡¼¥¸¥ç¥ó¼±Ê̻Ҥ¬¤¢¤ê¤Þ¤»¤ó"
+
+#: libdb/db_ver.c:78
+#, c-format
+msgid "warning: %s is version %s, expecting %s"
+msgstr "·Ù¹ð: %1$s ¤Î¥Ð¡¼¥¸¥ç¥ó¤Ï¡¢%3$s ¤Ç¤¢¤ë¤Ï¤º¤¬ %2$s ¤Ç¤¹"
+
+#: src/catman.c:121
+#, c-format
+msgid "usage: %s [-dhV] [-M manpath] [section] ...\n"
+msgstr "»ÈÍÑË¡: %s [-dhV] [-M manpath] [section] ...\n"
+
+#: src/catman.c:123
+msgid ""
+"-d --debug produce debugging info.\n"
+"-M --manpath path set search path for manual pages to `path'.\n"
+"-V --version show version.\n"
+"-h --help show this usage message.\n"
+msgstr ""
+"-d --debug ¥Ç¥Ð¥Ã¥°¾ðÊó¤òÀ¸À®¤¹¤ë\n"
+"-M --manpath path ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¸¡º÷¥Ñ¥¹¤ò`path'¤ËÀßÄꤹ¤ë\n"
+"-V --version ¥Ð¡¼¥¸¥ç¥ó¤òɽ¼¨¤¹¤ë\n"
+"-h --help ¤³¤Î¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë\n"
+
+#: src/catman.c:136
+#, c-format
+msgid "cannot read database %s"
+msgstr "¥Ç¡¼¥¿¥Ù¡¼¥¹ %s ¤òÆɤ߹þ¤á¤Þ¤»¤ó"
+
+#: src/catman.c:162
+msgid "fork failed"
+msgstr "fork ¤Ë¼ºÇÔ¤·¤Þ¤·¤¿"
+
+#: src/catman.c:174
+msgid "can't get man command's exit status"
+msgstr "man ¥³¥Þ¥ó¥É¤Î½ªÎ»¥¹¥Æ¡¼¥¿¥¹¤ò¼èÆÀ¤Ç¤­¤Þ¤»¤ó"
+
+#: src/catman.c:176
+#, c-format
+msgid "man command failed with exit status %d"
+msgstr "man ¥³¥Þ¥ó¥É¤¬½ªÎ»¥¹¥Æ¡¼¥¿¥¹ %d ¤Ç¼ºÇÔ¤·¤Þ¤·¤¿"
+
+#: src/catman.c:228
+#, c-format
+msgid "unable to reset cursor position in %s"
+msgstr "%s ¤Ç¥«¡¼¥½¥ë°ÌÃÖ¤ò¥ê¥»¥Ã¥È¤Ç¤­¤Þ¤»¤ó"
+
+#: src/catman.c:282
+#, c-format
+msgid "NULL content for key: %s"
+msgstr "¥­¡¼ %s ¤ÎÆâÍÆ¤Ï NULL ¤Ç¤¹"
+
+#: src/catman.c:297
+#, c-format
+msgid ""
+"\n"
+"Updating cat files for section %s of man hierarchy %s\n"
+msgstr "\nman ³¬ÁØ %2$s ¤Î¥»¥¯¥·¥ç¥ó %1$s ¤Î cat ¥Õ¥¡¥¤¥ë¤ò¹¹¿·¤·¤Æ¤¤¤Þ¤¹\n"
+
+#: src/catman.c:353
+#, c-format
+msgid "cannot write within %s"
+msgstr "%s ¤Ë½ñ¤­¹þ¤á¤Þ¤»¤ó"
+
+#: src/catman.c:497
+#, c-format
+msgid "unable to update %s"
+msgstr "%s ¤ò¹¹¿·¤Ç¤­¤Þ¤»¤ó"
+
+#: src/check_mandirs.c:73 src/straycats.c:111 src/straycats.c:137
+#, c-format
+msgid "warning: %s: ignoring bogus filename"
+msgstr "·Ù¹ð: %s : ¥»¥¯¥·¥ç¥ó¤¬°ã¤¦¥Õ¥¡¥¤¥ë̾¤ò̵»ë¤·¤Æ¤¤¤Þ¤¹"
+
+#: src/check_mandirs.c:80
+#, c-format
+msgid "warning: %s/man%s/%s.%s*: competing extensions"
+msgstr "·Ù¹ð: %s/man%s/%s.%s*: ³ÈÄ¥»Ò¤¬¶¥¹ç¤·¤Æ¤¤¤Þ¤¹"
+
+#: src/check_mandirs.c:288
+#, c-format
+msgid "warning: %s: bad symlink or ROFF `.so' request"
+msgstr "·Ù¹ð: %s : ¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬ÉÔÀµ¤Ç¤¢¤ë¤«¡¢ROFF `.so' Í׵᤬ÉÔÀµ¤Ç¤¹"
+
+#: src/check_mandirs.c:356
+#, c-format
+msgid "warning: %s: ignoring empty file"
+msgstr "·Ù¹ð: %s : ¶õ¥Õ¥¡¥¤¥ë¤ò̵»ë¤·¤Æ¤¤¤Þ¤¹"
+
+#: src/check_mandirs.c:361 src/straycats.c:232
+#, c-format
+msgid "warning: %s: whatis parse for %s(%s) failed"
+msgstr "·Ù¹ð: %s : whatis ¤¬ %s(%s) ¤Î²òÀϤ˼ºÇÔ¤·¤Þ¤·¤¿"
+
+#: src/check_mandirs.c:388 src/check_mandirs.c:423 src/straycats.c:82
+#: src/straycats.c:257 src/ult_src.c:109
+#, c-format
+msgid "can't search directory %s"
+msgstr "¥Ç¥£¥ì¥¯¥È¥ê %s ¤ò¸¡º÷¤Ç¤­¤Þ¤»¤ó"
+
+#: src/check_mandirs.c:446 src/check_mandirs.c:486 src/man.c:2004
+#, c-format
+msgid "can't update index cache %s"
+msgstr "¥Ç¥£¥ì¥¯¥È¥ê %s ¤ò¹¹¿·¤Ç¤­¤Þ¤»¤ó"
+
+#: src/check_mandirs.c:451
+#, c-format
+msgid "\rUpdating index cache for path `%s'. Wait..."
+msgstr "\r¥Ñ¥¹`%s'¤Î index ¥­¥ã¥Ã¥·¥å¤ò¹¹¿·¤·¤Æ¤¤¤Þ¤¹¡£¤ªÂÔ¤Á¤¯¤À¤µ¤¤..."
+
+#: src/check_mandirs.c:543
+#, c-format
+msgid "can't create index cache %s"
+msgstr "index ¥­¥ã¥Ã¥·¥å %s ¤òºîÀ®¤Ç¤­¤Þ¤»¤ó"
+
+#: src/check_mandirs.c:556 src/check_mandirs.c:588
+msgid "done.\n"
+msgstr "´°Î»¤·¤Þ¤·¤¿\n"
+
+#: src/compression.c:68
+msgid "can't create a temporary filename"
+msgstr "°ì»þŪ¤Ê¥Õ¥¡¥¤¥ë̾¤òºîÀ®¤Ç¤­¤Þ¤»¤ó"
+
+#: src/convert_name.c:44
+#, c-format
+msgid "Can't convert %s to cat name"
+msgstr "%s ¤ò cat ̾¤ËÊÑ´¹¤Ç¤­¤Þ¤»¤ó"
+
+#: src/lexgrog.l:204
+#, c-format
+msgid "warning: whatis for %s exceeds %d bytes, truncating."
+msgstr "·Ù¹ð: %s ¤Î whatis ¤¬ %d ¥Ð¥¤¥È¤òĶ¤¨¤Æ¤¤¤Þ¤¹¡£ÀÚ¤êµÍ¤á¤Æ¤¤¤Þ¤¹¡£"
+
+#: src/lexgrog.l:241 src/ult_src.c:296 src/ult_src.c:302
+#, c-format
+msgid "can't open %s"
+msgstr "%s ¤ò¥ª¡¼¥×¥ó¤Ç¤­¤Þ¤»¤ó"
+
+#: src/man.c:313
+msgid "can't popen"
+msgstr "¥ª¡¼¥×¥ó(popen)¤Ç¤­¤Þ¤»¤ó"
+
+#: src/man.c:320
+#, c-format
+msgid "command exited with status %d: %s"
+msgstr "¥³¥Þ¥ó¥É¤Ï¥¹¥Æ¡¼¥¿¥¹ %d ¤Ç½ªÎ»¤·¤Þ¤·¤¿: %s"
+
+#: src/man.c:450
+#, c-format
+msgid ""
+"usage: %s [-c|-f|-k|-w|-tZT device] [-adlhu7V] [-Mpath] [-Ppager] [-Slist]\n"
+" [-msystem] [-pstring] [-Llocale] [-eextension] [section] page "
+"...\n"
+msgstr ""
+"»ÈÍÑË¡: %s [-c|-f|-k|-w|-tZT device] [-adlhu7V] [-Mpath] [-Ppager] [-Slist]\n"
+" [-msystem] [-pstring] [-Llocale] [-eextension] [section] page ...\n"
+
+#: src/man.c:455
+#, c-format
+msgid ""
+"usage: %s [-c|-f|-k|-w] [-adlhu7V] [-Mpath] [-Ppager] [-Slist] [-msystem]\n"
+" [-pstring] [-Llocale] [-eextension] [section] page ...\n"
+msgstr ""
+"»ÈÍÑË¡: %s [-c|-f|-k|-w] [-adlhu7V] [-Mpath] [-Ppager] [-Slist] [-msystem]\n"
+" [-pstring] [-Llocale] [-eextension] [section] page ...\n"
+
+#: src/man.c:461
+msgid ""
+"-a, --all find all matching manual pages.\n"
+"-d, --debug emit debugging messages.\n"
+"-e, --extension limit search to extension type `extension'.\n"
+"-f, --whatis equivalent to whatis.\n"
+"-k, --apropos equivalent to apropos.\n"
+"-w, --where, --location print physical location of man page(s).\n"
+"-l, --local-file interpret `page' argument(s) as local "
+"filename(s).\n"
+"-u, --update force a cache consistency check.\n"
+"-r, --prompt string provide the `less' pager with a prompt\n"
+"-c, --catman used by catman to reformat out of date cat "
+"pages.\n"
+"-7, --ascii display ASCII translation of certain latin1 "
+"chars."
+msgstr ""
+"-a, --all ¥Þ¥Ã¥Á¤¹¤ë¤¹¤Ù¤Æ¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò¸¡º÷¤¹¤ë¡£\n"
+"-d, --debug ¥Ç¥Ð¥Ã¥°¾ðÊó¤ò½ÐÎϤ¹¤ë¡£\n"
+"-e, --extension ³ÈÄ¥»Ò·¿`extension'¤Ë¸¡º÷¤ò¸ÂÄꤹ¤ë¡£\n"
+"-f, --whatis ¥³¥Þ¥ó¥É whatis ¤ÈƱ¤¸¡£\n"
+"-k, --apropos ¥³¥Þ¥ó¥É apropos ¤ÈƱ¤¸¡£\n"
+"-w, --where, --location ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¼ÂºÝ¤Î¾ì½ê¤ò½ÐÎÏ¡£\n"
+"-l, --local-file °ú¿ô`page'¤ò¥í¡¼¥«¥ë¥Õ¥¡¥¤¥ë̾¤È¤·¤Æ°·¤¦¡£\n"
+"-u, --update ¶¯À©Åª¤Ë¥­¥ã¥Ã¥·¥å¤ÎÀ°¹çÀ­¤ò¥Á¥§¥Ã¥¯¤¹¤ë¡£\n"
+"-r, --prompt string `less'¥Ú¡¼¥¸¥ã¤Î¥×¥í¥ó¥×¥È¤ò»ØÄꤹ¤ë¡£\n"
+"-c, --catman ¸Å¤¤ cat ¥Ú¡¼¥¸¤òºÆ¥Õ¥©¡¼¥Þ¥Ã¥È(catman ¤¬»ÈÍÑ)¡£\n"
+"-7, --ascii latin1 ʸ»ú¤ò ASCII ÊÑ´¹¤·¤Æɽ¼¨¡£"
+
+#: src/man.c:474
+#, c-format
+msgid ""
+"-t, --troff use %s to format pages.\n"
+"-T, --troff-device device use %s with selected device.\n"
+msgstr ""
+"-t, --troff ¥Ú¡¼¥¸¤ÎÀ°·Á¤Ë %s ¤ò»ÈÍѤ¹¤ë\n"
+"-T, --troff-device device ÁªÂò¤·¤¿ device ¤Ç %s ¤ò»ÈÍѤ¹¤ë\n"
+
+#: src/man.c:479
+msgid "-Z, --ditroff use groff and force it to produce ditroff."
+msgstr "-Z, --ditroff groff ¤ò»ÈÍѤ·¡¢¶¯À©Åª¤Ë ditroff ¤òÀ¸À®¤¹¤ë¡£"
+
+#: src/man.c:484
+msgid ""
+"-D, --default reset all options to their default values.\n"
+"-M, --manpath path set search path for manual pages to `path'.\n"
+"-P, --pager pager use program `pager' to display output.\n"
+"-S, --sections list use colon separated section list.\n"
+"-m, --systems system search for man pages from other unix system(s).\n"
+"-L, --locale locale define the locale for this particular man "
+"search.\n"
+"-p, --preprocessor string string indicates which preprocessors to run."
+msgstr ""
+"-D, --default ¤¹¤Ù¤Æ¤Î¥ª¥×¥·¥ç¥ó¤ò¥Ç¥Õ¥©¥ë¥ÈÃͤËÌ᤹¡£\n"
+"-M, --manpath path man ¥Ú¡¼¥¸¤Î¸¡º÷¥Ñ¥¹¤ò`path'¤ËÀßÄê¡£\n"
+"-P, --pager pager ½ÐÎϤòɽ¼¨¤¹¤ë¤¿¤á¤Ë¥×¥í¥°¥é¥à`pager'¤ò»ÈÍÑ¡£\n"
+"-S, --sections list ¥³¥í¥ó¤Ç¶èÀڤä¿¥»¥¯¥·¥ç¥ó list ¤ò»ÈÍÑ¡£\n"
+"-m, --systems system ¾¤Î UNIX ¥·¥¹¥Æ¥à¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò¸¡º÷¤¹¤ë¡£\n"
+"-L, --locale locale ¤³¤Î¥Þ¥Ë¥å¥¢¥ë¸¡º÷¤ËÂФ·¥í¥±¡¼¥ë locale ¤òÄêµÁ¤¹¤ë¡£\n"
+"-p, --preprocessor string ¥×¥ê¥×¥í¥»¥Ã¥µ string ¤ò¼Â¹Ô¤¹¤ë¤è¤¦»ØÄꤹ¤ë¡£"
+
+#: src/man.c:494
+msgid ""
+"-V, --version show version.\n"
+"-h, --help show this usage message."
+msgstr ""
+"-V, --version ¥Ð¡¼¥¸¥ç¥ó¤òɽ¼¨¤¹¤ë\n"
+"-h, --help ¤³¤Î¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë"
+
+#: src/man.c:507
+#, c-format
+msgid "What manual page do you want from section %s?\n"
+msgstr "¥»¥¯¥·¥ç¥ó %s ¤Ë¤¢¤ëɬÍפʥޥ˥奢¥ë¥Ú¡¼¥¸¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤\n"
+
+#: src/man.c:509
+msgid "What manual page do you want?\n"
+msgstr "ɬÍפʥޥ˥奢¥ë¥Ú¡¼¥¸¤ò»ØÄꤷ¤Æ¤¯¤À¤µ¤¤¡£\n"
+
+#: src/man.c:536
+#, c-format
+msgid "No source manual entry for %s"
+msgstr "%s ¤Î¥Þ¥Ë¥å¥¢¥ë¥½¡¼¥¹¤ÏÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: src/man.c:545
+#, c-format
+msgid "No manual entry for %s"
+msgstr "¥Þ¥Ë¥å¥¢¥ë %s ¤ÏÅÐÏ¿¤µ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: src/man.c:550
+#, c-format
+msgid " in section %s\n"
+msgstr " (¥»¥¯¥·¥ç¥ó %s )\n"
+
+#: src/man.c:808
+msgid ""
+" Manual page $MAN_PN ?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):?pB %pB\\\\%.."
+msgstr " ¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸ $MAN_PN %lt?L/%L. ?lt¹Ô:byte %bB?s/%s..?e (½ª):?pB %pB\\\\%.."
+
+#: src/man.c:1061
+msgid ": incompatible options"
+msgstr ": ¥ª¥×¥·¥ç¥ó¤¬Ì·½â¤·¤Æ¤¤¤Þ¤¹"
+
+#. didn't fail on roff
+#: src/man.c:1274
+#, c-format
+msgid "ignoring unknown preprocessor `%c'"
+msgstr "ÉÔÌÀ¤Ê¥×¥ê¥×¥í¥»¥Ã¥µ `%c' ¤ò̵»ë¤·¤Æ¤¤¤Þ¤¹"
+
+#: src/man.c:1335 src/man.c:1383 src/mandb.c:203
+#, c-format
+msgid "can't chown %s"
+msgstr "%s ¤Î½êÍ­¼Ô¤òÊѹ¹¤Ç¤­¤Þ¤»¤ó"
+
+#: src/man.c:1368 src/mandb.c:174
+#, c-format
+msgid "can't chmod %s"
+msgstr "%s ¤Îµö²Ä°À­¤òÊѹ¹¤Ç¤­¤Þ¤»¤ó"
+
+#: src/man.c:1395 src/mandb.c:165
+#, c-format
+msgid "can't rename %s to %s"
+msgstr "%s ¤Î̾Á°¤ò %s ¤ËÊѹ¹¤Ç¤­¤Þ¤»¤ó"
+
+#: src/man.c:1404
+#, c-format
+msgid "can't unlink %s"
+msgstr "%s ¤òºï½ü(unlink)¤Ç¤­¤Þ¤»¤ó"
+
+#: src/man.c:1431
+msgid "can't create pipe"
+msgstr "¥Ñ¥¤¥×¤òºîÀ®¤Ç¤­¤Þ¤»¤ó"
+
+#: src/man.c:1439 src/security.c:208
+msgid "can't fork"
+msgstr "fork ¤Ç¤­¤Þ¤»¤ó"
+
+#: src/man.c:1456 src/man.c:1466
+msgid "can't dup2"
+msgstr "Ê£¼Ì¤Ç¤­¤Þ¤»¤ó(dup2 ¼ºÇÔ)"
+
+#: src/man.c:1463
+#, c-format
+msgid "can't create %s"
+msgstr "%s ¤òºîÀ®¤Ç¤­¤Þ¤»¤ó"
+
+#: src/man.c:1485
+#, c-format
+msgid "can't exec %s"
+msgstr "%s ¤ò¼Â¹Ô¤Ç¤­¤Þ¤»¤ó"
+
+#: src/man.c:1522
+#, c-format
+msgid "waiting for pid %u"
+msgstr "pid %u ¤Î½ªÎ»¤Þ¤Ç wait ¤·¤Æ¤¤¤Þ¤¹"
+
+#: src/man.c:1572
+msgid "Still saving the page, please wait...\n"
+msgstr "¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤òÊݸ¤·¤Æ¤¤¤Þ¤¹¡£¤·¤Ð¤é¤¯¤ªÂÔ¤Á¤¯¤À¤µ¤¤...\n"
+
+#: src/man.c:1613
+#, c-format
+msgid "can't chdir to %s"
+msgstr "%s ¤Ë¥Ç¥£¥ì¥¯¥È¥ê¤òÊѹ¹¤Ç¤­¤Þ¤»¤ó"
+
+#: src/man.c:1722
+#, c-format
+msgid ""
+"\n"
+"cannot write to %s in catman mode"
+msgstr "\ncatman ¥â¡¼¥É¤Ç %s ¤Ë½ñ¤­¹þ¤ß¤Ç¤­¤Þ¤»¤ó"
+
+#: src/man.c:1762
+#, c-format
+msgid "Reformatting %s, please wait...\n"
+msgstr "%s ¤òºÆ¥Õ¥©¡¼¥Þ¥Ã¥È¤·¤Æ¤¤¤Þ¤¹¡£¤·¤Ð¤é¤¯¤ªÂÔ¤Á¤¯¤À¤µ¤¤...\n"
+
+#: src/man.c:2357
+#, c-format
+msgid "--Man-- next: %s [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]\n"
+msgstr "--Man-- ¼¡¤Ï: %s [ ±ÜÍ÷ (return) | ¥¹¥­¥Ã¥× (Ctrl-D) | ½ªÎ» (Ctrl-C) ]\n"
+
+#: src/mandb.c:140
+#, c-format
+msgid "usage: %s [-dqsuc|-h|-V] [manpath]\n"
+msgstr "»ÈÍÑË¡: %s [-dqsuc|-h|-V] [manpath]\n"
+
+#: src/mandb.c:142
+msgid ""
+"-d --debug produce debugging info.\n"
+"-q --quiet work quietly, except for 'bogus' warning.\n"
+"-s --no-straycats don't look for or add stray cats to the dbs.\n"
+"-u --user-db produce user databases only.\n"
+"-c --create create dbs from scratch, rather than updating.\n"
+"-V --version show version.\n"
+"-h --help show this usage message.\n"
+msgstr ""
+"-d --debug ¥Ç¥Ð¥Ã¥°¾ðÊó¤òɽ¼¨¤¹¤ë¡£\n"
+"-q --quiet '¥Ç¥£¥ì¥¯¥È¥ê¤È¥Õ¥¡¥¤¥ë̾¤ÎÉÔ°ìÃ×'¤Î·Ù¹ð¤Î¤ß½ÐÎÏ¡£\n"
+"-s --no-straycats roff ¤Ê¤· cat ¥Õ¥¡¥¤¥ë¤Î¸¡º÷¤È DB ¤ØÄɲäò¹Ô¤ï¤Ê¤¤¡£\n"
+"-u --user-db ¥æ¡¼¥¶Íѥǡ¼¥¿¥Ù¡¼¥¹¤Î¤ß¤òÀ¸À®¡£\n"
+"-c --create ¥Ç¡¼¥¿¥Ù¡¼¥¹¤ò¹¹¿·¤»¤º¡¢°ì¤«¤éºîÀ®¤·Ä¾¤¹¡£\n"
+"-V --version ¥Ð¡¼¥¸¥ç¥ó¤òɽ¼¨¤¹¤ë¡£\n"
+"-h --help ¤³¤Î»ÈÍÑË¡¤òɽ¼¨¤¹¤ë¡£\n"
+
+#: src/mandb.c:158 src/security.c:157
+#, c-format
+msgid "can't remove %s"
+msgstr "%s ¤òºï½ü¤Ç¤­¤Þ¤»¤ó"
+
+#: src/mandb.c:260
+#, c-format
+msgid "Processing manual pages under %s...\n"
+msgstr "%s ÇÛ²¼¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤ò½èÍý¤·¤Æ¤¤¤Þ¤¹...\n"
+
+#: src/mandb.c:388
+#, c-format
+msgid "the setuid man user \"%s\" does not exist"
+msgstr "setuid ¤µ¤ì¤¿ man ¥æ¡¼¥¶ \\\"%s\\\" ¤Ï¸ºß¤·¤Þ¤»¤ó"
+
+#: src/mandb.c:409
+#, c-format
+msgid "warning: no MANDB_MAP directives in %s, using your manpath"
+msgstr "·Ù¹ð: %s ¤Ë MANDB_MAP ¤Î»ØÄê¤Ï¤¢¤ê¤Þ¤»¤ó¡£¤¢¤Ê¤¿¤Î manpath ¤ò»ÈÍѤ·¤Þ¤¹"
+
+#: src/mandb.c:449
+#, c-format
+msgid ""
+"%d man subdirectories contained newer manual pages.\n"
+"%d manual pages "
+msgstr ""
+"%d ²Õ½ê¤Î man ¥µ¥Ö¥Ç¥£¥ì¥¯¥È¥ê¤Ë¿·¤·¤¤¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤¬¤¢¤ê¤Þ¤·¤¿¡£\n"
+"%d ¸Ä¤Î¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸"
+
+#: src/mandb.c:454
+#, c-format
+msgid "and %d stray cats "
+msgstr "¤È %d ¸Ä¤Î roff ¤Î¤Ê¤¤ cat ¥Õ¥¡¥¤¥ë"
+
+#: src/mandb.c:455
+msgid "were added."
+msgstr "¤òÄɲä·¤Þ¤·¤¿¡£"
+
+#: src/manp.c:115
+#, c-format
+msgid "can't make sense of the manpath configuration file %s"
+msgstr "manpath ÀßÄê¥Õ¥¡¥¤¥ë %s ¤ÎÆâÍƤò²ò¼á¤Ç¤­¤Þ¤»¤ó"
+
+#: src/manp.c:121
+#, c-format
+msgid "warning: %s"
+msgstr "·Ù¹ð: %s"
+
+#: src/manp.c:127
+#, c-format
+msgid "warning: %s isn't a directory"
+msgstr "·Ù¹ð: %s ¤Ï¥Ç¥£¥ì¥¯¥È¥ê¤Ç¤Ï¤¢¤ê¤Þ¤»¤ó"
+
+#: src/manp.c:352
+#, c-format
+msgid "warning: $MANPATH set, ignoring %s"
+msgstr "·Ù¹ð: $MANPATH ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Þ¤¹¡£%s ¤ò̵»ë¤·¤Þ¤¹"
+
+#: src/manp.c:366
+msgid "warning: $PATH not set"
+msgstr "·Ù¹ð: $PATH ¤¬ÀßÄꤵ¤ì¤Æ¤¤¤Þ¤»¤ó"
+
+#: src/manp.c:377
+msgid "warning: empty $PATH"
+msgstr "·Ù¹ð: $PATH ¤¬¶õ¤Ç¤¹"
+
+#: src/manp.c:403 src/manp.c:424
+#, c-format
+msgid "warning: cannot create catdir %s"
+msgstr "·Ù¹ð: cat ¥Ç¥£¥ì¥¯¥È¥ê %s ¤òºîÀ®¤Ç¤­¤Þ¤»¤ó"
+
+#: src/manp.c:448
+#, c-format
+msgid "can't open the manpath configuration file %s"
+msgstr "manpath ÀßÄê¥Õ¥¡¥¤¥ë %s ¤ò¥ª¡¼¥×¥ó¤Ç¤­¤Þ¤»¤ó"
+
+#: src/manp.c:497
+#, c-format
+msgid "can't parse directory list `%s'"
+msgstr "¥Ç¥£¥ì¥¯¥È¥ê¥ê¥¹¥È `%s' ¤ò²òÀϤǤ­¤Þ¤»¤ó"
+
+#: src/manp.c:541
+#, c-format
+msgid "warning: mandatory directory %s doesn't exist"
+msgstr "·Ù¹ð: ɬÍפʥǥ£¥ì¥¯¥È¥ê %s ¤¬Â¸ºß¤·¤Þ¤»¤ó"
+
+#: src/manp.c:754
+msgid "can't determine current directory"
+msgstr "¥«¥ì¥ó¥È¥Ç¥£¥ì¥¯¥È¥ê¤ò·è¤á¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó"
+
+#: src/manp.c:767
+#, c-format
+msgid "warning: %s does not have a man tree component"
+msgstr "·Ù¹ð: %s ¤Ï¥Þ¥ó¥Ä¥ê¡¼¤Î¹½À®¤ò¤·¤Æ¤¤¤Þ¤»¤ó"
+
+#: src/manp.c:897
+#, c-format
+msgid "warning: %s does not begin with %s"
+msgstr "·Ù¹ð: %s ¤Ï %s ¤Ç»Ï¤Þ¤Ã¤Æ¤¤¤Þ¤»¤ó"
+
+#: src/manpath.c:86
+#, c-format
+msgid "usage: %s [[-gcdq] [-m system]] | [-V] | [-h]\n"
+msgstr "»ÈÍÑË¡: %s [[-gcdq] [-m system]] | [-V] | [-h]\n"
+
+#: src/manpath.c:88
+msgid ""
+"-c --catpath show relative catpaths.\n"
+"-g --global show the entire global manpath.\n"
+"-d --debug produce debugging info.\n"
+"-q --quiet produce fewer warnings.\n"
+"-m --systems system express which `systems' to use.\n"
+"-V --version show version.\n"
+"-h --help show this usage message.\n"
+msgstr ""
+"-c --catpath Âбþ¤¹¤ë catpath ¤òɽ¼¨¤¹¤ë¡£\n"
+"-g --global ¥°¥í¡¼¥Ð¥ë¤Ê manpath ¤ò¤¹¤Ù¤Æɽ¼¨¤¹¤ë¡£\n"
+"-d --debug ¥Ç¥Ð¥Ã¥°¾ðÊó¤òÀ¸À®¤¹¤ë¡£\n"
+"-q --quiet ·Ù¹ð¤ò¤Û¤È¤ó¤Éɽ¼¨¤·¤Ê¤¤¡£\n"
+"-m --systems system ¤É¤Î`¥·¥¹¥Æ¥à'¤ò»ÈÍѤ¹¤ë¤«ÌÀ¼¨¤¹¤ë¡£\n"
+"-V --version ¥Ð¡¼¥¸¥ç¥ó¤òɽ¼¨¤¹¤ë¡£\n"
+"-h --help ¤³¤Î¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë¡£\n"
+
+#: src/manpath.c:165
+#, c-format
+msgid "warning: no global manpaths set in config file %s"
+msgstr "·Ù¹ð: ÀßÄê¥Õ¥¡¥¤¥ë %s ¤Ë¥°¥í¡¼¥Ð¥ë¤Ê manpath ¤ÎÀßÄ꤬¤¢¤ê¤Þ¤»¤ó"
+
+#: src/security.c:66
+msgid "can't set effective uid"
+msgstr "Í­¸ú¤Ê UID ¤òÀßÄê¤Ç¤­¤Þ¤»¤ó"
+
+#: src/straycats.c:216 src/ult_src.c:144
+#, c-format
+msgid "warning: %s is a dangling symlink"
+msgstr "·Ù¹ð: %s ¤Ï¥·¥ó¥Ü¥ê¥Ã¥¯¥ê¥ó¥¯¤¬ÀÚ¤ì¤Æ¤¤¤Þ¤¹"
+
+#: src/straycats.c:218 src/ult_src.c:146 src/ult_src.c:236
+#, c-format
+msgid "can't resolve %s"
+msgstr "%s ¤ò²ò·è¤Ç¤­¤Þ¤»¤ó"
+
+#: src/straycats.c:262
+#, c-format
+msgid "Checking for stray cats under %s...\n"
+msgstr "%s ÇÛ²¼¤Ë roff ¤Î¤Ê¤¤ cat ¥Õ¥¡¥¤¥ë¤¬¤Ê¤¤¤«Ä´¤Ù¤Æ¤¤¤Þ¤¹...\n"
+
+#: src/straycats.c:299
+#, c-format
+msgid "warning: can't update index cache %s"
+msgstr "·Ù¹ð: index ¥­¥ã¥Ã¥·¥å %s ¤ò¹¹¿·¤Ç¤­¤Þ¤»¤ó"
+
+#: src/ult_src.c:262
+#, c-format
+msgid "%s is self referencing"
+msgstr "%s ¤Ï¼«Ê¬¼«¿È¤ò»²¾È¤·¤Æ¤¤¤Þ¤¹"
+
+#: src/version.c:28
+#, c-format
+msgid "%s, version %s, db %s, %s (G.Wilford@ee.surrey.ac.uk)\n"
+msgstr "%s, ¥Ð¡¼¥¸¥ç¥ó %s, db %s, %s (G.Wilford@ee.surrey.ac.uk)\n"
+
+#: src/version.c:31
+#, c-format
+msgid "\tdebian version %s, (%s), %s\n"
+msgstr "\tdebian ¥Ð¡¼¥¸¥ç¥ó %s, (%s), %s\n"
+
+#: src/whatis.c:125 src/whatis.c:141
+#, c-format
+msgid ""
+"usage: %s [-d] [-r|-w] [-m systems] [-M manpath] | [-h] | [-V] keyword ...\n"
+msgstr "»ÈÍÑË¡: %s [-d] [-r|-w] [-m systems] [-M manpath] | [-h] | [-V] keyword ...\n"
+
+#: src/whatis.c:127 src/whatis.c:143
+msgid ""
+"-d --debug\t\tproduce debugging info.\n"
+"-r --regex \t\tinterpret each keyword as a regex.\n"
+"-w --wildcard\t\tthe keyword(s) contain wildcards.\n"
+"-m --systems system\tinclude alternate systems man pages.\n"
+"-M --manpath path\tset search path for manual pages to `path'.\n"
+"-V --version\t\tshow version.\n"
+"-h --help\t\tshow this usage message.\n"
+msgstr ""
+"-d --debug\t\t¥Ç¥Ð¥Ã¥°¾ðÊó¤òÀ¸À®¤¹¤ë\n"
+"-r --regex \t\t¥­¡¼¥ï¡¼¥É¤òÀµµ¬É½¸½¤È¤·¤Æ²ò¼á¤¹¤ë\n"
+"-w --wildcard\t\t¥­¡¼¥ï¡¼¥É¤¬¥ï¥¤¥ë¥É¥«¡¼¥É¤ò´Þ¤à\n"
+"-m --systems system\tÊ̤Υ·¥¹¥Æ¥à¤Î¥Þ¥ó¥Ú¡¼¥¸¤ò´Þ¤á¤ë\n"
+"-M --manpath path\t¥Þ¥Ë¥å¥¢¥ë¥Ú¡¼¥¸¤Î¸¡º÷¥Ñ¥¹¤ò`path'¤ËÀßÄꤹ¤ë\n"
+"-V --version\t\t¥Ð¡¼¥¸¥ç¥ó¤òɽ¼¨¤¹¤ë\n"
+"-h --help\t\t¤³¤Î¥á¥Ã¥»¡¼¥¸¤òɽ¼¨¤¹¤ë\n"
+
+#: src/whatis.c:183
+msgid "warning: can't read the fallback whatis text database."
+msgstr "·Ù¹ð: ¶ÛµÞÍѤΠwhatis ¥Æ¥­¥¹¥È¥Ç¡¼¥¿¥Ù¡¼¥¹¤òÆɤ߹þ¤á¤Þ¤»¤ó"
+
+#: src/whatis.c:211 src/whatis.c:223
+msgid "(unknown)"
+msgstr "(ÉÔÌÀ)"
+
+#: src/whatis.c:482
+#, c-format
+msgid "%s: nothing appropriate.\n"
+msgstr "%s: ŬÀڤʤâ¤Î¤Ï¤¢¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£\n"
+
+#: src/whatis.c:576
+#, c-format
+msgid "%s what?\n"
+msgstr "%s: ¥­¡¼¥ï¡¼¥É¤Ï²¿¤Ç¤¹¤«¡©\n"
+
+#: src/whatis.c:599 src/whatis.c:609
+#, c-format
+msgid "fatal: regex `%s': %s"
+msgstr "Ã×̿Ū¥¨¥é¡¼: Àµµ¬É½¸½ `%s': %s"
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644
index 00000000..74c42b71
--- /dev/null
+++ b/src/Makefile.in
@@ -0,0 +1,201 @@
+# Programs Makefile for the man package.
+#
+# Copyright (C) 1994, 1995, Graeme Wilford.
+#
+# You may distribute under the terms of the GNU General Public
+# License as specified in the COPYING file that comes with this
+# distribution.
+#
+# Sat Aug 6 13:28:44 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk):
+
+srcdir = @srcdir@
+libdir = @libdir@
+VPATH = @srcdir@
+top_srcdir = @top_srcdir@
+subdir = src
+gnulocaledir = $(prefix)/share/locale
+
+INSTALL = @INSTALL@
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+
+LIBS = @INTLLIBS@ @LIBS@
+
+include ../include/Defines
+
+.PHONY: $(DEFAULT_TARGETS)
+
+#----------------------------------------------------------------#
+# user changeable definitions can be found in ../include/Defines #
+#----------------------------------------------------------------#
+
+# You may need to modify these options if you have lex instead of flex
+# or flex < 2.4.7 and you want to play with lexgrog.l (developement only)
+#
+FLEXOPTS = -8B -Cem
+LEX := $(LEX) $(FLEXOPTS)
+
+PROGS = man manpath mandb apropos whatis catman
+TOOLS = accessdb lexgrog globbing
+
+MANCPPFLAGS = -DWHATIS=\"$(bindir)/$(whatis)\" \
+ -DAPROPOS=\"$(bindir)/$(apropos)\" \
+ -DSOELIM=\"$(bindir)/$(zsoelim)\"
+
+CATMANCPPFLAGS = -DMAN=\"$(bindir)/$(man)\"
+
+#-------------------------------------------------------------------#
+# This is just to make sure that things are done in the right order #
+#-------------------------------------------------------------------#
+
+ifeq ($(nls),on)
+all:
+ $(make_in_root)
+else
+
+# The default programs to build
+all: manpath mandb apropos whatis catman man accessdb wrapper
+
+#-----------------------------------------------------------------------#
+# If we want any kind of NLS message catalogue support, nls must != off #
+# this is exported from the master Makefile. #
+#-----------------------------------------------------------------------#
+
+ ifneq ($(nls),off)
+NLS = -DNLS
+
+MSGS = whatis.m version.m compression.m mandb.m check_mandirs.m \
+ man.m manp.m manpath.m security.m straycats.m \
+ ult_src.m catman.m lexgrog.m convert_name.m
+MSG_PATHS = $(addprefix $(MSG_DIR)/, $(MSGS))
+
+local_gencat = ../gencat/gencat
+
+$(srcdir)/man_db-nls.h: $(srcdir)/stamp-h
+$(srcdir)/stamp-h: $(MSG_PATHS)
+ test -f $(gencat) || $(MAKE) -C ../gencat
+ $(gencat) -new /dev/null $^ -h $(srcdir)/man_db-nls.h
+ rm -f $@
+ date > $@
+
+$(MSG_PATHS): $(MSG_DIR)/%.m: $(srcdir)/%.c
+ test -f ../xcat/xcat || $(MAKE) -C ../xcat
+ ../xcat/xcat $(top_srcdir)/xcat/Register < $< > $@
+
+ endif
+endif
+
+override CPPFLAGS := $(DEFS) $(NLS) -DCONFIG_FILE=\"$(config_file)\" \
+ -DLOCALEDIR=\"$(gnulocaledir)\" \
+ -I../include -I$(top_srcdir) -I$(srcdir) -I- -I../intl \
+ $(CPPFLAGS)
+
+#--------------------#
+# some general rules #
+#--------------------#
+
+../lib/libman.a:
+ $(MAKE) -C ../lib
+
+../libdb/libmandb.a:
+ $(MAKE) -C ../libdb
+
+#-------------------------------------------------------------------#
+# The individual program dependencies... #
+# note that anything requiring compression.o must also have either #
+# security.o (man), or fake_security.o (others) in the object list. #
+#-------------------------------------------------------------------#
+
+man: security.o convert_name.o manp.o ult_src.o compression.o \
+ check_mandirs.o hashtable.o util.o lexgrog.o globbing.o
+
+mandb: security.o manp.o util.o ult_src.o check_mandirs.o hashtable.o straycats.o \
+ compression.o lexgrog.o
+
+wrapper: LIBS = "-lc"
+
+catman manpath whatis apropos: security.o manp.o util.o
+accessdb: util.o ../lib/libman.a
+
+whatis.o: whatis.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -DWHATIS -c $< -o $@
+
+apropos.o: whatis.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) -DAPROPOS -c $< -o $@
+
+lexgrog: lexgrog.c ../lib/libman.a
+ $(CC) $(CFLAGS) $(CPPFLAGS) -DTEST $(LDFLAGS) $^ -o $@
+
+man.o: man.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(MANCPPFLAGS) -c $< -o $@
+
+catman.o: catman.c
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(CATMANCPPFLAGS) -c $< -o $@
+
+globbing: globbing.c ../lib/libman.a
+ $(CC) $(CFLAGS) $(CPPFLAGS) -DTEST $(LDFLAGS) $^ -o $@
+
+# programs that depend on db routines...
+man mandb catman whatis apropos accessdb: ../libdb/libmandb.a
+
+# All programs depend on these...
+$(PROGS): version.o ../lib/libman.a
+
+# The standard targets
+install: all
+ $(MKINSTALLDIRS) $(bindir)
+ $(INSTALL_PROGRAM) $(man_install_flags) man $(libdir)/man-db/$(man)
+ $(INSTALL_PROGRAM) $(man_install_flags) mandb $(libdir)/man-db/$(mandb)
+ $(INSTALL_PROGRAM) manpath $(bindir)/$(manpath)
+ $(INSTALL_PROGRAM) catman $(bindir)/$(catman)
+ $(INSTALL_PROGRAM) whatis $(bindir)/$(whatis)
+ $(INSTALL_PROGRAM) apropos $(bindir)/$(apropos)
+ $(INSTALL_PROGRAM) wrapper $(bindir)/wrapper
+ ln -f wrapper $(bindir)/$(man)
+ ln -f wrapper $(bindir)/$(mandb)
+ for j in $(TOOLS); do \
+ if test -x $$j ; then \
+ $(INSTALL_PROGRAM) $$j $(sbindir)/$$j; \
+ fi; \
+ done
+ @if test -f $(config_file) ; then \
+ echo " "; \
+ echo "$(config_file) already exists. Overwrite manually if necessary"; \
+ echo " "; \
+ else \
+ $(MKINSTALLDIRS) $(sysconfdir); \
+ echo "$(INSTALL_DATA) $(srcdir)/man_db.config $(config_file)"; \
+ $(INSTALL_DATA) $(srcdir)/man_db.config $(config_file); \
+ fi
+
+uninstall:
+ rm -f $(addprefix $(bindir)/, $(PROGS))
+ rm -f $(addprefix $(sbindir)/, $(TOOLS))
+ @echo "Please remove $(config_file) manually if necessary"
+# rm -f $(config_file)
+
+mostlyclean clean:
+ rm -f *.o *~ core
+ rm -f $(PROGS) $(TOOLS) wrapper
+
+distclean: lexgrog.c clean
+ rm -f *.d *.out Makefile
+
+realclean: distclean
+ rm -f lexgrog.c stamp-h tags
+
+TAGS:
+ $(MKTAGS) $(srcdir)/*.[chl]
+
+#------------------------------------------------------------------#
+# These lines sort out proper dependencies, done if --enable-debug #
+# passed to ../configure. To override uncomment the following line #
+#------------------------------------------------------------------#
+#debug=on
+
+ifneq ($(clean),yes)
+ ifeq ($(debug),on)
+ SRCS = $(notdir $(wildcard $(srcdir)/*.c))
+ include $(SRCS:.c=.d)
+ endif
+endif
diff --git a/src/README.lexgrog b/src/README.lexgrog
new file mode 100644
index 00000000..738eb2d0
--- /dev/null
+++ b/src/README.lexgrog
@@ -0,0 +1,16 @@
+lexgrog.l is used to extract the whatis line(s) from manual pages.
+
+The default lexgrog.c code is compiled from 2.4a lexgrog.l flex source
+code as this is better at parsing HP-UX manual pages. For systems with
+standardised manual pages: Linux, SunOS, there is little difference
+between lexgrog.l-2.3.8 and lexgrog.l-2.4a, except the relative size of
+the C code they produce, the later being larger.
+
+In the event of poor whatis parsing or similar problems, simply
+
+ rm lexgrog.[lc]
+ ln -s lexgrog.l-2.3.8 lexgrog.l
+
+and then re-make. You will need a version of flex >= 2.4.7 to compile
+the flex file into C source.
+
diff --git a/src/accessdb.c b/src/accessdb.c
new file mode 100644
index 00000000..21acae80
--- /dev/null
+++ b/src/accessdb.c
@@ -0,0 +1,103 @@
+/*
+ * accessdb.c: show every key/content pair in the database.
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * Tue Apr 26 12:56:44 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <stdio.h>
+#include <errno.h>
+
+#ifndef STDC_HEADERS
+extern int errno;
+#endif
+
+#if defined(STDC_HEADERS)
+# include <string.h>
+# include <stdlib.h>
+#elif defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#else /* no string(s) header */
+extern char *strchr();
+#endif /* STDC_HEADERS */
+
+#include <libintl.h>
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+#include "libdb/mydbm.h"
+#include "lib/error.h"
+
+char *program_name;
+char *cat_root;
+int debug;
+
+/* for db_storage.c */
+char *database;
+MYDBM_FILE dbf;
+
+static void usage(int status)
+{
+ fprintf(stderr,
+ _("\nUsage: accessdb [man_database]\n"
+ "\tman_database defaults to %s " MAN_DB "\n"), cat_root);
+
+ exit (status);
+}
+
+int main(int argc, char *argv[])
+{
+ MYDBM_FILE dbf;
+ datum key,content;
+
+ program_name = basename(argv[0]);
+ if ( is_directory (CAT_ROOT) == 1 )
+ cat_root = CAT_ROOT;
+ else if ( is_directory (FHS_CAT_ROOT) == 1 )
+ cat_root = FHS_CAT_ROOT;
+
+ if (argc > 2)
+ usage(FAIL);
+ else if (argc == 2)
+ database = argv[1];
+ else
+ database = strappend( NULL, cat_root, MAN_DB, NULL);
+
+ if ( !(dbf = MYDBM_RDOPEN(database)) || dbver_rd(dbf)) {
+ error (0, errno, _("can't open %s for reading"), database);
+ usage(FAIL);
+ }
+
+ key = MYDBM_FIRSTKEY(dbf);
+
+ while (key.dptr != NULL) {
+ char *t, *nicekey;
+
+ content = MYDBM_FETCH(dbf, key);
+ if (!content.dptr)
+ exit (FATAL);
+ nicekey = xstrdup(key.dptr);
+ while ( (t = strchr(nicekey, '\t')) )
+ *t = '~';
+ while ( (t = strchr(content.dptr, '\t')) )
+ *t = ' ';
+ printf("%s -> \"%s\"\n", nicekey, content.dptr);
+ free(nicekey);
+ MYDBM_FREE(content.dptr);
+ key = MYDBM_NEXTKEY(dbf, key);
+ }
+
+ MYDBM_CLOSE(dbf);
+ exit (OK);
+}
diff --git a/src/catman.c b/src/catman.c
new file mode 100644
index 00000000..e12d1638
--- /dev/null
+++ b/src/catman.c
@@ -0,0 +1,504 @@
+/*
+ * catman.c: create and/or update cat files
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * Thu Dec 8 00:03:12 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+/* MAX_ARGS must be >= 6, 4 for options, 1 for page and 1 for NULL */
+#define MAX_ARGS 1024 /* *argv[MAX_ARG] */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <stdio.h>
+#include <assert.h>
+#include <sys/types.h>
+#include <errno.h>
+
+#if HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif /* HAVE_SYS_WAIT_H */
+
+#if defined(STDC_HEADERS)
+# include <string.h>
+# include <stdlib.h>
+#elif defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#else /* no string(s) header */
+#endif /* STDC_HEADERS */
+
+#ifndef STDC_HEADERS
+extern char *getenv();
+extern int errno;
+#endif
+
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#if defined(HAVE_LIMITS_H) && defined(_POSIX_VERSION)
+# include <limits.h>
+#else /* !(HAVE_LIMITS_H && _POSIX_VERSION) */
+# include <sys/param.h>
+#endif /* HAVE_LIMITS_H */
+
+#ifndef NAME_MAX
+# if defined(_POSIX_VERSION) && defined(_POSIX_NAME_MAX)
+# define NAME_MAX _POSIX_NAME_MAX
+# else /* !_POSIX_VERSION */
+# ifdef MAXNAMLEN
+# define NAME_MAX MAXNAMLEN
+# else /* !MAXNAMLEN */
+# define NAME_MAX 255 /* default to max */
+# endif /* MAXNAMLEN */
+# endif /* _POSIX_VERSION */
+#endif /* !NAME_MAX */
+
+#ifndef ARG_MAX
+# if defined(_POSIX_VERSION) && defined(_POSIX_ARG_MAX)
+# define ARG_MAX _POSIX_ARG_MAX
+# else /* !_POSIX_VERSION */
+# define ARG_MAX 4096 /* default to min */
+# endif /* _POSIX_VERSION */
+#endif /* !ARG_MAX */
+
+#ifdef HAVE_GETOPT_H
+# include <getopt.h>
+#else /* !HAVE_GETOPT_H */
+# include "lib/getopt.h"
+#endif /* HAVE_GETOPT_H */
+
+#include <locale.h>
+#include <libintl.h>
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+#include "libdb/mydbm.h"
+#include "libdb/db_storage.h"
+#include "lib/error.h"
+#include "manp.h"
+
+/* globals */
+#ifndef debug
+int debug = 0;
+#endif
+char *program_name;
+int quiet = 1;
+MYDBM_FILE dbf;
+char *manp;
+char *database;
+
+static const struct option long_options[] =
+{
+ {"debug", no_argument, 0, 'd'},
+ {"manpath", required_argument, 0, 'M'},
+ {"help", no_argument, 0, 'h'},
+ {"version", no_argument, 0, 'V'},
+ {0, 0, 0, 0}
+};
+
+static const char args[] = "dM:hV";
+
+#ifdef HAVE_SETLOCALE
+static char *locale;
+#endif /* HAVE_SETLOCALE */
+
+extern char *optarg;
+extern int optind, opterr, optopt;
+extern char *manpathlist[];
+
+static void usage(int status)
+{
+ printf(_( "usage: %s [-dhV] [-M manpath] [section] ...\n"), program_name);
+ printf(_(
+ "-d --debug produce debugging info.\n"
+ "-M --manpath path set search path for manual pages to `path'.\n"
+ "-V --version show version.\n"
+ "-h --help show this usage message.\n")
+ );
+
+ exit (status);
+}
+
+/* open db for reading, return 0 for success, errcode for failure */
+static int rdopen_db(void)
+{
+ if ( (dbf = MYDBM_RDOPEN(database)) == NULL ) {
+ error (0, errno, _( "cannot read database %s"), database);
+ return 1;
+ }
+ return 0;
+}
+
+/* fork() and execve() man with the appropriate catman args.
+ If we __inline__ this function, gcc v2.6.2 gives us `clobber' warnings ?? */
+static void catman(char *argp[], int arg_no)
+{
+ pid_t child;
+ int status;
+ int res;
+
+ if (debug) { /* show us what the command is going to be :) */
+ char **p;
+
+ fputs("man command =", stderr);
+ for (p = argp; *p; p++)
+ fprintf(stderr, " %s", *p);
+ putc('\n', stderr);
+ return;
+ }
+
+ child = vfork();
+ if (child < 0)
+ error(FATAL, errno, _( "fork failed"));
+ else if (child == 0) {
+ char *const envp[] = { NULL };
+
+ execve(MAN, argp, envp);
+ _exit(127);
+ }
+
+ do { /* cope with non-restarting system calls */
+ res = waitpid (child, &status, 0);
+ } while ((res == -1) && (errno == EINTR));
+ if (res == -1)
+ error (FATAL, 0, _( "can't get man command's exit status"));
+ else if (status)
+ error (CHILD_FAIL, 0, _( "man command failed with exit status %d"), status);
+}
+
+/* accept key and a pointer to the array address that needs to be filled in,
+ fill in address and return 1 if key.dptr can be freed otherwise 0 */
+static __inline__ int add_arg(datum key, char **argument)
+{
+ char *tab;
+
+ tab = strrchr(key.dptr, '\t');
+
+ if (tab && tab != key.dptr) {
+ *tab = '\0';
+ *argument = xstrdup(key.dptr);
+ *tab = '\t';
+ return 1;
+ }
+
+ *argument = key.dptr;
+ return 0;
+}
+
+/* simply close db, tidy up, call catman() and then free() the array */
+static void do_catman(char *argp[], int arg_no, int first_arg)
+{
+ MYDBM_CLOSE(dbf);
+
+ /* The last argument must be NULL */
+ argp[arg_no] = NULL;
+
+ catman(argp, arg_no);
+
+ /* don't free the last entry, it's NULL */
+ /* don't free the last but one entry, it's our nextkey */
+ arg_no -= 2;
+
+ while (arg_no >= first_arg)
+ /* all db methods now free() */
+ MYDBM_FREE(argp[arg_no--]);
+}
+
+#ifdef BTREE
+/* we need to reset the cursor position after a reopen */
+static __inline__ void reset_cursor(datum key)
+{
+ int status;
+ DBT content; /* dummy */
+
+ status = (dbf->seq)(dbf, (DBT *) &key, &content, R_CURSOR);
+ if (status == 1)
+ status = (dbf->seq)(dbf, (DBT *) &key, &content, R_LAST);
+ if (status == -1)
+ error(FATAL, errno, _( "unable to reset cursor position in %s"), database);
+}
+#else /* !BTREE */
+# define reset_cursor(key) /* nothing */
+#endif /* BTREE */
+
+/* find all pages that are in the supplied manpath and section and that are
+ ultimate source files. */
+static __inline__ int parse_for_sec(char *manpath, char *section)
+{
+ char *argp[MAX_ARGS];
+ datum key;
+ size_t arg_size, initial_bit;
+ int arg_no = 0, message = 1, first_arg;
+
+ if (rdopen_db() || dbver_rd(dbf))
+ return 1;
+
+ argp[arg_no++] = "man"; /* Name of program */
+
+#ifdef HAVE_SETLOCALE
+ /* As we supply a NULL environment to save precious execve() space,
+ we must also supply a locale if necessary */
+ if (locale) {
+ argp[arg_no++] = "-L"; /* locale option */
+ argp[arg_no++] = locale; /* The locale */
+ initial_bit += sizeof "-L" + strlen(locale) + 1;
+ } else
+ initial_bit = 0;
+
+#endif /* HAVE_SETLOCALE */
+
+ argp[arg_no++] = "-caM"; /* options */
+ argp[arg_no++] = manpath; /* particular manpath */
+ argp[arg_no++] = section; /* particular section */
+
+ first_arg = arg_no; /* first pagename argument */
+
+ initial_bit = sizeof "man" + sizeof "-caM" +
+ strlen(manpath) + strlen(section) + 2;
+
+ arg_size = initial_bit;
+ key = MYDBM_FIRSTKEY(dbf);
+
+ while (key.dptr != NULL) {
+ int free_key = 1;
+
+ /* ignore db identifier keys */
+ if (*key.dptr != '$') {
+ datum content;
+
+ content = MYDBM_FETCH(dbf, key);
+
+ if (!content.dptr)
+ error(FATAL, 0, _( "NULL content for key: %s"), key.dptr);
+
+ /* ignore overflow entries */
+ if (*content.dptr != '\t') {
+ struct mandata entry;
+
+ split_content(content.dptr, &entry);
+ content.dptr = entry.addr;
+
+ /* Accept if the entry is an ultimate manual
+ page and the section matches the one we're
+ currently dealing with */
+ if (entry.id == ULT_MAN &&
+ strcmp(entry.sec, section) == 0) {
+ if (message) {
+ printf(_("\nUpdating cat files for section %s of man hierarchy %s\n"),
+ section, manpath);
+ message = 0;
+ }
+
+ free_key = add_arg(key, &(argp[arg_no]));
+ arg_size += strlen(argp[arg_no++]) + 1;
+
+ if (debug)
+ fprintf(stderr, "arg space free: %d bytes\n",
+ ARG_MAX - arg_size);
+
+ /* Check to see if we have enough room
+ to add another max sized filename
+ and that we haven't run out of array
+ space too */
+ if (arg_size >= ARG_MAX - NAME_MAX ||
+ arg_no == MAX_ARGS - 1) {
+ do_catman(argp, arg_no, first_arg);
+
+ /* reopen db and tidy up */
+ if (rdopen_db())
+ return 1;
+ reset_cursor(key);
+ free_key = 1;
+ arg_no = first_arg;
+ arg_size = initial_bit;
+ }
+ }
+ }
+
+ /* we don't need the content ever again */
+ assert (content.dptr); /* just to be sure */
+ MYDBM_FREE(content.dptr);
+ }
+
+ /* If we are not using the key, free it now */
+ if (free_key) {
+ datum nextkey;
+
+ nextkey = MYDBM_NEXTKEY(dbf, key);
+ MYDBM_FREE(key.dptr);
+ key = nextkey;
+ } else
+ key = MYDBM_NEXTKEY(dbf, key);
+ }
+
+ if (arg_no > first_arg)
+ do_catman(argp, arg_no, first_arg);
+
+ return 0;
+}
+
+static __inline__ int check_access(const char *directory)
+{
+ if (access(directory, W_OK)) {
+ error(0, errno, _( "cannot write within %s"), directory);
+ return 1;
+ }
+
+ return 0;
+}
+
+int main(int argc, char *argv[])
+{
+ int c;
+ char *sys_manp;
+ char **mp, **sections;
+
+ int option_index; /* not used, but required by getopt_long() */
+
+ program_name = xstrdup(basename(argv[0]));
+
+ /* initialise the locale */
+ locale = setlocale( LC_MESSAGES, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ if (locale != NULL
+ || (locale = getenv ("LC_ALL"))
+ || (locale = getenv ("LC_MESSAGES"))
+ || (locale = getenv ("LANG")) )
+ locale = xstrdup (locale);
+ else
+ locale = "C";
+
+ while ((c = getopt_long (argc, argv, args,
+ long_options, &option_index)) != EOF) {
+ switch (c) {
+
+ case 'd':
+#ifndef debug
+ debug = 1;
+#endif
+ break;
+ case 'M':
+ manp = optarg;
+ break;
+ case 'V':
+ ver();
+ break;
+ case 'h':
+ usage(OK);
+ break;
+ default:
+ usage(FAIL);
+ break;
+ }
+ }
+
+ /* Deal with the sections */
+
+ /* If we were supplied sections: sort them out */
+ if (optind != argc) {
+ char **sp;
+
+ sections = sp = (char **) xmalloc ((argc - optind + 1) *
+ sizeof (char *));
+ while(optind != argc)
+ *sp++ = argv[optind++];
+ *sp = NULL;
+ } else {
+ char *mansect;
+
+ mansect = getenv("MANSECT");
+ if (mansect && *mansect) {
+ /* MANSECT contains sections */
+ char *sec;
+ int i = 0;
+
+ mansect = xstrdup(mansect);
+ sections = NULL;
+ for (sec = strtok(mansect, ":"); sec;
+ sec = strtok(NULL, ":")) {
+ sections = (char **) xrealloc (sections,
+ (i + 2) *
+ sizeof (char *));
+ sections[i++] = sec;
+ }
+ sections[i] = NULL;
+ } else {
+ /* use default sections */
+ static char *std_sections[] = STD_SECTIONS;
+ sections = std_sections;
+ }
+ }
+
+ if (debug) {
+ char **sp;
+
+ for (sp = sections; *sp; sp++)
+ fprintf(stderr, "sections: %s\n", *sp);
+ }
+
+ /* Deal with the MANPATH */
+
+ /* This is required for global_catpath(), regardless */
+ sys_manp = manpath(NULL);
+
+ /* pick up the system manpath or use the supplied one */
+ if (!manp) {
+ if ( !(manp = get_mandb_manpath()) )
+ manp = sys_manp;
+ }
+
+ if (debug)
+ fprintf(stderr, "manpath=%s\n", manp);
+
+ /* get the manpath as an array of pointers */
+ create_pathlist(xstrdup(manp), manpathlist);
+
+ for (mp = manpathlist; *mp; mp++) {
+ char *catpath, **sp;
+ size_t len;
+
+ catpath = global_catpath(*mp);
+
+ if (catpath) {
+ if (is_directory(catpath) != 1) {
+ free (catpath);
+ continue;
+ }
+ database = mkdbname(catpath);
+ } else {
+ if (is_directory(*mp) != 1)
+ continue;
+ database = mkdbname(*mp);
+ catpath = xstrdup(*mp);
+ }
+
+ len = strlen(catpath);
+
+ for (sp = sections; *sp; sp++) {
+ *(catpath + len) = '\0';
+ catpath = strappend (catpath, "/cat", *sp, NULL);
+ if (is_directory(catpath) != 1 || check_access(catpath))
+ continue;
+ if (parse_for_sec(*mp, *sp)) {
+ error(0, 0, _( "unable to update %s"), *mp);
+ break;
+ }
+ }
+
+ free (catpath);
+ }
+
+ exit (OK);
+}
diff --git a/src/check_mandirs.c b/src/check_mandirs.c
new file mode 100644
index 00000000..a908b1e6
--- /dev/null
+++ b/src/check_mandirs.c
@@ -0,0 +1,604 @@
+/*
+ * check_mandirs.c: used to auto-update the database caches
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * Mon May 2 17:36:33 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <errno.h>
+
+#ifdef HAVE_DIRENT_H
+# include <dirent.h>
+#else /* not HAVE_DIRENT_H */
+# define dirent direct
+# ifdef HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif /* HAVE_SYS_NDIR_H */
+# ifdef HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif /* HAVE_SYS_DIR_H */
+# ifdef HAVE_NDIR_H
+# include <ndir.h>
+# endif /* HAVE_NDIR_H */
+#endif /* HAVE_DIRENT_H */
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#if defined(STDC_HEADERS)
+# include <string.h>
+# include <stdlib.h>
+#elif defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#else /* no string(s) header */
+extern char *strchr(), *strrchr(), *strstr();
+#endif /* no string(s) header */
+
+#ifndef STDC_HEADERS
+extern time_t time();
+extern int errno;
+#endif
+
+#include <libintl.h>
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+#include "libdb/mydbm.h"
+#include "libdb/db_storage.h"
+#include "lib/error.h"
+#include "ult_src.h"
+#include "hashtable.h"
+
+int opt_test; /* don't update db */
+int pages;
+
+static void gripe_bogus_manpage(char *manpage)
+{
+ if (quiet < 2)
+ error (0, 0, _( "warning: %s: ignoring bogus filename"), manpage);
+}
+
+static void gripe_multi_extensions(const char *path, const char *sec,
+ const char *name, const char *ext)
+{
+ if (quiet < 2)
+ error (0, 0, _( "warning: %s/man%s/%s.%s*: competing extensions"),
+ path, sec, name, ext);
+}
+
+char *make_filename(const char *path, const char *name,
+ struct mandata *in, char *type)
+{
+ static char *file;
+
+ file = (char *) xrealloc (file, sizeof "//." + strlen(path) +
+ strlen(type) + strlen(in->sec) +
+ strlen(name) + strlen(in->ext));
+
+ (void) sprintf(file, "%s/%s%s/%s.%s", path, type, in->sec, name,
+ in->ext);
+
+ if (*in->comp != '-') /* Is there an extension ? */
+ file = strappend(file, ".", in->comp, NULL);
+
+ return file;
+}
+
+int splitline(char *raw_whatis, struct mandata *info, char *base_name)
+{
+ char *comma;
+ int ret;
+
+ info->whatis = NULL; /* default */
+ if (raw_whatis) {
+ if ( (info->whatis = strstr(raw_whatis, " - ")) ) {
+ info->whatis[0] = '\0'; /* separate description */
+ info->whatis += 3;
+ } else {
+ raw_whatis = NULL; /* kill entire whatis line */
+ }
+ }
+
+ /* Here we store the direct reference */
+ if (debug)
+ fprintf(stderr, "base_name = %s\n", base_name);
+
+ ret = dbstore(info, base_name);
+ if (ret > 0)
+ return ret;
+
+ /* if there are no indirect references, just go on to the
+ next file */
+
+ if (!raw_whatis || strchr(raw_whatis, ',') == NULL)
+ return 0;
+
+ /* If there are... */
+
+ if (info->id < STRAY_CAT)
+ info->id = WHATIS_MAN;
+ else
+ info->id = WHATIS_CAT;
+
+ /* don't waste space storing the whatis in the db */
+ info->whatis = NULL;
+ info->pointer = base_name;
+
+ while( (comma = strrchr(raw_whatis, ',')) != NULL) {
+ *comma = '\0';
+ comma += 2;
+
+ /* If we've already dealt with it, ignore */
+
+ if (strcmp(comma, base_name) != 0) {
+ if (debug)
+ fprintf(stderr, "comma = %s\n", comma);
+ ret = dbstore(info, comma);
+ if (ret > 0)
+ return ret;
+ }
+ }
+
+ /* If we've already dealt with it, ignore */
+
+ if (strcmp(raw_whatis, base_name) == 0)
+ return 0;
+
+ if (debug)
+ fprintf(stderr, "raw_w = %s\n", raw_whatis);
+ ret = dbstore(info, raw_whatis);
+ if (ret > 0)
+ return ret;
+
+ return 0;
+}
+
+/* take absolute filename and path (for ult_src) and do sanity checks on
+ file. Also check that file is non zero in length and is not already in
+ the db. If not, find it's ult_src() and see if we have the whatis cached,
+ otherwise cache it incase we trace another manpage back to it. Next, store
+ it in the db along with any references found in the whatis. */
+void test_manfile(char *file, const char *path)
+{
+ char *base_name, *othername, *ult, *sep;
+ struct lexgrog lg;
+ char *manpage;
+ struct mandata info, *exists;
+ struct nlist *in_cache;
+ struct stat buf;
+
+#ifdef COMP_SRC
+ struct compression *comp;
+ size_t len;
+#endif /* COMP_SRC */
+
+ memset( &lg, '\0', sizeof(struct lexgrog));
+ manpage = xstrdup(file);
+ base_name = basename(manpage);
+
+ /* Bogus files either have (i) no period, ie no extension, (ii)
+ a compression extension, but no sectional extension, (iii)
+ a missmatch between the section they are under and the
+ sectional part of their extension. */
+
+#ifdef COMP_SRC
+ if ( (comp = comp_info(base_name)) ) {
+ info.comp = comp->ext;
+ *(comp->file) = '\0'; /* to strip the comp ext */
+ } else
+ info.comp = NULL;
+
+ len = strlen(manpage);
+#else /* !COMP_SRC */
+ info.comp = NULL;
+#endif /* COMP_SRC */
+
+ if ( !(info.ext = strrchr(base_name, '.'))) {
+
+ /* no section extension */
+ gripe_bogus_manpage(file);
+ free(manpage);
+ return;
+ }
+
+ *(info.ext++) = '\0'; /* set section ext */
+ *(base_name - 1) = '\0'; /* strip '/base_name' */
+ info.sec = strrchr(manpage, '/') + 4; /* set section name */
+
+ if (strncmp(info.sec, info.ext, strlen(info.sec)) != 0) {
+
+ /* missmatch in extension */
+ gripe_bogus_manpage(file);
+ free(manpage);
+ return;
+ }
+
+ /* to get mtime info */
+ (void) lstat(file, &buf);
+ info._st_mtime = buf.st_mtime;
+
+ /* check that our file actually contains some data */
+ if (buf.st_size == 0) {
+ /* man_db pre 2.3 place holder ? */
+ free(manpage);
+ return;
+ }
+
+ /* see if we already have it, before going any further, this will
+ save both an ult_src() a find_name(), amongst other time wastes */
+ exists = dblookup_exact(base_name, info.ext);
+
+ /* Ensure we really have the actual page. Gzip keeps the mtime
+ the same when it compresses, so we have to compare comp
+ extensions also */
+
+ if (exists) {
+ if (strcmp(exists->comp, info.comp ? info.comp : "-") == 0) {
+ if (exists->_st_mtime == info._st_mtime
+ && exists->id < WHATIS_MAN) {
+ free_mandata_struct(exists);
+ free(manpage);
+ return;
+ }
+ } else {
+ struct stat physical;
+
+ /* see if the cached file actually exists. It's
+ evident at this point that we have multiple
+ comp extensions */
+ if (debug)
+ fprintf(stderr, "test_manfile(): stat %s\n",
+ make_filename(path, base_name, exists, "man"));
+ if (stat(make_filename(path, base_name, exists, "man"),
+ &physical) == -1) {
+ if ( ! opt_test )
+ dbdelete(base_name, exists);
+ } else {
+ gripe_multi_extensions(path, exists->sec,
+ base_name, exists->ext);
+ free_mandata_struct(exists);
+ free(manpage);
+ return;
+ }
+ }
+ free_mandata_struct(exists);
+ }
+
+ /* Trace the file to its ultimate source, else we'll be looking
+ for whatis info in files containing only '.so manx/foo.x', which
+ will give us an unobtainable whatis for the entry. */
+ ult = ult_src(file, path, &buf, SO_LINK | SOFT_LINK | HARD_LINK);
+
+ if (!ult) {
+ error (0, 0, _( "warning: %s: bad symlink or ROFF `.so' request"), file);
+ free(manpage);
+ return;
+ }
+
+ pages++; /* pages seen so far */
+ info.pointer = NULL; /* we have a direct page (so far) */
+
+#ifdef COMP_SRC
+ if (strncmp(ult, file, len) == 0)
+#else /* not COMP_SRC */
+ if (strcmp(ult, file) == 0)
+#endif /* COMP_SRC */
+
+ info.id = ULT_MAN; /* ultimate source file */
+ else
+ info.id = SO_MAN; /* .so, sym or hard linked file */
+
+ /* Ok, here goes: Use a hash tree to store the ult_srcs with
+ their whatis. Anytime after, check the hash tree, if it's there,
+ use it. This saves us a find_name() which is a real hog */
+
+ /* could use strrchr(ult, '/') + 1 as hash text, but not worth it */
+
+ in_cache = lookup(ult);
+
+ if (in_cache) { /* cache hit */
+ lg.whatis = in_cache->defn ? xstrdup(in_cache->defn) : NULL;
+ } else { /* cache miss */
+ /* go get the whatis info in its raw state */
+#ifdef COMP_SRC
+ /* if the nroff was compressed, an uncompressed version is
+ shown by a call to get_ztemp(), grog this for a whatis
+ rather than ult. This is a bit difficult to follow, sorry:
+ ult_src() will leave the last uncompressed nroff file it
+ has to deal with in get_ztemp() */
+ char *ztemp;
+
+ lg.type = MANPAGE;
+ if ( (ztemp = get_ztemp()) ) {
+ find_name(ztemp, basename(file), &lg);
+ remove_ztemp(); /* get rid of temp file identifier */
+ } else
+#endif /* COMP_SRC */
+ find_name(ult, basename(file), &lg);
+
+ install_text(ult, lg.whatis);
+ }
+
+ if (debug)
+ fprintf(stderr, "\"%s\"\n", lg.whatis);
+
+ /* split up the raw whatis data and store references */
+ info.filter = lg.filters;
+ if (lg.whatis) {
+ char save_id = info.id;
+ info.id = WHATIS_MAN;
+ while ((sep = strrchr(lg.whatis, 0x11))) {
+ *(sep++) = '\0';
+ othername = xstrdup(sep);
+ *(othername + strcspn(othername, " -")) = '\0';
+ if ( ! opt_test )
+ splitline(sep, &info, othername);
+ free(othername);
+ }
+ info.id = save_id;
+ } else {
+ (void) lstat(ult, &buf);
+ if (buf.st_size == 0) {
+ if (quiet < 2)
+ error (0, 0, _( "warning: %s: ignoring empty file"), ult);
+ free(manpage);
+ return;
+ }
+ if (quiet < 2)
+ error (0, 0, _( "warning: %s: whatis parse for %s(%s) failed"),
+ ult, base_name, info.ext);
+ }
+ if ( ! opt_test )
+ if (splitline(lg.whatis, &info, base_name) == 1)
+ gripe_multi_extensions(path, info.sec, base_name, info.ext);
+
+ free(manpage);
+ if (lg.whatis)
+ free(lg.whatis);
+}
+
+static __inline__ void add_dir_entries(const char *path, char *infile)
+{
+ char *manpage;
+ int len;
+ struct dirent *newdir;
+ DIR *dir;
+
+ manpage = strappend(NULL, path, "/", infile, "/", NULL);
+ len = strlen(manpage);
+
+ /*
+ * All filename entries in this dir should either be valid manpages
+ * or . files (such as current, parent dir).
+ */
+
+ if ( !(dir = opendir(infile)) ) {
+ error (0, errno, _( "can't search directory %s"), manpage);
+ free(manpage);
+ return;
+ }
+
+ /* strlen(newdir->d_name) could be replaced by newdir->d_reclen */
+
+ while ( (newdir = readdir(dir)) )
+ if ( !(*newdir->d_name == '.' &&
+ strlen(newdir->d_name) < (size_t) 3) ) {
+ manpage = strappend(manpage, newdir->d_name, NULL);
+ test_manfile(manpage, path);
+ *(manpage + len) = '\0';
+ }
+
+ free(manpage);
+ closedir(dir);
+}
+
+/*
+ * accepts the raw man dir tree eg. "/usr/man" and the time stored in the db
+ * any dirs of the tree that have been modified (ie added to) will then be
+ * scanned for new files, which are then added to the db.
+ */
+static short testmandirs(const char *path, time_t last)
+{
+ DIR *dir;
+ struct dirent *mandir;
+ struct stat stbuf;
+ short amount = 0;
+
+ if (debug)
+ fprintf(stderr, "Testing %s for new files\n", path);
+
+ if ( !(dir = opendir(path)) ) {
+ error (0, errno, _( "can't search directory %s"), path);
+ return 0;
+ }
+
+ chdir(path);
+
+ while( (mandir = readdir(dir)) ) {
+ if ( strncmp(mandir->d_name, "man", 3) != 0 )
+ continue;
+
+ if ( stat(mandir->d_name, &stbuf) == 0
+ && (stbuf.st_mode&S_IFDIR) && stbuf.st_mtime > last) {
+
+ if (debug)
+ fprintf(stderr,
+ "\tsubdirectory %s has been 'modified'\n",
+ mandir->d_name);
+
+ if ( (dbf = MYDBM_RWOPEN(database)) == NULL) {
+ /* rwopen(database); */
+#ifdef MAN_DB_UPDATES
+ if (!quiet)
+#endif /* MAN_DB_UPDATES */
+ error (0, errno, _( "can't update index cache %s"), database);
+ return 0;
+ }
+
+ if (! quiet) {
+ fprintf(stderr, "\r");
+ fprintf(stderr, _( "Updating index cache for path `%s'. Wait..."), path);
+ }
+ add_dir_entries(path, mandir->d_name);
+ MYDBM_CLOSE(dbf);
+ amount++;
+ }
+ }
+ closedir(dir);
+
+ /* clean out the whatis hashtable for new hierarchy */
+ if (amount > 0)
+ free_hashtab();
+
+ return amount;
+}
+
+/* update the time key stored within `database' */
+void update_db_time(void)
+{
+ datum key, content;
+#ifdef FAST_BTREE
+ datum key1, content1;
+#endif /* FAST_BTREE */
+
+ key.dptr = KEY;
+ key.dsize = sizeof KEY;
+ content.dptr = (char *) xmalloc(16); /* 11 is max long with '\0' */
+ sprintf(content.dptr, "%ld", (long)time(NULL));
+ content.dsize = strlen(content.dptr) + 1;
+
+ /* Open the db in RW to store the $mtime$ ID */
+ /* we know that this should succeed because we just updated the db! */
+ if ( (dbf = MYDBM_RWOPEN(database)) == NULL) {
+#ifdef MAN_DB_UPDATES
+ if (!quiet)
+#endif /* MAN_DB_UPDATES */
+ error (0, errno, _( "can't update index cache %s"), database);
+ free(content.dptr);
+ return;
+ }
+#ifndef FAST_BTREE
+ MYDBM_REPLACE(dbf, key, content);
+#else /* FAST_BTREE */
+ key1.dptr = KEY;
+ key1.dsize = sizeof KEY;
+
+ (dbf->seq)(dbf, (DBT *) &key1, (DBT *) &content1, R_CURSOR);
+
+ if (strcmp(key1.dptr, key.dptr) == 0)
+ (dbf->put)(dbf, (DBT *) &key, (DBT *) &content, R_CURSOR);
+ else
+ (dbf->put)(dbf, (DBT *) &key, (DBT *) &content, 0);
+#endif /* !FAST_BTREE */
+
+ MYDBM_CLOSE(dbf);
+ free(content.dptr);
+}
+
+/* remove the db's time key - called prior to update_db if we want
+ to `force' a full consistency check */
+void reset_db_time(void)
+{
+ datum key;
+
+ key.dptr = KEY;
+ key.dsize = sizeof KEY;
+
+ /* we don't really care if we can't open it RW - it's not fatal */
+ if ( (dbf = MYDBM_RWOPEN(database)) == NULL) {
+ if (debug) {
+ fprintf(stderr, "reset_db_time(): ");
+ perror("can't open db");
+ }
+ return;
+ }
+
+ MYDBM_DELETE(dbf, key);
+ if (debug)
+ fprintf(stderr, "reset_db_time()\n");
+ MYDBM_CLOSE(dbf);
+}
+
+/* routine to prepare/create the db prior to calling testmandirs() */
+short create_db(const char *manpath)
+{
+ short amount;
+
+ if (debug)
+ fprintf(stderr, "create_db(%s): %s\n", manpath, database);
+
+ /* Open the db in CTRW mode to store the $ver$ ID */
+
+ if ( (dbf = MYDBM_CTRWOPEN(database)) == NULL) {
+ error (0, errno, _( "can't create index cache %s"), database);
+ return 0;
+ /* should really return EOF */
+ }
+
+ dbver_wr(dbf);
+ MYDBM_CLOSE(dbf);
+
+ amount = testmandirs(manpath, (time_t) 0);
+
+ if (amount) {
+ update_db_time();
+ if (! quiet)
+ fputs(_( "done.\n"), stderr);
+ }
+
+ return amount;
+}
+
+/* routine to update the db, ensure that it is consistent with the
+ filesystem */
+short update_db(const char *manpath)
+{
+ if ( (dbf = MYDBM_RDOPEN(database)) && !dbver_rd(dbf)) {
+ datum key, content;
+ short new;
+
+ key.dptr = KEY;
+ key.dsize = sizeof KEY;
+ content = MYDBM_FETCH(dbf, key);
+ MYDBM_CLOSE(dbf);
+
+ if (debug)
+ fprintf(stderr, "update_db(): %ld\n", content.dptr ?
+ atol(content.dptr) :
+ 0L);
+ if (content.dptr) {
+ new = testmandirs(manpath, (time_t) atol(content.dptr) );
+ MYDBM_FREE(content.dptr);
+ } else
+ new = testmandirs(manpath, (time_t) 0);
+
+ if (new) {
+ update_db_time();
+ if (!quiet)
+ fputs(_( "done.\n"), stderr);
+ }
+
+ return new;
+ }
+
+ if (debug)
+ fprintf(stderr, "failed to open %s O_RDONLY\n", database);
+
+ return EOF;
+}
diff --git a/src/compression.c b/src/compression.c
new file mode 100644
index 00000000..5c64a9f1
--- /dev/null
+++ b/src/compression.c
@@ -0,0 +1,192 @@
+/*
+ * compression.c: code to find decompressor / compression extension
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * Sat Aug 20 15:01:02 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <stdio.h>
+#include <errno.h>
+#include <signal.h>
+
+#if defined(STDC_HEADERS)
+# include <string.h>
+# include <stdlib.h>
+#elif defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#else /* no string(s) header */
+#endif /* STDC_HEADERS */
+
+#ifndef STDC_HEADERS
+extern int errno;
+#endif
+
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <libintl.h>
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+#ifdef COMP_SRC /* must come after manconfig.h */
+
+#include "lib/error.h"
+#include "comp_src.h"
+
+static char *file; /* pointer to temp file name */
+static int file_fd= -1;
+
+/* initialise temp filename */
+static __inline__ void create_ztemp(void)
+{
+ int oldmask=umask(022);
+ drop_effective_privs();
+ errno = 0; /* failing tempnam() might fail to set errno */
+ file = tempnam(NULL, "zman");
+
+ if (file) {
+ unlink( file); /* remove a malicious dangling symlink */
+ file_fd = open(file, O_WRONLY|O_CREAT|O_EXCL, 0644);
+ }
+
+ if (!file || (file_fd < 0))
+ error (FATAL, errno, _( "can't create a temporary filename"));
+ regain_effective_privs();
+ umask(oldmask);
+ atexit( remove_ztemp);
+}
+
+/* Take filename as arg, return structure containing decompressor
+ and extension, or NULL if no comp extension found.
+ As an added bonus, return address of comp extension in comp->file
+ as this is otherwise unused.
+
+ eg.
+ filename = /usr/man/man1/foo.1.gz
+
+ comp->prog = "/usr/bin/gzip -dc";
+ comp->ext = "gz";
+ comp->file = filename + 19;
+ */
+struct compression *comp_info(char *filename)
+{
+ char *ext;
+ static char buff[10];
+ static struct compression hpux_comp = {GUNZIP " -S \"\"", "", buff};
+
+ ext = strrchr(filename, '.');
+
+ if (ext) {
+ struct compression *comp;
+ ext++;
+ for (comp = comp_list; comp->ext; comp++) {
+ if (strcmp(comp->ext, ext) == 0) {
+ comp->file = --ext;
+ return comp;
+ }
+ }
+ }
+ ext = strstr(filename, ".Z/");
+ if (ext) return &hpux_comp;
+ return NULL;
+}
+
+/* take filename w/o comp ext. as arg, return comp->file as a relative
+ compressed file or NULL if none found */
+struct compression *comp_file(char *filename)
+{
+ size_t len;
+ char *compfile;
+ struct compression *comp;
+
+ compfile = strappend(NULL, filename, ".", NULL);
+ len = strlen(compfile);
+
+ for (comp = comp_list; comp->ext; comp++) {
+ struct stat buf;
+
+ compfile = strappend(compfile, comp->ext, NULL);
+
+ if (stat(compfile, &buf) == 0) {
+ comp->file = compfile;
+ return comp;
+ }
+
+ *(compfile + len) = '\0';
+ }
+ return NULL;
+}
+
+/* set up a pointer to a unique temp filename on first call */
+char *decompress(char *filename, struct compression *comp)
+{
+ char *command;
+ int status;
+#ifndef debug
+ int save_debug = debug;
+#endif
+
+ if (!file)
+ create_ztemp();
+
+ /* temporarily drop the debug flag, so that we can continue */
+ command = strappend(NULL, comp->prog, " ", filename,
+ " > ", file, NULL);
+
+ if (debug) {
+#ifdef SECURE_MAN_UID
+ fputs("The following command done with dropped privs\n", stderr);
+#endif /* SECURE_MAN_UID */
+ fprintf(stderr, "%s\n", command);
+ }
+
+#ifndef debug
+ debug = 0;
+#endif
+ status = do_system_drop_privs (command);
+
+#ifndef debug
+ debug = save_debug;
+#endif
+
+ free(command);
+
+ if (status) {
+ (void) remove_with_dropped_privs(file);
+ exit (CHILD_FAIL);
+ }
+ return file;
+}
+
+/* remove temporary file, drop privs if necessary */
+void remove_ztemp(void)
+{
+ if (file) {
+ close( file_fd);
+ (void) remove_with_dropped_privs(file);
+ free(file); file = NULL;
+ }
+}
+
+/* return temporary filename */
+char *get_ztemp(void)
+{
+ return (file ? file : NULL);
+}
+#endif /* COMP_SRC */
diff --git a/src/convert_name.c b/src/convert_name.c
new file mode 100644
index 00000000..9403a8ca
--- /dev/null
+++ b/src/convert_name.c
@@ -0,0 +1,94 @@
+/*
+ * convert_name.c
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * code to do appropriate pathname conversion
+ *
+ * Mon May 2 11:14:28 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#if defined(STDC_HEADERS)
+# include <string.h>
+# include <stdlib.h>
+#elif defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#else /* no string(s) header */
+#endif /* STDC_HEADERS */
+
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#include <stdio.h>
+
+#include <libintl.h>
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+#include "lib/error.h"
+#include "manp.h"
+
+static __inline__ void gripe_converting_name (char *name)
+{
+ error (FATAL, 0, _( "Can't convert %s to cat name"), name);
+}
+
+/* derive the catpage path for manpage 'name'. If alternate is not NULL, use
+ its value as the catpath dir. */
+char *convert_name (char *name, char *alternate)
+{
+ char *to_name, *t1 = NULL;
+ char *t2 = NULL;
+#ifdef COMP_SRC
+ struct compression *comp;
+#endif /* COMP_SRC */
+
+ /* we already checked that there is an alternate catdir */
+ if (alternate)
+ name = alternate;
+
+#ifdef COMP_SRC
+ if ( (comp = comp_info(name)) )
+ *comp->file = '\0';
+#endif /* COMP_SRC */
+
+#ifdef COMP_CAT
+ to_name = strappend(NULL, name, "." COMPRESS_EXT, NULL);
+#else /* !COMP_CAT */
+ to_name = xstrdup (name);
+#endif /* COMP_CAT */
+
+ if ( (t1 = strrchr (to_name, '/')) ) {
+
+ *t1 = '\0';
+
+ if ((t2 = strrchr (to_name, '/')) == NULL)
+ gripe_converting_name (name);
+
+ *t1 = '/';
+ *(t2 + 1) = 'c';
+ *(t2 + 3) = 't';
+ } else
+ gripe_converting_name (name);
+
+ if (0) /* (debug) */
+ fprintf (stderr, "to_name in convert_name () is %s\n", to_name);
+
+#ifdef COMP_SRC
+ if (comp)
+ *comp->file = '.';
+#endif /* COMP_SRC */
+ return to_name;
+}
+
diff --git a/src/fake_security.c b/src/fake_security.c
new file mode 100644
index 00000000..ab4e1aaf
--- /dev/null
+++ b/src/fake_security.c
@@ -0,0 +1,39 @@
+/*
+ * fake_security.c: fake routines for non setuid programs
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * 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 <stdio.h>
+
+#include "manconfig.h"
+
+void drop_effective_privs (void)
+{
+ /* do nothing */
+}
+
+void regain_effective_privs (void)
+{
+ /* do nothing */
+}
+
+int remove_with_dropped_privs(const char *filename)
+{
+ return remove(filename);
+}
+
+int do_system_drop_privs (const char *command)
+{
+ return do_system (command);
+}
diff --git a/src/globbing.c b/src/globbing.c
new file mode 100644
index 00000000..d5a01418
--- /dev/null
+++ b/src/globbing.c
@@ -0,0 +1,161 @@
+/*
+ * globbing.c: interface to the POSIX glob routines
+ *
+ * Copyright (C), 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * Mon Mar 13 20:27:36 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <stdio.h>
+
+#if defined(STDC_HEADERS)
+# include <string.h>
+# include <stdlib.h>
+#elif defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#else /* no string(s) header */
+extern char *strrchr();
+#endif /* STDC_HEADERS */
+
+#include <ctype.h>
+
+#ifdef HAVE_GLOB_H
+# include <glob.h>
+#else
+# include "lib/glob.h"
+#endif
+
+#include "manconfig.h"
+#include "lib/error.h"
+
+extern char *extension;
+
+#ifdef TEST
+char *program_name, *extension;
+int debug = 1;
+#endif
+
+static __inline__ char *end_pattern(char *pattern, const char *sec)
+{
+ if (extension)
+ pattern = strappend(pattern, ".*", extension, "*", NULL);
+ else
+ pattern = strappend(pattern, ".", sec, "*", NULL);
+
+ return pattern;
+}
+
+char **look_for_file (char *path, char *sec, char *name, int cat)
+{
+ char *pattern = NULL;
+ static glob_t gbuf;
+ int status;
+
+ /* As static struct is allocated and contains NULLS we don't need
+ to check it before attempting a free. Let globfree() do that */
+
+ globfree(&gbuf);
+
+ /* globbing is obsolete. This routine only does a minumum amount
+ of matching. It does not find cat files in the alternate cat
+ directory. */
+
+ /* allow lookups like "3x foo" to match "../man3/foo.3x" */
+
+ if (isdigit(*sec) && sec[1] != '\0') {
+ pattern = strappend(pattern, path, cat ? "/cat" : "/man",
+ "\t/", name, NULL);
+
+ *strrchr(pattern, '\t') = *sec;
+ pattern = end_pattern(pattern, sec);
+ if (debug)
+ fprintf(stderr, "globbing pattern: %s\n", pattern);
+ status = glob(pattern, 0, NULL, &gbuf);
+ } else
+ status = 1;
+
+ /* AIX glob.h doesn't define GLOB_NOMATCH and the manpage is vague
+ regarding return status if there are no matches so check the
+ path count member also */
+
+ if (status != 0 || gbuf.gl_pathc == 0) {
+ if (pattern)
+ *pattern = '\0';
+ pattern = strappend(pattern, path, cat ? "/cat" : "/man",
+ sec, "/", name, NULL);
+
+ pattern = end_pattern(pattern, sec);
+ if (debug)
+ fprintf(stderr, "globbing pattern: %s\n", pattern);
+ status = glob(pattern, 0, NULL, &gbuf);
+ }
+
+ /* Try HPUX style compressed man pages */
+ if (status != 0 || gbuf.gl_pathc == 0) {
+ *pattern = '\0';
+ pattern = strappend(pattern, path, cat ? "/cat" : "/man",
+ sec, ".Z/", name, NULL);
+
+ pattern = end_pattern(pattern, sec);
+ if (debug)
+ fprintf(stderr, "globbing pattern: %s\n", pattern);
+ status = glob(pattern, 0, NULL, &gbuf);
+ }
+
+ /* Try man pages without the section extension --- IRIX man pages */
+ if (status != 0 || gbuf.gl_pathc == 0) {
+ *pattern = '\0';
+ pattern = strappend(pattern, path, cat ? "/cat" : "/man",
+ sec, "/", name, ".*", NULL);
+ if (debug)
+ fprintf(stderr, "globbing pattern: %s\n", pattern);
+ status = glob(pattern, 0, NULL, &gbuf);
+ }
+
+ /* Try Solaris style man page directories */
+ if (status != 0 || gbuf.gl_pathc == 0) {
+ *pattern = '\0';
+ pattern = strappend(pattern, path, cat ? "/cat" : "/man",
+ sec, "*/", name, NULL);
+ pattern = end_pattern(pattern, sec);
+ if (debug)
+ fprintf(stderr, "globbing pattern: %s\n", pattern);
+ status = glob(pattern, 0, NULL, &gbuf);
+ }
+
+ free(pattern);
+ return ( (status != 0 || gbuf.gl_pathc == 0) ?
+ (char **) NULL : gbuf.gl_pathv );
+
+}
+
+#ifdef TEST
+int main(int argc, char *argv[])
+{
+ int i;
+
+ program_name = xstrdup(basename(argv[0]));
+ if (argc != 4)
+ error(FAIL, 0, "usage: %s path sec name", program_name);
+
+ for (i = 0; i <= 1; i++) {
+ char **files;
+
+ files = look_for_file(argv[1], argv[2], argv[3], i);
+ if (files)
+ while (*files)
+ printf("%s\n", *files++);
+ }
+ return 0;
+}
+#endif /* TEST */
diff --git a/src/hashtable.c b/src/hashtable.c
new file mode 100644
index 00000000..771c75b0
--- /dev/null
+++ b/src/hashtable.c
@@ -0,0 +1,163 @@
+/*
+ * hashtable.c: in core hash table routines.
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * All of these routines except free_hashtable() 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 <stdio.h> /* only for printf() */
+
+#if defined(STDC_HEADERS)
+# include <string.h>
+# include <stdlib.h>
+#elif defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#else /* no string(s) header */
+#endif /* STDC_HEADERS */
+
+#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
+
+static struct nlist *hashtab[HASHSIZE]; /* The storage array */
+static int unique; /* unique hash values */
+static int identical; /* identical hash values */
+
+/* return hash value for string */
+static unsigned hash(char *s)
+{
+ unsigned hashval = 0;
+
+ while (*s)
+#if defined(KRII)
+ hashval = *s++ + 31 * hashval;
+ return hashval % HASHSIZE;
+#elif defined(PROLOGUE)
+ hashval = (hashval<<1) + *s++;
+ return hashval & (HASHSIZE - 1);
+#endif
+}
+
+/* return pointer to structure containing defn, else NULL if it
+ doesn't exist */
+struct nlist *lookup(char *s)
+{
+ struct nlist *np;
+
+ for (np = hashtab[hash(s)]; np; np = np->next) {
+ if (strcmp(s, np->name) == 0)
+ return np;
+ }
+ return NULL;
+}
+
+/* free the defn ptr's contents (if not NULL) */
+static __inline__ void free_defn(struct nlist *np)
+{
+ if (np->defn) {
+ if (np->is_text)
+ free(np->defn);
+ else
+ free_mandata_struct(np->defn);
+ }
+}
+
+/* return struct containing defn or NULL if unable to store */
+static struct nlist *install(char *name, void *defn, int flag)
+{
+ struct nlist *np;
+
+ if ((np = lookup(name)) == NULL) {
+ unsigned hashval;
+
+ np = (struct nlist *) xmalloc (sizeof(struct nlist));
+ np->name = xstrdup(name);
+ hashval = hash(name);
+
+ /* record uniqueness if debugging */
+ if (debug) {
+ if (hashtab[hashval])
+ identical++;
+ else
+ unique++;
+ }
+
+ /* point to last w/ this hash */
+ np->next = hashtab[hashval];
+
+ /* attach to hashtab array */
+ hashtab[hashval] = np;
+ } else
+ free_defn(np);
+
+ np->defn = defn;
+ np->is_text = flag;
+
+ return np;
+}
+
+/* special wrapper to insert a string or NULL */
+struct nlist *install_text(char *name, char *text)
+{
+ return install(name, text ? xstrdup(text) : text, 1);
+}
+
+/* special wrapper to insert a ptr to in core mandata struct linked list */
+struct nlist *install_db_ptr(char *name, struct mandata *db_ptr)
+{
+ return install(name, db_ptr, 0);
+}
+
+/* free up the hash tree (garbage collect), also free up any xstrdup()'d text
+ or mandata structures */
+void free_hashtab(void)
+{
+ int i;
+
+ if (debug) {
+ fprintf(stderr, "free_hashtab: %d entries, %d (%d%%) unique\n",
+ unique + identical,
+ unique, unique ? (unique * 100) / (unique + identical) : 0 );
+ unique = identical = 0;
+ }
+
+ for (i = 0; i < HASHSIZE; i++) {
+ struct nlist *np;
+
+ np = hashtab[i];
+ while (np) {
+ struct nlist *next;
+
+ free_defn(np);
+ free(np->name);
+ next = np->next;
+ free(np);
+ np = next;
+ }
+ hashtab[i] = NULL;
+ }
+}
diff --git a/src/hashtable.h b/src/hashtable.h
new file mode 100644
index 00000000..28077e77
--- /dev/null
+++ b/src/hashtable.h
@@ -0,0 +1,26 @@
+/*
+ * hashtable.h: contains struct nlist
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * Sat Aug 20 15:01:02 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#include "libdb/mydbm.h"
+#include "libdb/db_storage.h"
+
+struct nlist {
+ struct nlist *next; /* next in the chain */
+ char *name; /* the _name_ */
+ void *defn; /* the _definition_ */
+ int is_text; /* what did we store here ? */
+};
+
+extern struct nlist *lookup(char *s);
+extern __inline__ struct nlist *install_text(char *name, char *text);
+extern __inline__ struct nlist *install_db_ptr(char *name, struct mandata *db_ptr);
+extern void free_hashtab(void);
diff --git a/src/lexgrog.l b/src/lexgrog.l
new file mode 100644
index 00000000..3866f2b5
--- /dev/null
+++ b/src/lexgrog.l
@@ -0,0 +1,336 @@
+%{
+
+/*
+ * lexgrog.l: extract 'whatis' info from nroff man / formatted cat pages.
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * Wed Oct 12 18:46:11 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#undef PROFILE
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <errno.h>
+
+#ifndef STDC_HEADERS
+extern int errno;
+#endif
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#ifdef HAVE_STRING_H
+# include <string.h>
+#elif defined (HAVE_STRINGS_H)
+# include <strings.h>
+#endif /* HAVE_STRING_H */
+
+#include <libintl.h>
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+#include "lib/error.h"
+
+#define YY_READ_BUF_SIZE 1024
+#define MAX_NAME 2048
+
+#ifdef PROFILE
+static int ctr[YY_NUM_RULES];
+# define YY_USER_ACTION ++ctr[yy_act];
+#endif
+
+static void add_str_to_whatis(const char *string, size_t length);
+static void add_char_to_whatis(unsigned char c);
+static void newline_found(void);
+
+static char newname[MAX_NAME];
+static char *p_name, *fname;
+static char filters[MAX_FILTERS];
+
+#ifdef TEST
+#include <stdio.h>
+char *program_name = "lexgrog";
+#endif /* TEST */
+%}
+
+%option 8bit batch caseful never-interactive ecs meta-ecs
+%option nostdinit
+%option noyywrap nounput
+
+%x MAN_NAME
+%x CAT_NAME
+%x CAT_FILE
+%x MAN_FILE
+%x CAT_REST
+%x MAN_REST
+%x FORCE_EXIT
+
+digit [[:digit:]]
+upper [[:upper:]]
+alpha [[:alpha:]]
+blank [[:blank:]]
+blank_eol [[:blank:]\n]
+bol \n+
+next \n*
+dbl_quote \"
+font_change \\f([[:upper:]1-4]|\({upper}{2})
+size_change \\s[+-]?{digit}
+style_change ({font_change}{size_change}?|{size_change}{font_change}?)
+typeface \.(B[IR]?|I[BR]?|R[BI])
+sec_request \.[Ss][HhYySs]
+comment ['.]\\{dbl_quote}
+
+name (N[AaOo][Mm][Nn|Ee]|N[Oo][Mm]|N[Oo][Mm][Bb][Rr][Ee]|B[Ee][Zz][Ee][Ii][Cc][Hh][Nn][Uu][Nn][Gg])
+name_sec {dbl_quote}?{style_change}?{name}{style_change}?{dbl_quote}?
+
+ /* eptgrv : eqn, pic, tbl, grap, refer, vgrind */
+ /* no idea of how to detect grap or vgrind */
+tbl_request \.[Tt][Ss]
+eqn_request \.[Ee][Qq]
+pic_request \.[Pp][Ss][ 0-9.<]?
+ref1_request \.[Rr]1
+ref2_request \.\[
+
+%%
+
+ /* begin NAME section processing */
+<MAN_FILE>{sec_request}{blank_eol}+{name_sec}{blank}* BEGIN(MAN_NAME);
+<CAT_FILE>(\n{blank}*){2,}{name}{blank}*\n{blank}+ BEGIN(CAT_NAME);
+
+ /* general text matching */
+<MAN_FILE>\.[^Ss].*{next} |
+<MAN_FILE>\..{0,3}{dbl_quote}?.{0,4}{dbl_quote}? |
+<MAN_FILE>{comment}.*{next} |
+<CAT_FILE>.{1,9} |
+<CAT_FILE>[ ]* |
+<CAT_FILE>\n{2,} |
+<MAN_FILE,CAT_FILE>.|\n
+
+<MAN_REST>{
+ {bol}{tbl_request} filters[TBL_FILTER] = 't';
+ {bol}{eqn_request} filters[EQN_FILTER] = 'e';
+ {bol}{pic_request} filters[PIC_FILTER] = 'p';
+ {bol}{ref1_request} |
+ {bol}{ref2_request} filters[REF_FILTER] = 'r';
+}
+<MAN_REST><<EOF>> { /* exit */
+ *p_name = '\0'; /* terminate the string */
+ yyterminate();
+ }
+<MAN_REST>.|\n
+
+ /* rules to end NAME section processing */
+<FORCE_EXIT>.|\n { /* forced exit */
+ *p_name = '\0'; /* terminate the string */
+ yyterminate();
+ }
+
+<MAN_NAME>{bol}{sec_request}{blank}* | /* Another section */
+<MAN_NAME>{bol}\.X{upper}{blank}+ | /* special - hpux */
+<MAN_NAME>{bol}\.sp{blank}* | /* vertical spacing */
+<MAN_NAME>\n{blank}*{bol}.+ { /* terminate the string */
+ *p_name = '\0';
+ BEGIN(MAN_REST);
+ }
+
+<CAT_NAME>{bol}S[yYeE] |
+<CAT_NAME>\n{2,}.+ |
+<CAT_NAME>{next}__ { /* terminate the string */
+ *p_name = '\0';
+ BEGIN(CAT_REST);
+ yyterminate();
+ }
+
+ /* ROFF request removal */
+<MAN_NAME>{
+ {bol}{typeface}{blank}+ | /* type face commands */
+ {bol}\.IX{blank}.* | /* .IX line */
+ {bol}{comment}.* { /* per line comments */
+ newline_found();
+ }
+}
+
+<CAT_NAME>-\n[ \t\n]* /* strip continuations */
+
+ /* convert to DASH */
+<MAN_NAME>{next}{blank}*\\\((mi|hy|em){blank}* |
+<MAN_NAME>{next}[ \t\n]+[-\\]-{blank}* |
+<MAN_NAME>{next}[ \t\n]*[-\\]-{blank}+ |
+<CAT_NAME>{next}{blank}+-{1,2}[ \t\n]+ |
+<MAN_NAME>{bol}\.Nd{blank}* add_str_to_whatis(" - ", 3);
+
+ /* escape sequences and special characters */
+<MAN_NAME>{
+ {next}\\[\\e] add_char_to_whatis('\\');
+ {next}\\('|\(aa) add_char_to_whatis('\'');
+ {next}\\(`|\(ga) add_char_to_whatis('`');
+ {next}\\- add_char_to_whatis('-');
+ {next}\\\. add_char_to_whatis('.');
+ {next}((\\[ 0t])|[ ]|\t)* add_char_to_whatis(' ');
+ {next}\\\((ru|ul) add_char_to_whatis('_');
+ {next}\\\\t add_char_to_whatis('\t');
+
+ {next}\\[|^&!%acdpruz{}\n] /* various useless control chars */
+ {next}\\[bhlLvx]{blank}*'[^']+' /* various inline functions */
+
+ {next}\\\$[1-9] /* interpolate arg */
+
+ {next}\\\*(\({alpha})?{alpha} /* interpolate string */
+ {next}\\\({alpha}{alpha} /* special (non printable) character */
+ {next}\\\".* /* comment */
+
+ {next}{font_change} /* font changes */
+ {next}\\k{alpha} /* mark input place in register */
+
+ {next}\\n(\({alpha})?{alpha} /* interpolate number register */
+ {next}\\o\"[^"]+\" /* overstrike chars */
+
+ {next}{size_change} /* size changes */
+ {next}\\w{blank}*'[^']+'[^ \t]* /* width of string */
+
+ {next}\\ /* catch all */
+
+ {next}\(\\\|\){blank}* /* function() in hpux */
+}
+
+ /* collapse spaces, escpaed spaces, tabs, newlines to a single space */
+<CAT_NAME>{next}((\\[ ])|{blank})* add_char_to_whatis(' ');
+
+ /* a ROFF break request (.br) usually means we have multiple
+ whatis definitions, provide a separator for later processing */
+<MAN_NAME>{bol}\.br{blank}* add_char_to_whatis((char) 0x11);
+<MAN_NAME>{bol}\.{alpha}{2}{blank}* { /* very general roff requests */
+ newline_found();
+ }
+
+ /* pass words as a chunk. speed optimization */
+<MAN_NAME>[[:alnum:]]* add_str_to_whatis(yytext, yyleng);
+
+ /* normalise the period (,) separators */
+<CAT_NAME>{blank}*,[ \t\n]* |
+<MAN_NAME>{blank}*,{blank}* add_str_to_whatis(", ", 2);
+
+<CAT_NAME,MAN_NAME>{bol}. {
+ newline_found();
+ add_char_to_whatis(yytext[yyleng - 1]);
+ }
+
+<CAT_NAME,MAN_NAME>. add_char_to_whatis(*yytext);
+
+ /* default EOF rule */
+<<EOF>> return 1;
+
+%%
+
+/* print warning and force scanner to terminate */
+static void too_big(void)
+{
+ error(0, 0, _( "warning: whatis for %s exceeds %d bytes, truncating."), fname, MAX_NAME);
+
+ BEGIN(FORCE_EXIT);
+}
+
+/* append a string to newname if enough room */
+static void add_str_to_whatis(const char *string, size_t length)
+{
+ if (p_name - newname + length >= MAX_NAME) {
+ too_big();
+ } else {
+ (void) strncpy(p_name, string, length);
+ p_name += length;
+ }
+}
+
+/* append a char to newname if enough room */
+static void add_char_to_whatis(unsigned char c)
+{
+ if (p_name - newname + 1 >= MAX_NAME)
+ too_big();
+ else
+ *p_name++ = c;
+}
+
+static void newline_found(void)
+{
+/* If we are mid p_name and the last added char was not a space, best add one */
+ if (p_name != newname && *(p_name - 1) != ' ')
+ add_char_to_whatis(' ');
+}
+
+int find_name( char *file, char *filename, lexgrog *p_lg)
+{
+ int ret;
+
+ if ( (yyin = fopen(file, "r")) == NULL) {
+ error (0, errno, _( "can't open %s"), file);
+ return 0;
+ }
+
+ fname = filename;
+ *(p_name = newname) = '\0';
+ memset( filters, '_', sizeof(filters));
+
+ if (p_lg->type)
+ BEGIN(CAT_FILE);
+ else
+ BEGIN(MAN_FILE);
+
+ yyrestart(yyin);
+ ret = yylex();
+ fclose(yyin);
+
+ if (ret)
+ return 0;
+ else {
+ char f_tmp[MAX_FILTERS];
+ int j,k;
+
+ /* wipe out any initial spaces */
+ for (p_name = newname; *p_name == ' '; p_name++);
+ p_lg->whatis = xstrdup( p_name);
+ memset( f_tmp, '\0', MAX_FILTERS); f_tmp[0] = '-';
+ for ( p_lg->filters=0,j=k=0; j<MAX_FILTERS; j++ )
+ if ( filters[j] != '_' )
+ f_tmp[k++] = filters[j];
+ p_lg->filters = xstrdup( f_tmp);
+ return p_name[0];
+ }
+}
+
+#ifdef TEST
+int main(int argc, char **argv)
+{
+ if (argc > 1)
+ while (*++argv) {
+ printf("man: \"%s\"\n", find_name(*argv, "-", 0));
+ printf("cat: \"%s\"\n", find_name(*argv, "-", 1));
+ }
+ return 0;
+}
+#endif
+
+#ifdef PROFILE
+void rule_profile(void)
+{
+ int i, tot = 0;
+
+ printf("found NAME in %d man, %d cat pages\n", ctr[1], ctr[2]);
+ for (i = 3; i <= YY_NUM_RULES; i++)
+ if (ctr[i]) {
+ printf("rule[%d]: %d\n", i, ctr[i]);
+ tot += ctr[i];
+ }
+ printf("Total rules executed: %d\n", tot);
+}
+#else
+void rule_profile(void){}
+#endif
diff --git a/src/lexgrog.l-2.3.8 b/src/lexgrog.l-2.3.8
new file mode 100644
index 00000000..10f7820d
--- /dev/null
+++ b/src/lexgrog.l-2.3.8
@@ -0,0 +1,239 @@
+%{
+
+/*
+ * lexgrog.l: extract 'whatis' info from nroff man / formatted cat pages.
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * Wed Oct 12 18:46:11 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <errno.h>
+
+#ifndef STDC_HEADERS
+extern int errno;
+#endif
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#ifdef HAVE_STRING_H
+# include <string.h>
+#elif defined (HAVE_STRINGS_H)
+# include <strings.h>
+#endif /* HAVE_STRING_H */
+
+#define NLS_SET lexgrogSet
+#include "nls/nls.h"
+
+#ifdef NLS
+nl_catd catfd;
+#endif /* NLS */
+
+#include "manconfig.h"
+#include "lib/error.h"
+
+#define YY_READ_BUF_SIZE 1024
+#define MAX_NAME 2048
+
+static void add_str_to_whatis(const char *string, size_t length);
+static void add_char_to_whatis(const unsigned char c);
+static void newline_found(void);
+
+#ifdef TEST
+#include <stdio.h>
+char *program_name = "lexgrog";
+#endif /* TEST */
+%}
+
+%x man_name
+%x cat_name
+%x cat_file
+%x man_file
+%x force_exit
+
+ char newname[MAX_NAME];
+ char *p_name, *fname;
+ int cat;
+
+NAME N[AaOo][Mm][EeNn]
+MANNAME \"?(\\f[PRIB0123])?{NAME}(\\f[PRIB0123])?\"?
+W [ \t]
+
+%%
+ if ( cat )
+ BEGIN(cat_file);
+ else
+ BEGIN(man_file);
+
+ /* begin NAME section processing */
+<man_file>\.[Ss][HhYySs]{W}+{MANNAME}{W}* BEGIN(man_name);
+<man_file>\.RH.* BEGIN(man_name);
+<cat_file>(\n{W}*){2,}{NAME}{W}*\n{W}+ BEGIN(cat_name);
+
+ /* general text matching */
+<man_file>\.[^RSs].*\n* | /* large chunk rejection */
+<man_file>\..{0,3}\"?.{0,4}\"? | /* large chunk rejection */
+<cat_file>.{1,9} | /* catch all */
+<cat_file>[ ]* |
+<cat_file>\n{2,} |
+<man_file,cat_file>.|\n
+
+ /* default EOF rule */
+<<EOF>> return 1;
+
+ /* rules to end NAME section processing */
+<force_exit>.|\n | /* forced exit */
+<man_name>\n+\.[Ss][HhYS]{W}* | /* Another section */
+<man_name>\n+\.IX{W}+ | /* index request */
+<cat_name>\n+S[yYeE] |
+<cat_name>\n{2,}.+ |
+<man_name>\n{W}*\n+.+ |
+<cat_name>\n*__ { /* terminate the string */
+ *p_name = '\0';
+ yyterminate();
+ }
+
+ /* ROFF macro removal & per line comments */
+<man_name>\n+\.B[IR]?{W}+ | /* type face commands */
+<man_name>\n+\.I[BR]?{W}+ | /* type face commands */
+<man_name>\n+[.']\\\".* newline_found();
+
+<man_name>\n*\\f[PRIB0123] /* font changes */
+<man_name>\n*\\s[-+0-9]* /* size changes */
+<man_name>\n*\\\*(\(.)?. /* *roff strings */
+<man_name>\n*\\\& /* \& */
+<man_name>\n*\" /* string literal */
+
+<cat_name>-\n[ \t\n]* /* get rid of continuations */
+
+ /* convert to DASH */
+<man_name>\n*{W}*\\\((mi|hy|em){W}* |
+<man_name>\n*[ \t\n]+[-\\]-{W}* |
+<cat_name>\n*{W}+-{1,2}[ \t\n]+ |
+<man_name>\n+\.Nd{W}* add_str_to_whatis(" - ", 3);
+
+ /* convert to UNDERSCORE */
+<man_name>\n*\\\((ru|ul) add_char_to_whatis('_');
+
+ /* collapse spaces, escaped spaces, tabs, newlines to a single space */
+<cat_name,man_name>\n*((\\[ ])|[ ]|\t)* add_char_to_whatis(' ');
+
+ /* a ROFF break request (.br) usually means we have multiple
+ whatis definitions, provide a separator for later processing */
+<man_name>\n+\.br{W}* add_char_to_whatis((char) 0x11);
+
+ /* very general *roff macros */
+<man_name>\n+\.[A-Za-z]{2}{W}* newline_found();
+
+ /* pass words as a chunk. speed optimization */
+<man_name>[A-Za-z0-9]* add_str_to_whatis(yytext, yyleng);
+
+ /* normalise the period (,) separators */
+<cat_name>{W}*,[ \t\n]* |
+<man_name>{W}*,{W}* add_str_to_whatis(", ", 2);
+
+<cat_name,man_name>\n+. {
+ newline_found();
+ add_char_to_whatis(yytext[yyleng - 1]);
+ }
+
+<cat_name,man_name>. add_char_to_whatis(*yytext);
+
+%%
+
+/* print warning and force scanner to terminate */
+static void too_big(void)
+{
+ error(0, 0,
+ CATGETS(lexgrog_TOOBIG,
+ "warning: whatis for %s exceeds %d bytes, truncating."),
+ fname, MAX_NAME);
+
+ BEGIN(force_exit);
+}
+
+/* append a string to newname if enough room */
+static void add_str_to_whatis(const char *string, size_t length)
+{
+ if (p_name - newname + length >= MAX_NAME) {
+ too_big();
+ } else {
+ (void) strncpy(p_name, string, length);
+ p_name += length;
+ }
+}
+
+/* append a char to newname if enough room */
+static void add_char_to_whatis(const unsigned char c)
+{
+ if (p_name - newname + 1 >= MAX_NAME)
+ too_big();
+ else
+ *p_name++ = c;
+}
+
+static void newline_found(void)
+{
+/* If we are mid p_name and the last added char was not a space, best add one */
+ if (p_name != newname && *(p_name - 1) != ' ')
+ add_char_to_whatis(' ');
+}
+
+char *find_name(char *file, char *filename, short catfile)
+{
+ static int first = 1;
+ int ret;
+
+ if ( (yyin = fopen(file, "r")) == NULL) {
+ error (0, errno,
+ CATGETS(lexgrog_OPEN, "can't open %s"), file);
+ return NULL;
+ }
+ fname = filename;
+ *(p_name = newname) = '\0';
+ cat = (int) catfile;
+
+ if (first)
+ first = 0;
+ else
+ yyrestart(yyin);
+
+ ret = yylex();
+ fclose(yyin);
+
+ if (ret)
+ return NULL;
+ else {
+ /* wipe out any initial spaces */
+ for (p_name = newname; *p_name == ' '; p_name++);
+ return xstrdup(p_name);
+ }
+}
+
+#ifdef TEST
+int main(int argc, char **argv)
+{
+ if (argc > 1)
+ while (*++argv) {
+ printf("man: \"%s\"\n", find_name(*argv, "-", 0));
+ printf("cat: \"%s\"\n", find_name(*argv, "-", 1));
+ }
+ return 0;
+}
+#endif
+
+/* for compatibility with systems not having libfl */
+int yywrap(void)
+{
+ return 1;
+}
diff --git a/src/lexgrog.l-2.4a b/src/lexgrog.l-2.4a
new file mode 100644
index 00000000..9f909349
--- /dev/null
+++ b/src/lexgrog.l-2.4a
@@ -0,0 +1,299 @@
+%{
+
+/*
+ * lexgrog.l: extract 'whatis' info from nroff man / formatted cat pages.
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * Wed Oct 12 18:46:11 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#undef PROFILE
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <errno.h>
+
+#ifndef STDC_HEADERS
+extern int errno;
+#endif
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#ifdef HAVE_STRING_H
+# include <string.h>
+#elif defined (HAVE_STRINGS_H)
+# include <strings.h>
+#endif /* HAVE_STRING_H */
+
+#define NLS_SET lexgrogSet
+#include "nls/nls.h"
+
+#ifdef NLS
+nl_catd catfd;
+#endif /* NLS */
+
+#include "manconfig.h"
+#include "lib/error.h"
+
+#define YY_READ_BUF_SIZE 1024
+#define MAX_NAME 2048
+
+#ifdef PROFILE
+static int ctr[YY_NUM_RULES];
+# define YY_USER_ACTION ++ctr[yy_act];
+#endif
+
+static void add_str_to_whatis(const char *string, size_t length);
+static void add_char_to_whatis(unsigned char c);
+static void newline_found(void);
+
+static char newname[MAX_NAME];
+static char *p_name, *fname;
+
+#ifdef TEST
+#include <stdio.h>
+char *program_name = "lexgrog";
+#endif /* TEST */
+%}
+
+%option 8bit batch caseful never-interactive ecs meta-ecs
+%option nostdinit
+%option noyywrap nounput
+
+%x MAN_NAME
+%x CAT_NAME
+%x CAT_FILE
+%x MAN_FILE
+%x FORCE_EXIT
+
+digit [[:digit:]]
+upper [[:upper:]]
+alpha [[:alpha:]]
+blank [[:blank:]]
+bol \n+
+next \n*
+dbl_quote \"
+font_change \\f([[:upper:]1-4]|\({upper}{2})
+size_change \\s[+-]?{digit}
+style_change ({font_change}{size_change}?|{size_change}{font_change}?)
+typeface \.(B[IR]?|I[BR]?|R[BI])
+sec_request \.[Ss][HhYySs]
+comment ['.]\\{dbl_quote}
+
+name N[AaOo][Mm][EeNn]
+name_sec {dbl_quote}?{style_change}?{name}{style_change}?{dbl_quote}?
+
+%%
+
+ /* begin NAME section processing */
+<MAN_FILE>{sec_request}{blank}+{name_sec}{blank}* BEGIN(MAN_NAME);
+<CAT_FILE>(\n{blank}*){2,}{name}{blank}*\n{blank}+ BEGIN(CAT_NAME);
+
+ /* general text matching */
+<MAN_FILE>\.[^Ss].*{next} |
+<MAN_FILE>\..{0,3}{dbl_quote}?.{0,4}{dbl_quote}? |
+<CAT_FILE>.{1,9} |
+<CAT_FILE>[ ]* |
+<CAT_FILE>\n{2,} |
+<MAN_FILE,CAT_FILE>.|\n
+
+ /* rules to end NAME section processing */
+<FORCE_EXIT>.|\n | /* forced exit */
+<MAN_NAME>{bol}{sec_request}{blank}* | /* Another section */
+<MAN_NAME>{bol}\.IX{blank}+ | /* index request */
+<MAN_NAME>{bol}\.X{upper}{blank}+ | /* special - hpux */
+<MAN_NAME>{bol}\.sp{blank}* | /* vertical spacing */
+<MAN_NAME>\n{blank}*{bol}.+ | /* a break in the input */
+<CAT_NAME>{bol}S[yYeE] |
+<CAT_NAME>\n{2,}.+ |
+<CAT_NAME>{next}__ { /* terminate the string */
+ *p_name = '\0';
+ yyterminate();
+ }
+
+ /* ROFF request removal */
+<MAN_NAME>{
+ {bol}{typeface}{blank}+ | /* type face commands */
+ {bol}{comment}.* { /* per line comments */
+ newline_found();
+ }
+}
+
+<CAT_NAME>-\n[ \t\n]* /* strip continuations */
+
+ /* convert to DASH */
+<MAN_NAME>{next}{blank}*\\\((mi|hy|em){blank}* |
+<MAN_NAME>{next}[ \t\n]+[-\\]-{blank}* |
+<MAN_NAME>{next}[ \t\n]*[-\\]-{blank}+ |
+<CAT_NAME>{next}{blank}+-{1,2}[ \t\n]+ |
+<MAN_NAME>{bol}\.Nd{blank}* add_str_to_whatis(" - ", 3);
+
+ /* escape sequences and special characters */
+<MAN_NAME>{
+ {next}\\[\\e] add_char_to_whatis('\\');
+ {next}\\('|\(aa) add_char_to_whatis('\'');
+ {next}\\(`|\(ga) add_char_to_whatis('`');
+ {next}\\- add_char_to_whatis('-');
+ {next}\\\. add_char_to_whatis('.');
+ {next}((\\[ 0t])|[ ]|\t)* add_char_to_whatis(' ');
+ {next}\\\((ru|ul) add_char_to_whatis('_');
+ {next}\\\\t add_char_to_whatis('\t');
+
+ {next}\\[|^&!%acdpruz{}\n] /* various useless control chars */
+ {next}\\[bhlLvx]{blank}*'[^']+' /* various inline functions */
+
+ {next}\\\$[1-9] /* interpolate arg */
+
+ {next}\\\*(\({alpha})?{alpha} /* interpolate string */
+ {next}\\\({alpha}{alpha} /* special (non printable) character */
+ {next}\\\".* /* comment */
+
+ {next}{font_change} /* font changes */
+ {next}\\k{alpha} /* mark input place in register */
+
+ {next}\\n(\({alpha})?{alpha} /* interpolate number register */
+ {next}\\o\"[^"]+\" /* overstrike chars */
+
+ {next}{size_change} /* size changes */
+ {next}\\w{blank}*'[^']+'[^ \t]* /* width of string */
+
+ {next}\\ /* catch all */
+
+ {next}\(\\\|\){blank}* /* function() in hpux */
+}
+
+ /* collapse spaces, escpaed spaces, tabs, newlines to a single space */
+<CAT_NAME>{next}((\\[ ])|{blank})* add_char_to_whatis(' ');
+
+ /* a ROFF break request (.br) usually means we have multiple
+ whatis definitions, provide a separator for later processing */
+<MAN_NAME>{bol}\.br{blank}* add_char_to_whatis((char) 0x11);
+<MAN_NAME>{bol}\.{alpha}{2}{blank}* { /* very general roff requests */
+ newline_found();
+ }
+
+ /* pass words as a chunk. speed optimization */
+<MAN_NAME>[[:alnum:]]* add_str_to_whatis(yytext, yyleng);
+
+ /* normalise the period (,) separators */
+<CAT_NAME>{blank}*,[ \t\n]* |
+<MAN_NAME>{blank}*,{blank}* add_str_to_whatis(", ", 2);
+
+<CAT_NAME,MAN_NAME>{bol}. {
+ newline_found();
+ add_char_to_whatis(yytext[yyleng - 1]);
+ }
+
+<CAT_NAME,MAN_NAME>. add_char_to_whatis(*yytext);
+
+ /* default EOF rule */
+<<EOF>> return 1;
+
+%%
+
+/* print warning and force scanner to terminate */
+static void too_big(void)
+{
+ error(0, 0,
+ CATGETS(lexgrog_TOOBIG,
+ "warning: whatis for %s exceeds %d bytes, truncating."),
+ fname, MAX_NAME);
+
+ BEGIN(FORCE_EXIT);
+}
+
+/* append a string to newname if enough room */
+static void add_str_to_whatis(const char *string, size_t length)
+{
+ if (p_name - newname + length >= MAX_NAME) {
+ too_big();
+ } else {
+ (void) strncpy(p_name, string, length);
+ p_name += length;
+ }
+}
+
+/* append a char to newname if enough room */
+static void add_char_to_whatis(unsigned char c)
+{
+ if (p_name - newname + 1 >= MAX_NAME)
+ too_big();
+ else
+ *p_name++ = c;
+}
+
+static void newline_found(void)
+{
+/* If we are mid p_name and the last added char was not a space, best add one */
+ if (p_name != newname && *(p_name - 1) != ' ')
+ add_char_to_whatis(' ');
+}
+
+char *find_name(char *file, char *filename, short catfile)
+{
+ int ret;
+
+ if ( (yyin = fopen(file, "r")) == NULL) {
+ error (0, errno,
+ CATGETS(lexgrog_OPEN, "can't open %s"), file);
+ return NULL;
+ }
+
+ fname = filename;
+ *(p_name = newname) = '\0';
+
+ if (catfile)
+ BEGIN(CAT_FILE);
+ else
+ BEGIN(MAN_FILE);
+
+ yyrestart(yyin);
+ ret = yylex();
+ fclose(yyin);
+
+ if (ret)
+ return NULL;
+ else {
+ /* wipe out any initial spaces */
+ for (p_name = newname; *p_name == ' '; p_name++);
+ return xstrdup(p_name);
+ }
+}
+
+#ifdef TEST
+int main(int argc, char **argv)
+{
+ if (argc > 1)
+ while (*++argv) {
+ printf("man: \"%s\"\n", find_name(*argv, "-", 0));
+ printf("cat: \"%s\"\n", find_name(*argv, "-", 1));
+ }
+ return 0;
+}
+#endif
+
+#ifdef PROFILE
+void rule_profile(void)
+{
+ int i, tot = 0;
+
+ printf("found NAME in %d man, %d cat pages\n", ctr[1], ctr[2]);
+ for (i = 3; i <= YY_NUM_RULES; i++)
+ if (ctr[i]) {
+ printf("rule[%d]: %d\n", i, ctr[i]);
+ tot += ctr[i];
+ }
+ printf("Total rules executed: %d\n", tot);
+}
+#else
+void rule_profile(void){}
+#endif
diff --git a/src/lexgrog.l.new b/src/lexgrog.l.new
new file mode 100644
index 00000000..c31f1098
--- /dev/null
+++ b/src/lexgrog.l.new
@@ -0,0 +1,325 @@
+%{
+
+/*
+ * lexgrog.l: extract 'whatis' info from nroff man / formatted cat pages.
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * Wed Oct 12 18:46:11 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#undef PROFILE
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <errno.h>
+
+#ifndef STDC_HEADERS
+extern int errno;
+#endif
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#ifdef HAVE_STRING_H
+# include <string.h>
+#elif defined (HAVE_STRINGS_H)
+# include <strings.h>
+#endif /* HAVE_STRING_H */
+
+#include <libintl.h>
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+#include "lib/error.h"
+
+#define YY_READ_BUF_SIZE 1024
+#define MAX_NAME 2048
+
+#ifdef PROFILE
+static int ctr[YY_NUM_RULES];
+# define YY_USER_ACTION ++ctr[yy_act];
+#endif
+
+static void add_str_to_whatis(const char *string, size_t length);
+static void add_char_to_whatis(unsigned char c);
+static void newline_found(void);
+
+static char newname[MAX_NAME];
+static char *p_name, *fname;
+static char filters[MAX_FILTERS];
+
+#ifdef TEST
+#include <stdio.h>
+char *program_name = "lexgrog";
+#endif /* TEST */
+%}
+
+%option 8bit batch caseful never-interactive ecs meta-ecs
+%option nostdinit
+%option noyywrap nounput
+
+%x MAN_NAME
+%x CAT_NAME
+%x CAT_FILE
+%x MAN_FILE
+%x CAT_REST
+%x MAN_REST
+%x FORCE_EXIT
+
+digit [[:digit:]]
+upper [[:upper:]]
+alpha [[:alpha:]]
+blank [[:blank:]]
+blank_eol [[:blank:]\n]
+bol \n+
+next \n*
+dbl_quote \"
+font_change \\f([[:upper:]1-4]|\({upper}{2})
+size_change \\s[+-]?{digit}
+style_change ({font_change}{size_change}?|{size_change}{font_change}?)
+typeface \.(B[IR]?|I[BR]?|R[BI])
+sec_request \.[Ss][HhYySs]
+comment ['.]\\{dbl_quote}
+
+name (N[AaOo][Mm][Nn|Ee]|N[Oo][Mm]|N[Oo][Mm][Bb][Rr][Ee]|B[Ee][Zz][Ee][Ii][Cc][Hh][Nn][Uu][Nn][Gg])
+name_sec {dbl_quote}?{style_change}?{name}{style_change}?{dbl_quote}?
+
+tbl_request \.[Tt][Ss]
+eqn_request \.[Ee][Qq]
+pic_request \.[Pp][Ss][ 0-9.<]?
+ref1_request \.[Rr]1
+ref2_request \.\[
+
+%%
+
+ /* begin NAME section processing */
+<MAN_FILE>{sec_request}{blank_eol}+{name_sec}{blank}* BEGIN(MAN_NAME);
+<CAT_FILE>(\n{blank}*){2,}{name}{blank}*\n{blank}+ BEGIN(CAT_NAME);
+
+ /* general text matching */
+<MAN_FILE>\.[^Ss].*{next} |
+<MAN_FILE>\..{0,3}{dbl_quote}?.{0,4}{dbl_quote}? |
+<MAN_FILE>{comment}.*{next} |
+<CAT_FILE>.{1,9} |
+<CAT_FILE>[ ]* |
+<CAT_FILE>\n{2,} |
+<MAN_FILE,CAT_FILE>.|\n
+
+<MAN_REST>{
+ {bol}{tbl_request} filters[TBL_FILTER] = 't';
+ {bol}{eqn_request} filters[EQN_FILTER] = 'e';
+ {bol}{pic_request} filters[PIC_FILTER] = 'p';
+ {bol}{ref1_request} |
+ {bol}{ref2_request} filters[REF_FILTER] = 'r';
+}
+<MAN_REST><<EOF>> { /* exit */
+ *p_name = '\0'; /* terminate the string */
+ yyterminate();
+ }
+
+ /* rules to end NAME section processing */
+<FORCE_EXIT>.|\n { /* forced exit */
+ *p_name = '\0'; /* terminate the string */
+ yyterminate();
+ }
+
+<MAN_NAME>{bol}{sec_request}{blank}* | /* Another section */
+<MAN_NAME>{bol}\.X{upper}{blank}+ | /* special - hpux */
+<MAN_NAME>{bol}\.sp{blank}* | /* vertical spacing */
+<MAN_NAME>\n{blank}*{bol}.+ { /* terminate the string */
+ *p_name = '\0';
+ BEGIN(MAN_REST);
+ }
+
+<CAT_NAME>{bol}S[yYeE] |
+<CAT_NAME>\n{2,}.+ |
+<CAT_NAME>{next}__ { /* terminate the string */
+ *p_name = '\0';
+ BEGIN(CAT_REST);
+ yyterminate();
+ }
+
+ /* ROFF request removal */
+<MAN_NAME>{
+ {bol}{typeface}{blank}+ | /* type face commands */
+ {bol}\.IX{blank}.* | /* .IX line */
+ {bol}{comment}.* { /* per line comments */
+ newline_found();
+ }
+}
+
+<CAT_NAME>-\n[ \t\n]* /* strip continuations */
+
+ /* convert to DASH */
+<MAN_NAME>{next}{blank}*\\\((mi|hy|em){blank}* |
+<MAN_NAME>{next}[ \t\n]+[-\\]-{blank}* |
+<MAN_NAME>{next}[ \t\n]*[-\\]-{blank}+ |
+<CAT_NAME>{next}{blank}+-{1,2}[ \t\n]+ |
+<MAN_NAME>{bol}\.Nd{blank}* add_str_to_whatis(" - ", 3);
+
+ /* escape sequences and special characters */
+<MAN_NAME>{
+ {next}\\[\\e] add_char_to_whatis('\\');
+ {next}\\('|\(aa) add_char_to_whatis('\'');
+ {next}\\(`|\(ga) add_char_to_whatis('`');
+ {next}\\- add_char_to_whatis('-');
+ {next}\\\. add_char_to_whatis('.');
+ {next}((\\[ 0t])|[ ]|\t)* add_char_to_whatis(' ');
+ {next}\\\((ru|ul) add_char_to_whatis('_');
+ {next}\\\\t add_char_to_whatis('\t');
+
+ {next}\\[|^&!%acdpruz{}\n] /* various useless control chars */
+ {next}\\[bhlLvx]{blank}*'[^']+' /* various inline functions */
+
+ {next}\\\$[1-9] /* interpolate arg */
+
+ {next}\\\*(\({alpha})?{alpha} /* interpolate string */
+ {next}\\\({alpha}{alpha} /* special (non printable) character */
+ {next}\\\".* /* comment */
+
+ {next}{font_change} /* font changes */
+ {next}\\k{alpha} /* mark input place in register */
+
+ {next}\\n(\({alpha})?{alpha} /* interpolate number register */
+ {next}\\o\"[^"]+\" /* overstrike chars */
+
+ {next}{size_change} /* size changes */
+ {next}\\w{blank}*'[^']+'[^ \t]* /* width of string */
+
+ {next}\\ /* catch all */
+
+ {next}\(\\\|\){blank}* /* function() in hpux */
+}
+
+ /* collapse spaces, escpaed spaces, tabs, newlines to a single space */
+<CAT_NAME>{next}((\\[ ])|{blank})* add_char_to_whatis(' ');
+
+ /* a ROFF break request (.br) usually means we have multiple
+ whatis definitions, provide a separator for later processing */
+<MAN_NAME>{bol}\.br{blank}* add_char_to_whatis((char) 0x11);
+<MAN_NAME>{bol}\.{alpha}{2}{blank}* { /* very general roff requests */
+ newline_found();
+ }
+
+ /* pass words as a chunk. speed optimization */
+<MAN_NAME>[[:alnum:]]* add_str_to_whatis(yytext, yyleng);
+
+ /* normalise the period (,) separators */
+<CAT_NAME>{blank}*,[ \t\n]* |
+<MAN_NAME>{blank}*,{blank}* add_str_to_whatis(", ", 2);
+
+<CAT_NAME,MAN_NAME>{bol}. {
+ newline_found();
+ add_char_to_whatis(yytext[yyleng - 1]);
+ }
+
+<CAT_NAME,MAN_NAME>. add_char_to_whatis(*yytext);
+
+ /* default EOF rule */
+<<EOF>> return 1;
+
+%%
+
+/* print warning and force scanner to terminate */
+static void too_big(void)
+{
+ error(0, 0, _( "warning: whatis for %s exceeds %d bytes, truncating."), fname, MAX_NAME);
+
+ BEGIN(FORCE_EXIT);
+}
+
+/* append a string to newname if enough room */
+static void add_str_to_whatis(const char *string, size_t length)
+{
+ if (p_name - newname + length >= MAX_NAME) {
+ too_big();
+ } else {
+ (void) strncpy(p_name, string, length);
+ p_name += length;
+ }
+}
+
+/* append a char to newname if enough room */
+static void add_char_to_whatis(unsigned char c)
+{
+ if (p_name - newname + 1 >= MAX_NAME)
+ too_big();
+ else
+ *p_name++ = c;
+}
+
+static void newline_found(void)
+{
+/* If we are mid p_name and the last added char was not a space, best add one */
+ if (p_name != newname && *(p_name - 1) != ' ')
+ add_char_to_whatis(' ');
+}
+
+char *find_name(char *file, char *filename, short catfile)
+{
+ int ret;
+
+ if ( (yyin = fopen(file, "r")) == NULL) {
+ error (0, errno, _( "can't open %s"), file);
+ return NULL;
+ }
+
+ fname = filename;
+ *(p_name = newname) = '\0';
+ memset( filters, '_', sizeof(filters));
+
+ if (catfile)
+ BEGIN(CAT_FILE);
+ else
+ BEGIN(MAN_FILE);
+
+ yyrestart(yyin);
+ ret = yylex();
+ fclose(yyin);
+
+ if (ret)
+ return NULL;
+ else {
+ /* wipe out any initial spaces */
+ for (p_name = newname; *p_name == ' '; p_name++);
+ /* prepend filters to whatis */
+ return strappend( 0, "§", filters, "§", p_name, 0);
+ }
+}
+
+#ifdef TEST
+int main(int argc, char **argv)
+{
+ if (argc > 1)
+ while (*++argv) {
+ printf("man: \"%s\"\n", find_name(*argv, "-", 0));
+ printf("cat: \"%s\"\n", find_name(*argv, "-", 1));
+ }
+ return 0;
+}
+#endif
+
+#ifdef PROFILE
+void rule_profile(void)
+{
+ int i, tot = 0;
+
+ printf("found NAME in %d man, %d cat pages\n", ctr[1], ctr[2]);
+ for (i = 3; i <= YY_NUM_RULES; i++)
+ if (ctr[i]) {
+ printf("rule[%d]: %d\n", i, ctr[i]);
+ tot += ctr[i];
+ }
+ printf("Total rules executed: %d\n", tot);
+}
+#else
+void rule_profile(void){}
+#endif
diff --git a/src/man.c b/src/man.c
new file mode 100644
index 00000000..18de10d5
--- /dev/null
+++ b/src/man.c
@@ -0,0 +1,2629 @@
+/*
+ * man.c: The manual pager
+ *
+ * Copyright (c) 1990, 1991, John W. Eaton.
+ * Copyright (C), 1994, 1995 Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * John W. Eaton
+ * jwe@che.utexas.edu
+ * Department of Chemical Engineering
+ * The University of Texas at Austin
+ * Austin, Texas 78712
+ *
+ * Mostly written/re-written by Wilf, some routines by Markus Armbruster.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <stdio.h>
+#include <assert.h>
+#include <errno.h>
+#include <termios.h>
+
+#if defined(STDC_HEADERS)
+# include <string.h>
+# include <stdlib.h>
+#elif defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#else /* no string(s) header */
+extern char *strchr(), *strcat();
+#endif /* STDC_HEADERS */
+
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h>
+#else
+extern uid_t getuid(), geteuid();
+extern pid_t vfork();
+# define R_OK 4
+# define STDOUT_FILENO 1
+# define STDIN_FILENO 0
+#endif /* HAVE_UNISTD_H */
+
+#if defined(HAVE_LIMITS_H)
+# include <limits.h>
+#elif defined(HAVE_SYS_PARAM_H)
+# include <sys/param.h>
+#endif
+
+# ifndef PATH_MAX
+# ifdef _POSIX_VERSION
+# define PATH_MAX _POSIX_PATH_MAX
+# else /* !_POSIX_VERSION */
+# ifdef MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+# else /* !MAXPATHLEN */
+# define PATH_MAX 1024
+# endif /* MAXPATHLEN */
+# endif /* _POSIX_VERSION */
+# endif /* !PATH_MAX */
+
+ char wd[PATH_MAX];
+ char *cwd = wd;
+
+
+#ifndef PIPE_BUF
+# if defined(_POSIX_VERSION) && defined(_POSIX_PIPE_MAX)
+# define PIPE_MAX _POSIX_PIPE_MAX
+# else /* !_POSIX_PIPE_MAX */
+# if defined(PIPE_MAX) && (PIPE_MAX != INT_MAX)
+# define PIPE_BUF PIPE_MAX
+# else /* !PIPE_MAX */
+# define PIPE_BUF 512
+# endif /* PIPE_MAX */
+# endif /* _POSIX_PIPE_MAX */
+#endif /* PIPE_BUF */
+
+#ifdef HAVE_SYS_FILE
+# include <sys/file.h>
+#endif /* HAVE_SYS_FILE */
+
+#if HAVE_FCNTL_H
+# include <fcntl.h>
+#endif
+
+#include <ctype.h>
+#include <signal.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#if HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+
+#ifndef STDC_HEADERS
+extern char *getenv();
+extern int errno;
+#endif
+
+#ifdef HAVE_GETOPT_H
+# include <getopt.h>
+#else /* !HAVE_GETOPT_H */
+# include "lib/getopt.h"
+#endif /* HAVE_GETOPT_H */
+
+#include <locale.h>
+#include <libintl.h>
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+#include "libdb/mydbm.h"
+#include "libdb/db_storage.h"
+#include "lib/error.h"
+#include "lib/cleanup.h"
+#include "hashtable.h"
+#include "ult_src.h"
+#include "manp.h"
+#include "man.h"
+
+/* the magic cookie to request preprocessing */
+#define PP_COOKIE "'\\\" "
+
+/* the default preprocessor sequence */
+#ifndef DEFAULT_MANROFFSEQ
+# define DEFAULT_MANROFFSEQ ""
+#endif
+
+/* Some systems lack these */
+#ifndef STDIN_FILENO
+# define STDIN_FILENO 0
+#endif
+#ifndef STDOUT_FILENO
+# define STDOUT_FILENO 1
+#endif
+#ifndef STDERR_FILENO
+# define STDERR_FILENO 2
+#endif
+
+char * lang;
+struct lt {
+ char * lang;
+ char * device;
+ char * charset;
+} lang_table[] = {
+
+ /* LESSCHARSET=latin1 means '0x80-0xff is displayable'. */
+ /* It does not mean 'ISO-8859-1 charset'. */
+
+ /* roff_device=latin1 means 'groff uses ISO-8859-1 characters'. */
+ /* Thus 'ascii' should be used for ISO-8859-{2,3,4,...} languages. */
+
+ /* LANG means language of manpage. However, for English manpages, */
+ /* roff_device and LESSCHARSET are determined by user environment */
+ /* (latin1+latin1 for ISO-8859-1 languages and ascii+ascii for */
+ /* non-ISO-8859-1 languages). */
+
+ /* LANG roff_device LESSCHARSET */
+ { "da" , "latin1" , "latin1" }, /* Danish */
+ { "de" , "latin1" , "latin1" }, /* German */
+ { "en" , "latin1" , "-----" }, /* English */
+ { "es" , "latin1" , "latin1" }, /* Spanish */
+ { "fi" , "latin1" , "latin1" }, /* Finnish */
+ { "fr" , "latin1" , "latin1" }, /* French */
+ { "ga" , "latin1" , "latin1" }, /* Irish */
+ { "is" , "latin1" , "latin1" }, /* Icelandic */
+ { "it" , "latin1" , "latin1" }, /* Italian */
+ { "ja" , "nippon" , "ja" }, /* Japanese */
+ { "ko" , "nippon" , "latin1" }, /* Korean */
+ { "nl" , "latin1" , "latin1" }, /* Dutch */
+ { "no" , "latin1" , "latin1" }, /* Norwegian */
+ { "pt" , "latin1" , "latin1" }, /* Portuguese */
+ { "sv" , "latin1" , "latin1" }, /* Swedish */
+ { "*" , "ascii8" , "latin1" }, /* universal */
+ { 0 , 0 , 0 } };
+
+/* external formatter programs, one for use without -t, and one with -t */
+#define NFMT_PROG "./mandb_nfmt"
+#define TFMT_PROG "./mandb_tfmt"
+#undef ALT_EXT_FORMAT /* allow external formatters located in cat hierarchy */
+
+static int global_manpath = -1; /* global or user manual page hierarchy? */
+static int skip; /* page exists but has been skipped */
+
+#if defined _AIX || defined __sgi
+char **global_argv;
+#endif
+
+#if defined(__ultrix) || defined(__alpha)
+#define BROKEN_PCLOSE
+#endif
+
+#ifdef MAN_CATS
+# ifdef BROKEN_PCLOSE
+
+/* Some pclose(), notably Ultrix's get confused if we use more than one
+ concurrently, blech. Define our own popen()/pclose() combo. */
+
+static pid_t *fd2pid = NULL; /* map fd to pid, unused entries are zero */
+static int max_fd = -1; /* max fd seen, fd2pid has max_fd+1 elements */
+
+FILE *
+popen (const char *cmd, const char *type)
+{
+ pid_t child;
+ int for_reading;
+ int pipe_fd[2];
+ int fd;
+ FILE *stream;
+
+ /* check type */
+ if (type && (type[0] == 'r')) {
+ for_reading = 1;
+ } else if (type && (type[0] == 'w')) {
+ for_reading = 0;
+ } else {
+ return NULL;
+ }
+
+ if (pipe (pipe_fd)) {
+ return NULL;
+ }
+
+ child = vfork ();
+ if (child == -1) {
+ close (pipe_fd[0]);
+ close (pipe_fd[1]);
+ return NULL;
+ } else if (child == 0) {
+ /* if for_reading connect the writing end of pipe to stdout
+ else the reading end to stdin */
+ if (dup2 (pipe_fd[for_reading], for_reading) == -1) {
+ _exit (127);
+ }
+
+ /* close pipe fds */
+ close (pipe_fd[0]);
+ close (pipe_fd[1]);
+
+ /* exec cmd in a shell */
+ execl ("/bin/sh", "sh", "-c", cmd, NULL);
+ /* if we hit this, execl() failed */
+ _exit (127);
+ }
+
+ /* if for_reading make a stream from the reading end of pipe
+ else from the writing end */
+ fd = pipe_fd[!for_reading];
+ close (pipe_fd[for_reading]);
+ stream = fdopen (fd, type);
+
+ /* extend fd2pid up to index fd if necessary */
+ if (fd > max_fd) {
+ pid_t *new = malloc ((fd+1)*sizeof(pid_t));
+ if (new) {
+ /* copy old entries */
+ memcpy (new, fd2pid, (max_fd+1)*sizeof(pid_t));
+ /* zero new entries */
+ memset (new+max_fd+1, 0, (fd-max_fd)*sizeof(pid_t));
+ fd2pid = new;
+ max_fd = fd;
+ }
+ }
+
+ /* if we didn't get the stream or couldn't extend fd2pid, clean up & fail */
+ if (!stream || (fd > max_fd)) {
+ int res;
+ int save = errno;
+
+ kill (child, SIGKILL);
+
+ if (stream) {
+ fclose (stream);
+ } else {
+ close (fd);
+ }
+
+ do { /* cope with non-restarting system calls */
+ res = waitpid (child, NULL, 0);
+ } while ((res == -1) && (errno == EINTR));
+
+ errno = save;
+ return NULL;
+ }
+
+ fd2pid[fd] = child; /* save pid for plcose() */
+ return stream;
+}
+
+
+int
+pclose (FILE *stream)
+{
+ int fd = fileno (stream);
+ pid_t child;
+ int status;
+ int res;
+ int save;
+
+ if ((fd > max_fd) || !fd2pid[fd]) {
+ return -1;
+ }
+ child = fd2pid[fd];
+ fd2pid[fd] = 0;
+
+ if (fclose (stream)) {
+ return -1;
+ }
+
+ save = errno;
+ do { /* cope with non-restarting system calls */
+ res = waitpid (child, &status, 0);
+ } while ((res == -1) && (errno == EINTR));
+ if (res != -1) errno = save;
+
+ return status;
+}
+
+#endif /* BROKEN_PCLOSE */
+
+
+static FILE *checked_popen (char *command, char *type)
+{
+ FILE *stream;
+
+#ifdef SECURE_MAN_UID
+ if (global_manpath)
+ drop_effective_privs();
+#endif /* SECURE_MAN_UID */
+
+ if (debug) {
+ fprintf(stderr, "popen (\"%s\", \"%s\")\n",
+ command, type);
+ if (strchr (type, 'r'))
+ stream = popen (CAT " </dev/null", type);
+ else
+ stream = popen (CAT " >/dev/null", type);
+ } else
+ stream = popen (command, type);
+
+#ifdef SECURE_MAN_UID
+ if (global_manpath)
+ regain_effective_privs();
+#endif /* SECURE_MAN_UID */
+
+ if (stream == NULL)
+ error (0, 0, _( "can't popen"));
+ return stream;
+}
+#endif /* MAN_CATS */
+
+char * lang_dir( char * filename)
+{
+ char *ld; /* the lang dir: point to static data */
+ char *fm; /* the first "/man/" dir */
+ char *sm; /* the second "/man?/" dir */
+
+ ld = "";
+ if ( ! filename )
+ return ld;
+
+ if ( ! (fm = strstr( filename, "/man/")) )
+ return ld;
+ if ( ! (sm = strstr( 3+fm, "/man")) )
+ return ld;
+ if ( sm == 4+fm )
+ return ld;
+ if ( sm[5] != '/' )
+ return ld;
+ if ( ! strchr( "123456789lno", sm[4]) )
+ return ld;
+ /* found a lang dir */
+ fm += 5;
+ if ( ! (sm = strchr( fm, '/')) )
+ return ld;
+ ld = xstrdup ( fm);
+ ld[sm-fm] = '\0';
+ if (debug)
+ fprintf (stderr, "found lang dir element %s\n", ld);
+ return ld;
+}
+
+static __inline__ void gripe_system (char *command, int status)
+{
+ error (CHILD_FAIL, 0, _( "command exited with status %d: %s"), status, command);
+}
+
+
+static int checked_system (char *command)
+{
+ int status;
+
+ status = do_system_drop_privs (command);
+ if (status != 0)
+ gripe_system (command, status);
+
+ return status;
+}
+
+
+extern uid_t ruid; /* defined in security.c */
+extern uid_t euid; /* " " */
+extern char *manpathlist[]; /* defined in manp.c */
+
+/* globals */
+#ifndef debug
+int debug;
+#endif
+
+int quiet = 1;
+char *program_name;
+char *database;
+MYDBM_FILE dbf;
+char *extension; /* global for globbing.c */
+
+/* locals */
+static char *alt_system_name;
+static char **section_list;
+static char *section;
+static char *colon_sep_section_list;
+static char *preprocessors;
+static char *dbfilters;
+static char *pager;
+static char *locale;
+static char *internal_locale;
+static char *prompt_string;
+static char *std_sections[] = STD_SECTIONS;
+static char *manp;
+static char *external;
+
+static int troff;
+static char *roff_device = NULL;
+static int print_where;
+static int catman;
+static int local_man_file;
+static int findall;
+static int update;
+
+#ifdef MAN_DB_UPDATES
+static int update_required = 1; /* we haven't performed update */
+#endif /* MAN_DB_UPDATES */
+
+static int ascii; /* insert tr in the output pipe */
+static int save_cat; /* security breach? Can we save the cat? */
+
+static int found_a_stray; /* found a straycat */
+
+#ifdef MAN_CATS
+static char *tmp_cat_file; /* for open_cat_stream(), close_cat_stream() */
+static int cat_comp_pid; /* dto. */
+#endif
+
+static const struct option long_options[] =
+{
+ {"local-file", no_argument, 0, 'l'},
+ {"manpath", required_argument, 0, 'M'},
+ {"pager", required_argument, 0, 'P'},
+ {"sections", required_argument, 0, 'S'},
+ {"all", no_argument, 0, 'a'},
+ {"debug", no_argument, 0, 'd'},
+ {"whatis", no_argument, 0, 'f'},
+ {"help", no_argument, 0, 'h'},
+ {"apropos", no_argument, 0, 'k'},
+ {"version", no_argument, 0, 'V'},
+ {"systems", required_argument, 0, 'm'},
+ {"preprocessor", required_argument, 0, 'p'},
+ {"location", no_argument, 0, 'w'},
+ {"where", no_argument, 0, 'w'},
+ {"locale", required_argument, 0, 'L'},
+ {"extension", required_argument, 0, 'e'},
+ {"update", no_argument, 0, 'u'},
+ {"prompt", required_argument, 0, 'r'},
+ {"default", no_argument, 0, 'D'},
+ {"ascii", no_argument, 0, '7'},
+ {"catman", no_argument, 0, 'c'},
+
+#ifdef HAS_TROFF
+
+ {"troff", no_argument, 0, 't'},
+ {"troff-device", optional_argument, 0, 'T'},
+# ifdef TROFF_IS_GROFF
+ {"ditroff", no_argument, 0, 'Z'},
+ {"gxditview", optional_argument, 0, 'X'},
+# ifdef ENABLE_HTML
+ {"html", optional_argument, 0, 'H'},
+# endif
+# endif
+ {0, 0, 0, 0}
+};
+
+static const char args[] = "7DlM:P:S:adfhH::kVum:p:tT::we:L:Zcr:X::";
+
+# ifdef TROFF_IS_GROFF
+static int ditroff;
+static int htmlout;
+static char *html_pager;
+static char *gxditview;
+# endif /* TROFF_IS_GROFF */
+
+#else /* !HAS_TROFF */
+
+ {0, 0, 0, 0}
+};
+
+static const char args[] = "7DlM:P:S:adfhkVum:p:we:L:cr:";
+
+#endif /* HAS_TROFF */
+
+/* issue a usage message, then exit with the given status */
+static void usage (int status)
+{
+#ifdef HAS_TROFF
+# ifdef TROFF_IS_GROFF
+ char formatter[]="groff";
+# else
+ char formatter[]="troff";
+# endif /* TROFF_IS_GROFF */
+#endif /* HAS_TROFF */
+
+#ifdef HAS_TROFF
+ printf(_(
+ "usage: %s [-c|-f|-k|-w|-tZT device] [-adlhu7V] [-Mpath] [-Ppager] [-Slist]\n"
+ " [-msystem] [-pstring] [-Llocale] [-eextension] [section] page ...\n"),
+ program_name);
+#else
+ printf(_(
+ "usage: %s [-c|-f|-k|-w] [-adlhu7V] [-Mpath] [-Ppager] [-Slist] [-msystem]\n"
+ " [-pstring] [-Llocale] [-eextension] [section] page ...\n"),
+ program_name);
+#endif
+
+ puts(_(
+ "-a, --all find all matching manual pages.\n"
+ "-d, --debug emit debugging messages.\n"
+ "-e, --extension limit search to extension type `extension'.\n"
+ "-f, --whatis equivalent to whatis.\n"
+ "-k, --apropos equivalent to apropos.\n"
+ "-w, --where, --location print physical location of man page(s).\n"
+ "-l, --local-file interpret `page' argument(s) as local filename(s).\n"
+ "-u, --update force a cache consistency check.\n"
+ "-r, --prompt string provide the `less' pager with a prompt\n"
+ "-c, --catman used by catman to reformat out of date cat pages.\n"
+ "-7, --ascii display ASCII translation of certain latin1 chars."));
+#ifdef HAS_TROFF
+ printf(_(
+ "-t, --troff use %s to format pages.\n"
+ "-T, --troff-device device use %s with selected device.\n"),
+ formatter, formatter);
+# ifdef TROFF_IS_GROFF
+# ifdef ENABLE_HTML
+ puts(_("-H, --html use lynx or argument to display html output.\n"));
+# endif
+ puts(_("-Z, --ditroff use groff and force it to produce ditroff."));
+ puts(_("-X, --gxditview use groff and display through gditview (X11):"));
+ puts(_(" -X = -TX75, -X100 = -TX100, -X100-12 = -TX100-12."));
+# endif /* TROFF_IS_GROFF */
+#endif /* HAS_TROFF */
+
+ puts(_(
+ "-D, --default reset all options to their default values.\n"
+ "-M, --manpath path set search path for manual pages to `path'.\n"
+ "-P, --pager pager use program `pager' to display output.\n"
+ "-S, --sections list use colon separated section list.\n"
+ "-m, --systems system search for man pages from other unix system(s).\n"
+ "-L, --locale locale define the locale for this particular man search.\n"
+ "-p, --preprocessor string string indicates which preprocessors to run."));
+ puts( " e - [n]eqn p - pic t - tbl\n"
+ " g - grap r - refer v - vgrind");
+ puts(_(
+ "-V, --version show version.\n"
+ "-h, --help show this usage message."));
+
+ exit (status);
+}
+
+/*
+ * changed these messages from stdout to stderr,
+ * (Fabrizio Polacco) Fri, 14 Feb 1997 01:30:07 +0200
+ */
+static void gripe_no_name (char *section)
+{
+ if (section)
+ fprintf (stderr, _( "What manual page do you want from section %s?\n"), section);
+ else
+ fputs ( _( "What manual page do you want?\n"), stderr);
+
+ exit (FAIL);
+}
+
+static struct termios tms;
+static int tms_set=0;
+
+void set_term()
+{
+ if ( tms_set ) tcsetattr( 0, TCSANOW, &tms);
+}
+
+void get_term()
+{
+ if ( isatty( 1) ) {
+ if (debug) fprintf(stderr, "is a tty\n");
+ tcgetattr( 0, &tms);
+ if ( ! tms_set++ )
+ atexit( set_term);
+ }
+}
+
+/*
+ * changed these messages from stdout to stderr,
+ * (Fabrizio Polacco) Fri, 14 Feb 1997 01:30:07 +0200
+ */
+static __inline__ void gripe_no_man(char *name, char *sec)
+{
+ if (troff) {
+ fprintf ( stderr, _( "No source manual entry for %s"), name);
+ } else {
+
+/* On AIX and IRIX, fall back to the vendor supplied browser */
+#if defined _AIX || defined __sgi
+
+ putenv("MANPATH="); /* reset the MANPATH variable */
+ execv("/usr/bin/man", global_argv);
+#else
+ fprintf ( stderr, _( "No manual entry for %s"), name);
+#endif
+ }
+
+ if (sec)
+ fprintf ( stderr, _( " in section %s\n"), sec);
+ else
+ putc ('\n', stderr);
+}
+
+/* fire up the appropriate external program */
+static void do_extern (char *argv[])
+{
+ /* privs are already dropped */
+ argv[0] = basename(external);
+ execv(external, argv);
+ exit(FATAL);
+}
+
+/* lookup $MANOPT and if available, put in *argv[] format for getopt() */
+static __inline__ char **manopt_to_env(int *argc)
+{
+ char *manopt, *opt_start, **argv;
+
+ manopt = getenv("MANOPT");
+ if (manopt == NULL || *manopt == '\0')
+ return NULL;
+
+ opt_start = manopt = xstrdup(manopt);
+
+ /* allocate space for the program name */
+ *argc = 0;
+ argv = (char **) xmalloc ((*argc + 3) * sizeof (char *));
+ argv[(*argc)++] = program_name;
+
+ /* for each [ \t]+ delimited string, allocate an array space and fill
+ it in. An escaped space is treated specially */
+ while (*manopt) {
+ switch (*manopt) {
+ case ' ':
+ case '\t':
+ if (manopt != opt_start) {
+ *manopt = '\0';
+ argv = (char **)
+ xrealloc (argv, (*argc + 3) *
+ sizeof (char *));
+ argv[(*argc)++] = opt_start;
+ }
+ while (isspace(*(manopt + 1)))
+ *++manopt = '\0';
+ opt_start = manopt + 1;
+ break;
+ case '\\':
+ if (*(manopt + 1) == ' ')
+ manopt++;
+ break;
+ default:
+ break;
+ }
+ manopt++;
+ }
+
+ if (*opt_start)
+ argv[(*argc)++] = opt_start;
+ argv[*argc] = NULL;
+
+ return argv;
+}
+
+/* return char array with 'less' special chars escaped */
+static __inline__ char *escape_special(char *string)
+{
+ static char *escaped_string;
+ char *ptr;
+
+ /* 2*strlen will always be long enough to hold the escaped string */
+ ptr = escaped_string = (char *) xrealloc ( escaped_string,
+ 2 * strlen(string) + 1);
+
+ while (*string) {
+ if (*string == '?' ||
+ *string == ':' ||
+ *string == '.' ||
+ *string == '%' ||
+ *string == '\\')
+ *ptr++ = '\\';
+
+ *ptr++ = *string++;
+ }
+
+ *ptr = *string;
+ return escaped_string;
+}
+
+#ifdef MAN_DB_UPDATES
+/* test for new files. If any found return 1, else 0 */
+static int need_to_rerun(void)
+{
+ int rerun = 0;
+ char **mp;
+
+ for (mp = manpathlist; *mp; mp++) {
+ char *catpath;
+
+ if ( (catpath = global_catpath(*mp)) ) {
+ database = mkdbname(catpath);
+ free(catpath);
+ global_manpath = 1;
+ } else {
+ database = mkdbname(*mp);
+ global_manpath = 0;
+ drop_effective_privs();
+ }
+
+ if (update)
+ reset_db_time();
+
+ /* if no change or couldn't update (EOF), forget it */
+ if (update_db(*mp) > 0)
+ rerun = 1;
+
+ if (!global_manpath)
+ regain_effective_privs();
+
+ }
+
+ /* only ever need to do this once */
+ update_required = 0;
+
+ return rerun;
+}
+#endif /* MAN_DB_UPDATES */
+
+
+/* man issued with `-l' option */
+int local_man_loop (char *argv)
+{
+ int exit_status = OK;
+ int local_mf = local_man_file;
+ char *dir;
+
+ local_man_file = 1;
+ if (strcmp (argv, "-") == 0)
+ display (NULL, "", NULL, "(stdin)");
+ else {
+#ifdef COMP_SRC
+ /* See if we need to decompress the file(s) first */
+ struct compression *comp;
+
+ if ( (comp = comp_info(argv)) )
+ (void) decompress(argv, comp);
+#endif /* COMP_SRC */
+ lang = lang_dir (argv);
+ if (!display ((cwd[0]?cwd:NULL), argv, NULL, basename(argv))) {
+ if ( local_mf )
+ error (0, errno, argv);
+ exit_status = NOT_FOUND;
+ }
+
+#ifdef COMP_SRC
+ remove_ztemp();
+#endif /* COMP_SRC */
+ }
+ local_man_file = local_mf;
+ return (exit_status);
+}
+
+int main (int argc, char *argv[])
+{
+ int argc_env, status = 0, exit_status = OK;
+ char **argv_env, *tmp;
+ char *nextarg;
+ extern int optind;
+ void (int_handler)( int);
+
+
+ umask(022);
+ /* initialise the locale */
+ internal_locale = setlocale( LC_MESSAGES, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ if (internal_locale != NULL
+ || (internal_locale = getenv ("LC_ALL"))
+ || (internal_locale = getenv ("LC_MESSAGES"))
+ || (internal_locale = getenv ("LANG")) )
+ internal_locale = xstrdup (internal_locale);
+ else
+ internal_locale = "C";
+
+/* export argv, it might be needed when invoking the vendor supplied browser */
+#if defined _AIX || defined __sgi
+ global_argv = argv;
+#endif
+
+ program_name = xstrdup(basename((argv[0])));
+
+ { /* opens base streams in case someone like "info" closed them */
+ struct stat buf;
+ if ( (fileno(stdin) < 0)
+ || ((fstat( fileno(stdin), &buf) < 0) && (errno == EBADF)) )
+ freopen( "/dev/null", "r", stdin);
+ if ( (fileno(stdout) < 0)
+ || ((fstat( fileno(stdout), &buf) < 0) && (errno == EBADF)) )
+ freopen( "/dev/null", "w", stdout);
+ if ( (fileno(stderr) < 0)
+ || ((fstat( fileno(stderr), &buf) < 0) && (errno == EBADF)) )
+ freopen( "/dev/null", "w", stderr);
+ }
+
+/* if the user happens to be root and man is installed setuid, forget all
+ * of the priv dropping etc. Just make sure that any cat files produced
+ * are owned by MAN_OWNER by doing explicit chown() calls */
+
+#ifdef SECURE_MAN_UID
+ /* record who we actually are */
+ ruid = getuid ();
+ euid = geteuid ();
+
+ if (ruid == 0)
+ setuid(ruid);
+
+ /* so that manpath code respects user privs */
+ drop_effective_privs();
+#endif
+
+ /* This will enable us to do some profiling and know
+ where gmon.out will end up. Must chdir(cwd) before we return */
+# ifdef HAVE_GETCWD
+ if (!getcwd(cwd, PATH_MAX - 1))
+# else /* not HAVE_GETCWD */
+ if (!getwd(cwd))
+# endif
+ cwd[0] = '\0';
+
+ /* First of all, find out if $MANOPT is set. If so, put it in
+ *argv[] format for getopt to play with. */
+ if ( (argv_env = manopt_to_env (&argc_env)) ) {
+ man_getopt (argc_env, argv_env);
+ optind = 0;
+ }
+
+ /* give the actual program args to getopt */
+ man_getopt (argc, argv);
+
+ /* if the user wants whatis or apropos, give it to them... */
+ if (external)
+ do_extern (argv);
+
+ get_term(); /* stores terminal settings */
+ if (debug) fprintf(stderr, "real user = %d; effective user = %d\n", ruid, euid);
+
+#ifdef HAVE_SETLOCALE
+ /* close this locale and reinitialise incase a new locale was
+ issued as an argument or in $MANOPT */
+ if (locale) {
+ if ((internal_locale = setlocale(LC_MESSAGES, locale)) == NULL)
+ internal_locale = locale;
+
+ internal_locale = xstrdup (internal_locale);
+if (debug) fprintf(stderr, "main(): locale= %s,internal_locale= %s\n", locale, internal_locale);
+ if (internal_locale) {
+ extern int _nl_msg_cat_cntr;
+ setenv ("LANGUAGE", internal_locale, 1);
+ ++_nl_msg_cat_cntr;
+ }
+ }
+
+#endif /* HAVE_SETLOCALE */
+
+ if ( htmlout )
+ pager = (html_pager == NULL ? WEB_BROWSER : html_pager);
+ if (pager == NULL)
+ if ((pager = getenv ("PAGER")) == NULL)
+ pager = PAGER;
+ if (*pager == '\0')
+ pager = CAT;
+
+ if (prompt_string == NULL)
+#ifdef LESS_PROMPT
+ prompt_string = LESS_PROMPT;
+#else
+ prompt_string = _(
+ " Manual page $MAN_PN "
+ "?ltline %lt?L/%L.:byte %bB?s/%s..?e (END):"
+ "?pB %pB\\\\%..");
+#endif
+
+ if (debug)
+ fprintf (stderr, "\nusing %s as pager\n", pager);
+
+ if (optind == argc)
+ gripe_no_name (NULL);
+
+ signal( SIGINT, int_handler);
+
+ /* man issued with `-l' option */
+ if (local_man_file) {
+ for (; optind < argc; ++optind)
+ exit_status = local_man_loop( argv[optind]);
+ exit (exit_status);
+ }
+
+ if (manp == NULL)
+ manp = add_nls_manpath(manpath (alt_system_name),
+ internal_locale);
+ else
+ free(manpath(NULL));
+
+ create_pathlist(xstrdup(manp), manpathlist);
+
+ if (debug)
+ fprintf(stderr, "*manpath search path* = %s\n", manp);
+
+ /* finished manpath processing, regain privs */
+ regain_effective_privs();
+
+ section_list = get_section_list ();
+
+ if (optind == argc - 1) {
+ tmp = is_section ( argv[optind] );
+ if (tmp)
+ gripe_no_name (tmp);
+ }
+
+#ifdef MAN_DB_UPDATES
+ /* If `-a' or consistency check forced `-u', do it now. */
+ if (update || findall)
+ (void) need_to_rerun();
+#endif /* MAN_DB_UPDATES */
+
+ while (optind < argc) {
+ nextarg = argv[optind++];
+
+ /*
+ * See if this argument is a valid section name. If not,
+ * is_section returns NULL.
+ */
+ if (optind < argc) {
+ if (tmp = is_section (nextarg)) {
+ section = tmp;
+ if (debug) fprintf (stderr, "\nsection: %s\n", section);
+ continue;
+ }
+ }
+
+ /* this is where we actually start looking for the man page */
+ skip = 0;
+ status = man (nextarg);
+
+ /* clean out the memory cache for each man page */
+ free_hashtab();
+
+ if (!status && !catman) {
+ if ( !skip ) {
+ if ( strchr( nextarg, '/') )
+ exit_status = local_man_loop( nextarg);
+ else
+ exit_status = NOT_FOUND;
+ if ( exit_status == NOT_FOUND)
+ gripe_no_man(nextarg, section);
+ }
+ } else {
+ if (debug)
+ fprintf(stderr,
+ "\nFound %d man pages\n", status);
+ if (catman) {
+ printf("%s", nextarg);
+ if (section)
+ printf("(%s)", section);
+ if (optind != argc)
+ fputs(", ", stdout);
+ else
+ fputs(".\n", stdout);
+ }
+
+ }
+
+ chkr_garbage_detector();
+ }
+
+ /* For profiling */
+ if (cwd[0])
+ chdir(cwd);
+
+ exit (exit_status);
+}
+
+/* parse the arguments contained in *argv[] and set appropriate vars */
+static void man_getopt (int argc, char *argv[])
+{
+ int c, option_index; /* not used, but required by getopt_long() */
+ static int apropos, whatis; /* retain values between calls */
+
+ while ((c = getopt_long (argc, argv, args,
+ long_options, &option_index)) != EOF) {
+
+ switch (c) {
+
+ case 'l':
+ local_man_file = 1;
+ break;
+ case 'e':
+ extension = optarg;
+ break;
+ case 'M':
+ manp = optarg;
+ break;
+ case 'P':
+ pager = optarg;
+ break;
+ case 'S':
+ if (*optarg) colon_sep_section_list = optarg;
+ break;
+ case 'V':
+ ver();
+ break;
+ case 'a':
+ findall = 1;
+ break;
+ case 'u':
+ update = 1;
+ break;
+ case 'c':
+ catman = 1;
+ break;
+ case 'd':
+#ifndef debug
+ debug = 1;
+#endif
+ break;
+ case 'f':
+ external = WHATIS;
+ apropos = 1;
+ break;
+ case 'k':
+ external = APROPOS;
+ whatis = 1;
+ break;
+ case 'm':
+ alt_system_name = optarg;
+ break;
+ case 'L':
+ locale = optarg;
+ break;
+ case 'p':
+ preprocessors = optarg;
+ break;
+ case '7':
+ ascii = 1;
+ break;
+#ifdef HAS_TROFF
+ case 't':
+ troff = 1;
+ break;
+
+ case 'T':
+ /* @@@ traditional nroff knows -T,
+ troff does not (gets ignored).
+ All incarnations of groff know it.
+ Why does -T imply -t? */
+ /* as this is an optional argument */
+ roff_device = (optarg ? optarg : "ps");
+ troff = 1;
+ break;
+ case 'X':
+#ifdef TROFF_IS_GROFF
+ troff = 1;
+ gxditview = (optarg ? optarg : "75");
+#endif/* TROFF_IS_GROFF */
+ break;
+ case 'H':
+#ifdef TROFF_IS_GROFF
+ html_pager = (optarg ? optarg : 0);
+ htmlout = 1;
+#endif/* TROFF_IS_GROFF */
+ break;
+ case 'Z':
+#ifdef TROFF_IS_GROFF
+ ditroff = 1;
+ troff = 1;
+#endif/* TROFF_IS_GROFF */
+ break;
+#endif /* HAS_TROFF */
+ case 'w':
+ print_where = 1;
+ break;
+ case 'r':
+ prompt_string = optarg;
+ break;
+ case 'D':
+ /* discard all preset options */
+ local_man_file = findall = update = catman = debug
+ = troff = gxditview
+ = print_where = ascii = 0;
+#ifdef TROFF_IS_GROFF
+ ditroff = 0;
+#endif
+ roff_device = extension = pager = locale
+ = colon_sep_section_list
+ = alt_system_name = external
+ = preprocessors = manp = NULL;
+ break;
+ case 'h':
+ usage(OK);
+ break;
+ default:
+ usage(FAIL);
+ break;
+ }
+ }
+
+ /* check for incompatible options */
+ if (troff + whatis + apropos + catman + print_where > 1) {
+ error (0, 0,
+ strappend(NULL,
+ troff ? "-[tTZ] " : "",
+ whatis ? "-f " : "",
+ apropos ? "-k " : "",
+ catman ? "-c " : "",
+ print_where ? "-w " : "",
+ _( ": incompatible options"), NULL));
+ usage(FAIL);
+ }
+}
+
+/*
+ * Check to see if the argument is a valid section number.
+ * If the name matches one of
+ * the sections listed in section_list, we'll assume that it's a section.
+ * The list of sections in config.h simply allows us to specify oddly
+ * named directories like .../man3f. Yuk.
+ */
+static __inline__ char *is_section (char *name)
+{
+ char **vs;
+
+ for (vs = section_list; *vs; vs++)
+ if ((strcmp (*vs, name) == 0))
+ return name;
+ return NULL;
+}
+
+/* Snarf pre-processors from file, return (static) string or NULL on failure */
+static char *get_preprocessors_from_file (char *file)
+{
+ char *directive = NULL;
+#ifdef PP_COOKIE
+ FILE *fp;
+ static char line[128];
+
+ if (*file == '\0')
+ return NULL;
+
+ if ((fp = fopen (file, "r"))) {
+ if (fgets (line, sizeof (line), fp)) {
+ if (!memcmp (line, PP_COOKIE, 4)) {
+ int len;
+ directive = line+4;
+ /* strip trailing newline */
+ len = strlen (directive);
+ if (len && (directive[len-1] = '\n'))
+ directive[len-1] = 0;
+ }
+ }
+ fclose (fp);
+ }
+
+ /* if we couldn't read the first line from file, or we didn't
+ find PP_COOKIE, then directive == NULL */
+#endif
+ return directive;
+}
+
+
+/* Determine pre-processors, set save_cat and return
+ (static) string */
+static char *get_preprocessors (char *file)
+{
+ char *pp_string;
+ char *pp_source;
+
+ /* try in order: database, command line, file, environment, default */
+ /* command line overrides the database, but database empty overrides default */
+ if (dbfilters && (dbfilters[0] != '-') && !preprocessors) {
+ pp_string = dbfilters;
+ pp_source = "database";
+ save_cat = 1;
+ } else if ((pp_string = preprocessors)) {
+ pp_source = "command line";
+ save_cat = 0;
+ } else if ((pp_string = get_preprocessors_from_file (file))) {
+ pp_source = "file";
+ save_cat = 1;
+ } else if ((pp_string = getenv ("MANROFFSEQ"))) {
+ pp_source = "environment";
+ save_cat = 0;
+ } else if ( !dbfilters ) {
+ pp_string = DEFAULT_MANROFFSEQ;
+ pp_source = "default";
+ save_cat = 1;
+ } else {
+ pp_string = "";
+ pp_source = "no filters";
+ save_cat = 0;
+ }
+
+ if (debug)
+ fprintf (stderr, "pre-processors `%s' from %s\n",
+ pp_string, pp_source);
+ return pp_string;
+}
+
+/* This is so that we can store the temp file name used when input is
+ * stdin and remove it on exit.
+ */
+static char *stdin_tmpfile;
+static int stdin_tmpfile_fd;
+
+static void remove_stdintmp(void)
+{
+ if (stdin_tmpfile) {
+ if (stdin_tmpfile_fd >= 0)
+ close(stdin_tmpfile_fd);
+ (void) remove_with_dropped_privs(stdin_tmpfile);
+ }
+ stdin_tmpfile = NULL;
+}
+
+static __inline__ void create_stdintmp(void)
+{
+ /* This is basically copied from create_ztemp() in compression.c;
+ * it therefore shouldn't introduce any new security holes -- PMM
+ */
+ int oldmask = umask(022);
+ drop_effective_privs();
+ errno = 0; /* failing tempname() might fail to set errno */
+ stdin_tmpfile = tempnam(NULL, "sman");
+ if (stdin_tmpfile)
+ stdin_tmpfile_fd = open(stdin_tmpfile, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL, 0644);
+ if (!stdin_tmpfile || (stdin_tmpfile_fd < 0))
+ error (FATAL, errno, _( "can't create a temporary filename"));
+ regain_effective_privs();
+ umask(oldmask);
+ atexit( remove_stdintmp);
+}
+
+/* Determine roff_device and LESSCHARSET */
+static void determine_lang_table (char *lang)
+{
+ int j;
+ if (( ! lang ) || ( ! *lang )) {
+ /* English manpages */
+ for ( j=0; lang_table[j].lang; j++ ) {
+ if (( strncmp( lang_table[j].lang, internal_locale
+ , strlen(lang_table[j].lang)) == 0)
+ || ( lang_table[j].lang[0] == '*' )) {
+ if (!strcmp(lang_table[j].device, "latin1")) {
+ roff_device = "latin1";
+ putenv("LESSCHARSET=latin1");
+ } else {
+ roff_device = "ascii";
+ putenv("LESSCHARSET=ascii");
+ }
+ break;
+ }
+ }
+ } else {
+ int j;
+ for ( j=0; lang_table[j].lang; j++ ) {
+ if (( strncmp( lang_table[j].lang, lang
+ , strlen( lang_table[j].lang)) == 0 )
+ || ( lang_table[j].lang[0] == '*' )) {
+ roff_device = lang_table[j].device;
+ putenv( strappend ( 0
+ ,"LESSCHARSET="
+ , lang_table[j].charset
+ , 0));
+ j = sizeof(lang_table)/sizeof(struct lt) - 2;
+ }
+ }
+ }
+}
+
+/* Return command (malloced string) to format file to stdout */
+static __inline__ char *make_roff_command (char *dir, char *file)
+{
+ char *pp_string;
+ char *fmt_prog;
+ char *command;
+ char *tmpfile;
+
+ if (!*file) {
+ /* file == "": this means we are reading input from stdin.
+ * Unfortunately we need to read the first line or so to
+ * determine the preprocessor filename. So we read a bit
+ * into a temporary file which we give to get_preprocessors
+ * and then prepend to the rest of stdin by putting cat
+ * in the beginning of the pipeline we pass to system().
+ * I can't think of a better way to do this :-<
+ * [this code seems remarkably hairy for what it does...]
+ */
+ /* get_preprocessors uses 128 byte buffer, no point using more here */
+#define STDIN_SNARFLEN 128
+ char bf[STDIN_SNARFLEN];
+ int ct = 0; /* number of bytes in bf[] */
+ int ctot, r;
+ /* Ignore SIGPIPE; we want to be notified by write returning EPIPE. */
+ RETSIGTYPE (*old_handler)() = signal(SIGPIPE, SIG_IGN);
+
+ /* read data into bf; we don't want to use the stream stuff because
+ * we don't want data to be lost in the buffers, not read here or
+ * by the system()-run pipeline.
+ */
+ do {
+ errno = 0;
+ r = read(STDIN_FILENO, bf+ct, (128-ct));
+ if (r != -1)
+ ct += r;
+ /* stop on EOF (r==0), bf full (ct==128) or error (errno not 0 or EINTR) */
+ } while (r != 0 && ct < STDIN_SNARFLEN && (errno == 0 || errno == EINTR));
+
+ if (errno != 0)
+ error(FATAL, errno, _( "error trying to read from stdin"));
+
+ create_stdintmp();
+ /* write bf to stdin_tmpfile_fd */
+ ctot = ct;
+ do {
+ errno = 0;
+ r = write(stdin_tmpfile_fd, bf+(ctot-ct), ct);
+ if (r != -1)
+ ct -= r;
+ } while (ct > 0 && (errno == 0 || errno == EINTR));
+ if (errno != 0)
+ error(FATAL, errno, _( "error writing to temporary file %s"), stdin_tmpfile);
+
+ close(stdin_tmpfile_fd);
+ stdin_tmpfile_fd = -1; /* ensure we don't try to close it again */
+ signal(SIGPIPE, old_handler);
+
+ pp_string = get_preprocessors(stdin_tmpfile);
+ }
+ else
+ pp_string = get_preprocessors(file);
+
+#ifdef ALT_EXT_FORMAT
+ /* Check both external formatter locations */
+ if (global_manpath && dir) {
+ char *catpath = global_catpath (dir);
+
+ /* If we have an alternate catpath */
+ if (strcmp(catpath, dir) != 0) {
+ fmt_prog = strappend(catpath, "/",
+ troff ? TFMT_PROG : NFMT_PROG,
+ NULL);
+ if (access (fmt_prog, X_OK)) {
+ free (fmt_prog);
+ fmt_prog = xstrdup(troff ? TFMT_PROG : NFMT_PROG);
+ if (access (fmt_prog, X_OK)) {
+ free (fmt_prog);
+ fmt_prog = NULL;
+ }
+ }
+ /* If we don't */
+ } else {
+ free (catpath);
+#endif /* ALT_EXT_FORMAT */
+
+ fmt_prog = xstrdup(troff ? TFMT_PROG : NFMT_PROG);
+ if (access (fmt_prog, X_OK)) {
+ free (fmt_prog);
+ fmt_prog = NULL;
+ }
+
+#ifdef ALT_EXT_FORMAT
+ }
+ } else
+ fmt_prog = NULL;
+#endif /* ALT_EXT_FORMAT */
+
+ if (debug && fmt_prog)
+ fprintf(stderr, "External formatter %s\n", fmt_prog);
+
+ if (!fmt_prog) {
+ /* we don't have an external formatter script */
+ char *dev; /* either " -T<mumble>" or "" */
+ int using_tbl = 0;
+
+ /* load the roff_device value dependent on the language dir in path */
+ if ( ! roff_device && ! troff ) {
+ determine_lang_table (lang);
+ }
+ /* tell grops to guess the page size */
+ if ( roff_device && strcmp( roff_device, "ps") == 0 )
+ roff_device = strappend( NULL, "ps -P-g ", NULL);
+ if (gxditview && roff_device)
+ dev = strappend (NULL, " -X -T", roff_device, NULL);
+ else if (gxditview)
+ dev = strappend (NULL, " -TX", gxditview, NULL);
+ else if (roff_device)
+ dev = strappend (NULL, " -T", roff_device, NULL);
+ else
+ dev = "";
+
+ if (*file)
+ command = strappend (NULL, SOELIM " '", file, "'", NULL);
+ else {
+ /* Reading from stdin: use cat to pick up the part we
+ * read in to figure out the format pipeline.
+ * ? is '-' as a cat argument standard?
+ * If not we could try "(cat tempfile; cat) | SOELIM..."
+ */
+ command = strappend(NULL, "cat ", stdin_tmpfile, " - | ", SOELIM, NULL);
+ }
+ do {
+ char *filter;
+ int wants_dev = 0; /* filter wants a dev argument */
+
+ /* set filter according to *pp_string, on
+ errors set filter to "" */
+ switch (*pp_string) {
+ case 'e':
+ filter = troff ? EQN : NEQN;
+ wants_dev = 1;
+ break;
+ case 'g':
+ filter = GRAP;
+ break;
+ case 'p':
+ filter = PIC;
+ break;
+ case 't':
+ filter = TBL;
+ using_tbl = 1;
+ break;
+ case 'v':
+ filter = VGRIND;
+ break;
+ case 'r':
+ filter = REFER;
+ break;
+ case 0:
+ /* done with preprocessors, now add roff */
+#ifdef TROFF_IS_GROFF
+ if (troff && ditroff) filter = TROFF " -Z";
+ else
+#endif
+ if (troff) {
+#ifdef HAS_TROFF
+ filter = TROFF;
+#else
+ assert (0);
+#endif
+ } else {
+#ifdef NROFF_MISSING
+ assert (0);
+#else
+ filter = NROFF;
+#endif
+ }
+
+ wants_dev = 1;
+ break;
+ default:
+ filter = "";
+ }
+
+ if (*filter) {
+ command = strappend (command,
+ " | ",
+ filter,
+ wants_dev ? dev : "",
+ NULL);
+ } else {
+ assert (*pp_string); /* didn't fail on roff */
+ error (0, 0, _( "ignoring unknown preprocessor `%c'"), *pp_string);
+ }
+ } while (*pp_string++);
+
+#ifndef GNU_NROFF
+ /* tbl needs col */
+ if (using_tbl && !troff && *COL)
+ command = strappend (command, " | ", COL, NULL);
+#endif /* GNU_NROFF */
+
+ if (roff_device || gxditview) free (dev);
+ } else {
+ /* use external formatter script, it takes arguments
+ input file, preprocessor string, and (optional)
+ output device */
+ command = strappend (fmt_prog,
+ " '", file, "' \"", pp_string, "\" ",
+ roff_device ? roff_device : "", NULL);
+ }
+
+ return command;
+}
+
+/* Return command (malloced string) to display file, NULL means stdin */
+static char *make_display_command (char *file, char *title)
+{
+ char *command;
+
+ command = strappend (NULL, "{ export MAN_PN LESS; MAN_PN=\'",
+ escape_special(title),
+ "\'; LESS=\"" LESS_OPTS, prompt_string,
+ "\"; ", NULL);
+ if (file) {
+ if (ascii) {
+ command = strappend (command, CAT " '", file,
+ "' |" TR TR_SET1 TR_SET2 " |",
+ pager, "; }", NULL);
+ } else {
+ command = strappend (command, pager, " '", file,
+ "'; }", NULL);
+ }
+ } else {
+ if (ascii) {
+ command = strappend (command, TR TR_SET1 TR_SET2 " |",
+ pager, "; }", NULL);
+ } else {
+ command = strappend (command, pager, "; }", NULL);
+ }
+ }
+
+ return command;
+}
+
+
+#ifdef SECURE_MAN_UID
+/* Required if man is setuid and user has ruid==0 */
+static __inline__ int do_chown(const char *file)
+{
+ int status;
+
+ if ((status = chown (file, euid, (uid_t) -1)) )
+ error (0, errno, _( "can't chown %s"), file);
+
+ return status;
+}
+#endif /* SECURE_MAN_UID */
+
+
+/* return a (malloced) temporary name in cat_file's directory */
+static char *tmp_cat_filename (char *cat_file)
+{
+ char *name = xmalloc (strlen (cat_file) + 12);
+ char *base;
+ strcpy (name, cat_file);
+ base = basename(name);
+ sprintf (base, "%d", getpid());
+ return name;
+}
+
+
+/* If delete unlink tmp_cat, else commit tmp_cat to cat_file.
+ Return non-zero on error.
+ */
+static int commit_tmp_cat (char *cat_file, char *tmp_cat, int delete)
+{
+ int status;
+
+ if (!delete) {
+ if (debug) {
+ fprintf (stderr, "fixing temporary cat's mode\n");
+ status = 0;
+ } else {
+ status = chmod (tmp_cat, CATMODE);
+ if (status)
+ error(0, errno, _( "can't chmod %s"), tmp_cat);
+ }
+ } else
+ status = 0;
+
+#if defined(SECURE_MAN_UID) && defined(MAN_CATS)
+ /* @@@ if root has a private man hierarchy (strange idea), the
+ generated cats don't belong to him */
+ if (!delete && !status && (ruid == 0)) {
+ if (debug) {
+ fprintf (stderr, "chowning temporary cat\n");
+ status = 0;
+ } else {
+ status = do_chown(tmp_cat);
+ if (status)
+ error(0, errno, _( "can't chown %s"), tmp_cat);
+ }
+ }
+#endif /* SECURE_MAN_UID && MAN_CATS */
+
+ if (!delete && !status) {
+ if (debug) {
+ fprintf (stderr, "renaming temporary cat to %s\n",
+ cat_file);
+ status = 0;
+ } else {
+ if ((status = rename (tmp_cat, cat_file)))
+ error (0, errno, _( "can't rename %s to %s"), tmp_cat, cat_file);
+ }
+ }
+
+ if (delete || status) {
+ if (debug)
+ fprintf (stderr, "unlinking temporary cat\n");
+ else
+ if (unlink (tmp_cat))
+ error (0, errno, _( "can't unlink %s"), tmp_cat);
+ }
+
+ return status;
+}
+
+#ifdef MAN_CATS
+
+/* Return stream to write formatted manual page to for saving as cat file */
+static __inline__ FILE *open_cat_stream (char *cat_file)
+{
+ FILE *save;
+# ifdef COMP_CAT
+ pid_t child;
+ int pipe_fd[2];
+# endif
+
+ tmp_cat_file = tmp_cat_filename (cat_file);
+ if (!debug) {
+ push_cleanup ((void (*)())unlink, tmp_cat_file);
+ }
+
+# ifdef COMP_CAT
+ /* write to a pipe that compresses into tmp_cat_file */
+
+ /* create pipe */
+ if (pipe (pipe_fd)) {
+ error (0, errno, _( "can't create pipe"));
+ return NULL;
+ }
+
+ /* fork the compressor */
+ fflush (NULL);
+ child = fork ();
+ if (child < 0) {
+ error (0, errno, _( "can't fork"));
+ return NULL;
+ } else if (child == 0) {
+ /* compress reading end of pipe to tmp_cat_file */
+ char *const envp[] = { NULL };
+ int cat_fd;
+
+ pop_all_cleanups ();
+
+ if (debug) {
+ fprintf (stderr, "compressing to temporary cat %s\n",
+ tmp_cat_file);
+ tmp_cat_file = "/dev/null";
+ }
+
+ /* connect standard input to reading end of pipe */
+ if (dup2 (pipe_fd[0], 0) == -1)
+ error (0, errno, _( "can't dup2"));
+ close (pipe_fd[0]);
+ close (pipe_fd[1]);
+
+ /* set up standard output to write to tmp_cat_file */
+ cat_fd = open (tmp_cat_file, O_WRONLY|O_CREAT|O_TRUNC, CATMODE);
+ if (cat_fd == -1) {
+ error (FATAL, errno, _( "can't create %s"), tmp_cat_file);
+ }
+ if (dup2 (cat_fd, 1) == -1)
+ error (0, errno, _( "can't dup2"));
+ close (cat_fd);
+
+ nice (10);
+
+ /* compress standard input to standard output */
+ /* @@@ disgusting: have to split COMPRESSOR into argv */
+ {
+ char *cmd;
+ char *path;
+ char *argv[8];
+ int n;
+ cmd = xstrdup (COMPRESSOR);
+ path = strtok (cmd, " \t\n");
+ argv[0] = basename (path);
+ for (n = 1; argv[n-1]; ++n) {
+ argv[n] = strtok (NULL, " \t\n");
+ }
+ execve (path, argv, envp);
+ error (FATAL, errno, _( "can't exec %s"), path);
+ }
+ }
+
+ /* connect save to the writing end of pipe */
+ close (pipe_fd[0]);
+ save = fdopen (pipe_fd[1], "w");
+
+ cat_comp_pid = child;
+# else
+ /* write directly to tmp_cat_file */
+ if (debug) {
+ fprintf (stderr, "saving to temporary cat %s\n", tmp_cat_file);
+ tmp_cat_file = "/dev/null";
+ } else {
+ push_cleanup ((void (*)())unlink, tmp_cat_file);
+ }
+ save = fopen (tmp_cat_file, "w");
+# endif
+
+ return save;
+}
+
+/* Close the cat page stream, return non-zero on error.
+ If delete don't update the cat file.
+ */
+static __inline__ int close_cat_stream (FILE *cat_stream, char *cat_file, int delete)
+{
+ int status;
+
+ status = fclose (cat_stream);
+# ifdef COMP_CAT
+ { /* get compressor's exit status */
+ int comp_status;
+
+ while (waitpid (cat_comp_pid, &comp_status, 0) == -1) {
+ if (errno != EINTR) {
+ error (0, errno, _( "waiting for pid %u"), cat_comp_pid);
+ comp_status = -1;
+ break;
+ }
+ }
+
+ if (debug)
+ fprintf (stderr, "compressor exited with status %d\n",
+ comp_status);
+ status |= comp_status;
+ }
+# endif
+ status |= commit_tmp_cat (cat_file, tmp_cat_file, delete || status);
+ if (!debug) pop_cleanup ();
+ free (tmp_cat_file);
+ return status;
+}
+
+/*
+ * format a manual page with roff_cmd, display it with disp_cmd, and
+ * save it to cat_file
+ */
+static int format_display_and_save (char *roff_cmd, char *disp_cmd, char *cat_file)
+{
+ FILE *in = checked_popen (roff_cmd, "r");
+ FILE *out = checked_popen (disp_cmd, "w");
+ FILE *sav = open_cat_stream (cat_file);
+ int instat = 1, outstat;
+ RETSIGTYPE (*old_handler)() = signal (SIGPIPE, SIG_IGN);
+
+ if (in && out) {
+ /* copy in to both out and sav */
+ char buf[PIPE_BUF];
+ int inned; /* #bytes in buf */
+ int outing = 1;
+ int saving = sav != NULL;
+
+ while ((inned = fread (buf, 1, PIPE_BUF, in))) {
+ int outed = 0; /* #bytes already written to out */
+ int saved = 0; /* dto. to sav */
+
+ /* write buf to out and sav, cope with short writes */
+ do {
+ int n;
+
+ if (outing && (outed < inned)) {
+ n = fwrite (buf+outed, 1, inned-outed,
+ out);
+ outed += n;
+ if (!n && saving)
+ fprintf (stderr, _( "Still saving the page, please wait...\n"));
+ outing = n; /* stop outing on error */
+ }
+
+ if (saving && (saved < inned)) {
+ n = fwrite (buf+saved, 1, inned-saved,
+ sav);
+ saved += n;
+ saving = n; /* stop saving on error */
+ }
+
+ } while ( (outing && (outed < inned))
+ || (saving && (saved < inned)) );
+ }
+ }
+
+ if (in) instat = pclose (in);
+ if (sav) close_cat_stream (sav, cat_file, instat);
+ if (out) outstat = pclose (out);
+ signal (SIGPIPE, old_handler);
+ return instat;
+}
+#endif /* MAN_CATS */
+
+/*
+ * optionally chdir to dir, if necessary update cat_file from man_file
+ * and display it. if man_file is NULL cat_file is a stray cat. If
+ * !save_cat or cat_file is NULL we must not save the formatted cat.
+ * If man_file is "" this is a special case -- we expect the man page
+ * on standard input.
+ */
+static int display (char *dir, char *man_file, char *cat_file, char *title)
+{
+ int found;
+ static int pause;
+ char *roff_cmd; /* command to format man_file to stdout */
+
+ /* if dir is set chdir to it */
+ if (dir) {
+ if (debug)
+ fprintf (stderr, "chdir %s\n", dir);
+
+ if (chdir (dir)) {
+ error (0, errno, _( "can't chdir to %s"), dir);
+ return 0;
+ }
+ }
+
+ /* define roff_cmd */
+ {
+ char *source_file;
+#ifdef COMP_SRC
+ if ( !man_file || !(source_file = get_ztemp()) )
+ source_file = man_file;
+#else
+ source_file = man_file;
+#endif /* COMP_SRC */
+
+ if (source_file)
+ roff_cmd = make_roff_command (dir, source_file);
+ else
+ roff_cmd = NULL;
+ }
+
+ if (troff) {
+ found = !access (man_file, R_OK);
+ if (found) {
+ if (pause && do_prompt(title))
+ return 0;
+ checked_system (roff_cmd);
+ }
+ } else {
+
+ int format;
+ char *cmd;
+ int status;
+ char *catpath;
+
+ /* cat_file is the alternate cat_file.. */
+ /* If !man_file, we have a straycat
+ If !cat_file, we can't produce a cat_file, but we
+ may still have one tucked away under /usr...
+ Check there first ala the FSSTND, and display if newer
+ than man_file, if older, ignore it altogether */
+
+ if (!local_man_file && global_manpath) {
+ catpath = global_catpath(dir);
+
+ assert (catpath);
+ assert (dir);
+
+ if (man_file && strcmp(catpath, dir) != 0) {
+ /* we may have a FSSTND cat != cat_file */
+ char *std_cat_file;
+
+ std_cat_file = convert_name(man_file, NULL);
+ status = is_newer (man_file, std_cat_file);
+
+ if (status != -2 && !(status & 1) == 1) {
+ cat_file = std_cat_file;
+ save_cat = format = 0;
+ } else
+ format = 1;
+ /* @@@ memory leak of std_cat_file */
+ } else
+ format = 1;
+
+ free (catpath);
+ } else
+ format = 1;
+
+ if (!man_file) {
+ assert (cat_file);
+ format = 0;
+ } else if (!cat_file) {
+ assert (man_file);
+ save_cat = 0;
+ format = 1;
+ } else if (format) {
+ int status;
+ char *cat_dir;
+ char *tmp;
+
+ status = is_newer (man_file, cat_file);
+ format = (status == -2) || ((status & 1) == 1);
+
+ /* don't save if we haven't a cat directory */
+ cat_dir = xstrdup (cat_file);
+ if ((tmp = strrchr (cat_dir, '/'))) *tmp = 0;
+ save_cat = is_directory (cat_dir) == 1;
+ if (debug && !save_cat)
+ fprintf(stderr, "cat dir %s does not exist\n",
+ cat_dir);
+ free (cat_dir);
+ }
+
+ /* if we're trying to read stdin via '-l -' then man_file will be ""
+ * which access() obviously barfs on, but all is well because the
+ * roff_cmd will have been created to expect input via stdin.
+ * So we special-case this to avoid the bogus access() check.
+ */
+ if (format == 1 && *man_file == '\0')
+ found = 1;
+ else
+ found = !access (format ? man_file : cat_file, R_OK);
+
+ if (debug)
+ fprintf(stderr, "format: %d, save_cat: %d, found: %d\n",
+ format, save_cat, found);
+
+ if (found) {
+ if (print_where) {
+ if (man_file)
+ printf ("%s ", man_file);
+ if (cat_file && !format)
+ printf ("%s ", cat_file);
+ putchar ('\n');
+ } else if (catman) {
+ if (format) {
+ if (!save_cat) {
+ error (0, 0, _( "\ncannot write to %s in catman mode"), cat_file);
+ } else {
+ char *tmpcat = tmp_cat_filename (cat_file);
+ cmd = strappend (NULL, roff_cmd,
+#ifdef COMP_CAT
+ " | " COMPRESSOR " >",
+#else
+ " >",
+#endif /* COMP_CAT */
+ tmpcat, NULL);
+ /* save the cat as real user
+ (1) required for user man hierarchy
+ (2) else depending on ruid's privs
+ is ok, effectively disables
+ catman for non-root.
+ */
+ push_cleanup ((void (*)())unlink, tmpcat);
+ status = do_system_drop_privs (cmd);
+ if (status) gripe_system (cmd, status);
+ free (cmd);
+
+ commit_tmp_cat (cat_file, tmpcat, status);
+ pop_cleanup ();
+ free (tmpcat);
+ }
+ }
+
+ } else if (format) {
+ /* no cat or out of date */
+ char *disp_cmd;
+
+ if (pause && do_prompt(title)) {
+ if (roff_cmd)
+ free (roff_cmd);
+ if (local_man_file)
+ return 1;
+ else
+ return 0;
+ }
+
+ fprintf (stderr, _( "Reformatting %s, please wait...\n"), title);
+ disp_cmd = make_display_command (NULL, title);
+
+#ifdef MAN_CATS
+ if (save_cat) {
+ /* save cat */
+ format_display_and_save (roff_cmd,
+ disp_cmd,
+ cat_file);
+ } else
+#endif /* MAN_CATS */
+ {
+ /* don't save cat */
+ cmd = strappend (NULL, roff_cmd,
+ " | ", disp_cmd, NULL);
+ status = do_system_drop_privs (cmd);
+ /* some shells report broken pipe, ignore it */
+ if (status &&
+ (status != 256*(SIGPIPE + 0x80)) )
+ gripe_system (disp_cmd, status);
+ free (cmd);
+ }
+
+ free (disp_cmd);
+
+ } else {
+ /* display preformatted cat */
+#if defined(COMP_SRC)
+ struct compression *comp;
+
+ if (pause && do_prompt(title)) {
+ if (roff_cmd)
+ free (roff_cmd);
+ return 0;
+ }
+
+ comp = comp_info (cat_file);
+ if (comp) {
+ char *disp_cmd;
+
+ disp_cmd = make_display_command (NULL, title);
+ cmd = strappend (NULL, comp->prog,
+ " '", cat_file,
+ "' | ", disp_cmd, NULL);
+ free(disp_cmd);
+ } else
+ cmd = make_display_command (cat_file,
+ title);
+#elif defined(COMP_CAT)
+ char *disp_cmd;
+
+ if (pause && do_prompt(title)) {
+ if (roff_cmd)
+ free (roff_cmd);
+ return 0;
+ }
+
+ disp_cmd = make_display_command (NULL, title);
+ cmd = strappend (NULL, DECOMPRESSOR " '",
+ cat_file,
+ "' | ", disp_cmd, NULL);
+ free (disp_cmd);
+#else /* !(COMP_SRC || COMP_CAT) */
+ if (pause && do_prompt(title)) {
+ if (roff_cmd)
+ free (roff_cmd);
+ return 0;
+ }
+
+ cmd = make_display_command (cat_file, title);
+#endif /* COMP_SRC */
+ status = do_system_drop_privs (cmd);
+ /* some shells report broken pipe, ignore it */
+ if (status && (status != (SIGPIPE + 0x80) << 8))
+ gripe_system (cmd, status);
+ free (cmd);
+ }
+ }
+ }
+
+ if (roff_cmd)
+ free (roff_cmd);
+
+ if (!pause)
+ pause = found;
+
+ return found;
+}
+
+
+static char *find_cat_file (char *path, char *man_file, char *sec)
+{
+ char *cat_file, *cat_path;
+
+ /* could do this with `global' */
+
+ cat_path = global_catpath(man_file);
+ cat_file = convert_name(man_file, cat_path);
+
+ if (cat_path)
+ free(cat_path);
+
+ return cat_file;
+}
+
+
+/*
+ * See if the preformatted man page or the source exists in the given
+ * section.
+ */
+static int try_section (char *path, char *sec, char *name)
+{
+ int found = 0;
+ char **names, **np;
+ char *title;
+
+ if (debug)
+ fprintf (stderr, "trying section %s with globbing\n", sec);
+
+ title = strappend (NULL, name, "(", sec, ")", NULL);
+
+#ifndef NROFF_MISSING /* #ifdef NROFF */
+ /*
+ * Look for man page source files.
+ */
+
+ names = look_for_file(path, sec, name, 0);
+ if (!names)
+ /*
+ * No files match.
+ * See if there's a preformatted page around that
+ * we can display.
+ */
+#endif /* NROFF_MISSING */
+ {
+ if (catman) {
+ free(title);
+ return ++found;
+ }
+
+ if (!troff) {
+ names = look_for_file (path, sec, name, 1);
+
+ if (names)
+ for (np = names; *np; np++)
+ found += display (path, NULL, *np,
+ title);
+ }
+ }
+#ifndef NROFF_MISSING
+ else {
+ for (np = names; *np ; np++){
+ char *man_file;
+ char *cat_file;
+
+ if ( (man_file = ult_src (*np, path, NULL, SO_LINK|SOFT_LINK|HARD_LINK)) == NULL) {
+ free (title);
+ return 0;
+ }
+
+ if (debug)
+ fprintf (stderr, "found ultimate source file %s\n", man_file);
+ lang = lang_dir (man_file);
+
+ cat_file = find_cat_file (path, man_file, sec);
+ found += display (path, man_file, cat_file, title);
+ free (cat_file);
+#ifdef COMP_SRC
+ /* if ult_src() produced a ztemp file, we need to
+ remove it (and unexist it) before proceeding */
+ remove_ztemp();
+#endif /* COMP_SRC */
+ /* free(man_file); can't free this, it's static !! */
+ }
+ }
+#endif /* NROFF_MISSING */
+
+ free (title);
+ return found;
+}
+
+#ifdef MAN_DB_UPDATES
+/* wrapper to dbdelete which deals with opening/closing the db */
+static void dbdelete_wrapper(char *page, struct mandata *info)
+{
+ if ( !catman && (dbf = MYDBM_RWOPEN(database)) ) {
+ if ( dbdelete(page, info) == 1)
+ if (debug)
+ fprintf(stderr, "%s(%s) not in db!\n",
+ page, info->ext);
+ MYDBM_CLOSE(dbf);
+ }
+}
+#endif /* MAN_DB_UPDATES */
+
+/* This started out life as try_section, but a lot of that routine is
+ redundant wrt the db cache. */
+static int try_db_section (char *orig_name, char *path, struct mandata *in)
+{
+ int found = 0;
+ char *file, *name;
+ char *title;
+#ifdef MAN_DB_UPDATES
+ struct stat buf;
+#endif
+
+ if (debug) {
+ fprintf (stderr, "trying a db located file.\n");
+ dbprintf(in);
+ }
+
+ /* if the pointer holds some data, this is a reference to the
+ real page, use that instead. */
+ if (*in->pointer != '-')
+ name = in->pointer;
+ else
+ name = orig_name;
+
+ dbfilters = in->filter;
+
+ /* make sure the file we want is the same as the one in the
+ filesystem */
+
+#ifdef MAN_DB_UPDATES
+ /* The next piece of code examines the db found manual page
+ and checks for consistency */
+ file = make_filename(path, name, in, "man");
+ if (lstat(file, &buf) == 0 && buf.st_mtime != in->_st_mtime) {
+ /* update of this file required */
+ if (debug)
+ fprintf(stderr, "%s needs to be recached: %ld %ld.\n",
+ file, (long)in->_st_mtime, (long)buf.st_mtime);
+ if ( (dbf = MYDBM_RWOPEN(database)) ) {
+ dbdelete(orig_name, in);
+ test_manfile(file, path);
+ in = dblookup_exact(orig_name, in->ext);
+ MYDBM_CLOSE(dbf);
+ if (!in)
+ return 0;
+ if (*in->pointer != '-')
+ name = in->pointer;
+ else
+ name = orig_name;
+ }
+ else
+ error (0, errno, _( "can't update index cache %s"), database);
+ }
+#endif /* MAN_DB_UPDATES */
+
+#ifndef NROFF_MISSING /* #ifdef NROFF */
+ /*
+ * Look for man page source files.
+ */
+
+ title = strappend (NULL, name, "(", in->ext, ")", NULL);
+
+ if (in->id < STRAY_CAT) { /* There should be a src page */
+ file = make_filename(path, name, in, "man");
+ if (debug)
+ fprintf(stderr, "Checking physical location: %s\n", file);
+
+ if (access (file, R_OK) == 0) {
+ char *man_file;
+ char *cat_file;
+
+ if ( (man_file = ult_src( file, path, NULL, SO_LINK|SOFT_LINK|HARD_LINK))
+ == NULL) {
+ free (title);
+ return found; /* zero */
+ }
+
+ if (debug)
+ fprintf (stderr, "found ultimate source file %s\n", man_file);
+ lang = lang_dir (man_file);
+
+ cat_file = find_cat_file (path, man_file, in->ext);
+ found += display (path, man_file, cat_file, title);
+ free (cat_file);
+#ifdef COMP_SRC
+ /* if ult_src() produced a ztemp file, we need to
+ remove it (and unexist it) before proceeding */
+ remove_ztemp();
+#endif /* COMP_SRC */
+
+ } /* else {drop through to the bottom and return 0 anyway} */
+ } else
+
+#endif /* NROFF_MISSING */
+
+ if (in->id <= WHATIS_CAT) {
+
+ /* The db says we have a stray cat or whatis ref */
+
+ if (catman) {
+ free (title);
+ return ++found;
+ }
+
+ /* show this page but force an update later to make sure
+ we haven't just added the new page */
+ found_a_stray = 1;
+
+ if (!troff) {
+ file = make_filename(path, name, in, "cat");
+ if (debug)
+ fprintf(stderr, "Checking physical location: %s\n", file);
+
+ if ( access(file, R_OK) != 0 ) {
+ char *catpath;
+ catpath = global_catpath(path);
+
+ if ( catpath && strcmp(catpath, path) != 0 ) {
+
+ file = make_filename(catpath, name,
+ in, "cat");
+ free(catpath);
+ if (debug)
+ fprintf(stderr, "Checking physical location: %s\n", file);
+
+ if ( access(file, R_OK) != 0 ) {
+ /* don't delete here,
+ return==0 will do that */
+ free (title);
+ return found; /* zero */
+ }
+ } else {
+ if (catpath)
+ free(catpath);
+ free (title);
+ return found; /* zero */
+ }
+ }
+
+ found += display (path, NULL, file, title);
+ }
+ }
+ free (title);
+ return found;
+}
+
+/* test for existence, if fail: call dbdelete_wrapper, else return amount */
+static int exist_check(char *name, char *manpath, struct mandata *loc)
+{
+ int exists;
+
+ exists = try_db_section(name, manpath, loc);
+
+#ifdef MAN_DB_UPDATES
+ if ( !exists && !skip ) {
+ if (debug) fprintf(stderr, "dbdelete_wrapper =%s =%s\n", name, loc);
+ dbdelete_wrapper(name, loc);
+ }
+#endif /* MAN_DB_UPDATES */
+
+ return exists;
+}
+
+/* db wrapper for try_db_section(). If db not accessable, return -1,
+ otherwise return amount of pages found/displayed */
+static int try_db(char *manpath, char *sec, char *name)
+{
+ int found = 0;
+ struct nlist *in_cache;
+ struct mandata *loc, *data, *store[ENTRIES], *exact_ext = NULL;
+ struct mandata **exact_sec = store;
+
+ /* find out where our db for this manpath should be */
+
+ if (global_manpath) {
+ char *catpath;
+
+ catpath = global_catpath(manpath);
+ assert(catpath);
+ database = mkdbname(catpath);
+ free(catpath);
+ } else
+ database = mkdbname(manpath);
+
+ in_cache = lookup(manpath); /* have we looked here already? */
+
+ if ( !in_cache ) {
+ if ( (dbf = MYDBM_RDOPEN(database)) && !dbver_rd(dbf)) {
+ if (debug)
+ fprintf(stderr,
+ "Succeeded in opening %s O_RDONLY\n",
+ database);
+
+ /* if section is set, only return those that match,
+ otherwise NULL retrieves all available */
+ data = dblookup_all(name, section);
+ (void) install_db_ptr(manpath, data);
+ MYDBM_CLOSE(dbf);
+#ifdef MAN_DB_CREATES
+ } else if (!global_manpath) {
+ /* create one */
+ free_hashtab();
+ if (debug)
+ fprintf(stderr,
+ "Failed to open %s O_RDONLY\n",
+ database);
+ /* create_db should really return EOF on failure. */
+ if (create_db (manpath) == 0) {
+ data = infoalloc();
+ data->next = NULL; data->addr = NULL;
+ (void) install_db_ptr(manpath, data);
+ return -1;
+ }
+ return -2;
+#endif /* MAN_DB_CREATES */
+ } else {
+ if (debug)
+ fprintf(stderr,
+ "Failed to open %s O_RDONLY\n",
+ database);
+ data = infoalloc();
+ data->next = (struct mandata *) NULL;
+ data->addr = NULL;
+ (void) install_db_ptr(manpath, data);
+ return -1; /* indicate failure to open db */
+ }
+ } else
+ data = in_cache->defn;
+
+ /* if we already know that there is nothing here, get on with it */
+ if (!data)
+ return found; /* 0 */
+
+ /* We already tried (and failed) to open this db before */
+ if (!data->addr)
+ return -1;
+
+ /* cycle through the mandata structures (there's usually only
+ 1 or 2) and see what we have w.r.t. the current section */
+ for (loc = data; loc; loc = loc->next) {
+ if (!extension || strcmp(extension, loc->ext) == 0
+ || strcmp(extension,
+ loc->ext + strlen(sec)) == 0) {
+ if (strcmp(loc->ext, sec) == 0)
+ exact_ext = loc;
+ else if (strncmp(loc->ext, sec, strlen(sec) ) == 0)
+ *(exact_sec++) = loc;
+ }
+ }
+ *exact_sec = NULL;
+
+ /* ALL free()ing of structures must be done by free_hashtab() only */
+
+ /* first see if we have the right extension */
+ if (exact_ext)
+ found = exist_check(name, manpath, exact_ext);
+
+ /* if (not or -a) and (we have a correct section), show that */
+ if (findall || !found) {
+ for (exact_sec = store; *exact_sec; exact_sec++) {
+ found += exist_check(name, manpath, *exact_sec);
+ if (found && !findall)
+ break;
+ }
+ }
+
+ return found;
+}
+
+/* try to locate the page under the specified manpath, in the derised section,
+ with the supplied name. glob if necessary. Initially try to find it via
+ a db cache access, if that fails, search the filesystem. */
+static int locate_page(char *manpath, char *sec, char *name)
+{
+ int found, db_ok;
+
+ /* sort out whether we want to treat this hierarchy as
+ global or user. Differences:
+
+ global: if setuid, use privs; don't create db.
+ user : if setuid, drop privs; allow db creation. */
+
+ if (is_global_mandir(manpath)) {
+ global_manpath = 1;
+ } else {
+ global_manpath = 0;
+ drop_effective_privs();
+ }
+
+ if (debug)
+ fprintf (stderr, "searching in %s, section %s\n",
+ manpath, sec);
+
+ db_ok = try_db(manpath, sec, name);
+
+#ifdef MAN_DB_CREATES
+ if (db_ok == -2) /* we created a db in the last call */
+ db_ok = try_db(manpath, sec, name);
+#endif /* MAN_DB_CREATES */
+
+ if (db_ok == -1) /* we failed to find/open a db */
+ found = try_section (manpath, sec, name);
+ else
+ found = db_ok;
+
+ if (!global_manpath)
+ regain_effective_privs();
+
+ return found;
+}
+
+/*
+ * Search for manual pages.
+ *
+ * If preformatted manual pages are supported, look for the formatted
+ * file first, then the man page source file. If they both exist and
+ * the man page source file is newer, or only the source file exists,
+ * try to reformat it and write the results in the cat directory. If
+ * it is not possible to write the cat file, simply format and display
+ * the man file.
+ *
+ * If preformatted pages are not supported, or the troff option is
+ * being used, only look for the man page source file.
+ *
+ */
+static int man (char *name)
+{
+ int found = 0;
+
+ fflush (stdout);
+
+ if (section) {
+ char **mp;
+
+ for (mp = manpathlist; *mp; mp++) {
+ found += locate_page(*mp, section, name);
+ if (found && !findall) /* i.e. only do this section... */
+ return found;
+ }
+ } else {
+ char **sp;
+
+ /* sections in manpath are only 1 char */
+ for (sp = section_list; *sp && !sp[0][1]; sp++) {
+ char **mp;
+
+ for (mp = manpathlist; *mp; mp++) {
+ found += locate_page(*mp, *sp, name);
+ if (found && !findall) /* i.e. only do this section... */
+ return found;
+ }
+ }
+ }
+
+#ifdef MAN_DB_UPDATES
+ /* check to see if any of the databases need updating */
+ if ((!found || found_a_stray) && update_required) {
+ /* must free_hashtab() here in case testmandirs()
+ wants to use it */
+ free_hashtab();
+
+ if ( need_to_rerun() )
+ return man(name);
+ }
+#endif /* MAN_DB_UPDATES */
+
+ return found;
+}
+
+
+static __inline__ char **get_section_list (void)
+{
+ int i = 0;
+ char **sections = NULL;
+ char *sec;
+
+ if (colon_sep_section_list == NULL) {
+ colon_sep_section_list = getenv ("MANSECT");
+ if (colon_sep_section_list == NULL ||
+ *colon_sep_section_list == '\0')
+ return std_sections;
+ }
+
+ sec = xstrdup(colon_sep_section_list);
+
+ for (sec = strtok(colon_sep_section_list, ":"); sec;
+ sec = strtok(NULL, ":")) {
+ sections = (char **) xrealloc (sections,
+ (i + 2) * sizeof (char *));
+ sections[i++] = sec;
+ }
+ sections[i] = NULL;
+ return sections;
+}
+
+/* allow user to skip a page or quit after viewing desired page
+ return 1 to skip
+ return 0 to view
+ */
+static __inline__ int do_prompt (char *name)
+{
+ int ch;
+
+ skip = 0;
+ if (isatty (STDOUT_FILENO) && isatty (STDIN_FILENO)) {
+ fprintf (stderr, _(
+ "--Man-- next: %s "
+ "[ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]\n"),
+ name);
+ fflush (stderr);
+
+ do {
+ ch=getchar();
+ switch( ch ) {
+ case '\n':
+ return 0;
+ case EOF:
+ skip = 1;
+ return 1;
+ default:
+ break;
+ }
+ } while (1);
+ }
+ return 0;
+}
+
+void (int_handler)( int signo)
+{
+ if (debug)
+ fprintf (stderr, "\ninterrupt signal %d handler\n", signo);
+ exit( INTERRUPTED);
+}
diff --git a/src/man.h b/src/man.h
new file mode 100644
index 00000000..aba60849
--- /dev/null
+++ b/src/man.h
@@ -0,0 +1,17 @@
+/* man.c */
+static void man_getopt(int argc, char *argv[]);
+static __inline__ char *is_section(char *name);
+static __inline__ char **get_section_list (void);
+static int man (char *name);
+static int display (char *dir, char *man_file, char *cat_file, char *title);
+static __inline__ char *make_roff_command(char *dir, char *file);
+static __inline__ int do_prompt (char *name);
+
+/* convert_name.c */
+extern char *convert_name (char *name, char *alternate);
+
+/* globbing.c */
+extern char **look_for_file(char *path, char *sec, char *name, int cat);
+
+/* check_mandirs.c */
+extern char *make_filename(char *path, char *name, struct mandata *in, char *type);
diff --git a/src/man.sh b/src/man.sh
new file mode 100644
index 00000000..e925c75a
--- /dev/null
+++ b/src/man.sh
@@ -0,0 +1,8 @@
+#!/bin/sh -e
+pgm=`basename $0`
+edir=/usr/lib/man-db
+cmd="${edir}/${pgm} ${1+$@}"
+[ `id -u` = 0 ] || exec ${cmd}
+su nobody -c "/bin/true" && exec su nobody -c "$cmd"
+su -s /bin/true 2>/dev/null && exec su -s /bin/sh nobody -c "$cmd"
+exec su man -c "$cmd"
diff --git a/src/man_db-nls.h b/src/man_db-nls.h
new file mode 100644
index 00000000..2f9b91ae
--- /dev/null
+++ b/src/man_db-nls.h
@@ -0,0 +1,141 @@
+
+#define manpSet 0x1
+#define manp_PARSE_CONF 0x1
+#define manp_STAT 0x2
+#define manp_NOT_DIR 0x3
+#define manp_MANPATH 0x4
+#define manp_NO_PATH 0x5
+#define manp_MT_PATH 0x6
+#define manp_MKDIR_CAT1 0x7
+#define manp_MKDIR_CAT2 0x8
+#define manp_OPEN_CONF 0x9
+#define manp_PARSE_DIRS 0xa
+#define manp_MISS_DIR 0xb
+#define manp_CWD 0xc
+#define manp_NO_TREE 0xd
+#define manp_PREFIX 0xe
+
+#define whatisSet 0x2
+#define whatis_APROPOS_USAGE 0x1
+#define whatis_APROPOS_OPTIONS 0x2
+#define whatis_WHATIS_USAGE 0x3
+#define whatis_WHATIS_OPTIONS 0x4
+#define whatis_WHATIS 0x5
+#define whatis_UNKNOWN 0x6
+#define whatis_NOTHING_APPROPRIATE 0x7
+#define whatis_WHAT_WHAT 0x8
+#define whatis_FAILED_REGEX 0x9
+
+#define securitySet 0x3
+#define security_EUID 0x1
+#define security_REMOVE 0x2
+#define security_FORK 0x3
+
+#define u_sSet 0x4
+#define u_s_OPENDIR 0x1
+#define u_s_DANGLE 0x2
+#define u_s_RESOLVE 0x3
+#define u_s_SELF_REF 0x4
+#define u_s_OPEN 0x5
+
+#define catmanSet 0x5
+#define catman_USAGE 0x1
+#define catman_OPTIONS 0x2
+#define catman_RD_DB 0x3
+#define catman_FORK_FAILED 0x4
+#define catman_WAIT4MAN 0x5
+#define catman_MAN_FAILED 0x6
+#define catman_RESET_CURSOR 0x7
+#define catman_NULL_CONTENT 0x8
+#define catman_UPDATE_DB_MSG 0x9
+#define catman_NO_WRITE 0xa
+#define catman_NO_DB 0xb
+
+#define straySet 0x6
+#define stray_OPENDIR 0x1
+#define stray_BOGUS 0x2
+#define strayANGLE 0x3
+#define strayESOLVE 0x4
+#define stray_NO_WHATIS 0x5
+#define stray_CHECK 0x6
+#define stray_UPDATE_DB 0x7
+
+#define lexgrogSet 0x7
+#define lexgrog_TOOBIG 0x1
+#define lexgrog_OPEN 0x2
+
+#define manpathSet 0x8
+#define manpath_USAGE 0x1
+#define manpath_OPT 0x2
+#define manpath_NO_GLOBAL 0x3
+
+#define compressionSet 0x9
+#define compression_TEMPNAM 0x1
+
+#define versionSet 0xa
+#define version_STRING 0x1
+#define version_STRING2 0x2
+
+#define convnamSet 0xb
+#define convnam_FAIL 0x1
+
+#define c_mSet 0xc
+#define c_m_BOGUS 0x1
+#define c_m_MULT_EXT 0x2
+#define c_m_BAD_INCL 0x3
+#define c_m_MT_MAN 0x4
+#define c_m_NO_WHATIS 0x5
+#define c_m_OPENDIR 0x6
+#define c_m_UPDATE_DB 0x7
+#define c_m_UPDATE_DB_MSG 0x8
+#define c_m_CREATE_DB 0x9
+#define c_m_DONE 0xa
+
+#define manSet 0xd
+#define man_POPEN 0x1
+#define man_SYSTEM 0x2
+#define man_USAGE_TROFF 0x3
+#define man_USAGE_NOTROFF 0x4
+#define man_OPT1 0x5
+#define man_OPT2 0x6
+#define man_OPTDIT 0x7
+#define man_OPT3 0x8
+#define man_OPT4 0x9
+#define man_NO_NAME_S 0xa
+#define man_NO_NAME 0xb
+#define man_NO_SRC_MAN 0xc
+#define man_NO_MAN 0xd
+#define man_SEC 0xe
+#define man_LESS_PROMPT 0xf
+#define man_INCOMP_OPT 0x10
+#define man_BAD_PP 0x11
+#define man_CHOWN 0x12
+#define man_CHMOD 0x13
+#define man_RENAME 0x14
+#define man_UNLINK 0x15
+#define man_PIPE 0x16
+#define man_FORK 0x17
+#define man_DUP2 0x18
+#define man_CREATE_CAT 0x19
+#define man_EXEC 0x1a
+#define man_WAITPID 0x1b
+#define man_STILL_SAVING 0x1c
+#define man_CD 0x1d
+#define man_NO_CAT 0x1e
+#define man_REFORMAT 0x1f
+#define man_UPDATE_DB 0x20
+#define man_NEXT 0x21
+
+#define mandbSet 0xe
+#define mandb_USAGE 0x1
+#define mandb_OPTIONS 0x2
+#define mandb_REMOVE 0x3
+#define mandb_RENAME 0x4
+#define mandb_CHMOD 0x5
+#define mandb_CHOWN 0x6
+#define mandb_PROCESS 0x7
+#define mandb_NO_USER 0x8
+#define mandb_NO_DIRECTIVES 0x9
+#define mandb_MANS 0xa
+#define mandb_STRAYS 0xb
+#define mandb_ADDED 0xc
diff --git a/src/man_db.config b/src/man_db.config
new file mode 100644
index 00000000..bf0ea5aa
--- /dev/null
+++ b/src/man_db.config
@@ -0,0 +1,65 @@
+# man_db.config
+#
+# This file is used by the man_db package to configure the man and cat paths.
+# It is also used to provide a manpath for those without one by examining
+# their PATH environment variable. For details see the manpath(5) man page.
+#
+# Lines beginning with `#' are comments and are ignored. Any combination of
+# tabs or spaces may be used as `whitespace' separators.
+#
+# There are three mappings allowed in this file:
+# --------------------------------------------------------
+# MANDATORY_MANPATH manpath_element
+# MANPATH_MAP path_element manpath_element
+# MANDB_MAP global_manpath [relative_catpath]
+#---------------------------------------------------------
+# every automatically generated MANPATH includes these fields
+#
+#MANDATORY_MANPATH /usr/src/pvm3/man
+#
+MANDATORY_MANPATH /usr/man
+MANDATORY_MANPATH /usr/share/man
+MANDATORY_MANPATH /usr/X11R6/man
+MANDATORY_MANPATH /usr/local/man
+#---------------------------------------------------------
+# set up PATH to MANPATH mapping
+# ie. what man tree holds man pages for what binary directory.
+#
+# *PATH* -> *MANPATH*
+#
+MANPATH_MAP /bin /usr/share/man
+MANPATH_MAP /usr/bin /usr/share/man
+MANPATH_MAP /sbin /usr/share/man
+MANPATH_MAP /usr/sbin /usr/share/man
+MANPATH_MAP /usr/local/bin /usr/local/man
+MANPATH_MAP /usr/local/bin /usr/local/share/man
+MANPATH_MAP /usr/local/sbin /usr/local/man
+MANPATH_MAP /usr/local/sbin /usr/local/share/man
+MANPATH_MAP /usr/X11R6/bin /usr/X11R6/man
+MANPATH_MAP /usr/bin/X11 /usr/X11R6/man
+MANPATH_MAP /usr/games /usr/share/man
+MANPATH_MAP /opt/bin /opt/man
+MANPATH_MAP /opt/sbin /opt/man
+#---------------------------------------------------------
+# For a manpath element to be considered `global' it must be mentioned
+# below. Each line may have an optional extra string indicating the
+# catpath associated with the manpath. If no catpath string is used,
+# the catpath will default to the given manpath.
+#
+# You *must* provide all `global' man paths, including alternate system
+# man paths and locale specific manpaths and combinations of both, if
+# they exist, otherwise `user' permissions will be used to manipulate the
+# manual pages. Also, utilities like mandb will not initialise the database
+# cache for any manpaths not mentioned below.
+#
+# Any manpaths that are `contained' within other manpaths must be mentioned
+# *before* the containing manpath. E.g. /usr/man/preformat must be listed
+# before /usr/man.
+#
+# *MANPATH* -> *CATPATH*
+#
+MANDB_MAP /usr/man /var/cache/man/fsstnd
+MANDB_MAP /usr/share/man /var/cache/man
+MANDB_MAP /usr/local/man /var/cache/man/local
+MANDB_MAP /usr/X11R6/man /var/cache/man/X11R6
+MANDB_MAP /opt/man /var/cache/man/opt
diff --git a/src/mandb.c b/src/mandb.c
new file mode 100644
index 00000000..fd5baa1e
--- /dev/null
+++ b/src/mandb.c
@@ -0,0 +1,495 @@
+/*
+ * mandb.c: used to create and initialise global man database.
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * Tue Apr 26 12:56:44 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <stdio.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h> /* for chmod() */
+
+#if defined(STDC_HEADERS)
+# include <string.h>
+# include <stdlib.h>
+#elif defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#else /* no string(s) header */
+#endif /* STDC_HEADERS */
+
+#ifndef STDC_HEADERS
+extern int errno;
+#endif
+
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h>
+#else
+# define W_OK 2
+# ifdef HAVE_GETCWD_H
+extern char *getcwd();
+# else
+extern char *getwd();
+# endif
+#endif /* HAVE_UNISTD_H */
+
+#ifdef __profile__
+# if defined(HAVE_LIMITS_H) && defined(_POSIX_VERSION)
+# include <limits.h> /* for PATH_MAX */
+# else /* !(HAVE_LIMITS_H && _POSIX_VERSION) */
+# include <sys/param.h> /* for MAXPATHLEN */
+# endif /* HAVE_LIMITS_H */
+# ifndef PATH_MAX
+# ifdef _POSIX_VERSION
+# define PATH_MAX _POSIX_PATH_MAX
+# else /* !_POSIX_VERSION */
+# ifdef MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+# else /* !MAXPATHLEN */
+# define PATH_MAX 1024
+# endif /* MAXPATHLEN */
+# endif /* _POSIX_VERSION */
+# endif /* !PATH_MAX */
+#endif /* __profile__ */
+
+#ifdef SECURE_MAN_UID
+# include <pwd.h>
+#endif /* SECURE_MAN_UID */
+
+#ifdef HAVE_GETOPT_H
+# include <getopt.h>
+#else /* !HAVE_GETOPT_H */
+# include "lib/getopt.h"
+#endif /* HAVE_GETOPT_H */
+
+#include <locale.h>
+#include <libintl.h>
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+#include "libdb/mydbm.h"
+#include "lib/error.h"
+#include "lib/cleanup.h"
+#include "manp.h"
+
+#ifndef debug
+int debug = 0;
+#endif
+char *program_name;
+int quiet = 1;
+extern int opt_test; /* don't update db */
+MYDBM_FILE dbf;
+char *manp;
+char *database;
+
+/* default options */
+static const struct option long_options[] =
+{
+ {"create", no_argument, 0, 'c'},
+ {"debug", no_argument, 0, 'd'},
+ {"help", no_argument, 0, 'h'},
+ {"quiet", no_argument, 0, 'q'},
+ {"user-db", no_argument, 0, 'u'},
+ {"no-straycats", no_argument, 0, 's'},
+ {"test", no_argument, 0, 't'},
+ {"version", no_argument, 0, 'V'},
+ {0, 0, 0, 0}
+};
+
+static const char args[] = "cdhqstuV";
+static int check_for_strays = 1;
+static int user;
+static int create;
+
+#ifdef NDBM
+# ifdef BERKELEY_DB
+static char *dbfile;
+static char *tmpdbfile;
+# else /* !BERKELEY_DB NDBM */
+static char *dirfile;
+static char *pagfile;
+static char *tmpdirfile;
+static char *tmppagfile;
+# endif /* BERKELEY_DB */
+#else /* !NDBM */
+static char *xfile;
+static char *xtmpfile;
+#endif /* NDBM */
+
+#if defined(SECURE_MAN_UID) && defined(MAN_DB_UPDATES)
+static uid_t euid;
+# define DO_CHOWN
+#endif /* SECURE_MAN_UID && MAN_DB_UPDATES */
+
+extern char *optarg;
+extern int optind, opterr, optopt;
+extern char *manpathlist[];
+extern int pages;
+
+static void usage(int status)
+{
+ printf(_( "usage: %s [-dqsuc|-h|-V] [manpath]\n"), program_name);
+ printf(_(
+ "-d --debug produce debugging info.\n"
+ "-q --quiet work quietly, except for 'bogus' warning.\n"
+ "-s --no-straycats don't look for or add stray cats to the dbs.\n"
+ "-u --user-db produce user databases only.\n"
+ "-c --create create dbs from scratch, rather than updating.\n"
+ "-V --version show version.\n"
+ "-h --help show this usage message.\n")
+ );
+
+ exit (status);
+}
+
+/* remove() with error checking */
+static __inline__ void xremove(const char *path)
+{
+ if (remove(path) == -1 && errno != ENOENT)
+ error(0, errno, _( "can't remove %s"), path);
+}
+
+/* rename() with error checking */
+static __inline__ void xrename(const char *from, const char *to)
+{
+ if (rename(from, to) == -1 && errno != ENOENT) {
+ error(0, errno, _( "can't rename %s to %s"), from, to);
+ xremove (from);
+ }
+}
+
+/* CPhipps 2000/02/24 - Copy a file.
+ * Still plenty of error handling could be added here. */
+static __inline__ void xcopy(const char *from, const char *to)
+{
+ FILE* ifp = fopen(from, "r");
+ FILE* ofp = fopen(to, "w");
+
+ if (!ifp || !ofp) {
+ if (ifp) fclose(ifp);
+ if (ofp) fclose(ofp);
+ perror("fopen");
+ return;
+ }
+
+ while (!feof(ifp) && !ferror(ifp)) {
+ char buf[1024];
+ size_t in = fread(buf, 1, sizeof(buf), ifp);
+ if (in > 0) fwrite(buf, 1, in, ofp);
+ }
+ fclose(ifp); fclose(ofp);
+}
+
+/* chmod() with error checking */
+static __inline__ void xchmod(const char *path, mode_t mode)
+{
+ if (chmod(path, mode) == -1) {
+ error (0, errno, _( "can't chmod %s"), path);
+ xremove (path);
+ }
+}
+
+/* rename and chmod the database */
+static __inline__ void finish_up(void)
+{
+#ifdef NDBM
+# ifdef BERKELEY_DB
+ xrename (tmpdbfile, dbfile);
+ xchmod (dbfile, DBMODE);
+# else /* not BERKELEY_DB */
+ xrename (tmpdirfile, dirfile);
+ xchmod (dirfile, DBMODE);
+ xrename (tmppagfile, pagfile);
+ xchmod (pagfile, DBMODE);
+# endif /* BERKELEY_DB */
+#else /* not NDBM */
+ xrename (xtmpfile, xfile);
+ xchmod (xfile, DBMODE);
+#endif /* NDBM */
+}
+
+#ifdef DO_CHOWN
+/* chown() with error checking */
+static __inline__ void xchown(const char *path, uid_t owner, uid_t group)
+{
+ if (chown(path, owner, group) == -1) {
+ error (0, errno, _( "can't chown %s"), path);
+ xremove (path);
+ }
+}
+
+/* change the owner of global man databases */
+static __inline__ void do_chown(uid_t uid)
+{
+# ifdef NDBM
+# ifdef BERKELEY_DB
+ xchown (dbfile, uid, -1);
+# else /* not BERKELEY_DB */
+ xchown (dirfile, uid, -1);
+ xchown (pagfile, uid, -1);
+# endif /* BERKELEY_DB */
+# else /* not NDBM */
+ xchown (xfile, uid, -1);
+# endif /* NDBM */
+}
+#endif /* DO_CHOWN */
+
+/* dont actually create any dbs, just do an update */
+static __inline__ short update_db_wrapper(const char *manpath)
+{
+ short amount;
+
+ amount = update_db(manpath);
+ return (amount != EOF ? amount : create_db(manpath));
+}
+
+/* remove incomplete databases */
+static void cleanup (void *dummy)
+{
+#ifdef NDBM
+# ifdef BERKELEY_DB
+ unlink (tmpdbfile);
+# else /* !BERKELEY_DB NDBM */
+ unlink (tmpdirfile);
+ unlink (tmppagfile);
+# endif /* BERKELEY_DB NDBM */
+#else /* !NDBM */
+ unlink (xtmpfile);
+#endif /* NDBM */
+}
+
+/* sort out the database names */
+static short mandb(const char *catpath, const char *manpath)
+{
+ char pid[23];
+ short amount;
+ char *dbname;
+
+ dbname = mkdbname(catpath);
+ sprintf(pid, "%d", getpid());
+ database = strappend(NULL, catpath, "/", pid, NULL);
+
+ if (!quiet)
+ printf(_( "Processing manual pages under %s...\n"), manpath);
+#ifdef NDBM
+# ifdef BERKELEY_DB
+ dbfile = strappend(NULL, dbname, ".db", NULL);
+ tmpdbfile = strappend(NULL, database, ".db", NULL);
+ if (create) {
+ xremove (tmpdbfile);
+ amount = create_db(manpath);
+ } else {
+ xcopy (dbfile, tmpdbfile);
+ amount = update_db_wrapper (manpath);
+ }
+# else /* !BERKELEY_DB NDBM */
+ dirfile = strappend(NULL, dbname, ".dir", NULL);
+ pagfile = strappend(NULL, dbname, ".pag", NULL);
+ tmpdirfile = strappend(NULL, database, ".dir", NULL);
+ tmppagfile = strappend(NULL, database, ".pag", NULL);
+ if (create) {
+ xremove (tmpdirfile);
+ xremove (tmppagfile);
+ amount = create_db(manpath);
+ } else {
+ xcopy (dirfile, tmpdirfile);
+ xcopy (pagfile, tmppagfile);
+ amount = update_db_wrapper (manpath);
+ }
+# endif /* BERKELEY_DB NDBM */
+#else /* !NDBM */
+ xfile = dbname;
+ xtmpfile = database;
+ if (create) {
+ xremove (xtmpfile);
+ amount = create_db(manpath);
+ } else {
+ xcopy (xfile, xtmpfile);
+ amount = update_db_wrapper (manpath);
+ }
+#endif /* NDBM */
+
+ return amount;
+}
+
+int main(int argc, char *argv[])
+{
+ int c;
+ char *catpath, *sys_manp;
+ short amount = 0;
+ int strays = 0;
+ int quiet_temp = 0;
+ char **mp;
+ char *locale;
+
+ int option_index; /* not used, but required by getopt_long() */
+
+#ifdef __profile__
+ char wd[PATH_MAX];
+ char *cwd = wd;
+#endif /* __profile__ */
+
+#ifdef DO_CHOWN
+ struct passwd *man_owner;
+#endif
+
+ program_name = xstrdup(basename((argv[0])));
+
+ /* initialise the locale */
+ locale = setlocale( LC_MESSAGES, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ if (locale != NULL
+ || (locale = getenv ("LC_ALL"))
+ || (locale = getenv ("LC_MESSAGES"))
+ || (locale = getenv ("LANG")) )
+ locale = xstrdup (locale);
+ else
+ locale = "C";
+
+ while ((c = getopt_long (argc, argv, args,
+ long_options, &option_index)) != EOF) {
+ switch (c) {
+
+ case 'd':
+#ifndef debug
+ debug = 1;
+#endif
+ break;
+ case 'q':
+ quiet_temp++;
+ break;
+ case 'u':
+ user = 1;
+ break;
+ case 'c':
+ create = 1;
+ break;
+ case 's':
+ check_for_strays = 1;
+ break;
+ case 't':
+ opt_test = 1;
+ break;
+ case 'V':
+ ver();
+ break;
+ case 'h':
+ usage(OK);
+ break;
+ default:
+ usage(FAIL);
+ break;
+ }
+ }
+
+
+#ifdef __profile__
+# ifdef HAVE_GETCWD
+ if (!getcwd(cwd, PATH_MAX - 1))
+# else /* not HAVE_GETCWD */
+ if (!getwd(cwd))
+# endif
+ cwd[0] = '\0';
+#endif /* __profile__ */
+
+
+#ifdef DO_CHOWN
+ euid = geteuid();
+ if ( (man_owner = getpwnam(MAN_OWNER)) == NULL)
+ error (FAIL, 0,
+ _( "the setuid man user \"%s\" does not exist"), MAN_OWNER);
+ if (!user && euid != man_owner->pw_uid)
+ user = 1;
+#endif /* DO_CHOWN */
+
+
+ /* This is required for global_catpath(), regardless */
+ manp = manpath(NULL);
+
+ if ( opt_test )
+ quiet = 1;
+ else if ( quiet_temp == 1 )
+ quiet = 2;
+ else
+ quiet = quiet_temp;
+
+ /* pick up the system manpath or use the supplied one */
+ if (argc != optind) {
+ free(manp);
+ manp = argv[optind];
+ } else if (!user) {
+ if ( (sys_manp = get_mandb_manpath()) ) {
+ free(manp);
+ manp = sys_manp;
+ } else
+ error (0, 0, _( "warning: no MANDB_MAP directives in %s, using your manpath"),
+ CONFIG_FILE);
+ }
+
+ if (debug)
+ fprintf(stderr, "manpath=%s\n", manp);
+
+ /* get the manpath as an array of pointers */
+ create_pathlist(xstrdup(manp), manpathlist);
+
+ for (mp = manpathlist; *mp; mp++) {
+ catpath = global_catpath(*mp);
+ if (catpath) { /* system db */
+ /* if (access(catpath, W_OK) == 0 && !user) { */
+ if (!user) {
+ push_cleanup (cleanup, NULL);
+ amount += mandb (catpath, *mp);
+ if (check_for_strays)
+ strays += straycats(*mp);
+ finish_up();
+#ifdef DO_CHOWN
+ if (euid == 0)
+ do_chown (man_owner->pw_uid);
+#endif
+ pop_cleanup();
+ }
+ free(catpath);
+ } else { /* user db */
+ push_cleanup (cleanup, NULL);
+ amount += mandb (*mp, *mp);
+ if (check_for_strays)
+ strays += straycats(*mp);
+ finish_up();
+ pop_cleanup();
+ }
+
+ chkr_garbage_detector();
+ }
+
+ if (!quiet) {
+ printf(_(
+ "%d man subdirectories contained newer manual pages.\n"
+ "%d manual pages "),
+ amount, pages);
+ if (check_for_strays)
+ printf(_(
+ "and %d stray cats "), strays);
+ puts(_( "were added."));
+ }
+
+#ifdef __profile__
+ /* For profiling */
+ if (cwd[0])
+ chdir(cwd);
+#endif /* __profile__ */
+
+ exit (OK);
+}
diff --git a/src/manp.c b/src/manp.c
new file mode 100644
index 00000000..02ea19d3
--- /dev/null
+++ b/src/manp.c
@@ -0,0 +1,1028 @@
+/*
+ * manp.c
+ *
+ * Copyright (c) 1990, 1991, John W. Eaton.
+ * Copyright (C) 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * 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): changes
+ * to get_dirlist() and manpath().
+ *
+ * This whole code segment is unfriendly and could do with a complete
+ * overhaul.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <stdio.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <assert.h>
+#include <errno.h>
+
+#if defined(STDC_HEADERS)
+# include <stdlib.h>
+# include <string.h>
+#elif defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#else /* no string(s) header */
+extern char *strtok();
+extern char *strpbrk();
+extern char *strchr();
+extern char *strstr();
+#endif
+
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h>
+#else
+# ifdef HAVE_GETCWD_H
+extern char *getcwd();
+# else
+extern char *getwd();
+# endif
+#endif /* HAVE_UNISTD_H */
+
+#ifndef STDC_HEADERS
+extern char *getenv();
+extern int errno;
+#endif
+
+#if defined(HAVE_LIMITS_H) && defined(_POSIX_VERSION)
+# include <limits.h> /* for PATH_MAX */
+#else /* !(HAVE_LIMITS_H && _POSIX_VERSION) */
+# include <sys/param.h> /* for MAXPATHLEN */
+#endif /* HAVE_LIMITS_H */
+
+#ifndef PATH_MAX
+# if defined(_POSIX_VERSION) && defined(_POSIX_PATH_MAX)
+# define PATH_MAX _POSIX_PATH_MAX
+# else /* !_POSIX_VERSION */
+# ifdef MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+# else /* !MAXPATHLEN */
+# define PATH_MAX 1024
+# endif /* MAXPATHLEN */
+# endif /* _POSIX_VERSION */
+#endif /* !PATH_MAX */
+
+#include <libintl.h>
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+#include "lib/error.h"
+#include "manp.h"
+#include "security.h"
+
+typedef struct {
+ char mandir[PATH_MAX];
+ char bin[PATH_MAX];
+ int mandatory;
+} DIRLIST;
+
+#define MANDB_MAP -1
+#define MANPATH_MAP 0
+#define MANDATORY 1
+
+DIRLIST list[MAXDIRS];
+char *tmplist[MAXDIRS];
+char *manpathlist[MAXDIRS];
+
+static __inline__ char *get_manpath(char *path);
+static __inline__ char *has_subdirs(char *p);
+static __inline__ char *fsstnd(char *path);
+static char *def_path(int flag);
+static void add_dir_to_list(char **lp, char *dir);
+static char **add_dir_to_path_list(char **mp, char *p);
+
+
+static __inline__ void gripe_reading_mp_config (char *file)
+{
+ if (!quiet)
+ error (FAIL, 0, _( "can't make sense of the manpath configuration file %s"), file);
+}
+
+static __inline__ void gripe_stat_file(char *file)
+{
+ if (!quiet)
+ error (0, errno, _( "warning: %s"), file);
+}
+
+static __inline__ void gripe_not_directory(char *dir)
+{
+ if (!quiet)
+ error (0, 0, _( "warning: %s isn't a directory"), dir);
+}
+
+
+/* accept a manpath list, separated with ':', return the associated
+ catpath list */
+char *cat_manpath(char *manp)
+{
+ DIRLIST *manlist;
+ size_t len = 0;
+ char *catp, *path;
+
+ catp = xstrdup(manp);
+
+ for (path = strtok(catp, ":"); path; path = strtok(NULL, ":")) {
+ for (manlist = list; manlist->mandir[0] != '\0'; manlist++)
+ if (manlist->mandatory == MANDB_MAP
+ && strcmp(path, manlist->mandir) == 0) {
+ len += strlen (manlist->bin) + 1;
+ break;
+ }
+ if (manlist->mandir[0] == '\0')
+ len += strlen(path) + 1;
+ }
+
+ catp = (char *) xrealloc (catp, len + 1);
+
+ *catp = '\0';
+
+ for (path = strtok(manp, ":"); path; path = strtok(NULL, ":")) {
+ (void) strcat(catp, ":");
+ for (manlist = list; manlist->mandir[0] != '\0'; manlist++)
+ if (manlist->mandatory == MANDB_MAP
+ && strcmp(path, manlist->mandir) == 0) {
+ (void) strcat(catp, manlist->bin);
+ break;
+ }
+ if (manlist->mandir[0] == '\0')
+ (void) strcat(catp, path);
+ }
+
+ return ++catp;
+}
+
+static char *
+check_and_give (const char *path, const char *locale)
+{
+ char *result = NULL, *testdir;
+ int test;
+
+ testdir = strappend (NULL, path, "/", locale, NULL);
+ test = is_directory (testdir);
+
+ if ( test == 1 ) {
+ if (debug)
+ fprintf (stderr, "check_and_give(): adding %s\n", testdir);
+
+ result = xstrdup (testdir); /* I do not like side effects */
+ } else if ( test == 0 )
+ gripe_not_directory (testdir);
+
+ free (testdir);
+
+ return result;
+}
+
+static char *
+add_to_manpath (char *manpath, const char *path)
+{
+ char *result;
+
+ if (manpath == NULL)
+ result = xstrdup (path);
+ else
+ result = strappend (manpath, ":", path, NULL);
+
+ return result;
+}
+
+
+char *add_nls_manpath (char *manpathlist, const char *locale)
+{
+#ifdef HAVE_SETLOCALE
+ char *manpath = NULL;
+ char *path;
+ char *temp_locale;
+ char *omanpathlist = strdup(manpathlist);
+
+ if (debug)
+ fprintf (stderr, "add_nls_manpath(): processing %s\n", manpathlist);
+
+ if (locale == NULL || *locale == '\0' || *locale == 'C')
+ return manpathlist;
+
+ temp_locale = xstrdup( locale);
+
+ for (path = strtok( manpathlist, ":"); path;
+ path = strtok( NULL, ":") ) {
+
+ static char locale_delims[] = "@,._";
+ char *delim, *tempo;
+ char *testpath;
+
+ strcpy( temp_locale, locale);
+
+ if ( (testpath = check_and_give( path, temp_locale)) ) {
+ manpath = add_to_manpath (manpath, testpath);
+ free (testpath);
+ }
+ for (delim = locale_delims ; *delim != '\0' ; ++delim)
+ if ( (tempo = strchr (temp_locale, *delim)) ) {
+ *tempo = '\0'; /* Strip out the rest of the line */
+ if ( (testpath = check_and_give (path, temp_locale)) ) {
+ manpath = add_to_manpath (manpath, testpath);
+ free (testpath);
+ }
+ }
+ }
+ /* After doing all the locale stuff we add the manpath to the *END*
+ * so the locale dirs are checked first on each section */
+ manpath = add_to_manpath(manpath,omanpathlist);
+ free (omanpathlist);
+
+ free (manpathlist);
+ return manpath;
+
+#else /* !HAVE_SETLOCALE */
+ return manpathlist;
+#endif /* HAVE_SETLOCALE */
+}
+
+/* Add to the manpathlist system dependent subdirs */
+char *add_system_manpath (char *systems, char *manpathlist)
+{
+ const char *system;
+ char *path;
+ char *manpath = NULL;
+ size_t manpathsize = 0;
+
+ if (systems == NULL)
+ if ((systems = getenv ("SYSTEM")) == NULL)
+ systems = "";
+ if (*systems == '\0')
+ return manpathlist;
+
+ /* For each manpathlist[] component */
+
+ for (system = strtok (systems, ",:"); system;
+ system = strtok (NULL, ",:")) {
+ char *next;
+
+ /* For each systems component */
+
+ if (strcmp(system, "man") != 0) {
+ for (path = manpathlist; path;
+ path = next) {
+ size_t pathlen;
+ size_t newdirlen;
+ char *newdir;
+ int status;
+
+ next = strpbrk (path, ":" );
+ pathlen = next ? next++ - path : strlen (path);
+ newdirlen = strlen (system) + pathlen + 3;
+ newdir = (char *) xmalloc (newdirlen);
+
+ /* add it to the manpath component */
+
+ strncpy (newdir, path, pathlen);
+ *(newdir + pathlen) = '\0';
+ strcat (newdir, "/");
+ strcat (newdir, system);
+
+ /* and see if it exists */
+
+ status = is_directory (newdir);
+
+ if (status == 0)
+ gripe_not_directory(newdir);
+ else if (status == 1) {
+ if (debug)
+ fprintf (stderr,
+ "adding %s to manpathlist\n",
+ newdir);
+ manpath = (char *) xrealloc (manpath,
+ manpathsize + newdirlen);
+ /* Add to manpath */
+ if (manpathsize)
+ strcat (manpath, ":");
+ else
+ *manpath = '\0';
+ strcat (manpath, newdir);
+ manpathsize += newdirlen;
+ } else {
+ if (debug) {
+ fputs ("can't stat ", stderr);
+ perror (newdir);
+ }
+ }
+ free (newdir);
+ }
+ } else {
+ /* Add base directory */
+ size_t pathlen;
+
+ pathlen = strlen(manpathlist) + 1;
+ manpath = (char *) xrealloc (manpath, manpathsize + pathlen);
+ if (manpathsize)
+ strcat (manpath, ":");
+ else
+ *manpath = '\0';
+ strcat (manpath, manpathlist);
+ manpathsize += pathlen;
+ }
+ }
+ /*
+ * Thu, 21 Nov 1996 22:24:19 +0200 fpolacco@debian.org
+ * bug#5534 (man fails if env var SYSTEM is defined)
+ * with error [man: internal manpath equates to NULL]
+ * the reason: is_directory (newdir); returns -1
+ */
+ if (!manpath) {
+ if (debug) fprintf(stderr, "add_system_manpath(): %s\n",
+ "internal manpath equates to NULL");
+ return manpathlist;
+ }
+ return manpath;
+}
+
+/*
+ * Always add system and locale directories to pathlist.
+ * If the environment variable MANPATH is set, return it.
+ * If the environment variable PATH is set and has a nonzero length,
+ * try to determine the corresponding manpath, otherwise, return the
+ * default manpath.
+ *
+ * The manpath.config file is used to map system wide /bin directories
+ * to top level man page directories.
+ *
+ * For directories which are in the user's path but not in the
+ * manpath.config file, see if there is a subdirectory `man' or `MAN'.
+ * If so, add that directory to the path. Example: user has
+ * $HOME/bin in his path and the directory $HOME/bin/man exists -- the
+ * directory $HOME/bin/man will be added to the manpath.
+ */
+char *guess_manpath (char *systems)
+{
+ int len;
+ char *path;
+
+ if ((path = getenv ("PATH")) == NULL) {
+ /*
+ * Things aren't going to work well, but hey...
+ */
+ if (!quiet)
+ error (0, 0, _( "warning: $PATH not set"));
+
+ path = add_system_manpath (systems, def_path (MANDATORY));
+
+ return path;
+ } else {
+ if ((len = strlen (path)) == 0) {
+ /*
+ * Things aren't going to work well here either...
+ */
+ if (!quiet)
+ error (0, 0, _( "warning: empty $PATH"));
+
+ path = add_system_manpath (systems, def_path (MANDATORY));
+
+ return path;
+ }
+
+ path = add_system_manpath (systems, get_manpath (path));
+
+ return path;
+ }
+}
+
+char *manpath (char *systems)
+{
+ char *manpathlist;
+
+ /* need to read config file even if MANPATH set, for mandb(8) */
+ if (get_dirlist ())
+ gripe_reading_mp_config (CONFIG_FILE);
+
+ manpathlist = getenv ("MANPATH");
+ if ( manpathlist && *manpathlist ) {
+ char *pos;
+ /*
+ * This must be it.
+ */
+ /* xstrdup() required below so that we don't hack up the environment */
+ manpathlist = xstrdup (manpathlist);
+ if ( manpathlist[0] == ':' ) {
+ if (!quiet) error (0, 0,
+ _( "warning: $MANPATH set, prepending %s"), CONFIG_FILE);
+ manpathlist = strappend ( guess_manpath (systems)
+ , add_system_manpath (systems, manpathlist)
+ , NULL);
+ } else if ( manpathlist[strlen(manpathlist)-1] == ':' ) {
+ if (!quiet) error (0, 0,
+ _( "warning: $MANPATH set, appending %s"), CONFIG_FILE);
+ manpathlist = strappend ( add_system_manpath (systems, manpathlist)
+ , guess_manpath (systems)
+ , NULL);
+ } else if ( (pos = strstr(manpathlist,"::")) ) {
+ *(pos++) = '\0';
+ if (!quiet) error (0, 0,
+ _( "warning: $MANPATH set, inserting '%s'"), CONFIG_FILE);
+ manpathlist = strappend ( add_system_manpath (systems, manpathlist)
+ , ":" , guess_manpath (systems)
+ , add_system_manpath (systems, pos)
+ , NULL);
+ } else {
+ if (!quiet) error (0, 0,
+ _( "warning: $MANPATH set, ignoring %s"), CONFIG_FILE);
+ manpathlist = add_system_manpath (systems, manpathlist);
+ }
+ } else {
+ manpathlist = guess_manpath (systems);
+ }
+ return manpathlist;
+}
+
+#ifdef SECURE_MAN_UID
+extern uid_t ruid; /* initial real user id */
+extern uid_t euid; /* initial effective user id */
+#endif /* SECURE_MAN_UID */
+/* create the catman hierarchy if it doesn't exist */
+void
+mkcatdirs( DIRLIST *dlp)
+{
+ char manname[PATH_MAX+6];
+ char catname[PATH_MAX+6];
+
+ if ( dlp->bin ) {
+ int oldmask=umask(022);
+ /* first the base catdir */
+ if ( is_directory( dlp->bin) != 1) {
+ regain_effective_privs();
+ if ( mkdir( dlp->bin, S_ISGID|0755) < 0 ) {
+ if (!quiet)
+ error (0, 0, _( "warning: cannot create catdir %s"), dlp->bin);
+ if (debug)
+ fprintf (stderr, "warning: cannot create catdir %s\n", dlp->bin);
+ } else if (debug)
+ fprintf (stderr, "created base catdir %s\n", dlp->bin);
+#ifdef SECURE_MAN_UID
+ if ( ruid == 0 )
+ chown( dlp->bin, euid, 0);
+#endif /* SECURE_MAN_UID */
+ drop_effective_privs();
+ }
+ /* then the hierarchy */
+ sprintf( catname, "%s/cat1", dlp->bin);
+ if ( is_directory( dlp->bin) == 1) {
+ int j;
+ regain_effective_privs();
+ if (debug) fprintf (stderr,
+ "creating catdir hierarchy %s ", dlp->bin);
+ for (j=1; j<10; j++) {
+ sprintf( catname, "%s/cat%d", dlp->bin, j);
+ sprintf( manname, "%s/man%d", dlp->mandir, j);
+ if (( is_directory( manname) == 1)
+ && ( is_directory( catname) != 1)) {
+ if ( mkdir( catname, S_ISGID|0755) < 0 ) {
+ if (!quiet)
+ error (0, 0, _( "warning: cannot create catdir %s"), catname);
+ if (debug)
+ fprintf (stderr, "warning: cannot create catdir %s\n", catname);
+ } else if (debug)
+ fprintf (stderr, " cat%d", j);
+#ifdef SECURE_MAN_UID
+ if ( ruid == 0 )
+ chown( catname, euid, 0);
+#endif /* SECURE_MAN_UID */
+ }
+ }
+ if (debug)
+ fprintf (stderr, "\n");
+ drop_effective_privs();
+ }
+ umask(oldmask);
+ }
+}
+
+extern char *program_name;
+/* Parse the manpath.config file, extracting appropriate information. */
+DIRLIST * add_2_dirlist ( FILE *config, DIRLIST *dlp)
+{
+ char *bp;
+ char buf[BUFSIZ];
+ int converted;
+
+ while ( (bp = fgets (buf, BUFSIZ, config)) ) {
+
+ while ( isspace(*bp) )
+ bp++;
+
+ /* leave last element empty! */
+ if ( dlp >= &list[MAXDIRS-1] ) {
+ error (0, 0, _( "too many entries in config file"));
+ gripe_reading_mp_config (CONFIG_FILE);
+ return dlp;
+ }
+
+ if (*bp == '#' || *bp == '\0') {
+ continue;
+ } else if (strncmp(bp, "NO", 2) == 0) {
+ continue; /* mach any word starting with NO */
+ } else if (sscanf(bp, "MANBIN %*s") == 1) {
+ continue;
+ } else if (sscanf(bp, "MANDATORY_MANPATH %s", dlp->mandir) == 1) {
+ dlp->mandatory = MANDATORY;
+ if (debug)
+ fprintf (stderr, "found mandatory man directory %s\n",
+ dlp->mandir);
+ dlp++;
+ } else if (sscanf(bp, "MANPATH_MAP %s %s", dlp->bin,
+ dlp->mandir) == 2) {
+ dlp->mandatory = MANPATH_MAP;
+ if (debug)
+ fprintf (stderr, "found manpath map %s --> %s\n",
+ dlp->bin, dlp->mandir);
+ dlp++;
+ } else if ( (converted =
+ sscanf(bp, "MANDB_MAP %s %s", dlp->mandir, dlp->bin)) > 0) {
+ dlp->mandatory = MANDB_MAP;
+ if (is_directory(dlp->mandir) != 1) {
+ continue;
+ }
+ if (converted == 1) {
+ (void) strcpy(dlp->bin, dlp->mandir);
+#ifdef USE_FSSTND
+ } else if (converted == 2 &&
+ strcmp(dlp->bin, "FSSTND") == 0) {
+ char *fsstnd_catpath;
+ (void) strcpy(dlp->bin,
+ fsstnd_catpath = fsstnd(dlp->mandir));
+ free(fsstnd_catpath);
+#endif /* USE_FSSTND */
+ }
+ if (debug)
+ fprintf (stderr,
+ "found global mandir %s mapped to catdir %s\n",
+ dlp->mandir, dlp->bin);
+ /* create the catman hierarchy if it doesn't exist */
+ if ( strcmp(program_name,"mandb") == 0)
+ mkcatdirs( dlp);
+ dlp++;
+ } else {
+ error (0, 0, _( "can't parse directory list `%s'"), bp);
+ gripe_reading_mp_config (CONFIG_FILE);
+ }
+ }
+
+ return dlp;
+}
+int get_dirlist (void)
+{
+ char *home;
+ FILE *config;
+ DIRLIST *dlp = list;
+
+ if ((config = fopen (CONFIG_FILE, "r")) == NULL)
+ error (FAIL, 0, _( "can't open the manpath configuration file %s"), CONFIG_FILE);
+ dlp = add_2_dirlist (config, dlp);
+ fclose(config);
+
+ if ((home = xstrdup( getenv ("HOME"))) )
+ if ((config = fopen ( strappend ( home, "/.manpath", NULL), "r")) != NULL) {
+ dlp = add_2_dirlist (config, dlp);
+ fclose(config);
+ }
+ dlp->bin[0] = dlp->mandir[0] = '\0';
+ dlp->mandatory = 0;
+ return 0;
+}
+
+
+/*
+ * Construct the default manpath. This picks up mandatory manpaths
+ * only.
+ */
+static char *def_path (int flag)
+{
+ int len = 0;
+ char *manpathlist;
+ DIRLIST *dlp;
+
+ dlp = list;
+ while (dlp->mandatory == flag) {
+ len += strlen (dlp->mandir) + 1;
+ dlp++;
+ }
+
+ /* If we have complete config file failure... */
+ if (len == 0)
+ return xstrdup("/usr/man");
+
+ manpathlist = (char *) xmalloc (len);
+ *manpathlist = '\0';
+
+ dlp = list;
+ while (dlp->mandatory == flag) {
+ int status;
+
+ status = is_directory (dlp->mandir);
+
+ if (status < 0) {
+ gripe_stat_file(dlp->mandir);
+ } else if (status == 0 && !quiet) {
+ error (0, 0, _( "warning: mandatory directory %s doesn't exist"), dlp->mandir);
+ } else if (status == 1){
+ (void) strcat(manpathlist, dlp->mandir);
+ (void) strcat(manpathlist, ":");
+ dlp++;
+ }
+ }
+ return manpathlist;
+}
+
+/*
+ * For each directory in the user's path, see if it is one of the
+ * directories listed in the manpath.config file. If so, and it is
+ * not already in the manpath, add it. If the directory is not listed
+ * in the manpath.config file, see if there is a subdirectory `man' or
+ * `MAN'. If so, and it is not already in the manpath, add it.
+ * Example: user has $HOME/bin in his path and the directory
+ * $HOME/bin/man exists -- the directory $HOME/bin/man will be added
+ * to the manpath.
+ */
+static __inline__ char *get_manpath (char *path)
+{
+ int len;
+ char *tmppath;
+ char *t;
+ char *p;
+ char **lp;
+ char *end;
+ char *manpathlist;
+ DIRLIST *dlp;
+
+ for (end = p = tmppath = xstrdup (path); end; p = end + 1){
+
+ if ((end = strchr (p, ':')))
+ *end = '\0';
+
+ /* don't do this for current dir ("." or empty entry in PATH) */
+ if ((*p == '\0') || (strcmp( p, ".") == 0))
+ continue;
+
+ if (debug)
+ fprintf (stderr, "\npath directory %s ", p);
+
+ /*
+ * The directory we're working on is in the config file.
+ * If we haven't added it to the list yet, do.
+ */
+
+ for (dlp = list; dlp->mandir[0] != '\0'; dlp++)
+ if (dlp->bin[0] != '\0' && !strcmp (p, dlp->bin)) {
+ if (debug)
+ fprintf (stderr, "is in the config file\n");
+
+ add_dir_to_list (tmplist, dlp->mandir);
+ goto found;
+ }
+
+ /*
+ * The directory we're working on isn't in the config file. See
+ * if it has man or MAN subdirectories. If so, and it hasn't
+ * been added to the list, do.
+ */
+
+ if (debug)
+ fprintf (stderr, "is not in the config file\n");
+
+ t = has_subdirs (p);
+ if (t != NULL) {
+ if (debug)
+ fprintf (stderr, "but it does have a man or MAN subdirectory\n");
+
+ add_dir_to_list (tmplist, t);
+ free (t);
+ } else
+ if (debug)
+ fprintf (stderr, "and doesn't have man or MAN subdirectories\n");
+
+ found:
+ ;
+ }
+
+ free(tmppath);
+
+ if (debug)
+ fprintf (stderr, "\nadding mandatory man directories\n\n");
+
+ dlp = list;
+ while (dlp->mandatory == MANDATORY) {
+ add_dir_to_list (tmplist, dlp->mandir);
+ dlp++;
+ }
+
+ len = 0;
+ lp = tmplist;
+ while (*lp != NULL) {
+ len += strlen (*lp) + 1;
+ lp++;
+ }
+
+ assert (len);
+ manpathlist = (char *) xmalloc (len);
+ *manpathlist = '\0';
+
+ lp = tmplist;
+ p = manpathlist;
+ while (*lp != NULL) {
+ len = strlen (*lp);
+ memcpy (p, *lp, len);
+ p += len;
+ *p++ = ':';
+ lp++;
+ }
+
+ p[-1] = '\0';
+
+ return manpathlist;
+}
+
+/*
+ * Add a directory to the manpath list if it isn't already there.
+ */
+static void add_dir_to_list (char **lp, char *dir)
+{
+ int status;
+
+ while (*lp != NULL){
+
+ if (!strcmp (*lp, dir)){
+ if (debug)
+ fprintf (stderr, "%s is already in the manpath\n", dir);
+ return;
+ }
+ lp++;
+ }
+
+ /*
+ * Not found -- add it.
+ */
+
+ status = is_directory (dir);
+
+ if (status < 0)
+ gripe_stat_file(dir);
+ else if (status == 0)
+ gripe_not_directory(dir);
+ else if (status == 1) {
+ if (debug)
+ fprintf (stderr, "adding %s to manpath\n", dir);
+
+ *lp = xstrdup (dir);
+ }
+}
+
+/*
+ * Check to see if the current directory has man or MAN
+ * subdirectories.
+ *
+ * Unsure if this is such a good idea... Should at least do a realpath()
+ * on anything picked up!
+ */
+static __inline__ char *has_subdirs (char *p)
+{
+ size_t len;
+ char *t;
+
+ len = strlen (p);
+
+ t = (char *) xmalloc (len + 5);
+
+ (void) strcpy(t, p);
+ (void) strcpy(t + len, "/man");
+
+ if (is_directory (t) == 1)
+ return t;
+
+#if 0
+ (void) strcpy (t + len, "/MAN");
+
+ if (is_directory (t) == 1)
+ return t;
+
+ free (t);
+#endif
+ return NULL;
+}
+
+static __inline__ char **add_dir_to_path_list (char **mp, char *p)
+{
+ int status;
+ char wd[PATH_MAX];
+ char *cwd = wd;
+
+ status = is_directory (p);
+
+ if (status < 0)
+ gripe_stat_file(p);
+ else if (status == 0)
+ gripe_not_directory(p);
+ else {
+ /* deal with relative paths */
+
+ if (*p != '/') {
+#ifdef HAVE_GETCWD
+ if ( !getcwd(cwd, PATH_MAX - 2 - strlen(p)) )
+#else /* no GETCWD */
+ if ( !getwd(cwd) )
+#endif /* HAVE_GETCWD */
+ error (FATAL, errno, _( "can't determine current directory"));
+ (void) strcat(wd, "/");
+ (void) strcat(wd, p);
+ *mp = xstrdup(wd);
+ } else
+ *mp = xstrdup (p);
+
+#ifdef MAN_TREE_COMPONENT
+ if (!strstr(*mp, "/man") && !strstr(*mp, "/MAN")) {
+
+ /* not really a man tree after all */
+
+ if (!quiet)
+ error (0, 0, _( "warning: %s does not have a man tree component"), *mp);
+ free(*mp);
+ } else {
+#endif /* MAN_TREE_COMPONENT */
+ if (debug)
+ fprintf (stderr,
+ "adding %s to manpathlist\n",
+ *mp);
+ mp++;
+#ifdef MAN_TREE_COMPONENT
+ }
+#endif /* MAN_TREE_COMPONENT */
+ }
+ return mp;
+}
+
+void create_pathlist(char *manp, char **mp)
+{
+ char *p, *end;
+
+ /*
+ * Expand the manpath into a list for easier handling.
+ */
+
+ for (p = manp;; p = end + 1) {
+ if ( (end = strchr (p, ':')) )
+ *end = '\0';
+
+ mp = add_dir_to_path_list (mp, p);
+ if (end == NULL)
+ break;
+
+ *end = ':';
+ }
+ *mp = NULL;
+ free(manp);
+}
+
+/* routine to get global manpath list */
+char *get_mandb_manpath(void)
+{
+ size_t len = 0;
+ char *manpathlist;
+ DIRLIST *dlp;
+ /* extern DIRLIST list[]; mappings set up by manpath() */
+
+ for (dlp = list; dlp->mandir[0] != '\0'; dlp++)
+ if (dlp->mandatory == MANDB_MAP)
+ len += strlen (dlp->mandir) + 1;
+
+ /* see if we have anything at all */
+
+ if (!len)
+ return NULL;
+
+ manpathlist = (char *) xmalloc (len + 1);
+ *manpathlist = '\0';
+
+ for (dlp = list; dlp->mandir[0] != '\0'; dlp++) {
+ if (dlp->mandatory == MANDB_MAP) {
+ (void) strcat(manpathlist, ":");
+ (void) strcat(manpathlist, dlp->mandir);
+ }
+ }
+ return ++manpathlist;
+}
+
+/*
+ * Take manpath or manfile path as arg, return catdir mapping or NULL if
+ * it isn't a global mandir.
+ */
+/* This routine would seem to work correctly for nls subdirs and would
+ specify the (correct) consistent catpath even if not defined in the
+ config file */
+char *global_catpath(char *name)
+{
+ DIRLIST *dlp;
+
+ for (dlp = list; dlp->mandir[0] != '\0'; dlp++) {
+ size_t mandir_length = strlen (dlp->mandir);
+
+ if (dlp->mandatory == MANDB_MAP &&
+ strncmp(name, dlp->mandir, mandir_length) == 0) {
+ char *suffix = name + mandir_length;
+ char *catpath;
+
+ catpath = xmalloc ( strlen (dlp->bin)
+ + strlen (suffix) + 1);
+ (void) strcpy (catpath, dlp->bin);
+ if (*suffix == '/') {
+ ++suffix;
+ (void) strcat (catpath, "/");
+ }
+ if (!strncmp (suffix, "man", 3)) {
+ suffix += 3;
+ (void) strcat (catpath, "cat");
+ }
+ (void) strcat (catpath, suffix);
+#if 0
+ if (debug)
+ fprintf(stderr, "global_catpath: %s\n", catpath);
+#endif
+ return catpath;
+ }
+ }
+ return NULL;
+}
+
+/* check to see if the supplied man directory is considered `global' */
+int is_global_mandir(const char *dir)
+{
+ DIRLIST *dlp;
+
+ for (dlp = list; dlp->mandir[0] != '\0'; dlp++)
+ if (dlp->mandatory == MANDB_MAP &&
+ strncmp(dir, dlp->mandir, strlen(dlp->mandir)) == 0)
+ return 1;
+ return 0;
+}
+
+/* Accept a manpath (not a full pathname to a file) and return an FSSTND
+ equivalent catpath */
+static __inline__ char *fsstnd(char *path)
+{
+ char *manpath;
+ char *catpath;
+ char *element;
+
+ if (strncmp(path, MAN_ROOT, sizeof MAN_ROOT - 1) != 0) {
+ if (!quiet)
+ error (0, 0, _( "warning: %s does not begin with %s"), path, MAN_ROOT);
+ return xstrdup(path);
+ }
+ /* get rid of initial "/usr" */
+ path += sizeof MAN_ROOT - 1;
+ manpath = xstrdup (path);
+ catpath = (char *) xmalloc (strlen(path) + sizeof CAT_ROOT - 3);
+#if 0
+ if (debug)
+ fprintf(stderr, "fsstnd size = %d\n", strlen(path) +
+ sizeof CAT_ROOT - 4);
+#endif
+ /* start with CAT_ROOT */
+ (void) strcpy (catpath, CAT_ROOT);
+
+ /* split up path into elements and deal with accordingly */
+ for (element = strtok(manpath, "/"); element; element = strtok(NULL, "/")) {
+ if (strncmp(element, "man", 3) == 0) {
+ if (*(element + 3)) {
+#if 0
+ *element -= 10; /* [Mm] -> [Cc] */
+ *(element + 2) += 6; /* [Nn] -> [Tt] */
+#endif
+ *element = 'c';
+ *(element + 2) = 't';
+ } else
+ continue;
+ }
+ (void) strcat (catpath, "/");
+ (void) strcat (catpath, element);
+ }
+ free(manpath);
+#if 0
+ if (debug)
+ fprintf(stderr, "fsstnd: %s -> %s\n", path, catpath);
+#endif
+ return catpath;
+}
diff --git a/src/manp.h b/src/manp.h
new file mode 100644
index 00000000..2ade2145
--- /dev/null
+++ b/src/manp.h
@@ -0,0 +1,12 @@
+/* manp.c */
+extern char *cat_manpath(char *manp);
+extern char *add_nls_manpath(char *manpathlist, const char *locale);
+extern char *add_system_manpath(char *systems, char *manpathlist);
+extern char *manpath(char *systems);
+extern void create_pathlist(char *manp, char **mp);
+extern char *get_mandb_manpath(void);
+extern char *global_catpath(char *name);
+extern int is_global_mandir(const char *dir);
+extern char * iterate_catlist( int global );
+extern void start_iterator( void);
+extern int get_dirlist (void);
diff --git a/src/manpath.c b/src/manpath.c
new file mode 100644
index 00000000..f2d4dd43
--- /dev/null
+++ b/src/manpath.c
@@ -0,0 +1,169 @@
+/*
+ * manpath.c: display either the manpath or catpath
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * Thu Nov 17 08:29:39 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <stdio.h>
+#include <assert.h>
+#include <errno.h>
+#include <termios.h>
+
+#if defined(STDC_HEADERS)
+# include <string.h>
+# include <stdlib.h>
+#elif defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#else /* no string(s) header */
+extern char *strchr(), *strcat();
+#endif /* STDC_HEADERS */
+
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h>
+#else
+extern uid_t getuid(), geteuid();
+extern pid_t vfork();
+#endif /* HAVE_UNISTD_H */
+
+#if defined(HAVE_LIMITS_H)
+# include <limits.h>
+#elif defined(HAVE_SYS_PARAM_H)
+# include <sys/param.h>
+#endif
+
+#ifdef HAVE_GETOPT_H
+# include <getopt.h>
+#else /* !HAVE_GETOPT_H */
+# include "lib/getopt.h"
+#endif /* HAVE_GETOPT_H */
+
+#include <locale.h>
+#include <libintl.h>
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+#include "lib/error.h"
+#include "manp.h"
+
+extern char *optarg;
+extern int optind, opterr, optopt;
+
+#ifndef debug
+int debug;
+#endif
+char *program_name;
+int quiet = 0;
+
+static const struct option long_options[] =
+{
+ {"catpath", no_argument, 0, 'c'},
+ {"global", no_argument, 0, 'g'},
+ {"debug", no_argument, 0, 'd'},
+ {"help", no_argument, 0, 'h'},
+ {"quiet", no_argument, 0, 'q'},
+ {"version", no_argument, 0, 'V'},
+ {"systems", required_argument, 0, 'm'},
+ {0, 0, 0, 0}
+};
+
+static const char args[] = "cgdhqVm:";
+
+static void usage(int status)
+{
+ printf (_(
+ "usage: %s [[-gcdq] [-m system]] | [-V] | [-h]\n"), program_name);
+ printf (_(
+ "-c --catpath show relative catpaths.\n"
+ "-g --global show the entire global manpath.\n"
+ "-d --debug produce debugging info.\n"
+ "-q --quiet produce fewer warnings.\n"
+ "-m --systems system express which `systems' to use.\n"
+ "-V --version show version.\n"
+ "-h --help show this usage message.\n"));
+
+ exit (status);
+}
+
+/*
+ * Examine user's PATH and print a reasonable MANPATH.
+ */
+int main (int argc, char *argv[])
+{
+ int c, global = 0, cat = 0;
+ char *alt_system = "";
+ char *path_string;
+ int option_index; /* not used, but required by getopt_long() */
+ char *locale;
+
+ program_name = xstrdup(basename((argv[0])));
+ /* initialise the locale */
+ locale = setlocale( LC_MESSAGES, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+ if (locale != NULL
+ || (locale = getenv ("LC_ALL"))
+ || (locale = getenv ("LC_MESSAGES"))
+ || (locale = getenv ("LANG")) )
+ locale = xstrdup (locale);
+ else
+ locale = "C";
+
+ while ((c = getopt_long (argc, argv, args,
+ long_options, &option_index)) != EOF) {
+ switch (c) {
+
+ case 'c':
+ cat = 1;
+ break;
+ case 'd':
+#ifndef debug
+ debug = 1;
+#endif
+ break;
+ case 'q':
+ quiet = 1;
+ break;
+ case 'm':
+ alt_system = optarg;
+ break;
+ case 'g':
+ global = 1;
+ quiet = 1;
+ break;
+ case 'V':
+ ver();
+ break;
+ case 'h':
+ usage(OK);
+ break;
+ default:
+ usage(FAIL);
+ break;
+ }
+ }
+
+ path_string = manpath (alt_system);
+
+ if (global) {
+ path_string = get_mandb_manpath();
+ if (!path_string)
+ error (FAIL, 0, _( "warning: no global manpaths set in config file %s"), CONFIG_FILE);
+ }
+ if (cat)
+ path_string = cat_manpath(path_string);
+
+ printf ("%s\n", path_string);
+ exit (OK);
+}
diff --git a/src/security.c b/src/security.c
new file mode 100644
index 00000000..89c40774
--- /dev/null
+++ b/src/security.c
@@ -0,0 +1,234 @@
+/*
+ * security.c: routines to aid secure uid operations.
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * 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 <stdio.h>
+#include <errno.h>
+
+#ifndef STDC_HEADERS
+extern int errno;
+#endif
+
+#if defined(STDC_HEADERS)
+# include <string.h>
+# include <stdlib.h>
+#elif defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#endif /* STDC_HEADERS */
+
+#include <sys/types.h>
+
+#if HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#include <libintl.h>
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+#include "lib/error.h"
+#include "lib/cleanup.h"
+#include "security.h"
+
+#ifdef SECURE_MAN_UID
+uid_t ruid; /* initial real user id */
+uid_t euid; /* initial effective user id */
+#endif /* SECURE_MAN_UID */
+
+/*
+ * If you want to try to understand the following routines, go make
+ * a coffee, you'll need it. (a copy of your kernel sources may also
+ * be handy :-)
+ */
+
+#ifdef SECURE_MAN_UID
+
+static __inline__ void gripe_set_euid()
+{
+ error (FATAL, errno, _( "can't set effective uid"));
+}
+
+#endif /* SECURE_MAN_UID */
+
+/*
+ * 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 SECURE_MAN_UID
+
+ /* user is root or we've already dropped privs */
+ if (ruid == 0 || geteuid() == ruid)
+ return;
+
+ if (debug)
+ fputs("drop_effective_privs()\n", stderr);
+
+# if defined (POSIX_SAVED_IDS)
+ if (seteuid (ruid))
+ gripe_set_euid();
+
+# elif defined(BROKEN_LINUX_SAVED_IDS)
+ if (setuid (ruid))
+ gripe_set_euid();
+
+# elif defined(HAVE_SETREUID) /* fallback (could just be #else ) */
+ if (setreuid (euid, ruid))
+ gripe_set_euid();
+
+# endif /* all ways to drop privs */
+
+#endif /* SECURE_MAN_UID */
+
+ return;
+}
+
+/*
+ * 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 SECURE_MAN_UID
+ /* user is root or we've already regained (never dropped) privs */
+ if (ruid == 0 || geteuid() == euid)
+ return;
+
+ if (debug)
+ fputs("regain_effective_privs()\n", stderr);
+
+# if defined(POSIX_SAVED_IDS)
+ if (seteuid (euid))
+ gripe_set_euid();
+
+# elif defined(BROKEN_LINUX_SAVED_IDS)
+ if (setuid (euid))
+ gripe_set_euid();
+
+# elif defined(HAVE_SETREUID) /* fallback (could just be #else ) */
+ if (setreuid (ruid, euid))
+ gripe_set_euid();
+
+# endif
+
+#endif /* SECURE_MAN_UID */
+
+ return;
+}
+
+/* remove() a file after dropping privs. If already dropped, just remove and
+ return, don't regain any privs! */
+int remove_with_dropped_privs(const char *filename)
+{
+ int ret;
+
+#ifdef SECURE_MAN_UID
+ if (geteuid() != ruid) {
+ drop_effective_privs();
+ ret = remove (filename);
+ if (debug)
+ fprintf(stderr, "remove(\"%s\")\n", filename);
+ regain_effective_privs();
+ } else
+#endif /* SECURE_MAN_UID */
+ ret = remove (filename);
+
+ if (ret != 0)
+ error (0, errno, _( "can't remove %s"), filename);
+
+ return ret;
+}
+
+/*
+ * If we want to execute a system command with no effective priveledges
+ * we have to either
+ * (a) Use saved id's (if available) to completely drop effective
+ * priveledges and re-engage them after the call.
+ * (b) fork() and then drop effective privs in the child. Do the
+ * system() command from the child and wait for it to die.
+ * (b) does not need saved ids as, once dropped, the effective privs are
+ * not required in the child again. (a) does not require a fork() as the
+ * system()'d processes will not have suid=MAN_OWNER and will be unable
+ * to gain any man derived priveledges.
+ *
+ * Obviously (a) is favoured, but there are many implementations...
+ * some broken :-(
+ */
+int do_system_drop_privs (const char *command)
+{
+#ifdef SECURE_MAN_UID
+
+# if defined(POSIX_SAVED_IDS) || defined(BROKEN_LINUX_SAVED_IDS)
+
+ /* if root or we already dropped privs, just do it */
+ if (ruid == 0 || geteuid() == ruid)
+ return do_system (command);
+ else {
+ int status;
+
+ drop_effective_privs();
+ status = do_system (command);
+ regain_effective_privs();
+ return status;
+ }
+
+# elif defined(HAVE_SETREUID) /* fallback (could just be #else ) */
+
+ /* if root, just do it */
+ if (ruid == 0)
+ return do_system (command);
+ else {
+ pid_t child;
+ int status;
+
+ fflush (NULL);
+ child = fork ();
+
+ if (child < 0) {
+ error (0, errno, _( "can't fork"));
+ status = 0;
+ } else if (child == 0) {
+ pop_all_cleanups ();
+ if (setreuid (ruid, ruid))
+ gripe_set_euid();
+ exit (do_system (command));
+ } else {
+ pid_t res;
+ int save = errno;
+ do { /* cope with non-restarting system calls */
+ res = waitpid (child, &status, 0);
+ } while ((res == -1) && (errno == EINTR));
+ if (res == -1)
+ status = -1;
+ else
+ errno = save;
+ }
+
+ return status;
+ }
+# endif /* all ways to do a sys command after dropping privs */
+
+#else /* !SECURE_MAN_UID */
+ return do_system (command);
+#endif /* SECURE_MAN_UID */
+}
diff --git a/src/security.h b/src/security.h
new file mode 100644
index 00000000..0373f5ac
--- /dev/null
+++ b/src/security.h
@@ -0,0 +1,54 @@
+/*
+ * security.h: supplies correct macros to security routines
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * Sat Nov 12 13:58:54 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#ifndef SECURITY_H
+#define SECURITY_H
+
+#ifdef SECURE_MAN_UID
+
+ /*
+ * 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 preformatted man pages and the directories that
+ * they live in are readable and writeable by this user.
+ */
+
+extern __inline__ void drop_effective_privs(void);
+extern __inline__ void regain_effective_privs(void);
+
+# ifdef HAVE_UNISTD_H
+
+# include <unistd.h> /* for _POSIX_SAVED_IDS */
+
+# if defined(_POSIX_SAVED_IDS)
+# if defined(__linux__) || defined(__hpux)
+ /* Linux pre 1.1.37 has broken saved uids */
+# define BROKEN_LINUX_SAVED_IDS
+# elif defined(__ultrix__)
+ /* Ultrix pretends to have saved uids, but hasn't unless: */
+# if defined(POSIX) || defined(SYSTEM_FIVE)
+# define POSIX_SAVED_IDS
+# endif /* POSIX || SYSTEM_FIVE */
+# else /* !linux && !ultrix */
+# define POSIX_SAVED_IDS
+# endif /* linux || ultrix */
+# endif /* _POSIX_SAVED_IDS */
+# endif /* HAVE_UNISTD_H */
+
+# if !defined(BROKEN_LINUX_SAVED_IDS) && \
+ !defined(POSIX_SAVED_IDS) && \
+ !defined (HAVE_SETREUID)
+# error Cannot install man setuid as no SAVED IDS or setreuid()
+# endif
+
+#endif /* SECURE_MAN_UID */
+#endif /* SECURITY_H */
diff --git a/src/stamp-h b/src/stamp-h
new file mode 100644
index 00000000..359d7f83
--- /dev/null
+++ b/src/stamp-h
@@ -0,0 +1 @@
+Tue Feb 17 21:33:52 EET 1998
diff --git a/src/straycats.c b/src/straycats.c
new file mode 100644
index 00000000..55a49fdc
--- /dev/null
+++ b/src/straycats.c
@@ -0,0 +1,364 @@
+/*
+ * straycats.c: find and process stray cat files
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * Tue May 3 21:24:51 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <stdio.h>
+#include <signal.h>
+#include <errno.h>
+
+#ifndef STDC_HEADERS
+extern int errno;
+#endif
+
+#if defined(STDC_HEADERS)
+# include <string.h>
+# include <stdlib.h>
+#elif defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#else /* no string(s) header */
+extern char *strrchr();
+#endif /* STDC_HEADERS */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#ifdef HAVE_DIRENT_H
+# include <dirent.h>
+#else /* not HAVE_DIRENT_H */
+# define dirent direct
+# ifdef HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif /* HAVE_SYS_NDIR_H */
+# ifdef HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif /* HAVE_SYS_DIR_H */
+# ifdef HAVE_NDIR_H
+# include <ndir.h>
+# endif /* HAVE_NDIR_H */
+#endif /* HAVE_DIRENT_H */
+
+#ifdef HAVE_CANONICALIZE_FILE_NAME
+extern char *canonicalize_file_name __P ((__const char *__name));
+#endif
+
+#include <libintl.h>
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+#include "libdb/mydbm.h"
+#include "libdb/db_storage.h"
+#include "lib/error.h"
+#include "manp.h"
+
+static char *temp_name;
+static char *catdir, *mandir;
+
+/* prototype here as it uses struct mandata which is defined in db_storage.h */
+extern int splitline(char *raw_whatis, struct mandata *info, char *base_name);
+
+static __inline__ int check_for_stray(void)
+{
+ DIR *cdir;
+ struct dirent *catlist;
+ size_t lenman, lencat;
+ int strays = 0;
+#ifdef HAVE_CANONICALIZE_FILE_NAME
+ /* no PATH_MAX then */
+ char *fullpath;
+#else
+ char fullpath[PATH_MAX];
+#endif
+
+ if ( !(cdir = opendir(catdir))) {
+ error (0, errno, _( "can't search directory %s"), catdir);
+ return 0;
+ }
+
+ mandir = strappend(mandir, "/", NULL);
+ catdir = strappend(catdir, "/", NULL);
+ lenman = strlen(mandir);
+ lencat = strlen(catdir);
+
+ while ((catlist = readdir(cdir))) {
+ struct mandata info;
+ char *ext, *section;
+ short found;
+ struct stat buf;
+#ifdef COMP_SRC
+ struct compression *comp;
+#endif
+
+ if (*catlist->d_name == '.' &&
+ strlen(catlist->d_name) < (size_t) 3)
+ continue;
+
+ *(mandir + lenman) = *(catdir + lencat) = '\0';
+ mandir = strappend(mandir, catlist->d_name, NULL);
+ catdir = strappend(catdir, catlist->d_name, NULL);
+
+ ext = strrchr(mandir, '.');
+ if (!ext) {
+ if (quiet < 2)
+ error (0, 0, _( "warning: %s: ignoring bogus filename"), catdir);
+ continue;
+
+#if defined(COMP_SRC) || defined(COMP_CAT)
+
+# if defined(COMP_SRC)
+ } else if (comp_info(ext)) {
+# elif defined(COMP_CAT)
+ } else if (strcmp(ext + 1, COMPRESS_EXT) == 0) {
+# endif /* COMP_* */
+ *ext = '\0';
+ info.comp = ext + 1;
+#endif /* COMP_SRC || COMP_CAT */
+
+ } else
+ info.comp = NULL;
+
+ ext = strrchr(mandir, '.');
+ *(mandir + lenman - 1) = '\0';
+ section = xstrdup(strrchr(mandir, '/') + 4);
+ *(mandir + lenman - 1) = '/';
+
+ /* check for bogosity */
+
+ if (!ext || strncmp(ext + 1, section, strlen(section)) != 0) {
+ if (quiet < 2)
+ error (0, 0, _( "warning: %s: ignoring bogus filename"), catdir);
+ free(section);
+ continue;
+ }
+
+ /*
+ * now that we've stripped off the cat compression
+ * extension (if it has one), we can try some of ours.
+ */
+
+ if (debug)
+ fprintf(stderr, "Testing for existence: %s\n", mandir);
+
+ if (stat(mandir, &buf) == 0)
+ found = 1;
+#ifdef COMP_SRC
+ else if ( (comp = comp_file(mandir)) ) {
+ found = 1;
+ free(comp->file);
+ }
+#endif
+ else
+ found = 0;
+
+ if (!found) {
+ char *filter=0;
+ struct mandata *exists;
+ lexgrog lg;
+
+ /* we have a straycat. Need to filter it and get
+ its whatis (if necessary) */
+
+ lg.whatis = 0;
+ *(ext++) = '\0';
+ info.ext = ext;
+
+ /* see if we already have it, before going any
+ further */
+ exists = dblookup_exact(basename(mandir), info.ext);
+#ifndef FAVOUR_STRAYCATS
+ if (exists && exists->id != WHATIS_CAT) {
+#else /* FAVOUR_STRAYCATS */
+ if (exists && exists->id != WHATIS_CAT &&
+ exists->id != WHATIS_MAN) {
+#endif /* !FAVOUR_STRAYCATS */
+ free_mandata_struct(exists);
+ free(section);
+ continue;
+ }
+ if (debug)
+ fprintf(stderr, "%s(%s) is not in the db.\n",
+ basename(mandir), info.ext);
+
+ /* fill in the missing parts of the structure */
+ info.sec = section;
+ info.id = STRAY_CAT;
+ info.pointer = NULL;
+ info._st_mtime = 0L;
+
+ /* Check to see how to filter the cat file */
+#if defined(COMP_SRC)
+ if (info.comp)
+ filter = strappend(NULL,
+ comp_info(catdir)->prog, " ",
+ catdir, " | " COL " -bx > ",
+ temp_name, NULL);
+ else
+#elif defined (COMP_CAT)
+ if (info.comp)
+ filter = strappend(NULL, DECOMPRESSOR " ",
+ catdir, " | " COL " -bx > ",
+ temp_name, NULL);
+ else
+#endif /* COMP_* */
+ filter = strappend(NULL, COL " -bx < ",
+ catdir, " > ", temp_name,
+ NULL);
+
+#ifdef HAVE_CANONICALIZE_FILE_NAME
+ if ( !(fullpath = canonicalize_file_name(catdir)) ) {
+ if (quiet < 2)
+ error (0, errno, _( "can't resolve %s"), catdir);
+ } else
+#else
+ if (realpath(catdir, fullpath) == NULL) {
+ if (quiet < 2)
+ if (errno == ENOENT)
+ error (0, 0, _( "warning: %s is a dangling symlink"), fullpath);
+ else
+ error (0, errno, _( "can't resolve %s"), fullpath);
+ }
+ } else
+#endif
+ {
+#ifdef HAVE_CANONICALIZE_FILE_NAME
+ free(fullpath);
+#endif
+ if (do_system(filter) != 0) {
+ remove(temp_name);
+ perror(filter);
+ exit (CHILD_FAIL);
+ }
+
+ strays++;
+
+ lg.type = CATPAGE;
+ if ( ! find_name(temp_name, basename(catdir), &lg) )
+ if (quiet < 2)
+ error (0, 0, _( "warning: %s: whatis parse for %s(%s) failed"),
+ catdir, basename(mandir), info.sec);
+
+ (void) splitline( lg.whatis, &info, basename(mandir));
+ }
+
+ free(filter);
+
+ if ( lg.whatis)
+ free( lg.whatis);
+ }
+ free(section);
+ }
+ closedir(cdir);
+ return strays;
+}
+
+static int open_catdir(void)
+{
+ DIR *cdir;
+ struct dirent *catlist;
+ size_t catlen, manlen;
+ int strays = 0;
+
+ if ( !(cdir = opendir(catdir))) {
+ error (0, errno, _( "can't search directory %s"), catdir);
+ return 0;
+ }
+
+ if (!quiet)
+ printf(_( "Checking for stray cats under %s...\n"), catdir);
+
+ catdir = strappend(catdir, "/", NULL);
+ mandir = strappend(mandir, "/", NULL);
+ catlen = strlen(catdir);
+ manlen = strlen(mandir);
+
+ /* should make this case insensitive */
+ while ((catlist = readdir(cdir))) {
+ char *t1;
+
+ if (strncmp(catlist->d_name, "cat", 3) != 0)
+ continue;
+
+ catdir = strappend(catdir, catlist->d_name, NULL);
+ mandir = strappend(mandir, catlist->d_name, NULL);
+
+ *(t1 = mandir + manlen) = 'm';
+ *(t1 + 2) = 'n';
+
+ strays += check_for_stray();
+
+ *(catdir + catlen) = *(mandir + manlen) = '\0';
+ }
+ closedir(cdir);
+ return strays;
+}
+
+int straycats(char *manpath)
+{
+ char *catpath;
+ int strays;
+
+ if (!temp_name) {
+ int fd;
+
+ if ( !(temp_name=xstrdup("/tmp/zcatXXXXXX")) )
+ return 0;
+ if ( (fd = mkstemp(temp_name)) == -1) {
+ error (0, errno, _( "warning: can't create temp file %s"), temp_name);
+ return 0;
+ }
+ close( fd);
+ }
+
+ if ( !(dbf = MYDBM_RWOPEN(database)) || dbver_rd(dbf)) {
+ error (0, errno, _( "warning: can't update index cache %s"), database);
+ return 0;
+ }
+
+ catpath = global_catpath(manpath);
+
+ /* look in the usual catpath location */
+ mandir = xstrdup(manpath);
+ catdir = xstrdup(manpath);
+ strays = open_catdir();
+
+ /* look in the alternate catpath location if we have one
+ and it's different from the usual catpath */
+
+ if (debug && catpath)
+ fprintf(stderr, "catpath: %s, manpath: %s\n", catpath, manpath);
+
+ if (catpath && strcmp(catpath, manpath) != 0) {
+ *mandir = *catdir = '\0';
+ mandir = strappend(mandir, manpath, NULL);
+ catdir = strappend(catdir, catpath, NULL);
+ strays += open_catdir();
+ }
+
+ free(mandir);
+ free(catdir);
+
+ if (catpath)
+ free(catpath);
+
+ MYDBM_CLOSE(dbf);
+ remove (temp_name);
+ free(temp_name); temp_name = NULL;
+ return strays;
+}
diff --git a/src/ult_src.c b/src/ult_src.c
new file mode 100644
index 00000000..534a2cb9
--- /dev/null
+++ b/src/ult_src.c
@@ -0,0 +1,337 @@
+/*
+ * ult_src.c
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * code to seek out the original (ultimate) source man file for
+ * any specified man file. Soft and hard links and .so inclusions
+ * are traced. Use: reduce amount of cat files to a minimum.
+ *
+ * Mon May 2 11:14:28 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <stdio.h>
+#include <ctype.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <errno.h>
+
+#ifndef STDC_HEADERS
+extern int errno;
+#endif
+
+#ifndef S_ISLNK /* loosing sys/stat.h */
+# if defined(S_IFMT) && defined(S_IFLNK)
+# define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
+# endif
+#endif
+
+#ifdef HAVE_DIRENT_H
+# include <dirent.h>
+#else /* not HAVE_DIRENT_H */
+# define dirent direct
+# ifdef HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif /* HAVE_SYS_NDIR_H */
+# ifdef HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif /* HAVE_SYS_DIR_H */
+# ifdef HAVE_NDIR_H
+# include <ndir.h>
+# endif /* HAVE_NDIR_H */
+#endif /* HAVE_DIRENT_H */
+
+extern char *realpath();
+
+#if defined(STDC_HEADERS)
+# include <string.h>
+# include <stdlib.h>
+#elif defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#else /* no string(s) header */
+extern char *strrchr();
+#endif /* no string(s) header */
+
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#if defined(HAVE_LIMITS_H) && defined(_POSIX_VERSION)
+# include <limits.h> /* for PATH_MAX */
+#else /* !(HAVE_LIMITS_H && _POSIX_VERSION) */
+# include <sys/param.h> /* for MAXPATHLEN */
+#endif /* HAVE_LIMITS_H */
+
+#ifndef PATH_MAX
+# if defined(_POSIX_VERSION) && defined(_POSIX_PATH_MAX)
+# define PATH_MAX _POSIX_PATH_MAX
+# else /* !_POSIX_VERSION */
+# ifdef MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+# else /* !MAXPATHLEN */
+# define PATH_MAX 1024
+# endif /* MAXPATHLEN */
+# endif /* _POSIX_VERSION */
+#endif /* !PATH_MAX */
+
+#include <libintl.h>
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+#include "lib/error.h"
+#include "ult_src.h"
+
+/* Find minimum value hard link filename for given file and inode */
+static __inline__ char *ult_hardlink(char *fullpath, long inode)
+{
+ DIR *mdir;
+ struct dirent *manlist;
+ char link[PATH_MAX];
+ char dir[PATH_MAX];
+ char *t;
+
+ *(t = strrchr(fullpath, '/')) = '\0';
+ (void) strcpy(dir, fullpath);
+ *t = '/';
+ (void) strcpy(link, ++t);
+
+ if ((mdir = opendir(dir)) == NULL) {
+ error (0, errno, _( "can't search directory %s"), dir);
+ return NULL;
+ }
+
+ while ((manlist = readdir(mdir))) {
+ if (manlist->d_ino == inode &&
+ strcmp(link, manlist->d_name) > 0) {
+ (void) strcpy(link, manlist->d_name);
+ if (debug)
+ fprintf(stderr, "ult_hardlink: (%s)\n", link);
+ }
+ }
+ closedir(mdir);
+
+ /* If we already are the link with the smallest name value */
+ /* return NULL */
+
+ if (strcmp(link, t) == 0)
+ return NULL;
+
+ return strcpy(strrchr(fullpath, '/') + 1, link);
+}
+
+#ifdef S_ISLNK
+/* use realpath() to resolve all sym links within 'fullpath'. 'mantree' is
+ the man hierarchy */
+static __inline__ char *ult_softlink(char *fullpath, const char *mantree)
+{
+ char resolved_path[PATH_MAX];
+
+ if (realpath(fullpath, resolved_path) == NULL) {
+
+ /* discard the unresolved path */
+
+ if (errno == ENOENT)
+ error (0, 0, _( "warning: %s is a dangling symlink"), fullpath);
+ else
+ error (0, errno, _( "can't resolve %s"), fullpath);
+ return NULL;
+ }
+
+ if (debug)
+ fprintf(stderr, "ult_softlink: (%s)\n",
+ resolved_path + strlen(mantree) + 1);
+
+ /* if symlink is not within this mantree, forget it */
+
+ if (strncmp(mantree, resolved_path, strlen(mantree)) != 0) {
+ if (debug)
+ fprintf(stderr, "ult_softlink: non-local link\n");
+ return NULL;
+ }
+
+ return strcpy(fullpath, resolved_path);
+}
+#endif /* S_ISLNK */
+
+/* test `buffer' to see if it contains a .so include, if so and it's not an
+ absolute filename, copy it into `basename' at `rel' and return 1 */
+static __inline__ int test_for_include(char *buffer, char *rel)
+{
+ /* strip out any leading whitespace (if any) */
+ while (isspace( (int) *buffer))
+ buffer++;
+
+ /* see if the `command' is a .so */
+ if (strncmp(buffer, ".so", 3) == 0) {
+ buffer += 3;
+
+ /* strip out any whitespace between the command and
+ it's argumant */
+ while (isspace( (int) *buffer))
+ buffer++;
+
+ /* If .so's argument is an absolute filename, it could be
+ either (i) a macro inclusion, (ii) a non local manual page
+ or (iii) a (somewhat bogus) reference to a local manual
+ page.
+
+ If (i) or (ii), we must not follow the reference. (iii) is
+ a problem with the manual page, thus we don't want to
+ follow any absolute inclusions in our quest for the
+ ultimate source file */
+ if (*buffer != '/') {
+ /* copy filename into rel address */
+ while (*buffer && !isspace( (int) *buffer))
+ *(rel++) = *(buffer++);
+
+ *rel = '\0';
+ return 1;
+ }
+ }
+ return 0;
+}
+
+/*
+ * recursive function which finds the ultimate source file by following
+ * any ".so filename" directives in the first line of the man pages.
+ * Also (optionally) traces symlinks and hard links(!).
+ *
+ * name is full pathname, path is the MANPATH directory (/usr/man)
+ * flags is a combination of SO_LINK | SOFT_LINK | HARD_LINK
+ */
+char *ult_src(char *name, const char *path, struct stat *buf, int flags)
+{
+
+ static char basename[2048]; /* must be static */
+ static short recurse; /* must be static */
+ static char *relative; /* must be static */
+
+ /* initialise the function */
+
+ /* as ult_softlink() & ult_hardlink() do all of their respective
+ resolving in one call, only need to sort them out once */
+
+ if (recurse == 0) {
+ struct stat new_buf;
+ (void) strcpy(basename, name);
+ relative = basename + strlen(path) + 1;
+
+ if (debug)
+ fprintf(stderr, "\nult_src: File %s\n", name);
+
+ /* If we don't have a buf, allocate and assign one */
+ if ( !buf && ((flags & SOFT_LINK) || (flags & HARD_LINK)) ) {
+ buf = &new_buf;
+ if (lstat(basename, buf) == -1) {
+ error (0, errno, _( "can't resolve %s"), basename);
+ return NULL;
+ }
+ }
+
+#ifdef S_ISLNK
+ /* Permit semi local (inter-tree) soft links */
+
+ if (flags & SOFT_LINK) {
+ if (S_ISLNK(buf->st_mode))
+ /* Is a symlink, resolve it. */
+ (void) ult_softlink(basename, path);
+ /* if ( ! ult_softlink(basename, path) )
+ return NULL; */
+ }
+#endif /* S_ISLNK */
+
+ /* Only deal with local (inter-dir) HARD links */
+
+ if (flags & HARD_LINK) {
+ if (buf->st_nlink > 1)
+ /* Has HARD links, find least value */
+ (void) ult_hardlink(basename, buf->st_ino);
+ }
+ }
+
+ /* keep a check on recursion level */
+ else if (recurse == 10) {
+ error (0, 0, _( "%s is self referencing"), name);
+ return NULL;
+ }
+
+ if (flags & SO_LINK) {
+ char buffer[1024], *bptr;
+ int val;
+ FILE *fp;
+#ifdef COMP_SRC
+ struct compression *comp;
+
+ /* get rid of the previous ztemp file (if any) */
+ remove_ztemp();
+
+ /* if we are handed the name of a compressed file, remove
+ the compression extension? */
+ if ( (comp = comp_info(basename)) ) {
+ *comp->file = '\0';
+ }
+
+ /* if the open fails, try looking for compressed */
+ if ((fp = fopen (basename, "r")) == NULL) {
+ char *filename;
+
+ if ( (comp = comp_file(basename)) ) {
+ filename = decompress(comp->file, comp);
+ free(comp->file);
+ (void) strcat(basename, ".");
+ (void) strcat(basename, comp->ext);
+ fp = fopen (filename, "r");
+ } else
+ filename = basename;
+
+ if (!fp) {
+ error (0, errno, _( "can't open %s"), filename);
+ return NULL;
+ }
+ }
+#else
+ if ((fp = fopen (basename, "r")) == NULL) {
+ error (0, errno, _( "can't open %s"), basename);
+ return NULL;
+ }
+#endif
+ /* make sure that we skip over any comments */
+ do {
+ bptr = fgets(buffer, 1024, fp);
+ }
+ while (bptr && strncmp(buffer, ".\\\"", 3) == 0);
+
+ fclose(fp);
+
+ if (buffer)
+ val = test_for_include(buffer, relative);
+ else
+ val = EOF;
+
+ if (val == 1) { /* keep on looking... */
+ char *ult;
+
+ if (debug)
+ fprintf(stderr, "ult_src: points to %s\n", basename);
+
+ recurse++;
+ ult = ult_src(basename, path, NULL, flags);
+ recurse--;
+
+ return ult;
+ }
+ }
+
+ /* We have the ultimate source */
+ return basename;
+}
diff --git a/src/ult_src.h b/src/ult_src.h
new file mode 100644
index 00000000..79ba1388
--- /dev/null
+++ b/src/ult_src.h
@@ -0,0 +1,5 @@
+#define SO_LINK 0001
+#define SOFT_LINK 0002
+#define HARD_LINK 0004
+
+extern char *ult_src(char *name, const char *path, struct stat *buf, int flags);
diff --git a/src/util.c b/src/util.c
new file mode 100644
index 00000000..276fffa3
--- /dev/null
+++ b/src/util.c
@@ -0,0 +1,161 @@
+/*
+ * util.c
+ *
+ * Copyright (c) 1990, 1991, John W. Eaton.
+ * Copyright (C) 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * 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 <stdio.h>
+
+#if defined(STDC_HEADERS)
+# include <string.h>
+# include <stdlib.h>
+#elif defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#else /* no string(s) header */
+extern char *strrchr();
+extern char *strcat();
+extern char *strcpy();
+#endif /* STDC_HEADERS */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#include "manconfig.h"
+#include "libdb/mydbm.h" /* for full definition of MAN_DB */
+
+#define MAX(a,b) ((a)>(b)?a:b)
+
+/* take path, add db name and return */
+char *mkdbname(const char *path)
+{
+ static char *name;
+ size_t len = strlen(path);
+
+ name = (char *) xrealloc (name, sizeof MAN_DB + len);
+ (void) strcpy (name, path);
+ (void) strcpy (name+len, MAN_DB);
+
+ return name;
+}
+
+/*
+ * Is file a newer than file b?
+ *
+ * case:
+ *
+ * a is man_page, b is cat_page
+ *
+ * a newer than b returns 1/3 (ret & 1) == 1
+ * a older than b 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_newer (char *fa, char *fb)
+{
+ struct stat fa_sb;
+ struct stat fb_sb;
+ int fa_stat;
+ int fb_stat;
+ int status = 0;
+#ifndef debug
+ extern int debug;
+#endif
+
+ if (debug)
+ fprintf(stderr, "is_newer: 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) {
+ if (debug)
+ fprintf(stderr, " (%d)\n", -status);
+ return -status;
+ }
+
+ if (fa_sb.st_size == 0)
+ status |= 2;
+
+ if (fb_sb.st_size == 0)
+ status |= 4;
+
+ /* tar and similar archivers modify the st_mtime of output files.
+ It is possible to end up with a catfile *seemingly* newer than
+ a freshly untarred man file. To get around this, we use
+ st_mtime or st_ctime, whichever is greatest (newest). */
+
+ status |= (MAX(fa_sb.st_mtime, fa_sb.st_ctime) > fb_sb.st_mtime);
+
+ if (debug)
+ fprintf(stderr, " (%d)\n", status);
+ return status;
+}
+
+/*
+ * Is path a directory?
+ */
+int is_directory (char *path)
+{
+ struct stat sb;
+ int status;
+
+ status = stat (path, &sb);
+
+ if (status != 0)
+ return status;
+
+ return ((sb.st_mode & S_IFDIR) != 0);
+}
+
+/* wrapper for system() */
+int do_system (const char *command)
+{
+#ifndef debug
+ extern int debug;
+#endif
+
+ /*
+ * If we're debugging, don't really execute the command -- you never
+ * know what might be in that mangled string :-O.
+ */
+
+ if (debug) {
+ fprintf (stderr, "\ntrying command: %s\n", command);
+ return 0;
+ } else {
+ return system (command);
+ }
+}
diff --git a/src/version.c b/src/version.c
new file mode 100644
index 00000000..3f22e687
--- /dev/null
+++ b/src/version.c
@@ -0,0 +1,32 @@
+/*
+ * version.c: the ver() and atexit()/on_exit() routines.
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ * Copyright (c), 1996, 2000, Fabrizio Polacco
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#include <stdio.h>
+
+#include <libintl.h>
+#define _(String) gettext (String)
+
+#include "manconfig.h"
+#include "lib/error.h"
+
+/* print the version message, then exit */
+void ver(void)
+{
+ printf(_( "%s, version %s, %s (fpolacco@debian.org)\n"),
+ program_name, VERSION, DATE);
+ exit(OK);
+}
+
diff --git a/src/whatis.c b/src/whatis.c
new file mode 100644
index 00000000..967ef317
--- /dev/null
+++ b/src/whatis.c
@@ -0,0 +1,626 @@
+/*
+ * whatis.c: search the index or whatis database(s) for words.
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * routines for whatis and apropos programs. Whatis looks up the
+ * keyword for the description, apropos searches the entire database
+ * for word matches.
+ *
+ * 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 <stdio.h>
+#include <ctype.h>
+#include <errno.h>
+
+#ifndef STDC_HEADERS
+extern int errno;
+#endif
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#if defined(STDC_HEADERS)
+# include <stdlib.h>
+# include <string.h>
+#elif defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#else
+extern char *strrchr(), *strtok();
+#endif /* no string(s) header */
+
+#include <locale.h>
+#include <libintl.h>
+#define _(String) gettext (String)
+
+#ifdef HAVE_REGEX_H
+# include <sys/types.h>
+# include <regex.h>
+#endif /* HAVE_REGEX_H */
+
+#ifdef HAVE_FNMATCH_H
+# include <fnmatch.h>
+#else /* !HAVE_FNMATCH_H */
+# include "lib/fnmatch.h"
+#endif /* HAVE_FNMATCH_H */
+
+#ifdef HAVE_GETOPT_H
+# include <getopt.h>
+#else /* !HAVE_GETOPT_H */
+# include "lib/getopt.h"
+#endif /* HAVE_GETOPT_H */
+
+#include "manconfig.h"
+#include "libdb/mydbm.h"
+#include "libdb/db_storage.h"
+#include "lib/error.h"
+#include "manp.h"
+
+extern char *manpathlist[];
+extern char *optarg;
+extern int optind, opterr, optopt;
+
+#ifndef debug
+int debug;
+#endif
+char *program_name;
+char *database;
+MYDBM_FILE dbf;
+int quiet = 1;
+
+#if defined(POSIX_REGEX) || defined(BSD_REGEX)
+# define REGEX
+#endif
+
+#ifdef REGEX
+# if defined(POSIX_REGEX)
+static regex_t preg;
+# endif
+static int regex;
+static int exact;
+# ifndef HAVE_REGEX_H
+extern char *re_comp();
+extern void regfree();
+# endif
+#endif
+
+static int wildcard;
+static int status = OK;
+
+#if !defined(APROPOS) && !defined(WHATIS)
+# error #define WHATIS or APROPOS, so I know who I am
+#endif
+
+static const char args[] = "drewhVm:M:fkL:";
+
+static const struct option long_options[] =
+{
+ {"debug", no_argument, 0, 'd'},
+ {"regex", no_argument, 0, 'r'},
+ {"exact", no_argument, 0, 'e'},
+ {"wildcard", no_argument, 0, 'w'},
+ {"help", no_argument, 0, 'h'},
+ {"version", no_argument, 0, 'V'},
+ {"systems", required_argument, 0, 'm'},
+ {"manpath", required_argument, 0, 'M'},
+ {"whatis", no_argument, 0, 'f'},
+ {"apropos", no_argument, 0, 'k'},
+ {"locale", required_argument, 0, 'L'},
+ {"exact", no_argument, 0, 'e'},
+ {0, 0, 0, 0}
+};
+
+#ifdef APROPOS
+static void usage(int status)
+{
+ printf(_( "usage: %s [-d] [-r|-w|-e] [-m systems] [-M manpath] | [-h] | [-V] keyword ...\n"), program_name);
+ printf(_(
+ "-d --debug produce debugging info.\n"
+ "-r --regex interpret each keyword as a regex (default).\n"
+ "-e --exact search each keyword for exact match.\n"
+ "-w --wildcard the keyword(s) contain wildcards.\n"
+ "-m --systems system include alternate systems man pages.\n"
+ "-M --manpath path set search path for manual pages to `path'.\n"
+ "-V --version show version.\n"
+ "-h --help show this usage message.\n")
+ );
+
+ exit (status);
+}
+#else
+static void usage(int status)
+{
+ printf(_( "usage: %s [-d] [-r|-w] [-m systems] [-M manpath] | [-h] | [-V] keyword ...\n"), program_name);
+ printf(_(
+ "-d --debug produce debugging info.\n"
+ "-r --regex interpret each keyword as a regex.\n"
+ "-w --wildcard the keyword(s) contain wildcards.\n"
+ "-m --systems system include alternate systems man pages.\n"
+ "-M --manpath path set search path for manual pages to `path'.\n"
+ "-V --version show version.\n"
+ "-h --help show this usage message.\n")
+ );
+
+ exit (status);
+}
+#endif
+
+/* do the old thing, if we cannot find the relevant database */
+static __inline__ int use_grep(char *page, char *manpath)
+{
+ char *whatis_file = strappend(NULL, manpath, "/whatis", NULL);
+ int status;
+
+ if (access(whatis_file, R_OK) == 0) {
+#if defined(WHATIS)
+ char *command = strappend(NULL, "grep -i '^", page,
+ "' ", whatis_file, NULL);
+#elif defined(APROPOS)
+ char *flags, *command;
+
+#ifdef REGEX
+ if (regex)
+ flags = "-iE";
+ else
+#endif
+ flags = "-iEw";
+
+ command = strappend(NULL, "grep ", flags, " '", page,
+ "' ", whatis_file, NULL);
+#endif
+ status = (system(command) == 0);
+ free(command);
+ } else {
+ if (debug) {
+ error (0, 0, _( "warning: can't read the fallback whatis text database."));
+ error (0, errno, "%s/whatis", manpath);
+ }
+ status = 0;
+ }
+
+ free(whatis_file);
+ return status;
+}
+
+/* fill_in_whatis() is really a ../libdb/db_lookup.c routine but whatis.c
+ is the only file that actually requires access to the whatis text... */
+
+/* Take mandata struct (earlier returned from a dblookup()) and return
+ the relative whatis */
+static char *get_whatis(struct mandata *info)
+{
+ struct mandata *newinfo;
+
+ /* In the future we may need to gaurd against an infinate
+ recursive loop here, but as info->pointer only points to
+ whatis refs, we're safe for the time being */
+
+ /* ensure we need to fill in the whatis */
+ if (*(info->pointer) == '-') {
+ if (*(info->whatis))
+ return xstrdup(info->whatis);
+ else
+ return xstrdup(_( "(unknown)"));
+ }
+
+ newinfo = dblookup_exact(info->pointer, info->ext);
+
+ /* If the pointer lookup fails, do nothing */
+ if (newinfo) {
+ char *whatis;
+ whatis = get_whatis(newinfo);
+ free_mandata_struct(newinfo);
+ return whatis;
+ } else
+ return xstrdup(_( "(unknown)"));
+}
+
+/* print out any matches found */
+static void display(struct mandata *info, char *page)
+{
+ char *string, *whatis;
+
+ whatis = get_whatis(info);
+
+ if (debug)
+ dbprintf(info);
+
+ if (*(info->pointer) == '-')
+ string = strappend(NULL, page, " (", info->ext, ")", NULL);
+ else
+ string = strappend(NULL, page, " (", info->ext, ") [",
+ info->pointer, "]", NULL);
+
+ if (strlen(string) < (size_t) 20)
+ printf("%-20s - %s\n", string, whatis);
+ else
+ printf("%s - %s\n", string, whatis);
+
+ free(whatis);
+ free(string);
+}
+
+/* return lowered version of s */
+static char *lower(char *s)
+{
+ char *low, *p;
+
+ p = low = (char *) xmalloc (strlen(s) +1);
+
+ while (*s) {
+ if (isupper(*s))
+ *p++ = tolower(*s++);
+ else
+ *p++ = *s++;
+ }
+
+ *p = *s;
+ return low;
+}
+
+#ifdef WHATIS
+/* lookup the page and display the results */
+static __inline__ int whatis(char *page)
+{
+ struct mandata *info;
+ int count = 0;
+
+ info = dblookup_all(page, NULL);
+ while (info) {
+ struct mandata *pinfo;
+
+ display(info, page);
+ count++;
+ pinfo = info->next; /* go on to next structure */
+ free(info->addr); /* free info's `content' */
+ free(info); /* free info */
+ info = pinfo;
+ }
+ return count;
+}
+#endif /* WHATIS */
+
+/* return 1 if page matches name, else 0 */
+static int parse_name(char *page, char *dbname)
+{
+#ifdef REGEX
+ if (regex)
+# if defined(POSIX_REGEX)
+ return (regexec(&preg, dbname, 0, (regmatch_t *) 0, 0) == 0);
+# elif defined(BSD_REGEX)
+ return re_exec(dbname);
+# endif
+#endif /* REGEX */
+
+#ifdef APROPOS
+ if (!wildcard) {
+ char *lowdbname = lower(dbname);
+ return STREQ(lowdbname, page);
+ free(lowdbname);
+ }
+#endif
+
+ return (fnmatch(page, dbname, 0) == 0);
+}
+
+#ifdef APROPOS
+/* return 1 on word match */
+static int match(char *lowpage, char *whatis)
+{
+ char *lowwhatis = lower(whatis);
+ size_t len = strlen(lowpage);
+ char *p, *begin;
+
+ begin = lowwhatis;
+
+ /* check for string match, then see if it is a _word_ */
+ while (lowwhatis && (p = strstr(lowwhatis, lowpage))) {
+ char *left = p - 1;
+ char *right = p + len;
+
+ if ((p == begin || (!islower(*left) && *left != '_')) &&
+ (!*right || (!islower(*right) && *right != '_')) ) {
+ free(begin);
+ return 1;
+ }
+ lowwhatis = p + 1;
+ }
+
+ free(begin);
+ return 0;
+}
+
+/* return 1 if page matches whatis, else 0 */
+static int parse_whatis(char *page, char *lowpage, char *whatis)
+{
+#ifdef REGEX
+ if (regex)
+# if defined(POSIX_REGEX)
+ return (regexec(&preg, whatis, 0, (regmatch_t *) 0, 0) == 0);
+# elif defined(BSD_REGEX)
+ return re_exec(whatis);
+# endif
+#endif /* REGEX */
+
+ if (wildcard)
+ return (fnmatch(page, whatis, 0) == 0);
+
+ return match(lowpage, whatis);
+}
+#endif /* APROPOS */
+
+/* scan for the page, print any matches */
+static int apropos(char *page, char *lowpage)
+{
+ datum key, cont;
+ int found = 0;
+
+#ifndef BTREE
+ datum nextkey;
+
+ key = MYDBM_FIRSTKEY(dbf);
+ while (key.dptr) {
+ if (*key.dptr != '$') {
+ cont= MYDBM_FETCH(dbf, key);
+#else /* BTREE */
+ int end;
+
+ end = btree_nextkeydata(dbf, &key, &cont);
+ while (!end) {
+ if (*key.dptr != '$') {
+#endif /* !BTREE */
+
+ /* bug#4372, NULL pointer dereference in cont.dptr, fix
+ * by dassen@wi.leidenuniv.nl (J.H.M.Dassen), thanx Ray.
+ */
+ if (cont.dptr && (*cont.dptr != '\t')) /* a real page */
+ {
+ char *tab;
+ int match;
+#ifdef APROPOS
+ char *whatis;
+#endif
+
+ if ((tab = strrchr(key.dptr, '\t')))
+ *tab = '\0';
+
+
+#ifdef APROPOS
+ match = parse_name(lowpage, key.dptr);
+ whatis = strrchr(cont.dptr, '\t');
+ if (!(whatis && *++whatis))
+ whatis = NULL;
+
+ if (!match && whatis)
+ match = parse_whatis(page, lowpage,
+ whatis);
+#else /* WHATIS */
+ match = parse_name(page, key.dptr);
+#endif /* APROPOS */
+ if (match) {
+ struct mandata info;
+ split_content(cont.dptr, &info);
+ display(&info, key.dptr);
+ found++;
+ cont.dptr = info.addr;
+ }
+
+ found += match;
+ if (tab)
+ *tab = '\t';
+ }
+#ifndef BTREE
+ MYDBM_FREE(cont.dptr);
+ }
+ nextkey = MYDBM_NEXTKEY(dbf, key);
+ MYDBM_FREE(key.dptr);
+ key = nextkey;
+#else /* BTREE */
+ }
+ MYDBM_FREE(cont.dptr);
+ MYDBM_FREE(key.dptr);
+ end = btree_nextkeydata(dbf, &key, &cont);
+#endif /* !BTREE */
+ }
+
+ return found;
+}
+
+/* loop through the man paths, searching for a match */
+static void search(char *page)
+{
+ int found = 0;
+ char *lowpage = lower(page);
+ char *catpath, **mp;
+
+ if (debug)
+ fprintf(stderr, "lower(%s) = \"%s\"\n", page, lowpage);
+
+ for (mp = manpathlist; *mp; mp++) {
+ catpath = global_catpath(*mp);
+
+ if (catpath) {
+ database = mkdbname(catpath);
+ free(catpath);
+ } else
+ database = mkdbname(*mp);
+
+ if (debug)
+ fprintf(stderr, "path=%s\n", *mp);
+
+ if ( !(dbf = MYDBM_RDOPEN(database)) || dbver_rd(dbf)) {
+ found += use_grep(page, *mp);
+ continue;
+ }
+
+#ifdef WHATIS
+# ifdef REGEX
+ if (regex || wildcard) {
+# else /* !REGEX */
+ if (wildcard) {
+# endif /* REGEX */
+ found += apropos(page, lowpage);
+ } else
+ found += whatis(page);
+#else /* APROPOS */
+ found += apropos(page, lowpage);
+#endif /* WHATIS */
+ MYDBM_CLOSE(dbf);
+ }
+
+ chkr_garbage_detector();
+
+ if (!found) {
+ printf(_( "%s: nothing appropriate.\n"), page);
+ status = NOT_FOUND;
+ }
+
+ free (lowpage);
+}
+
+int main(int argc, char *argv[])
+{
+ int c;
+ char *manp = NULL, *alt_systems = "";
+ char *llocale=0, *locale;
+ int option_index;
+
+ program_name = xstrdup(basename((argv[0])));
+
+ /* initialise the locale */
+ locale = setlocale( LC_MESSAGES, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+ if (locale != NULL
+ || (locale = getenv ("LC_ALL"))
+ || (locale = getenv ("LC_MESSAGES"))
+ || (locale = getenv ("LANG")) )
+ locale = xstrdup (locale);
+ else
+ locale = "C";
+
+ while ((c = getopt_long (argc, argv, args,
+ long_options, &option_index)) != EOF) {
+ switch (c) {
+
+ case 'd':
+#ifndef debug
+ debug = 1;
+#endif
+ break;
+ case 'L':
+ llocale = optarg;
+ break;
+ case 'm':
+ alt_systems = optarg;
+ break;
+ case 'M':
+ manp = optarg;
+ break;
+ case 'e':
+#ifdef REGEX
+ regex = 0;
+ exact = 1;
+#endif
+ break;
+ case 'r':
+#ifdef REGEX
+ regex = 1;
+#endif
+ break;
+ case 'w':
+ wildcard = 1;
+ break;
+ case 'f': /* fall through */
+ case 'k': /* ignore, may be passed by man */
+ break;
+ case 'V':
+ ver();
+ break;
+ case 'h':
+ usage(OK);
+ break;
+ default:
+ usage(FAIL);
+ break;
+ }
+ }
+
+ /* close this locale and reinitialise incase a new locale was
+ issued as an argument or in $MANOPT */
+ if (llocale) {
+ setlocale(LC_MESSAGES, llocale);
+ locale = xstrdup( llocale);
+if (debug) fprintf(stderr, "main(): locale= %s,internal_locale= %s\n", llocale, locale);
+ if (locale) {
+ extern int _nl_msg_cat_cntr;
+ if (locale[2] == '_' )
+ locale[2] = '\0';
+ setenv ("LANGUAGE", locale, 1);
+ ++_nl_msg_cat_cntr;
+ }
+ }
+
+#if defined(REGEX) && defined(APROPOS)
+ /* Become it even if it's null - GNU standards */
+ /* if (getenv("POSIXLY_CORRECT")) */
+ if ( ! exact )
+ regex = 1;
+#endif
+
+ /* Make sure that we have a keyword! */
+ if (argc == optind) {
+ printf (_( "%s what?\n"), program_name);
+ return 0;
+ }
+
+ /* sort out the internal manpath */
+ if (manp == NULL)
+ manp = add_nls_manpath(manpath (alt_systems), locale);
+ else
+ free(manpath(NULL));
+
+ create_pathlist(xstrdup(manp), manpathlist);
+
+ while (optind < argc) {
+#if defined(POSIX_REGEX)
+ if (regex) {
+ int errcode = regcomp(&preg, argv[optind],
+ REG_EXTENDED|
+ REG_NOSUB|
+ REG_ICASE);
+
+ if (errcode) {
+ char error_string[64];
+ regerror(errcode, &preg, error_string, 64);
+ error (FAIL, 0, _( "fatal: regex `%s': %s"), argv[optind], error_string);
+ }
+ }
+#elif defined(BSD_REGEX)
+ if (regex) {
+
+ /* How to set type of regex ...? */
+
+ char *error_string = re_comp(argv[optind]);
+ if (error_string)
+ error (FAIL, 0, _( "fatal: regex `%s': %s"), argv[optind], error_string);
+
+ }
+#endif /* REGEX */
+ search(argv[optind++]);
+ }
+
+ exit (status);
+}
diff --git a/src/wrapper.c b/src/wrapper.c
new file mode 100644
index 00000000..6e015b18
--- /dev/null
+++ b/src/wrapper.c
@@ -0,0 +1,109 @@
+/*
+ * wrapper.c - wrapper program around man and mandb
+ * Copyright (c) 2000 Fabrizio Polacco, <fpolacco@debian.org>
+ * This source file is part of the package man-db
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 dated June, 1991.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * A copy of the GNU General Public License is available in
+ * the original source package which contains this file, or, on a Debian
+ * GNU/Linux system, in /usr/share/common-license/GPL (as installed by
+ * package base-files); if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include <string.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+#include <pwd.h>
+#include <sys/types.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "config.h"
+
+#if NLS
+# include <locale.h>
+# include <libintl.h>
+# define _(Text) gettext (Text)
+#else
+# undef bindtextdomain
+# define bindtextdomain(Domain, Directory) /* empty */
+# undef textdomain
+# define textdomain(Domain) /* empty */
+# define _(Text) Text
+#endif
+
+
+/* this list is used to autenticate the program running.
+ * it is fixed at compile time to avoid a full class of
+ * dangers ...
+ */
+struct {
+ const char * prog;
+ const char * run;
+ const char * user;
+} *wlp, wrapped_list[] =
+{ /* prog run user */
+ { "man", "/usr/lib/man-db/man", "man" },
+ { "mandb", "/usr/lib/man-db/mandb", "man" },
+ { 0, 0, 0, }};
+
+char *program_name;
+
+int main( int argc, char **argv)
+{
+ uid_t ruid;
+ char * fakeroot;
+ char * p;
+ struct passwd *pwd;
+
+ setlocale (LC_ALL, "");
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
+ /* this wrapper can be run as "man" or as "mandb" */
+ p = strrchr( argv[0], '/');
+ program_name = ( p ? ++p : argv[0] );
+
+ ruid = getuid ();
+ fakeroot = getenv("FAKEROOTKEY");
+
+#ifdef DEBUG
+ printf( "%s:\n", program_name);
+ printf( "real = %d, = %d, fakeroot = %d\n"
+ , (int)ruid, (fakeroot!=0));
+#endif
+
+ for ( wlp=wrapped_list; wlp->prog && strcmp( program_name, wlp->prog); ++wlp)
+ ;
+ if (!wlp->prog) {
+ fprintf( stderr, _("Don't know which program should I run being >%s<\n"),
+ program_name);
+ return -ENOENT;
+ }
+
+ if ( !fakeroot && ruid == 0 ) {
+ pwd = getpwnam( wlp->user);
+ if ( !pwd
+ || setgid(pwd->pw_gid)
+ || initgroups( wlp->user, pwd->pw_gid)
+ || setuid(pwd->pw_uid)) {
+ fprintf( stderr, _("%s: Failed su to user %s\n"),
+ wlp->prog, wlp->user);
+ return -EACCES;
+ }
+ }
+ execv( wlp->run, argv);
+ perror("execv");
+ return -errno;
+}
diff --git a/stamp-h.in b/stamp-h.in
new file mode 100644
index 00000000..30b2420b
--- /dev/null
+++ b/stamp-h.in
@@ -0,0 +1 @@
+Sun Jun 4 00:26:20 EEST 2000
diff --git a/tools/README b/tools/README
new file mode 100644
index 00000000..d618d20f
--- /dev/null
+++ b/tools/README
@@ -0,0 +1,19 @@
+This directory contains various shell scripts:
+
+checkman: Can be run to inform of manual pages duplicated across
+ hierarchies.
+
+install-sh: Used by configure if a BSD-like install program is not
+ found.
+
+mandb_[nt]fmt-script:
+ An example of a per manual page hierarchy formatter
+ script.
+
+mkcatdirs: Can be used to create all of the required cat directories
+ after installation.
+
+mkinstalldirs: Used by the Makefiles to create any install dirctories that
+ do not already exist.
+
+nroff-script: A script suitable to emulate nroff on systems using groff.
diff --git a/tools/chconfig b/tools/chconfig
new file mode 100644
index 00000000..45a2bfd4
--- /dev/null
+++ b/tools/chconfig
@@ -0,0 +1,117 @@
+#!/usr/bin/perl -w
+
+ # chconfig
+ # (c) 1999 Fabrizio Polacco <fpolacco@prosa.it>
+ #
+ # tool to convert the man-db configuration file to the FHS.
+ # it slurps the file in argument (default /etc/manpath.config) and,
+ # unless exists in it a single line containing the keyword
+ # NOFHS
+ # it tries to make the changes to comply with FHS.
+ #
+
+push @ARGV, "/etc/manpath.config" unless @ARGV;
+ print " Upgrading $ARGV[0]\n";
+
+my $myum = 0;
+my $myusm = 0;
+my $mh = 0;
+my $mhug = 0;
+my $mhob = 0;
+my $mhos = 0;
+my $mbusm = 0;
+my $mbom = 0;
+
+push @IN, " # config file rewritten by tool chconfig\n";
+while (<>) {
+ warn " Respecting NOFHS directive.\n" and exit 0
+ if m,^\s*NOFHS\s*$,i;
+ warn " Configuration file already processed.\n" and exit 0
+ if m/$IN[0]/;
+ push @IN, $_;
+ # first section
+ $myum = $#IN if m,^MANDATORY_MANPATH\s+/usr/man\s*$, ;
+ $myusm = $#IN if m,^MANDATORY_MANPATH\s+/usr/share/man\s*$, ;
+ # second section
+ $mhug = $#IN if m,^MANPATH_MAP\s+/usr/games\s+, ;
+ $mhob = $#IN if m,^MANPATH_MAP\s+/opt/bin\s+, ;
+ $mhos = $#IN if m,^MANPATH_MAP\s+/opt/sbin\s+, ;
+ $mh = $#IN if m,^MANPATH_MAP\s+, ;
+ # third section
+ if ( m,^MANDB_MAP\s+(/\S+)(?:\s+.*)?$, ) {
+ $w = $1 ;
+ push @IN3, ( $w =~ s,/,,g) . " $_";
+ $mbusm = $#IN if m,^MANDB_MAP\s+/usr/share/man(?:\s+.*)?$, ;
+ $mbom = $#IN if m,^MANDB_MAP\s+/opt/man(?:\s+.*)?$, ;
+ }
+}
+ # In the third section, if needed, add the lines
+ # MANDB_MAP /usr/share/man /var/cache/man/share
+ # MANDB_MAP /opt/man /var/cache/man/opt
+push @IN3, "3 MANDB_MAP\t/usr/share/man\t/var/cache/man/share\n" unless $mbusm;
+push @IN3, "2 MANDB_MAP\t/opt/man\t/var/cache/man/opt\n" unless $mbom;
+
+$saved = $ARGV . ".orig";
+rename $ARGV, ( -e $saved ? $ARGV . "~" : $saved );
+open OUT, ">$ARGV" or die "Cannot open output file $ARGV: $!\n";
+
+foreach $j (0..$#IN) {
+ $_ = $IN[$j];
+ # first section
+ # MANDATORY_MANPATH section:
+ # we have to add
+ # MANDATORY_MANPATH /usr/share/man
+ # just after the usual line
+ # MANDATORY_MANPATH /usr/man
+ # which we leave in place.
+ if ( ! $myusm and $j == $myum ) {
+ print OUT ;
+ print OUT "MANDATORY_MANPATH\t\t\t/usr/share/man\n";
+ next;
+ }
+ # second section
+ # MANPATH_MAP section:
+ # we change all the manpath_elements from /usr/man to /usr/share/man.
+ # we also add the lines
+ # MANPATH_MAP /usr/games /usr/share/man
+ # MANPATH_MAP /opt/bin /opt/man
+ # MANPATH_MAP /opt/sbin /opt/man
+ # if they were missing.
+ if ( m,^MANPATH_MAP\s+, ) {
+ s,(\s+)/usr/man\s*$,$1/usr/share/man\n,;
+ print OUT ;
+ # only after the last entry of the section!
+ if ( $j == $mh ) {
+ print OUT "MANPATH_MAP\t/usr/games\t\t/usr/share/man\n"
+ unless $mhug;
+ print OUT "MANPATH_MAP\t/opt/bin\t\t/opt/man\n"
+ unless $mhob;
+ print OUT "MANPATH_MAP\t/opt/sbin\t\t/opt/man\n"
+ unless $mhos;
+ }
+ next;
+ }
+ # third section
+ # MANDB_MAP section:
+ # in the relative_catpath field, we change all occurrences of
+ # /var/catman with /var/cache/man.
+ # we also reorder the entries to have longer manpath before.
+ if ( m,^MANDB_MAP\s+, ) {
+ if ( @IN3 ) {
+ foreach (reverse sort @IN3) {
+ ($w,$t,$m,$c) = split;
+ $c = "/var/cache/man/$c"
+ if !$c or $c =~ m/^FSSTND$/i;
+ $c =~ s,/var/catman,/var/cache/man,;
+ print OUT $t, "\t", $m, "\t\t", $c, "\n";
+ }
+ @IN3 = ();
+ }
+ next;
+ }
+ # default
+ print OUT;
+}
+
+__END__
+
diff --git a/tools/checkman b/tools/checkman
new file mode 100755
index 00000000..a9404162
--- /dev/null
+++ b/tools/checkman
@@ -0,0 +1,58 @@
+#! /bin/sh
+
+# script to weed out duplicated manual pages across hierarchies.
+#
+# Use argument to pass manpaths to the utils, else the system manpath
+# is used.
+#
+# e.g. invoke as `check /usr/man:/usr/local/man'
+
+if test $# -ne 0
+then
+ manpath=$1
+else
+ manpath=`manpath -q`
+fi
+
+echo "Search for duplicates under:" >&2
+echo $manpath >&2
+
+dups=`whatis -w -M $manpath "*" | sed -e 's/\([^ ]*\)[^(]* (\([^)]*\)).*/\2#\1/' | \
+ sort | uniq -d`
+
+for i in $dups
+do
+
+# split up the dup into the section/name components
+
+ args=`echo $i |tr '#' ' '`
+
+# We only cater for two dups. Others will have to be fixed on a later run.
+# Find the locations of the dup'd files
+
+ file1=
+ file2=
+
+ for file in `man -aw -M $manpath $args |sed -e 's/\([^ ]*\).*/\1/'`
+ do
+ if test "$file1"
+ then
+ file2=$file
+ break
+ else
+ file1=$file
+ fi
+ done
+
+# See which is newer and echo
+
+ if test "$file1" -nt "$file2"
+ then
+ echo "$file1 is newer than $file2" >&2
+ echo "$file2"
+ elif test "$file2" -nt "$file1"
+ then
+ echo "$file2 is newer than $file1" >&2
+ echo "$file1"
+ fi
+done
diff --git a/tools/install-manpage b/tools/install-manpage
new file mode 100644
index 00000000..6057af0a
--- /dev/null
+++ b/tools/install-manpage
@@ -0,0 +1,102 @@
+#!/usr/bin/perl -d
+
+# install-manpage - (c) 1998 by Fabrizio Polacco <fpolacco@debian.org>
+# This program is under GPL License, see /usr/doc/copyright/GPL .
+#
+# this utility "installs" (copies) a manpage into his "right[TM]"
+# location, using the "right[TM]" name, depending on its content
+# (mainly the .TH and the .SH NAME sections).
+# Allowed modifiers are --local, --debian for the location,
+# -section <sect> and --name <name> for the name.
+# option --link creates symlinks for alternative names and
+# --gzip compresses the manpage.
+# --debian implies --link and --gzip .
+#
+#
+
+die "work in progress: don't use!";
+
+my $version='0.1';
+
+my $usage = "Usage:\t"."install-manpage [options] <file> ...\n".
+" Installs <file> into its correct location, \n".
+" with its correct name, depending on the \n".
+" content of the .TH and .SH NAME sections. \n".
+" '-' as <file> means stdin; both are filtered to text.\n".
+"options:\n".
+" --local installs in /usr/local instead of /usr;\n".
+" --debian [<path>] installs in ./debian/<path>/usr\n".
+" <path> is optional and defaults to 'tmp'\n".
+" implies --link and --gzip .\n".
+" --section <sect> uses <sect> in name. (deprecated)\n".
+" --name <name> uses <name> in name. (deprecated)\n".
+" --LANG <lang> forces installation in <lang> subdirectory.\n".
+" --[no]link creates one symlink for each name in .SH NAME.\n".
+" --[no]gzip compresses the page using gzip -9 .\n".
+" --help --VERSION --quiet --verbose\n";
+
+use Getopt::Long;
+$Getopt::Long::ignorecase = 0; # distinct Upper
+
+local $opt_help; # used only once
+
+die $usage if ! # in case of error
+&GetOptions
+ ('' # - <stdin>
+ ,'local' # -l --local
+ ,'debian:s' # -d --debian [<path>|"tmp"]
+ ,'section=s' # -s --section <string>
+ ,'name=s' # -n --name <string>
+ ,'LANG=s' # -L --LANG <string>
+ ,'link!' # -l --link --nolink
+ ,'gzip!' # -g --gzip --nogzip
+ #
+ ,'help' # -h --help
+ ,'VERSION' # -V --VERSION
+ ,'quiet' # -q --quiet
+ ,'verbose' # -v --verbose
+ );
+die $usage if $opt_help;
+
+die "lang name missing\n" . $usage if ! $opt_lang;
+die "action flag missing (--add, --remove).\n" . $usage
+ if ((! $opt_add) and (! $opt_remove));
+die "too much action flags (--add and --remove).\n" . $usage
+ if ( $opt_add and $opt_remove);
+
+$OUT = " $opt_file";
+open( OUT) or die "cannot copy file $OUT\n";
+$IN = " $opt_file" . ".bak";
+open( IN, "> $IN") or die "cannot copy to $IN\n";
+print IN <OUT>; # copy original file
+close( IN); close( OUT);
+
+open( IN, "< $IN ") or die "cannot open input file $IN\n";
+open( OUT, "> $OUT") or die "cannot open output file $OUT\n";
+while( <IN>) {
+ print OUT $_ and next if ! m|$opt_keyword| ;
+
+ # process lines containing the keyword
+ print OUT $_ and next if m|^[\t ]*#| ;
+ #print OUT "# ", $_ and next if m|$base/$opt_lang| ;
+ next if m|$base/$opt_lang| ;
+ print OUT $_ and next if ! m|[\t ]*$base[\t ]*| ;
+ print OUT $_ and next if m|[\t ]*$base/| ;
+
+ # process only lines declaring $base as global_manpath
+ ($key, $global, $relative) = split;
+ print OUT "$key\t$global/$opt_lang\t\t$relative/$opt_lang\n" if $opt_add;
+ print OUT ;
+ print OUT <IN>;
+}
+close( IN); close( OUT);
+
+# catman dirs MUST be owned by man
+#if ( $opt_add ) {
+# # create the cat directories only if the man directories exist
+# $res=`mkcatdirs man root 0755`;
+# print $res if $opt_verbose;
+#} else {
+# system "su man -c \"rm -rf $relative/$opt_lang \"";
+#}
+
diff --git a/tools/install-sh b/tools/install-sh
new file mode 100755
index 00000000..8c07c508
--- /dev/null
+++ b/tools/install-sh
@@ -0,0 +1,119 @@
+#! /bin/sh
+
+#
+# install - install a program, script, or datafile
+# This comes from X11R5; it is not part of GNU.
+#
+# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+#
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+
+instcmd="$mvprog"
+chmodcmd=""
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+fi
+
+if [ x"$dst" = x ]
+then
+ echo "install: no destination specified"
+ exit 1
+fi
+
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+if [ -d $dst ]
+then
+ dst="$dst"/`basename $src`
+fi
+
+# Make a temp file name in the proper directory.
+
+dstdir=`dirname $dst`
+dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+$doit $instcmd $src $dsttmp
+
+# and set any options; do chmod last to preserve setuid bits
+
+if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi
+if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi
+if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi
+if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi
+
+# Now rename the file to the real destination.
+
+$doit $rmcmd $dst
+$doit $mvcmd $dsttmp $dst
+
+
+exit 0
diff --git a/tools/mandb_[nt]fmt-script b/tools/mandb_[nt]fmt-script
new file mode 100644
index 00000000..9023a885
--- /dev/null
+++ b/tools/mandb_[nt]fmt-script
@@ -0,0 +1,28 @@
+# !/bin/sh
+# $1 : the source file
+# $2 : the preprocessor string
+# $3 : the output device (optional)
+
+prog=`basename $0`
+prepipe=
+postpipe=
+
+for p in `echo "$2" | sed 's/./& /g'`
+do
+ case $p in
+ e) prepipe="$prepipe | /usr/bin/neqn" ;;
+ g) echo "$prog: can't preprocess with grap" >&2 ;;
+ p) echo "$prog: can't preprocess with pic" >&2 ;;
+ t) prepipe="$prepipe | /usr/bin/tbl" ; postpipe="| /usr/bin/col" ;;
+ r) prepipe="$prepipe | /usr/bin/refer" ;;
+ v) echo "$prog: can't preprocess with vgrind" >&2 ;;
+ *) echo "$prog: unknown preprocessor \`$p'" >&2 ;;
+ esac
+done
+
+case $prog in
+ mandb_tfmt) postpipe="| /usr/bin/troff -t ${3+-T$3}" ;;
+ *) postpipe="| /usr/bin/nroff ${3+-T$3} $postpipe";;
+esac
+
+eval "cat /usr/export/exec/sun4/lib/tmac/tmac.an $1 $prepipe $postpipe"
diff --git a/tools/mkcatdirs b/tools/mkcatdirs
new file mode 100755
index 00000000..32255f2b
--- /dev/null
+++ b/tools/mkcatdirs
@@ -0,0 +1,111 @@
+#! /bin/sh
+#
+# Copyright (C) 1995, Graeme Wilford.
+#
+# You may distribute under the terms of the GNU General Public
+# License as specified in the COPYING file that comes with the man_db
+# distribution.
+#
+# Mon Mar 13 17:46:22 GMT 1995 Wilf. (G.Wilford@ee.surrey.ac.uk):
+
+#PATH=.:/usr/local/bin:/usr/bin:/bin
+
+progname=`basename $0`
+here=`pwd`
+test_only=
+
+# sort out the command line options
+
+if test "$1" = "-t" -o "$1" = "--test"
+then
+ test_only=yes
+else
+ if test "$1" -a "$2" -a "$3"
+ then
+ test_only=no
+ owner=$1
+ group=$2
+ mode=$3
+ fi
+fi
+
+test "$1" = "-h" -o "$1" = "--help" && help=yes || help=
+
+if test "$help" -o -z "$test_only"
+then
+ cat << EOF
+usage: $progname -h | -t | owner group mode
+ -h --help this usage message
+ -t --test don't create anything
+
+This utility will use the information supplied in your manpath
+configuration file to determine which cat directories you require. It
+will then create them as the supplied <owner> and <group> and with
+access permissions of <mode>. <mode> can be any mode accepted by chmod.
+
+A mode of 0755 is recommended in most cases.
+
+The man_db package must be _installed_ for this script to work.
+EOF
+ exit 0
+fi
+
+for manpath in `manpath -qg | tr ':' ' '`
+do
+ echo "Manual page hierarchy: $manpath"
+ catdir=`MANPATH=$manpath manpath -qc 2>/dev/null`
+ cd $manpath
+
+ subdirs=
+ for subdir in `echo man?*`
+ do
+ test -d "$subdir" &&
+ subdirs="$subdirs `echo ${subdir} | sed -e 's,man,cat,'`"
+ done
+
+ echo "Cat page hierarchy: $catdir"
+ echo "Cat sections: $subdirs"
+
+ if test -d "$catdir"
+ then
+ subs_needed=
+ subs_ok=
+ for subdir in $subdirs
+ do
+ cd $catdir
+ test -d "$subdir" &&
+ subs_ok="$subs_ok $subdir" ||
+ subs_needed="$subs_needed $subdir"
+ done
+
+ echo " already present: $subs_ok"
+ echo " need to be created: $subs_needed"
+
+ catdirs=
+ for subdir in $subs_needed
+ do
+ catdirs="$catdirs ${catdir}/${subdir}"
+ done
+ else
+ echo " Cat directory not present, no subdirectories will be created"
+ catdirs=
+ fi
+
+ cd $here
+ if test "$test_only" = "no" -a "$catdirs"
+ then
+ echo " "
+ echo "mkinstalldirs $catdirs" &&
+ mkinstalldirs $catdirs &&
+ echo "chown $owner $catdirs" &&
+ chown $owner $catdirs &&
+ echo "chgrp $group $catdirs" &&
+ chgrp $group $catdirs &&
+ echo "chmod $mode $catdirs" &&
+ chmod $mode $catdirs ||
+ exit $?
+ fi
+
+ echo " "
+done
+
diff --git a/tools/mkinstalldirs b/tools/mkinstalldirs
new file mode 100755
index 00000000..0801ec2c
--- /dev/null
+++ b/tools/mkinstalldirs
@@ -0,0 +1,32 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+# Author: Noah Friedman <friedman@prep.ai.mit.edu>
+# Created: 1993-05-16
+# Last modified: 1994-03-25
+# Public domain
+
+errstatus=0
+
+for file in ${1+"$@"} ; do
+ set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ shift
+
+ pathcomp=
+ for d in ${1+"$@"} ; do
+ pathcomp="$pathcomp$d"
+ case "$pathcomp" in
+ -* ) pathcomp=./$pathcomp ;;
+ esac
+
+ if test ! -d "$pathcomp"; then
+ echo "mkdir $pathcomp" 1>&2
+ mkdir "$pathcomp" || errstatus=$?
+ fi
+
+ pathcomp="$pathcomp/"
+ done
+done
+
+exit $errstatus
+
+# mkinstalldirs ends here
diff --git a/tools/nroff-script b/tools/nroff-script
new file mode 100755
index 00000000..76f3ae9e
--- /dev/null
+++ b/tools/nroff-script
@@ -0,0 +1,56 @@
+#!/bin/sh
+# Emulate nroff with groff.
+
+prog="$0"
+# Default device.
+T=-Tascii
+opts=
+
+for i
+do
+ case $1 in
+ -h)
+ opts="$opts -P-h"
+ ;;
+ -[eq]|-s*)
+ # ignore these options
+ ;;
+ -[mrnoT])
+ echo "$prog: option $1 requires an argument" >&2
+ exit 1
+ ;;
+ -i|-[mrnoV]*)
+ opts="$opts $1";
+ ;;
+
+ -Tascii|-Tlatin1)
+ T=$1
+ ;;
+ -T*)
+ # ignore other devices
+ ;;
+ -u*)
+ # Solaris 2.2 `man' uses -u0; ignore it,
+ # since `less' and `more' can use the emboldening info.
+ ;;
+ --)
+ shift
+ break
+ ;;
+ -)
+ break
+ ;;
+ -*)
+ echo "$prog: invalid option $1" >&2
+ exit 1
+ ;;
+ *)
+ break
+ ;;
+ esac
+ shift
+done
+
+# This shell script is intended for use with man, so warnings are
+# probably not wanted. Also load nroff-style character definitions.
+exec groff -Wall -mtty-char $T $opts ${1+"$@"}
diff --git a/zsoelim/Makefile.in b/zsoelim/Makefile.in
new file mode 100644
index 00000000..db2d3b64
--- /dev/null
+++ b/zsoelim/Makefile.in
@@ -0,0 +1,53 @@
+# zsoelim Makefile for the man package.
+#
+# Copyright (C) 1994, 1995, Graeme Wilford.
+#
+# You may distribute under the terms of the GNU General Public
+# License as specified in the COPYING file that comes with this
+# distribution.
+#
+# Sat Oct 29 13:09:31 GMT 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+
+srcdir = @srcdir@
+VPATH = @srcdir@
+top_srcdir = @top_srcdir@
+INSTALL = @INSTALL@
+
+include ../include/Defines
+
+.PHONY: $(DEFAULT_TARGETS)
+
+override CPPFLAGS := $(DEFS) -I../include -I$(top_srcdir) -I- $(CPPFLAGS)
+override LDLIBS = -lc @LEXLIB@
+
+# You may need to modify these options if you have lex instead of flex
+# and you want to play with zsoelim.l
+FLEXOPTS = -B8 -Cfe -o$@
+LEX := $(LEX) $(FLEXOPTS)
+
+all: zsoelim
+
+zsoelim: ../lib/libman.a
+
+../lib/libman.a:
+ $(MAKE) -C ../lib
+
+# The standard targets
+install: all
+ $(MKINSTALLDIRS) $(bindir)
+ $(INSTALL_PROGRAM) zsoelim $(bindir)/$(zsoelim)
+
+uninstall:
+ rm -f $(bindir)/$(zsoelim)
+
+clean:
+ rm -f zsoelim zsoelim.c *.o core *~
+
+distclean: zsoelim.c clean
+ rm -f Makefile
+
+realclean: distclean
+ rm -f zsoelim.c tags
+
+TAGS:
+ $(MKTAGS) $(srcdir)/*.[lc]
diff --git a/zsoelim/README b/zsoelim/README
new file mode 100644
index 00000000..ef5120eb
--- /dev/null
+++ b/zsoelim/README
@@ -0,0 +1,6 @@
+Here is my soelim replacement. It is required as the first *roff
+pre-processor if we want to be able to deal with 100% of compressed src
+nroff files correctly. Most other ways only guarantee ~90% success.
+
+A replacement tmac.andoc was considered, but would not have been portable to
+all systems.
diff --git a/zsoelim/zsoelim.l b/zsoelim/zsoelim.l
new file mode 100644
index 00000000..a397f05f
--- /dev/null
+++ b/zsoelim/zsoelim.l
@@ -0,0 +1,451 @@
+%{
+
+/*
+ * soelim.l: eliminate .so includes within *roff source
+ *
+ * Copyright (C), 1994, 1995, Graeme W. Wilford. (Wilf.)
+ *
+ * You may distribute under the terms of the GNU General Public
+ * License as specified in the file COPYING that comes with this
+ * distribution.
+ *
+ * Added functionality over gsoelim to allow for compressed .so includes.
+ *
+ * Wed Oct 12 18:46:11 BST 1994 Wilf. (G.Wilford@ee.surrey.ac.uk)
+ *
+ * Tue, 14 Oct 1997 Fabrizio Polacco <fpolacco@debian.org>
+ * - added changes that were done to .c instead of -l source
+ * - added new start condition to avoid execution of .so requests
+ * inside a macro definition.
+ */
+
+#define MAX_SO_DEPTH 10 /* max .so recursion depth */
+#undef ACCEPT_QUOTES /* accept quoted roff requests */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif /* HAVE_CONFIG_H */
+
+#if defined(STDC_HEADERS)
+# include <string.h>
+# include <stdlib.h>
+#elif defined(HAVE_STRING_H)
+# include <string.h>
+#elif defined(HAVE_STRINGS_H)
+# include <strings.h>
+#else /* no string(s) header */
+extern char *strchr(), *strcat();
+extern int strncmp();
+#endif /* STDC_HEADERS */
+
+#if defined(HAVE_UNISTD_H)
+# include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#ifndef STDC_HEADERS
+extern int errno;
+#endif
+
+#define STATIC_VER /* soelim has a static ver() */
+
+#define NAME so_name[so_stack_ptr]
+#define LINE so_line[so_stack_ptr]
+
+#include "manconfig.h"
+#include "lib/error.h"
+
+#ifdef COMP_SRC
+#include "comp_src.h"
+static char* so_delete[MAX_SO_DEPTH];
+#endif /* COMP_SRC */
+
+static int open_file(char *filename);
+
+#ifdef ACCEPT_QUOTES
+# define ZAP_QUOTES zap_quotes()
+static void zap_quotes(void);
+#else
+# define ZAP_QUOTES
+#endif
+
+char *program_name;
+
+static YY_BUFFER_STATE so_stack[MAX_SO_DEPTH];
+static char *so_name[MAX_SO_DEPTH];
+static char temp_name[1024];
+static int so_line[MAX_SO_DEPTH];
+static int so_stack_ptr;
+static int no_newline;
+static int status = OK;
+
+extern int optind;
+%}
+
+%x so
+%x de
+%x end_request
+%x lfnumber
+%x lfname
+
+W [ \t]
+
+%%
+
+^\.de{W}*.+ {
+ no_newline = 1;
+ ECHO;
+ BEGIN(de); /* Now we're inside of a macro definition: ends with a comment */
+ }
+
+^\.so{W}* {
+ no_newline = 1;
+ BEGIN(so); /* Now we're in the .so environment */
+ }
+
+^\.lf{W}* {
+ no_newline = 1;
+ ECHO; /* Now we're in the .lf environment */
+ BEGIN(lfnumber);
+ }
+
+^[^\.\n].* | /* fallback */
+^\.[^sl].* |
+^\.l[^f].* |
+^\.s[^o].* |
+^\.s |
+^\.l |
+. {
+ no_newline = 1;
+ ECHO;
+ }
+
+\n {
+ no_newline = 0;
+ putchar('\n');
+ LINE++;
+ }
+
+
+<so>\"?[^ \t\n\"]+\"? { /* file names including whitespace ? */
+ if (so_stack_ptr == MAX_SO_DEPTH - 1)
+ error (FATAL, 0,
+ "%s:%d: .so requests nested too deeply or are recursive",
+ NAME, LINE);
+
+ ZAP_QUOTES;
+ so_stack[so_stack_ptr++] = YY_CURRENT_BUFFER;
+ LINE = 1;
+
+ no_newline = 0;
+
+ sprintf( temp_name, "%s.gz", yytext);
+ if (open_file(xstrdup(yytext)) && open_file(temp_name)) {
+#ifndef __alpha
+ error(0, 0,
+ "%s:%d: warning: failed .so request", NAME, LINE);
+ printf(".so %s\n", yytext);
+#endif
+ BEGIN(end_request);
+ } else {
+ printf(".lf 1 %s\n", yytext);
+ yy_switch_to_buffer( yy_create_buffer(yyin,
+ YY_BUF_SIZE) );
+ BEGIN(INITIAL);
+ }
+
+ }
+
+<end_request>{W}*\n {
+ no_newline = 0;
+ BEGIN(INITIAL);
+ }
+
+<so>\n {
+ no_newline = 0;
+ error(0, 0,
+ "%s:%d: warning: newline in .so request, ignoring",
+ NAME, LINE);
+ putchar('\n');
+ LINE++;
+ BEGIN(INITIAL);
+ }
+
+<de>^\.\..* {
+ no_newline = 1;
+ ECHO;
+ BEGIN(INITIAL);
+ }
+
+<de>.* {
+ no_newline = 1;
+ ECHO;
+ }
+
+<de>\n {
+ no_newline = 0;
+ putchar('\n');
+ LINE++;
+ }
+
+
+<lfnumber>\"?[0-9]+\"? {
+ no_newline = 1;
+ ECHO;
+ ZAP_QUOTES;
+ LINE = atoi(yytext);
+ BEGIN(lfname);
+ }
+
+<lfname>\"?[^ \t\n\"]+\"? { /* file names including whitespace ?? */
+ no_newline = 1;
+ ECHO;
+ putchar('\n');
+ ZAP_QUOTES;
+ NAME = xstrdup(yytext);
+ BEGIN(end_request);
+ }
+
+<lfname>{W}+ {
+ no_newline = 1;
+ ECHO;
+ }
+
+<lfnumber,lfname>. {
+ no_newline = 1;
+ error(0, 0,
+ "%s:%d: warning: malformed .lf request, ignoring",
+ NAME, LINE);
+ putchar(*yytext);
+ BEGIN(INITIAL);
+ }
+
+<lfnumber,lfname>\n {
+ no_newline = 0;
+ error(0, 0,
+ "%s:%d: warning: newline in .lf request, ignoring",
+ NAME, LINE);
+ putchar('\n');
+ LINE++;
+ BEGIN(INITIAL);
+ }
+
+<<EOF>> {
+ fclose(yyin);
+
+#ifdef COMP_SRC
+ if (so_delete[so_stack_ptr])
+ remove(so_delete[so_stack_ptr]);
+#endif
+ if (no_newline)
+ putchar('\n');
+
+ if ( --so_stack_ptr < 0 ) {
+ yyterminate();
+ } else {
+ yy_delete_buffer( YY_CURRENT_BUFFER );
+ yy_switch_to_buffer( so_stack[so_stack_ptr] );
+ printf(".lf %d %s\n", LINE += 1, NAME);
+ }
+ no_newline = 0;
+ BEGIN(end_request);
+ }
+%%
+
+#ifdef ACCEPT_QUOTES
+/* remove leading and trailing quotes in requests */
+static void zap_quotes(void)
+{
+ if (*yytext == '"') {
+ if (yytext[yyleng - 1] == '"') {
+ yytext[yyleng - 1] = '\0';
+ yytext++;
+ } else
+ error(0, 0, "%s:%d: unterminated quote in roff request",
+ NAME, LINE);
+ }
+}
+#endif
+
+/* print the usage message, then exit */
+static void usage (int status)
+{
+ printf("usage: %s [ -VCh ] [ file ... ]\n", program_name);
+ exit (status);
+}
+
+/* print the version, then exit */
+static __inline__ void ver(void)
+{
+ printf("%s, version %s, %s (G.Wilford@ee.surrey.ac.uk)\n",
+ program_name, VERSION, DATE);
+ exit(OK);
+}
+
+/* initialise the stack and call the parser */
+static void parse_file(void)
+{
+ so_stack_ptr = 0;
+ printf(".lf 1 %s\n", NAME);
+ LINE = 1;
+ yylex();
+}
+
+int main(int argc, char *argv[])
+{
+ int c;
+
+ program_name = basename(argv[0]);
+
+ while ( (c = getopt(argc, argv, "hVC")) != EOF ) {
+ switch (c) {
+ case 'V':
+ ver();
+ break;
+ case 'C':
+ break; /* compatibility with GNU soelim */
+ case 'h':
+ usage(0);
+ break;
+ default:
+ usage(1);
+ break;
+ }
+ }
+
+ /* if we have any arguments, parse them in command line order, else
+ open stdin */
+ if (optind == argc) {
+ so_name[0] = "-";
+ parse_file();
+ } else {
+ while (optind < argc) {
+ if (open_file(argv[optind++]))
+ continue;
+ parse_file();
+ }
+ }
+
+ return status;
+}
+
+/* This routine is used to open the specified file or uncompress a compressed
+ version and open that instead */
+static int open_file(char *filename)
+{
+ FILE *oldyyin;
+ char *ext;
+ char *compfile;
+ int is_hpux=0;
+ int is_compr=0;
+ struct compression *comp;
+ struct stat buf;
+
+ oldyyin = yyin;
+
+/* #ifdef __hpux */
+ ext = strrchr(filename, '.');
+ if (strstr(filename, ".Z/")) { /* The file is in an HPUX directory */
+ compfile = filename;
+ is_hpux = 1;
+ is_compr = 0;
+ } else if (ext) {
+ ext++;
+ for (comp = comp_list; comp->ext && !is_compr; comp++) {
+ if (strcmp(comp->ext, ext) == 0) {
+ if (stat(filename, &buf) == 0) {
+ comp->file = --ext;
+ is_compr = 1;
+ compfile = filename;
+ break;
+ }
+ }
+ }
+ is_hpux = 0;
+ }
+/* #endif __hpux */
+
+ if( is_hpux || is_compr || !(yyin = fopen( filename, "r" ))) {
+
+#ifdef COMP_SRC
+ size_t len;
+
+ if (is_hpux) {
+ struct compression hpux_comp = {GUNZIP " -S \"\"",
+ "", NULL};
+ comp = &hpux_comp;
+ } else if ( ! is_compr) {
+ compfile = strappend(NULL, filename, ".", NULL);
+ len = strlen(compfile);
+
+ for (comp = comp_list; comp->ext; comp++) {
+ compfile = strappend(compfile, comp->ext, NULL);
+ if (stat(compfile, &buf) == 0)
+ break;
+ *(compfile + len) = '\0';
+ }
+ }
+
+ if (comp->ext) {
+ char *command;
+ int exit_status;
+ int file_fd;
+
+ filename = tempnam(NULL, "zsman");
+ if (filename) {
+ unlink( filename); /* remove a malicious dangling symlink */
+ file_fd = open(filename, O_RDONLY|O_NOCTTY|O_CREAT|O_EXCL, 0644);
+ }
+ if (!filename || (file_fd < 0))
+ error (FATAL, errno, "can't create a temporary filename");
+ command = strappend(NULL, comp->prog, " ", compfile, " > ", filename, NULL);
+ exit_status = system(command);
+ close( file_fd);
+
+ if (exit_status != 0) {
+ error (0, 0, "%s exited with status %d",
+ command, exit_status);
+ free(command);
+ yyin = oldyyin;
+ return 1;
+ }
+
+ free(command);
+
+ if( !(yyin = fopen( filename, "r" )) ) {
+ error (0, errno, "open decompressed file: %s",
+ filename);
+ yyin = oldyyin;
+ return 1;
+ }
+
+ so_delete[so_stack_ptr] = filename;
+ NAME = compfile;
+ return 0;
+ }
+#endif /* COMP_SRC */
+ if (so_stack_ptr > 0) {
+ so_stack_ptr--;
+#ifndef __alpha
+ error (0, errno, "%s:%d: %s", NAME, LINE, filename);
+#endif
+ } else {
+ error (0, errno, filename);
+ status = FAIL;
+ }
+ yyin = oldyyin;
+ return 1;
+ }
+ NAME = filename;
+ return 0;
+}
+
+/* for compatibility with systems not having libfl, can't be static */
+int yywrap(void)
+{
+ return 1;
+}