summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>1999-01-11 16:38:16 +0000
committerMarc Espie <espie@cvs.openbsd.org>1999-01-11 16:38:16 +0000
commit33f48d5efec336d91bc14868b6603b6e53804e89 (patch)
treee1b0250475483d3c1404da35563e0743a5e2924d
parent99605a9e62a5b339ff09bd970d377cb20fc4a159 (diff)
Upgrade to 3.12, merge with OpenBSD changes.
-rw-r--r--gnu/usr.bin/texinfo/Makefile.am11
-rw-r--r--gnu/usr.bin/texinfo/Makefile.bsd-wrapper4
-rw-r--r--gnu/usr.bin/texinfo/Makefile.in106
-rw-r--r--gnu/usr.bin/texinfo/configure612
-rw-r--r--gnu/usr.bin/texinfo/configure.in59
-rw-r--r--gnu/usr.bin/texinfo/dir-example572
-rw-r--r--gnu/usr.bin/texinfo/doc/Makefile.am21
-rw-r--r--gnu/usr.bin/texinfo/doc/info-stnd.texi2
-rw-r--r--gnu/usr.bin/texinfo/doc/info.texi2
-rw-r--r--gnu/usr.bin/texinfo/doc/texinfo.tex336
-rw-r--r--gnu/usr.bin/texinfo/doc/texinfo.txi2
-rw-r--r--gnu/usr.bin/texinfo/info/Makefile.am25
-rw-r--r--gnu/usr.bin/texinfo/info/Makefile.in305
-rw-r--r--gnu/usr.bin/texinfo/info/dir.c190
-rw-r--r--gnu/usr.bin/texinfo/info/display.c502
-rw-r--r--gnu/usr.bin/texinfo/info/display.h13
-rw-r--r--gnu/usr.bin/texinfo/info/echo-area.c12
-rw-r--r--gnu/usr.bin/texinfo/info/echo-area.h2
-rw-r--r--gnu/usr.bin/texinfo/info/filesys.c309
-rw-r--r--gnu/usr.bin/texinfo/info/filesys.h15
-rw-r--r--gnu/usr.bin/texinfo/info/footnotes.c114
-rw-r--r--gnu/usr.bin/texinfo/info/footnotes.h16
-rw-r--r--gnu/usr.bin/texinfo/info/gc.h13
-rw-r--r--gnu/usr.bin/texinfo/info/indices.c522
-rw-r--r--gnu/usr.bin/texinfo/info/indices.h15
-rw-r--r--gnu/usr.bin/texinfo/info/info-utils.h26
-rw-r--r--gnu/usr.bin/texinfo/info/info.c549
-rw-r--r--gnu/usr.bin/texinfo/info/info.h145
-rw-r--r--gnu/usr.bin/texinfo/info/infodoc.c527
-rw-r--r--gnu/usr.bin/texinfo/info/infomap.c137
-rw-r--r--gnu/usr.bin/texinfo/info/m-x.c57
-rw-r--r--gnu/usr.bin/texinfo/info/makedoc.c263
-rw-r--r--gnu/usr.bin/texinfo/info/man.c271
-rw-r--r--gnu/usr.bin/texinfo/info/man.h13
-rw-r--r--gnu/usr.bin/texinfo/info/nodemenu.c126
-rw-r--r--gnu/usr.bin/texinfo/info/nodes.h111
-rw-r--r--gnu/usr.bin/texinfo/info/search.h26
-rw-r--r--gnu/usr.bin/texinfo/info/session.c2916
-rw-r--r--gnu/usr.bin/texinfo/info/signals.h19
-rw-r--r--gnu/usr.bin/texinfo/info/termdep.h76
-rw-r--r--gnu/usr.bin/texinfo/info/terminal.c18
-rw-r--r--gnu/usr.bin/texinfo/info/tilde.c258
-rw-r--r--gnu/usr.bin/texinfo/info/variables.c195
-rw-r--r--gnu/usr.bin/texinfo/info/variables.h21
-rw-r--r--gnu/usr.bin/texinfo/info/window.c656
-rw-r--r--gnu/usr.bin/texinfo/info/window.h70
-rw-r--r--gnu/usr.bin/texinfo/lib/Makefile.am2
-rw-r--r--gnu/usr.bin/texinfo/lib/system.h2
-rw-r--r--gnu/usr.bin/texinfo/makeinfo/Makefile.am2
-rw-r--r--gnu/usr.bin/texinfo/makeinfo/makeinfo.c161
-rw-r--r--gnu/usr.bin/texinfo/makeinfo/makeinfo.h62
-rw-r--r--gnu/usr.bin/texinfo/makeinfo/multi.c192
-rw-r--r--gnu/usr.bin/texinfo/mkinstalldirs2
-rw-r--r--gnu/usr.bin/texinfo/po/Makefile.in.in52
-rw-r--r--gnu/usr.bin/texinfo/po/cat-id-tbl.c766
-rw-r--r--gnu/usr.bin/texinfo/util/Makefile.am2
-rw-r--r--gnu/usr.bin/texinfo/util/gen-dir-node18
-rw-r--r--gnu/usr.bin/texinfo/util/install-info.c92
-rw-r--r--gnu/usr.bin/texinfo/util/texi2dvi467
-rw-r--r--gnu/usr.bin/texinfo/util/texindex.c726
60 files changed, 6728 insertions, 6078 deletions
diff --git a/gnu/usr.bin/texinfo/Makefile.am b/gnu/usr.bin/texinfo/Makefile.am
index f861d14ea98..03c30601d08 100644
--- a/gnu/usr.bin/texinfo/Makefile.am
+++ b/gnu/usr.bin/texinfo/Makefile.am
@@ -1,15 +1,16 @@
## Makefile.am for texinfo.
-## $Id: Makefile.am,v 1.1 1997/08/01 21:59:31 kstailey Exp $
+## $Id: Makefile.am,v 1.2 1999/01/11 16:38:00 espie Exp $
## Process this file with automake to produce Makefile.in in all directories.
-## Be sure we're using the right version of Automake.
-AUTOMAKE_OPTIONS = 1.1p
+# Be sure we're using the right version of Automake.
+# 1.2f was the first version that supported .txi as a Texinfo suffix.
+AUTOMAKE_OPTIONS = 1.2f
# Additional files to distribute.
-EXTRA_DIST = INTRODUCTION dir-example README-alpha
+EXTRA_DIST = INTRODUCTION dir-example
# All subdirectories.
# Do intl/ and lib/ first since the C programs depend on them.
# Do doc/ last so makeinfo will be built when we get there.
# Others are alphabetical.
-SUBDIRS = intl lib emacs info makeinfo po util doc
+SUBDIRS = intl lib info makeinfo po util doc
diff --git a/gnu/usr.bin/texinfo/Makefile.bsd-wrapper b/gnu/usr.bin/texinfo/Makefile.bsd-wrapper
index 660b166715c..b2d3952a3d5 100644
--- a/gnu/usr.bin/texinfo/Makefile.bsd-wrapper
+++ b/gnu/usr.bin/texinfo/Makefile.bsd-wrapper
@@ -1,9 +1,9 @@
-# $OpenBSD: Makefile.bsd-wrapper,v 1.25 1998/10/18 20:02:35 millert Exp $
+# $OpenBSD: Makefile.bsd-wrapper,v 1.26 1999/01/11 16:38:00 espie Exp $
INFODIR= infodir=${DESTDIR}/usr/share/info
INFOPATH= DEFAULT_INFOPATH=/usr/local/info:/usr/share/info:.
CLEANFILES= makeinfo/makeinfo.info info/info.info info/info-stnd.info \
- emacs/Makefile
+ info/funs.h info/doc.c
NOMAN= # info.1 manpage passed into obsolescence
SUBDIRS= intl lib info makeinfo po util doc
diff --git a/gnu/usr.bin/texinfo/Makefile.in b/gnu/usr.bin/texinfo/Makefile.in
index 239d0229e0b..dda80775567 100644
--- a/gnu/usr.bin/texinfo/Makefile.in
+++ b/gnu/usr.bin/texinfo/Makefile.in
@@ -1,8 +1,17 @@
-# Makefile.in generated automatically by automake 1.2 from Makefile.am
+# Makefile.in generated automatically by automake 1.2f from Makefile.am
-# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+# Be sure we're using the right version of Automake.
+# 1.2f was the first version that supported .txi as a Texinfo suffix.
SHELL = /bin/sh
@@ -43,12 +52,12 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
transform = @program_transform_name@
-NORMAL_INSTALL = true
-PRE_INSTALL = true
-POST_INSTALL = true
-NORMAL_UNINSTALL = true
-PRE_UNINSTALL = true
-POST_UNINSTALL = true
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
@@ -58,6 +67,7 @@ GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
+INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
@@ -77,16 +87,16 @@ USE_NLS = @USE_NLS@
VERSION = @VERSION@
l = @l@
-AUTOMAKE_OPTIONS = 1.1p
+AUTOMAKE_OPTIONS = 1.2f
# Additional files to distribute.
-EXTRA_DIST = INTRODUCTION dir-example README-alpha
+EXTRA_DIST = INTRODUCTION dir-example
# All subdirectories.
# Do intl/ and lib/ first since the C programs depend on them.
# Do doc/ last so makeinfo will be built when we get there.
# Others are alphabetical.
-SUBDIRS = intl lib emacs info makeinfo po util doc
+SUBDIRS = intl lib info makeinfo po util doc
# XXX OpenBSD customizations
# We need this as we have different installpaths depending on the
@@ -120,9 +130,9 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES =
DIST_COMMON = README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL \
-Makefile.am Makefile.in NEWS THANKS TODO acconfig.h aclocal.m4 \
-config.guess config.h.in config.sub configure configure.in install-sh \
-missing mkinstalldirs stamp-h.in
+Makefile.am Makefile.in NEWS TODO acconfig.h aclocal.m4 config.guess \
+config.h.in config.sub configure configure.in install-sh missing \
+mkinstalldirs stamp-h.in texinfo.tex
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
@@ -148,6 +158,7 @@ $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCI
cd $(srcdir) && $(AUTOCONF)
config.h: stamp-h
+ @:
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
@@ -163,7 +174,7 @@ mostlyclean-hdr:
clean-hdr:
distclean-hdr:
- rm -f config.h
+ -rm -f config.h
maintainer-clean-hdr:
@@ -180,7 +191,7 @@ all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive info-recursive dvi-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
- for subdir in $(SUBDIRS); do \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
(cd $$subdir && $(SUBDIRMAKE) $$target) \
@@ -190,7 +201,9 @@ check-recursive installcheck-recursive info-recursive dvi-recursive:
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
- rev=''; for subdir in $(SUBDIRS); do rev="$$rev $$subdir"; done; \
+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ rev="$$subdir $$rev"; \
+ done; \
for subdir in $$rev; do \
target=`echo $@ | sed s/-recursive//`; \
echo "Making $$target in $$subdir"; \
@@ -204,24 +217,29 @@ tags-recursive:
tags: TAGS
-ID: $(HEADERS) $(SOURCES)
- here=`pwd` && cd $(srcdir) && mkid -f$$here/ID $(SOURCES) $(HEADERS)
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
-TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES)
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
done; \
- test -z "$(ETAGS_ARGS)config.h.in$(SOURCES)$(HEADERS)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $(SOURCES) $(HEADERS) -o $$here/TAGS)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
- rm -f TAGS ID
+ -rm -f TAGS ID
maintainer-clean-tags:
@@ -232,7 +250,7 @@ top_distdir = $(distdir)
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
- rm -rf $(distdir)
+ -rm -rf $(distdir)
GZIP=$(GZIP) $(TAR) zxf $(distdir).tar.gz
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
@@ -245,20 +263,20 @@ distcheck: dist
&& $(MAKE) install \
&& $(MAKE) installcheck \
&& $(MAKE) dist
- rm -rf $(distdir)
+ -rm -rf $(distdir)
@echo "========================"; \
echo "$(distdir).tar.gz is ready for distribution"; \
echo "========================"
dist: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
- rm -rf $(distdir)
+ -rm -rf $(distdir)
dist-all: distdir
-chmod -R a+r $(distdir)
GZIP=$(GZIP) $(TAR) chozf $(distdir).tar.gz $(distdir)
- rm -rf $(distdir)
+ -rm -rf $(distdir)
distdir: $(DISTFILES)
- rm -rf $(distdir)
+ -rm -rf $(distdir)
mkdir $(distdir)
-chmod 777 $(distdir)
@for file in $(DISTFILES); do \
@@ -267,12 +285,12 @@ distdir: $(DISTFILES)
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
- for subdir in $(SUBDIRS); do \
- test -d $(distdir)/$$subdir \
- || mkdir $(distdir)/$$subdir \
- || exit 1; \
- chmod 777 $(distdir)/$$subdir; \
- (cd $$subdir && $(SUBDIRMAKE) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
+ for subdir in $(SUBDIRS); do \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ chmod 777 $(distdir)/$$subdir; \
+ (cd $$subdir && $(SUBDIRMAKE) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|| exit 1; \
done
info: info-recursive
@@ -304,19 +322,19 @@ installdirs: installdirs-recursive
mostlyclean-generic:
- test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
- test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- rm -f Makefile $(DISTCLEANFILES)
- rm -f config.cache config.log stamp-h stamp-h[0-9]*
- test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
- test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
@@ -331,12 +349,12 @@ mostlyclean: mostlyclean-recursive mostlyclean-am
clean: clean-recursive clean-am
distclean: distclean-recursive distclean-am
- rm -f config.status
+ -rm -f config.status
maintainer-clean: maintainer-clean-recursive maintainer-clean-am
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
- rm -f config.status
+ -rm -f config.status
.PHONY: default mostlyclean-hdr distclean-hdr clean-hdr \
maintainer-clean-hdr install-data-recursive uninstall-data-recursive \
diff --git a/gnu/usr.bin/texinfo/configure b/gnu/usr.bin/texinfo/configure
index fda1f825760..844c73e447f 100644
--- a/gnu/usr.bin/texinfo/configure
+++ b/gnu/usr.bin/texinfo/configure
@@ -610,24 +610,8 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
-
-PACKAGE=texinfo
-
-VERSION=3.11
-
-if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
- { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
-fi
-cat >> confdefs.h <<EOF
-#define PACKAGE "$PACKAGE"
-EOF
-
-cat >> confdefs.h <<EOF
-#define VERSION "$VERSION"
-EOF
-
echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:631: checking whether build environment is sane" >&5
+echo "configure:615: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@@ -638,10 +622,21 @@ echo timestamp > conftestfile
# directory).
if (
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
- if test "" = "X"; then
+ if test "$*" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftestfile`
fi
+ if test "$*" != "X $srcdir/configure conftestfile" \
+ && test "$*" != "X conftestfile $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ { echo "configure: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" 1>&2; exit 1; }
+ fi
+
test "$2" = conftestfile
)
then
@@ -672,9 +667,54 @@ test "$program_suffix" != NONE &&
# sed with no file args requires a program.
test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:672: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftestmake <<\EOF
+all:
+ @echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+ eval ac_cv_prog_make_${ac_make}_set=yes
+else
+ eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ SET_MAKE=
+else
+ echo "$ac_t""no" 1>&6
+ SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+PACKAGE=texinfo
+
+VERSION=3.12
+
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+ { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+fi
+cat >> confdefs.h <<EOF
+#define PACKAGE "$PACKAGE"
+EOF
+
+cat >> confdefs.h <<EOF
+#define VERSION "$VERSION"
+EOF
+
+
+
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:678: checking for working aclocal" >&5
+echo "configure:718: checking for working aclocal" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -687,7 +727,7 @@ else
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:691: checking for working autoconf" >&5
+echo "configure:731: checking for working autoconf" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -700,7 +740,7 @@ else
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:704: checking for working automake" >&5
+echo "configure:744: checking for working automake" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -713,7 +753,7 @@ else
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:717: checking for working autoheader" >&5
+echo "configure:757: checking for working autoheader" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -726,7 +766,7 @@ else
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:730: checking for working makeinfo" >&5
+echo "configure:770: checking for working makeinfo" >&5
# Run test in a subshell; some versions of sh will print an error if
# an executable is not found, even if stderr is redirected.
# Redirect stdin to placate older versions of autoconf. Sigh.
@@ -738,38 +778,12 @@ else
echo "$ac_t""missing" 1>&6
fi
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:743: checking whether ${MAKE-make} sets \${MAKE}" >&5
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftestmake <<\EOF
-all:
- @echo 'ac_maketemp="${MAKE}"'
-EOF
-# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
-rm -f conftestmake
-fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- SET_MAKE=
-else
- echo "$ac_t""no" 1>&6
- SET_MAKE="MAKE=${MAKE-make}"
-fi
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:773: checking for $ac_word" >&5
+echo "configure:787: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -798,7 +812,7 @@ if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:802: checking for $ac_word" >&5
+echo "configure:816: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -846,7 +860,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:850: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:864: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
ac_ext=c
# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
@@ -856,11 +870,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS
cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext <<EOF
-#line 860 "configure"
+#line 874 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -880,12 +894,12 @@ if test $ac_cv_prog_cc_works = no; then
{ echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:884: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:898: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:889: checking whether we are using GNU C" >&5
+echo "configure:903: checking whether we are using GNU C" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -894,7 +908,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:898: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:912: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -909,7 +923,7 @@ if test $ac_cv_prog_gcc = yes; then
ac_save_CFLAGS="$CFLAGS"
CFLAGS=
echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
-echo "configure:913: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:927: checking whether ${CC-cc} accepts -g" >&5
if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -937,7 +951,7 @@ else
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:941: checking how to run the C preprocessor" >&5
+echo "configure:955: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -952,13 +966,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 956 "configure"
+#line 970 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:962: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:976: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -969,13 +983,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 973 "configure"
+#line 987 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:979: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:993: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
:
@@ -999,13 +1013,13 @@ echo "$ac_t""$CPP" 1>&6
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:1003: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:1017: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <<EOF
-#line 1009 "configure"
+#line 1023 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
@@ -1023,7 +1037,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
-#line 1027 "configure"
+#line 1041 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
@@ -1055,7 +1069,7 @@ fi
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1059: checking for a BSD compatible install" >&5
+echo "configure:1073: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1107,7 +1121,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1111: checking for $ac_word" >&5
+echo "configure:1125: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1139,7 +1153,7 @@ TEXMF='$(datadir)/texmf'
# Extract the first word of "texconfig", so it can be a program name with args.
set dummy texconfig; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1143: checking for $ac_word" >&5
+echo "configure:1157: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_TEXCONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1165,11 +1179,11 @@ else
echo "$ac_t""no" 1>&6
fi
-$TEXCONFIG && eval `texconfig confall | grep '^TEXMF='`
+$TEXCONFIG && eval `texconfig conf </dev/null | grep '^TEXMF='`
echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6
-echo "configure:1173: checking for POSIXized ISC" >&5
+echo "configure:1187: checking for POSIXized ISC" >&5
if test -d /etc/conf/kconfig.d &&
grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
then
@@ -1191,17 +1205,17 @@ fi
ac_safe=`echo "minix/config.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for minix/config.h""... $ac_c" 1>&6
-echo "configure:1195: checking for minix/config.h" >&5
+echo "configure:1209: checking for minix/config.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1200 "configure"
+#line 1214 "configure"
#include "confdefs.h"
#include <minix/config.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1219: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1239,9 +1253,103 @@ EOF
fi
-# Needed on sysV68 for sigblock, sigsetmask.
+echo $ac_n "checking for gzdopen in -lz""... $ac_c" 1>&6
+echo "configure:1258: checking for gzdopen in -lz" >&5
+ac_lib_var=`echo z'_'gzdopen | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lz $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 1266 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char gzdopen();
+
+int main() {
+gzdopen()
+; return 0; }
+EOF
+if { (eval echo configure:1277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo z | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lz $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+
+# Needed on sysV68 for sigblock, sigsetmask. But check for it in libc first.
+echo $ac_n "checking for sigblock""... $ac_c" 1>&6
+echo "configure:1307: checking for sigblock" >&5
+if eval "test \"`echo '$''{'ac_cv_func_sigblock'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1312 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char sigblock(); below. */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char sigblock();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined (__stub_sigblock) || defined (__stub___sigblock)
+choke me
+#else
+sigblock();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:1335: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_func_sigblock=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_func_sigblock=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'sigblock`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+else
+ echo "$ac_t""no" 1>&6
echo $ac_n "checking for sigblock in -lbsd""... $ac_c" 1>&6
-echo "configure:1245: checking for sigblock in -lbsd" >&5
+echo "configure:1353: checking for sigblock in -lbsd" >&5
ac_lib_var=`echo bsd'_'sigblock | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1249,7 +1357,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lbsd $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1253 "configure"
+#line 1361 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1260,7 +1368,7 @@ int main() {
sigblock()
; return 0; }
EOF
-if { (eval echo configure:1264: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1275,7 +1383,7 @@ LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- ac_tr_lib=HAVE_LIB`echo bsd | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ ac_tr_lib=HAVE_LIB`echo bsd | sed -e 's/^a-zA-Z0-9_/_/g' \
-e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
cat >> confdefs.h <<EOF
#define $ac_tr_lib 1
@@ -1287,13 +1395,15 @@ else
echo "$ac_t""no" 1>&6
fi
+fi
+
# Some GNU/Linux systems (e.g., SuSE 4.3, 1996) don't have curses, but
# rather ncurses. So we check for it.
TERMLIBS=
for termlib in ncurses curses termcap terminfo termlib ; do
echo $ac_n "checking for tputs in -l${termlib}""... $ac_c" 1>&6
-echo "configure:1297: checking for tputs in -l${termlib}" >&5
+echo "configure:1407: checking for tputs in -l${termlib}" >&5
ac_lib_var=`echo ${termlib}'_'tputs | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1301,7 +1411,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-l${termlib} $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 1305 "configure"
+#line 1415 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -1312,7 +1422,7 @@ int main() {
tputs()
; return 0; }
EOF
-if { (eval echo configure:1316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -1335,13 +1445,55 @@ fi
done
+if test "x$termlib" = xncurses; then
+ for ac_hdr in ncurses/termcap.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:1454: checking for $ac_hdr" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 1459 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1464: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out`
+if test -z "$ac_err"; then
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=yes"
+else
+ echo "$ac_err" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_header_$ac_safe=no"
+fi
+rm -f conftest*
+fi
+if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_hdr 1
+EOF
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+done
+
+fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1340: checking for ANSI C header files" >&5
+echo "configure:1492: checking for ANSI C header files" >&5
if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1345 "configure"
+#line 1497 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -1349,7 +1501,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1353: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1505: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1366,7 +1518,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1370 "configure"
+#line 1522 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -1384,7 +1536,7 @@ fi
if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF
-#line 1388 "configure"
+#line 1540 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -1405,7 +1557,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 1409 "configure"
+#line 1561 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -1416,7 +1568,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:1420: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1572: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
:
else
@@ -1445,17 +1597,17 @@ for ac_hdr in fcntl.h pwd.h string.h strings.h termcap.h termio.h \
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:1449: checking for $ac_hdr" >&5
+echo "configure:1601: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1454 "configure"
+#line 1606 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1459: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1611: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -1482,49 +1634,13 @@ fi
done
-if test "x$termlib" = xncurses; then
- ac_safe=`echo "ncurses/termcap.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for ncurses/termcap.h""... $ac_c" 1>&6
-echo "configure:1489: checking for ncurses/termcap.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1494 "configure"
-#include "confdefs.h"
-#include <ncurses/termcap.h>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1499: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- :
-else
- echo "$ac_t""no" 1>&6
-fi
-
-fi
-
echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1523: checking for off_t" >&5
+echo "configure:1639: checking for off_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1528 "configure"
+#line 1644 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -1552,12 +1668,12 @@ EOF
fi
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:1556: checking return type of signal handlers" >&5
+echo "configure:1672: checking return type of signal handlers" >&5
if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1561 "configure"
+#line 1677 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
@@ -1574,7 +1690,7 @@ int main() {
int i;
; return 0; }
EOF
-if { (eval echo configure:1578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1694: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
@@ -1593,12 +1709,12 @@ EOF
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1597: checking for working const" >&5
+echo "configure:1713: checking for working const" >&5
if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1602 "configure"
+#line 1718 "configure"
#include "confdefs.h"
int main() {
@@ -1647,7 +1763,7 @@ ccp = (char const *const *) p;
; return 0; }
EOF
-if { (eval echo configure:1651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1767: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
@@ -1668,12 +1784,12 @@ EOF
fi
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:1672: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:1788: checking whether struct tm is in sys/time.h or time.h" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1677 "configure"
+#line 1793 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
@@ -1681,7 +1797,7 @@ int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:1685: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1801: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
@@ -1705,19 +1821,19 @@ fi
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6
-echo "configure:1709: checking for working alloca.h" >&5
+echo "configure:1825: checking for working alloca.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1714 "configure"
+#line 1830 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:1721: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_header_alloca_h=yes
else
@@ -1738,12 +1854,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:1742: checking for alloca" >&5
+echo "configure:1858: checking for alloca" >&5
if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1747 "configure"
+#line 1863 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -1766,7 +1882,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:1770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
ac_cv_func_alloca_works=yes
else
@@ -1798,12 +1914,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:1802: checking whether alloca needs Cray hooks" >&5
+echo "configure:1918: checking whether alloca needs Cray hooks" >&5
if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1807 "configure"
+#line 1923 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -1828,12 +1944,12 @@ echo "$ac_t""$ac_cv_os_cray" 1>&6
if test $ac_cv_os_cray = yes; then
for ac_func in _getb67 GETB67 getb67; do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:1832: checking for $ac_func" >&5
+echo "configure:1948: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1837 "configure"
+#line 1953 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -1856,7 +1972,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:1860: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:1976: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -1883,7 +1999,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:1887: checking stack direction for C alloca" >&5
+echo "configure:2003: checking stack direction for C alloca" >&5
if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1891,7 +2007,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 1895 "configure"
+#line 2011 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -1910,7 +2026,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:1914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2030: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_c_stack_direction=1
else
@@ -1932,12 +2048,12 @@ EOF
fi
echo $ac_n "checking for vprintf""... $ac_c" 1>&6
-echo "configure:1936: checking for vprintf" >&5
+echo "configure:2052: checking for vprintf" >&5
if eval "test \"`echo '$''{'ac_cv_func_vprintf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1941 "configure"
+#line 2057 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vprintf(); below. */
@@ -1960,7 +2076,7 @@ vprintf();
; return 0; }
EOF
-if { (eval echo configure:1964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2080: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_vprintf=yes"
else
@@ -1984,12 +2100,12 @@ fi
if test "$ac_cv_func_vprintf" != yes; then
echo $ac_n "checking for _doprnt""... $ac_c" 1>&6
-echo "configure:1988: checking for _doprnt" >&5
+echo "configure:2104: checking for _doprnt" >&5
if eval "test \"`echo '$''{'ac_cv_func__doprnt'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1993 "configure"
+#line 2109 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _doprnt(); below. */
@@ -2012,7 +2128,7 @@ _doprnt();
; return 0; }
EOF
-if { (eval echo configure:2016: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func__doprnt=yes"
else
@@ -2037,7 +2153,7 @@ fi
fi
echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>&6
-echo "configure:2041: checking whether setvbuf arguments are reversed" >&5
+echo "configure:2157: checking whether setvbuf arguments are reversed" >&5
if eval "test \"`echo '$''{'ac_cv_func_setvbuf_reversed'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2045,7 +2161,7 @@ else
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 2049 "configure"
+#line 2165 "configure"
#include "confdefs.h"
#include <stdio.h>
/* If setvbuf has the reversed format, exit 0. */
@@ -2059,7 +2175,7 @@ main () {
exit(0); /* Non-reversed systems segv here. */
}
EOF
-if { (eval echo configure:2063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2179: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_func_setvbuf_reversed=yes
else
@@ -2086,12 +2202,12 @@ for ac_func in setvbuf getcwd memset bzero strchr strcasecmp \
sigprocmask sigsetmask
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2090: checking for $ac_func" >&5
+echo "configure:2206: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2095 "configure"
+#line 2211 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2114,7 +2230,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2118: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2234: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2141,12 +2257,12 @@ done
for ac_func in memcpy memmove strdup strerror
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2145: checking for $ac_func" >&5
+echo "configure:2261: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2150 "configure"
+#line 2266 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2169,7 +2285,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2289: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2198,21 +2314,21 @@ done
ALL_LINGUAS="de fr"
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:2202: checking for inline" >&5
+echo "configure:2318: checking for inline" >&5
if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat > conftest.$ac_ext <<EOF
-#line 2209 "configure"
+#line 2325 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:2216: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -2238,12 +2354,12 @@ EOF
esac
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:2242: checking for size_t" >&5
+echo "configure:2358: checking for size_t" >&5
if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2247 "configure"
+#line 2363 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -2274,17 +2390,17 @@ for ac_hdr in unistd.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2278: checking for $ac_hdr" >&5
+echo "configure:2394: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2283 "configure"
+#line 2399 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2288: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2404: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2313,12 +2429,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2317: checking for $ac_func" >&5
+echo "configure:2433: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2322 "configure"
+#line 2438 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2341,7 +2457,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2345: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2366,7 +2482,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:2370: checking for working mmap" >&5
+echo "configure:2486: checking for working mmap" >&5
if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2374,7 +2490,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 2378 "configure"
+#line 2494 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -2514,7 +2630,7 @@ main()
}
EOF
-if { (eval echo configure:2518: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2634: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null
then
ac_cv_func_mmap_fixed_mapped=yes
else
@@ -2536,23 +2652,23 @@ EOF
fi
-
+
for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h string.h \
-unistd.h values.h
+unistd.h values.h sys/param.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2546: checking for $ac_hdr" >&5
+echo "configure:2662: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2551 "configure"
+#line 2667 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2556: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2582,12 +2698,12 @@ done
__argz_count __argz_stringify __argz_next
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2586: checking for $ac_func" >&5
+echo "configure:2702: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2591 "configure"
+#line 2707 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2610,7 +2726,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2614: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2730: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2639,12 +2755,12 @@ done
for ac_func in stpcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2643: checking for $ac_func" >&5
+echo "configure:2759: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2648 "configure"
+#line 2764 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2667,7 +2783,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2671: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2701,19 +2817,19 @@ EOF
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:2705: checking for LC_MESSAGES" >&5
+echo "configure:2821: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2710 "configure"
+#line 2826 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:2717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2833: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
am_cv_val_LC_MESSAGES=yes
else
@@ -2734,7 +2850,7 @@ EOF
fi
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:2738: checking whether NLS is requested" >&5
+echo "configure:2854: checking whether NLS is requested" >&5
# Check whether --enable-nls or --disable-nls was given.
if test "${enable_nls+set}" = set; then
enableval="$enable_nls"
@@ -2754,7 +2870,7 @@ fi
EOF
echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6
-echo "configure:2758: checking whether included gettext is requested" >&5
+echo "configure:2874: checking whether included gettext is requested" >&5
# Check whether --with-included-gettext or --without-included-gettext was given.
if test "${with_included_gettext+set}" = set; then
withval="$with_included_gettext"
@@ -2773,17 +2889,17 @@ fi
ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for libintl.h""... $ac_c" 1>&6
-echo "configure:2777: checking for libintl.h" >&5
+echo "configure:2893: checking for libintl.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2782 "configure"
+#line 2898 "configure"
#include "confdefs.h"
#include <libintl.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2787: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2903: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -2800,19 +2916,19 @@ fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libc""... $ac_c" 1>&6
-echo "configure:2804: checking for gettext in libc" >&5
+echo "configure:2920: checking for gettext in libc" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2809 "configure"
+#line 2925 "configure"
#include "confdefs.h"
#include <libintl.h>
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:2816: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
gt_cv_func_gettext_libc=yes
else
@@ -2828,7 +2944,7 @@ echo "$ac_t""$gt_cv_func_gettext_libc" 1>&6
if test "$gt_cv_func_gettext_libc" != "yes"; then
echo $ac_n "checking for bindtextdomain in -lintl""... $ac_c" 1>&6
-echo "configure:2832: checking for bindtextdomain in -lintl" >&5
+echo "configure:2948: checking for bindtextdomain in -lintl" >&5
ac_lib_var=`echo intl'_'bindtextdomain | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -2836,7 +2952,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lintl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2840 "configure"
+#line 2956 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -2847,7 +2963,7 @@ int main() {
bindtextdomain()
; return 0; }
EOF
-if { (eval echo configure:2851: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2967: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -2863,19 +2979,19 @@ fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for gettext in libintl""... $ac_c" 1>&6
-echo "configure:2867: checking for gettext in libintl" >&5
+echo "configure:2983: checking for gettext in libintl" >&5
if eval "test \"`echo '$''{'gt_cv_func_gettext_libintl'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2872 "configure"
+#line 2988 "configure"
#include "confdefs.h"
int main() {
return (int) gettext ("")
; return 0; }
EOF
-if { (eval echo configure:2879: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:2995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
gt_cv_func_gettext_libintl=yes
else
@@ -2903,7 +3019,7 @@ EOF
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2907: checking for $ac_word" >&5
+echo "configure:3023: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2937,12 +3053,12 @@ fi
for ac_func in dcgettext
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2941: checking for $ac_func" >&5
+echo "configure:3057: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2946 "configure"
+#line 3062 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2965,7 +3081,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3085: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -2992,7 +3108,7 @@ done
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2996: checking for $ac_word" >&5
+echo "configure:3112: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3024,7 +3140,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3028: checking for $ac_word" >&5
+echo "configure:3144: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3056,7 +3172,7 @@ else
fi
cat > conftest.$ac_ext <<EOF
-#line 3060 "configure"
+#line 3176 "configure"
#include "confdefs.h"
int main() {
@@ -3064,7 +3180,7 @@ extern int _nl_msg_cat_cntr;
return _nl_msg_cat_cntr
; return 0; }
EOF
-if { (eval echo configure:3068: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
CATOBJEXT=.gmo
DATADIRNAME=share
@@ -3087,7 +3203,7 @@ fi
if test "$CATOBJEXT" = "NONE"; then
echo $ac_n "checking whether catgets can be used""... $ac_c" 1>&6
-echo "configure:3091: checking whether catgets can be used" >&5
+echo "configure:3207: checking whether catgets can be used" >&5
# Check whether --with-catgets or --without-catgets was given.
if test "${with_catgets+set}" = set; then
withval="$with_catgets"
@@ -3100,7 +3216,7 @@ fi
if test "$nls_cv_use_catgets" = "yes"; then
echo $ac_n "checking for main in -li""... $ac_c" 1>&6
-echo "configure:3104: checking for main in -li" >&5
+echo "configure:3220: checking for main in -li" >&5
ac_lib_var=`echo i'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3108,14 +3224,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-li $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3112 "configure"
+#line 3228 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:3119: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3235: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -3143,12 +3259,12 @@ else
fi
echo $ac_n "checking for catgets""... $ac_c" 1>&6
-echo "configure:3147: checking for catgets" >&5
+echo "configure:3263: checking for catgets" >&5
if eval "test \"`echo '$''{'ac_cv_func_catgets'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3152 "configure"
+#line 3268 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char catgets(); below. */
@@ -3171,7 +3287,7 @@ catgets();
; return 0; }
EOF
-if { (eval echo configure:3175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+if { (eval echo configure:3291: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
eval "ac_cv_func_catgets=yes"
else
@@ -3193,7 +3309,7 @@ EOF
# Extract the first word of "gencat", so it can be a program name with args.
set dummy gencat; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3197: checking for $ac_word" >&5
+echo "configure:3313: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GENCAT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3225,7 +3341,7 @@ fi
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3229: checking for $ac_word" >&5
+echo "configure:3345: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3258,7 +3374,7 @@ fi
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3262: checking for $ac_word" >&5
+echo "configure:3378: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3293,7 +3409,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3297: checking for $ac_word" >&5
+echo "configure:3413: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3328,7 +3444,7 @@ fi
CATOBJEXT=.cat
INSTOBJEXT=.cat
DATADIRNAME=lib
- INTLDEPS="../intl/libintl.a"
+ INTLDEPS='$(top_builddir)/intl/libintl.a'
INTLLIBS=$INTLDEPS
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
nls_cv_header_intl=intl/libintl.h
@@ -3351,7 +3467,7 @@ fi
# Extract the first word of "msgfmt", so it can be a program name with args.
set dummy msgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3355: checking for $ac_word" >&5
+echo "configure:3471: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3385,7 +3501,7 @@ fi
# Extract the first word of "gmsgfmt", so it can be a program name with args.
set dummy gmsgfmt; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3389: checking for $ac_word" >&5
+echo "configure:3505: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3417,7 +3533,7 @@ fi
# Extract the first word of "xgettext", so it can be a program name with args.
set dummy xgettext; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3421: checking for $ac_word" >&5
+echo "configure:3537: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3453,7 +3569,7 @@ fi
CATOBJEXT=.gmo
INSTOBJEXT=.mo
DATADIRNAME=share
- INTLDEPS="../intl/libintl.a"
+ INTLDEPS='$(top_builddir)/intl/libintl.a'
INTLLIBS=$INTLDEPS
LIBS=`echo $LIBS | sed -e 's/-lintl//'`
nls_cv_header_intl=intl/libintl.h
@@ -3507,7 +3623,7 @@ fi
LINGUAS=
else
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:3511: checking for catalogs to be installed" >&5
+echo "configure:3627: checking for catalogs to be installed" >&5
NEW_LINGUAS=
for lang in ${LINGUAS=$ALL_LINGUAS}; do
case "$ALL_LINGUAS" in
@@ -3523,21 +3639,29 @@ echo "configure:3511: checking for catalogs to be installed" >&5
fi
fi
+ 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
+
+
test -d intl || mkdir intl
if test "$CATOBJEXT" = ".cat"; then
ac_safe=`echo "linux/version.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for linux/version.h""... $ac_c" 1>&6
-echo "configure:3531: checking for linux/version.h" >&5
+echo "configure:3655: checking for linux/version.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3536 "configure"
+#line 3660 "configure"
#include "confdefs.h"
#include <linux/version.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3541: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3665: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -3576,12 +3700,12 @@ fi
MKINSTALLDIRS=
- if test $ac_aux_dir; then
+ if test -n "$ac_aux_dir"; then
MKINSTALLDIRS="sh $ac_aux_dir/mkinstalldirs"
fi
- if test -z "$MKINSTALLDIRS"; then
- MKINSTALLDIRS="sh \$(top_srcdir)/mkinstalldirs"
- fi
+# if test -z "$MKINSTALLDIRS"; then
+# MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs"
+# fi
l=
@@ -3597,6 +3721,7 @@ 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
@@ -3705,7 +3830,6 @@ ac_given_INSTALL="$INSTALL"
trap 'rm -fr `echo "Makefile \
doc/Makefile \
- emacs/Makefile \
info/Makefile \
intl/Makefile \
lib/Makefile \
@@ -3777,6 +3901,7 @@ s%@INTLLIBS@%$INTLLIBS%g
s%@INTLOBJS@%$INTLOBJS%g
s%@POFILES@%$POFILES%g
s%@POSUB@%$POSUB%g
+s%@INCLUDE_LOCALE_H@%$INCLUDE_LOCALE_H%g
s%@GT_NO@%$GT_NO%g
s%@GT_YES@%$GT_YES%g
s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g
@@ -3824,7 +3949,6 @@ cat >> $CONFIG_STATUS <<EOF
CONFIG_FILES=\${CONFIG_FILES-"Makefile \
doc/Makefile \
- emacs/Makefile \
info/Makefile \
intl/Makefile \
lib/Makefile \
diff --git a/gnu/usr.bin/texinfo/configure.in b/gnu/usr.bin/texinfo/configure.in
index 1a5f1581a0a..ac3c85b74be 100644
--- a/gnu/usr.bin/texinfo/configure.in
+++ b/gnu/usr.bin/texinfo/configure.in
@@ -1,39 +1,80 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(texinfo.texi)
+dnl $Id: configure.in,v 1.2 1999/01/11 16:38:01 espie Exp $
+dnl
+AC_INIT(makeinfo/makeinfo.c)
+AC_PREREQ(2.12)dnl Minimum Autoconf version required.
+AM_CONFIG_HEADER(config.h)
+
+AM_INIT_AUTOMAKE([texinfo], [3.12])
dnl Checks for programs.
+AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_PROG_RANLIB
+# We do this for the sake of a more helpful warning in doc/Makefile.
+TEXMF='$(datadir)/texmf'
+AC_CHECK_PROG(TEXCONFIG, texconfig, true, false)
+$TEXCONFIG && eval `texconfig conf </dev/null | grep '^TEXMF='`
+AC_SUBST(TEXMF)
+
AC_ISC_POSIX
AC_MINIX
dnl Checks for libraries.
-# Needed on sysV68 for sigblock, sigsetmask.
-AC_CHECK_LIB(bsd, sigblock)
+AC_CHECK_LIB(z, gzdopen)
+# Needed on sysV68 for sigblock, sigsetmask. But check for it in libc first.
+AC_CHECK_FUNC(sigblock, , AC_CHECK_LIB(bsd, sigblock))
+
+# Some GNU/Linux systems (e.g., SuSE 4.3, 1996) don't have curses, but
+# rather ncurses. So we check for it.
TERMLIBS=
-for termlib in curses termcap terminfo termlib ; do
+for termlib in ncurses curses termcap terminfo termlib ; do
AC_CHECK_LIB(${termlib}, tputs,
[TERMLIBS="${TERMLIBS} -l${termlib}"; break])
done
AC_SUBST(TERMLIBS)
dnl Checks for header files.
+dnl Do not use <ncurses/termcap.h> unless we're linking with ncurses.
+if test "x$termlib" = xncurses; then
+ dnl Use AC_CHECK_HEADERS so the HAVE_*_H symbol gets defined.
+ AC_CHECK_HEADERS(ncurses/termcap.h)
+fi
AC_HEADER_STDC
-AC_CHECK_HEADERS(unistd.h termio.h string.h varargs.h \
- sys/time.h sys/fcntl.h sys/ttold.h sys/ptem.h sys/file.h)
+AC_CHECK_HEADERS(fcntl.h pwd.h string.h strings.h termcap.h termio.h \
+ termios.h unistd.h \
+ sys/fcntl.h sys/file.h sys/ptem.h sys/time.h sys/ttold.h sys/wait.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_OFF_T
+AC_TYPE_SIGNAL
AC_C_CONST
AC_STRUCT_TM
dnl Checks for library functions.
AC_FUNC_ALLOCA
+AC_FUNC_VPRINTF
AC_FUNC_SETVBUF_REVERSED
-AC_CHECK_FUNCS(setvbuf getcwd memset bzero bcopy memcpy strchr strcasecmp \
- strdup vfprintf vsprintf strerror sigprocmask sigsetmask)
+AC_CHECK_FUNCS(setvbuf getcwd memset bzero strchr strcasecmp \
+ sigprocmask sigsetmask)
+dnl strcasecmp, strerror, xmalloc, xrealloc, probably others should be added.
+AC_REPLACE_FUNCS(memcpy memmove strdup strerror)
+
+dnl Set of available languages and i18n macros.
+ALL_LINGUAS="de fr"
+AM_GNU_GETTEXT
+AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl)
-AC_OUTPUT(Makefile libtxi/Makefile makeinfo/Makefile info/Makefile util/Makefile emacs/Makefile)
+AC_OUTPUT([Makefile \
+ doc/Makefile \
+ info/Makefile \
+ intl/Makefile \
+ lib/Makefile \
+ makeinfo/Makefile \
+ po/Makefile.in \
+ util/Makefile \
+ ],
+ [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in >po/Makefile])
diff --git a/gnu/usr.bin/texinfo/dir-example b/gnu/usr.bin/texinfo/dir-example
index c789d0a56b3..2f11fcc4356 100644
--- a/gnu/usr.bin/texinfo/dir-example
+++ b/gnu/usr.bin/texinfo/dir-example
@@ -1,309 +1,341 @@
This is the directory file `dir' a.k.a. `DIR', which contains the
-topmost node of the Info hierarchy. This file is merely made available
-for your hacking pleasure, not official or standard in any way.
-If it doesn't make sense to you, or you don't like it, ignore it.
+ topmost node of the Info hierarchy.
+This particular dir file is merely made available for your hacking
+ pleasure, not official or standard in any way. If it doesn't make sense
+ to you, or you don't like it, ignore it.
+If you have dir entries for Texinfo manuals you'd like to be added here,
+ please send them to karl@gnu.org.
-$Id: dir-example,v 1.1 1996/12/15 21:37:56 downsj Exp $
+$Id: dir-example,v 1.2 1999/01/11 16:38:01 espie Exp $

-File: dir Node: Top This is the top of the INFO tree.
+File: dir, Node: Top, This is the top of the INFO tree.
-This node gives a menu of the major topics accessible through Info.
+This is the Info main menu (aka directory node).
+A few useful Info commands:
`q' quits;
`?' lists all Info commands;
`h' starts the Info tutorial;
`mTexinfo RET' visits the Texinfo manual, etc.
+Not all of the topics shown below may be available on this system.
+
* Menu:
GNU packages
-* Bash: (bash). Bourne again shell.
-* Cpio: (cpio). Cpio archiver.
-* DC: (dc). Postfix arbitrary expression calculator.
-* Diff: (diff). Comparing and merging programs.
-* Ed: (ed). Line editor.
-* Emacs: (emacs). Extensible self-documenting text editor.
-* File utilities: (fileutils). GNU file utilities.
-* Finding files: (find). Operating on files matching certain criteria.
-* Font utilities: (fontu). Programs for font manipulation.
-* Gawk: (gawk). A text processing and scanning language.
-* Gzip: (gzip). General (de)compression.
-* Identifier DB: (id-utils). Identifier database utilities.
-* Ispell: (ispell). Interactive spelling corrector.
-* M4: (m4). Macro processor.
-* Make: (make). Remake files automatically.
-* Ptx: (ptx). Permuted index generator.
-* Shar: (sharutils). Shell archiver, uudecode/uuencode.
-* Shell utilities: (sh-utils). GNU shell utilities.
-* Tar: (tar). ``Tape'' archiver.
-* Text utilities: (textutils). GNU text utilities.
-* Time: (time). Measuring program resource usage.
-* UUCP: (uucp). Copying between machines, offline.
-* Wdiff: (wdiff). Word-by-word comparison.
+* Bash: (bash). Bourne-Again SHell.
+* Cpio: (cpio). Copy-in-copy-out archiver.
+* DC: (dc). Postfix desk calculator.
+* Diff: (diff). Comparing and merging programs.
+* Ed: (ed). Line editor.
+* Emacs: (emacs). Extensible self-documenting text editor.
+* File utilities: (fileutils). GNU file utilities.
+* Finding files: (find). Operating on files matching certain criteria.
+* Font utilities: (fontu). Programs for font manipulation.
+* Gawk: (gawk.info). A text scanning and processing language.
+* Gcal: (gcal). GNU calendar program.
+* Gzip: (gzip). General (de)compression.
+* Identifier DB: (id-utils). Identifier database utilities.
+* Ispell: (ispell). Interactive spelling corrector.
+* M4: (m4). Macro processor.
+* Make: (make). Remake files automatically.
+* Ptx: (ptx). Permuted index generator.
+* Shar: (sharutils). Shell archiver, uudecode/uuencode.
+* Shell utilities: (sh-utils). GNU shell utilities.
+* tar: (tar). Making tape (or disk) archives.
+* Text utilities: (textutils). GNU text utilities.
+* Time: (time). Measuring program resource usage.
+* UUCP: (uucp). Copying between machines, offline.
+* Wdiff: (wdiff). Word-by-word comparison.
+* Wget: (wget). URL download.
GNU programming tools
-* As: (as). Assembler.
-* Binutils: (binutils). ar/copy/objdump/nm/size/strip/ranlib.
-* Bison: (bison). LALR(1) parser generator.
-* CPP: (cpp). C preprocessor.
-* CVS: (cvs). Concurrent versions system for source control.
-* DejaGnu: (dejagnu). Testing framework.
-* Flex: (flex). A fast scanner generator.
-* Gasp: (gasp). GNU Assembler preprocessor.
-* Libtool: (libtool). Generic library support script.
-* GCC: (gcc). C compiler.
-* GDB: (gdb). Source-level debugger for C and C++.
-* Gperf: (gperf). Perfect hash function generator.
-* Gprof: (gprof). Profiler.
-* Indent: (indent). Prettyprinter for programs.
-* Ld: (ld). Linker.
+* As: (as). Assembler.
+* Binutils: (binutils). ar/copy/objdump/nm/size/strip/ranlib.
+* Bison: (bison). LALR(1) parser generator.
+* CPP: (cpp). C preprocessor.
+* CVS: (cvs). Concurrent versions system for source control.
+* DejaGnu: (dejagnu). Testing framework.
+* Flex: (flex). A fast scanner generator.
+* Gasp: (gasp). GNU Assembler preprocessor.
+* Libtool: (libtool). Generic library support script.
+* GCC: (gcc). C compiler.
+* GDB: (gdb). Source-level debugger for C and C++.
+* Gettext Utilities: (gettext). GNU gettext utilities.
+* Gperf: (gperf). Perfect hash function generator.
+* Gprof: (gprof). Profiler.
+* Indent: (indent). Prettyprinter for programs.
+* Ld: (ld). Linker.
Texinfo documentation system
-* Info: (info). Documentation browsing system.
-* Texinfo: (texinfo). The GNU documentation format.
+* Info: (info). Documentation browsing system.
+* Texinfo: (texinfo). The GNU documentation format.
+* info program: (info-stnd). Standalone Info-reading program.
* install-info: (texinfo)Invoking install-info. Updating info/dir entries.
-* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation.
-* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files.
-* info program: (info-stnd). Standalone Info-reading program.
-* makeinfo: (makeinfo). Convert Texinfo source to Info or plain ASCII.
+* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation.
+* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files.
+* makeinfo: (texinfo)makeinfo preferred. Translate Texinfo source.
GNU Emacs Lisp
-* Elisp: (elisp). GNU Emacs Lisp reference manual.
+* Elisp: (elisp). GNU Emacs Lisp reference manual.
* Intro Elisp: (emacs-lisp-intro). Introduction to Elisp programming.
-* Calc: (calc). Calculator and more.
-* CC-mode: (ccmode). Editing C, C++, and Objective C.
-* Common Lisp: (cl). Partial Common Lisp support for Emacs Lisp.
-* Dired-x: (dired-x). Extra directory editor features.
-* Edebug: (edebug). Source-level debugger for Emacs Lisp.
-* Ediff: (ediff). Comprehensive visual interface to diff & patch.
-* EDB: (edb). Database for Emacs.
-* Forms: (forms). Fill-in-the-form data entry.
-* Gmhist: (gmhist). Generic minibuffer history.
-* GNUS: (gnus). Netnews reading and posting.
-* Mailcrypt: (mailcrypt). Use PGP in Emacs.
-* MH-E: (mh-e). Emacs interface to the MH mail system.
-* PCL-CVS: (pcl-cvs). Emacs front end to CVS.
-* Supercite: (sc). Supercite for including other people's words.
-* VIP: (vip). vi emulation.
-* VIPER: (viper). The new VI-emulation mode in Emacs-19.29.
-* VM: (vm). Mail reader.
-* W3: (w3). WWW browser.
+* AUC TeX: (auctex). Editing (La)TeX files.
+* Calc: (calc). Calculator and more.
+* CC mode: (cc-mode). Editing C, C++, Objective C, and Java.
+* Common Lisp: (cl). Partial Common Lisp support for Emacs Lisp.
+* Dired-x: (dired-x). Extra directory editor features.
+* Edebug: (edebug). Source-level debugger for Emacs Lisp.
+* Ediff: (ediff). Comprehensive visual interface to diff & patch.
+* EDB: (edb). Database for Emacs.
+* Forms: (forms). Fill-in-the-form data entry.
+* Gmhist: (gmhist). Generic minibuffer history.
+* GNUS: (gnus). Netnews reading and posting.
+* Mailcrypt: (mailcrypt). Use PGP in Emacs.
+* MH-E: (mh-e). Emacs interface to the MH mail system.
+* PCL-CVS: (pcl-cvs). Emacs front end to CVS.
+* Supercite: (sc). Supercite for including other people's words.
+* VIP: (vip). vi emulation.
+* VIPER: (viper). The new VI-emulation mode in Emacs-19.29.
+* VM: (vm). Mail reader.
+* W3: (w3). WWW browser.
-GNU admin
-* Autoconf: (autoconf). Automatic generation of package configuration.
-* Automake: (automake). Making Makefile.in's.
-* Configure: (configure). Cygnus configure.
-* Gettext: (gettext). Internationalization.
-* Gnats: (gnats). Cygnus bug tracking system.
-* Maintaining: (maintain). Maintaining GNU software.
-* Remsync: (remsync). Remote synchronization of directory trees.
-* Send PR: (send-pr). Cygnus bug reporting for Gnats.
-* Source config: (cfg-paper). Some theory on configuring source packages.
-* Standards: (standards). GNU coding standards.
+GNU programming support
+* Autoconf: (autoconf). Automatic generation of package configuration.
+* Configure: (configure). Cygnus configure.
+* Gnats: (gnats). Cygnus bug tracking system.
+* Remsync: (remsync). Remote synchronization of directory trees.
+* Send PR: (send-pr). Cygnus bug reporting for Gnats.
GNU libraries
-* Annotate: (annotate). High-level GDB to GUI's.
-* BFD: (bfd). Binary file descriptors for object file IO.
-* GDB library: (libgdb). Application programming interface to GDB.
-* GDBM: (gdbm). Hashed databases.
-* History: (history). Recall previous lines of input.
-* Iostream: (iostream). C++ input/output.
-* Libc: (libc). C library.
-* Libg++: (libg++). C++ classes.
-* Mmalloc: (mmalloc). Memory-mapped malloc.
-* Readline: (readline). General command-line interface.
-* Regex: (regex). Regular expressions.
-* Termcap: (termcap). All about /etc/termcap.
+* Annotate: (annotate). High-level GDB to GUI's.
+* BFD: (bfd). Binary file descriptors for object file IO.
+* GDB library: (libgdb). Application programming interface to GDB.
+* GDBM: (gdbm). Hashed databases.
+* History: (history). Recall previous lines of input.
+* Iostream: (iostream). C++ input/output.
+* Libc: (libc). C library.
+* Libg++: (libg++). C++ classes.
+* Mmalloc: (mmalloc). Memory-mapped malloc.
+* Readline: (readline). General command-line interface.
+* Regex: (regex). Regular expressions.
+* Termcap: (termcap). All about /etc/termcap.
GNU programming documentation
-* GDB internals: (gdbint). Debugger internals.
-* Ld internals: (ldint). GNU linker internals.
-* Stabs: (stabs). Symbol table debugging information format.
+* GDB internals: (gdbint). Debugger internals.
+* Ld internals: (ldint). GNU linker internals.
+* Maintaining: (maintain). Maintaining GNU software.
+* Source config: (cfg-paper). Some theory on configuring source packages.
+* Stabs: (stabs). Symbol table debugging information format.
+* Standards: (standards). GNU coding standards.
-DOS
-* Demacs: (demacs). GNU Emacs for DOS.
-* GNUish: (gnuish). GNU utilities for DOS.
+Linux
+* dosemu: (dosemu). Linux DOS emulator.
+* gpm: (gpm). Linux general purpose mouse interface.
+* linux-faq: (linux-faq). The Linux FAQ List
TeX things
* Afm2tfm: (dvips)Invoking afm2tfm. Making Type 1 fonts available to TeX.
-* Dvips: (dvips). DVI-to-PostScript translator.
-* Eplain: (eplain). Expanding on plain TeX.
-* Kpathsearch: (kpathsea). File lookup along search paths.
-* LaTeX: (latex). LaTeX.
-* MakeIndex: (makeindex). Index creation for TeX.
-* Naming fonts: (fontname). Filenames for TeX fonts.
-* TeXDraw: (texdraw). Drawing PostScript diagrams within TeX.
-* Web2c: (web2c). TeX, Metafont, and their companion programs.
+* Dvips: (dvips). DVI-to-PostScript translator.
+* Eplain: (eplain). Expanding on plain TeX.
+* Kpathsearch: (kpathsea). File lookup along search paths.
+* LaTeX: (latex). LaTeX.
+* MakeIndex: (makeindex). Index creation for TeX.
+* Naming fonts: (fontname). Filenames for TeX fonts.
+* TDS: (tds). Standard TeX directory structure.
+* TeXDraw: (texdraw). Drawing PostScript diagrams within TeX.
+* Web2c: (web2c). TeX, Metafont, and their companion programs.
+
+DOS
+* Demacs: (demacs). GNU Emacs for DOS.
+* GNUish: (gnuish). GNU utilities for DOS.
Other things
-* Amd: (amdref). Filesystem automounter.
-* CMUCL: (cmu-user). CMU Common Lisp.
-* File headers: (filehdr). Bibliographic information for computer files.
-* HTML: (snafu). Hypertext Markup Language 2.0 specification.
-* Jargon: (jargon). The jargon file.
-* Perl: (perl). Practical extraction and report language.
+* Amd: (amdref). Filesystem automounter.
+* CMUCL: (cmu-user). CMU Common Lisp.
+* File headers: (filehdr). Bibliographic information for computer files.
+* GCP: (gcp). Game club protocol.
+* GIMP: (pdb). The GIMP procedural database.
+* HTML: (snafu). Hypertext Markup Language 2.0 specification.
+* Jargon: (jargon). The jargon file.
+* JED: (jed). JED editor documentation.
+* octave: (octave). Octave - A language for numerical computation.
+* Perl: (perl). Practical extraction and report language.
* PRCS: (prcs). Project revision control system.
-* Screen: (screen). Virtual screen manager.
-* UMB C.S. Dept.: (csinfo). UMass/Boston Computer Science Dept. info.
+* Screen: (screen). Virtual screen manager.
+* UMB C.S. Dept.: (csinfo). UMass/Boston Computer Science Dept. info.
Individual utilities
-* aid: (id-utils)aid invocation. Matching strings.
-* ar: (binutils)ar. Create/modify/extract archives.
-* at-pr: (gnats)at-pr. Bug report timely reminders.
-* autoreconf: (autoconf)Invoking autoreconf. Remake multiple configure's.
-* autoscan: (autoconf)Invoking autoscan. Automate initial configure.in.
-* awk: (Gawk)Invoking gawk. Text processing and scanning.
-* basename: (sh-utils)basename invocation. Strip directory and suffix.
-* bibtex: (web2c)BibTeX invocation. Maintaining bibliographies.
-* c++filt: (binutils)c++filt. Demangle C++ symbols.
-* cat: (textutils)cat invocation. Concatenate and write files.
-* chgrp: (fileutils)chgrp invocation. Change file groups.
-* chmod: (fileutils)chmod invocation. Change file permissions.
-* chown: (fileutils)chown invocation. Change file owners/groups.
-* chroot: (sh-utils)chroot invocation. Specify the root directory.
-* cksum: (textutils)cksum invocation. Print POSIX CRC checksum.
-* cmp: (diff)Invoking cmp. Character-by-character diff.
-* comm: (textutils)comm invocation. Compare sorted files by line.
-* cp: (fileutils)cp invocation. Copy files.
-* csplit: (textutils)csplit invocation. Split by context.
-* cut: (textutils)cut invocation. Print selected parts of lines.
-* date: (sh-utils)date invocation. Print/set system date and time.
-* dd: (fileutils)dd invocation. Copy and convert a file.
-* df: (fileutils)df invocation. Report filesystems' disk usage.
-* diff3: (diff)Invoking diff3. Three-way diff.
-* dir: (fileutils)dir invocation. List directories briefly.
-* dirname: (sh-utils)dirname invocation. Strip non-directory suffix.
-* dmp: (web2c)Dmp invocation. Troff->MPX (MetaPost pictures).
-* du: (fileutils)du invocation. Report on disk usage.
-* dvicopy: (web2c)DVIcopy invocation. Virtual font expansion
-* dvitomp: (web2c)DVItoMP invocation. DVI to MPX (MetaPost pictures).
-* dvitype: (web2c)DVItype invocation. DVI to human-readable text.
-* echo: (sh-utils)echo invocation. Print a line of text.
-* edit-pr: (gnats)Invoking edit-pr. Changing bugs.
-* eid: (id-utils)eid invocation. Invoking an editor on matches.
+* aclocal: (automake)Invoking aclocal. Generating aclocal.m4.
+* aid: (id-utils)aid invocation. Matching strings.
+* ar: (binutils)ar. Create/modify/extract archives.
+* at-pr: (gnats)at-pr. Bug report timely reminders.
+* automake: (automake). Making Makefile.in's.
+* autoreconf: (autoconf)Invoking autoreconf. Remake multiple configure's.
+* autoscan: (autoconf)Invoking autoscan. Automate initial configure.in.
+* awk: (gawk)Invoking gawk. Text processing and scanning.
+* basename: (sh-utils)basename invocation. Strip directory and suffix.
+* bibtex: (web2c)BibTeX invocation. Maintaining bibliographies.
+* c++filt: (binutils)c++filt. Demangle C++ symbols.
+* cat: (textutils)cat invocation. Concatenate and write files.
+* chgrp: (fileutils)chgrp invocation. Change file groups.
+* chmod: (fileutils)chmod invocation. Change file permissions.
+* chown: (fileutils)chown invocation. Change file owners/groups.
+* chroot: (sh-utils)chroot invocation. Specify the root directory.
+* cksum: (textutils)cksum invocation. Print POSIX CRC checksum.
+* cmp: (diff)Invoking cmp. Character-by-character diff.
+* comm: (textutils)comm invocation. Compare sorted files by line.
+* cp: (fileutils)cp invocation. Copy files.
+* csplit: (textutils)csplit invocation. Split by context.
+* cut: (textutils)cut invocation. Print selected parts of lines.
+* date: (sh-utils)date invocation. Print/set system date and time.
+* dd: (fileutils)dd invocation. Copy and convert a file.
+* df: (fileutils)df invocation. Report filesystem disk usage.
+* diff3: (diff)Invoking diff3. Three-way diff.
+* dir: (fileutils)dir invocation. List directories briefly.
+* dircolors: (fileutils)dircolors invocation. Color setup for ls.
+* dirname: (sh-utils)dirname invocation. Strip non-directory suffix.
+* dmp: (web2c)Dmp invocation. Troff->MPX (MetaPost pictures).
+* du: (fileutils)du invocation. Report on disk usage.
+* dvicopy: (web2c)DVIcopy invocation. Virtual font expansion
+* dvitomp: (web2c)DVItoMP invocation. DVI to MPX (MetaPost pictures).
+* dvitype: (web2c)DVItype invocation. DVI to human-readable text.
+* echo: (sh-utils)echo invocation. Print a line of text.
+* edit-pr: (gnats)Invoking edit-pr. Changing bugs.
+* eid: (id-utils)eid invocation. Invoking an editor on matches.
* emacsclient: (emacs)Emacs Server. Connecting to a running Emacs.
* emacsserver: (emacs)Emacs Server. Connecting to a running Emacs.
-* env: (sh-utils)env invocation. Modify the environment.
+* env: (sh-utils)env invocation. Modify the environment.
* etags: (emacs)Create Tags Table. Creating a TAGS table.
-* expand: (textutils)expand invocation. Convert tabs to spaces.
-* expr: (sh-utils)expr invocation. Evaluate expressions.
-* false: (sh-utils)false invocation. Do nothing, unsuccessfully.
-* fid: (id-utils)fid invocation. Listing a file's identifiers.
-* file-pr: (gnats)file-pr. Processing incoming traffic.
-* find: (find)Invoking find. Finding and acting on files.
-* fmt: (textutils)fmt invocation. Reformat paragraph text.
-* fold: (textutils)fold invocation. Wrap long input lines.
-* g++: (gcc)Invoking G++. The GNU C++ compiler.
-* gftodvi: (web2c)GFtoDVI invocation. Generic font proofsheets.
-* gftopk: (web2c)GFtoPK invocation. Generic to packed fonts.
-* gftype: (web2c)GFtype invocation. GF to human-readable text.
-* gid: (id-utils)gid invocation. Listing all matching lines.
-* groups: (sh-utils)groups invocation. Print group names a user is in.
-* gunzip: (gzip)Overview. Decompression.
-* head: (textutils)head invocation. Output the first part of files.
-* hostname: (sh-utils)hostname invocation. Print or set system name.
-* id: (sh-utils)id invocation. Print real/effective uid/gid.
-* idx: (id-utils)idx invocation. Testing mkid scanners.
-* ifnames: (autoconf)Invoking ifnames. List conditionals in source.
-* iid: (id-utils)iid invocation. Interactive complex queries.
-* inimf: (web2c)inimf invocation. Initial Metafont.
-* inimp: (web2c)inimp invocation. Initial MetaPost.
-* initex: (web2c)initex invocation. Initial TeX.
-* install: (fileutils)install invocation. Copy and change attributes.
-* join: (textutils)join invocation. Join lines on a common field.
-* kpsewhich: (kpathsea)Invoking kpsewhich. TeX file searching.
-* lid: (id-utils)lid invocation. Matching identifier patterns.
-* ln: (fileutils)ln invocation. Make links between files.
-* locate: (find)Invoking locate. Finding files in a database.
-* logname: (sh-utils)logname invocation. Print current login name.
-* ls: (fileutils)ls invocation. List directory contents.
-* makempx: (web2c)MakeMPX invocation. MetaPost label typesetting.
-* maketexmf: (kpathsea)MakeTeX scripts. MF source generation.
-* maketexpk: (kpathsea)MakeTeX scripts. PK bitmap generation.
-* maketextex: (kpathsea)MakeTeX scripts. TeX source generation.
-* maketextfm: (kpathsea)MakeTeX scripts. TeX font metric generation.
-* mf: (web2c)mf invocation. Creating typeface families.
-* mft: (web2c)MFT invocation. Prettyprinting Metafont source.
-* mkdir: (fileutils)mkdir invocation. Create directories.
-* mkfifo: (fileutils)mkfifo invocation. Create FIFOs: (named pipes).
-* mkid: (id-utils)mkid invocation. Creating an ID database.
-* mknod: (fileutils)mknod invocation. Create special files.
-* mp: (web2c)mp invocation. Creating technical diagrams.
-* mpto: (web2c)MPto invocation. MetaPost label extraction.
-* mv: (fileutils)mv invocation. Rename files.
-* newer: (web2c)Newer invocation. Compare modification times.
-* nice: (sh-utils)nice invocation. Modify scheduling priority.
-* nl: (textutils)nl invocation. Number lines and write files.
-* nlmconv: (binutils)nlmconv. Convert object to NetWare LM.
-* nm: (binutils)nm. List symbols in object files.
-* nohup: (sh-utils)nohup invocation. Immunize to hangups.
-* objcopy: (binutils)objcopy. Copy/translate object files.
-* objdump: (binutils)objdump. Display info from object files.
-* od: (textutils)od invocation. Dump files in octal, etc.
-* paste: (textutils)paste invocation. Merge lines of files.
-* patch: (diff)Invoking patch. Automatically applying diffs.
-* patgen: (web2c)Patgen invocation. Creating hyphenation patterns.
-* pathchk: (sh-utils)pathchk invocation. Check file name portability.
-* pid: (id-utils)pid invocation. Looking up filenames.
-* pktogf: (web2c)PKtoGF invocation. Packed to generic fonts.
-* pktype: (web2c)PKtype invocation. PK to human-readable text.
-* pltotf: (web2c)PLtoTF invocation. Property list to TFM.
-* pooltype: (web2c)Pooltype invocation. Display WEB pool files.
-* pr-addr: (gnats)pr-addr. Bug report address retrieval.
-* pr-edit: (gnats)pr-edit. The edit-pr driver.
-* pr: (textutils)pr invocation. Paginate or columnate files.
-* printenv: (sh-utils)printenv invocation. Print environment variables.
-* printf: (sh-utils)printf invocation. Format and print data.
-* pwd: (sh-utils)pwd invocation. Print working directory.
-* query-pr: (gnats)Invoking query-pr. Bug searching/reporting.
-* queue-pr: (gnats)queue-pr. Handling incoming traffic.
-* ranlib: (binutils)ranlib. Index archive file contents.
-* rm: (fileutils)rm invocation. Remove files.
-* rmdir: (fileutils)rmdir invocation. Remove empty directories.
-* sdiff: (diff)Invoking sdiff. Interactively merge files.
-* send-pr: (gnats)Invoking send-pr. Submitting bugs.
-* shar: (sharutils)shar invocation. Create shell archive.
-* size: (binutils)size. List object file section sizes.
-* sleep: (sh-utils)sleep invocation. Delay for a specified time.
-* sort: (textutils)sort invocation. Sort text files.
-* split: (textutils)split invocation. Split into fixed-size pieces.
-* strings: (binutils)strings. List printable strings.
-* strip: (binutils)strip. Discard symbols.
-* stty: (sh-utils)stty invocation. Print/change terminal settings.
-* su: (sh-utils)su invocation. Modify user and group id.
-* sum: (textutils)sum invocation. Print traditional checksum.
-* sync: (fileutils)sync invocation. Synchronize memory and disk.
-* tabs: (tput)Invoking tabs. Tab settings.
-* tac: (textutils)tac invocation. Reverse files.
-* tail: (textutils)tail invocation. Output the last part of files.
-* tangle: (web2c)Tangle invocation. WEB to Pascal.
-* tee: (sh-utils)tee invocation. Redirect to multiple files.
-* test: (sh-utils)test invocation. File/string tests.
-* tex: (web2c)tex invocation. Typesetting.
-* tftopl: (web2c)TFtoPL invocation. TFM -> property list.
-* touch: (fileutils)touch invocation. Change file timestamps.
-* tput: (tput)Invoking tput. Termcap in shell scripts.
-* tr: (textutils)tr invocation. Translate characters.
-* true: (sh-utils)true invocation. Do nothing, successfully.
-* tty: (sh-utils)tty invocation. Print terminal name.
-* uname: (sh-utils)uname invocation. Print system information.
-* unexpand: (textutils)unexpand invocation. Convert spaces to tabs.
-* uniq: (textutils)uniq invocation. Uniqify files.
-* unshar: (sharutils)unshar invocation. Extract from shell archive.
-* updatedb: (find)Invoking updatedb. Building the locate database.
-* users: (sh-utils)users invocation. Print current user names.
-* vdir: (fileutils)vdir invocation. List directories verbosely.
-* vftovp: (web2c)VFtoVP invocation. Virtual font -> virtual pl.
-* view-pr: (gnats)Invoking view-pr. Showing bug reports.
-* virmf: (web2c)virmf invocation. Virgin Metafont.
-* virmp: (web2c)virmp invocation. Virgin MetaPost.
-* virtex: (web2c)virtex invocation. Virgin TeX.
-* vptovf: (web2c)VPtoVF invocation. Virtual pl -> virtual font.
-* wc: (textutils)wc invocation. Byte, word, and line counts.
-* weave: (web2c)Weave invocation. WEB to TeX.
-* who: (sh-utils)who invocation. Print who is logged in.
-* whoami: (sh-utils)whoami invocation. Print effective user id.
-* xargs: (find)Invoking xargs. Operating on many files.
-* yes: (sh-utils)yes invocation. Print a string indefinitely.
-* zcat: (gzip)Overview. Decompression to stdout.
+* expand: (textutils)expand invocation. Convert tabs to spaces.
+* expr: (sh-utils)expr invocation. Evaluate expressions.
+* factor: (sh-utils)factor invocation. Print prime factors
+* false: (sh-utils)false invocation. Do nothing, unsuccessfully.
+* fid: (id-utils)fid invocation. Listing a file's identifiers.
+* file-pr: (gnats)file-pr. Processing incoming traffic.
+* find: (find)Invoking find. Finding and acting on files.
+* fmt: (textutils)fmt invocation. Reformat paragraph text.
+* fold: (textutils)fold invocation. Wrap long input lines.
+* g++: (gcc)Invoking G++. The GNU C++ compiler.
+* gcal2txt: (gcal)Invoking gcal2txt. Calendar resource to text file.
+* gettextize: (gettext)gettextize Invocation. Prepare a package for gettext.
+* gftodvi: (web2c)GFtoDVI invocation. Generic font proofsheets.
+* gftopk: (web2c)GFtoPK invocation. Generic to packed fonts.
+* gftype: (web2c)GFtype invocation. GF to human-readable text.
+* gid: (id-utils)gid invocation. Listing all matching lines.
+* git: (git). GNU interactive tools.
+* groups: (sh-utils)groups invocation. Print group names a user is in.
+* gunzip: (gzip)Overview. Decompression.
+* head: (textutils)head invocation. Output the first part of files.
+* hostname: (sh-utils)hostname invocation. Print or set system name.
+* id: (sh-utils)id invocation. Print real/effective uid/gid.
+* idx: (id-utils)idx invocation. Testing mkid scanners.
+* ifnames: (autoconf)Invoking ifnames. List conditionals in source.
+* iid: (id-utils)iid invocation. Interactive complex queries.
+* inimf: (web2c)inimf invocation. Initial Metafont.
+* inimp: (web2c)inimp invocation. Initial MetaPost.
+* initex: (web2c)initex invocation. Initial TeX.
+* install: (fileutils)install invocation. Copy and change attributes.
+* join: (textutils)join invocation. Join lines on a common field.
+* kpsewhich: (kpathsea)Invoking kpsewhich. TeX file searching.
+* lid: (id-utils)lid invocation. Matching identifier patterns.
+* ln: (fileutils)ln invocation. Make links between files.
+* locate: (find)Invoking locate. Finding files in a database.
+* logname: (sh-utils)logname invocation. Print current login name.
+* ls: (fileutils)ls invocation. List directory contents.
+* makempx: (web2c)MakeMPX invocation. MetaPost label typesetting.
+* maketexmf: (kpathsea)MakeTeX scripts. MF source generation.
+* maketexpk: (kpathsea)MakeTeX scripts. PK bitmap generation.
+* maketextex: (kpathsea)MakeTeX scripts. TeX source generation.
+* maketextfm: (kpathsea)MakeTeX scripts. TeX font metric generation.
+* md5sum: (textutils)md5sum invocation. Print or check message-digests.
+* mf: (web2c)mf invocation. Creating typeface families.
+* mft: (web2c)MFT invocation. Prettyprinting Metafont source.
+* mkdir: (fileutils)mkdir invocation. Create directories.
+* mkfifo: (fileutils)mkfifo invocation. Create FIFOs: (named pipes).
+* mkid: (id-utils)mkid invocation. Creating an ID database.
+* mknod: (fileutils)mknod invocation. Create special files.
+* mp: (web2c)mp invocation. Creating technical diagrams.
+* mpto: (web2c)MPto invocation. MetaPost label extraction.
+* msgfmt: (gettext)msgfmt Invocation. Make MO files out of PO files.
+* msgmerge: (gettext)msgmerge Invocation. Update two PO files into one.
+* mv: (fileutils)mv invocation. Rename files.
+* newer: (web2c)Newer invocation. Compare modification times.
+* nice: (sh-utils)nice invocation. Modify scheduling priority.
+* nl: (textutils)nl invocation. Number lines and write files.
+* nlmconv: (binutils)nlmconv. Convert object to NetWare LM.
+* nm: (binutils)nm. List symbols in object files.
+* nohup: (sh-utils)nohup invocation. Immunize to hangups.
+* objcopy: (binutils)objcopy. Copy/translate object files.
+* objdump: (binutils)objdump. Display info from object files.
+* od: (textutils)od invocation. Dump files in octal, etc.
+* paste: (textutils)paste invocation. Merge lines of files.
+* patch: (diff)Invoking patch. Automatically applying diffs.
+* patgen: (web2c)Patgen invocation. Creating hyphenation patterns.
+* pathchk: (sh-utils)pathchk invocation. Check file name portability.
+* pid: (id-utils)pid invocation. Looking up filenames.
+* pktogf: (web2c)PKtoGF invocation. Packed to generic fonts.
+* pktype: (web2c)PKtype invocation. PK to human-readable text.
+* pltotf: (web2c)PLtoTF invocation. Property list to TFM.
+* pooltype: (web2c)Pooltype invocation. Display WEB pool files.
+* pr-addr: (gnats)pr-addr. Bug report address retrieval.
+* pr-edit: (gnats)pr-edit. The edit-pr driver.
+* pr: (textutils)pr invocation. Paginate or columnate files.
+* printenv: (sh-utils)printenv invocation. Print environment variables.
+* printf: (sh-utils)printf invocation. Format and print data.
+* pwd: (sh-utils)pwd invocation. Print working directory.
+* query-pr: (gnats)Invoking query-pr. Bug searching/reporting.
+* queue-pr: (gnats)queue-pr. Handling incoming traffic.
+* ranlib: (binutils)ranlib. Index archive file contents.
+* rm: (fileutils)rm invocation. Remove files.
+* rmdir: (fileutils)rmdir invocation. Remove empty directories.
+* sdiff: (diff)Invoking sdiff. Interactively merge files.
+* send-pr: (gnats)Invoking send-pr. Submitting bugs.
+* seq: (sh-utils)seq invocation. Print numeric sequences
+* shar: (sharutils)shar invocation. Create shell archive.
+* size: (binutils)size. List object file section sizes.
+* sleep: (sh-utils)sleep invocation. Delay for a specified time.
+* sort: (textutils)sort invocation. Sort text files.
+* split: (textutils)split invocation. Split into fixed-size pieces.
+* strings: (binutils)strings. List printable strings.
+* strip: (binutils)strip. Discard symbols.
+* stty: (sh-utils)stty invocation. Print/change terminal settings.
+* su: (sh-utils)su invocation. Modify user and group id.
+* sum: (textutils)sum invocation. Print traditional checksum.
+* sync: (fileutils)sync invocation. Synchronize memory and disk.
+* tabs: (tput)Invoking tabs. Tab settings.
+* tac: (textutils)tac invocation. Reverse files.
+* tail: (textutils)tail invocation. Output the last part of files.
+* tangle: (web2c)Tangle invocation. WEB to Pascal.
+* tcal: (gcal)Invoking tcal. Run Gcal with tomorrow's date.
+* tee: (sh-utils)tee invocation. Redirect to multiple files.
+* test: (sh-utils)test invocation. File/string tests.
+* tex: (web2c)tex invocation. Typesetting.
+* tftopl: (web2c)TFtoPL invocation. TFM -> property list.
+* touch: (fileutils)touch invocation. Change file timestamps.
+* tput: (tput)Invoking tput. Termcap in shell scripts.
+* tr: (textutils)tr invocation. Translate characters.
+* true: (sh-utils)true invocation. Do nothing, successfully.
+* tty: (sh-utils)tty invocation. Print terminal name.
+* txt2gcal: (gcal)Invoking txt2gcal. Calendar text to resource file.
+* uname: (sh-utils)uname invocation. Print system information.
+* unexpand: (textutils)unexpand invocation. Convert spaces to tabs.
+* uniq: (textutils)uniq invocation. Uniqify files.
+* unshar: (sharutils)unshar invocation. Extract from shell archive.
+* updatedb: (find)Invoking updatedb. Building the locate database.
+* users: (sh-utils)users invocation. Print current user names.
+* vdir: (fileutils)vdir invocation. List directories verbosely.
+* vftovp: (web2c)VFtoVP invocation. Virtual font -> virtual pl.
+* view-pr: (gnats)Invoking view-pr. Showing bug reports.
+* virmf: (web2c)virmf invocation. Virgin Metafont.
+* virmp: (web2c)virmp invocation. Virgin MetaPost.
+* virtex: (web2c)virtex invocation. Virgin TeX.
+* vptovf: (web2c)VPtoVF invocation. Virtual pl -> virtual font.
+* wc: (textutils)wc invocation. Byte, word, and line counts.
+* weave: (web2c)Weave invocation. WEB to TeX.
+* who: (sh-utils)who invocation. Print who is logged in.
+* whoami: (sh-utils)whoami invocation. Print effective user id.
+* xargs: (find)Invoking xargs. Operating on many files.
+* xgettext: (gettext)xgettext Invocation. Extract strings into a PO file.
+* yes: (sh-utils)yes invocation. Print a string indefinitely.
+* zcat: (gzip)Overview. Decompression to stdout.
diff --git a/gnu/usr.bin/texinfo/doc/Makefile.am b/gnu/usr.bin/texinfo/doc/Makefile.am
index 68efe846abb..f7c8e616237 100644
--- a/gnu/usr.bin/texinfo/doc/Makefile.am
+++ b/gnu/usr.bin/texinfo/doc/Makefile.am
@@ -1,11 +1,12 @@
## Makefile.am for texinfo/emacs.
-## $Id: Makefile.am,v 1.1 1997/08/01 22:01:12 kstailey Exp $
+## $Id: Makefile.am,v 1.2 1999/01/11 16:38:02 espie Exp $
## Run automake in .. to produce Makefile.in from this.
-info_TEXINFOS = info-stnd.texi info.texi texinfo.texi
+info_TEXINFOS = info-stnd.texi info.texi texinfo.txi
-# Use the makeinfo built in our distribution.
+# Use the programs built in our distribution.
MAKEINFO = ../makeinfo/makeinfo
+INSTALL_INFO = ../util/install-info
# Include our texinfo.tex, not Automake's.
EXTRA_DIST = macro.texi userdoc.texi epsf.tex texinfo.tex
@@ -26,10 +27,10 @@ dist-info:
# since we don't distribute them.
.texi.info:
$(MAKEINFO) -I$(srcdir) `echo $< | sed 's,.*/,,'`
-texinfo: $(srcdir)/texinfo.texi
- $(MAKEINFO) -I$(srcdir) texinfo.texi
+texinfo: $(srcdir)/texinfo.txi
+ $(MAKEINFO) -I$(srcdir) texinfo.txi
-# Do not try to install them from $(srcdir).
+# Similarly, Do not try to install the info files from $(srcdir).
install-info-am: $(INFO_DEPS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(infodir)
@@ -43,14 +44,14 @@ install-info-am: $(INFO_DEPS)
done; \
done
@$(POST_INSTALL)
- @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
+ @if $(SHELL) -c '$(INSTALL_INFO) --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
for file in $(INFO_DEPS); do \
- echo " install-info --info-dir=$(infodir) $(infodir)/$$file";\
- install-info --info-dir=$(infodir) $(infodir)/$$file || :;\
+ echo " $(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/$$file";\
+ $(INSTALL_INFO) --info-dir=$(infodir) $(infodir)/$$file || :;\
done; \
else : ; fi
-# Remove them at make distclean.
+# Remove the info files at make distclean.
distclean-aminfo:
rm -f texinfo texinfo-* info*.info*
diff --git a/gnu/usr.bin/texinfo/doc/info-stnd.texi b/gnu/usr.bin/texinfo/doc/info-stnd.texi
index b2d10dc3b5b..c4238b8a3de 100644
--- a/gnu/usr.bin/texinfo/doc/info-stnd.texi
+++ b/gnu/usr.bin/texinfo/doc/info-stnd.texi
@@ -9,7 +9,7 @@
@synindex fn cp
@synindex ky cp
@comment %**end of header
-@comment $Id: info-stnd.texi,v 1.1 1997/08/01 22:01:10 kstailey Exp $
+@comment $Id: info-stnd.texi,v 1.2 1999/01/11 16:38:02 espie Exp $
@dircategory Texinfo documentation system
@direntry
diff --git a/gnu/usr.bin/texinfo/doc/info.texi b/gnu/usr.bin/texinfo/doc/info.texi
index 8282ff8cd31..8d188cbed0d 100644
--- a/gnu/usr.bin/texinfo/doc/info.texi
+++ b/gnu/usr.bin/texinfo/doc/info.texi
@@ -3,7 +3,7 @@
@setfilename info.info
@settitle Info 1.0
@comment %**end of header
-@comment $Id: info.texi,v 1.1 1997/08/01 22:01:10 kstailey Exp $
+@comment $Id: info.texi,v 1.2 1999/01/11 16:38:02 espie Exp $
@dircategory Texinfo documentation system
@direntry
diff --git a/gnu/usr.bin/texinfo/doc/texinfo.tex b/gnu/usr.bin/texinfo/doc/texinfo.tex
index ec9b7029432..7385f1ffae3 100644
--- a/gnu/usr.bin/texinfo/doc/texinfo.tex
+++ b/gnu/usr.bin/texinfo/doc/texinfo.tex
@@ -1,32 +1,40 @@
-%% TeX macros to handle Texinfo files.
-%% $Id: texinfo.tex,v 1.1 1997/08/01 22:01:12 kstailey Exp $
-
-% Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
-% 94, 95, 96, 97 Free Software Foundation, Inc.
-
-%This texinfo.tex file is free software; you can redistribute it and/or
-%modify it under the terms of the GNU General Public License as
-%published by the Free Software Foundation; either version 2, or (at
-%your option) any later version.
-
-%This texinfo.tex file is distributed in the hope that it will be
-%useful, but WITHOUT ANY WARRANTY; without even the implied warranty
-%of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-%General Public License for more details.
-
-%You should have received a copy of the GNU General Public License
-%along with this texinfo.tex file; see the file COPYING. If not, write
-%to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-%Boston, MA 02111-1307, USA.
-
-
-%In other words, you are welcome to use, share and improve this program.
-%You are forbidden to forbid anyone else to use, share and improve
-%what you give them. Help stamp out software-hoarding!
-
-
-% Send bug reports to bug-texinfo@prep.ai.mit.edu.
-% Please include a *precise* test case in each bug report.
+% texinfo.tex -- TeX macros to handle Texinfo files.
+% $Id: texinfo.tex,v 1.2 1999/01/11 16:38:03 espie Exp $
+%
+% Copyright (C) 1985, 86, 88, 90, 91, 92, 93, 94, 95, 96, 97, 98
+% Free Software Foundation, Inc.
+%
+% This texinfo.tex file is free software; you can redistribute it and/or
+% modify it under the terms of the GNU General Public License as
+% published by the Free Software Foundation; either version 2, or (at
+% your option) any later version.
+%
+% This texinfo.tex file is distributed in the hope that it will be
+% useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+% General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this texinfo.tex file; see the file COPYING. If not, write
+% to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+% Boston, MA 02111-1307, USA.
+%
+% In other words, you are welcome to use, share and improve this program.
+% You are forbidden to forbid anyone else to use, share and improve
+% what you give them. Help stamp out software-hoarding!
+%
+% Please try the latest version of texinfo.tex before submitting bug
+% reports; you can get the latest version from:
+% ftp://ftp.cs.umb.edu/pub/tex/texinfo.tex
+% /home/gd/gnu/doc/texinfo.tex on the GNU machines.
+%
+% Send bug reports to bug-texinfo@gnu.org.
+% Please include a precise test case in each bug report,
+% including a complete document with which we can reproduce the problem.
+%
+% Texinfo macros (with @macro) are *not* supported by texinfo.tex. You
+% have to run makeinfo -E to expand macros first; the texi2dvi script
+% does this.
% Make it possible to create a .fmt file just by loading this file:
@@ -36,7 +44,7 @@
% This automatically updates the version number based on RCS.
\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
-\deftexinfoversion$Revision: 1.1 $
+\deftexinfoversion$Revision: 1.2 $
\message{Loading texinfo package [Version \texinfoversion]:}
% If in a .fmt file, print the version number
@@ -54,7 +62,8 @@
\let\ptexdot=\.
\let\ptexdots=\dots
\let\ptexend=\end
-\let\ptexequiv = \equiv
+\let\ptexequiv=\equiv
+\let\ptexexclam=\!
\let\ptexi=\i
\let\ptexlbrace=\{
\let\ptexrbrace=\}
@@ -441,14 +450,11 @@
% @. is an end-of-sentence period.
\def\.{.\spacefactor=3000 }
-% @enddots{} is an end-of-sentence ellipsis.
-\gdef\enddots{$\mathinner{\ldotp\ldotp\ldotp\ldotp}$\spacefactor=3000}
-
% @! is an end-of-sentence bang.
-\gdef\!{!\spacefactor=3000 }
+\def\!{!\spacefactor=3000 }
% @? is an end-of-sentence query.
-\gdef\?{?\spacefactor=3000 }
+\def\?{?\spacefactor=3000 }
% @w prevents a word break. Without the \leavevmode, @w at the
% beginning of a paragraph, when TeX is still in vertical mode, would
@@ -573,9 +579,27 @@ where each line of input produces a line of output.}
\let\br = \par
-% @dots{} output some dots
+% @dots{} output an ellipsis using the current font.
+% We do .5em per period so that it has the same spacing in a typewriter
+% font as three actual period characters.
+%
+\def\dots{\hbox to 1.5em{%
+ \hskip 0pt plus 0.25fil minus 0.25fil
+ .\hss.\hss.%
+ \hskip 0pt plus 0.5fil minus 0.5fil
+}}
+
+% @enddots{} is an end-of-sentence ellipsis.
+%
+\def\enddots{%
+ \hbox to 2em{%
+ \hskip 0pt plus 0.25fil minus 0.25fil
+ .\hss.\hss.\hss.%
+ \hskip 0pt plus 0.5fil minus 0.5fil
+ }%
+ \spacefactor=3000
+}
-\def\dots{$\ldots$}
% @page forces the start of a new page
@@ -1236,7 +1260,7 @@ where each line of input produces a line of output.}
\let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
\let\tenttsl=\titlettsl
\resetmathfonts \setleading{25pt}}
-\def\titlefont#1{{\titlefonts #1}}
+\def\titlefont#1{{\titlefonts\rm #1}}
\def\chapfonts{%
\let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
\let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
@@ -1263,6 +1287,10 @@ where each line of input produces a line of output.}
%
\textfonts
+% Define these so they can be easily changed for other fonts.
+\def\angleleft{$\langle$}
+\def\angleright{$\rangle$}
+
% Count depth in font-changes, for error checks
\newcount\fontdepth \fontdepth=0
@@ -1300,15 +1328,15 @@ where each line of input produces a line of output.}
\null
}
\let\ttfont=\t
-\def\samp #1{`\tclose{#1}'\null}
+\def\samp#1{`\tclose{#1}'\null}
\setfont\smallrm\rmshape{8}{1000}
\font\smallsy=cmsy9
\def\key#1{{\smallrm\textfont2=\smallsy \leavevmode\hbox{%
- \raise0.4pt\hbox{$\langle$}\kern-.08em\vtop{%
+ \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{%
\vbox{\hrule\kern-0.4pt
- \hbox{\raise0.4pt\hbox{\vphantom{$\langle$}}#1}}%
+ \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}%
\kern-0.4pt\hrule}%
- \kern-.06em\raise0.4pt\hbox{$\rangle$}}}}
+ \kern-.06em\raise0.4pt\hbox{\angleright}}}}
% The old definition, with no lozenge:
%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null}
\def\ctrl #1{{\tt \rawbackslash \hat}#1}
@@ -1421,7 +1449,7 @@ where each line of input produces a line of output.}
% rms does not like the angle brackets --karl, 17may97.
% So now @email is just like @uref.
-%\def\email#1{$\langle${\tt #1}$\rangle$}
+%\def\email#1{\angleleft{\tt #1}\angleright}
\let\email=\uref
% Check if we are currently using a typewriter font. Since all the
@@ -2043,10 +2071,7 @@ July\or August\or September\or October\or November\or December\fi
% @multitablelinespace is space to leave between table items, baseline
% to baseline.
% 0pt means it depends on current normal line spacing.
-
-%%%%
-% Dimensions
-
+%
\newskip\multitableparskip
\newskip\multitableparindent
\newdimen\multitablecolspace
@@ -2056,15 +2081,15 @@ July\or August\or September\or October\or November\or December\fi
\multitablecolspace=12pt
\multitablelinespace=0pt
-%%%%
% Macros used to set up halign preamble:
+%
\let\endsetuptable\relax
\def\xendsetuptable{\endsetuptable}
\let\columnfractions\relax
\def\xcolumnfractions{\columnfractions}
\newif\ifsetpercent
-%% 2/1/96, to allow fractions to be given with more than one digit.
+% 2/1/96, to allow fractions to be given with more than one digit.
\def\pickupwholefraction#1 {\global\advance\colcount by1 %
\expandafter\xdef\csname col\the\colcount\endcsname{.#1\hsize}%
\setuptable}
@@ -2090,80 +2115,84 @@ July\or August\or September\or October\or November\or December\fi
\ifx\go\pickupwholefraction\else\let\go\setuptable\fi%
\fi\go}
-%%%%
% multitable syntax
\def\tab{&\hskip1sp\relax} % 2/2/96
% tiny skip here makes sure this column space is
% maintained, even if it is never used.
-
-%%%%
% @multitable ... @end multitable definitions:
\def\multitable{\parsearg\dotable}
-
\def\dotable#1{\bgroup
-\let\item\cr
-\tolerance=9500
-\hbadness=9500
-\setmultitablespacing
-\parskip=\multitableparskip
-\parindent=\multitableparindent
-\overfullrule=0pt
-\global\colcount=0\relax%
-\def\Emultitable{\global\setpercentfalse\global\everycr{}\cr\egroup\egroup}%
- % To parse everything between @multitable and @item :
-\setuptable#1 \endsetuptable
- % Need to reset this to 0 after \setuptable.
-\global\colcount=0\relax%
- %
- % This preamble sets up a generic column definition, which will
- % be used as many times as user calls for columns.
- % \vtop will set a single line and will also let text wrap and
- % continue for many paragraphs if desired.
-\halign\bgroup&\global\advance\colcount by 1\relax%
-\multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
- % In order to keep entries from bumping into each other
- % we will add a \leftskip of \multitablecolspace to all columns after
- % the first one.
- % If a template has been used, we will add \multitablecolspace
- % to the width of each template entry.
- % If user has set preamble in terms of percent of \hsize
- % we will use that dimension as the width of the column, and
- % the \leftskip will keep entries from bumping into each other.
- % Table will start at left margin and final column will justify at
- % right margin.
-\ifnum\colcount=1
-\else
- \ifsetpercent
+ \vskip\parskip
+ \let\item\crcr
+ \tolerance=9500
+ \hbadness=9500
+ \setmultitablespacing
+ \parskip=\multitableparskip
+ \parindent=\multitableparindent
+ \overfullrule=0pt
+ \global\colcount=0
+ \def\Emultitable{\global\setpercentfalse\cr\egroup\egroup}%
+ %
+ % To parse everything between @multitable and @item:
+ \setuptable#1 \endsetuptable
+ %
+ % \everycr will reset column counter, \colcount, at the end of
+ % each line. Every column entry will cause \colcount to advance by one.
+ % The table preamble
+ % looks at the current \colcount to find the correct column width.
+ \everycr{\noalign{%
+ %
+ % \filbreak%% keeps underfull box messages off when table breaks over pages.
+ % Maybe so, but it also creates really weird page breaks when the table
+ % breaks over pages. Wouldn't \vfil be better? Wait until the problem
+ % manifests itself, so it can be fixed for real --karl.
+ \global\colcount=0\relax}}%
+ %
+ % This preamble sets up a generic column definition, which will
+ % be used as many times as user calls for columns.
+ % \vtop will set a single line and will also let text wrap and
+ % continue for many paragraphs if desired.
+ \halign\bgroup&\global\advance\colcount by 1\relax
+ \multistrut\vtop{\hsize=\expandafter\csname col\the\colcount\endcsname
+ %
+ % In order to keep entries from bumping into each other
+ % we will add a \leftskip of \multitablecolspace to all columns after
+ % the first one.
+ %
+ % If a template has been used, we will add \multitablecolspace
+ % to the width of each template entry.
+ %
+ % If the user has set preamble in terms of percent of \hsize we will
+ % use that dimension as the width of the column, and the \leftskip
+ % will keep entries from bumping into each other. Table will start at
+ % left margin and final column will justify at right margin.
+ %
+ % Make sure we don't inherit \rightskip from the outer environment.
+ \rightskip=0pt
+ \ifnum\colcount=1
+ % The first column will be indented with the surrounding text.
+ \advance\hsize by\leftskip
\else
- % If user has <not> set preamble in terms of percent of \hsize
- % we will advance \hsize by \multitablecolspace
- \advance\hsize by \multitablecolspace
+ \ifsetpercent \else
+ % If user has not set preamble in terms of percent of \hsize
+ % we will advance \hsize by \multitablecolspace.
+ \advance\hsize by \multitablecolspace
+ \fi
+ % In either case we will make \leftskip=\multitablecolspace:
+ \leftskip=\multitablecolspace
\fi
- % In either case we will make \leftskip=\multitablecolspace:
-\leftskip=\multitablecolspace
-\fi
- % Ignoring space at the beginning and end avoids an occasional spurious
- % blank line, when TeX decides to break the line at the space before the
- % box from the multistrut, so the strut ends up on a line by itself.
- % For example:
- % @multitable @columnfractions .11 .89
- % @item @code{#}
- % @tab Legal holiday which is valid in major parts of the whole country.
- % Is automatically provided with highlighting sequences respectively marking
- % characters.
- \noindent\ignorespaces##\unskip\multistrut}\cr
- % \everycr will reset column counter, \colcount, at the end of
- % each line. Every column entry will cause \colcount to advance by one.
- % The table preamble
- % looks at the current \colcount to find the correct column width.
-\global\everycr{\noalign{%
-% \filbreak%% keeps underfull box messages off when table breaks over pages.
-% Maybe so, but it also creates really weird page breaks when the table
-% breaks over pages Wouldn't \vfil be better? Wait until the problem
-% manifests itself, so it can be fixed for real --karl.
-\global\colcount=0\relax}}
+ % Ignoring space at the beginning and end avoids an occasional spurious
+ % blank line, when TeX decides to break the line at the space before the
+ % box from the multistrut, so the strut ends up on a line by itself.
+ % For example:
+ % @multitable @columnfractions .11 .89
+ % @item @code{#}
+ % @tab Legal holiday which is valid in major parts of the whole country.
+ % Is automatically provided with highlighting sequences respectively marking
+ % characters.
+ \noindent\ignorespaces##\unskip\multistrut}\cr
}
\def\setmultitablespacing{% test to see if user has set \multitablelinespace.
@@ -2510,6 +2539,11 @@ width0pt\relax} \fi
\indexbreaks
%
% See if the index file exists and is nonempty.
+ % Change catcode of @ here so that if the index file contains
+ % \initial {@}
+ % as its first line, TeX doesn't complain about mismatched braces
+ % (because it thinks @} is a control sequence).
+ \catcode`\@ = 11
\openin 1 \jobname.#1s
\ifeof 1
% \enddoublecolumns gets confused if there is no text in the index,
@@ -2531,7 +2565,6 @@ width0pt\relax} \fi
% to make right now.
\def\indexbackslash{\rawbackslashxx}%
\catcode`\\ = 0
- \catcode`\@ = 11
\escapechar = `\\
\begindoublecolumns
\input \jobname.#1s
@@ -3427,11 +3460,12 @@ width0pt\relax} \fi
% the index entries, but we want to suppress hyphenation here. (We
% can't do that in the \entry macro, since index entries might consist
% of hyphenated-identifiers-that-do-not-fit-on-a-line-and-nothing-else.)
-%
-% \turnoffactive is for the sake of @" used for umlauts.
\def\tocentry#1#2{\begingroup
\vskip 0pt plus1pt % allow a little stretch for the sake of nice page breaks
- \entry{\turnoffactive #1}{\turnoffactive #2}%
+ % Do not use \turnoffactive in these arguments. Since the toc is
+ % typeset in cmr, so characters such as _ would come out wrong; we
+ % have to do the usual translation tricks.
+ \entry{#1}{#2}%
\endgroup}
% Space between chapter (or whatever) number and the title.
@@ -3497,30 +3531,35 @@ width0pt\relax} \fi
% But \@ or @@ will get a plain tex @ character.
\def\tex{\begingroup
-\catcode `\\=0 \catcode `\{=1 \catcode `\}=2
-\catcode `\$=3 \catcode `\&=4 \catcode `\#=6
-\catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
-\catcode `\%=14
-\catcode 43=12 % plus
-\catcode`\"=12
-\catcode`\==12
-\catcode`\|=12
-\catcode`\<=12
-\catcode`\>=12
-\escapechar=`\\
-%
-\let\,=\ptexcomma
-\let\{=\ptexlbrace
-\let\}=\ptexrbrace
-\let\.=\ptexdot
-\let\*=\ptexstar
-\let\dots=\ptexdots
-\def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
-\def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
-\def\@{@}%
-\let\bullet=\ptexbullet
-\let\b=\ptexb \let\c=\ptexc \let\i=\ptexi \let\t=\ptext
-%
+ \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
+ \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
+ \catcode `\^=7 \catcode `\_=8 \catcode `\~=13 \let~=\tie
+ \catcode `\%=14
+ \catcode 43=12 % plus
+ \catcode`\"=12
+ \catcode`\==12
+ \catcode`\|=12
+ \catcode`\<=12
+ \catcode`\>=12
+ \escapechar=`\\
+ %
+ \let\b=\ptexb
+ \let\bullet=\ptexbullet
+ \let\c=\ptexc
+ \let\,=\ptexcomma
+ \let\.=\ptexdot
+ \let\dots=\ptexdots
+ \let\equiv=\ptexequiv
+ \let\!=\ptexexclam
+ \let\i=\ptexi
+ \let\{=\ptexlbrace
+ \let\}=\ptexrbrace
+ \let\*=\ptexstar
+ \let\t=\ptext
+ %
+ \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}%
+ \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}%
+ \def\@{@}%
\let\Etex=\endgroup}
% Define @lisp ... @endlisp.
@@ -4373,7 +4412,7 @@ width0pt\relax} \fi
\def\refx#1#2{%
\expandafter\ifx\csname X#1\endcsname\relax
% If not defined, say something at least.
- $\langle$un\-de\-fined$\rangle$%
+ \angleleft un\-de\-fined\angleright
\ifhavexrefs
\message{\linenumber Undefined cross reference `#1'.}%
\else
@@ -4390,10 +4429,13 @@ width0pt\relax} \fi
}
% This is the macro invoked by entries in the aux file.
-\def\xrdef #1#2{{%
- \catcode`\'=\other
- \expandafter\gdef\csname X#1\endcsname{#2}%
-}}
+%
+\def\xrdef#1{\begingroup
+ % Reenable \ as an escape while reading the second argument.
+ \catcode`\\ = 0
+ \afterassignment\endgroup
+ \expandafter\gdef\csname X#1\endcsname
+}
% Read the last existing aux file, if any. No error if none exists.
\def\readauxfile{\begingroup
@@ -4617,7 +4659,7 @@ width0pt\relax} \fi
% Check for and read epsf.tex up front. If we read it only at @image
% time, we might be inside a group, and then its definitions would get
% undone and the next image would fail.
-\openin 1 = xepsf.tex
+\openin 1 = epsf.tex
\ifeof 1 \else
\closein 1
\def\epsfannounce{\toks0 = }% do not bother showing banner
diff --git a/gnu/usr.bin/texinfo/doc/texinfo.txi b/gnu/usr.bin/texinfo/doc/texinfo.txi
index 3e809623671..ea16d1525a7 100644
--- a/gnu/usr.bin/texinfo/doc/texinfo.txi
+++ b/gnu/usr.bin/texinfo/doc/texinfo.txi
@@ -1,5 +1,5 @@
\input texinfo.tex @c -*-texinfo-*-
-@c $Id: texinfo.txi,v 1.1 1999/01/11 16:32:51 espie Exp $
+@c $Id: texinfo.txi,v 1.2 1999/01/11 16:38:04 espie Exp $
@c %**start of header
@c All text is ignored before the setfilename.
diff --git a/gnu/usr.bin/texinfo/info/Makefile.am b/gnu/usr.bin/texinfo/info/Makefile.am
index 6ff91f8a51c..160b7eeac7e 100644
--- a/gnu/usr.bin/texinfo/info/Makefile.am
+++ b/gnu/usr.bin/texinfo/info/Makefile.am
@@ -1,5 +1,5 @@
## Makefile.am for texinfo/info.
-## $Id: Makefile.am,v 1.1 1997/08/01 21:59:59 kstailey Exp $
+## $Id: Makefile.am,v 1.2 1999/01/11 16:38:06 espie Exp $
## Run automake in .. to produce Makefile.in from this.
noinst_PROGRAMS = makedoc
@@ -13,7 +13,10 @@ transform = s/ginfo/info/; @program_transform_name@
localedir = $(datadir)/locale
# -I. for funs.h.
-INCLUDES = -I. -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
+# Automake puts -I.. and -I$(srcdir) into DEFS by default, but
+# we need to override it, so include them ourselves.
+INCLUDES = -I. -I$(top_srcdir)/lib -I../intl -I.. -I$(srcdir)
+DEFS = -DINFODIR=\"$(infodir)\" -DLOCALEDIR=\"$(localedir)\" @DEFS@
LDADD = ../lib/libtxi.a @TERMLIBS@ @INTLLIBS@
makedoc_SOURCES = makedoc.c
@@ -32,13 +35,11 @@ EXTRA_DIST = README
# files which contain DECLARE_INFO_COMMAND. `funs.h' is a header file
# listing the functions found. `doc.c' is a structure containing pointers
# to those functions along with completable names and documentation strings.
-#
-# I do not know how to get this right.
-# BUILT_SOURCES = doc.c funs.h
-#
-#cmd_sources = $(srcdir)/session.c $(srcdir)/echo-area.c $(srcdir)/infodoc.c \
-# $(srcdir)/m-x.c $(srcdir)/indices.c $(srcdir)/nodemenu.c \
-# $(srcdir)/footnotes.c $(srcdir)/variables.c
-#
-#$(BUILTSOURCES): makedoc $(cmd_sources)
-# ./makedoc $(cmd_sources)
+BUILT_SOURCES = doc.c funs.h
+
+cmd_sources = $(srcdir)/session.c $(srcdir)/echo-area.c $(srcdir)/infodoc.c \
+ $(srcdir)/m-x.c $(srcdir)/indices.c $(srcdir)/nodemenu.c \
+ $(srcdir)/footnotes.c $(srcdir)/variables.c
+
+$(BUILT_SOURCES): makedoc $(cmd_sources)
+ ./makedoc $(cmd_sources)
diff --git a/gnu/usr.bin/texinfo/info/Makefile.in b/gnu/usr.bin/texinfo/info/Makefile.in
index a472db0d673..c71d31959ec 100644
--- a/gnu/usr.bin/texinfo/info/Makefile.in
+++ b/gnu/usr.bin/texinfo/info/Makefile.in
@@ -1,8 +1,14 @@
-# Makefile.in generated automatically by automake 1.2 from Makefile.am
+# Makefile.in generated automatically by automake 1.2f from Makefile.am
-# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy, distribute and modify it.
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
SHELL = /bin/sh
@@ -42,12 +48,12 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
-NORMAL_INSTALL = true
-PRE_INSTALL = true
-POST_INSTALL = true
-NORMAL_UNINSTALL = true
-PRE_UNINSTALL = true
-POST_UNINSTALL = true
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
@@ -57,6 +63,7 @@ GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
+INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
@@ -87,7 +94,10 @@ transform = s/ginfo/info/; @program_transform_name@
localedir = $(datadir)/locale
# -I. for funs.h.
-INCLUDES = -I. -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
+# Automake puts -I.. and -I$(srcdir) into DEFS by default, but
+# we need to override it, so include them ourselves.
+INCLUDES = -I. -I$(top_srcdir)/lib -I../intl -I.. -I$(srcdir)
+DEFS = -DINFODIR=\"$(infodir)\" -DLOCALEDIR=\"$(localedir)\" @DEFS@
LDADD = ../lib/libtxi.a @TERMLIBS@ @INTLLIBS@
makedoc_SOURCES = makedoc.c
@@ -101,13 +111,21 @@ ginfo_SOURCES = dir.c display.c display.h doc.c doc.h dribble.c dribble.h \
variables.c variables.h window.c window.h
EXTRA_DIST = README
+
+# The files `doc.c' and `funs.h' are created by ./makedoc run over the source
+# files which contain DECLARE_INFO_COMMAND. `funs.h' is a header file
+# listing the functions found. `doc.c' is a structure containing pointers
+# to those functions along with completable names and documentation strings.
+BUILT_SOURCES = doc.c funs.h
+
+cmd_sources = $(srcdir)/session.c $(srcdir)/echo-area.c $(srcdir)/infodoc.c \
+ $(srcdir)/m-x.c $(srcdir)/indices.c $(srcdir)/nodemenu.c \
+ $(srcdir)/footnotes.c $(srcdir)/variables.c
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
-
-DEFS = @DEFS@ -I. -I$(srcdir) -I..
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
@@ -138,7 +156,7 @@ OBJECTS = $(ginfo_OBJECTS) $(makedoc_OBJECTS)
default: all
.SUFFIXES:
-.SUFFIXES: .c .o
+.SUFFIXES: .S .c .o .s
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps info/Makefile
@@ -150,7 +168,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
mostlyclean-binPROGRAMS:
clean-binPROGRAMS:
- test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
distclean-binPROGRAMS:
@@ -167,7 +185,7 @@ install-binPROGRAMS: $(bin_PROGRAMS)
done
uninstall-binPROGRAMS:
- $(NORMAL_UNINSTALL)
+ @$(NORMAL_UNINSTALL)
list='$(bin_PROGRAMS)'; for p in $$list; do \
rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
done
@@ -175,7 +193,7 @@ uninstall-binPROGRAMS:
mostlyclean-noinstPROGRAMS:
clean-noinstPROGRAMS:
- test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+ -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
distclean-noinstPROGRAMS:
@@ -184,13 +202,19 @@ maintainer-clean-noinstPROGRAMS:
.c.o:
$(COMPILE) -c $<
+.s.o:
+ $(COMPILE) -c $<
+
+.S.o:
+ $(COMPILE) -c $<
+
mostlyclean-compile:
- rm -f *.o core
+ -rm -f *.o core *.core
clean-compile:
distclean-compile:
- rm -f *.tab.c
+ -rm -f *.tab.c
maintainer-clean-compile:
@@ -204,21 +228,26 @@ makedoc: $(makedoc_OBJECTS) $(makedoc_DEPENDENCIES)
tags: TAGS
-ID: $(HEADERS) $(SOURCES)
- here=`pwd` && cd $(srcdir) && mkid -f$$here/ID $(SOURCES) $(HEADERS)
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES)
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
tags=; \
here=`pwd`; \
- test -z "$(ETAGS_ARGS)$(SOURCES)$(HEADERS)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $(SOURCES) $(HEADERS) -o $$here/TAGS)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
- rm -f TAGS ID
+ -rm -f TAGS ID
maintainer-clean-tags:
@@ -233,107 +262,101 @@ distdir: $(DISTFILES)
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
-dir.o dir.lo: dir.c info.h ../lib/system.h ../config.h ../intl/libintl.h \
- filesys.h display.h info-utils.h nodes.h window.h infomap.h \
- search.h terminal.h session.h dribble.h echo-area.h doc.h \
- footnotes.h gc.h tilde.h
-display.o display.lo: display.c info.h ../lib/system.h ../config.h \
- ../intl/libintl.h filesys.h display.h info-utils.h nodes.h \
- window.h infomap.h search.h terminal.h session.h dribble.h \
- echo-area.h doc.h footnotes.h gc.h
-doc.o doc.lo: doc.c doc.h info.h ../lib/system.h ../config.h \
- ../intl/libintl.h filesys.h display.h info-utils.h nodes.h \
- window.h infomap.h search.h terminal.h session.h dribble.h \
- echo-area.h footnotes.h gc.h funs.h
-dribble.o dribble.lo: dribble.c info.h ../lib/system.h ../config.h \
- ../intl/libintl.h filesys.h display.h info-utils.h nodes.h \
- window.h infomap.h search.h terminal.h session.h dribble.h \
- echo-area.h doc.h footnotes.h gc.h
-echo-area.o echo-area.lo: echo-area.c info.h ../lib/system.h ../config.h \
- ../intl/libintl.h filesys.h display.h info-utils.h nodes.h \
- window.h infomap.h search.h terminal.h session.h dribble.h \
- echo-area.h doc.h footnotes.h gc.h
-filesys.o filesys.lo: filesys.c info.h ../lib/system.h ../config.h \
- ../intl/libintl.h filesys.h display.h info-utils.h nodes.h \
- window.h infomap.h search.h terminal.h session.h dribble.h \
- echo-area.h doc.h footnotes.h gc.h tilde.h
-footnotes.o footnotes.lo: footnotes.c info.h ../lib/system.h ../config.h \
- ../intl/libintl.h filesys.h display.h info-utils.h nodes.h \
- window.h infomap.h search.h terminal.h session.h dribble.h \
- echo-area.h doc.h footnotes.h gc.h
-gc.o gc.lo: gc.c info.h ../lib/system.h ../config.h ../intl/libintl.h \
- filesys.h display.h info-utils.h nodes.h window.h infomap.h \
- search.h terminal.h session.h dribble.h echo-area.h doc.h \
- footnotes.h gc.h
-indices.o indices.lo: indices.c info.h ../lib/system.h ../config.h \
- ../intl/libintl.h filesys.h display.h info-utils.h nodes.h \
- window.h infomap.h search.h terminal.h session.h dribble.h \
- echo-area.h doc.h footnotes.h gc.h indices.h
-info-utils.o info-utils.lo: info-utils.c info.h ../lib/system.h \
- ../config.h ../intl/libintl.h filesys.h display.h info-utils.h \
- nodes.h window.h infomap.h search.h terminal.h session.h \
- dribble.h echo-area.h doc.h footnotes.h gc.h man.h
-info.o info.lo: info.c info.h ../lib/system.h ../config.h \
- ../intl/libintl.h filesys.h display.h info-utils.h nodes.h \
- window.h infomap.h search.h terminal.h session.h dribble.h \
- echo-area.h doc.h footnotes.h gc.h indices.h ../lib/getopt.h \
- man.h
-infodoc.o infodoc.lo: infodoc.c info.h ../lib/system.h ../config.h \
- ../intl/libintl.h filesys.h display.h info-utils.h nodes.h \
- window.h infomap.h search.h terminal.h session.h dribble.h \
- echo-area.h doc.h footnotes.h gc.h
-infomap.o infomap.lo: infomap.c info.h ../lib/system.h ../config.h \
- ../intl/libintl.h filesys.h display.h info-utils.h nodes.h \
- window.h infomap.h search.h terminal.h session.h dribble.h \
- echo-area.h doc.h footnotes.h gc.h funs.h
-m-x.o m-x.lo: m-x.c info.h ../lib/system.h ../config.h ../intl/libintl.h \
- filesys.h display.h info-utils.h nodes.h window.h infomap.h \
- search.h terminal.h session.h dribble.h echo-area.h doc.h \
- footnotes.h gc.h
-makedoc.o makedoc.lo: makedoc.c info.h ../lib/system.h ../config.h \
- ../intl/libintl.h filesys.h display.h info-utils.h nodes.h \
- window.h infomap.h search.h terminal.h session.h dribble.h \
- echo-area.h doc.h footnotes.h gc.h
-man.o man.lo: man.c info.h ../lib/system.h ../config.h ../intl/libintl.h \
- filesys.h display.h info-utils.h nodes.h window.h infomap.h \
- search.h terminal.h session.h dribble.h echo-area.h doc.h \
- footnotes.h gc.h signals.h tilde.h man.h
-nodemenu.o nodemenu.lo: nodemenu.c info.h ../lib/system.h ../config.h \
- ../intl/libintl.h filesys.h display.h info-utils.h nodes.h \
- window.h infomap.h search.h terminal.h session.h dribble.h \
- echo-area.h doc.h footnotes.h gc.h
-nodes.o nodes.lo: nodes.c info.h ../lib/system.h ../config.h \
- ../intl/libintl.h filesys.h display.h info-utils.h nodes.h \
- window.h infomap.h search.h terminal.h session.h dribble.h \
- echo-area.h doc.h footnotes.h gc.h man.h
-search.o search.lo: search.c info.h ../lib/system.h ../config.h \
- ../intl/libintl.h filesys.h display.h info-utils.h nodes.h \
- window.h infomap.h search.h terminal.h session.h dribble.h \
- echo-area.h doc.h footnotes.h gc.h
-session.o session.lo: session.c info.h ../lib/system.h ../config.h \
- ../intl/libintl.h filesys.h display.h info-utils.h nodes.h \
- window.h infomap.h search.h terminal.h session.h dribble.h \
- echo-area.h doc.h footnotes.h gc.h man.h
-signals.o signals.lo: signals.c info.h ../lib/system.h ../config.h \
- ../intl/libintl.h filesys.h display.h info-utils.h nodes.h \
- window.h infomap.h search.h terminal.h session.h dribble.h \
- echo-area.h doc.h footnotes.h gc.h signals.h
-terminal.o terminal.lo: terminal.c info.h ../lib/system.h ../config.h \
- ../intl/libintl.h filesys.h display.h info-utils.h nodes.h \
- window.h infomap.h search.h terminal.h session.h dribble.h \
- echo-area.h doc.h footnotes.h gc.h termdep.h
-tilde.o tilde.lo: tilde.c info.h ../lib/system.h ../config.h \
- ../intl/libintl.h filesys.h display.h info-utils.h nodes.h \
- window.h infomap.h search.h terminal.h session.h dribble.h \
- echo-area.h doc.h footnotes.h gc.h
-variables.o variables.lo: variables.c info.h ../lib/system.h ../config.h \
- ../intl/libintl.h filesys.h display.h info-utils.h nodes.h \
- window.h infomap.h search.h terminal.h session.h dribble.h \
- echo-area.h doc.h footnotes.h gc.h variables.h
-window.o window.lo: window.c info.h ../lib/system.h ../config.h \
- ../intl/libintl.h filesys.h display.h info-utils.h nodes.h \
- window.h infomap.h search.h terminal.h session.h dribble.h \
- echo-area.h doc.h footnotes.h gc.h
+dir.o: dir.c info.h ../lib/system.h ../config.h filesys.h display.h \
+ info-utils.h nodes.h window.h infomap.h search.h terminal.h \
+ session.h dribble.h echo-area.h doc.h footnotes.h gc.h tilde.h
+display.o: display.c info.h ../lib/system.h ../config.h filesys.h \
+ display.h info-utils.h nodes.h window.h infomap.h search.h \
+ terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
+ gc.h
+doc.o: doc.c doc.h info.h ../lib/system.h ../config.h filesys.h \
+ display.h info-utils.h nodes.h window.h infomap.h search.h \
+ terminal.h session.h dribble.h echo-area.h footnotes.h gc.h \
+ funs.h
+dribble.o: dribble.c info.h ../lib/system.h ../config.h filesys.h \
+ display.h info-utils.h nodes.h window.h infomap.h search.h \
+ terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
+ gc.h
+echo-area.o: echo-area.c info.h ../lib/system.h ../config.h filesys.h \
+ display.h info-utils.h nodes.h window.h infomap.h search.h \
+ terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
+ gc.h
+filesys.o: filesys.c info.h ../lib/system.h ../config.h filesys.h \
+ display.h info-utils.h nodes.h window.h infomap.h search.h \
+ terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
+ gc.h tilde.h
+footnotes.o: footnotes.c info.h ../lib/system.h ../config.h filesys.h \
+ display.h info-utils.h nodes.h window.h infomap.h search.h \
+ terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
+ gc.h
+gc.o: gc.c info.h ../lib/system.h ../config.h filesys.h display.h \
+ info-utils.h nodes.h window.h infomap.h search.h terminal.h \
+ session.h dribble.h echo-area.h doc.h footnotes.h gc.h
+indices.o: indices.c info.h ../lib/system.h ../config.h filesys.h \
+ display.h info-utils.h nodes.h window.h infomap.h search.h \
+ terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
+ gc.h indices.h
+info-utils.o: info-utils.c info.h ../lib/system.h ../config.h filesys.h \
+ display.h info-utils.h nodes.h window.h infomap.h search.h \
+ terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
+ gc.h man.h
+info.o: info.c info.h ../lib/system.h ../config.h filesys.h display.h \
+ info-utils.h nodes.h window.h infomap.h search.h terminal.h \
+ session.h dribble.h echo-area.h doc.h footnotes.h gc.h \
+ indices.h ../lib/getopt.h man.h
+infodoc.o: infodoc.c info.h ../lib/system.h ../config.h filesys.h \
+ display.h info-utils.h nodes.h window.h infomap.h search.h \
+ terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
+ gc.h
+infomap.o: infomap.c info.h ../lib/system.h ../config.h filesys.h \
+ display.h info-utils.h nodes.h window.h infomap.h search.h \
+ terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
+ gc.h funs.h
+m-x.o: m-x.c info.h ../lib/system.h ../config.h filesys.h display.h \
+ info-utils.h nodes.h window.h infomap.h search.h terminal.h \
+ session.h dribble.h echo-area.h doc.h footnotes.h gc.h
+makedoc.o: makedoc.c info.h ../lib/system.h ../config.h filesys.h \
+ display.h info-utils.h nodes.h window.h infomap.h search.h \
+ terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
+ gc.h
+man.o: man.c info.h ../lib/system.h ../config.h filesys.h display.h \
+ info-utils.h nodes.h window.h infomap.h search.h terminal.h \
+ session.h dribble.h echo-area.h doc.h footnotes.h gc.h \
+ signals.h tilde.h man.h
+nodemenu.o: nodemenu.c info.h ../lib/system.h ../config.h filesys.h \
+ display.h info-utils.h nodes.h window.h infomap.h search.h \
+ terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
+ gc.h
+nodes.o: nodes.c info.h ../lib/system.h ../config.h filesys.h display.h \
+ info-utils.h nodes.h window.h infomap.h search.h terminal.h \
+ session.h dribble.h echo-area.h doc.h footnotes.h gc.h man.h
+search.o: search.c info.h ../lib/system.h ../config.h filesys.h \
+ display.h info-utils.h nodes.h window.h infomap.h search.h \
+ terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
+ gc.h
+session.o: session.c info.h ../lib/system.h ../config.h filesys.h \
+ display.h info-utils.h nodes.h window.h infomap.h search.h \
+ terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
+ gc.h man.h
+signals.o: signals.c info.h ../lib/system.h ../config.h filesys.h \
+ display.h info-utils.h nodes.h window.h infomap.h search.h \
+ terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
+ gc.h signals.h
+terminal.o: terminal.c info.h ../lib/system.h ../config.h filesys.h \
+ display.h info-utils.h nodes.h window.h infomap.h search.h \
+ terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
+ gc.h termdep.h
+tilde.o: tilde.c info.h ../lib/system.h ../config.h filesys.h display.h \
+ info-utils.h nodes.h window.h infomap.h search.h terminal.h \
+ session.h dribble.h echo-area.h doc.h footnotes.h gc.h
+variables.o: variables.c info.h ../lib/system.h ../config.h filesys.h \
+ display.h info-utils.h nodes.h window.h infomap.h search.h \
+ terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
+ gc.h variables.h
+window.o: window.c info.h ../lib/system.h ../config.h filesys.h \
+ display.h info-utils.h nodes.h window.h infomap.h search.h \
+ terminal.h session.h dribble.h echo-area.h doc.h footnotes.h \
+ gc.h
info:
dvi:
@@ -360,19 +383,19 @@ installdirs:
mostlyclean-generic:
- test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
- test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- rm -f Makefile $(DISTCLEANFILES)
- rm -f config.cache config.log stamp-h stamp-h[0-9]*
- test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
- test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
- test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-binPROGRAMS mostlyclean-noinstPROGRAMS \
mostlyclean-compile mostlyclean-tags \
mostlyclean-generic
@@ -383,7 +406,7 @@ clean: clean-binPROGRAMS clean-noinstPROGRAMS clean-compile clean-tags \
distclean: distclean-binPROGRAMS distclean-noinstPROGRAMS \
distclean-compile distclean-tags distclean-generic \
clean
- rm -f config.status
+ -rm -f config.status
maintainer-clean: maintainer-clean-binPROGRAMS \
maintainer-clean-noinstPROGRAMS \
@@ -404,20 +427,8 @@ mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
-# The files `doc.c' and `funs.h' are created by ./makedoc run over the source
-# files which contain DECLARE_INFO_COMMAND. `funs.h' is a header file
-# listing the functions found. `doc.c' is a structure containing pointers
-# to those functions along with completable names and documentation strings.
-#
-# I do not know how to get this right.
-# BUILT_SOURCES = doc.c funs.h
-#
-#cmd_sources = $(srcdir)/session.c $(srcdir)/echo-area.c $(srcdir)/infodoc.c \
-# $(srcdir)/m-x.c $(srcdir)/indices.c $(srcdir)/nodemenu.c \
-# $(srcdir)/footnotes.c $(srcdir)/variables.c
-#
-#$(BUILTSOURCES): makedoc $(cmd_sources)
-# ./makedoc $(cmd_sources)
+$(BUILT_SOURCES): makedoc $(cmd_sources)
+ ./makedoc $(cmd_sources)
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/gnu/usr.bin/texinfo/info/dir.c b/gnu/usr.bin/texinfo/info/dir.c
index 4ccf8561310..3536cac3ffd 100644
--- a/gnu/usr.bin/texinfo/info/dir.c
+++ b/gnu/usr.bin/texinfo/info/dir.c
@@ -1,9 +1,7 @@
-/* dir.c -- How to build a special "dir" node from "localdir" files. */
+/* dir.c -- How to build a special "dir" node from "localdir" files.
+ $Id: dir.c,v 1.2 1999/01/11 16:38:06 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,13 +19,7 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#if defined (HAVE_SYS_FILE_H)
-#include <sys/file.h>
-#endif /* HAVE_SYS_FILE_H */
-#include <sys/errno.h>
+#include "info.h"
#include "info-utils.h"
#include "filesys.h"
#include "tilde.h"
@@ -37,23 +29,53 @@
dirs_to_add which are found in INFOPATH. */
static void add_menu_to_file_buffer (), insert_text_into_fb_at_binding ();
-static void build_dir_node_internal ();
static char *dirs_to_add[] = {
"dir", "localdir", (char *)NULL
};
+
+/* Return zero if the file represented in the stat structure TEST has
+ already been seen, nonzero else. */
+
+typedef struct
+{
+ unsigned long device;
+ unsigned long inode;
+} dir_file_list_entry_type;
+
+static int
+new_dir_file_p (test)
+ struct stat *test;
+{
+ static unsigned dir_file_list_len = 0;
+ static dir_file_list_entry_type *dir_file_list = NULL;
+ unsigned i;
+
+ for (i = 0; i < dir_file_list_len; i++)
+ {
+ dir_file_list_entry_type entry;
+ entry = dir_file_list[i];
+ if (entry.device == test->st_dev && entry.inode == test->st_ino)
+ return 0;
+ }
+
+ dir_file_list_len++;
+ dir_file_list = xrealloc (dir_file_list,
+ dir_file_list_len * sizeof (dir_file_list_entry_type));
+ dir_file_list[dir_file_list_len - 1].device = test->st_dev;
+ dir_file_list[dir_file_list_len - 1].inode = test->st_ino;
+ return 1;
+}
+
+
void
maybe_build_dir_node (dirname)
char *dirname;
{
- FILE_BUFFER *dir_buffer;
int path_index, update_tags;
char *this_dir;
-
- /* Check to see if the file has already been built. If so, then
- do not build it again. */
- dir_buffer = info_find_file (dirname);
+ FILE_BUFFER *dir_buffer = info_find_file (dirname);
/* If there is no "dir" in the current info path, we cannot build one
from nothing. */
@@ -64,6 +86,10 @@ maybe_build_dir_node (dirname)
if (dir_buffer->flags & N_CannotGC)
return;
+ /* Initialize the list we use to avoid reading the same dir file twice
+ with the dir file just found. */
+ new_dir_file_p (&dir_buffer->finfo);
+
path_index = update_tags = 0;
/* Using each element of the path, check for one of the files in
@@ -71,62 +97,56 @@ maybe_build_dir_node (dirname)
Only files explictly named are eligible. This is a design decision.
There can be an info file name "localdir.info" which contains
information on the setting up of "localdir" files. */
- while (this_dir = extract_colon_unit (infopath, &path_index))
+ while ((this_dir = extract_colon_unit (infopath, &path_index)))
{
register int da_index;
char *from_file;
/* Expand a leading tilde if one is present. */
if (*this_dir == '~')
- {
- char *tilde_expanded_dirname;
-
- tilde_expanded_dirname = tilde_expand_word (this_dir);
- if (tilde_expanded_dirname != this_dir)
- {
- free (this_dir);
- this_dir = tilde_expanded_dirname;
- }
- }
-
- /* For every file named in DIRS_TO_ADD found in the search path,
- add the contents of that file's menu to our "dir" node. */
- for (da_index = 0; from_file = dirs_to_add[da_index]; da_index++)
- {
- struct stat finfo;
- char *fullpath;
- int namelen, statable;
-
- namelen = strlen (from_file);
-
- fullpath = (char *)xmalloc (3 + strlen (this_dir) + namelen);
- strcpy (fullpath, this_dir);
- if (fullpath[strlen (fullpath) - 1] != '/')
- strcat (fullpath, "/");
- strcat (fullpath, from_file);
-
- statable = (stat (fullpath, &finfo) == 0);
-
- /* Only add the contents of this file if it is not identical to the
- file of the DIR buffer. */
- if ((statable && S_ISREG (finfo.st_mode)) &&
- (strcmp (dir_buffer->fullpath, fullpath) != 0))
- {
- long filesize;
- char *contents;
-
- contents = filesys_read_info_file (fullpath, &filesize, &finfo);
-
- if (contents)
- {
- update_tags++;
- add_menu_to_file_buffer (contents, filesize, dir_buffer);
- free (contents);
- }
- }
-
- free (fullpath);
- }
+ {
+ char *tilde_expanded_dirname;
+
+ tilde_expanded_dirname = tilde_expand_word (this_dir);
+ if (tilde_expanded_dirname != this_dir)
+ {
+ free (this_dir);
+ this_dir = tilde_expanded_dirname;
+ }
+ }
+
+ /* For every different file named in DIRS_TO_ADD found in the
+ search path, add that file's menu to our "dir" node. */
+ for (da_index = 0; (from_file = dirs_to_add[da_index]); da_index++)
+ {
+ struct stat finfo;
+ int statable;
+ int namelen = strlen (from_file);
+ char *fullpath = xmalloc (3 + strlen (this_dir) + namelen);
+
+ strcpy (fullpath, this_dir);
+ if (fullpath[strlen (fullpath) - 1] != '/')
+ strcat (fullpath, "/");
+ strcat (fullpath, from_file);
+
+ statable = (stat (fullpath, &finfo) == 0);
+
+ /* Only add this file if we have not seen it before. */
+ if (statable && S_ISREG (finfo.st_mode) && new_dir_file_p (&finfo))
+ {
+ long filesize;
+ char *contents = filesys_read_info_file (fullpath, &filesize,
+ &finfo);
+ if (contents)
+ {
+ update_tags++;
+ add_menu_to_file_buffer (contents, filesize, dir_buffer);
+ free (contents);
+ }
+ }
+
+ free (fullpath);
+ }
free (this_dir);
}
@@ -176,37 +196,37 @@ add_menu_to_file_buffer (contents, size, fb)
if (fb_offset == -1)
{
/* Find the start of the second node in this file buffer. If there
- is only one node, we will be adding the contents to the end of
- this node. */
+ is only one node, we will be adding the contents to the end of
+ this node. */
fb_offset = find_node_separator (&fb_binding);
/* If not even a single node separator, give up. */
if (fb_offset == -1)
- return;
+ return;
fb_binding.start = fb_offset;
fb_binding.start +=
- skip_node_separator (fb_binding.buffer + fb_binding.start);
+ skip_node_separator (fb_binding.buffer + fb_binding.start);
/* Try to find the next node separator. */
fb_offset = find_node_separator (&fb_binding);
/* If found one, consider that the start of the menu. Otherwise, the
- start of this menu is the end of the file buffer (i.e., fb->size). */
+ start of this menu is the end of the file buffer (i.e., fb->size). */
if (fb_offset != -1)
- fb_binding.start = fb_offset;
+ fb_binding.start = fb_offset;
else
- fb_binding.start = fb_binding.end;
+ fb_binding.start = fb_binding.end;
insert_text_into_fb_at_binding
- (fb, &fb_binding, INFO_MENU_LABEL, strlen (INFO_MENU_LABEL));
+ (fb, &fb_binding, INFO_MENU_LABEL, strlen (INFO_MENU_LABEL));
fb_binding.buffer = fb->contents;
fb_binding.start = 0;
fb_binding.end = fb->filesize;
fb_offset = search_forward (INFO_MENU_LABEL, &fb_binding);
if (fb_offset == -1)
- abort ();
+ abort ();
}
/* CONTENTS_OFFSET and FB_OFFSET point to the starts of the menus that
@@ -224,23 +244,23 @@ add_menu_to_file_buffer (contents, size, fb)
int num_found = 0;
while ((fb_binding.start > 0) &&
- (whitespace_or_newline (fb_binding.buffer[fb_binding.start - 1])))
+ (whitespace_or_newline (fb_binding.buffer[fb_binding.start - 1])))
{
- num_found++;
- fb_binding.start--;
+ num_found++;
+ fb_binding.start--;
}
/* Optimize if possible. */
if (num_found >= 2)
{
- fb_binding.buffer[fb_binding.start++] = '\n';
- fb_binding.buffer[fb_binding.start++] = '\n';
+ fb_binding.buffer[fb_binding.start++] = '\n';
+ fb_binding.buffer[fb_binding.start++] = '\n';
}
else
{
- /* Do it the hard way. */
- insert_text_into_fb_at_binding (fb, &fb_binding, "\n\n", 2);
- fb_binding.start += 2;
+ /* Do it the hard way. */
+ insert_text_into_fb_at_binding (fb, &fb_binding, "\n\n", 2);
+ fb_binding.start += 2;
}
}
diff --git a/gnu/usr.bin/texinfo/info/display.c b/gnu/usr.bin/texinfo/info/display.c
index 0194afafa20..a9ca5d65689 100644
--- a/gnu/usr.bin/texinfo/info/display.c
+++ b/gnu/usr.bin/texinfo/info/display.c
@@ -1,9 +1,7 @@
-/* display.c -- How to display Info windows. */
+/* display.c -- How to display Info windows.
+ $Id: display.c,v 1.2 1999/01/11 16:38:06 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,10 +19,7 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#include <stdio.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+#include "info.h"
#include "display.h"
extern int info_any_buffered_input_p (); /* Found in session.c. */
@@ -57,7 +52,7 @@ display_clear_display (display)
register int i;
register DISPLAY_LINE *display_line;
- for (i = 0; display_line = display[i]; i++)
+ for (i = 0; (display_line = display[i]); i++)
{
display[i]->text[0] = '\0';
display[i]->textlen = 0;
@@ -83,13 +78,13 @@ display_update_display (window)
{
/* Only re-display visible windows which need updating. */
if (((win->flags & W_WindowVisible) == 0) ||
- ((win->flags & W_UpdateWindow) == 0) ||
- (win->height == 0))
- continue;
+ ((win->flags & W_UpdateWindow) == 0) ||
+ (win->height == 0))
+ continue;
display_update_one_window (win);
if (display_was_interrupted_p)
- break;
+ break;
}
/* Always update the echo area. */
@@ -102,12 +97,12 @@ void
display_update_one_window (win)
WINDOW *win;
{
- register char *nodetext; /* Current character to display. */
+ register char *nodetext; /* Current character to display. */
register char *last_node_char; /* Position of the last character in node. */
- register int i; /* General use index. */
- char *printed_line; /* Buffer for a printed line. */
- int pl_index = 0; /* Index into PRINTED_LINE. */
- int line_index = 0; /* Number of lines done so far. */
+ register int i; /* General use index. */
+ char *printed_line; /* Buffer for a printed line. */
+ int pl_index = 0; /* Index into PRINTED_LINE. */
+ int line_index = 0; /* Number of lines done so far. */
DISPLAY_LINE **display = the_display;
/* If display is inhibited, that counts as an interrupted display. */
@@ -142,165 +137,165 @@ display_update_one_window (win)
int replen;
if (isprint (*nodetext))
- {
- rep_temp[0] = *nodetext;
- replen = 1;
- rep_temp[1] = '\0';
- rep = rep_temp;
- }
+ {
+ rep_temp[0] = *nodetext;
+ replen = 1;
+ rep_temp[1] = '\0';
+ rep = rep_temp;
+ }
else
- {
- if (*nodetext == '\r' || *nodetext == '\n')
- {
- replen = win->width - pl_index;
- }
- else
- {
- rep = printed_representation (*nodetext, pl_index);
- replen = strlen (rep);
- }
- }
+ {
+ if (*nodetext == '\r' || *nodetext == '\n')
+ {
+ replen = win->width - pl_index;
+ }
+ else
+ {
+ rep = printed_representation (*nodetext, pl_index);
+ replen = strlen (rep);
+ }
+ }
/* If this character can be printed without passing the width of
- the line, then stuff it into the line. */
+ the line, then stuff it into the line. */
if (replen + pl_index < win->width)
- {
- /* Optimize if possible. */
- if (replen == 1)
- {
- printed_line[pl_index++] = *rep;
- }
- else
- {
- for (i = 0; i < replen; i++)
- printed_line[pl_index++] = rep[i];
- }
- }
+ {
+ /* Optimize if possible. */
+ if (replen == 1)
+ {
+ printed_line[pl_index++] = *rep;
+ }
+ else
+ {
+ for (i = 0; i < replen; i++)
+ printed_line[pl_index++] = rep[i];
+ }
+ }
else
- {
- DISPLAY_LINE *entry;
-
- /* If this character cannot be printed in this line, we have
- found the end of this line as it would appear on the screen.
- Carefully print the end of the line, and then compare. */
- if (*nodetext == '\n' || *nodetext == '\r' || *nodetext == '\t')
- {
- printed_line[pl_index] = '\0';
- rep_carried_over = (char *)NULL;
- }
- else
- {
- /* The printed representation of this character extends into
- the next line. Remember the offset of the last character
- printed out of REP so that we can carry the character over
- to the next line. */
- for (i = 0; pl_index < (win->width - 1);)
- printed_line[pl_index++] = rep[i++];
-
- rep_carried_over = rep + i;
-
- /* If printing the last character in this window couldn't
- possibly cause the screen to scroll, place a backslash
- in the rightmost column. */
- if (1 + line_index + win->first_row < the_screen->height)
- {
- if (win->flags & W_NoWrap)
- printed_line[pl_index++] = '$';
- else
- printed_line[pl_index++] = '\\';
- }
- printed_line[pl_index] = '\0';
- }
-
- /* We have the exact line as it should appear on the screen.
- Check to see if this line matches the one already appearing
- on the screen. */
- entry = display[line_index + win->first_row];
-
- /* If the screen line is inversed, then we have to clear
- the line from the screen first. Why, I don't know. */
- if (entry->inverse)
- {
- terminal_goto_xy (0, line_index + win->first_row);
- terminal_clear_to_eol ();
- entry->inverse = 0;
- entry->text[0] = '\0';
- entry->textlen = 0;
- }
-
- /* Find the offset where these lines differ. */
- for (i = 0; i < pl_index; i++)
- if (printed_line[i] != entry->text[i])
- break;
-
- /* If the lines are not the same length, or if they differed
- at all, we must do some redrawing. */
- if ((i != pl_index) || (pl_index != entry->textlen))
- {
- /* Move to the proper point on the terminal. */
- terminal_goto_xy (i, line_index + win->first_row);
-
- /* If there is any text to print, print it. */
- if (i != pl_index)
- terminal_put_text (printed_line + i);
-
- /* If the printed text didn't extend all the way to the edge
- of the window, and text was appearing between here and the
- edge of the window, clear from here to the end of the line. */
- if ((pl_index < win->width && pl_index < entry->textlen) ||
- (entry->inverse))
- terminal_clear_to_eol ();
-
- fflush (stdout);
-
- /* Update the display text buffer. */
- strcpy (entry->text + i, printed_line + i);
- entry->textlen = pl_index;
-
- /* Lines showing node text are not in inverse. Only modelines
- have that distinction. */
- entry->inverse = 0;
- }
-
- /* We have done at least one line. Increment our screen line
- index, and check against the bottom of the window. */
- if (++line_index == win->height)
- break;
-
- /* A line has been displayed, and the screen reflects that state.
- If there is typeahead pending, then let that typeahead be read
- now, instead of continuing with the display. */
- if (info_any_buffered_input_p ())
- {
- free (printed_line);
- display_was_interrupted_p = 1;
- return;
- }
-
- /* Reset PL_INDEX to the start of the line. */
- pl_index = 0;
-
- /* If there are characters from REP left to print, stuff them
- into the buffer now. */
- if (rep_carried_over)
- for (; rep[pl_index]; pl_index++)
- printed_line[pl_index] = rep[pl_index];
-
- /* If this window has chosen not to wrap lines, skip to the end
- of the physical line in the buffer, and start a new line here. */
- if (pl_index && (win->flags & W_NoWrap))
- {
- char *begin;
-
- pl_index = 0;
- printed_line[0] = '\0';
-
- begin = nodetext;
-
- while ((nodetext < last_node_char) && (*nodetext != '\n'))
- nodetext++;
- }
- }
+ {
+ DISPLAY_LINE *entry;
+
+ /* If this character cannot be printed in this line, we have
+ found the end of this line as it would appear on the screen.
+ Carefully print the end of the line, and then compare. */
+ if (*nodetext == '\n' || *nodetext == '\r' || *nodetext == '\t')
+ {
+ printed_line[pl_index] = '\0';
+ rep_carried_over = (char *)NULL;
+ }
+ else
+ {
+ /* The printed representation of this character extends into
+ the next line. Remember the offset of the last character
+ printed out of REP so that we can carry the character over
+ to the next line. */
+ for (i = 0; pl_index < (win->width - 1);)
+ printed_line[pl_index++] = rep[i++];
+
+ rep_carried_over = rep + i;
+
+ /* If printing the last character in this window couldn't
+ possibly cause the screen to scroll, place a backslash
+ in the rightmost column. */
+ if (1 + line_index + win->first_row < the_screen->height)
+ {
+ if (win->flags & W_NoWrap)
+ printed_line[pl_index++] = '$';
+ else
+ printed_line[pl_index++] = '\\';
+ }
+ printed_line[pl_index] = '\0';
+ }
+
+ /* We have the exact line as it should appear on the screen.
+ Check to see if this line matches the one already appearing
+ on the screen. */
+ entry = display[line_index + win->first_row];
+
+ /* If the screen line is inversed, then we have to clear
+ the line from the screen first. Why, I don't know. */
+ if (entry->inverse)
+ {
+ terminal_goto_xy (0, line_index + win->first_row);
+ terminal_clear_to_eol ();
+ entry->inverse = 0;
+ entry->text[0] = '\0';
+ entry->textlen = 0;
+ }
+
+ /* Find the offset where these lines differ. */
+ for (i = 0; i < pl_index; i++)
+ if (printed_line[i] != entry->text[i])
+ break;
+
+ /* If the lines are not the same length, or if they differed
+ at all, we must do some redrawing. */
+ if ((i != pl_index) || (pl_index != entry->textlen))
+ {
+ /* Move to the proper point on the terminal. */
+ terminal_goto_xy (i, line_index + win->first_row);
+
+ /* If there is any text to print, print it. */
+ if (i != pl_index)
+ terminal_put_text (printed_line + i);
+
+ /* If the printed text didn't extend all the way to the edge
+ of the window, and text was appearing between here and the
+ edge of the window, clear from here to the end of the line. */
+ if ((pl_index < win->width && pl_index < entry->textlen) ||
+ (entry->inverse))
+ terminal_clear_to_eol ();
+
+ fflush (stdout);
+
+ /* Update the display text buffer. */
+ strcpy (entry->text + i, printed_line + i);
+ entry->textlen = pl_index;
+
+ /* Lines showing node text are not in inverse. Only modelines
+ have that distinction. */
+ entry->inverse = 0;
+ }
+
+ /* We have done at least one line. Increment our screen line
+ index, and check against the bottom of the window. */
+ if (++line_index == win->height)
+ break;
+
+ /* A line has been displayed, and the screen reflects that state.
+ If there is typeahead pending, then let that typeahead be read
+ now, instead of continuing with the display. */
+ if (info_any_buffered_input_p ())
+ {
+ free (printed_line);
+ display_was_interrupted_p = 1;
+ return;
+ }
+
+ /* Reset PL_INDEX to the start of the line. */
+ pl_index = 0;
+
+ /* If there are characters from REP left to print, stuff them
+ into the buffer now. */
+ if (rep_carried_over)
+ for (; rep[pl_index]; pl_index++)
+ printed_line[pl_index] = rep[pl_index];
+
+ /* If this window has chosen not to wrap lines, skip to the end
+ of the physical line in the buffer, and start a new line here. */
+ if (pl_index && (win->flags & W_NoWrap))
+ {
+ char *begin;
+
+ pl_index = 0;
+ printed_line[0] = '\0';
+
+ begin = nodetext;
+
+ while ((nodetext < last_node_char) && (*nodetext != '\n'))
+ nodetext++;
+ }
+ }
}
done_with_node_display:
@@ -313,13 +308,13 @@ display_update_one_window (win)
/* If this line has text on it then make it go away. */
if (entry && entry->textlen)
- {
- entry->textlen = 0;
- entry->text[0] = '\0';
+ {
+ entry->textlen = 0;
+ entry->text[0] = '\0';
- terminal_goto_xy (0, line_index + win->first_row);
- terminal_clear_to_eol ();
- }
+ terminal_goto_xy (0, line_index + win->first_row);
+ terminal_clear_to_eol ();
+ }
}
/* Finally, if this window has a modeline it might need to be redisplayed.
@@ -331,19 +326,19 @@ display_update_one_window (win)
line_index = win->first_row + win->height;
/* This display line must both be in inverse, and have the same
- contents. */
+ contents. */
if ((!display[line_index]->inverse) ||
- (strcmp (display[line_index]->text, win->modeline) != 0))
- {
- terminal_goto_xy (0, line_index);
- terminal_begin_inverse ();
- terminal_put_text (win->modeline);
- terminal_end_inverse ();
- strcpy (display[line_index]->text, win->modeline);
- display[line_index]->inverse = 1;
- display[line_index]->textlen = strlen (win->modeline);
- fflush (stdout);
- }
+ (strcmp (display[line_index]->text, win->modeline) != 0))
+ {
+ terminal_goto_xy (0, line_index);
+ terminal_begin_inverse ();
+ terminal_put_text (win->modeline);
+ terminal_end_inverse ();
+ strcpy (display[line_index]->text, win->modeline);
+ display[line_index]->inverse = 1;
+ display[line_index]->textlen = strlen (win->modeline);
+ fflush (stdout);
+ }
}
/* Okay, this window doesn't need updating anymore. */
@@ -387,40 +382,40 @@ display_scroll_display (start, end, amount)
/* Shift the lines to scroll right into place. */
for (i = 0; i < (end - start); i++)
- {
- temp = the_display[last - i];
- the_display[last - i] = the_display[end - i];
- the_display[end - i] = temp;
- }
+ {
+ temp = the_display[last - i];
+ the_display[last - i] = the_display[end - i];
+ the_display[end - i] = temp;
+ }
/* The lines have been shifted down in the buffer. Clear all of the
- lines that were vacated. */
+ lines that were vacated. */
for (i = start; i != (start + amount); i++)
- {
- the_display[i]->text[0] = '\0';
- the_display[i]->textlen = 0;
- the_display[i]->inverse = 0;
- }
+ {
+ the_display[i]->text[0] = '\0';
+ the_display[i]->textlen = 0;
+ the_display[i]->inverse = 0;
+ }
}
if (amount < 0)
{
last = start + amount;
for (i = 0; i < (end - start); i++)
- {
- temp = the_display[last + i];
- the_display[last + i] = the_display[start + i];
- the_display[start + i] = temp;
- }
+ {
+ temp = the_display[last + i];
+ the_display[last + i] = the_display[start + i];
+ the_display[start + i] = temp;
+ }
/* The lines have been shifted up in the buffer. Clear all of the
- lines that are left over. */
+ lines that are left over. */
for (i = end + amount; i != end; i++)
- {
- the_display[i]->text[0] = '\0';
- the_display[i]->textlen = 0;
- the_display[i]->inverse = 0;
- }
+ {
+ the_display[i]->text[0] = '\0';
+ the_display[i]->textlen = 0;
+ the_display[i]->inverse = 0;
+ }
}
}
@@ -434,9 +429,9 @@ display_scroll_line_starts (window, old_pagetop, old_starts, old_count)
int old_pagetop, old_count;
char **old_starts;
{
- register int i, old, new; /* Indices into the line starts arrays. */
- int last_new, last_old; /* Index of the last visible line. */
- int old_first, new_first; /* Index of the first changed line. */
+ register int i, old, new; /* Indices into the line starts arrays. */
+ int last_new, last_old; /* Index of the last visible line. */
+ int old_first, new_first; /* Index of the first changed line. */
int unchanged_at_top = 0;
int already_scrolled = 0;
@@ -466,39 +461,39 @@ display_scroll_line_starts (window, old_pagetop, old_starts, old_count)
for (old = old_first + unchanged_at_top; old < last_old; old++)
{
for (new = new_first; new < last_new; new++)
- if (old_starts[old] == window->line_starts[new])
- {
- /* Find the extent of the matching lines. */
- for (i = 0; (old + i) < last_old; i++)
- if (old_starts[old + i] != window->line_starts[new + i])
- break;
-
- /* Scroll these lines if there are enough of them. */
- {
- int start, end, amount;
-
- start = (window->first_row
- + ((old + already_scrolled) - old_pagetop));
- amount = new - (old + already_scrolled);
- end = window->first_row + window->height;
-
- /* If we are shifting the block of lines down, then the last
- AMOUNT lines will become invisible. Thus, don't bother
- scrolling them. */
- if (amount > 0)
- end -= amount;
-
- if ((end - start) > 0)
- {
- display_scroll_display (start, end, amount);
-
- /* Some lines have been scrolled. Simulate the scrolling
- by offsetting the value of the old index. */
- old += i;
- already_scrolled += amount;
- }
- }
- }
+ if (old_starts[old] == window->line_starts[new])
+ {
+ /* Find the extent of the matching lines. */
+ for (i = 0; (old + i) < last_old; i++)
+ if (old_starts[old + i] != window->line_starts[new + i])
+ break;
+
+ /* Scroll these lines if there are enough of them. */
+ {
+ int start, end, amount;
+
+ start = (window->first_row
+ + ((old + already_scrolled) - old_pagetop));
+ amount = new - (old + already_scrolled);
+ end = window->first_row + window->height;
+
+ /* If we are shifting the block of lines down, then the last
+ AMOUNT lines will become invisible. Thus, don't bother
+ scrolling them. */
+ if (amount > 0)
+ end -= amount;
+
+ if ((end - start) > 0)
+ {
+ display_scroll_display (start, end, amount);
+
+ /* Some lines have been scrolled. Simulate the scrolling
+ by offsetting the value of the old index. */
+ old += i;
+ already_scrolled += amount;
+ }
+ }
+ }
}
}
@@ -512,12 +507,13 @@ display_cursor_at_point (window)
vpos = window_line_of_point (window) - window->pagetop + window->first_row;
hpos = window_get_cursor_column (window);
terminal_goto_xy (hpos, vpos);
+ fflush (stdout);
}
/* **************************************************************** */
-/* */
-/* Functions Static to this File */
-/* */
+/* */
+/* Functions Static to this File */
+/* */
/* **************************************************************** */
/* Make a DISPLAY_LINE ** with width and height. */
@@ -552,7 +548,7 @@ free_display (display)
if (!display)
return;
- for (i = 0; display_line = display[i]; i++)
+ for (i = 0; (display_line = display[i]); i++)
{
free (display_line->text);
free (display_line);
diff --git a/gnu/usr.bin/texinfo/info/display.h b/gnu/usr.bin/texinfo/info/display.h
index d8bd5a166fe..4ddaa9e3725 100644
--- a/gnu/usr.bin/texinfo/info/display.h
+++ b/gnu/usr.bin/texinfo/info/display.h
@@ -1,9 +1,10 @@
-/* display.h -- How the display in Info is done. */
+/* display.h -- How the display in Info is done.
+ $Id: display.h,v 1.2 1999/01/11 16:38:07 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
+ This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#if !defined (_DISPLAY_H_)
-#define _DISPLAY_H_
+#ifndef INFO_DISPLAY_H
+#define INFO_DISPLAY_H
#include "info-utils.h"
#include "terminal.h"
@@ -73,4 +74,4 @@ extern void display_scroll_display ();
that appear in the OLD_STARTS array. */
extern void display_scroll_line_starts ();
-#endif /* !_DISPLAY_H_ */
+#endif /* not INFO_DISPLAY_H */
diff --git a/gnu/usr.bin/texinfo/info/echo-area.c b/gnu/usr.bin/texinfo/info/echo-area.c
index f3e7a04f5af..4642a28e095 100644
--- a/gnu/usr.bin/texinfo/info/echo-area.c
+++ b/gnu/usr.bin/texinfo/info/echo-area.c
@@ -1,7 +1,7 @@
/* echo-area.c -- How to read a line in the echo area.
- $Id: echo-area.c,v 1.1 1997/08/01 22:00:07 kstailey Exp $
+ $Id: echo-area.c,v 1.2 1999/01/11 16:38:07 espie Exp $
- Copyright (C) 1993, 97 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -938,11 +938,9 @@ DECLARE_INFO_COMMAND (ea_possible_completions, _("List possible completions"))
int limit, count, max_label = 0;
initialize_message_buffer ();
- printf_to_message_buffer
- (_("There %s %d "), completions_found_index == 1 ? _("is") : _("are"),
- completions_found_index);
- printf_to_message_buffer
- (_("completion%s:\n"), completions_found_index == 1 ? "" : "s");
+ printf_to_message_buffer (completions_found_index == 1
+ ? _("One completion:\n")
+ : _("%d completions:\n"));
/* Find the maximum length of a label. */
for (i = 0; i < completions_found_index; i++)
diff --git a/gnu/usr.bin/texinfo/info/echo-area.h b/gnu/usr.bin/texinfo/info/echo-area.h
index e794d596a4d..dfac04dd91e 100644
--- a/gnu/usr.bin/texinfo/info/echo-area.h
+++ b/gnu/usr.bin/texinfo/info/echo-area.h
@@ -1,5 +1,5 @@
/* echo-area.h -- Functions used in reading information from the echo area.
- $Id: echo-area.h,v 1.1 1997/08/01 22:00:08 kstailey Exp $
+ $Id: echo-area.h,v 1.2 1999/01/11 16:38:07 espie Exp $
This file is part of GNU Info, a program for reading online documentation
stored in Info format.
diff --git a/gnu/usr.bin/texinfo/info/filesys.c b/gnu/usr.bin/texinfo/info/filesys.c
index e684bf81f7b..714b98843e6 100644
--- a/gnu/usr.bin/texinfo/info/filesys.c
+++ b/gnu/usr.bin/texinfo/info/filesys.c
@@ -1,9 +1,7 @@
-/* filesys.c -- File system specific functions for hacking this system. */
+/* filesys.c -- File system specific functions for hacking this system.
+ $Id: filesys.c,v 1.2 1999/01/11 16:38:07 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,49 +19,17 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#if defined (HAVE_SYS_FILE_H)
-#include <sys/file.h>
-#endif /* HAVE_SYS_FILE_H */
-#include <sys/errno.h>
-#include "general.h"
+#include "info.h"
+
#include "tilde.h"
#include "filesys.h"
-#if !defined (O_RDONLY)
-#if defined (HAVE_SYS_FCNTL_H)
-#include <sys/fcntl.h>
-#else /* !HAVE_SYS_FCNTL_H */
-#include <fcntl.h>
-#endif /* !HAVE_SYS_FCNTL_H */
-#endif /* !O_RDONLY */
-
-#if !defined (errno)
-extern int errno;
-#endif /* !errno */
-
-/* Found in info-utils.c. */
-extern char *filename_non_directory ();
-
-#if !defined (BUILDING_LIBRARY)
-/* Found in session.c */
-extern int info_windows_initialized_p;
-
-/* Found in window.c. */
-extern void message_in_echo_area (), unmessage_in_echo_area ();
-#endif /* !BUILDING_LIBRARY */
-
/* Local to this file. */
static char *info_file_in_path (), *lookup_info_filename ();
static void remember_info_filename (), maybe_initialize_infopath ();
-#if !defined (NULL)
-# define NULL 0x0
-#endif /* !NULL */
-
-typedef struct {
+typedef struct
+{
char *suffix;
char *decompressor;
} COMPRESSION_ALIST;
@@ -72,6 +38,7 @@ static char *info_suffixes[] = {
"",
".info",
"-info",
+ "/index",
(char *)NULL
};
@@ -114,58 +81,58 @@ info_find_fullpath (partial)
expansion = lookup_info_filename (partial);
if (expansion)
- return (expansion);
+ return (expansion);
/* If we have the full path to this file, we still may have to add
- various extensions to it. I guess we have to stat this file
- after all. */
+ various extensions to it. I guess we have to stat this file
+ after all. */
if (initial_character == '/')
- temp = info_file_in_path (partial + 1, "/");
+ temp = info_file_in_path (partial + 1, "/");
else if (initial_character == '~')
- {
- expansion = tilde_expand_word (partial);
- if (*expansion == '/')
- {
- temp = info_file_in_path (expansion + 1, "/");
- free (expansion);
- }
- else
- temp = expansion;
- }
+ {
+ expansion = tilde_expand_word (partial);
+ if (*expansion == '/')
+ {
+ temp = info_file_in_path (expansion + 1, "/");
+ free (expansion);
+ }
+ else
+ temp = expansion;
+ }
else if (initial_character == '.' &&
- (partial[1] == '/' || (partial[1] == '.' && partial[2] == '/')))
- {
- if (local_temp_filename_size < 1024)
- local_temp_filename = (char *)xrealloc
- (local_temp_filename, (local_temp_filename_size = 1024));
+ (partial[1] == '/' || (partial[1] == '.' && partial[2] == '/')))
+ {
+ if (local_temp_filename_size < 1024)
+ local_temp_filename = (char *)xrealloc
+ (local_temp_filename, (local_temp_filename_size = 1024));
#if defined (HAVE_GETCWD)
- if (!getcwd (local_temp_filename, local_temp_filename_size))
+ if (!getcwd (local_temp_filename, local_temp_filename_size))
#else /* !HAVE_GETCWD */
- if (!getwd (local_temp_filename))
+ if (!getwd (local_temp_filename))
#endif /* !HAVE_GETCWD */
- {
- filesys_error_number = errno;
- return (partial);
- }
-
- strcat (local_temp_filename, "/");
- strcat (local_temp_filename, partial);
- return (local_temp_filename);
- }
+ {
+ filesys_error_number = errno;
+ return (partial);
+ }
+
+ strcat (local_temp_filename, "/");
+ strcat (local_temp_filename, partial);
+ return (local_temp_filename);
+ }
else
- temp = info_file_in_path (partial, infopath);
+ temp = info_file_in_path (partial, infopath);
if (temp)
- {
- remember_info_filename (partial, temp);
- if (strlen (temp) > local_temp_filename_size)
- local_temp_filename = (char *) xrealloc
- (local_temp_filename,
- (local_temp_filename_size = (50 + strlen (temp))));
- strcpy (local_temp_filename, temp);
- free (temp);
- return (local_temp_filename);
- }
+ {
+ remember_info_filename (partial, temp);
+ if (strlen (temp) > local_temp_filename_size)
+ local_temp_filename = (char *) xrealloc
+ (local_temp_filename,
+ (local_temp_filename_size = (50 + strlen (temp))));
+ strcpy (local_temp_filename, temp);
+ free (temp);
+ return (local_temp_filename);
+ }
}
return (partial);
}
@@ -183,25 +150,25 @@ info_file_in_path (filename, path)
dirname_index = 0;
- while (temp_dirname = extract_colon_unit (path, &dirname_index))
+ while ((temp_dirname = extract_colon_unit (path, &dirname_index)))
{
register int i, pre_suffix_length;
char *temp;
/* Expand a leading tilde if one is present. */
if (*temp_dirname == '~')
- {
- char *expanded_dirname;
+ {
+ char *expanded_dirname;
- expanded_dirname = tilde_expand_word (temp_dirname);
- free (temp_dirname);
- temp_dirname = expanded_dirname;
- }
+ expanded_dirname = tilde_expand_word (temp_dirname);
+ free (temp_dirname);
+ temp_dirname = expanded_dirname;
+ }
temp = (char *)xmalloc (30 + strlen (temp_dirname) + strlen (filename));
strcpy (temp, temp_dirname);
if (temp[(strlen (temp)) - 1] != '/')
- strcat (temp, "/");
+ strcat (temp, "/");
strcat (temp, filename);
pre_suffix_length = strlen (temp);
@@ -209,54 +176,54 @@ info_file_in_path (filename, path)
free (temp_dirname);
for (i = 0; info_suffixes[i]; i++)
- {
- strcpy (temp + pre_suffix_length, info_suffixes[i]);
-
- statable = (stat (temp, &finfo) == 0);
-
- /* If we have found a regular file, then use that. Else, if we
- have found a directory, look in that directory for this file. */
- if (statable)
- {
- if (S_ISREG (finfo.st_mode))
- {
- return (temp);
- }
- else if (S_ISDIR (finfo.st_mode))
- {
- char *newpath, *filename_only, *newtemp;
-
- newpath = strdup (temp);
- filename_only = filename_non_directory (filename);
- newtemp = info_file_in_path (filename_only, newpath);
-
- free (newpath);
- if (newtemp)
- {
- free (temp);
- return (newtemp);
- }
- }
- }
- else
- {
- /* Add various compression suffixes to the name to see if
- the file is present in compressed format. */
- register int j, pre_compress_suffix_length;
-
- pre_compress_suffix_length = strlen (temp);
-
- for (j = 0; compress_suffixes[j].suffix; j++)
- {
- strcpy (temp + pre_compress_suffix_length,
- compress_suffixes[j].suffix);
-
- statable = (stat (temp, &finfo) == 0);
- if (statable && (S_ISREG (finfo.st_mode)))
- return (temp);
- }
- }
- }
+ {
+ strcpy (temp + pre_suffix_length, info_suffixes[i]);
+
+ statable = (stat (temp, &finfo) == 0);
+
+ /* If we have found a regular file, then use that. Else, if we
+ have found a directory, look in that directory for this file. */
+ if (statable)
+ {
+ if (S_ISREG (finfo.st_mode))
+ {
+ return (temp);
+ }
+ else if (S_ISDIR (finfo.st_mode))
+ {
+ char *newpath, *filename_only, *newtemp;
+
+ newpath = xstrdup (temp);
+ filename_only = filename_non_directory (filename);
+ newtemp = info_file_in_path (filename_only, newpath);
+
+ free (newpath);
+ if (newtemp)
+ {
+ free (temp);
+ return (newtemp);
+ }
+ }
+ }
+ else
+ {
+ /* Add various compression suffixes to the name to see if
+ the file is present in compressed format. */
+ register int j, pre_compress_suffix_length;
+
+ pre_compress_suffix_length = strlen (temp);
+
+ for (j = 0; compress_suffixes[j].suffix; j++)
+ {
+ strcpy (temp + pre_compress_suffix_length,
+ compress_suffixes[j].suffix);
+
+ statable = (stat (temp, &finfo) == 0);
+ if (statable && (S_ISREG (finfo.st_mode)))
+ return (temp);
+ }
+ }
+ }
free (temp);
}
return ((char *)NULL);
@@ -290,7 +257,7 @@ extract_colon_unit (string, idx)
strncpy (value, &string[start], (i - start));
value[i - start] = '\0';
if (string[i])
- ++i;
+ ++i;
*idx = i;
return (value);
}
@@ -317,10 +284,10 @@ lookup_info_filename (filename)
{
register int i;
for (i = 0; names_and_files[i]; i++)
- {
- if (strcmp (names_and_files[i]->filename, filename) == 0)
- return (names_and_files[i]->expansion);
- }
+ {
+ if (strcmp (names_and_files[i]->filename, filename) == 0)
+ return (names_and_files[i]->expansion);
+ }
}
return (char *)NULL;;
}
@@ -340,12 +307,12 @@ remember_info_filename (filename, expansion)
alloc_size = names_and_files_slots * sizeof (FILENAME_LIST *);
names_and_files =
- (FILENAME_LIST **) xrealloc (names_and_files, alloc_size);
+ (FILENAME_LIST **) xrealloc (names_and_files, alloc_size);
}
new = (FILENAME_LIST *)xmalloc (sizeof (FILENAME_LIST));
- new->filename = strdup (filename);
- new->expansion = expansion ? strdup (expansion) : (char *)NULL;
+ new->filename = xstrdup (filename);
+ new->expansion = expansion ? xstrdup (expansion) : (char *)NULL;
names_and_files[names_and_files_index++] = new;
names_and_files[names_and_files_index] = (FILENAME_LIST *)NULL;
@@ -357,7 +324,7 @@ maybe_initialize_infopath ()
if (!infopath_size)
{
infopath = (char *)
- xmalloc (infopath_size = (1 + strlen (DEFAULT_INFOPATH)));
+ xmalloc (infopath_size = (1 + strlen (DEFAULT_INFOPATH)));
strcpy (infopath, DEFAULT_INFOPATH);
}
@@ -392,7 +359,7 @@ info_add_path (path, where)
}
else if (where == INFOPATH_PREPEND)
{
- char *temp = strdup (infopath);
+ char *temp = xstrdup (infopath);
strcpy (infopath, path);
strcat (infopath, ":");
strcat (infopath, temp);
@@ -436,21 +403,21 @@ filesys_read_info_file (pathname, filesize, finfo)
/* If the file couldn't be opened, give up. */
if (descriptor < 0)
- {
- filesys_error_number = errno;
- return ((char *)NULL);
- }
+ {
+ filesys_error_number = errno;
+ return ((char *)NULL);
+ }
/* Try to read the contents of this file. */
st_size = (long) finfo->st_size;
contents = (char *)xmalloc (1 + st_size);
if ((read (descriptor, contents, st_size)) != st_size)
- {
- filesys_error_number = errno;
- close (descriptor);
- free (contents);
- return ((char *)NULL);
- }
+ {
+ filesys_error_number = errno;
+ close (descriptor);
+ free (contents);
+ return ((char *)NULL);
+ }
close (descriptor);
@@ -510,20 +477,20 @@ filesys_read_compressed (pathname, filesize, finfo)
chunk = (char *)xmalloc (FILESYS_PIPE_BUFFER_SIZE);
while (1)
- {
- int bytes_read;
+ {
+ int bytes_read;
- bytes_read = fread (chunk, 1, FILESYS_PIPE_BUFFER_SIZE, stream);
+ bytes_read = fread (chunk, 1, FILESYS_PIPE_BUFFER_SIZE, stream);
- if (bytes_read + offset >= size)
- contents = (char *)xrealloc
- (contents, size += (2 * FILESYS_PIPE_BUFFER_SIZE));
+ if (bytes_read + offset >= size)
+ contents = (char *)xrealloc
+ (contents, size += (2 * FILESYS_PIPE_BUFFER_SIZE));
- memcpy (contents + offset, chunk, bytes_read);
- offset += bytes_read;
- if (bytes_read != FILESYS_PIPE_BUFFER_SIZE)
- break;
- }
+ memcpy (contents + offset, chunk, bytes_read);
+ offset += bytes_read;
+ if (bytes_read != FILESYS_PIPE_BUFFER_SIZE)
+ break;
+ }
free (chunk);
pclose (stream);
@@ -572,8 +539,8 @@ filesys_decompressor_for_file (filename)
for (i = strlen (filename) - 1; i > 0; i--)
if (filename[i] == '.')
{
- extension = filename + i;
- break;
+ extension = filename + i;
+ break;
}
if (!extension)
diff --git a/gnu/usr.bin/texinfo/info/filesys.h b/gnu/usr.bin/texinfo/info/filesys.h
index 130a52a6357..8c326ca3773 100644
--- a/gnu/usr.bin/texinfo/info/filesys.h
+++ b/gnu/usr.bin/texinfo/info/filesys.h
@@ -1,9 +1,10 @@
-/* filesys.h -- External declarations of functions and vars in filesys.c. */
+/* filesys.h -- External declarations of functions and vars in filesys.c.
+ $Id: filesys.h,v 1.2 1999/01/11 16:38:07 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
+ This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#if !defined (_FILESYS_H_)
-#define _FILESYS_H_
+#ifndef INFO_FILESYS_H
+#define INFO_FILESYS_H
/* The path on which we look for info files. You can initialize this
from the environment variable INFOPATH if there is one, or you can
@@ -70,7 +71,7 @@ extern char *extract_colon_unit ();
/* The default value of INFOPATH. */
#if !defined (DEFAULT_INFOPATH)
-! # define DEFAULT_INFOPATH "/usr/local/info:/usr/info:/usr/local/lib/info:/usr/lib/info:/usr/local/gnu/info:/usr/local/gnu/lib/info:/usr/gnu/info:/usr/gnu/lib/info:/opt/gnu/info:/usr/share/info:/usr/share/lib/info:/usr/local/share/info:/usr/local/share/lib/info:/usr/gnu/lib/emacs/info:/usr/local/gnu/lib/emacs/info:/usr/local/lib/emacs/info:/usr/local/emacs/info:."
+# define DEFAULT_INFOPATH "/usr/local/info:/usr/info:/usr/local/lib/info:/usr/lib/info:/usr/local/gnu/info:/usr/local/gnu/lib/info:/usr/gnu/info:/usr/gnu/lib/info:/opt/gnu/info:/usr/share/info:/usr/share/lib/info:/usr/local/share/info:/usr/local/share/lib/info:/usr/gnu/lib/emacs/info:/usr/local/gnu/lib/emacs/info:/usr/local/lib/emacs/info:/usr/local/emacs/info:."
#endif /* !DEFAULT_INFOPATH */
#if !defined (S_ISREG) && defined (S_IFREG)
@@ -81,4 +82,4 @@ extern char *extract_colon_unit ();
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif /* !S_ISDIR && S_IFDIR */
-#endif /* !_FILESYS_H_ */
+#endif /* not INFO_FILESYS_H */
diff --git a/gnu/usr.bin/texinfo/info/footnotes.c b/gnu/usr.bin/texinfo/info/footnotes.c
index 35a0f352de8..ad69ceaaa8f 100644
--- a/gnu/usr.bin/texinfo/info/footnotes.c
+++ b/gnu/usr.bin/texinfo/info/footnotes.c
@@ -1,9 +1,7 @@
-/* footnotes.c -- Some functions for manipulating footnotes. */
+/* footnotes.c -- Some functions for manipulating footnotes.
+ $Id: footnotes.c,v 1.2 1999/01/11 16:38:08 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -40,7 +38,7 @@ find_footnotes_window ()
/* Try to find an existing window first. */
for (win = windows; win; win = win->next)
if (internal_info_node_p (win->node) &&
- (strcmp (win->node->nodename, footnote_nodename) == 0))
+ (strcmp (win->node->nodename, footnote_nodename) == 0))
break;
return (win);
@@ -72,37 +70,37 @@ make_footnotes_node (node)
refs = info_xrefs_of_node (node);
if (refs)
- {
- register int i;
- char *refname;
+ {
+ register int i;
+ char *refname;
- refname = (char *)xmalloc
- (1 + strlen ("-Footnotes") + strlen (node->nodename));
+ refname = (char *)xmalloc
+ (1 + strlen ("-Footnotes") + strlen (node->nodename));
- strcpy (refname, node->nodename);
- strcat (refname, "-Footnotes");
+ strcpy (refname, node->nodename);
+ strcat (refname, "-Footnotes");
- for (i = 0; refs[i]; i++)
- if ((refs[i]->nodename != (char *)NULL) &&
- (strcmp (refs[i]->nodename, refname) == 0))
- {
- char *filename;
+ for (i = 0; refs[i]; i++)
+ if ((refs[i]->nodename != (char *)NULL) &&
+ (strcmp (refs[i]->nodename, refname) == 0))
+ {
+ char *filename;
- filename = node->parent;
- if (!filename)
- filename = node->filename;
+ filename = node->parent;
+ if (!filename)
+ filename = node->filename;
- fn_node = info_get_node (filename, refname);
+ fn_node = info_get_node (filename, refname);
- if (fn_node)
- fn_start = 0;
+ if (fn_node)
+ fn_start = 0;
- break;
- }
+ break;
+ }
- free (refname);
- info_free_references (refs);
- }
+ free (refname);
+ info_free_references (refs);
+ }
}
/* If we never found the start of a footnotes area, quit now. */
@@ -126,7 +124,7 @@ make_footnotes_node (node)
This effectively skips either "---- footno...", or "File: foo...". */
while (text_start < fn_node->nodelen)
if (fn_node->contents[text_start++] == '\n')
- break;
+ break;
result->nodelen = strlen (header) + fn_node->nodelen - text_start;
@@ -134,7 +132,7 @@ make_footnotes_node (node)
result->contents = (char *)xmalloc (1 + result->nodelen);
sprintf (result->contents, "%s", header);
memcpy (result->contents + strlen (header),
- fn_node->contents + text_start, fn_node->nodelen - text_start);
+ fn_node->contents + text_start, fn_node->nodelen - text_start);
name_internal_node (result, footnote_nodename);
free (header);
@@ -176,7 +174,7 @@ info_get_or_remove_footnotes (window)
if (fn_win && !new_footnotes)
{
if (windows->next)
- info_delete_window_internal (fn_win);
+ info_delete_window_internal (fn_win);
}
/* If there are footnotes for this window's node, but no window around
@@ -187,27 +185,27 @@ info_get_or_remove_footnotes (window)
WINDOW *last, *win;
/* Always make this window be the last one appearing in the list. Find
- the last window in the chain. */
+ the last window in the chain. */
for (win = windows, last = windows; win; last = win, win = win->next);
/* Try to split this window, and make the split window the one to
- contain the footnotes. */
+ contain the footnotes. */
old_active = active_window;
active_window = last;
fn_win = window_make_window (new_footnotes);
active_window = old_active;
if (!fn_win)
- {
- free (new_footnotes->contents);
- free (new_footnotes);
-
- /* If we are hacking automatic footnotes, and there are footnotes
- but we couldn't display them, print a message to that effect. */
- if (auto_footnotes_p)
- inform_in_echo_area ("Footnotes could not be displayed");
- return (FN_UNABLE);
- }
+ {
+ free (new_footnotes->contents);
+ free (new_footnotes);
+
+ /* If we are hacking automatic footnotes, and there are footnotes
+ but we couldn't display them, print a message to that effect. */
+ if (auto_footnotes_p)
+ inform_in_echo_area (_("Footnotes could not be displayed"));
+ return (FN_UNABLE);
+ }
}
/* If there are footnotes, and there is a window to display them,
@@ -217,7 +215,7 @@ info_get_or_remove_footnotes (window)
window_set_node_of_window (fn_win, new_footnotes);
window_change_window_height
- (fn_win, fn_win->line_count - fn_win->height);
+ (fn_win, fn_win->line_count - fn_win->height);
remember_window_and_node (fn_win, new_footnotes);
add_gcable_pointer (new_footnotes->contents);
@@ -231,19 +229,17 @@ info_get_or_remove_footnotes (window)
/* Show the footnotes associated with this node in another window. */
DECLARE_INFO_COMMAND (info_show_footnotes,
- "Show the footnotes associated with this node in another window")
+ _("Show the footnotes associated with this node in another window"))
{
- int result;
-
/* A negative argument means just make the window go away. */
if (count < 0)
{
WINDOW *fn_win = find_footnotes_window ();
/* If there is an old footnotes window, and it isn't the only window
- on the screen, delete it. */
+ on the screen, delete it. */
if (fn_win && windows->next)
- info_delete_window_internal (fn_win);
+ info_delete_window_internal (fn_win);
}
else
{
@@ -252,14 +248,14 @@ DECLARE_INFO_COMMAND (info_show_footnotes,
result = info_get_or_remove_footnotes (window);
switch (result)
- {
- case FN_UNFOUND:
- info_error (NO_FOOT_NODE);
- break;
-
- case FN_UNABLE:
- info_error (WIN_TOO_SMALL);
- break;
- }
+ {
+ case FN_UNFOUND:
+ info_error (NO_FOOT_NODE);
+ break;
+
+ case FN_UNABLE:
+ info_error (WIN_TOO_SMALL);
+ break;
+ }
}
}
diff --git a/gnu/usr.bin/texinfo/info/footnotes.h b/gnu/usr.bin/texinfo/info/footnotes.h
index 89b1b3578e6..dafe731608c 100644
--- a/gnu/usr.bin/texinfo/info/footnotes.h
+++ b/gnu/usr.bin/texinfo/info/footnotes.h
@@ -1,9 +1,10 @@
-/* footnotes.h -- Some functions for manipulating footnotes. */
+/* footnotes.h -- Some functions for manipulating footnotes.
+ $Id: footnotes.h,v 1.2 1999/01/11 16:38:08 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
+ This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,11 +22,11 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#if !defined (_FOOTNOTES_H_)
-#define _FOOTNOTES_H_
+#ifndef INFO_FOOTNOTES_H
+#define INFO_FOOTNOTES_H
/* Magic string which indicates following text is footnotes. */
-#define FOOTNOTE_LABEL "---------- Footnotes ----------"
+#define FOOTNOTE_LABEL _("---------- Footnotes ----------")
#define FN_FOUND 0
#define FN_UNFOUND 1
@@ -42,5 +43,4 @@ extern int info_get_or_remove_footnotes ();
/* Non-zero means attempt to show footnotes when displaying a new window. */
extern int auto_footnotes_p;
-#endif /* !_FOOTNOTES_H_ */
-
+#endif /* not INFO_FOOTNOTES_H */
diff --git a/gnu/usr.bin/texinfo/info/gc.h b/gnu/usr.bin/texinfo/info/gc.h
index 876062ad249..3f62a14dcbe 100644
--- a/gnu/usr.bin/texinfo/info/gc.h
+++ b/gnu/usr.bin/texinfo/info/gc.h
@@ -1,9 +1,10 @@
-/* gc.h -- Functions for garbage collecting unused node contents. */
+/* gc.h -- Functions for garbage collecting unused node contents.
+ $Id: gc.h,v 1.2 1999/01/11 16:38:08 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
+ This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#if !defined (_GC_H_)
-#define _GC_H_
+#ifndef INFO_GC_H
+#define INFO_GC_H
/* Add POINTER to the list of garbage collectible pointers. A pointer
is not actually garbage collected until no info window contains a node
@@ -33,4 +34,4 @@ extern void add_gcable_pointer ();
node->contents which are collectible, and free them. */
extern void gc_pointers ();
-#endif /* !_GC_H_ */
+#endif /* not INFO_GC_H */
diff --git a/gnu/usr.bin/texinfo/info/indices.c b/gnu/usr.bin/texinfo/info/indices.c
index 6848884288b..2a895e8a52b 100644
--- a/gnu/usr.bin/texinfo/info/indices.c
+++ b/gnu/usr.bin/texinfo/info/indices.c
@@ -1,9 +1,7 @@
-/* indices.c -- Commands for dealing with an Info file Index. */
+/* indices.c -- Commands for dealing with an Info file Index.
+ $Id: indices.c,v 1.2 1999/01/11 16:38:08 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -43,9 +41,9 @@ static char *initial_index_nodename = (char *)NULL;
/* A structure associating index names with index offset ranges. */
typedef struct {
- char *name; /* The nodename of this index. */
- int first; /* The index in our list of the first entry. */
- int last; /* The index in our list of the last entry. */
+ char *name; /* The nodename of this index. */
+ int first; /* The index in our list of the first entry. */
+ int last; /* The index in our list of the last entry. */
} INDEX_NAME_ASSOC;
/* An array associating index nodenames with index offset ranges. */
@@ -65,7 +63,7 @@ add_index_to_index_nodenames (array, node)
for (last = 0; array[last]; last++);
assoc = (INDEX_NAME_ASSOC *)xmalloc (sizeof (INDEX_NAME_ASSOC));
- assoc->name = strdup (node->nodename);
+ assoc->name = xstrdup (node->nodename);
if (!index_nodenames_index)
{
@@ -119,10 +117,10 @@ info_indices_of_file_buffer (file_buffer)
if (index_nodenames)
{
for (i = 0; index_nodenames[i]; i++)
- {
- free (index_nodenames[i]->name);
- free (index_nodenames[i]);
- }
+ {
+ free (index_nodenames[i]->name);
+ free (index_nodenames[i]);
+ }
index_nodenames_index = 0;
index_nodenames[0] = (INDEX_NAME_ASSOC *)NULL;
@@ -133,48 +131,59 @@ info_indices_of_file_buffer (file_buffer)
{
TAG *tag;
- for (i = 0; tag = file_buffer->tags[i]; i++)
- {
- if (string_in_line ("Index", tag->nodename) != -1)
- {
- NODE *node;
- REFERENCE **menu;
-
- /* Found one. Get its menu. */
- node = info_get_node (tag->filename, tag->nodename);
- if (!node)
- continue;
-
- /* Remember the filename and nodename of this index. */
- initial_index_filename = strdup (file_buffer->filename);
- initial_index_nodename = strdup (tag->nodename);
-
- menu = info_menu_of_node (node);
-
- /* If we have a menu, add this index's nodename and range
- to our list of index_nodenames. */
- if (menu)
- {
- add_index_to_index_nodenames (menu, node);
-
- /* Concatenate the references found so far. */
- result = info_concatenate_references (result, menu);
- }
- free (node);
- }
- }
+ for (i = 0; (tag = file_buffer->tags[i]); i++)
+ {
+ if (string_in_line ("Index", tag->nodename) != -1)
+ {
+ NODE *node;
+ REFERENCE **menu;
+
+ /* Found one. Get its menu. */
+ node = info_get_node (tag->filename, tag->nodename);
+ if (!node)
+ continue;
+
+ /* Remember the filename and nodename of this index. */
+ initial_index_filename = xstrdup (file_buffer->filename);
+ initial_index_nodename = xstrdup (tag->nodename);
+
+ menu = info_menu_of_node (node);
+
+ /* If we have a menu, add this index's nodename and range
+ to our list of index_nodenames. */
+ if (menu)
+ {
+ add_index_to_index_nodenames (menu, node);
+
+ /* Concatenate the references found so far. */
+ result = info_concatenate_references (result, menu);
+ }
+ free (node);
+ }
+ }
}
/* If there is a result, clean it up so that every entry has a filename. */
for (i = 0; result && result[i]; i++)
if (!result[i]->filename)
- result[i]->filename = strdup (file_buffer->filename);
+ result[i]->filename = xstrdup (file_buffer->filename);
return (result);
}
DECLARE_INFO_COMMAND (info_index_search,
- "Look up a string in the index for this file")
+ _("Look up a string in the index for this file"))
+{
+ do_info_index_search (window, count, 0);
+}
+
+/* Look up SEARCH_STRING in the index for this file. If SEARCH_STRING
+ is NULL, prompt user for input. */
+void
+do_info_index_search (window, count, search_string)
+ WINDOW *window;
+ int count;
+ char *search_string;
{
FILE_BUFFER *fb;
char *line;
@@ -193,47 +202,52 @@ DECLARE_INFO_COMMAND (info_index_search,
(strcmp (initial_index_filename, fb->filename) != 0))
{
info_free_references (index_index);
- window_message_in_echo_area ("Finding index entries...");
+ window_message_in_echo_area (_("Finding index entries..."));
index_index = info_indices_of_file_buffer (fb);
}
/* If there is no index, quit now. */
if (!index_index)
{
- info_error ("No indices found.");
- return;
- }
-
- /* Okay, there is an index. Let the user select one of the members of it. */
- line =
- info_read_maybe_completing (window, "Index entry: ", index_index);
-
- window = active_window;
-
- /* User aborted? */
- if (!line)
- {
- info_abort_key (active_window, 1, 0);
+ info_error (_("No indices found."));
return;
}
- /* Empty line means move to the Index node. */
- if (!*line)
+ /* Okay, there is an index. Look for SEARCH_STRING, or, if it is
+ empty, prompt for one. */
+ if (search_string && *search_string)
+ line = xstrdup (search_string);
+ else
{
- free (line);
-
- if (initial_index_filename && initial_index_nodename)
- {
- NODE *node;
-
- node =
- info_get_node (initial_index_filename, initial_index_nodename);
- set_remembered_pagetop_and_point (window);
- window_set_node_of_window (window, node);
- remember_window_and_node (window, node);
- window_clear_echo_area ();
- return;
- }
+ line = info_read_maybe_completing (window, _("Index entry: "),
+ index_index);
+ window = active_window;
+
+ /* User aborted? */
+ if (!line)
+ {
+ info_abort_key (active_window, 1, 0);
+ return;
+ }
+
+ /* Empty line means move to the Index node. */
+ if (!*line)
+ {
+ free (line);
+
+ if (initial_index_filename && initial_index_nodename)
+ {
+ NODE *node;
+
+ node = info_get_node (initial_index_filename,
+ initial_index_nodename);
+ set_remembered_pagetop_and_point (window);
+ window_set_node_of_window (window, node);
+ remember_window_and_node (window, node);
+ window_clear_echo_area ();
+ return;
+ }
+ }
}
/* The user typed either a completed index label, or a partial string.
@@ -246,9 +260,9 @@ DECLARE_INFO_COMMAND (info_index_search,
/* Start the search right after/before this index. */
if (count < 0)
{
- register int i;
- for (i = 0; index_index[i]; i++);
- index_offset = i;
+ register int i;
+ for (i = 0; index_index[i]; i++);
+ index_offset = i;
}
else
index_offset = -1;
@@ -267,8 +281,55 @@ DECLARE_INFO_COMMAND (info_index_search,
}
}
+int
+index_entry_exists (window, string)
+ WINDOW *window;
+ char *string;
+{
+ register int i;
+ FILE_BUFFER *fb;
+
+ /* If there is no previous search string, the user hasn't built an index
+ yet. */
+ if (!string)
+ return 0;
+
+ fb = file_buffer_of_window (window);
+ if (!initial_index_filename
+ || (strcmp (initial_index_filename, fb->filename) != 0))
+ {
+ info_free_references (index_index);
+ index_index = info_indices_of_file_buffer (fb);
+ }
+
+ /* If there is no index, that is an error. */
+ if (!index_index)
+ return 0;
+
+ for (i = 0; (i > -1) && (index_index[i]); i++)
+ if (strcmp (string, index_index[i]->label) == 0)
+ break;
+
+ /* If that failed, look for the next substring match. */
+ if ((i < 0) || (!index_index[i]))
+ {
+ for (i = 0; (i > -1) && (index_index[i]); i++)
+ if (string_in_line (string, index_index[i]->label) != -1)
+ break;
+
+ if ((i > -1) && (index_index[i]))
+ string_in_line (string, index_index[i]->label);
+ }
+
+ /* If that failed, return 0. */
+ if ((i < 0) || (!index_index[i]))
+ return 0;
+
+ return 1;
+}
+
DECLARE_INFO_COMMAND (info_next_index_match,
- "Go to the next matching index item from the last `\\[index-search]' command")
+ _("Go to the next matching index item from the last `\\[index-search]' command"))
{
register int i;
int partial, dir;
@@ -278,14 +339,14 @@ DECLARE_INFO_COMMAND (info_next_index_match,
yet. */
if (!index_search)
{
- info_error ("No previous index search string.");
+ info_error (_("No previous index search string."));
return;
}
/* If there is no index, that is an error. */
if (!index_index)
{
- info_error ("No index entries.");
+ info_error (_("No index entries."));
return;
}
@@ -308,18 +369,18 @@ DECLARE_INFO_COMMAND (info_next_index_match,
if ((i < 0) || (!index_index[i]))
{
for (i = index_offset + dir; (i > -1) && (index_index[i]); i += dir)
- if (string_in_line (index_search, index_index[i]->label) != -1)
- break;
+ if (string_in_line (index_search, index_index[i]->label) != -1)
+ break;
if ((i > -1) && (index_index[i]))
- partial = string_in_line (index_search, index_index[i]->label);
+ partial = string_in_line (index_search, index_index[i]->label);
}
/* If that failed, print an error. */
if ((i < 0) || (!index_index[i]))
{
- info_error ("No %sindex entries containing \"%s\".",
- index_offset > 0 ? "more " : "", index_search);
+ info_error (_("No %sindex entries containing \"%s\"."),
+ index_offset > 0 ? _("more ") : "", index_search);
return;
}
@@ -329,43 +390,43 @@ DECLARE_INFO_COMMAND (info_next_index_match,
/* Report to the user on what we have found. */
{
register int j;
- char *name = "CAN'T SEE THIS";
+ char *name = _("CAN'T SEE THIS");
char *match;
for (j = 0; index_nodenames[j]; j++)
{
- if ((i >= index_nodenames[j]->first) &&
- (i <= index_nodenames[j]->last))
- {
- name = index_nodenames[j]->name;
- break;
- }
+ if ((i >= index_nodenames[j]->first) &&
+ (i <= index_nodenames[j]->last))
+ {
+ name = index_nodenames[j]->name;
+ break;
+ }
}
/* If we had a partial match, indicate to the user which part of the
string matched. */
- match = strdup (index_index[i]->label);
+ match = xstrdup (index_index[i]->label);
if (partial && show_index_match)
{
- int j, ls, start, upper;
+ int j, ls, start, upper;
- ls = strlen (index_search);
- start = partial - ls;
- upper = isupper (match[start]) ? 1 : 0;
+ ls = strlen (index_search);
+ start = partial - ls;
+ upper = isupper (match[start]) ? 1 : 0;
- for (j = 0; j < ls; j++)
- if (upper)
- match[j + start] = info_tolower (match[j + start]);
- else
- match[j + start] = info_toupper (match[j + start]);
+ for (j = 0; j < ls; j++)
+ if (upper)
+ match[j + start] = info_tolower (match[j + start]);
+ else
+ match[j + start] = info_toupper (match[j + start]);
}
{
char *format;
format = replace_in_documentation
- ("Found \"%s\" in %s. (`\\[next-index-match]' tries to find next.)");
+ (_("Found \"%s\" in %s. (`\\[next-index-match]' tries to find next.)"));
window_message_in_echo_area (format, match, name);
}
@@ -379,7 +440,7 @@ DECLARE_INFO_COMMAND (info_next_index_match,
if (!node)
{
info_error (CANT_FILE_NODE,
- index_index[i]->filename, index_index[i]->nodename);
+ index_index[i]->filename, index_index[i]->nodename);
return;
}
@@ -397,16 +458,16 @@ DECLARE_INFO_COMMAND (info_next_index_match,
if (loc != -1)
{
- window->point = loc;
- window_adjust_pagetop (window);
+ window->point = loc;
+ window_adjust_pagetop (window);
}
}
}
/* **************************************************************** */
-/* */
-/* Info APROPOS: Search every known index. */
-/* */
+/* */
+/* Info APROPOS: Search every known index. */
+/* */
/* **************************************************************** */
/* For every menu item in DIR, search the indices of that file for
@@ -420,14 +481,13 @@ apropos_in_all_indices (search_string, inform)
REFERENCE **all_indices = (REFERENCE **)NULL;
REFERENCE **dir_menu = (REFERENCE **)NULL;
NODE *dir_node;
- int printed = 0;
dir_node = info_get_node ("dir", "Top");
if (dir_node)
dir_menu = info_menu_of_node (dir_node);
if (!dir_menu)
- return;
+ return NULL;
/* For every menu item in DIR, get the associated node's file buffer and
read the indices of that file buffer. Gather all of the indices into
@@ -441,54 +501,54 @@ apropos_in_all_indices (search_string, inform)
this_item = dir_menu[dir_index];
if (!this_item->filename)
- {
- if (dir_node->parent)
- this_item->filename = strdup (dir_node->parent);
- else
- this_item->filename = strdup (dir_node->filename);
- }
+ {
+ if (dir_node->parent)
+ this_item->filename = xstrdup (dir_node->parent);
+ else
+ this_item->filename = xstrdup (dir_node->filename);
+ }
/* Find this node. If we cannot find it, try using the label of the
- entry as a file (i.e., "(LABEL)Top"). */
+ entry as a file (i.e., "(LABEL)Top"). */
this_node = info_get_node (this_item->filename, this_item->nodename);
if (!this_node && this_item->nodename &&
- (strcmp (this_item->label, this_item->nodename) == 0))
- this_node = info_get_node (this_item->label, "Top");
+ (strcmp (this_item->label, this_item->nodename) == 0))
+ this_node = info_get_node (this_item->label, "Top");
if (!this_node)
- continue;
+ continue;
/* Get the file buffer associated with this node. */
{
- char *files_name;
+ char *files_name;
- files_name = this_node->parent;
- if (!files_name)
- files_name = this_node->filename;
+ files_name = this_node->parent;
+ if (!files_name)
+ files_name = this_node->filename;
- this_fb = info_find_file (files_name);
+ this_fb = info_find_file (files_name);
- if (this_fb && inform)
- message_in_echo_area ("Scanning indices of \"%s\"...", files_name);
+ if (this_fb && inform)
+ message_in_echo_area (_("Scanning indices of \"%s\"..."), files_name);
- this_index = info_indices_of_file_buffer (this_fb);
- free (this_node);
+ this_index = info_indices_of_file_buffer (this_fb);
+ free (this_node);
- if (this_fb && inform)
- unmessage_in_echo_area ();
+ if (this_fb && inform)
+ unmessage_in_echo_area ();
}
if (this_index)
- {
- /* Remember the filename which contains this set of references. */
- for (i = 0; this_index && this_index[i]; i++)
- if (!this_index[i]->filename)
- this_index[i]->filename = strdup (this_fb->filename);
-
- /* Concatenate with the other indices. */
- all_indices = info_concatenate_references (all_indices, this_index);
- }
+ {
+ /* Remember the filename which contains this set of references. */
+ for (i = 0; this_index && this_index[i]; i++)
+ if (!this_index[i]->filename)
+ this_index[i]->filename = xstrdup (this_fb->filename);
+
+ /* Concatenate with the other indices. */
+ all_indices = info_concatenate_references (all_indices, this_index);
+ }
}
info_free_references (dir_menu);
@@ -501,21 +561,21 @@ apropos_in_all_indices (search_string, inform)
int apropos_list_slots = 0;
for (i = 0; (entry = all_indices[i]); i++)
- {
- if (string_in_line (search_string, entry->label) != -1)
- {
- add_pointer_to_array
- (entry, apropos_list_index, apropos_list, apropos_list_slots,
- 100, REFERENCE *);
- }
- else
- {
- maybe_free (entry->label);
- maybe_free (entry->filename);
- maybe_free (entry->nodename);
- free (entry);
- }
- }
+ {
+ if (string_in_line (search_string, entry->label) != -1)
+ {
+ add_pointer_to_array
+ (entry, apropos_list_index, apropos_list, apropos_list_slots,
+ 100, REFERENCE *);
+ }
+ else
+ {
+ maybe_free (entry->label);
+ maybe_free (entry->filename);
+ maybe_free (entry->nodename);
+ free (entry);
+ }
+ }
free (all_indices);
all_indices = apropos_list;
@@ -524,7 +584,7 @@ apropos_in_all_indices (search_string, inform)
}
#define APROPOS_NONE \
- "No available info files reference \"%s\" in their indices."
+ _("No available info files reference \"%s\" in their indices.")
void
info_apropos (string)
@@ -544,8 +604,8 @@ info_apropos (string)
REFERENCE *entry;
for (i = 0; (entry = apropos_list[i]); i++)
- fprintf (stderr, "\"(%s)%s\" -- %s\n",
- entry->filename, entry->nodename, entry->label);
+ fprintf (stderr, "\"(%s)%s\" -- %s\n",
+ entry->filename, entry->nodename, entry->label);
}
info_free_references (apropos_list);
}
@@ -553,11 +613,11 @@ info_apropos (string)
static char *apropos_list_nodename = "*Apropos*";
DECLARE_INFO_COMMAND (info_index_apropos,
- "Grovel all known info file's indices for a string and build a menu")
+ _("Grovel all known info file's indices for a string and build a menu"))
{
char *line;
- line = info_read_in_echo_area (window, "Index apropos: ");
+ line = info_read_in_echo_area (window, _("Index apropos: "));
window = active_window;
@@ -577,85 +637,85 @@ DECLARE_INFO_COMMAND (info_index_apropos,
apropos_list = apropos_in_all_indices (line, 1);
if (!apropos_list)
- {
- info_error (APROPOS_NONE, line);
- }
+ {
+ info_error (APROPOS_NONE, line);
+ }
else
- {
- register int i;
- char *line_buffer;
-
- initialize_message_buffer ();
- printf_to_message_buffer
- ("\n* Menu: Nodes whoses indices contain \"%s\":\n", line);
- line_buffer = (char *)xmalloc (500);
-
- for (i = 0; apropos_list[i]; i++)
- {
- int len;
- sprintf (line_buffer, "* (%s)%s::",
- apropos_list[i]->filename, apropos_list[i]->nodename);
- len = pad_to (36, line_buffer);
- sprintf (line_buffer + len, "%s", apropos_list[i]->label);
- printf_to_message_buffer ("%s\n", line_buffer);
- }
- free (line_buffer);
- }
+ {
+ register int i;
+ char *line_buffer;
+
+ initialize_message_buffer ();
+ printf_to_message_buffer
+ (_("\n* Menu: Nodes whoses indices contain \"%s\":\n"), line);
+ line_buffer = (char *)xmalloc (500);
+
+ for (i = 0; apropos_list[i]; i++)
+ {
+ int len;
+ sprintf (line_buffer, "* (%s)%s::",
+ apropos_list[i]->filename, apropos_list[i]->nodename);
+ len = pad_to (36, line_buffer);
+ sprintf (line_buffer + len, "%s", apropos_list[i]->label);
+ printf_to_message_buffer ("%s\n", line_buffer);
+ }
+ free (line_buffer);
+ }
apropos_node = message_buffer_to_node ();
add_gcable_pointer (apropos_node->contents);
name_internal_node (apropos_node, apropos_list_nodename);
/* Even though this is an internal node, we don't want the window
- system to treat it specially. So we turn off the internalness
- of it here. */
+ system to treat it specially. So we turn off the internalness
+ of it here. */
apropos_node->flags &= ~N_IsInternal;
/* Find/Create a window to contain this node. */
{
- WINDOW *new;
- NODE *node;
-
- set_remembered_pagetop_and_point (window);
-
- /* If a window is visible and showing an apropos list already,
- re-use it. */
- for (new = windows; new; new = new->next)
- {
- node = new->node;
-
- if (internal_info_node_p (node) &&
- (strcmp (node->nodename, apropos_list_nodename) == 0))
- break;
- }
-
- /* If we couldn't find an existing window, try to use the next window
- in the chain. */
- if (!new && window->next)
- new = window->next;
-
- /* If we still don't have a window, make a new one to contain
- the list. */
- if (!new)
- {
- WINDOW *old_active;
-
- old_active = active_window;
- active_window = window;
- new = window_make_window ((NODE *)NULL);
- active_window = old_active;
- }
-
- /* If we couldn't make a new window, use this one. */
- if (!new)
- new = window;
-
- /* Lines do not wrap in this window. */
- new->flags |= W_NoWrap;
-
- window_set_node_of_window (new, apropos_node);
- remember_window_and_node (new, apropos_node);
- active_window = new;
+ WINDOW *new;
+ NODE *node;
+
+ set_remembered_pagetop_and_point (window);
+
+ /* If a window is visible and showing an apropos list already,
+ re-use it. */
+ for (new = windows; new; new = new->next)
+ {
+ node = new->node;
+
+ if (internal_info_node_p (node) &&
+ (strcmp (node->nodename, apropos_list_nodename) == 0))
+ break;
+ }
+
+ /* If we couldn't find an existing window, try to use the next window
+ in the chain. */
+ if (!new && window->next)
+ new = window->next;
+
+ /* If we still don't have a window, make a new one to contain
+ the list. */
+ if (!new)
+ {
+ WINDOW *old_active;
+
+ old_active = active_window;
+ active_window = window;
+ new = window_make_window ((NODE *)NULL);
+ active_window = old_active;
+ }
+
+ /* If we couldn't make a new window, use this one. */
+ if (!new)
+ new = window;
+
+ /* Lines do not wrap in this window. */
+ new->flags |= W_NoWrap;
+
+ window_set_node_of_window (new, apropos_node);
+ remember_window_and_node (new, apropos_node);
+ active_window = new;
}
info_free_references (apropos_list);
}
diff --git a/gnu/usr.bin/texinfo/info/indices.h b/gnu/usr.bin/texinfo/info/indices.h
index 265b1472ba8..bd0a7273cf9 100644
--- a/gnu/usr.bin/texinfo/info/indices.h
+++ b/gnu/usr.bin/texinfo/info/indices.h
@@ -1,9 +1,10 @@
-/* indices.h -- Functions defined in indices.c. */
+/* indices.h -- Functions defined in indices.c.
+ $Id: indices.h,v 1.2 1999/01/11 16:38:08 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
+ This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#if !defined (_INDICES_H_)
-#define _INDICES_H_
+#ifndef INFO_INDICES_H
+#define INFO_INDICES_H
/* User-visible variable controls the output of info-index-next. */
extern int show_index_match;
@@ -35,5 +36,7 @@ REFERENCE **apropos_in_all_indices ();
/* User visible functions declared in indices.c. */
extern void info_index_search (), info_next_index_match ();
+extern void do_info_index_search ();
+extern int index_intry_exists ();
-#endif /* !_INDICES_H_ */
+#endif /* not INFO_INDICES_H */
diff --git a/gnu/usr.bin/texinfo/info/info-utils.h b/gnu/usr.bin/texinfo/info/info-utils.h
index 5ca2e0c15cd..2b2d6c250b6 100644
--- a/gnu/usr.bin/texinfo/info/info-utils.h
+++ b/gnu/usr.bin/texinfo/info/info-utils.h
@@ -1,9 +1,10 @@
-/* info-utils.h -- Exported functions and variables from info-util.c. */
+/* info-utils.h -- Exported functions and variables from info-util.c.
+ $Id: info-utils.h,v 1.2 1999/01/11 16:38:08 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
+ This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 96 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#if !defined (_INFO_UTILS_H_)
-#define _INFO_UTILS_H_
+#ifndef INFO_UTILS_H
+#define INFO_UTILS_H
#if !defined (HAVE_STRCHR)
# undef strchr
@@ -31,11 +32,6 @@
# define strrchr rindex
#endif /* !HAVE_STRCHR */
-#if !defined (HAVE_MEMCPY)
-# undef memcpy
-# define memcpy(dest, source, count) bcopy(source, dest, count)
-#endif /* !HAVE_MEMCPY */
-
#include "nodes.h"
#include "window.h"
#include "search.h"
@@ -44,10 +40,10 @@
cross reference. Arrays of such references can be built by calling
info_menus_of_node () or info_xrefs_of_node (). */
typedef struct {
- char *label; /* User Label. */
- char *filename; /* File where this node can be found. */
- char *nodename; /* Name of the node. */
- int start, end; /* Offsets within the containing node of LABEL. */
+ char *label; /* User Label. */
+ char *filename; /* File where this node can be found. */
+ char *nodename; /* Name of the node. */
+ int start, end; /* Offsets within the containing node of LABEL. */
} REFERENCE;
/* When non-zero, various display and input functions handle ISO Latin
@@ -141,4 +137,4 @@ extern void info_parse_label (/* label, node */);
info_parse_label (INFO_ALTPREV_LABEL, n); \
} while (0)
-#endif /* !_INFO_UTILS_H_ */
+#endif /* not INFO_UTILS_H */
diff --git a/gnu/usr.bin/texinfo/info/info.c b/gnu/usr.bin/texinfo/info/info.c
index f00d71bb187..46763b0ee58 100644
--- a/gnu/usr.bin/texinfo/info/info.c
+++ b/gnu/usr.bin/texinfo/info/info.c
@@ -1,9 +1,7 @@
-/* info.c -- Display nodes of Info files in multiple windows. */
+/* info.c -- Display nodes of Info files in multiple windows.
+ $Id: info.c,v 1.2 1999/01/11 16:38:08 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 96, 97, 98 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,6 +20,7 @@
Written by Brian Fox (bfox@ai.mit.edu). */
#include "info.h"
+#include "indices.h"
#include "dribble.h"
#include "getopt.h"
#if defined (HANDLE_MAN_PAGES)
@@ -30,8 +29,10 @@
/* The version numbers of this version of Info. */
int info_major_version = 2;
-int info_minor_version = 14;
-int info_patch_level = 0;
+int info_minor_version = 18;
+
+/* basename (argv[0]) */
+static char *program_name = NULL;
/* Non-zero means search all indices for APROPOS_SEARCH_STRING. */
static int apropos_p = 0;
@@ -39,6 +40,14 @@ static int apropos_p = 0;
/* Variable containing the string to search for when apropos_p is non-zero. */
static char *apropos_search_string = (char *)NULL;
+/* Non-zero means search all indices for INDEX_SEARCH_STRING. Unlike
+ apropos, this puts the user at the node, running info. */
+static int index_search_p = 0;
+
+/* Variable containing the string to search for when index_search_p is
+ non-zero. */
+static char *index_search_string = (char *)NULL;
+
/* Non-zero means print version info only. */
static int print_version_p = 0;
@@ -70,6 +79,7 @@ int dump_subnodes = 0;
#define APROPOS_OPTION 1
#define DRIBBLE_OPTION 2
#define RESTORE_OPTION 3
+#define IDXSRCH_OPTION 4
static struct option long_options[] = {
{ "apropos", 1, 0, APROPOS_OPTION },
{ "directory", 1, 0, 'd' },
@@ -81,6 +91,7 @@ static struct option long_options[] = {
{ "version", 0, &print_version_p, 1 },
{ "dribble", 1, 0, DRIBBLE_OPTION },
{ "restore", 1, 0, RESTORE_OPTION },
+ { "index-search", 1, 0, IDXSRCH_OPTION },
{NULL, 0, NULL, 0}
};
@@ -91,13 +102,13 @@ static char *short_options = "d:n:f:o:s";
int info_windows_initialized_p = 0;
/* Some "forward" declarations. */
-static void usage (), info_short_help (), remember_info_program_name ();
+static void info_short_help (), remember_info_program_name ();
/* **************************************************************** */
-/* */
-/* Main Entry Point to the Info Program */
-/* */
+/* */
+/* Main Entry Point to the Info Program */
+/* */
/* **************************************************************** */
int
@@ -105,85 +116,102 @@ main (argc, argv)
int argc;
char **argv;
{
- int getopt_long_index; /* Index returned by getopt_long (). */
- NODE *initial_node; /* First node loaded by Info. */
+ int getopt_long_index; /* Index returned by getopt_long (). */
+ NODE *initial_node; /* First node loaded by Info. */
remember_info_program_name (argv[0]);
+#ifdef HAVE_SETLOCALE
+ /* Set locale via LC_ALL. */
+ setlocale (LC_ALL, "");
+#endif
+
+ /* Set the text message domain. */
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
while (1)
{
int option_character;
option_character = getopt_long
- (argc, argv, short_options, long_options, &getopt_long_index);
+ (argc, argv, short_options, long_options, &getopt_long_index);
/* getopt_long () returns EOF when there are no more long options. */
if (option_character == EOF)
- break;
+ break;
/* If this is a long option, then get the short version of it. */
if (option_character == 0 && long_options[getopt_long_index].flag == 0)
- option_character = long_options[getopt_long_index].val;
+ option_character = long_options[getopt_long_index].val;
/* Case on the option that we have received. */
switch (option_character)
- {
- case 0:
- break;
-
- /* User wants to add a directory. */
- case 'd':
- info_add_path (optarg, INFOPATH_PREPEND);
- break;
-
- /* User is specifying a particular node. */
- case 'n':
- add_pointer_to_array (optarg, user_nodenames_index, user_nodenames,
- user_nodenames_slots, 10, char *);
- break;
-
- /* User is specifying a particular Info file. */
- case 'f':
- if (user_filename)
- free (user_filename);
-
- user_filename = strdup (optarg);
- break;
-
- /* User is specifying the name of a file to output to. */
- case 'o':
- if (user_output_filename)
- free (user_output_filename);
- user_output_filename = strdup (optarg);
- break;
-
- /* User is specifying that she wishes to dump the subnodes of
- the node that she is dumping. */
- case 's':
- dump_subnodes = 1;
- break;
-
- /* User has specified a string to search all indices for. */
- case APROPOS_OPTION:
- apropos_p = 1;
- maybe_free (apropos_search_string);
- apropos_search_string = strdup (optarg);
- break;
-
- /* User has specified a dribble file to receive keystrokes. */
- case DRIBBLE_OPTION:
- close_dribble_file ();
- open_dribble_file (optarg);
- break;
-
- /* User has specified an alternate input stream. */
- case RESTORE_OPTION:
- info_set_input_from_file (optarg);
- break;
-
- default:
- usage ();
- }
+ {
+ case 0:
+ break;
+
+ /* User wants to add a directory. */
+ case 'd':
+ info_add_path (optarg, INFOPATH_PREPEND);
+ break;
+
+ /* User is specifying a particular node. */
+ case 'n':
+ add_pointer_to_array (optarg, user_nodenames_index, user_nodenames,
+ user_nodenames_slots, 10, char *);
+ break;
+
+ /* User is specifying a particular Info file. */
+ case 'f':
+ if (user_filename)
+ free (user_filename);
+
+ user_filename = xstrdup (optarg);
+ break;
+
+ /* User is specifying the name of a file to output to. */
+ case 'o':
+ if (user_output_filename)
+ free (user_output_filename);
+ user_output_filename = xstrdup (optarg);
+ break;
+
+ /* User is specifying that she wishes to dump the subnodes of
+ the node that she is dumping. */
+ case 's':
+ dump_subnodes = 1;
+ break;
+
+ /* User has specified a string to search all indices for. */
+ case APROPOS_OPTION:
+ apropos_p = 1;
+ maybe_free (apropos_search_string);
+ apropos_search_string = xstrdup (optarg);
+ break;
+
+ /* User has specified a dribble file to receive keystrokes. */
+ case DRIBBLE_OPTION:
+ close_dribble_file ();
+ open_dribble_file (optarg);
+ break;
+
+ /* User has specified an alternate input stream. */
+ case RESTORE_OPTION:
+ info_set_input_from_file (optarg);
+ break;
+
+ /* User has specified a string to search all indices for. */
+ case IDXSRCH_OPTION:
+ index_search_p = 1;
+ maybe_free (index_search_string);
+ index_search_string = xstrdup (optarg);
+ break;
+
+ default:
+ fprintf (stderr, _("Try --help for more information."));
+ exit (1);
+ }
}
/* If the output device is not a terminal, and no output filename has been
@@ -191,14 +219,20 @@ main (argc, argv)
to stdout, and turn on the dumping of subnodes. */
if ((!isatty (fileno (stdout))) && (user_output_filename == (char *)NULL))
{
- user_output_filename = strdup ("-");
+ user_output_filename = xstrdup ("-");
dump_subnodes = 1;
}
/* If the user specified --version, then show the version and exit. */
if (print_version_p)
{
- printf ("GNU Info, Version %s.\n", version_string ());
+ printf ("%s (GNU %s %s) %s\n", program_name, PACKAGE, VERSION,
+ version_string ());
+ printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
+There is NO warranty. You may redistribute this software\n\
+under the terms of the GNU General Public License.\n\
+For more information about these matters, see the files named COPYING.\n"),
+ "1998");
exit (0);
}
@@ -209,34 +243,49 @@ main (argc, argv)
exit (0);
}
- /* If the user hasn't specified a path for Info files, default that path
- now. */
+ /* If the user hasn't specified a path for Info files, default it.
+ Lowest priority is our messy hardwired list in filesys.h.
+ Then comes the user's INFODIR from the Makefile.
+ Highest priority is the environment variable, if set. */
if (!infopath)
{
- char *path_from_env, *getenv ();
-
- path_from_env = getenv ("INFOPATH");
+ char *path_from_env = getenv ("INFOPATH");
if (path_from_env)
- info_add_path (path_from_env, INFOPATH_PREPEND);
+ {
+ unsigned len = strlen (path_from_env);
+ /* Trailing : on INFOPATH means insert the default path. */
+ if (len && path_from_env[len - 1] == ':')
+ {
+ path_from_env[len - 1] = 0;
+ info_add_path (DEFAULT_INFOPATH, INFOPATH_PREPEND);
+ }
+#ifdef INFODIR /* from the Makefile */
+ info_add_path (INFODIR, INFOPATH_PREPEND);
+#endif
+ info_add_path (path_from_env, INFOPATH_PREPEND);
+ }
else
- info_add_path (DEFAULT_INFOPATH, INFOPATH_PREPEND);
+ {
+ info_add_path (DEFAULT_INFOPATH, INFOPATH_PREPEND);
+#ifdef INFODIR /* from the Makefile */
+ info_add_path (INFODIR, INFOPATH_PREPEND);
+#endif
+ }
}
/* If the user specified a particular filename, add the path of that
file to the contents of INFOPATH. */
if (user_filename)
{
- char *directory_name, *temp;
-
- directory_name = strdup (user_filename);
- temp = filename_non_directory (directory_name);
+ char *directory_name = xstrdup (user_filename);
+ char *temp = filename_non_directory (directory_name);
if (temp != directory_name)
- {
- *temp = 0;
- info_add_path (directory_name, INFOPATH_PREPEND);
- }
+ {
+ *temp = 0;
+ info_add_path (directory_name, INFOPATH_PREPEND);
+ }
free (directory_name);
}
@@ -251,39 +300,74 @@ main (argc, argv)
/* Get the initial Info node. It is either "(dir)Top", or what the user
specifed with values in user_filename and user_nodenames. */
- if (user_nodenames)
- initial_node = info_get_node (user_filename, user_nodenames[0]);
- else
- initial_node = info_get_node (user_filename, (char *)NULL);
+ initial_node = info_get_node (user_filename,
+ user_nodenames ? user_nodenames[0] : NULL);
/* If we couldn't get the initial node, this user is in trouble. */
if (!initial_node)
{
if (info_recent_file_error)
- info_error (info_recent_file_error);
+ info_error (info_recent_file_error);
else
- info_error
- (CANT_FIND_NODE, user_nodenames ? user_nodenames[0] : "Top");
+ info_error
+ (CANT_FIND_NODE, user_nodenames ? user_nodenames[0] : "Top");
exit (1);
}
- /* Special cases for when the user specifies multiple nodes. If we are
- dumping to an output file, dump all of the nodes specified. Otherwise,
- attempt to create enough windows to handle the nodes that this user wants
- displayed. */
+ /* Special cases for when the user specifies multiple nodes. If we
+ are dumping to an output file, dump all of the nodes specified.
+ Otherwise, attempt to create enough windows to handle the nodes
+ that this user wants displayed. */
if (user_nodenames_index > 1)
{
free (initial_node);
if (user_output_filename)
- dump_nodes_to_file
- (user_filename, user_nodenames, user_output_filename, dump_subnodes);
+ dump_nodes_to_file
+ (user_filename, user_nodenames, user_output_filename, dump_subnodes);
else
- begin_multiple_window_info_session (user_filename, user_nodenames);
+ begin_multiple_window_info_session (user_filename, user_nodenames);
exit (0);
}
+ /* If the user specified `--index-search=STRING', start the info
+ session in the node corresponding to the first match. */
+ if (index_search_p)
+ {
+ int status = 0;
+
+ initialize_info_session (initial_node, 0);
+
+ if (index_entry_exists (windows, index_search_string))
+ {
+ terminal_clear_screen ();
+ terminal_prep_terminal ();
+ display_update_display (windows);
+ info_last_executed_command = (VFunction *)NULL;
+
+ do_info_index_search (windows, 0, index_search_string);
+
+ info_read_and_dispatch ();
+
+ terminal_unprep_terminal ();
+
+ /* On program exit, leave the cursor at the bottom of the
+ window, and restore the terminal IO. */
+ terminal_goto_xy (0, screenheight - 1);
+ terminal_clear_to_eol ();
+ fflush (stdout);
+ }
+ else
+ {
+ fputs (_("no entries found\n"), stderr);
+ status = 2;
+ }
+
+ close_dribble_file ();
+ exit (status);
+ }
+
/* If there are arguments remaining, they are the names of menu items
in sequential info files starting from the first one loaded. That
file name is either "dir", or the contents of user_filename if one
@@ -299,125 +383,134 @@ main (argc, argv)
/* Remember the name of the menu entry we want. */
arg = argv[optind++];
- if (first_arg == (char *)NULL)
- first_arg = arg;
+ if (!first_arg)
+ first_arg = arg;
/* Build and return a list of the menu items in this node. */
menu = info_menu_of_node (initial_node);
/* If there wasn't a menu item in this node, stop here, but let
- the user continue to use Info. Perhaps they wanted this node
- and didn't realize it. */
+ the user continue to use Info. Perhaps they wanted this node
+ and didn't realize it. */
if (!menu)
- {
+ {
#if defined (HANDLE_MAN_PAGES)
- if (first_arg == arg)
- {
- node = make_manpage_node (first_arg);
- if (node)
- goto maybe_got_node;
- }
+ if (first_arg == arg)
+ {
+ node = make_manpage_node (first_arg);
+ if (node)
+ goto maybe_got_node;
+ }
#endif /* HANDLE_MAN_PAGES */
- begin_info_session_with_error
- (initial_node, "There is no menu in this node.");
- exit (0);
- }
+ begin_info_session_with_error
+ (initial_node, _("There is no menu in this node."));
+ exit (0);
+ }
/* Find the specified menu item. */
entry = info_get_labeled_reference (arg, menu);
/* If the item wasn't found, search the list sloppily. Perhaps this
- user typed "buffer" when they really meant "Buffers". */
+ user typed "buffer" when they really meant "Buffers". */
if (!entry)
- {
- register int i;
-
- for (i = 0; entry = menu[i]; i++)
- if (strncasecmp (entry->label, arg, strlen (arg)) == 0)
- break;
- }
+ {
+ register int i;
+ int best_guess = -1;
+
+ for (i = 0; (entry = menu[i]); i++)
+ {
+ if (strcasecmp (entry->label, arg) == 0)
+ break;
+ else
+ if (strncasecmp (entry->label, arg, strlen (arg)) == 0)
+ best_guess = i;
+ }
+
+ if (!entry && best_guess != -1)
+ entry = menu[best_guess];
+ }
/* If we failed to find the reference, start Info with the current
- node anyway. It is probably a misspelling. */
+ node anyway. It is probably a misspelling. */
if (!entry)
- {
- char *error_message = "There is no menu item \"%s\" in this node.";
+ {
+ char *error_message = _("There is no menu item \"%s\" in this node.");
#if defined (HANDLE_MAN_PAGES)
- if (first_arg == arg)
- {
- node = make_manpage_node (first_arg);
- if (node)
- goto maybe_got_node;
- }
+ if (first_arg == arg)
+ {
+ node = make_manpage_node (first_arg);
+ if (node)
+ goto maybe_got_node;
+ }
#endif /* HANDLE_MAN_PAGES */
- info_free_references (menu);
+ info_free_references (menu);
- /* If we were supposed to dump this node, complain. */
- if (user_output_filename)
- info_error (error_message, arg);
- else
- begin_info_session_with_error (initial_node, error_message, arg);
+ /* If we were supposed to dump this node, complain. */
+ if (user_output_filename)
+ info_error (error_message, arg);
+ else
+ begin_info_session_with_error (initial_node, error_message, arg);
- exit (0);
- }
+ exit (0);
+ }
/* We have found the reference that the user specified. Clean it
- up a little bit. */
+ up a little bit. */
if (!entry->filename)
- {
- if (initial_node->parent)
- entry->filename = strdup (initial_node->parent);
- else
- entry->filename = strdup (initial_node->filename);
- }
+ {
+ if (initial_node->parent)
+ entry->filename = xstrdup (initial_node->parent);
+ else
+ entry->filename = xstrdup (initial_node->filename);
+ }
/* Find this node. If we can find it, then turn the initial_node
- into this one. If we cannot find it, try using the label of the
- entry as a file (i.e., "(LABEL)Top"). Otherwise the Info file is
- malformed in some way, and we will just use the current value of
- initial node. */
+ into this one. If we cannot find it, try using the label of the
+ entry as a file (i.e., "(LABEL)Top"). Otherwise the Info file is
+ malformed in some way, and we will just use the current value of
+ initial node. */
node = info_get_node (entry->filename, entry->nodename);
#if defined (HANDLE_MAN_PAGES)
- if ((first_arg == arg) && !node)
- {
- node = make_manpage_node (first_arg);
- if (node)
- goto maybe_got_node;
- }
+ if ((first_arg == arg) && !node)
+ {
+ node = make_manpage_node (first_arg);
+ if (node)
+ goto maybe_got_node;
+ }
#endif /* HANDLE_MAN_PAGES */
if (!node && entry->nodename &&
- (strcmp (entry->label, entry->nodename) == 0))
- node = info_get_node (entry->label, "Top");
+ (strcmp (entry->label, entry->nodename) == 0))
+ node = info_get_node (entry->label, "Top");
maybe_got_node:
if (node)
- {
- free (initial_node);
- initial_node = node;
- info_free_references (menu);
- }
+ {
+ free (initial_node);
+ initial_node = node;
+ info_free_references (menu);
+ }
else
- {
- char *temp = strdup (entry->label);
- char *error_message;
+ {
+ char *temp = xstrdup (entry->label);
+ char *error_message;
- error_message = "Unable to find the node referenced by \"%s\".";
+ error_message = _("Unable to find the node referenced by \"%s\".");
- info_free_references (menu);
+ info_free_references (menu);
- /* If we were trying to dump the node, then give up. Otherwise,
- start the session with an error message. */
- if (user_output_filename)
- info_error (error_message, temp);
- else
- begin_info_session_with_error (initial_node, error_message, temp);
+ /* If we were trying to dump the node, then give up. Otherwise,
+ start the session with an error message. */
+ if (user_output_filename)
+ info_error (error_message, temp);
+ else
+ begin_info_session_with_error (initial_node, error_message, temp);
- exit (0);
- }
+ exit (0);
+ }
}
/* If the user specified that this node should be output, then do that
@@ -440,19 +533,12 @@ version_string ()
{
vstring = (char *)xmalloc (50);
sprintf (vstring, "%d.%d", info_major_version, info_minor_version);
- if (info_patch_level)
- sprintf (vstring + strlen (vstring), "-p%d", info_patch_level);
}
return (vstring);
}
-
-/* **************************************************************** */
-/* */
-/* Error Handling for Info */
-/* */
-/* **************************************************************** */
-static char *program_name = (char *)NULL;
+
+/* Error handling. */
static void
remember_info_program_name (fullpath)
@@ -461,7 +547,7 @@ remember_info_program_name (fullpath)
char *filename;
filename = filename_non_directory (fullpath);
- program_name = strdup (filename);
+ program_name = xstrdup (filename);
}
/* Non-zero if an error has been signalled. */
@@ -490,61 +576,52 @@ info_error (format, arg1, arg2)
else
{
if (!echo_area_is_active)
- {
- if (info_error_rings_bell_p)
- terminal_ring_bell ();
- window_message_in_echo_area (format, arg1, arg2);
- }
+ {
+ if (info_error_rings_bell_p)
+ terminal_ring_bell ();
+ window_message_in_echo_area (format, arg1, arg2);
+ }
else
- {
- NODE *temp;
-
- temp = build_message_node (format, arg1, arg2);
- if (info_error_rings_bell_p)
- terminal_ring_bell ();
- inform_in_echo_area (temp->contents);
- free (temp->contents);
- free (temp);
- }
+ {
+ NODE *temp;
+
+ temp = build_message_node (format, arg1, arg2);
+ if (info_error_rings_bell_p)
+ terminal_ring_bell ();
+ inform_in_echo_area (temp->contents);
+ free (temp->contents);
+ free (temp);
+ }
}
}
-/* Produce a very brief descripton of the available options and exit with
- an error. */
-static void
-usage ()
-{
- fprintf (stderr,"%s\n%s\n%s\n%s\n%s\n",
-"Usage: info [-d dir-path] [-f info-file] [-o output-file] [-n node-name]...",
-" [--directory dir-path] [--file info-file] [--node node-name]...",
-" [--help] [--output output-file] [--subnodes] [--version]",
-" [--dribble dribble-file] [--restore from-file]",
-" [menu-selection ...]");
- exit (1);
-}
-
/* Produce a scaled down description of the available options to Info. */
static void
info_short_help ()
{
- printf ("%s", "\
-Here is a quick description of Info's options. For a more complete\n\
-description of how to use Info, type `info info options'.\n\
+ printf (_("\
+Usage: %s [OPTION]... [INFO-FILE [MENU-ITEM...]]\n\
+\n\
+Read documentation in Info format.\n\
+For more complete documentation on how to use Info, run `info info options'.\n\
+\n\
+Options:\n\
+--directory DIR add DIR to INFOPATH.\n\
+--dribble FILENAME remember user keystrokes in FILENAME.\n\
+--file FILENAME specify Info file to visit.\n\
+--node NODENAME specify nodes in first visited Info file.\n\
+--output FILENAME output selected nodes to FILENAME.\n\
+--restore FILENAME read initial keystrokes from FILENAME.\n\
+--subnodes recursively output menu items.\n\
+--help display this help and exit.\n\
+--version display version information and exit.\n\
\n\
- --directory DIR Add DIR to INFOPATH.\n\
- --file FILENAME Specify Info file to visit.\n\
- --node NODENAME Specify nodes in first visited Info file.\n\
- --output FILENAME Output selected nodes to FILENAME.\n\
- --dribble FILENAME Remember user keystrokes in FILENAME.\n\
- --restore FILENAME Read initial keystrokes from FILENAME.\n\
- --subnodes Recursively output menu items.\n\
- --help Get this help message.\n\
- --version Display Info's version information.\n\
+The first argument, if present, is the name of the Info file to read.\n\
+Any remaining arguments are treated as the names of menu\n\
+items in the initial node visited. For example, `info emacs buffers'\n\
+moves to the node `buffers' in the info file `emacs'.\n\
\n\
-Remaining arguments to Info are treated as the names of menu\n\
-items in the initial node visited. You can easily move to the\n\
-node of your choice by specifying the menu names which describe\n\
-the path to that node. For example, `info emacs buffers'.\n");
+Email bug reports to bug-texinfo@gnu.org."), program_name);
exit (0);
}
diff --git a/gnu/usr.bin/texinfo/info/info.h b/gnu/usr.bin/texinfo/info/info.h
index a8759227758..1be7f299e91 100644
--- a/gnu/usr.bin/texinfo/info/info.h
+++ b/gnu/usr.bin/texinfo/info/info.h
@@ -1,9 +1,10 @@
-/* info.h -- Header file which includes all of the other headers. */
+/* info.h -- Header file which includes all of the other headers.
+ $Id: info.h,v 1.2 1999/01/11 16:38:08 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
+ This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,33 +22,86 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#if !defined (_INFO_H_)
-#define _INFO_H_
+#if !defined (INFO_H)
+#define INFO_H
+
+/* We always want these, so why clutter up the compile command? */
+#define HANDLE_MAN_PAGES
+#define NAMED_FUNCTIONS
+
+/* System dependencies. */
+#include "system.h"
+
+/* Some of our other include files use these. */
+typedef int Function ();
+typedef void VFunction ();
+typedef char *CFunction ();
+
-#include <stdio.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#if defined (HAVE_STRING_H)
-#include <string.h>
-#endif /* HAVE_STRING_H */
#include "filesys.h"
#include "display.h"
#include "session.h"
-#include "echo_area.h"
+#include "echo-area.h"
#include "doc.h"
#include "footnotes.h"
#include "gc.h"
+#define info_toupper(x) (islower (x) ? toupper (x) : x)
+#define info_tolower(x) (isupper (x) ? tolower (x) : x)
+
+#if !defined (whitespace)
+# define whitespace(c) ((c == ' ') || (c == '\t'))
+#endif /* !whitespace */
+
+#if !defined (whitespace_or_newline)
+# define whitespace_or_newline(c) (whitespace (c) || (c == '\n'))
+#endif /* !whitespace_or_newline */
+
+/* Add POINTER to the list of pointers found in ARRAY. SLOTS is the number
+ of slots that have already been allocated. INDEX is the index into the
+ array where POINTER should be added. GROW is the number of slots to grow
+ ARRAY by, in the case that it needs growing. TYPE is a cast of the type
+ of object stored in ARRAY (e.g., NODE_ENTRY *. */
+#define add_pointer_to_array(pointer, idx, array, slots, grow, type) \
+ do { \
+ if (idx + 2 >= slots) \
+ array = (type *)(xrealloc (array, (slots += grow) * sizeof (type))); \
+ array[idx++] = (type)pointer; \
+ array[idx] = (type)NULL; \
+ } while (0)
+
+#define maybe_free(x) do { if (x) free (x); } while (0)
+
+#if !defined (zero_mem) && defined (HAVE_MEMSET)
+# define zero_mem(mem, length) memset (mem, 0, length)
+#endif /* !zero_mem && HAVE_MEMSET */
+
+#if !defined (zero_mem) && defined (HAVE_BZERO)
+# define zero_mem(mem, length) bzero (mem, length)
+#endif /* !zero_mem && HAVE_BZERO */
+
+#if !defined (zero_mem)
+# define zero_mem(mem, length) \
+ do { \
+ register int zi; \
+ register unsigned char *place; \
+ \
+ place = (unsigned char *)mem; \
+ for (zi = 0; zi < length; zi++) \
+ place[zi] = 0; \
+ } while (0)
+#endif /* !zero_mem */
+
+
/* A structure associating the nodes visited in a particular window. */
typedef struct {
- WINDOW *window; /* The window that this list is attached to. */
- NODE **nodes; /* Array of nodes visited in this window. */
- int *pagetops; /* For each node in NODES, the pagetop. */
- long *points; /* For each node in NODES, the point. */
- int current; /* Index in NODES of the current node. */
- int nodes_index; /* Index where to add the next node. */
- int nodes_slots; /* Number of slots allocated to NODES. */
+ WINDOW *window; /* The window that this list is attached to. */
+ NODE **nodes; /* Array of nodes visited in this window. */
+ int *pagetops; /* For each node in NODES, the pagetop. */
+ long *points; /* For each node in NODES, the point. */
+ int current; /* Index in NODES of the current node. */
+ int nodes_index; /* Index where to add the next node. */
+ int nodes_slots; /* Number of slots allocated to NODES. */
} INFO_WINDOW;
/* Array of structures describing for each window which nodes have been
@@ -71,30 +125,41 @@ extern int info_error_rings_bell_p;
extern void info_error ();
/* The version numbers of Info. */
-extern int info_major_version, info_minor_version, info_patch_level;
+extern int info_major_version, info_minor_version;
/* How to get the version string for this version of Info. Returns
something similar to "2.11". */
extern char *version_string ();
/* Error message defines. */
-#define CANT_FIND_NODE "Cannot find the node \"%s\"."
-#define CANT_FILE_NODE "Cannot find the node \"(%s)%s\"."
-#define CANT_FIND_WIND "Cannot find a window!"
-#define CANT_FIND_POINT "Point doesn't appear within this window's node!"
-#define CANT_KILL_LAST "Cannot delete the last window."
-#define NO_MENU_NODE "No menu in this node."
-#define NO_FOOT_NODE "No footnotes in this node."
-#define NO_XREF_NODE "No cross references in this node."
-#define NO_POINTER "No \"%s\" pointer for this node."
-#define UNKNOWN_COMMAND "Unknown Info command `%c'. `?' for help."
-#define TERM_TOO_DUMB "Terminal type \"%s\" is not smart enough to run Info."
-#define AT_NODE_BOTTOM "You are already at the last page of this node."
-#define AT_NODE_TOP "You are already at the first page of this node."
-#define ONE_WINDOW "Only one window."
-#define WIN_TOO_SMALL "Resulting window would be too small."
-#define CANT_MAKE_HELP \
-"There isn't enough room to make a help window. Please delete a window."
-
-#endif /* !_INFO_H_ */
+#define CANT_FIND_NODE _("Cannot find the node \"%s\".")
+#define CANT_FILE_NODE _("Cannot find the node \"(%s)%s\".")
+#define CANT_FIND_WIND _("Cannot find a window!")
+#define CANT_FIND_POINT _("Point doesn't appear within this window's node!")
+#define CANT_KILL_LAST _("Cannot delete the last window.")
+#define NO_MENU_NODE _("No menu in this node.")
+#define NO_FOOT_NODE _("No footnotes in this node.")
+#define NO_XREF_NODE _("No cross references in this node.")
+#define NO_POINTER _("No \"%s\" pointer for this node.")
+#define UNKNOWN_COMMAND _("Unknown Info command `%c'. `?' for help.")
+#define TERM_TOO_DUMB _("Terminal type \"%s\" is not smart enough to run Info.")
+#define AT_NODE_BOTTOM _("You are already at the last page of this node.")
+#define AT_NODE_TOP _("You are already at the first page of this node.")
+#define ONE_WINDOW _("Only one window.")
+#define WIN_TOO_SMALL _("Resulting window would be too small.")
+#define CANT_MAKE_HELP \
+_("There isn't enough room to make a help window. Please delete a window.")
+
+
+/* Found in info-utils.c. */
+extern char *filename_non_directory ();
+
+#if !defined (BUILDING_LIBRARY)
+/* Found in session.c */
+extern int info_windows_initialized_p;
+
+/* Found in window.c. */
+extern void message_in_echo_area (), unmessage_in_echo_area ();
+#endif /* !BUILDING_LIBRARY */
+#endif /* !INFO_H */
diff --git a/gnu/usr.bin/texinfo/info/infodoc.c b/gnu/usr.bin/texinfo/info/infodoc.c
index 35675095e70..90aa2f19ded 100644
--- a/gnu/usr.bin/texinfo/info/infodoc.c
+++ b/gnu/usr.bin/texinfo/info/infodoc.c
@@ -1,9 +1,7 @@
-/* infodoc.c -- Functions which build documentation nodes. */
+/* infodoc.c -- Functions which build documentation nodes.
+ $Id: infodoc.c,v 1.2 1999/01/11 16:38:08 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -33,9 +31,9 @@
/* #define HELP_NODE_GETS_REGENERATED 1 */
/* **************************************************************** */
-/* */
-/* Info Help Windows */
-/* */
+/* */
+/* Info Help Windows */
+/* */
/* **************************************************************** */
/* The name of the node used in the help window. */
@@ -49,10 +47,12 @@ static char *internal_info_help_node_contents = (char *)NULL;
/* The static text which appears in the internal info help node. */
static char *info_internal_help_text[] = {
- "Basic Commands in Info Windows",
+ N_ ("Basic Commands in Info Windows"),
"******************************",
"",
- " h Invoke the Info tutorial.",
+ " h Invoke the Info tutorial.",
+ " CTRL-x 0 Quit this help.",
+ " q Quit Info altogether.",
"",
"Selecting other nodes:",
"----------------------",
@@ -72,9 +72,8 @@ static char *info_internal_help_text[] = {
" b Go to the beginning of this node.",
" e Go to the end of this node.",
"",
- "\"Advanced\" commands:",
+ "Other commands:",
"--------------------",
- " q Quit Info.",
" 1 Pick first item in node's menu.",
" 2-9 Pick second ... ninth item in node's menu.",
" 0 Pick last item in node's menu.",
@@ -82,7 +81,7 @@ static char *info_internal_help_text[] = {
" You may include a filename as well, as in (FILENAME)NODENAME.",
" s Search through this Info file for a specified string,",
" and select the node in which the next occurrence is found.",
- (char *)NULL
+ NULL
};
static char *where_is (), *where_is_internal ();
@@ -97,70 +96,70 @@ dump_map_to_message_buffer (prefix, map)
for (i = 0; i < 256; i++)
{
if (map[i].type == ISKMAP)
- {
- char *new_prefix, *keyname;
+ {
+ char *new_prefix, *keyname;
- keyname = pretty_keyname (i);
- new_prefix = (char *)
- xmalloc (3 + strlen (prefix) + strlen (keyname));
- sprintf (new_prefix, "%s%s%s ", prefix, *prefix ? " " : "", keyname);
+ keyname = pretty_keyname (i);
+ new_prefix = (char *)
+ xmalloc (3 + strlen (prefix) + strlen (keyname));
+ sprintf (new_prefix, "%s%s%s ", prefix, *prefix ? " " : "", keyname);
- dump_map_to_message_buffer (new_prefix, (Keymap)map[i].function);
- free (new_prefix);
- }
+ dump_map_to_message_buffer (new_prefix, (Keymap)map[i].function);
+ free (new_prefix);
+ }
else if (map[i].function)
- {
- register int last;
- char *doc, *name;
-
- doc = function_documentation (map[i].function);
- name = function_name (map[i].function);
-
- if (!*doc)
- continue;
-
- /* Find out if there is a series of identical functions, as in
- ea_insert (). */
- for (last = i + 1; last < 256; last++)
- if ((map[last].type != ISFUNC) ||
- (map[last].function != map[i].function))
- break;
-
- if (last - 1 != i)
- {
- printf_to_message_buffer
- ("%s%s .. ", prefix, pretty_keyname (i));
- printf_to_message_buffer
- ("%s%s\t", prefix, pretty_keyname (last - 1));
- i = last - 1;
- }
- else
- printf_to_message_buffer ("%s%s\t", prefix, pretty_keyname (i));
+ {
+ register int last;
+ char *doc, *name;
+
+ doc = function_documentation (map[i].function);
+ name = function_name (map[i].function);
+
+ if (!*doc)
+ continue;
+
+ /* Find out if there is a series of identical functions, as in
+ ea_insert (). */
+ for (last = i + 1; last < 256; last++)
+ if ((map[last].type != ISFUNC) ||
+ (map[last].function != map[i].function))
+ break;
+
+ if (last - 1 != i)
+ {
+ printf_to_message_buffer
+ ("%s%s .. ", prefix, pretty_keyname (i));
+ printf_to_message_buffer
+ ("%s%s\t", prefix, pretty_keyname (last - 1));
+ i = last - 1;
+ }
+ else
+ printf_to_message_buffer ("%s%s\t", prefix, pretty_keyname (i));
#if defined (NAMED_FUNCTIONS)
- /* Print the name of the function, and some padding before the
- documentation string is printed. */
- {
- int length_so_far;
- int desired_doc_start = 40; /* Must be multiple of 8. */
-
- printf_to_message_buffer ("(%s)", name);
- length_so_far = message_buffer_length_this_line ();
-
- if ((desired_doc_start + strlen (doc)) >= the_screen->width)
- printf_to_message_buffer ("\n ");
- else
- {
- while (length_so_far < desired_doc_start)
- {
- printf_to_message_buffer ("\t");
- length_so_far += character_width ('\t', length_so_far);
- }
- }
- }
+ /* Print the name of the function, and some padding before the
+ documentation string is printed. */
+ {
+ int length_so_far;
+ int desired_doc_start = 40; /* Must be multiple of 8. */
+
+ printf_to_message_buffer ("(%s)", name);
+ length_so_far = message_buffer_length_this_line ();
+
+ if ((desired_doc_start + strlen (doc)) >= the_screen->width)
+ printf_to_message_buffer ("\n ");
+ else
+ {
+ while (length_so_far < desired_doc_start)
+ {
+ printf_to_message_buffer ("\t");
+ length_so_far += character_width ('\t', length_so_far);
+ }
+ }
+ }
#endif /* NAMED_FUNCTIONS */
- printf_to_message_buffer ("%s\n", doc);
- }
+ printf_to_message_buffer ("%s\n", doc);
+ }
}
}
@@ -184,7 +183,7 @@ create_internal_info_help_node ()
initialize_message_buffer ();
for (i = 0; info_internal_help_text[i]; i++)
- printf_to_message_buffer ("%s\n", info_internal_help_text[i]);
+ printf_to_message_buffer ("%s\n", info_internal_help_text[i]);
printf_to_message_buffer ("---------------------\n\n");
printf_to_message_buffer ("The current search path is:\n");
@@ -199,34 +198,34 @@ create_internal_info_help_node ()
#if defined (NAMED_FUNCTIONS)
/* Get a list of the M-x commands which have no keystroke equivs. */
for (i = 0; function_doc_array[i].func; i++)
- {
- VFunction *func = function_doc_array[i].func;
-
- if ((!where_is_internal (info_keymap, func)) &&
- (!where_is_internal (echo_area_keymap, func)))
- {
- if (!printed_one_mx)
- {
- printf_to_message_buffer ("---------------------\n\n");
- printf_to_message_buffer
- ("The following commands can only be invoked via M-x:\n\n");
- printed_one_mx = 1;
- }
-
- printf_to_message_buffer
- ("M-x %s\n %s\n",
- function_doc_array[i].func_name,
- replace_in_documentation (function_doc_array[i].doc));
- }
- }
+ {
+ VFunction *func = function_doc_array[i].func;
+
+ if ((!where_is_internal (info_keymap, func)) &&
+ (!where_is_internal (echo_area_keymap, func)))
+ {
+ if (!printed_one_mx)
+ {
+ printf_to_message_buffer ("---------------------\n\n");
+ printf_to_message_buffer
+ (_("The following commands can only be invoked via M-x:\n\n"));
+ printed_one_mx = 1;
+ }
+
+ printf_to_message_buffer
+ ("M-x %s\n %s\n",
+ function_doc_array[i].func_name,
+ replace_in_documentation (function_doc_array[i].doc));
+ }
+ }
if (printed_one_mx)
- printf_to_message_buffer ("\n");
+ printf_to_message_buffer ("\n");
#endif /* NAMED_FUNCTIONS */
printf_to_message_buffer
- ("%s", replace_in_documentation
- ("--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n"));
+ ("%s", replace_in_documentation
+ (_("--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n")));
node = message_buffer_to_node ();
internal_info_help_node_contents = node->contents;
}
@@ -273,16 +272,16 @@ info_find_or_create_help_window ()
int max = 0;
for (window = windows; window; window = window->next)
- {
- if (window->height > max)
- {
- max = window->height;
- eligible = window;
- }
- }
+ {
+ if (window->height > max)
+ {
+ max = window->height;
+ eligible = window;
+ }
+ }
if (!eligible)
- return ((WINDOW *)NULL);
+ return ((WINDOW *)NULL);
}
#if !defined (HELP_NODE_GETS_REGENERATED)
else
@@ -297,28 +296,28 @@ info_find_or_create_help_window ()
if (!help_window)
{
/* Split the largest window into 2 windows, and show the help text
- in that window. */
+ in that window. */
if (eligible->height > 30)
- {
- active_window = eligible;
- help_window = window_make_window (internal_info_help_node);
- }
+ {
+ active_window = eligible;
+ help_window = window_make_window (internal_info_help_node);
+ }
else
- {
- set_remembered_pagetop_and_point (active_window);
- window_set_node_of_window (active_window, internal_info_help_node);
- help_window = active_window;
- }
+ {
+ set_remembered_pagetop_and_point (active_window);
+ window_set_node_of_window (active_window, internal_info_help_node);
+ help_window = active_window;
+ }
}
else
{
/* Case where help node always gets regenerated, and we have an
- existing window in which to place the node. */
+ existing window in which to place the node. */
if (active_window != help_window)
- {
- set_remembered_pagetop_and_point (active_window);
- active_window = help_window;
- }
+ {
+ set_remembered_pagetop_and_point (active_window);
+ active_window = help_window;
+ }
window_set_node_of_window (active_window, internal_info_help_node);
}
remember_window_and_node (help_window, help_window->node);
@@ -326,7 +325,7 @@ info_find_or_create_help_window ()
}
/* Create or move to the help window. */
-DECLARE_INFO_COMMAND (info_get_help_window, "Display help message")
+DECLARE_INFO_COMMAND (info_get_help_window, _("Display help message"))
{
WINDOW *help_window;
@@ -344,7 +343,7 @@ DECLARE_INFO_COMMAND (info_get_help_window, "Display help message")
/* Show the Info help node. This means that the "info" file is installed
where it can easily be found on your system. */
-DECLARE_INFO_COMMAND (info_get_info_help_node, "Visit Info node `(info)Help'")
+DECLARE_INFO_COMMAND (info_get_info_help_node, _("Visit Info node `(info)Help'"))
{
NODE *node;
char *nodename;
@@ -356,15 +355,15 @@ DECLARE_INFO_COMMAND (info_get_info_help_node, "Visit Info node `(info)Help'")
for (win = windows; win; win = win->next)
{
- if (win->node && win->node->filename &&
- (strcasecmp
- (filename_non_directory (win->node->filename), "info") == 0) &&
- ((strcmp (win->node->nodename, "Help") == 0) ||
- (strcmp (win->node->nodename, "Help-Small-Screen") == 0)))
- {
- active_window = win;
- return;
- }
+ if (win->node && win->node->filename &&
+ (strcasecmp
+ (filename_non_directory (win->node->filename), "info") == 0) &&
+ ((strcmp (win->node->nodename, "Help") == 0) ||
+ (strcmp (win->node->nodename, "Help-Small-Screen") == 0)))
+ {
+ active_window = win;
+ return;
+ }
}
}
@@ -380,32 +379,32 @@ DECLARE_INFO_COMMAND (info_get_info_help_node, "Visit Info node `(info)Help'")
if (!node)
{
if (info_recent_file_error)
- info_error (info_recent_file_error);
+ info_error (info_recent_file_error);
else
- info_error (CANT_FILE_NODE, "Info", nodename);
+ info_error (CANT_FILE_NODE, "Info", nodename);
}
else
{
/* If the current window is very large (greater than 45 lines),
- then split it and show the help node in another window.
- Otherwise, use the current window. */
+ then split it and show the help node in another window.
+ Otherwise, use the current window. */
if (active_window->height > 45)
- active_window = window_make_window (node);
+ active_window = window_make_window (node);
else
- {
- set_remembered_pagetop_and_point (active_window);
- window_set_node_of_window (active_window, node);
- }
+ {
+ set_remembered_pagetop_and_point (active_window);
+ window_set_node_of_window (active_window, node);
+ }
remember_window_and_node (active_window, node);
}
}
/* **************************************************************** */
-/* */
-/* Groveling Info Keymaps and Docs */
-/* */
+/* */
+/* Groveling Info Keymaps and Docs */
+/* */
/* **************************************************************** */
/* Return the documentation associated with the Info command FUNCTION. */
@@ -468,7 +467,7 @@ key_documentation (key, map)
return ((char *)NULL);
}
-DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY")
+DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY"))
{
char keyname[50];
int keyname_index = 0;
@@ -481,24 +480,24 @@ DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY")
while (1)
{
- message_in_echo_area ("Describe key: %s", keyname);
+ message_in_echo_area (_("Describe key: %s"), keyname);
keystroke = info_get_input_char ();
unmessage_in_echo_area ();
if (Meta_p (keystroke) && (!ISO_Latin_p || key < 160))
- {
- if (map[ESC].type != ISKMAP)
- {
- window_message_in_echo_area
- ("ESC %s is undefined.", pretty_keyname (UnMeta (keystroke)));
- return;
- }
-
- strcpy (keyname + keyname_index, "ESC ");
- keyname_index = strlen (keyname);
- keystroke = UnMeta (keystroke);
- map = (Keymap)map[ESC].function;
- }
+ {
+ if (map[ESC].type != ISKMAP)
+ {
+ window_message_in_echo_area
+ (_("ESC %s is undefined."), pretty_keyname (UnMeta (keystroke)));
+ return;
+ }
+
+ strcpy (keyname + keyname_index, "ESC ");
+ keyname_index = strlen (keyname);
+ keystroke = UnMeta (keystroke);
+ map = (Keymap)map[ESC].function;
+ }
/* Add the printed representation of KEYSTROKE to our keyname. */
rep = pretty_keyname (keystroke);
@@ -506,40 +505,40 @@ DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY")
keyname_index = strlen (keyname);
if (map[keystroke].function == (VFunction *)NULL)
- {
- message_in_echo_area ("%s is undefined.", keyname);
- return;
- }
+ {
+ message_in_echo_area (_("%s is undefined."), keyname);
+ return;
+ }
else if (map[keystroke].type == ISKMAP)
- {
- map = (Keymap)map[keystroke].function;
- strcat (keyname, " ");
- keyname_index = strlen (keyname);
- continue;
- }
+ {
+ map = (Keymap)map[keystroke].function;
+ strcat (keyname, " ");
+ keyname_index = strlen (keyname);
+ continue;
+ }
else
- {
- char *message, *fundoc, *funname = "";
+ {
+ char *message, *fundoc, *funname = "";
#if defined (NAMED_FUNCTIONS)
- funname = function_name (map[keystroke].function);
+ funname = function_name (map[keystroke].function);
#endif /* NAMED_FUNCTIONS */
- fundoc = function_documentation (map[keystroke].function);
+ fundoc = function_documentation (map[keystroke].function);
- message = (char *)xmalloc
- (10 + strlen (keyname) + strlen (fundoc) + strlen (funname));
+ message = (char *)xmalloc
+ (10 + strlen (keyname) + strlen (fundoc) + strlen (funname));
#if defined (NAMED_FUNCTIONS)
- sprintf (message, "%s (%s): %s.", keyname, funname, fundoc);
+ sprintf (message, "%s (%s): %s.", keyname, funname, fundoc);
#else
- sprintf (message, "%s is defined to %s.", keyname, fundoc);
+ sprintf (message, _("%s is defined to %s."), keyname, fundoc);
#endif /* !NAMED_FUNCTIONS */
- window_message_in_echo_area ("%s", message);
- free (message);
- break;
- }
+ window_message_in_echo_area ("%s", message);
+ free (message);
+ break;
+ }
}
}
@@ -565,28 +564,28 @@ pretty_keyname (key)
else if (Control_p (key))
{
switch (key)
- {
- case '\n': rep = "LFD"; break;
- case '\t': rep = "TAB"; break;
- case '\r': rep = "RET"; break;
- case ESC: rep = "ESC"; break;
-
- default:
- sprintf (rep_buffer, "C-%c", UnControl (key));
- rep = rep_buffer;
- }
+ {
+ case '\n': rep = "LFD"; break;
+ case '\t': rep = "TAB"; break;
+ case '\r': rep = "RET"; break;
+ case ESC: rep = "ESC"; break;
+
+ default:
+ sprintf (rep_buffer, "C-%c", UnControl (key));
+ rep = rep_buffer;
+ }
}
else
{
switch (key)
- {
- case ' ': rep = "SPC"; break;
- case DEL: rep = "DEL"; break;
- default:
- rep_buffer[0] = key;
- rep_buffer[1] = '\0';
- rep = rep_buffer;
- }
+ {
+ case ' ': rep = "SPC"; break;
+ case DEL: rep = "DEL"; break;
+ default:
+ rep_buffer[0] = key;
+ rep_buffer[1] = '\0';
+ rep = rep_buffer;
+ }
}
return (rep);
}
@@ -609,39 +608,39 @@ replace_in_documentation (string)
{
/* Is this the start of a replaceable function name? */
if (string[i] == '\\' && string[i + 1] == '[')
- {
- char *fun_name, *rep;
- VFunction *function;
-
- /* Copy in the old text. */
- strncpy (result + next, string + start, i - start);
- next += (i - start);
- start = i + 2;
-
- /* Move to the end of the function name. */
- for (i = start; string[i] && (string[i] != ']'); i++);
-
- fun_name = (char *)xmalloc (1 + i - start);
- strncpy (fun_name, string + start, i - start);
- fun_name[i - start] = '\0';
-
- /* Find a key which invokes this function in the info_keymap. */
- function = named_function (fun_name);
-
- /* If the internal documentation string fails, there is a
- serious problem with the associated command's documentation.
- We croak so that it can be fixed immediately. */
- if (!function)
- abort ();
-
- rep = where_is (info_keymap, function);
- strcpy (result + next, rep);
- next = strlen (result);
-
- start = i;
- if (string[i])
- start++;
- }
+ {
+ char *fun_name, *rep;
+ VFunction *function;
+
+ /* Copy in the old text. */
+ strncpy (result + next, string + start, i - start);
+ next += (i - start);
+ start = i + 2;
+
+ /* Move to the end of the function name. */
+ for (i = start; string[i] && (string[i] != ']'); i++);
+
+ fun_name = (char *)xmalloc (1 + i - start);
+ strncpy (fun_name, string + start, i - start);
+ fun_name[i - start] = '\0';
+
+ /* Find a key which invokes this function in the info_keymap. */
+ function = named_function (fun_name);
+
+ /* If the internal documentation string fails, there is a
+ serious problem with the associated command's documentation.
+ We croak so that it can be fixed immediately. */
+ if (!function)
+ abort ();
+
+ rep = where_is (info_keymap, function);
+ strcpy (result + next, rep);
+ next = strlen (result);
+
+ start = i;
+ if (string[i])
+ start++;
+ }
}
strcpy (result + next, string + start);
return (result);
@@ -674,7 +673,7 @@ where_is (map, function)
name = function_name (function);
if (name)
- sprintf (where_is_rep, "M-x %s", name);
+ sprintf (where_is_rep, "M-x %s", name);
rep = where_is_rep;
}
@@ -694,29 +693,29 @@ where_is_internal (map, function)
for (i = 0; i < 256; i++)
if ((map[i].type == ISFUNC) && map[i].function == function)
{
- sprintf (where_is_rep + where_is_rep_index, "%s", pretty_keyname (i));
- return (where_is_rep);
+ sprintf (where_is_rep + where_is_rep_index, "%s", pretty_keyname (i));
+ return (where_is_rep);
}
/* Okay, search subsequent maps for this function. */
for (i = 0; i < 256; i++)
{
if (map[i].type == ISKMAP)
- {
- int saved_index = where_is_rep_index;
- char *rep;
+ {
+ int saved_index = where_is_rep_index;
+ char *rep;
- sprintf (where_is_rep + where_is_rep_index, "%s ",
- pretty_keyname (i));
+ sprintf (where_is_rep + where_is_rep_index, "%s ",
+ pretty_keyname (i));
- where_is_rep_index = strlen (where_is_rep);
- rep = where_is_internal ((Keymap)map[i].function, function);
+ where_is_rep_index = strlen (where_is_rep);
+ rep = where_is_internal ((Keymap)map[i].function, function);
- if (rep)
- return (where_is_rep);
+ if (rep)
+ return (where_is_rep);
- where_is_rep_index = saved_index;
- }
+ where_is_rep_index = saved_index;
+ }
}
return ((char *)NULL);
@@ -729,7 +728,7 @@ DECLARE_INFO_COMMAND (info_where_is,
{
char *command_name;
- command_name = read_function_name ("Where is command: ", window);
+ command_name = read_function_name (_("Where is command: "), window);
if (!command_name)
{
@@ -744,27 +743,27 @@ DECLARE_INFO_COMMAND (info_where_is,
function = named_function (command_name);
if (function)
- {
- char *location;
-
- location = where_is (active_window->keymap, function);
-
- if (!location)
- {
- info_error ("`%s' is not on any keys", command_name);
- }
- else
- {
- if (strncmp (location, "M-x ", 4) == 0)
- window_message_in_echo_area
- ("%s can only be invoked via %s.", command_name, location);
- else
- window_message_in_echo_area
- ("%s can be invoked via %s.", command_name, location);
- }
- }
+ {
+ char *location;
+
+ location = where_is (active_window->keymap, function);
+
+ if (!location)
+ {
+ info_error (_("`%s' is not on any keys"), command_name);
+ }
+ else
+ {
+ if (strncmp (location, "M-x ", 4) == 0)
+ window_message_in_echo_area
+ (_("%s can only be invoked via %s."), command_name, location);
+ else
+ window_message_in_echo_area
+ (_("%s can be invoked via %s."), command_name, location);
+ }
+ }
else
- info_error ("There is no function named `%s'", command_name);
+ info_error (_("There is no function named `%s'"), command_name);
}
free (command_name);
diff --git a/gnu/usr.bin/texinfo/info/infomap.c b/gnu/usr.bin/texinfo/info/infomap.c
index 27a959eb517..9b46db1d319 100644
--- a/gnu/usr.bin/texinfo/info/infomap.c
+++ b/gnu/usr.bin/texinfo/info/infomap.c
@@ -1,9 +1,7 @@
-/* infomap.c -- Keymaps for Info. */
+/* infomap.c -- Keymaps for Info.
+ $Id: infomap.c,v 1.2 1999/01/11 16:38:08 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,10 +19,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#include "stdio.h"
-#include "ctype.h"
+#include "info.h"
#include "infomap.h"
#include "funs.h"
+#include "terminal.h"
/* Return a new keymap which has all the uppercase letters mapped to run
the function info_do_lowercase_version (). */
@@ -82,16 +80,63 @@ keymap_discard_keymap (map)
for (i = 0; i < 256; i++)
{
switch (map[i].type)
- {
- case ISFUNC:
- break;
+ {
+ case ISFUNC:
+ break;
+
+ case ISKMAP:
+ keymap_discard_keymap ((Keymap)map[i].function);
+ break;
+
+ }
+ }
+}
- case ISKMAP:
- keymap_discard_keymap ((Keymap)map[i].function);
- break;
+/* Conditionally bind key sequence. */
+int
+keymap_bind_keyseq (map, keyseq, keyentry)
+ Keymap map;
+ const unsigned char *keyseq;
+ KEYMAP_ENTRY *keyentry;
+{
+ register Keymap m = map;
+ register const unsigned char *s = keyseq;
+ register int c;
+
+ if (s == NULL || *s == '\0') return 0;
- }
+ while ((c = *s++) != '\0')
+ {
+ switch (m[c].type)
+ {
+ case ISFUNC:
+ if (!(m[c].function == NULL ||
+ (m != map && m[c].function == info_do_lowercase_version)))
+ return 0;
+
+ if (*s != '\0')
+ {
+ m[c].type = ISKMAP;
+ m[c].function = (VFunction *)keymap_make_keymap ();
+ }
+ break;
+
+ case ISKMAP:
+ if (*s == '\0')
+ return 0;
+ break;
+ }
+ if (*s != '\0')
+ {
+ m = (Keymap)m[c].function;
+ }
+ else
+ {
+ m[c] = *keyentry;
+ }
}
+
+ return 1;
}
/* Initialize the standard info keymaps. */
@@ -117,15 +162,15 @@ initialize_info_keymaps ()
echo_area_keymap[ESC].function = (VFunction *)keymap_make_keymap ();
echo_area_keymap[Control ('x')].type = ISKMAP;
echo_area_keymap[Control ('x')].function =
- (VFunction *)keymap_make_keymap ();
+ (VFunction *)keymap_make_keymap ();
}
/* Bind numeric arg functions for both echo area and info window maps. */
for (i = '0'; i < '9' + 1; i++)
{
((Keymap) info_keymap[ESC].function)[i].function =
- ((Keymap) echo_area_keymap[ESC].function)[i].function =
- info_add_digit_to_numeric_arg;
+ ((Keymap) echo_area_keymap[ESC].function)[i].function =
+ info_add_digit_to_numeric_arg;
}
((Keymap) info_keymap[ESC].function)['-'].function =
((Keymap) echo_area_keymap[ESC].function)['-'].function =
@@ -182,6 +227,31 @@ initialize_info_keymaps ()
map['o'].function = info_next_window;
map[DEL].function = ea_backward_kill_line;
+ /* Arrow key bindings for echo area keymaps. It seems that some
+ terminals do not match their termcap entries, so it's best to just
+ define everything with both of the usual prefixes. */
+ map = echo_area_keymap;
+ keymap_bind_keyseq (map, term_ku, &map[Control ('p')]); /* up */
+ keymap_bind_keyseq (map, "\033OA", &map[Control ('p')]);
+ keymap_bind_keyseq (map, "\033[A", &map[Control ('p')]);
+ keymap_bind_keyseq (map, term_kd, &map[Control ('n')]); /* down */
+ keymap_bind_keyseq (map, "\033OB", &map[Control ('n')]);
+ keymap_bind_keyseq (map, "\033[B", &map[Control ('n')]);
+ keymap_bind_keyseq (map, term_kr, &map[Control ('f')]); /* right */
+ keymap_bind_keyseq (map, "\033OC", &map[Control ('f')]);
+ keymap_bind_keyseq (map, "\033[C", &map[Control ('f')]);
+ keymap_bind_keyseq (map, term_kl, &map[Control ('b')]); /* left */
+ keymap_bind_keyseq (map, "\033OD", &map[Control ('b')]);
+ keymap_bind_keyseq (map, "\033[D", &map[Control ('b')]);
+
+ map = (Keymap)echo_area_keymap[ESC].function;
+ keymap_bind_keyseq (map, term_kl, &map['b']); /* left */
+ keymap_bind_keyseq (map, "\033OA", &map['b']);
+ keymap_bind_keyseq (map, "\033[A", &map['b']);
+ keymap_bind_keyseq (map, term_kr, &map['f']); /* right */
+ keymap_bind_keyseq (map, "\033OB", &map['f']);
+ keymap_bind_keyseq (map, "\033[B", &map['f']);
+
/* Bind commands for Info window keymaps. */
map = info_keymap;
map[TAB].function = info_move_to_next_xref;
@@ -264,6 +334,35 @@ initialize_info_keymaps ()
map['o'].function = info_next_window;
map['t'].function = info_tile_windows;
map['w'].function = info_toggle_wrap;
-}
-
+ /* Arrow key bindings for Info windows keymap. */
+ map = info_keymap;
+ keymap_bind_keyseq (map, term_kN, &map[Control ('v')]); /* pagedown */
+ keymap_bind_keyseq (map, term_ku, &map[Control ('p')]); /* up */
+ keymap_bind_keyseq (map, "\033OA", &map[Control ('p')]);
+ keymap_bind_keyseq (map, "\033[A", &map[Control ('p')]);
+ keymap_bind_keyseq (map, term_kd, &map[Control ('n')]); /* down */
+ keymap_bind_keyseq (map, "\033OB", &map[Control ('n')]);
+ keymap_bind_keyseq (map, "\033[B", &map[Control ('n')]);
+ keymap_bind_keyseq (map, term_kr, &map[Control ('f')]); /* right */
+ keymap_bind_keyseq (map, "\033OC", &map[Control ('f')]);
+ keymap_bind_keyseq (map, "\033[C", &map[Control ('f')]);
+ keymap_bind_keyseq (map, term_kl, &map[Control ('b')]); /* left */
+ keymap_bind_keyseq (map, "\033OD", &map[Control ('b')]);
+ keymap_bind_keyseq (map, "\033[D", &map[Control ('b')]);
+
+ map = (Keymap)info_keymap[ESC].function;
+ keymap_bind_keyseq (map, term_kl, &map['b']); /* left */
+ keymap_bind_keyseq (map, "\033OA", &map['b']);
+ keymap_bind_keyseq (map, "\033[A", &map['b']);
+ keymap_bind_keyseq (map, term_kr, &map['f']); /* right */
+ keymap_bind_keyseq (map, "\033OB", &map['f']);
+ keymap_bind_keyseq (map, "\033[B", &map['f']);
+ keymap_bind_keyseq (map, term_kN, &map[Control ('v')]); /* pagedown */
+
+ /* The alternative to this definition of a `main map' key in the
+ `ESC map' section, is something like:
+ keymap_bind_keyseq (map, term_kP, &((KeyMap)map[ESC].function).map['v']);
+ */
+ keymap_bind_keyseq (info_keymap/*sic*/, term_kP, &map['v']); /* pageup */
+}
diff --git a/gnu/usr.bin/texinfo/info/m-x.c b/gnu/usr.bin/texinfo/info/m-x.c
index 03ac1a52232..b504feff3ca 100644
--- a/gnu/usr.bin/texinfo/info/m-x.c
+++ b/gnu/usr.bin/texinfo/info/m-x.c
@@ -1,9 +1,7 @@
-/* m-x.c -- Meta-X minibuffer reader. */
+/* m-x.c -- Meta-X minibuffer reader.
+ $Id: m-x.c,v 1.2 1999/01/11 16:38:08 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -24,9 +22,9 @@
#include "info.h"
/* **************************************************************** */
-/* */
-/* Reading Named Commands */
-/* */
+/* */
+/* Reading Named Commands */
+/* */
/* **************************************************************** */
/* Read the name of an Info function in the echo area and return the
@@ -49,12 +47,12 @@ read_function_name (prompt, window)
REFERENCE *entry;
entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
- entry->label = strdup (function_doc_array[i].func_name);
+ entry->label = xstrdup (function_doc_array[i].func_name);
entry->nodename = (char *)NULL;
entry->filename = (char *)NULL;
add_pointer_to_array
- (entry, array_index, array, array_slots, 200, REFERENCE *);
+ (entry, array_index, array, array_slots, 200, REFERENCE *);
}
line = info_read_completing_in_echo_area (window, prompt, array);
@@ -68,11 +66,11 @@ read_function_name (prompt, window)
}
DECLARE_INFO_COMMAND (describe_command,
- "Read the name of an Info command and describe it")
+ _("Read the name of an Info command and describe it"))
{
char *line;
- line = read_function_name ("Describe command: ", window);
+ line = read_function_name (_("Describe command: "), window);
if (!line)
{
@@ -83,22 +81,19 @@ DECLARE_INFO_COMMAND (describe_command,
/* Describe the function named in "LINE". */
if (*line)
{
- char *fundoc;
- VFunction *fun;
-
- fun = named_function (line);
+ VFunction *fun = named_function (line);
if (!fun)
- return;
+ return;
window_message_in_echo_area ("%s: %s.",
- line, function_documentation (fun));
+ line, function_documentation (fun));
}
free (line);
}
DECLARE_INFO_COMMAND (info_execute_command,
- "Read a command name in the echo area and execute it")
+ _("Read a command name in the echo area and execute it"))
{
char *line;
@@ -133,11 +128,11 @@ DECLARE_INFO_COMMAND (info_execute_command,
VFunction *function;
if ((active_window != the_echo_area) &&
- (strncmp (line, "echo-area-", 10) == 0))
+ (strncmp (line, "echo-area-", 10) == 0))
{
- free (line);
- info_error ("Cannot execute an `echo-area' command here.");
- return;
+ free (line);
+ info_error (_("Cannot execute an `echo-area' command here."));
+ return;
}
function = named_function (line);
@@ -152,7 +147,7 @@ DECLARE_INFO_COMMAND (info_execute_command,
/* Okay, now that we have M-x, let the user set the screen height. */
DECLARE_INFO_COMMAND (set_screen_height,
- "Set the height of the displayed window")
+ _("Set the height of the displayed window"))
{
int new_height;
@@ -165,24 +160,24 @@ DECLARE_INFO_COMMAND (set_screen_height,
new_height = screenheight;
- sprintf (prompt, "Set screen height to (%d): ", new_height);
+ sprintf (prompt, _("Set screen height to (%d): "), new_height);
line = info_read_in_echo_area (window, prompt);
/* If the user aborted, do that now. */
if (!line)
- {
- info_abort_key (active_window, count, 0);
- return;
- }
+ {
+ info_abort_key (active_window, count, 0);
+ return;
+ }
/* Find out what the new height is supposed to be. */
if (*line)
- new_height = atoi (line);
+ new_height = atoi (line);
/* Clear the echo area if it isn't active. */
if (!echo_area_is_active)
- window_clear_echo_area ();
+ window_clear_echo_area ();
free (line);
}
diff --git a/gnu/usr.bin/texinfo/info/makedoc.c b/gnu/usr.bin/texinfo/info/makedoc.c
index c0c4587ff18..6e52af8478d 100644
--- a/gnu/usr.bin/texinfo/info/makedoc.c
+++ b/gnu/usr.bin/texinfo/info/makedoc.c
@@ -1,9 +1,10 @@
-/* makedoc.c -- Make DOC.C and FUNS.H from input files. */
+/* makedoc.c -- Make doc.c and funs.h from input files.
+ $Id: makedoc.c,v 1.2 1999/01/11 16:38:08 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
+ This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,24 +27,8 @@
a header file which describes the contents. This only does the functions
declared with DECLARE_INFO_COMMAND. */
-#include <stdio.h>
-#include <ctype.h>
-#include <sys/types.h>
-#if defined (HAVE_SYS_FILE_H)
-#include <sys/file.h>
-#endif /* HAVE_SYS_FILE_H */
-#include <sys/stat.h>
-#include "general.h"
-
-#if !defined (O_RDONLY)
-#if defined (HAVE_SYS_FCNTL_H)
-#include <sys/fcntl.h>
-#else /* !HAVE_SYS_FCNTL_H */
-#include <fcntl.h>
-#endif /* !HAVE_SYS_FCNTL_H */
-#endif /* !O_RDONLY */
-
-extern void *xmalloc (), *xrealloc ();
+#include "info.h"
+
static void fatal_file_error ();
/* Name of the header file which receives the declarations of functions. */
@@ -79,15 +64,15 @@ static char *doc_header_1[] = {
/* How to remember the locations of the functions found so that Emacs
can use the information in a tag table. */
typedef struct {
- char *name; /* Name of the tag. */
- int line; /* Line number at which it appears. */
- long char_offset; /* Character offset at which it appears. */
+ char *name; /* Name of the tag. */
+ int line; /* Line number at which it appears. */
+ long char_offset; /* Character offset at which it appears. */
} EMACS_TAG;
typedef struct {
- char *filename; /* Name of the file containing entries. */
- long entrylen; /* Total number of characters in tag block. */
- EMACS_TAG **entries; /* Entries found in FILENAME. */
+ char *filename; /* Name of the file containing entries. */
+ long entrylen; /* Total number of characters in tag block. */
+ EMACS_TAG **entries; /* Entries found in FILENAME. */
int entries_index;
int entries_slots;
} EMACS_TAG_BLOCK;
@@ -114,8 +99,8 @@ main (argc, argv)
for (i = 1; i < argc; i++)
if (strcmp (argv[i], "-tags") == 0)
{
- tags_only++;
- break;
+ tags_only++;
+ break;
}
if (tags_only)
@@ -128,8 +113,8 @@ main (argc, argv)
doc_stream = must_fopen (doc_filename, "w");
fprintf (funs_stream,
- "/* %s -- Generated declarations for Info commands. */\n",
- funs_filename);
+ "/* %s -- Generated declarations for Info commands. */\n",
+ funs_filename);
for (i = 0; doc_header[i]; i++)
{
@@ -138,7 +123,7 @@ main (argc, argv)
}
fprintf (doc_stream,
- " Source files groveled to make this file include:\n\n");
+ _(" Source files groveled to make this file include:\n\n"));
for (i = 1; i < argc; i++)
fprintf (doc_stream, "\t%s\n", argv[i]);
@@ -155,17 +140,17 @@ main (argc, argv)
curfile = argv[i];
if (*curfile == '-')
- continue;
+ continue;
fprintf (doc_stream, "/* Commands found in \"%s\". */\n", curfile);
fprintf (funs_stream, "\n/* Functions declared in \"%s\". */\n",
- curfile);
+ curfile);
process_one_file (curfile, doc_stream, funs_stream);
}
fprintf (doc_stream,
- " { (VFunction *)NULL, (char *)NULL, (char *)NULL }\n};\n");
+ " { (VFunction *)NULL, (char *)NULL, (char *)NULL }\n};\n");
fclose (funs_stream);
fclose (doc_stream);
@@ -195,25 +180,25 @@ maybe_dump_tags (stream)
/* Calculate the length of the dumped block first. */
for (j = 0; j < block->entries_index; j++)
- {
- char digits[30];
- etag = block->entries[j];
- block_len += 3 + strlen (etag->name);
- sprintf (digits, "%d,%d", etag->line, etag->char_offset);
- block_len += strlen (digits);
- }
+ {
+ char digits[30];
+ etag = block->entries[j];
+ block_len += 3 + strlen (etag->name);
+ sprintf (digits, "%d,%ld", etag->line, etag->char_offset);
+ block_len += strlen (digits);
+ }
/* Print out the defining line. */
- fprintf (stream, "\f\n%s,%d\n", block->filename, block_len);
+ fprintf (stream, "\f\n%s,%ld\n", block->filename, block_len);
/* Print out the individual tags. */
for (j = 0; j < block->entries_index; j++)
- {
- etag = block->entries[j];
+ {
+ etag = block->entries[j];
- fprintf (stream, "%s,\177%d,%d\n",
- etag->name, etag->line, etag->char_offset);
- }
+ fprintf (stream, "%s,\177%d,%ld\n",
+ etag->name, etag->line, etag->char_offset);
+ }
}
}
@@ -226,7 +211,7 @@ make_emacs_tag_block (filename)
EMACS_TAG_BLOCK *block;
block = (EMACS_TAG_BLOCK *)xmalloc (sizeof (EMACS_TAG_BLOCK));
- block->filename = strdup (filename);
+ block->filename = xstrdup (filename);
block->entrylen = 0;
block->entries = (EMACS_TAG **)NULL;
block->entries_index = 0;
@@ -248,7 +233,7 @@ add_tag_to_block (block, name, line, char_offset)
tag->line = line;
tag->char_offset = char_offset;
add_pointer_to_array (tag, block->entries_index, block->entries,
- block->entries_slots, 50, EMACS_TAG *);
+ block->entries_slots, 50, EMACS_TAG *);
}
/* Read the file represented by FILENAME into core, and search it for Info
@@ -297,51 +282,51 @@ process_one_file (filename, doc_stream, funs_stream)
#endif /* NAMED_FUNCTIONS */
for (; offset < (file_size - decl_len); offset++)
- {
- if (buffer[offset] == '\n')
- {
- line_number++;
- line_start = offset + 1;
- }
-
- if (strncmp (buffer + offset, decl_str, decl_len) == 0)
- {
- offset += decl_len;
- point = offset;
- break;
- }
- }
+ {
+ if (buffer[offset] == '\n')
+ {
+ line_number++;
+ line_start = offset + 1;
+ }
+
+ if (strncmp (buffer + offset, decl_str, decl_len) == 0)
+ {
+ offset += decl_len;
+ point = offset;
+ break;
+ }
+ }
if (!point)
- break;
+ break;
/* Skip forward until we find the open paren. */
while (point < file_size)
- {
- if (buffer[point] == '\n')
- {
- line_number++;
- line_start = point + 1;
- }
- else if (buffer[point] == '(')
- break;
-
- point++;
- }
+ {
+ if (buffer[point] == '\n')
+ {
+ line_number++;
+ line_start = point + 1;
+ }
+ else if (buffer[point] == '(')
+ break;
+
+ point++;
+ }
while (point++ < file_size)
- {
- if (!whitespace_or_newline (buffer[point]))
- break;
- else if (buffer[point] == '\n')
- {
- line_number++;
- line_start = point + 1;
- }
- }
+ {
+ if (!whitespace_or_newline (buffer[point]))
+ break;
+ else if (buffer[point] == '\n')
+ {
+ line_number++;
+ line_start = point + 1;
+ }
+ }
if (point >= file_size)
- break;
+ break;
/* Now looking at name of function. Get it. */
for (offset = point; buffer[offset] != ','; offset++);
@@ -351,42 +336,42 @@ process_one_file (filename, doc_stream, funs_stream)
/* Remember this tag in the current block. */
{
- char *tag_name;
+ char *tag_name;
- tag_name = (char *)xmalloc (1 + (offset - line_start));
- strncpy (tag_name, buffer + line_start, offset - line_start);
- tag_name[offset - line_start] = '\0';
- add_tag_to_block (block, tag_name, line_number, point);
+ tag_name = (char *)xmalloc (1 + (offset - line_start));
+ strncpy (tag_name, buffer + line_start, offset - line_start);
+ tag_name[offset - line_start] = '\0';
+ add_tag_to_block (block, tag_name, line_number, point);
}
#if defined (NAMED_FUNCTIONS)
/* Generate the user-visible function name from the function's name. */
{
- register int i;
- char *name_start;
+ register int i;
+ char *name_start;
- name_start = func;
+ name_start = func;
- if (strncmp (name_start, "info_", 5) == 0)
- name_start += 5;
+ if (strncmp (name_start, "info_", 5) == 0)
+ name_start += 5;
- func_name = strdup (name_start);
+ func_name = xstrdup (name_start);
- /* Fix up "ea" commands. */
- if (strncmp (func_name, "ea_", 3) == 0)
- {
- char *temp_func_name;
+ /* Fix up "ea" commands. */
+ if (strncmp (func_name, "ea_", 3) == 0)
+ {
+ char *temp_func_name;
- temp_func_name = (char *)xmalloc (10 + strlen (func_name));
- strcpy (temp_func_name, "echo_area_");
- strcat (temp_func_name, func_name + 3);
- free (func_name);
- func_name = temp_func_name;
- }
+ temp_func_name = (char *)xmalloc (10 + strlen (func_name));
+ strcpy (temp_func_name, "echo_area_");
+ strcat (temp_func_name, func_name + 3);
+ free (func_name);
+ func_name = temp_func_name;
+ }
- for (i = 0; func_name[i]; i++)
- if (func_name[i] == '_')
- func_name[i] = '-';
+ for (i = 0; func_name[i]; i++)
+ if (func_name[i] == '_')
+ func_name[i] = '-';
}
#endif /* NAMED_FUNCTIONS */
@@ -394,40 +379,40 @@ process_one_file (filename, doc_stream, funs_stream)
point = offset + 1;
while (point < file_size)
- {
- if (buffer[point] == '\n')
- {
- line_number++;
- line_start = point + 1;
- }
-
- if (buffer[point] == '"')
- break;
- else
- point++;
- }
+ {
+ if (buffer[point] == '\n')
+ {
+ line_number++;
+ line_start = point + 1;
+ }
+
+ if (buffer[point] == '"')
+ break;
+ else
+ point++;
+ }
offset = point + 1;
while (offset < file_size)
- {
- if (buffer[offset] == '\n')
- {
- line_number++;
- line_start = offset + 1;
- }
-
- if (buffer[offset] == '\\')
- offset += 2;
- else if (buffer[offset] == '"')
- break;
- else
- offset++;
- }
+ {
+ if (buffer[offset] == '\n')
+ {
+ line_number++;
+ line_start = offset + 1;
+ }
+
+ if (buffer[offset] == '\\')
+ offset += 2;
+ else if (buffer[offset] == '"')
+ break;
+ else
+ offset++;
+ }
offset++;
if (offset >= file_size)
- break;
+ break;
doc = (char *)xmalloc (1 + (offset - point));
strncpy (doc, buffer + point, offset - point);
@@ -450,7 +435,7 @@ process_one_file (filename, doc_stream, funs_stream)
free the memory already allocated to it. */
if (block->entries)
add_pointer_to_array (block, emacs_tags_index, emacs_tags,
- emacs_tags_slots, 10, EMACS_TAG_BLOCK *);
+ emacs_tags_slots, 10, EMACS_TAG_BLOCK *);
else
{
free (block->filename);
@@ -462,7 +447,7 @@ static void
fatal_file_error (filename)
char *filename;
{
- fprintf (stderr, "Couldn't manipulate the file %s.\n", filename);
+ fprintf (stderr, _("Couldn't manipulate the file %s.\n"), filename);
exit (2);
}
diff --git a/gnu/usr.bin/texinfo/info/man.c b/gnu/usr.bin/texinfo/info/man.c
index 4b4dca9b203..08052185c89 100644
--- a/gnu/usr.bin/texinfo/info/man.c
+++ b/gnu/usr.bin/texinfo/info/man.c
@@ -1,9 +1,7 @@
-/* man.c: How to read and format man files. */
+/* man.c: How to read and format man files.
+ $Id: man.c,v 1.2 1999/01/11 16:38:08 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1995 Free Software Foundation, Inc.
+ Copyright (C) 1995, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -23,7 +21,6 @@
#include "info.h"
#include <sys/ioctl.h>
-#include <sys/file.h>
#include "signals.h"
#if defined (HAVE_SYS_TIME_H)
#include <sys/time.h>
@@ -31,8 +28,8 @@
#if defined (HAVE_SYS_WAIT_H)
#include <sys/wait.h>
#endif
-#include "tilde.h"
+#include "tilde.h"
#include "man.h"
#if !defined (_POSIX_VERSION)
@@ -75,31 +72,31 @@ get_manpage_node (file_buffer, pagename)
page = get_manpage_contents (pagename);
if (page)
- {
- char header[1024];
- long oldsize, newsize;
- int hlen, plen;
-
- sprintf (header, "\n\n%c\n%s %s, %s %s, %s (dir)\n\n",
- INFO_COOKIE,
- INFO_FILE_LABEL, file_buffer->filename,
- INFO_NODE_LABEL, pagename,
- INFO_UP_LABEL);
- oldsize = file_buffer->filesize;
- hlen = strlen (header);
- plen = strlen (page);
- newsize = (oldsize + hlen + plen);
- file_buffer->contents =
- (char *)xrealloc (file_buffer->contents, 1 + newsize);
- memcpy (file_buffer->contents + oldsize, header, hlen);
- oldsize += hlen;
- memcpy (file_buffer->contents + oldsize, page, plen);
- file_buffer->contents[newsize] = '\0';
- file_buffer->filesize = newsize;
- file_buffer->finfo.st_size = newsize;
- build_tags_and_nodes (file_buffer);
- free (page);
- }
+ {
+ char header[1024];
+ long oldsize, newsize;
+ int hlen, plen;
+
+ sprintf (header, "\n\n%c\n%s %s, %s %s, %s (dir)\n\n",
+ INFO_COOKIE,
+ INFO_FILE_LABEL, file_buffer->filename,
+ INFO_NODE_LABEL, pagename,
+ INFO_UP_LABEL);
+ oldsize = file_buffer->filesize;
+ hlen = strlen (header);
+ plen = strlen (page);
+ newsize = (oldsize + hlen + plen);
+ file_buffer->contents =
+ (char *)xrealloc (file_buffer->contents, 1 + newsize);
+ memcpy (file_buffer->contents + oldsize, header, hlen);
+ oldsize += hlen;
+ memcpy (file_buffer->contents + oldsize, page, plen);
+ file_buffer->contents[newsize] = '\0';
+ file_buffer->filesize = newsize;
+ file_buffer->finfo.st_size = newsize;
+ build_tags_and_nodes (file_buffer);
+ free (page);
+ }
node = manpage_node_of_file_buffer (file_buffer, pagename);
}
@@ -110,12 +107,9 @@ get_manpage_node (file_buffer, pagename)
FILE_BUFFER *
create_manpage_file_buffer ()
{
- FILE_BUFFER *file_buffer;
- struct stat *finfo;
-
- file_buffer = make_file_buffer ();
- file_buffer->filename = strdup (MANPAGE_FILE_BUFFER_NAME);
- file_buffer->fullpath = strdup (MANPAGE_FILE_BUFFER_NAME);
+ FILE_BUFFER *file_buffer = make_file_buffer ();
+ file_buffer->filename = xstrdup (MANPAGE_FILE_BUFFER_NAME);
+ file_buffer->fullpath = xstrdup (MANPAGE_FILE_BUFFER_NAME);
file_buffer->finfo.st_size = 0;
file_buffer->filesize = 0;
file_buffer->contents = (char *)NULL;
@@ -137,25 +131,24 @@ executable_file_in_path (filename, path)
dirname_index = 0;
- while (temp_dirname = extract_colon_unit (path, &dirname_index))
+ while ((temp_dirname = extract_colon_unit (path, &dirname_index)))
{
- register int i;
char *temp;
/* Expand a leading tilde if one is present. */
if (*temp_dirname == '~')
- {
- char *expanded_dirname;
+ {
+ char *expanded_dirname;
- expanded_dirname = tilde_expand_word (temp_dirname);
- free (temp_dirname);
- temp_dirname = expanded_dirname;
- }
+ expanded_dirname = tilde_expand_word (temp_dirname);
+ free (temp_dirname);
+ temp_dirname = expanded_dirname;
+ }
temp = (char *)xmalloc (30 + strlen (temp_dirname) + strlen (filename));
strcpy (temp, temp_dirname);
if (temp[(strlen (temp)) - 1] != '/')
- strcat (temp, "/");
+ strcat (temp, "/");
strcat (temp, filename);
free (temp_dirname);
@@ -164,10 +157,10 @@ executable_file_in_path (filename, path)
/* If we have found a regular executable file, then use it. */
if ((statable) && (S_ISREG (finfo.st_mode)) &&
- (access (temp, X_OK) == 0))
- return (temp);
+ (access (temp, X_OK) == 0))
+ return (temp);
else
- free (temp);
+ free (temp);
}
return ((char *)NULL);
}
@@ -221,7 +214,7 @@ static void
reap_children (sig)
int sig;
{
- unsigned int status;
+ int status;
wait (&status);
}
@@ -233,7 +226,6 @@ get_manpage_contents (pagename)
int pipes[2];
pid_t child;
char *formatted_page = (char *)NULL;
- char *section = (char *)NULL;
int arg_index = 1;
if (formatter_args[0] == (char *)NULL)
@@ -261,11 +253,11 @@ get_manpage_contents (pagename)
if (child == -1)
return ((char *)NULL);
-
+
if (child != 0)
{
/* In the parent, close the writing end of the pipe, and read from
- the exec'd child. */
+ the exec'd child. */
close (pipes[1]);
formatted_page = read_from_fd (pipes[0]);
close (pipes[0]);
@@ -273,16 +265,16 @@ get_manpage_contents (pagename)
else
{
/* In the child, close the read end of the pipe, make the write end
- of the pipe be stdout, and execute the man page formatter. */
+ of the pipe be stdout, and execute the man page formatter. */
close (pipes[0]);
close (fileno (stderr));
- close (fileno (stdin)); /* Don't print errors. */
+ close (fileno (stdin)); /* Don't print errors. */
dup2 (pipes[1], fileno (stdout));
execv (formatter_args[0], formatter_args);
/* If we get here, we couldn't exec, so close out the pipe and
- exit. */
+ exit. */
close (pipes[1]);
exit (0);
}
@@ -304,21 +296,21 @@ clean_manpage (manpage)
newpage = (char *)xmalloc (1 + strlen (manpage));
- for (i = 0, j = 0; newpage[j] = manpage[i]; i++, j++)
+ for (i = 0, j = 0; (newpage[j] = manpage[i]); i++, j++)
{
if (manpage[i] == '\n')
- newline_count++;
+ newline_count++;
else
- newline_count = 0;
+ newline_count = 0;
if (newline_count == 3)
- {
- j--;
- newline_count--;
- }
+ {
+ j--;
+ newline_count--;
+ }
- if (manpage[i] == '\b')
- j -= 2;
+ if (manpage[i] == '\b' || manpage[i] == '\f')
+ j -= 2;
}
newpage[j++] = '\0';
@@ -339,11 +331,11 @@ manpage_node_of_file_buffer (file_buffer, pagename)
{
register int i;
- for (i = 0; tag = file_buffer->tags[i]; i++)
- {
- if (strcasecmp (pagename, tag->nodename) == 0)
- break;
- }
+ for (i = 0; (tag = file_buffer->tags[i]); i++)
+ {
+ if (strcasecmp (pagename, tag->nodename) == 0)
+ break;
+ }
}
if (tag)
@@ -459,7 +451,7 @@ find_reference_section (node)
{
position = search_forward (reference_section_starters[i], &frs_binding);
if (position != -1)
- break;
+ break;
}
if (position == -1)
@@ -473,11 +465,11 @@ find_reference_section (node)
for (i = frs_binding.start; i < frs_binding.end - 2; i++)
{
if ((frs_binding.buffer[i] == '\n') &&
- (!whitespace (frs_binding.buffer[i + 1])))
- {
- frs_binding.end = i;
- break;
- }
+ (!whitespace (frs_binding.buffer[i + 1])))
+ {
+ frs_binding.end = i;
+ break;
+ }
}
return (&frs_binding);
@@ -508,43 +500,43 @@ xrefs_of_manpage (node)
register int start, end;
for (start = position; start > reference_section->start; start--)
- if (whitespace (reference_section->buffer[start]))
- break;
+ if (whitespace (reference_section->buffer[start]))
+ break;
start++;
for (end = position; end < reference_section->end; end++)
- {
- if (whitespace (reference_section->buffer[end]))
- {
- end = start;
- break;
- }
-
- if (reference_section->buffer[end] == ')')
- {
- end++;
- break;
- }
- }
+ {
+ if (whitespace (reference_section->buffer[end]))
+ {
+ end = start;
+ break;
+ }
+
+ if (reference_section->buffer[end] == ')')
+ {
+ end++;
+ break;
+ }
+ }
if (end != start)
- {
- REFERENCE *entry;
- int len = end - start;
-
- entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
- entry->label = (char *)xmalloc (1 + len);
- strncpy (entry->label, (reference_section->buffer) + start, len);
- entry->label[len] = '\0';
- entry->filename = strdup (node->filename);
- entry->nodename = strdup (entry->label);
- entry->start = start;
- entry->end = end;
-
- add_pointer_to_array
- (entry, refs_index, refs, refs_slots, 10, REFERENCE *);
- }
+ {
+ REFERENCE *entry;
+ int len = end - start;
+
+ entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
+ entry->label = (char *)xmalloc (1 + len);
+ strncpy (entry->label, (reference_section->buffer) + start, len);
+ entry->label[len] = '\0';
+ entry->filename = xstrdup (node->filename);
+ entry->nodename = xstrdup (entry->label);
+ entry->start = start;
+ entry->end = end;
+
+ add_pointer_to_array
+ (entry, refs_index, refs, refs_slots, 10, REFERENCE *);
+ }
reference_section->start = position + 1;
}
@@ -558,7 +550,6 @@ locate_manpage_xref (node, start, dir)
long start;
int dir;
{
- register int i, count;
REFERENCE **refs;
long position = -1;
@@ -573,27 +564,27 @@ locate_manpage_xref (node, start, dir)
count = i;
if (dir > 0)
- {
- for (i = 0; entry = refs[i]; i++)
- if (entry->start > start)
- {
- position = entry->start;
- break;
- }
- }
+ {
+ for (i = 0; (entry = refs[i]); i++)
+ if (entry->start > start)
+ {
+ position = entry->start;
+ break;
+ }
+ }
else
- {
- for (i = count - 1; i > 0; i--)
- {
- entry = refs[i];
-
- if (entry->start < start)
- {
- position = entry->start;
- break;
- }
- }
- }
+ {
+ for (i = count - 1; i > -1; i--)
+ {
+ entry = refs[i];
+
+ if (entry->start < start)
+ {
+ position = entry->start;
+ break;
+ }
+ }
+ }
info_free_references (refs);
}
@@ -622,20 +613,20 @@ manpage_xrefs_in_binding (node, binding)
start = binding->start + (binding->buffer - node->contents);
end = binding->end + (binding->buffer - node->contents);
- for (i = 0; entry = all_refs[i]; i++)
+ for (i = 0; (entry = all_refs[i]); i++)
{
if ((entry->start > start) && (entry->end < end))
- {
- add_pointer_to_array
- (entry, brefs_index, brefs, brefs_slots, 10, REFERENCE *);
- }
+ {
+ add_pointer_to_array
+ (entry, brefs_index, brefs, brefs_slots, 10, REFERENCE *);
+ }
else
- {
- maybe_free (entry->label);
- maybe_free (entry->filename);
- maybe_free (entry->nodename);
- free (entry);
- }
+ {
+ maybe_free (entry->label);
+ maybe_free (entry->filename);
+ maybe_free (entry->nodename);
+ free (entry);
+ }
}
free (all_refs);
diff --git a/gnu/usr.bin/texinfo/info/man.h b/gnu/usr.bin/texinfo/info/man.h
index 1584e260687..490b4c3b356 100644
--- a/gnu/usr.bin/texinfo/info/man.h
+++ b/gnu/usr.bin/texinfo/info/man.h
@@ -1,9 +1,10 @@
-/* man.h: Defines and external function declarations for man.c */
+/* man.h: Defines and external function declarations for man.c.
+ $Id: man.h,v 1.2 1999/01/11 16:38:08 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
+ This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,8 +22,8 @@
Author: Brian J. Fox (bfox@ai.mit.edu) Sat May 6 16:19:13 1995. */
-#if !defined (_MAN_H_)
-#define _MAN_H_
+#ifndef INFO_MAN_H
+#define INFO_MAN_H
#define MANPAGE_FILE_BUFFER_NAME "*manpages*"
@@ -33,4 +34,4 @@ extern long locate_manpage_xref (/* NODE *node, long start, int dir */);
extern REFERENCE **xrefs_of_manpage (/* NODE *node */);
extern REFERENCE **manpage_xrefs_in_binding (/* NODE *node, SEARCH_BINDING *binding */);
-#endif /* !_MAN_H_ */
+#endif /* INFO_MAN_H */
diff --git a/gnu/usr.bin/texinfo/info/nodemenu.c b/gnu/usr.bin/texinfo/info/nodemenu.c
index 33044157bd2..70878f4ca92 100644
--- a/gnu/usr.bin/texinfo/info/nodemenu.c
+++ b/gnu/usr.bin/texinfo/info/nodemenu.c
@@ -1,9 +1,7 @@
-/* nodemenu.c -- Produce a menu of all visited nodes. */
+/* nodemenu.c -- Produce a menu of all visited nodes.
+ $Id: nodemenu.c,v 1.2 1999/01/11 16:38:08 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -27,10 +25,10 @@
static char *
nodemenu_format_info ()
{
- return ("\n\
+ return (_("\n\
* Menu:\n\
(File)Node Lines Size Containing File\n\
- ---------- ----- ---- ---------------");
+ ---------- ----- ---- ---------------"));
}
/* Produce a formatted line of information about NODE. Here is what we want
@@ -41,7 +39,7 @@ nodemenu_format_info ()
---------- ----- ---- ---------------
* (emacs)Buffers:: 48 2230 /usr/gnu/info/emacs/emacs-1
* (autoconf)Writing configure.in:: 123 58789 /usr/gnu/info/autoconf/autoconf-1
-* (dir)Top:: 40 589 /usr/gnu/info/dir
+* (dir)Top:: 40 589 /usr/gnu/info/dir
*/
static char *
format_node_info (node)
@@ -58,7 +56,7 @@ format_node_info (node)
{
parent = filename_non_directory (node->parent);
if (!parent)
- parent = node->parent;
+ parent = node->parent;
}
else
parent = (char *)NULL;
@@ -72,15 +70,15 @@ format_node_info (node)
char *file = (char *)NULL;
if (parent)
- file = parent;
+ file = parent;
else
- file = filename_non_directory (containing_file);
+ file = filename_non_directory (containing_file);
if (!file)
- file = containing_file;
+ file = containing_file;
if (!*file)
- file = "dir";
+ file = "dir";
sprintf (line_buffer, "* (%s)%s::", file, node->nodename);
}
@@ -92,13 +90,13 @@ format_node_info (node)
for (i = 0; i < node->nodelen; i++)
if (node->contents[i] == '\n')
- lines++;
+ lines++;
sprintf (line_buffer + len, "%d", lines);
}
len = pad_to (44, line_buffer);
- sprintf (line_buffer + len, "%d", node->nodelen);
+ sprintf (line_buffer + len, "%ld", node->nodelen);
if (node->filename && *(node->filename))
{
@@ -106,7 +104,7 @@ format_node_info (node)
sprintf (line_buffer + len, node->filename);
}
- return (strdup (line_buffer));
+ return xstrdup (line_buffer);
}
/* Little string comparison routine for qsort (). */
@@ -137,26 +135,26 @@ get_visited_nodes (filter_func)
if (!info_windows)
return ((NODE *)NULL);
- for (iw_index = 0; info_win = info_windows[iw_index]; iw_index++)
+ for (iw_index = 0; (info_win = info_windows[iw_index]); iw_index++)
{
for (i = 0; i < info_win->nodes_index; i++)
- {
- node = info_win->nodes[i];
-
- /* We skip mentioning "*Node Menu*" nodes. */
- if (internal_info_node_p (node) &&
- (strcmp (node->nodename, nodemenu_nodename) == 0))
- continue;
-
- if (node && (!filter_func || (*filter_func) (node)))
- {
- char *line;
-
- line = format_node_info (node);
- add_pointer_to_array
- (line, lines_index, lines, lines_slots, 20, char *);
- }
- }
+ {
+ node = info_win->nodes[i];
+
+ /* We skip mentioning "*Node Menu*" nodes. */
+ if (internal_info_node_p (node) &&
+ (strcmp (node->nodename, nodemenu_nodename) == 0))
+ continue;
+
+ if (node && (!filter_func || (*filter_func) (node)))
+ {
+ char *line;
+
+ line = format_node_info (node);
+ add_pointer_to_array
+ (line, lines_index, lines, lines_slots, 20, char *);
+ }
+ }
}
/* Sort the array of information lines, if there are any. */
@@ -169,22 +167,22 @@ get_visited_nodes (filter_func)
/* Delete duplicates. */
for (i = 0, newlen = 1; i < lines_index - 1; i++)
- {
- if (strcmp (lines[i], lines[i + 1]) == 0)
- {
- free (lines[i]);
- lines[i] = (char *)NULL;
- }
- else
- newlen++;
- }
+ {
+ if (strcmp (lines[i], lines[i + 1]) == 0)
+ {
+ free (lines[i]);
+ lines[i] = (char *)NULL;
+ }
+ else
+ newlen++;
+ }
/* We have free ()'d and marked all of the duplicate slots.
- Copy the live slots rather than pruning the dead slots. */
+ Copy the live slots rather than pruning the dead slots. */
temp = (char **)xmalloc ((1 + newlen) * sizeof (char *));
for (i = 0, j = 0; i < lines_index; i++)
- if (lines[i])
- temp[j++] = lines[i];
+ if (lines[i])
+ temp[j++] = lines[i];
temp[j] = (char *)NULL;
free (lines);
@@ -196,8 +194,8 @@ get_visited_nodes (filter_func)
printf_to_message_buffer
("%s", replace_in_documentation
- ("Here is the menu of nodes you have recently visited.\n\
-Select one from this menu, or use `\\[history-node]' in another window.\n"));
+ (_("Here is the menu of nodes you have recently visited.\n\
+Select one from this menu, or use `\\[history-node]' in another window.\n")));
printf_to_message_buffer ("%s\n", nodemenu_format_info ());
@@ -216,7 +214,7 @@ Select one from this menu, or use `\\[history-node]' in another window.\n"));
}
DECLARE_INFO_COMMAND (list_visited_nodes,
- "Make a window containing a menu of all of the currently visited nodes")
+ _("Make a window containing a menu of all of the currently visited nodes"))
{
WINDOW *new;
NODE *node;
@@ -229,14 +227,20 @@ DECLARE_INFO_COMMAND (list_visited_nodes,
node = new->node;
if (internal_info_node_p (node) &&
- (strcmp (node->nodename, nodemenu_nodename) == 0))
- break;
+ (strcmp (node->nodename, nodemenu_nodename) == 0))
+ break;
}
/* If we couldn't find an existing window, try to use the next window
in the chain. */
- if (!new && window->next)
- new = window->next;
+ if (!new)
+ {
+ if (window->next)
+ new = window->next;
+ /* If there is more than one window, wrap around. */
+ else if (window != windows)
+ new = windows;
+ }
/* If we still don't have a window, make a new one to contain the list. */
if (!new)
@@ -258,10 +262,16 @@ DECLARE_INFO_COMMAND (list_visited_nodes,
node = get_visited_nodes ((Function *)NULL);
name_internal_node (node, nodemenu_nodename);
+#if 0
/* Even if this is an internal node, we don't want the window
system to treat it specially. So we turn off the internalness
of it here. */
+ /* Why? We depend on internal_info_node_p returning true, so we must
+ not remove the flag. Otherwise, the *Node Menu* nodes themselves
+ appear in the node menu. --Andreas Schwab
+ <schwab@issan.informatik.uni-dortmund.de>. */
node->flags &= ~N_IsInternal;
+#endif
/* If this window is already showing a node menu, reuse the existing node
slot. */
@@ -270,7 +280,7 @@ DECLARE_INFO_COMMAND (list_visited_nodes,
#if defined (NOTDEF)
if (internal_info_node_p (new->node) &&
- (strcmp (new->node->nodename, nodemenu_nodename) == 0))
+ (strcmp (new->node->nodename, nodemenu_nodename) == 0))
remember_me = 0;
#endif /* NOTDEF */
@@ -284,7 +294,7 @@ DECLARE_INFO_COMMAND (list_visited_nodes,
}
DECLARE_INFO_COMMAND (select_visited_node,
- "Select a node which has been previously visited in a visible window")
+ _("Select a node which has been previously visited in a visible window"))
{
char *line;
NODE *node;
@@ -296,7 +306,7 @@ DECLARE_INFO_COMMAND (select_visited_node,
free (node);
line =
- info_read_completing_in_echo_area (window, "Select visited node: ", menu);
+ info_read_completing_in_echo_area (window, _("Select visited node: "), menu);
window = active_window;
@@ -316,9 +326,9 @@ DECLARE_INFO_COMMAND (select_visited_node,
entry = info_get_labeled_reference (line, menu);
if (!entry)
- info_error ("The reference disappeared! (%s).", line);
+ info_error (_("The reference disappeared! (%s)."), line);
else
- info_select_reference (window, entry);
+ info_select_reference (window, entry);
}
free (line);
diff --git a/gnu/usr.bin/texinfo/info/nodes.h b/gnu/usr.bin/texinfo/info/nodes.h
index 7ddea17ddda..c39b4bc81b1 100644
--- a/gnu/usr.bin/texinfo/info/nodes.h
+++ b/gnu/usr.bin/texinfo/info/nodes.h
@@ -1,9 +1,10 @@
-/* nodes.h -- How we represent nodes internally. */
+/* nodes.h -- How we represent nodes internally.
+ $Id: nodes.h,v 1.2 1999/01/11 16:38:08 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
+ This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,15 +22,15 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#if !defined (_NODES_H_)
-#define _NODES_H_
+#if !defined (NODES_H)
+#define NODES_H
-#include "general.h"
+#include "info.h"
/* **************************************************************** */
-/* */
-/* User Code Interface */
-/* */
+/* */
+/* User Code Interface */
+/* */
/* **************************************************************** */
/* Callers generally only want the node itself. This structure is used
@@ -41,45 +42,45 @@
paths, so you might have: node->filename = "/usr/gnu/info/emacs-1",
with node->parent = "/usr/gnu/info/emacs". */
typedef struct {
- char *filename; /* The physical file containing this node. */
- char *parent; /* Non-null is the logical file name. */
- char *nodename; /* The name of this node. */
- char *contents; /* Characters appearing in this node. */
- long nodelen; /* The length of the CONTENTS member. */
- int flags; /* See immediately below. */
+ char *filename; /* The physical file containing this node. */
+ char *parent; /* Non-null is the logical file name. */
+ char *nodename; /* The name of this node. */
+ char *contents; /* Characters appearing in this node. */
+ long nodelen; /* The length of the CONTENTS member. */
+ int flags; /* See immediately below. */
} NODE;
/* Defines that can appear in NODE->flags. All informative. */
-#define N_HasTagsTable 0x01 /* This node was found through a tags table. */
-#define N_TagsIndirect 0x02 /* The tags table was an indirect one. */
-#define N_UpdateTags 0x04 /* The tags table is out of date. */
-#define N_IsCompressed 0x08 /* The file is compressed on disk. */
-#define N_IsInternal 0x10 /* This node was made by Info. */
-#define N_CannotGC 0x20 /* File buffer cannot be gc'ed. */
-#define N_IsManPage 0x40 /* This node is a Un*x manpage. */
+#define N_HasTagsTable 0x01 /* This node was found through a tags table. */
+#define N_TagsIndirect 0x02 /* The tags table was an indirect one. */
+#define N_UpdateTags 0x04 /* The tags table is out of date. */
+#define N_IsCompressed 0x08 /* The file is compressed on disk. */
+#define N_IsInternal 0x10 /* This node was made by Info. */
+#define N_CannotGC 0x20 /* File buffer cannot be gc'ed. */
+#define N_IsManPage 0x40 /* This node is a Un*x manpage. */
/* **************************************************************** */
-/* */
-/* Internal Data Structures */
-/* */
+/* */
+/* Internal Data Structures */
+/* */
/* **************************************************************** */
/* Some defines describing details about Info file contents. */
/* String Constants. */
-#define INFO_FILE_LABEL "File:"
-#define INFO_NODE_LABEL "Node:"
-#define INFO_PREV_LABEL "Prev:"
-#define INFO_ALTPREV_LABEL "Previous:"
-#define INFO_NEXT_LABEL "Next:"
-#define INFO_UP_LABEL "Up:"
-#define INFO_MENU_LABEL "\n* Menu:"
-#define INFO_MENU_ENTRY_LABEL "\n* "
-#define INFO_XREF_LABEL "*Note"
-#define TAGS_TABLE_END_LABEL "\nEnd Tag Table"
-#define TAGS_TABLE_BEG_LABEL "Tag Table:\n"
-#define INDIRECT_TAGS_TABLE_LABEL "Indirect:\n"
-#define TAGS_TABLE_IS_INDIRECT_LABEL "(Indirect)"
+#define INFO_FILE_LABEL "File:"
+#define INFO_NODE_LABEL "Node:"
+#define INFO_PREV_LABEL "Prev:"
+#define INFO_ALTPREV_LABEL "Previous:"
+#define INFO_NEXT_LABEL "Next:"
+#define INFO_UP_LABEL "Up:"
+#define INFO_MENU_LABEL "\n* Menu:"
+#define INFO_MENU_ENTRY_LABEL "\n* "
+#define INFO_XREF_LABEL "*Note"
+#define TAGS_TABLE_END_LABEL "\nEnd Tag Table"
+#define TAGS_TABLE_BEG_LABEL "Tag Table:\n"
+#define INDIRECT_TAGS_TABLE_LABEL "Indirect:\n"
+#define TAGS_TABLE_IS_INDIRECT_LABEL "(Indirect)"
/* Character Constants. */
#define INFO_COOKIE '\037'
@@ -94,10 +95,10 @@ typedef struct {
member in the structure below simply contains the name of the current
file. The following structure describes a single node within a file. */
typedef struct {
- char *filename; /* The file where this node can be found. */
- char *nodename; /* The node pointed to by this tag. */
- long nodestart; /* The offset of the start of this node. */
- long nodelen; /* The length of this node. */
+ char *filename; /* The file where this node can be found. */
+ char *nodename; /* The node pointed to by this tag. */
+ long nodestart; /* The offset of the start of this node. */
+ long nodelen; /* The length of this node. */
} TAG;
/* The following structure is used to remember information about the contents
@@ -108,21 +109,21 @@ typedef struct {
corresponding SLOTS member which says how many slots have been allocated
(with malloc ()) for this array. */
typedef struct {
- char *filename; /* The filename used to find this file. */
- char *fullpath; /* The full pathname of this info file. */
- struct stat finfo; /* Information about this file. */
- char *contents; /* The contents of this particular file. */
- long filesize; /* The number of bytes this file expands to. */
- char **subfiles; /* If non-null, the list of subfiles. */
- TAG **tags; /* If non-null, the indirect tags table. */
- int tags_slots; /* Number of slots allocated for TAGS. */
- int flags; /* Various flags. Mimics of N_* flags. */
+ char *filename; /* The filename used to find this file. */
+ char *fullpath; /* The full pathname of this info file. */
+ struct stat finfo; /* Information about this file. */
+ char *contents; /* The contents of this particular file. */
+ long filesize; /* The number of bytes this file expands to. */
+ char **subfiles; /* If non-null, the list of subfiles. */
+ TAG **tags; /* If non-null, the indirect tags table. */
+ int tags_slots; /* Number of slots allocated for TAGS. */
+ int flags; /* Various flags. Mimics of N_* flags. */
} FILE_BUFFER;
/* **************************************************************** */
-/* */
-/* Externally Visible Functions */
-/* */
+/* */
+/* Externally Visible Functions */
+/* */
/* **************************************************************** */
/* Array of FILE_BUFFER * which represents the currently loaded info files. */
@@ -165,4 +166,4 @@ extern char *info_recent_file_error;
/* Create a new, empty file buffer. */
extern FILE_BUFFER *make_file_buffer ();
-#endif /* !_NODES_H_ */
+#endif /* !NODES_H */
diff --git a/gnu/usr.bin/texinfo/info/search.h b/gnu/usr.bin/texinfo/info/search.h
index 72695c3f0b6..0fafa165eea 100644
--- a/gnu/usr.bin/texinfo/info/search.h
+++ b/gnu/usr.bin/texinfo/info/search.h
@@ -1,9 +1,10 @@
-/* search.h -- Structure used to search large bodies of text, with bounds. */
+/* search.h -- Structure used to search large bodies of text, with bounds.
+ $Id: search.h,v 1.2 1999/01/11 16:38:09 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
+ This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -31,18 +32,18 @@
They return a long, which is the offset from the start of the buffer
at which the match was found. An offset of -1 indicates failure. */
-#if !defined (_SEARCH_H_)
-#define _SEARCH_H_
+#ifndef INFO_SEARCH_H
+#define INFO_SEARCH_H
typedef struct {
- char *buffer; /* The buffer of text to search. */
- long start; /* Offset of the start of the search. */
- long end; /* Offset of the end of the searh. */
- int flags; /* Flags controlling the type of search. */
+ char *buffer; /* The buffer of text to search. */
+ long start; /* Offset of the start of the search. */
+ long end; /* Offset of the end of the searh. */
+ int flags; /* Flags controlling the type of search. */
} SEARCH_BINDING;
-#define S_FoldCase 0x01 /* Set means fold case in searches. */
-#define S_SkipDest 0x02 /* Set means return pointing after the dest. */
+#define S_FoldCase 0x01 /* Set means fold case in searches. */
+#define S_SkipDest 0x02 /* Set means return pointing after the dest. */
SEARCH_BINDING *make_binding (), *copy_binding ();
extern long search_forward (), search_backward (), search ();
@@ -71,5 +72,4 @@ extern int skip_node_characters (), skip_node_separator ();
extern long find_node_separator (), find_tags_table ();
extern long find_node_in_binding ();
-#endif /* !_SEARCH_H_ */
-
+#endif /* not INFO_SEARCH_H */
diff --git a/gnu/usr.bin/texinfo/info/session.c b/gnu/usr.bin/texinfo/info/session.c
index 50befb8388b..2e7818487be 100644
--- a/gnu/usr.bin/texinfo/info/session.c
+++ b/gnu/usr.bin/texinfo/info/session.c
@@ -1,9 +1,7 @@
-/* session.c -- The user windowing interface to Info. */
+/* session.c -- The user windowing interface to Info.
+ $Id: session.c,v 1.2 1999/01/11 16:38:09 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
- stored in Info format.
-
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 96, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -22,11 +20,7 @@
Written by Brian Fox (bfox@ai.mit.edu). */
#include "info.h"
-#if defined (HAVE_SYS_FILE_H)
-#include <sys/file.h>
-#endif /* HAVE_SYS_FILE_H */
#include <sys/ioctl.h>
-#include <fcntl.h>
#if defined (HAVE_SYS_TIME_H)
# include <sys/time.h>
@@ -41,28 +35,28 @@ static void info_clear_pending_input (), info_set_pending_input ();
static void info_handle_pointer ();
/* **************************************************************** */
-/* */
-/* Running an Info Session */
-/* */
+/* */
+/* Running an Info Session */
+/* */
/* **************************************************************** */
/* The place that we are reading input from. */
-static FILE *info_input_stream = (FILE *)NULL;
+static FILE *info_input_stream = NULL;
/* The last executed command. */
-VFunction *info_last_executed_command = (VFunction *)NULL;
+VFunction *info_last_executed_command = NULL;
/* Becomes non-zero when 'q' is typed to an Info window. */
int quit_info_immediately = 0;
/* Array of structures describing for each window which nodes have been
visited in that window. */
-INFO_WINDOW **info_windows = (INFO_WINDOW **)NULL;
+INFO_WINDOW **info_windows = NULL;
/* Where to add the next window, if we need to add one. */
static int info_windows_index = 0;
-/* Number of slots allocated to INFO_WINDOWS. */
+/* Number of slots allocated to `info_windows'. */
static int info_windows_slots = 0;
void remember_window_and_node (), forget_window_and_nodes ();
@@ -87,52 +81,52 @@ begin_multiple_window_info_session (filename, nodenames)
node = info_get_node (filename, nodenames[i]);
if (!node)
- break;
+ break;
/* If this is the first node, initialize the info session. */
if (!window)
- {
- initialize_info_session (node);
- window = active_window;
- }
+ {
+ initialize_info_session (node, 1);
+ window = active_window;
+ }
else
- {
- /* Find the largest window in WINDOWS, and make that be the active
- one. Then split it and add our window and node to the list
- of remembered windows and nodes. Then tile the windows. */
- register WINDOW *win, *largest = (WINDOW *)NULL;
- int max_height = 0;
-
- for (win = windows; win; win = win->next)
- if (win->height > max_height)
- {
- max_height = win->height;
- largest = win;
- }
-
- if (!largest)
- {
- display_update_display (windows);
- info_error (CANT_FIND_WIND);
- info_session ();
- exit (0);
- }
-
- active_window = largest;
- window = window_make_window (node);
- if (window)
- {
- window_tile_windows (TILE_INTERNALS);
- remember_window_and_node (window, node);
- }
- else
- {
- display_update_display (windows);
- info_error (WIN_TOO_SMALL);
- info_session ();
- exit (0);
- }
- }
+ {
+ /* Find the largest window in WINDOWS, and make that be the active
+ one. Then split it and add our window and node to the list
+ of remembered windows and nodes. Then tile the windows. */
+ register WINDOW *win, *largest = (WINDOW *)NULL;
+ int max_height = 0;
+
+ for (win = windows; win; win = win->next)
+ if (win->height > max_height)
+ {
+ max_height = win->height;
+ largest = win;
+ }
+
+ if (!largest)
+ {
+ display_update_display (windows);
+ info_error (CANT_FIND_WIND);
+ info_session ();
+ exit (0);
+ }
+
+ active_window = largest;
+ window = window_make_window (node);
+ if (window)
+ {
+ window_tile_windows (TILE_INTERNALS);
+ remember_window_and_node (window, node);
+ }
+ else
+ {
+ display_update_display (windows);
+ info_error (WIN_TOO_SMALL);
+ info_session ();
+ exit (0);
+ }
+ }
}
display_startup_message_and_start ();
}
@@ -145,7 +139,7 @@ begin_info_session_with_error (initial_node, format, arg)
char *format;
void *arg;
{
- initialize_info_session (initial_node);
+ initialize_info_session (initial_node, 1);
info_error (format, arg, (void *)NULL);
info_session ();
}
@@ -155,7 +149,7 @@ void
begin_info_session (initial_node)
NODE *initial_node;
{
- initialize_info_session (initial_node);
+ initialize_info_session (initial_node, 1);
display_startup_message_and_start ();
}
@@ -165,7 +159,7 @@ display_startup_message_and_start ()
char *format;
format = replace_in_documentation
- ("Welcome to Info version %s. \"\\[get-help-window]\" for help, \"\\[menu-item]\" for menu item.");
+ (_("Welcome to Info version %s. \"\\[get-help-window]\" for help, \"\\[menu-item]\" for menu item."));
window_message_in_echo_area (format, version_string ());
info_session ();
@@ -175,9 +169,8 @@ display_startup_message_and_start ()
void
info_session ()
{
- terminal_prep_terminal ();
display_update_display (windows);
- info_last_executed_command = (VFunction *)NULL;
+ info_last_executed_command = NULL;
info_read_and_dispatch ();
/* On program exit, leave the cursor at the bottom of the window, and
restore the terminal I/O. */
@@ -202,19 +195,19 @@ info_read_and_dispatch ()
int lk;
/* If we haven't just gone up or down a line, there is no
- goal column for this window. */
+ goal column for this window. */
if ((info_last_executed_command != info_next_line) &&
- (info_last_executed_command != info_prev_line))
- active_window->goal_column = -1;
+ (info_last_executed_command != info_prev_line))
+ active_window->goal_column = -1;
if (echo_area_is_active)
- {
- lk = echo_area_last_command_was_kill;
- echo_area_prep_read ();
- }
+ {
+ lk = echo_area_last_command_was_kill;
+ echo_area_prep_read ();
+ }
if (!info_any_buffered_input_p ())
- display_update_display (windows);
+ display_update_display (windows);
display_cursor_at_point (active_window);
info_initialize_numeric_arg ();
@@ -223,9 +216,9 @@ info_read_and_dispatch ()
key = info_get_input_char ();
/* No errors yet. We just read a character, that's all. Only clear
- the echo_area if it is not currently active. */
+ the echo_area if it is not currently active. */
if (!echo_area_is_active)
- window_clear_echo_area ();
+ window_clear_echo_area ();
info_error_was_printed = 0;
@@ -233,26 +226,26 @@ info_read_and_dispatch ()
info_dispatch_on_key (key, active_window->keymap);
if (echo_area_is_active)
- {
- /* Echo area commands that do killing increment the value of
- ECHO_AREA_LAST_COMMAND_WAS_KILL. Thus, if there is no
- change in the value of this variable, the last command
- executed was not a kill command. */
- if (lk == echo_area_last_command_was_kill)
- echo_area_last_command_was_kill = 0;
-
- if (ea_last_executed_command == ea_newline ||
- info_aborted_echo_area)
- {
- ea_last_executed_command = (VFunction *)NULL;
- done = 1;
- }
-
- if (info_last_executed_command == info_quit)
- quit_info_immediately = 1;
- }
+ {
+ /* Echo area commands that do killing increment the value of
+ ECHO_AREA_LAST_COMMAND_WAS_KILL. Thus, if there is no
+ change in the value of this variable, the last command
+ executed was not a kill command. */
+ if (lk == echo_area_last_command_was_kill)
+ echo_area_last_command_was_kill = 0;
+
+ if (ea_last_executed_command == ea_newline ||
+ info_aborted_echo_area)
+ {
+ ea_last_executed_command = (VFunction *)NULL;
+ done = 1;
+ }
+
+ if (info_last_executed_command == info_quit)
+ quit_info_immediately = 1;
+ }
else if (info_last_executed_command == info_quit)
- done = 1;
+ done = 1;
}
}
@@ -260,25 +253,30 @@ info_read_and_dispatch ()
extern void initialize_info_signal_handler ();
/* Initialize the first info session by starting the terminal, window,
- and display systems. */
+ and display systems. If CLEAR_SCREEN is 0, don't clear the screen. */
void
-initialize_info_session (node)
+initialize_info_session (node, clear_screen)
NODE *node;
+ int clear_screen;
{
- char *getenv (), *term_name;
-
- term_name = getenv ("TERM");
+ char *term_name = getenv ("TERM");
terminal_initialize_terminal (term_name);
if (terminal_is_dumb_p)
{
if (!term_name)
- term_name = "dumb";
+ term_name = "dumb";
info_error (TERM_TOO_DUMB, term_name);
exit (1);
}
- terminal_clear_screen ();
+
+ if (clear_screen)
+ {
+ terminal_prep_terminal ();
+ terminal_clear_screen ();
+ }
+
initialize_info_keymaps ();
window_initialize_windows (screenwidth, screenheight);
initialize_info_signal_handler ();
@@ -289,9 +287,13 @@ initialize_info_session (node)
asynchronously deleted (e.g., user resizes window very small). */
window_deletion_notifier = forget_window_and_nodes;
- /* If input has not been redirected yet, make it come from STDIN. */
+ /* If input has not been redirected yet, make it come from unbuffered
+ standard input. */
if (!info_input_stream)
- info_input_stream = stdin;
+ {
+ setbuf(stdin, NULL);
+ info_input_stream = stdin;
+ }
info_windows_initialized_p = 1;
}
@@ -360,10 +362,8 @@ remember_window_and_node (window, node)
WINDOW *window;
NODE *node;
{
- INFO_WINDOW *info_win;
-
/* See if we already have this window in our list. */
- info_win = get_info_window_of_window (window);
+ INFO_WINDOW *info_win = get_info_window_of_window (window);
/* If the window wasn't already on our list, then make a new entry. */
if (!info_win)
@@ -378,21 +378,19 @@ remember_window_and_node (window, node)
info_win->nodes_slots = 0;
add_pointer_to_array (info_win, info_windows_index, info_windows,
- info_windows_slots, 10, INFO_WINDOW *);
+ info_windows_slots, 10, INFO_WINDOW *);
}
/* If this node, the current pagetop, and the current point are the
- same as the last saved node and pagetop, don't really add this to
- the list of history nodes. */
- {
- int ni = info_win->nodes_index - 1;
-
- if ((ni != -1) &&
- (info_win->nodes[ni]->contents == node->contents) &&
- (info_win->pagetops[ni] == window->pagetop) &&
- (info_win->points[ni] == window->point))
- return;
- }
+ same as the current saved node and pagetop, don't really add this to
+ the list of history nodes. This may happen only at the very
+ beginning of the program, I'm not sure. --karl */
+ if (info_win->nodes
+ && info_win->current >= 0
+ && info_win->nodes[info_win->current]->contents == node->contents
+ && info_win->pagetops[info_win->current] == window->pagetop
+ && info_win->points[info_win->current] == window->point)
+ return;
/* Remember this node, the currently displayed pagetop, and the current
location of point in this window. Because we are updating pagetops
@@ -400,22 +398,20 @@ remember_window_and_node (window, node)
add_pointer_to_array macro here. */
if (info_win->nodes_index + 2 >= info_win->nodes_slots)
{
- info_win->nodes = (NODE **)
- xrealloc (info_win->nodes,
- (info_win->nodes_slots += 20) * sizeof (NODE *));
-
- info_win->pagetops = (int *)
- xrealloc (info_win->pagetops, info_win->nodes_slots * sizeof (int));
-
- info_win->points = (long *)
- xrealloc (info_win->points, info_win->nodes_slots * sizeof (long));
+ info_win->nodes_slots += 20;
+ info_win->nodes = (NODE **) xrealloc (info_win->nodes,
+ info_win->nodes_slots * sizeof (NODE *));
+ info_win->pagetops = (int *) xrealloc (info_win->pagetops,
+ info_win->nodes_slots * sizeof (int));
+ info_win->points = (long *) xrealloc (info_win->points,
+ info_win->nodes_slots * sizeof (long));
}
info_win->nodes[info_win->nodes_index] = node;
info_win->pagetops[info_win->nodes_index] = window->pagetop;
info_win->points[info_win->nodes_index] = window->point;
info_win->current = info_win->nodes_index++;
- info_win->nodes[info_win->nodes_index] = (NODE *)NULL;
+ info_win->nodes[info_win->nodes_index] = NULL;
info_win->pagetops[info_win->nodes_index] = 0;
info_win->points[info_win->nodes_index] = 0;
}
@@ -426,18 +422,17 @@ static void
consistency_check_info_windows ()
{
register int i;
- INFO_WINDOW *info_win;
for (i = 0; i < info_windows_index; i++)
{
WINDOW *win;
for (win = windows; win; win = win->next)
- if (win == info_windows[i]->window)
- break;
+ if (win == info_windows[i]->window)
+ break;
if (!win)
- abort ();
+ abort ();
}
}
#endif /* DEBUG_FORGET_WINDOW_AND_NODES */
@@ -458,27 +453,27 @@ forget_window_and_nodes (window)
if (info_win)
{
while (i < info_windows_index)
- {
- info_windows[i] = info_windows[i + 1];
- i++;
- }
+ {
+ info_windows[i] = info_windows[i + 1];
+ i++;
+ }
info_windows_index--;
info_windows[info_windows_index] = (INFO_WINDOW *)NULL;
if (info_win->nodes)
- {
- /* Free the node structures which held onto internal node contents
- here. This doesn't free the contents; we have a garbage collector
- which does that. */
- for (i = 0; info_win->nodes[i]; i++)
- if (internal_info_node_p (info_win->nodes[i]))
- free (info_win->nodes[i]);
- free (info_win->nodes);
-
- maybe_free (info_win->pagetops);
- maybe_free (info_win->points);
- }
+ {
+ /* Free the node structures which held onto internal node contents
+ here. This doesn't free the contents; we have a garbage collector
+ which does that. */
+ for (i = 0; info_win->nodes[i]; i++)
+ if (internal_info_node_p (info_win->nodes[i]))
+ free (info_win->nodes[i]);
+ free (info_win->nodes);
+
+ maybe_free (info_win->pagetops);
+ maybe_free (info_win->points);
+ }
free (info_win);
}
@@ -509,9 +504,9 @@ info_set_node_of_window (window, node)
/* **************************************************************** */
-/* */
-/* Info Movement Commands */
-/* */
+/* */
+/* Info Movement Commands */
+/* */
/* **************************************************************** */
/* Change the pagetop of WINDOW to DESIRED_TOP, perhaps scrolling the screen
@@ -555,8 +550,8 @@ set_window_pagetop (window, desired_top)
amount = desired_top - old_pagetop;
if ((amount >= window->height) ||
- (((window->height - amount) * 10) < window->height))
- return;
+ (((window->height - amount) * 10) < window->height))
+ return;
start = amount + window->first_row;
end = window->height + window->first_row;
@@ -570,8 +565,8 @@ set_window_pagetop (window, desired_top)
amount = old_pagetop - desired_top;
if ((amount >= window->height) ||
- (((window->height - amount) * 10) < window->height))
- return;
+ (((window->height - amount) * 10) < window->height))
+ return;
start = window->first_row;
end = (window->first_row + window->height) - amount;
@@ -619,7 +614,7 @@ move_to_new_line (old, new, window)
int goal;
if (new >= window->line_count || new < 0)
- return;
+ return;
goal = window_get_goal_column (window);
window->goal_column = goal;
@@ -631,7 +626,7 @@ move_to_new_line (old, new, window)
}
/* Move WINDOW's point down to the next line if possible. */
-DECLARE_INFO_COMMAND (info_next_line, "Move down to the next line")
+DECLARE_INFO_COMMAND (info_next_line, _("Move down to the next line"))
{
int old_line, new_line;
@@ -646,7 +641,7 @@ DECLARE_INFO_COMMAND (info_next_line, "Move down to the next line")
}
/* Move WINDOW's point up to the previous line if possible. */
-DECLARE_INFO_COMMAND (info_prev_line, "Move up to the previous line")
+DECLARE_INFO_COMMAND (info_prev_line, _("Move up to the previous line"))
{
int old_line, new_line;
@@ -661,7 +656,7 @@ DECLARE_INFO_COMMAND (info_prev_line, "Move up to the previous line")
}
/* Move WINDOW's point to the end of the true line. */
-DECLARE_INFO_COMMAND (info_end_of_line, "Move to the end of the line")
+DECLARE_INFO_COMMAND (info_end_of_line, _("Move to the end of the line"))
{
register int point, len;
register char *buffer;
@@ -681,7 +676,7 @@ DECLARE_INFO_COMMAND (info_end_of_line, "Move to the end of the line")
}
/* Move WINDOW's point to the beginning of the true line. */
-DECLARE_INFO_COMMAND (info_beginning_of_line, "Move to the start of the line")
+DECLARE_INFO_COMMAND (info_beginning_of_line, _("Move to the start of the line"))
{
register int point;
register char *buffer;
@@ -700,7 +695,7 @@ DECLARE_INFO_COMMAND (info_beginning_of_line, "Move to the start of the line")
}
/* Move point forward in the node. */
-DECLARE_INFO_COMMAND (info_forward_char, "Move forward a character")
+DECLARE_INFO_COMMAND (info_forward_char, _("Move forward a character"))
{
if (count < 0)
info_backward_char (window, -count, key);
@@ -709,14 +704,14 @@ DECLARE_INFO_COMMAND (info_forward_char, "Move forward a character")
window->point += count;
if (window->point >= window->node->nodelen)
- window->point = window->node->nodelen - 1;
+ window->point = window->node->nodelen - 1;
info_show_point (window);
}
}
/* Move point backward in the node. */
-DECLARE_INFO_COMMAND (info_backward_char, "Move backward a character")
+DECLARE_INFO_COMMAND (info_backward_char, _("Move backward a character"))
{
if (count < 0)
info_forward_char (window, -count, key);
@@ -725,7 +720,7 @@ DECLARE_INFO_COMMAND (info_backward_char, "Move backward a character")
window->point -= count;
if (window->point < 0)
- window->point = 0;
+ window->point = 0;
info_show_point (window);
}
@@ -734,7 +729,7 @@ DECLARE_INFO_COMMAND (info_backward_char, "Move backward a character")
#define alphabetic(c) (islower (c) || isupper (c) || isdigit (c))
/* Move forward a word in this node. */
-DECLARE_INFO_COMMAND (info_forward_word, "Move forward a word")
+DECLARE_INFO_COMMAND (info_forward_word, _("Move forward a word"))
{
long point;
char *buffer;
@@ -753,37 +748,37 @@ DECLARE_INFO_COMMAND (info_forward_word, "Move forward a word")
while (count)
{
if (point + 1 >= end)
- return;
+ return;
/* If we are not in a word, move forward until we are in one.
- Then, move forward until we hit a non-alphabetic character. */
+ Then, move forward until we hit a non-alphabetic character. */
c = buffer[point];
if (!alphabetic (c))
- {
- while (++point < end)
- {
- c = buffer[point];
- if (alphabetic (c))
- break;
- }
- }
+ {
+ while (++point < end)
+ {
+ c = buffer[point];
+ if (alphabetic (c))
+ break;
+ }
+ }
if (point >= end) return;
while (++point < end)
- {
- c = buffer[point];
- if (!alphabetic (c))
- break;
- }
+ {
+ c = buffer[point];
+ if (!alphabetic (c))
+ break;
+ }
--count;
}
window->point = point;
info_show_point (window);
}
-DECLARE_INFO_COMMAND (info_backward_word, "Move backward a word")
+DECLARE_INFO_COMMAND (info_backward_word, _("Move backward a word"))
{
long point;
char *buffer;
@@ -801,31 +796,31 @@ DECLARE_INFO_COMMAND (info_backward_word, "Move backward a word")
while (count)
{
if (point == 0)
- break;
+ break;
/* Like info_forward_word (), except that we look at the
- characters just before point. */
+ characters just before point. */
c = buffer[point - 1];
if (!alphabetic (c))
- {
- while (--point)
- {
- c = buffer[point - 1];
- if (alphabetic (c))
- break;
- }
- }
+ {
+ while (--point)
+ {
+ c = buffer[point - 1];
+ if (alphabetic (c))
+ break;
+ }
+ }
while (point)
- {
- c = buffer[point - 1];
- if (!alphabetic (c))
- break;
- else
- --point;
- }
+ {
+ c = buffer[point - 1];
+ if (!alphabetic (c))
+ break;
+ else
+ --point;
+ }
--count;
}
window->point = point;
@@ -857,9 +852,9 @@ times_description (count)
break;
if (counter_names[i])
- sprintf (td_buffer, "%s%s", counter_names[i], count > 2 ? " times" : "");
+ sprintf (td_buffer, "%s%s", counter_names[i], count > 2 ? _(" times") : "");
else
- sprintf (td_buffer, "%d times", count);
+ sprintf (td_buffer, _("%d times"), count);
return (td_buffer);
}
@@ -868,11 +863,11 @@ times_description (count)
already at the bottom of a node. Possible values are defined in session.h.
The meanings are:
- IS_Continuous Try to get first menu item, or failing that, the
- "Next:" pointer, or failing that, the "Up:" and
- "Next:" of the up.
- IS_NextOnly Try to get "Next:" menu item.
- IS_PageOnly Simply give up at the bottom of a node. */
+ IS_Continuous Try to get first menu item, or failing that, the
+ "Next:" pointer, or failing that, the "Up:" and
+ "Next:" of the up.
+ IS_NextOnly Try to get "Next:" menu item.
+ IS_PageOnly Simply give up at the bottom of a node. */
int info_scroll_behaviour = IS_Continuous;
@@ -897,136 +892,136 @@ forward_move_node_structure (window, behaviour)
case IS_NextOnly:
info_next_label_of_node (window->node);
if (!info_parsed_nodename && !info_parsed_filename)
- info_error ("No \"Next\" pointer for this node.");
+ info_error (_("No \"Next\" pointer for this node."));
else
- {
- window_message_in_echo_area ("Following \"Next\" node...");
- info_handle_pointer ("Next", window);
- }
+ {
+ window_message_in_echo_area (_("Following \"Next\" node..."));
+ info_handle_pointer (_("Next"), window);
+ }
break;
case IS_Continuous:
{
- /* First things first. If this node contains a menu, move down
- into the menu. */
- {
- REFERENCE **menu;
-
- menu = info_menu_of_node (window->node);
-
- if (menu)
- {
- info_free_references (menu);
- window_message_in_echo_area ("Selecting first menu item...");
- info_menu_digit (window, 1, '1');
- return;
- }
- }
-
- /* Okay, this node does not contain a menu. If it contains a
- "Next:" pointer, use that. */
- info_next_label_of_node (window->node);
- if (info_label_was_found)
- {
- window_message_in_echo_area ("Selecting \"Next\" node...");
- info_handle_pointer ("Next", window);
- return;
- }
-
- /* Okay, there wasn't a "Next:" for this node. Move "Up:" until we
- can move "Next:". If that isn't possible, complain that there
- are no more nodes. */
- {
- int up_counter, old_current;
- INFO_WINDOW *info_win;
-
- /* Remember the current node and location. */
- info_win = get_info_window_of_window (window);
- old_current = info_win->current;
-
- /* Back up through the "Up:" pointers until we have found a "Next:"
- that isn't the same as the first menu item found in that node. */
- up_counter = 0;
- while (!info_error_was_printed)
- {
- info_up_label_of_node (window->node);
- if (info_label_was_found)
- {
- info_handle_pointer ("Up", window);
- if (info_error_was_printed)
- continue;
-
- up_counter++;
-
- info_next_label_of_node (window->node);
-
- /* If no "Next" pointer, keep backing up. */
- if (!info_label_was_found)
- continue;
-
- /* If this node's first menu item is the same as this node's
- Next pointer, keep backing up. */
- if (!info_parsed_filename)
- {
- REFERENCE **menu;
- char *next_nodename;
-
- /* Remember the name of the Next node, since reading
- the menu can overwrite the contents of the
- info_parsed_xxx strings. */
- next_nodename = strdup (info_parsed_nodename);
-
- menu = info_menu_of_node (window->node);
- if (menu &&
- (strcmp
- (menu[0]->nodename, next_nodename) == 0))
- {
- info_free_references (menu);
- free (next_nodename);
- continue;
- }
- else
- {
- /* Restore the world to where it was before
- reading the menu contents. */
- info_free_references (menu);
- free (next_nodename);
- info_next_label_of_node (window->node);
- }
- }
-
- /* This node has a "Next" pointer, and it is not the
- same as the first menu item found in this node. */
- window_message_in_echo_area
- ("Moving \"Up\" %s, then \"Next\".",
- times_description (up_counter));
-
- info_handle_pointer ("Next", window);
- return;
- }
- else
- {
- /* No more "Up" pointers. Print an error, and call it
- quits. */
- register int i;
-
- for (i = 0; i < up_counter; i++)
- {
- info_win->nodes_index--;
- free (info_win->nodes[info_win->nodes_index]);
- info_win->nodes[info_win->nodes_index] = (NODE *)NULL;
- }
- info_win->current = old_current;
- window->node = info_win->nodes[old_current];
- window->pagetop = info_win->pagetops[old_current];
- window->point = info_win->points[old_current];
- recalculate_line_starts (window);
- window->flags |= W_UpdateWindow;
- info_error ("No more nodes.");
- }
- }
- }
- break;
+ /* First things first. If this node contains a menu, move down
+ into the menu. */
+ {
+ REFERENCE **menu;
+
+ menu = info_menu_of_node (window->node);
+
+ if (menu)
+ {
+ info_free_references (menu);
+ window_message_in_echo_area (_("Selecting first menu item..."));
+ info_menu_digit (window, 1, '1');
+ return;
+ }
+ }
+
+ /* Okay, this node does not contain a menu. If it contains a
+ "Next:" pointer, use that. */
+ info_next_label_of_node (window->node);
+ if (info_label_was_found)
+ {
+ window_message_in_echo_area (_("Selecting \"Next\" node..."));
+ info_handle_pointer (_("Next"), window);
+ return;
+ }
+
+ /* Okay, there wasn't a "Next:" for this node. Move "Up:" until we
+ can move "Next:". If that isn't possible, complain that there
+ are no more nodes. */
+ {
+ int up_counter, old_current;
+ INFO_WINDOW *info_win;
+
+ /* Remember the current node and location. */
+ info_win = get_info_window_of_window (window);
+ old_current = info_win->current;
+
+ /* Back up through the "Up:" pointers until we have found a "Next:"
+ that isn't the same as the first menu item found in that node. */
+ up_counter = 0;
+ while (!info_error_was_printed)
+ {
+ info_up_label_of_node (window->node);
+ if (info_label_was_found)
+ {
+ info_handle_pointer (_("Up"), window);
+ if (info_error_was_printed)
+ continue;
+
+ up_counter++;
+
+ info_next_label_of_node (window->node);
+
+ /* If no "Next" pointer, keep backing up. */
+ if (!info_label_was_found)
+ continue;
+
+ /* If this node's first menu item is the same as this node's
+ Next pointer, keep backing up. */
+ if (!info_parsed_filename)
+ {
+ REFERENCE **menu;
+ char *next_nodename;
+
+ /* Remember the name of the Next node, since reading
+ the menu can overwrite the contents of the
+ info_parsed_xxx strings. */
+ next_nodename = xstrdup (info_parsed_nodename);
+
+ menu = info_menu_of_node (window->node);
+ if (menu &&
+ (strcmp
+ (menu[0]->nodename, next_nodename) == 0))
+ {
+ info_free_references (menu);
+ free (next_nodename);
+ continue;
+ }
+ else
+ {
+ /* Restore the world to where it was before
+ reading the menu contents. */
+ info_free_references (menu);
+ free (next_nodename);
+ info_next_label_of_node (window->node);
+ }
+ }
+
+ /* This node has a "Next" pointer, and it is not the
+ same as the first menu item found in this node. */
+ window_message_in_echo_area
+ ("Moving \"Up\" %s, then \"Next\".",
+ times_description (up_counter));
+
+ info_handle_pointer (_("Next"), window);
+ return;
+ }
+ else
+ {
+ /* No more "Up" pointers. Print an error, and call it
+ quits. */
+ register int i;
+
+ for (i = 0; i < up_counter; i++)
+ {
+ info_win->nodes_index--;
+ free (info_win->nodes[info_win->nodes_index]);
+ info_win->nodes[info_win->nodes_index] = (NODE *)NULL;
+ }
+ info_win->current = old_current;
+ window->node = info_win->nodes[old_current];
+ window->pagetop = info_win->pagetops[old_current];
+ window->point = info_win->points[old_current];
+ recalculate_line_starts (window);
+ window->flags |= W_UpdateWindow;
+ info_error (_("No more nodes."));
+ }
+ }
+ }
+ break;
}
}
}
@@ -1046,115 +1041,115 @@ backward_move_node_structure (window, behaviour)
case IS_NextOnly:
info_prev_label_of_node (window->node);
if (!info_parsed_nodename && !info_parsed_filename)
- info_error ("No \"Prev\" for this node.");
+ info_error (_("No \"Prev\" for this node."));
else
- {
- window_message_in_echo_area ("Moving \"Prev\" in this window.");
- info_handle_pointer ("Prev", window);
- }
+ {
+ window_message_in_echo_area (_("Moving \"Prev\" in this window."));
+ info_handle_pointer (_("Prev"), window);
+ }
break;
case IS_Continuous:
info_prev_label_of_node (window->node);
if (!info_parsed_nodename && !info_parsed_filename)
- {
- info_up_label_of_node (window->node);
- if (!info_parsed_nodename && !info_parsed_filename)
- info_error ("No \"Prev\" or \"Up\" for this node.");
- else
- {
- window_message_in_echo_area ("Moving \"Up\" in this window.");
- info_handle_pointer ("Up", window);
- }
- }
+ {
+ info_up_label_of_node (window->node);
+ if (!info_parsed_nodename && !info_parsed_filename)
+ info_error (_("No \"Prev\" or \"Up\" for this node."));
+ else
+ {
+ window_message_in_echo_area (_("Moving \"Up\" in this window."));
+ info_handle_pointer (_("Up"), window);
+ }
+ }
else
- {
- REFERENCE **menu;
- int inhibit_menu_traversing = 0;
-
- /* Watch out! If this node's Prev is the same as the Up, then
- move Up. Otherwise, we could move Prev, and then to the last
- menu item in the Prev. This would cause the user to loop
- through a subsection of the info file. */
- if (!info_parsed_filename && info_parsed_nodename)
- {
- char *pnode;
-
- pnode = strdup (info_parsed_nodename);
- info_up_label_of_node (window->node);
-
- if (!info_parsed_filename && info_parsed_nodename &&
- strcmp (info_parsed_nodename, pnode) == 0)
- {
- /* The nodes are the same. Inhibit moving to the last
- menu item. */
- free (pnode);
- inhibit_menu_traversing = 1;
- }
- else
- {
- free (pnode);
- info_prev_label_of_node (window->node);
- }
- }
-
- /* Move to the previous node. If this node now contains a menu,
- and we have not inhibited movement to it, move to the node
- corresponding to the last menu item. */
- window_message_in_echo_area ("Moving \"Prev\" in this window.");
- info_handle_pointer ("Prev", window);
-
- if (!inhibit_menu_traversing)
- {
- while (!info_error_was_printed &&
- (menu = info_menu_of_node (window->node)))
- {
- info_free_references (menu);
- window_message_in_echo_area
- ("Moving to \"Prev\"'s last menu item.");
- info_menu_digit (window, 1, '0');
- }
- }
- }
+ {
+ REFERENCE **menu;
+ int inhibit_menu_traversing = 0;
+
+ /* Watch out! If this node's Prev is the same as the Up, then
+ move Up. Otherwise, we could move Prev, and then to the last
+ menu item in the Prev. This would cause the user to loop
+ through a subsection of the info file. */
+ if (!info_parsed_filename && info_parsed_nodename)
+ {
+ char *pnode;
+
+ pnode = xstrdup (info_parsed_nodename);
+ info_up_label_of_node (window->node);
+
+ if (!info_parsed_filename && info_parsed_nodename &&
+ strcmp (info_parsed_nodename, pnode) == 0)
+ {
+ /* The nodes are the same. Inhibit moving to the last
+ menu item. */
+ free (pnode);
+ inhibit_menu_traversing = 1;
+ }
+ else
+ {
+ free (pnode);
+ info_prev_label_of_node (window->node);
+ }
+ }
+
+ /* Move to the previous node. If this node now contains a menu,
+ and we have not inhibited movement to it, move to the node
+ corresponding to the last menu item. */
+ window_message_in_echo_area (_("Moving \"Prev\" in this window."));
+ info_handle_pointer (_("Prev"), window);
+
+ if (!inhibit_menu_traversing)
+ {
+ while (!info_error_was_printed &&
+ (menu = info_menu_of_node (window->node)))
+ {
+ info_free_references (menu);
+ window_message_in_echo_area
+ (_("Moving to \"Prev\"'s last menu item."));
+ info_menu_digit (window, 1, '0');
+ }
+ }
+ }
break;
}
}
/* Move continuously forward through the node structure of this info file. */
DECLARE_INFO_COMMAND (info_global_next_node,
- "Move forwards or down through node structure")
+ _("Move forwards or down through node structure"))
{
if (count < 0)
info_global_prev_node (window, -count, key);
else
{
while (count && !info_error_was_printed)
- {
- forward_move_node_structure (window, IS_Continuous);
- count--;
- }
+ {
+ forward_move_node_structure (window, IS_Continuous);
+ count--;
+ }
}
}
/* Move continuously backward through the node structure of this info file. */
DECLARE_INFO_COMMAND (info_global_prev_node,
- "Move backwards or up through node structure")
+ _("Move backwards or up through node structure"))
{
if (count < 0)
info_global_next_node (window, -count, key);
else
{
while (count && !info_error_was_printed)
- {
- backward_move_node_structure (window, IS_Continuous);
- count--;
- }
+ {
+ backward_move_node_structure (window, IS_Continuous);
+ count--;
+ }
}
}
/* Show the next screen of WINDOW's node. */
-DECLARE_INFO_COMMAND (info_scroll_forward, "Scroll forward in this window")
+DECLARE_INFO_COMMAND (info_scroll_forward, _("Scroll forward in this window"))
{
if (count < 0)
info_scroll_backward (window, -count, key);
@@ -1163,43 +1158,43 @@ DECLARE_INFO_COMMAND (info_scroll_forward, "Scroll forward in this window")
int desired_top;
/* Without an explicit numeric argument, scroll the bottom two
- lines to the top of this window, Or, if at bottom of window,
- and the user wishes to scroll through nodes get the "Next" node
- for this window. */
+ lines to the top of this window, Or, if at bottom of window,
+ and the user wishes to scroll through nodes get the "Next" node
+ for this window. */
if (!info_explicit_arg && count == 1)
- {
- desired_top = window->pagetop + (window->height - 2);
-
- /* If there are no more lines to scroll here, error, or get
- another node, depending on INFO_SCROLL_BEHAVIOUR. */
- if (desired_top > window->line_count)
- {
- int behaviour = info_scroll_behaviour;
-
- /* Here is a hack. If the key being used is not SPC, do the
- PageOnly behaviour. */
- if (key != SPC && key != DEL)
- behaviour = IS_PageOnly;
-
- forward_move_node_structure (window, behaviour);
- return;
- }
- }
+ {
+ desired_top = window->pagetop + (window->height - 2);
+
+ /* If there are no more lines to scroll here, error, or get
+ another node, depending on INFO_SCROLL_BEHAVIOUR. */
+ if (desired_top > window->line_count)
+ {
+ int behaviour = info_scroll_behaviour;
+
+ /* Here is a hack. If the key being used is not SPC, do the
+ PageOnly behaviour. */
+ if (key != SPC && key != DEL)
+ behaviour = IS_PageOnly;
+
+ forward_move_node_structure (window, behaviour);
+ return;
+ }
+ }
else
- desired_top = window->pagetop + count;
+ desired_top = window->pagetop + count;
if (desired_top >= window->line_count)
- desired_top = window->line_count - 2;
+ desired_top = window->line_count - 2;
if (window->pagetop > desired_top)
- return;
+ return;
else
- set_window_pagetop (window, desired_top);
+ set_window_pagetop (window, desired_top);
}
}
/* Show the previous screen of WINDOW's node. */
-DECLARE_INFO_COMMAND (info_scroll_backward, "Scroll backward in this window")
+DECLARE_INFO_COMMAND (info_scroll_backward, _("Scroll backward in this window"))
{
if (count < 0)
info_scroll_forward (window, -count, key);
@@ -1208,58 +1203,58 @@ DECLARE_INFO_COMMAND (info_scroll_backward, "Scroll backward in this window")
int desired_top;
/* Without an explicit numeric argument, scroll the top two lines
- to the bottom of this window, or move to the previous, or Up'th
- node. */
+ to the bottom of this window, or move to the previous, or Up'th
+ node. */
if (!info_explicit_arg && count == 1)
- {
- desired_top = window->pagetop - (window->height - 2);
-
- if ((desired_top < 0) && (window->pagetop == 0))
- {
- int behaviour = info_scroll_behaviour;
-
- /* Same kind of hack as in info_scroll_forward. If the key
- used to invoke this command is not DEL, do only the PageOnly
- behaviour. */
- if (key != DEL && key != SPC)
- behaviour = IS_PageOnly;
-
- backward_move_node_structure (window, behaviour);
- return;
- }
- }
+ {
+ desired_top = window->pagetop - (window->height - 2);
+
+ if ((desired_top < 0) && (window->pagetop == 0))
+ {
+ int behaviour = info_scroll_behaviour;
+
+ /* Same kind of hack as in info_scroll_forward. If the key
+ used to invoke this command is not DEL, do only the PageOnly
+ behaviour. */
+ if (key != DEL && key != SPC)
+ behaviour = IS_PageOnly;
+
+ backward_move_node_structure (window, behaviour);
+ return;
+ }
+ }
else
- desired_top = window->pagetop - count;
+ desired_top = window->pagetop - count;
if (desired_top < 0)
- desired_top = 0;
+ desired_top = 0;
set_window_pagetop (window, desired_top);
}
}
/* Move to the beginning of the node. */
-DECLARE_INFO_COMMAND (info_beginning_of_node, "Move to the start of this node")
+DECLARE_INFO_COMMAND (info_beginning_of_node, _("Move to the start of this node"))
{
window->pagetop = window->point = 0;
window->flags |= W_UpdateWindow;
}
/* Move to the end of the node. */
-DECLARE_INFO_COMMAND (info_end_of_node, "Move to the end of this node")
+DECLARE_INFO_COMMAND (info_end_of_node, _("Move to the end of this node"))
{
window->point = window->node->nodelen - 1;
info_show_point (window);
}
/* **************************************************************** */
-/* */
-/* Commands for Manipulating Windows */
-/* */
+/* */
+/* Commands for Manipulating Windows */
+/* */
/* **************************************************************** */
/* Make the next window in the chain be the active window. */
-DECLARE_INFO_COMMAND (info_next_window, "Select the next window")
+DECLARE_INFO_COMMAND (info_next_window, _("Select the next window"))
{
if (count < 0)
{
@@ -1277,20 +1272,20 @@ DECLARE_INFO_COMMAND (info_next_window, "Select the next window")
while (count--)
{
if (window->next)
- window = window->next;
+ window = window->next;
else
- {
- if (window == the_echo_area || !echo_area_is_active)
- window = windows;
- else
- window = the_echo_area;
- }
+ {
+ if (window == the_echo_area || !echo_area_is_active)
+ window = windows;
+ else
+ window = the_echo_area;
+ }
}
if (active_window != window)
{
if (auto_footnotes_p)
- info_get_or_remove_footnotes (window);
+ info_get_or_remove_footnotes (window);
window->flags |= W_UpdateWindow;
active_window = window;
@@ -1298,7 +1293,7 @@ DECLARE_INFO_COMMAND (info_next_window, "Select the next window")
}
/* Make the previous window in the chain be the active window. */
-DECLARE_INFO_COMMAND (info_prev_window, "Select the previous window")
+DECLARE_INFO_COMMAND (info_prev_window, _("Select the previous window"))
{
if (count < 0)
{
@@ -1317,30 +1312,30 @@ DECLARE_INFO_COMMAND (info_prev_window, "Select the previous window")
while (count--)
{
/* If we are in the echo area, or if the echo area isn't active and we
- are in the first window, find the last window in the chain. */
+ are in the first window, find the last window in the chain. */
if (window == the_echo_area ||
- (window == windows && !echo_area_is_active))
- {
- register WINDOW *win, *last;
+ (window == windows && !echo_area_is_active))
+ {
+ register WINDOW *win, *last;
- for (win = windows; win; win = win->next)
- last = win;
+ for (win = windows; win; win = win->next)
+ last = win;
- window = last;
- }
+ window = last;
+ }
else
- {
- if (window == windows)
- window = the_echo_area;
- else
- window = window->prev;
- }
+ {
+ if (window == windows)
+ window = the_echo_area;
+ else
+ window = window->prev;
+ }
}
if (active_window != window)
{
if (auto_footnotes_p)
- info_get_or_remove_footnotes (window);
+ info_get_or_remove_footnotes (window);
window->flags |= W_UpdateWindow;
active_window = window;
@@ -1349,7 +1344,7 @@ DECLARE_INFO_COMMAND (info_prev_window, "Select the previous window")
/* Split WINDOW into two windows, both showing the same node. If we
are automatically tiling windows, re-tile after the split. */
-DECLARE_INFO_COMMAND (info_split_window, "Split the current window")
+DECLARE_INFO_COMMAND (info_split_window, _("Split the current window"))
{
WINDOW *split, *old_active;
int pagetop;
@@ -1373,54 +1368,54 @@ DECLARE_INFO_COMMAND (info_split_window, "Split the current window")
#if defined (SPLIT_BEFORE_ACTIVE)
/* Try to scroll the old window into its new postion. */
if (pagetop == window->pagetop)
- {
- int start, end, amount;
-
- start = split->first_row;
- end = start + window->height;
- amount = split->height + 1;
- display_scroll_display (start, end, amount);
- }
+ {
+ int start, end, amount;
+
+ start = split->first_row;
+ end = start + window->height;
+ amount = split->height + 1;
+ display_scroll_display (start, end, amount);
+ }
#else /* !SPLIT_BEFORE_ACTIVE */
/* Make sure point still appears in the active window. */
info_show_point (window);
#endif /* !SPLIT_BEFORE_ACTIVE */
/* If the window just split was one internal to Info, try to display
- something else in it. */
+ something else in it. */
if (internal_info_node_p (split->node))
- {
- register int i, j;
- INFO_WINDOW *iw;
- NODE *node = (NODE *)NULL;
- char *filename;
-
- for (i = 0; iw = info_windows[i]; i++)
- {
- for (j = 0; j < iw->nodes_index; j++)
- if (!internal_info_node_p (iw->nodes[j]))
- {
- if (iw->nodes[j]->parent)
- filename = iw->nodes[j]->parent;
- else
- filename = iw->nodes[j]->filename;
-
- node = info_get_node (filename, iw->nodes[j]->nodename);
- if (node)
- {
- window_set_node_of_window (split, node);
- i = info_windows_index - 1;
- break;
- }
- }
- }
- }
+ {
+ register int i, j;
+ INFO_WINDOW *iw;
+ NODE *node = (NODE *)NULL;
+ char *filename;
+
+ for (i = 0; (iw = info_windows[i]); i++)
+ {
+ for (j = 0; j < iw->nodes_index; j++)
+ if (!internal_info_node_p (iw->nodes[j]))
+ {
+ if (iw->nodes[j]->parent)
+ filename = iw->nodes[j]->parent;
+ else
+ filename = iw->nodes[j]->filename;
+
+ node = info_get_node (filename, iw->nodes[j]->nodename);
+ if (node)
+ {
+ window_set_node_of_window (split, node);
+ i = info_windows_index - 1;
+ break;
+ }
+ }
+ }
+ }
split->pagetop = window->pagetop;
if (auto_tiling_p)
- window_tile_windows (DONT_TILE_INTERNALS);
+ window_tile_windows (DONT_TILE_INTERNALS);
else
- window_adjust_pagetop (split);
+ window_adjust_pagetop (split);
remember_window_and_node (split, split->node);
}
@@ -1430,7 +1425,7 @@ DECLARE_INFO_COMMAND (info_split_window, "Split the current window")
automatically displaying footnotes, show or remove the footnotes
window. If we are automatically tiling windows, re-tile after the
deletion. */
-DECLARE_INFO_COMMAND (info_delete_window, "Delete the current window")
+DECLARE_INFO_COMMAND (info_delete_window, _("Delete the current window"))
{
if (!windows->next)
{
@@ -1438,17 +1433,17 @@ DECLARE_INFO_COMMAND (info_delete_window, "Delete the current window")
}
else if (window->flags & W_WindowIsPerm)
{
- info_error ("Cannot delete a permanent window");
+ info_error (_("Cannot delete a permanent window"));
}
else
{
info_delete_window_internal (window);
if (auto_footnotes_p)
- info_get_or_remove_footnotes (active_window);
+ info_get_or_remove_footnotes (active_window);
if (auto_tiling_p)
- window_tile_windows (DONT_TILE_INTERNALS);
+ window_tile_windows (DONT_TILE_INTERNALS);
}
}
@@ -1461,19 +1456,19 @@ info_delete_window_internal (window)
if (windows->next && ((window->flags & W_WindowIsPerm) == 0))
{
/* We not only delete the window from the display, we forget it from
- our list of remembered windows. */
+ our list of remembered windows. */
forget_window_and_nodes (window);
window_delete_window (window);
if (echo_area_is_active)
- echo_area_inform_of_deleted_window (window);
+ echo_area_inform_of_deleted_window (window);
}
}
/* Just keep WINDOW, deleting all others. */
-DECLARE_INFO_COMMAND (info_keep_one_window, "Delete all other windows")
+DECLARE_INFO_COMMAND (info_keep_one_window, _("Delete all other windows"))
{
- int num_deleted; /* The number of windows we deleted. */
+ int num_deleted; /* The number of windows we deleted. */
int pagetop, start, end;
/* Remember a few things about this window. We may be able to speed up
@@ -1489,14 +1484,14 @@ DECLARE_INFO_COMMAND (info_keep_one_window, "Delete all other windows")
WINDOW *win;
/* Find an eligible window and delete it. If no eligible windows
- are found, we are done. A window is eligible for deletion if
- is it not permanent, and it is not WINDOW. */
+ are found, we are done. A window is eligible for deletion if
+ is it not permanent, and it is not WINDOW. */
for (win = windows; win; win = win->next)
- if (win != window && ((win->flags & W_WindowIsPerm) == 0))
- break;
+ if (win != window && ((win->flags & W_WindowIsPerm) == 0))
+ break;
if (!win)
- break;
+ break;
info_delete_window_internal (win);
num_deleted++;
@@ -1517,7 +1512,7 @@ DECLARE_INFO_COMMAND (info_keep_one_window, "Delete all other windows")
}
/* Scroll the "other" window of WINDOW. */
-DECLARE_INFO_COMMAND (info_scroll_other_window, "Scroll the other window")
+DECLARE_INFO_COMMAND (info_scroll_other_window, _("Scroll the other window"))
{
WINDOW *other;
@@ -1537,7 +1532,7 @@ DECLARE_INFO_COMMAND (info_scroll_other_window, "Scroll the other window")
}
/* Change the size of WINDOW by AMOUNT. */
-DECLARE_INFO_COMMAND (info_grow_window, "Grow (or shrink) this window")
+DECLARE_INFO_COMMAND (info_grow_window, _("Grow (or shrink) this window"))
{
window_change_window_height (window, count);
}
@@ -1548,22 +1543,22 @@ int auto_tiling_p = 0;
/* Tile all of the visible windows. */
DECLARE_INFO_COMMAND (info_tile_windows,
- "Divide the available screen space among the visible windows")
+ _("Divide the available screen space among the visible windows"))
{
window_tile_windows (TILE_INTERNALS);
}
/* Toggle the state of this window's wrapping of lines. */
DECLARE_INFO_COMMAND (info_toggle_wrap,
- "Toggle the state of line wrapping in the current window")
+ _("Toggle the state of line wrapping in the current window"))
{
window_toggle_wrap (window);
}
/* **************************************************************** */
-/* */
-/* Info Node Commands */
-/* */
+/* */
+/* Info Node Commands */
+/* */
/* **************************************************************** */
/* Using WINDOW for various defaults, select the node referenced by ENTRY
@@ -1585,12 +1580,12 @@ info_select_reference (window, entry)
filename = window->node->filename;
if (filename)
- filename = strdup (filename);
+ filename = xstrdup (filename);
if (entry->nodename)
- nodename = strdup (entry->nodename);
+ nodename = xstrdup (entry->nodename);
else
- nodename = strdup ("Top");
+ nodename = xstrdup ("Top");
node = info_get_node (filename, nodename);
@@ -1600,25 +1595,25 @@ info_select_reference (window, entry)
if (!node)
{
if (info_recent_file_error)
- file_system_error = strdup (info_recent_file_error);
+ file_system_error = xstrdup (info_recent_file_error);
if (entry->nodename && (strcmp (entry->nodename, entry->label) == 0))
- {
- node = info_get_node (entry->label, "Top");
- if (!node && info_recent_file_error)
- {
- maybe_free (file_system_error);
- file_system_error = strdup (info_recent_file_error);
- }
- }
+ {
+ node = info_get_node (entry->label, "Top");
+ if (!node && info_recent_file_error)
+ {
+ maybe_free (file_system_error);
+ file_system_error = xstrdup (info_recent_file_error);
+ }
+ }
}
if (!node)
{
if (file_system_error)
- info_error (file_system_error);
+ info_error (file_system_error);
else
- info_error (CANT_FIND_NODE, nodename);
+ info_error (CANT_FIND_NODE, nodename);
}
maybe_free (file_system_error);
@@ -1668,42 +1663,42 @@ info_handle_pointer (label, window)
filename = nodename = (char *)NULL;
if (info_parsed_filename)
- filename = strdup (info_parsed_filename);
+ filename = xstrdup (info_parsed_filename);
else
- {
- if (window->node->parent)
- filename = strdup (window->node->parent);
- else if (window->node->filename)
- filename = strdup (window->node->filename);
- }
+ {
+ if (window->node->parent)
+ filename = xstrdup (window->node->parent);
+ else if (window->node->filename)
+ filename = xstrdup (window->node->filename);
+ }
if (info_parsed_nodename)
- nodename = strdup (info_parsed_nodename);
+ nodename = xstrdup (info_parsed_nodename);
else
- nodename = strdup ("Top");
+ nodename = xstrdup ("Top");
node = info_get_node (filename, nodename);
if (node)
- {
- INFO_WINDOW *info_win;
-
- info_win = get_info_window_of_window (window);
- if (info_win)
- {
- info_win->pagetops[info_win->current] = window->pagetop;
- info_win->points[info_win->current] = window->point;
- }
- set_remembered_pagetop_and_point (window);
- info_set_node_of_window (window, node);
- }
+ {
+ INFO_WINDOW *info_win;
+
+ info_win = get_info_window_of_window (window);
+ if (info_win)
+ {
+ info_win->pagetops[info_win->current] = window->pagetop;
+ info_win->points[info_win->current] = window->point;
+ }
+ set_remembered_pagetop_and_point (window);
+ info_set_node_of_window (window, node);
+ }
else
- {
- if (info_recent_file_error)
- info_error (info_recent_file_error);
- else
- info_error (CANT_FILE_NODE, filename, nodename);
- }
+ {
+ if (info_recent_file_error)
+ info_error (info_recent_file_error);
+ else
+ info_error (CANT_FILE_NODE, filename, nodename);
+ }
free (filename);
free (nodename);
@@ -1716,30 +1711,30 @@ info_handle_pointer (label, window)
/* Make WINDOW display the "Next:" node of the node currently being
displayed. */
-DECLARE_INFO_COMMAND (info_next_node, "Select the `Next' node")
+DECLARE_INFO_COMMAND (info_next_node, _("Select the `Next' node"))
{
info_next_label_of_node (window->node);
- info_handle_pointer ("Next", window);
+ info_handle_pointer (_("Next"), window);
}
/* Make WINDOW display the "Prev:" node of the node currently being
displayed. */
-DECLARE_INFO_COMMAND (info_prev_node, "Select the `Prev' node")
+DECLARE_INFO_COMMAND (info_prev_node, _("Select the `Prev' node"))
{
info_prev_label_of_node (window->node);
- info_handle_pointer ("Prev", window);
+ info_handle_pointer (_("Prev"), window);
}
/* Make WINDOW display the "Up:" node of the node currently being
displayed. */
-DECLARE_INFO_COMMAND (info_up_node, "Select the `Up' node")
+DECLARE_INFO_COMMAND (info_up_node, _("Select the `Up' node"))
{
info_up_label_of_node (window->node);
- info_handle_pointer ("Up", window);
+ info_handle_pointer (_("Up"), window);
}
/* Make WINDOW display the last node of this info file. */
-DECLARE_INFO_COMMAND (info_last_node, "Select the last node in this file")
+DECLARE_INFO_COMMAND (info_last_node, _("Select the last node in this file"))
{
register int i;
FILE_BUFFER *fb = file_buffer_of_window (window);
@@ -1752,7 +1747,7 @@ DECLARE_INFO_COMMAND (info_last_node, "Select the last node in this file")
}
if (!node)
- info_error ("This window has no additional nodes");
+ info_error (_("This window has no additional nodes"));
else
{
set_remembered_pagetop_and_point (window);
@@ -1761,7 +1756,7 @@ DECLARE_INFO_COMMAND (info_last_node, "Select the last node in this file")
}
/* Make WINDOW display the first node of this info file. */
-DECLARE_INFO_COMMAND (info_first_node, "Select the first node in this file")
+DECLARE_INFO_COMMAND (info_first_node, _("Select the first node in this file"))
{
FILE_BUFFER *fb = file_buffer_of_window (window);
NODE *node = (NODE *)NULL;
@@ -1770,7 +1765,7 @@ DECLARE_INFO_COMMAND (info_first_node, "Select the first node in this file")
node = info_get_node (fb->filename, fb->tags[0]->nodename);
if (!node)
- info_error ("This window has no additional nodes");
+ info_error (_("This window has no additional nodes"));
else
{
set_remembered_pagetop_and_point (window);
@@ -1778,55 +1773,15 @@ DECLARE_INFO_COMMAND (info_first_node, "Select the first node in this file")
}
}
-/* Make WINDOW display the previous node displayed in this window. */
-DECLARE_INFO_COMMAND (info_history_node,
- "Select the most recently selected node")
-{
- INFO_WINDOW *info_win;
-
- /* Find the INFO_WINDOW which contains WINDOW. */
- info_win = get_info_window_of_window (window);
-
- if (!info_win)
- {
- info_error ("Requested window is not present!");
- return;
- }
-
- set_remembered_pagetop_and_point (window);
- if (!info_win->current)
- {
- if (info_win->nodes_index > 1)
- {
- window_message_in_echo_area
- ("Now wrapped around to beginning of history.");
- info_win->current = info_win->nodes_index;
- }
- else
- {
- info_error ("No earlier nodes in this window.");
- return;
- }
- }
-
- info_win->current--;
- window_set_node_of_window (window, info_win->nodes[info_win->current]);
- window->pagetop = info_win->pagetops[info_win->current];
- window->point = info_win->points[info_win->current];
- window->flags |= W_UpdateWindow;
- if (auto_footnotes_p)
- info_get_or_remove_footnotes (window);
-}
-
/* Select the last menu item in WINDOW->node. */
DECLARE_INFO_COMMAND (info_last_menu_item,
- "Select the last item in this node's menu")
+ _("Select the last item in this node's menu"))
{
info_menu_digit (window, 1, '0');
}
/* Use KEY (a digit) to select the Nth menu item in WINDOW->node. */
-DECLARE_INFO_COMMAND (info_menu_digit, "Select this menu item")
+DECLARE_INFO_COMMAND (info_menu_digit, _("Select this menu item"))
{
register int i, item;
register REFERENCE *entry, **menu;
@@ -1847,15 +1802,15 @@ DECLARE_INFO_COMMAND (info_menu_digit, "Select this menu item")
for (i = 0; menu[i + 1]; i++);
else
{
- for (i = 0; entry = menu[i]; i++)
- if (i == item - 1)
- break;
+ for (i = 0; (entry = menu[i]); i++)
+ if (i == item - 1)
+ break;
}
if (menu[i])
info_select_reference (window, menu[i]);
else
- info_error ("There aren't %d items in this menu.", item);
+ info_error (_("There aren't %d items in this menu."), item);
info_free_references (menu);
return;
@@ -1882,9 +1837,9 @@ info_menu_or_ref_item (window, count, key, builder, ask_p)
if (!menu)
{
if (builder == info_menu_of_node)
- info_error (NO_MENU_NODE);
+ info_error (NO_MENU_NODE);
else
- info_error (NO_XREF_NODE);
+ info_error (NO_XREF_NODE);
return;
}
@@ -1898,80 +1853,77 @@ info_menu_or_ref_item (window, count, key, builder, ask_p)
if (point_line != -1)
{
- SEARCH_BINDING binding;
-
- binding.start = 0;
- binding.buffer = window->line_starts[point_line];
- if (window->line_starts[point_line + 1])
- binding.end = window->line_starts[point_line + 1] - binding.buffer;
- else
- binding.end =
- (window->node->contents + window->node->nodelen) - binding.buffer;
- binding.flags = 0;
-
- if (builder == info_menu_of_node)
- {
- if (point_line)
- {
- binding.buffer--;
- binding.end++;
-
- refs = info_menu_items (&binding);
- }
- }
- else
- {
+ SEARCH_BINDING binding;
+
+ binding.buffer = window->node->contents;
+ binding.start = window->line_starts[point_line] - binding.buffer;
+ if (window->line_starts[point_line + 1])
+ binding.end = window->line_starts[point_line + 1] - binding.buffer;
+ else
+ binding.end = window->node->nodelen;
+ binding.flags = 0;
+
+ if (builder == info_menu_of_node)
+ {
+ if (point_line)
+ {
+ binding.start--;
+ refs = info_menu_items (&binding);
+ }
+ }
+ else
+ {
#if defined (HANDLE_MAN_PAGES)
- if (window->node->flags & N_IsManPage)
- refs = manpage_xrefs_in_binding (window->node, &binding);
- else
+ if (window->node->flags & N_IsManPage)
+ refs = manpage_xrefs_in_binding (window->node, &binding);
+ else
#endif /* HANDLE_MAN_PAGES */
- refs = info_xrefs (&binding);
- }
-
- if (refs)
- {
- if ((strcmp (refs[0]->label, "Menu") != 0) ||
- (builder == info_xrefs_of_node))
- {
- int which = 0;
-
- /* Find the closest reference to point. */
- if (builder == info_xrefs_of_node)
- {
- int closest = -1;
-
- for (; refs[which]; which++)
- {
- if ((window->point >= refs[which]->start) &&
- (window->point <= refs[which]->end))
- {
- closest = which;
- break;
- }
- else if (window->point < refs[which]->start)
- {
- break;
- }
- }
- if (closest == -1)
- which--;
- else
- which = closest;
- }
-
- defentry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
- defentry->label = strdup (refs[which]->label);
- defentry->filename = refs[which]->filename;
- defentry->nodename = refs[which]->nodename;
-
- if (defentry->filename)
- defentry->filename = strdup (defentry->filename);
- if (defentry->nodename)
- defentry->nodename = strdup (defentry->nodename);
- }
- info_free_references (refs);
- }
+ refs = info_xrefs (&binding);
+ }
+
+ if (refs)
+ {
+ if ((strcmp (refs[0]->label, "Menu") != 0) ||
+ (builder == info_xrefs_of_node))
+ {
+ int which = 0;
+
+ /* Find the closest reference to point. */
+ if (builder == info_xrefs_of_node)
+ {
+ int closest = -1;
+
+ for (; refs[which]; which++)
+ {
+ if ((window->point >= refs[which]->start) &&
+ (window->point <= refs[which]->end))
+ {
+ closest = which;
+ break;
+ }
+ else if (window->point < refs[which]->start)
+ {
+ break;
+ }
+ }
+ if (closest == -1)
+ which--;
+ else
+ which = closest;
+ }
+
+ defentry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
+ defentry->label = xstrdup (refs[which]->label);
+ defentry->filename = refs[which]->filename;
+ defentry->nodename = refs[which]->nodename;
+
+ if (defentry->filename)
+ defentry->filename = xstrdup (defentry->filename);
+ if (defentry->nodename)
+ defentry->nodename = xstrdup (defentry->nodename);
+ }
+ info_free_references (refs);
+ }
}
}
@@ -1982,24 +1934,24 @@ info_menu_or_ref_item (window, count, key, builder, ask_p)
/* Build the prompt string. */
if (defentry)
- prompt = (char *)xmalloc (20 + strlen (defentry->label));
+ prompt = (char *)xmalloc (20 + strlen (defentry->label));
else
- prompt = (char *)xmalloc (20);
+ prompt = (char *)xmalloc (20);
if (builder == info_menu_of_node)
- {
- if (defentry)
- sprintf (prompt, "Menu item (%s): ", defentry->label);
- else
- sprintf (prompt, "Menu item: ");
- }
+ {
+ if (defentry)
+ sprintf (prompt, _("Menu item (%s): "), defentry->label);
+ else
+ sprintf (prompt, _("Menu item: "));
+ }
else
- {
- if (defentry)
- sprintf (prompt, "Follow xref (%s): ", defentry->label);
- else
- sprintf (prompt, "Follow xref: ");
- }
+ {
+ if (defentry)
+ sprintf (prompt, _("Follow xref (%s): "), defentry->label);
+ else
+ sprintf (prompt, _("Follow xref: "));
+ }
line = info_read_completing_in_echo_area (window, prompt, menu);
free (prompt);
@@ -2008,31 +1960,31 @@ info_menu_or_ref_item (window, count, key, builder, ask_p)
/* User aborts, just quit. */
if (!line)
- {
- maybe_free (defentry);
- info_free_references (menu);
- info_abort_key (window, 0, 0);
- return;
- }
+ {
+ maybe_free (defentry);
+ info_free_references (menu);
+ info_abort_key (window, 0, 0);
+ return;
+ }
/* If we had a default and the user accepted it, use that. */
if (!*line)
- {
- free (line);
- if (defentry)
- line = strdup (defentry->label);
- else
- line = (char *)NULL;
- }
+ {
+ free (line);
+ if (defentry)
+ line = xstrdup (defentry->label);
+ else
+ line = (char *)NULL;
+ }
}
else
{
/* Not going to ask any questions. If we have a default entry, use
- that, otherwise return. */
+ that, otherwise return. */
if (!defentry)
- return;
+ return;
else
- line = strdup (defentry->label);
+ line = xstrdup (defentry->label);
}
if (line)
@@ -2041,42 +1993,42 @@ info_menu_or_ref_item (window, count, key, builder, ask_p)
entry = info_get_labeled_reference (line, menu);
if (!entry && defentry)
- info_error ("The reference disappeared! (%s).", line);
+ info_error (_("The reference disappeared! (%s)."), line);
else
- {
- NODE *orig;
-
- orig = window->node;
- info_select_reference (window, entry);
- if ((builder == info_xrefs_of_node) && (window->node != orig))
- {
- long offset;
- long start;
-
- if (window->line_count > 0)
- start = window->line_starts[1] - window->node->contents;
- else
- start = 0;
-
- offset =
- info_target_search_node (window->node, entry->label, start);
-
- if (offset != -1)
- {
- window->point = offset;
- window_adjust_pagetop (window);
- }
- }
- }
+ {
+ NODE *orig;
+
+ orig = window->node;
+ info_select_reference (window, entry);
+ if ((builder == info_xrefs_of_node) && (window->node != orig))
+ {
+ long offset;
+ long start;
+
+ if (window->line_count > 0)
+ start = window->line_starts[1] - window->node->contents;
+ else
+ start = 0;
+
+ offset =
+ info_target_search_node (window->node, entry->label, start);
+
+ if (offset != -1)
+ {
+ window->point = offset;
+ window_adjust_pagetop (window);
+ }
+ }
+ }
free (line);
if (defentry)
- {
- free (defentry->label);
- maybe_free (defentry->filename);
- maybe_free (defentry->nodename);
- free (defentry);
- }
+ {
+ free (defentry->label);
+ maybe_free (defentry->filename);
+ maybe_free (defentry->nodename);
+ free (defentry);
+ }
}
info_free_references (menu);
@@ -2087,7 +2039,7 @@ info_menu_or_ref_item (window, count, key, builder, ask_p)
/* Read a line (with completion) which is the name of a menu item,
and select that item. */
-DECLARE_INFO_COMMAND (info_menu_item, "Read a menu item and select its node")
+DECLARE_INFO_COMMAND (info_menu_item, _("Read a menu item and select its node"))
{
info_menu_or_ref_item (window, count, key, info_menu_of_node, 1);
}
@@ -2095,13 +2047,13 @@ DECLARE_INFO_COMMAND (info_menu_item, "Read a menu item and select its node")
/* Read a line (with completion) which is the name of a reference to
follow, and select the node. */
DECLARE_INFO_COMMAND
- (info_xref_item, "Read a footnote or cross reference and select its node")
+ (info_xref_item, _("Read a footnote or cross reference and select its node"))
{
info_menu_or_ref_item (window, count, key, info_xrefs_of_node, 1);
}
/* Position the cursor at the start of this node's menu. */
-DECLARE_INFO_COMMAND (info_find_menu, "Move to the start of this node's menu")
+DECLARE_INFO_COMMAND (info_find_menu, _("Move to the start of this node's menu"))
{
SEARCH_BINDING binding;
long position;
@@ -2125,7 +2077,7 @@ DECLARE_INFO_COMMAND (info_find_menu, "Move to the start of this node's menu")
/* Visit as many menu items as is possible, each in a separate window. */
DECLARE_INFO_COMMAND (info_visit_menu,
- "Visit as many menu items at once as possible")
+ _("Visit as many menu items at once as possible"))
{
register int i;
REFERENCE *entry, **menu;
@@ -2143,20 +2095,19 @@ DECLARE_INFO_COMMAND (info_visit_menu,
window_tile_windows (TILE_INTERNALS);
if (!new)
- info_error (WIN_TOO_SMALL);
+ info_error (WIN_TOO_SMALL);
else
- {
- active_window = new;
- info_select_reference (new, entry);
- }
+ {
+ active_window = new;
+ info_select_reference (new, entry);
+ }
}
}
/* Read a line of input which is a node name, and go to that node. */
-DECLARE_INFO_COMMAND (info_goto_node, "Read a node name and select it")
+DECLARE_INFO_COMMAND (info_goto_node, _("Read a node name and select it"))
{
char *line;
- NODE *node;
#define GOTO_COMPLETES
#if defined (GOTO_COMPLETES)
@@ -2172,54 +2123,54 @@ DECLARE_INFO_COMMAND (info_goto_node, "Read a node name and select it")
for (fbi = 0; info_loaded_files && info_loaded_files[fbi]; fbi++)
{
- FILE_BUFFER *fb;
- REFERENCE *entry;
- int this_is_the_current_fb;
-
- fb = info_loaded_files[fbi];
- this_is_the_current_fb = (current == fb);
-
- entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
- entry->filename = entry->nodename = (char *)NULL;
- entry->label = (char *)xmalloc (4 + strlen (fb->filename));
- sprintf (entry->label, "(%s)*", fb->filename);
-
- add_pointer_to_array
- (entry, items_index, items, items_slots, 10, REFERENCE *);
-
- if (fb->tags)
- {
- for (i = 0; fb->tags[i]; i++)
- {
- entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
- entry->filename = entry->nodename = (char *)NULL;
- entry->label = (char *) xmalloc
- (4 + strlen (fb->filename) + strlen (fb->tags[i]->nodename));
- sprintf (entry->label, "(%s)%s",
- fb->filename, fb->tags[i]->nodename);
-
- add_pointer_to_array
- (entry, items_index, items, items_slots, 100, REFERENCE *);
- }
-
- if (this_is_the_current_fb)
- {
- for (i = 0; fb->tags[i]; i++)
- {
- entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
- entry->filename = entry->nodename = (char *)NULL;
- entry->label = strdup (fb->tags[i]->nodename);
- add_pointer_to_array (entry, items_index, items,
- items_slots, 100, REFERENCE *);
- }
- }
- }
+ FILE_BUFFER *fb;
+ REFERENCE *entry;
+ int this_is_the_current_fb;
+
+ fb = info_loaded_files[fbi];
+ this_is_the_current_fb = (current == fb);
+
+ entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
+ entry->filename = entry->nodename = (char *)NULL;
+ entry->label = (char *)xmalloc (4 + strlen (fb->filename));
+ sprintf (entry->label, "(%s)*", fb->filename);
+
+ add_pointer_to_array
+ (entry, items_index, items, items_slots, 10, REFERENCE *);
+
+ if (fb->tags)
+ {
+ for (i = 0; fb->tags[i]; i++)
+ {
+ entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
+ entry->filename = entry->nodename = (char *)NULL;
+ entry->label = (char *) xmalloc
+ (4 + strlen (fb->filename) + strlen (fb->tags[i]->nodename));
+ sprintf (entry->label, "(%s)%s",
+ fb->filename, fb->tags[i]->nodename);
+
+ add_pointer_to_array
+ (entry, items_index, items, items_slots, 100, REFERENCE *);
+ }
+
+ if (this_is_the_current_fb)
+ {
+ for (i = 0; fb->tags[i]; i++)
+ {
+ entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
+ entry->filename = entry->nodename = (char *)NULL;
+ entry->label = xstrdup (fb->tags[i]->nodename);
+ add_pointer_to_array (entry, items_index, items,
+ items_slots, 100, REFERENCE *);
+ }
+ }
+ }
}
- line = info_read_maybe_completing (window, "Goto Node: ", items);
+ line = info_read_maybe_completing (window, _("Goto Node: "), items);
info_free_references (items);
}
#else /* !GOTO_COMPLETES */
- line = info_read_in_echo_area (window, "Goto Node: ");
+ line = info_read_in_echo_area (window, _("Goto Node: "));
#endif /* !GOTO_COMPLETES */
/* If the user aborted, quit now. */
@@ -2240,12 +2191,11 @@ DECLARE_INFO_COMMAND (info_goto_node, "Read a node name and select it")
}
#if defined (HANDLE_MAN_PAGES)
-DECLARE_INFO_COMMAND (info_man, "Read a manpage reference and select it")
+DECLARE_INFO_COMMAND (info_man, _("Read a manpage reference and select it"))
{
char *line;
- NODE *node;
- line = info_read_in_echo_area (window, "Get Manpage: ");
+ line = info_read_in_echo_area (window, _("Get Manpage: "));
if (!line)
{
@@ -2260,7 +2210,7 @@ DECLARE_INFO_COMMAND (info_man, "Read a manpage reference and select it")
char *goto_command;
goto_command = (char *)xmalloc
- (4 + strlen (MANPAGE_FILE_BUFFER_NAME) + strlen (line));
+ (4 + strlen (MANPAGE_FILE_BUFFER_NAME) + strlen (line));
sprintf (goto_command, "(%s)%s", MANPAGE_FILE_BUFFER_NAME, line);
@@ -2275,61 +2225,70 @@ DECLARE_INFO_COMMAND (info_man, "Read a manpage reference and select it")
#endif /* HANDLE_MAN_PAGES */
/* Move to the "Top" node in this file. */
-DECLARE_INFO_COMMAND (info_top_node, "Select the node `Top' in this file")
+DECLARE_INFO_COMMAND (info_top_node, _("Select the node `Top' in this file"))
{
- info_parse_and_select ("Top", window);
+ info_parse_and_select (_("Top"), window);
}
/* Move to the node "(dir)Top". */
-DECLARE_INFO_COMMAND (info_dir_node, "Select the node `(dir)'")
+DECLARE_INFO_COMMAND (info_dir_node, _("Select the node `(dir)'"))
{
info_parse_and_select ("(dir)Top", window);
}
-/* Try to delete the current node appearing in this window, showing the most
- recently selected node in this window. */
-DECLARE_INFO_COMMAND (info_kill_node, "Kill this node")
+
+/* Read the name of a node to kill. The list of available nodes comes
+ from the nodes appearing in the current window configuration. */
+static char *
+read_nodename_to_kill (window)
+ WINDOW *window;
{
- register int iw, i;
- register INFO_WINDOW *info_win;
- char *nodename = (char *)NULL;
- NODE *temp = (NODE *)NULL;
+ int iw;
+ char *nodename;
+ INFO_WINDOW *info_win;
+ REFERENCE **menu = NULL;
+ int menu_index = 0, menu_slots = 0;
+ char *default_nodename = xstrdup (active_window->node->nodename);
+ char *prompt = xmalloc (40 + strlen (default_nodename));
- /* Read the name of a node to kill. The list of available nodes comes
- from the nodes appearing in the current window configuration. */
- {
- REFERENCE **menu = (REFERENCE **)NULL;
- int menu_index = 0, menu_slots = 0;
- char *default_nodename, *prompt;
+ sprintf (prompt, _("Kill node (%s): "), default_nodename);
- for (iw = 0; info_win = info_windows[iw]; iw++)
- {
- REFERENCE *entry;
+ for (iw = 0; (info_win = info_windows[iw]); iw++)
+ {
+ REFERENCE *entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
+ entry->label = xstrdup (info_win->window->node->nodename);
+ entry->filename = entry->nodename = (char *)NULL;
- entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
- entry->label = strdup (info_win->window->node->nodename);
- entry->filename = entry->nodename = (char *)NULL;
+ add_pointer_to_array (entry, menu_index, menu, menu_slots, 10,
+ REFERENCE *);
+ }
- add_pointer_to_array
- (entry, menu_index, menu, menu_slots, 10, REFERENCE *);
- }
+ nodename = info_read_completing_in_echo_area (window, prompt, menu);
+ free (prompt);
+ info_free_references (menu);
+ if (nodename && !*nodename)
+ {
+ free (nodename);
+ nodename = default_nodename;
+ }
+ else
+ free (default_nodename);
- default_nodename = strdup (active_window->node->nodename);
- prompt = (char *)xmalloc (40 + strlen (default_nodename));
- sprintf (prompt, "Kill node (%s): ", default_nodename);
+ return nodename;
+}
- nodename = info_read_completing_in_echo_area (window, prompt, menu);
- free (prompt);
- info_free_references (menu);
- if (nodename && !*nodename)
- {
- free (nodename);
- nodename = default_nodename;
- }
- else
- free (default_nodename);
- }
+/* Delete NODENAME from this window, showing the most
+ recently selected node in this window. */
+static void
+kill_node (window, nodename)
+ WINDOW *window;
+ char *nodename;
+{
+ int iw, i;
+ INFO_WINDOW *info_win;
+ NODE *temp;
+
/* If there is no nodename to kill, quit now. */
if (!nodename)
{
@@ -2338,16 +2297,16 @@ DECLARE_INFO_COMMAND (info_kill_node, "Kill this node")
}
/* If there is a nodename, find it in our window list. */
- for (iw = 0; info_win = info_windows[iw]; iw++)
+ for (iw = 0; (info_win = info_windows[iw]); iw++)
if (strcmp (nodename, info_win->nodes[info_win->current]->nodename) == 0)
break;
if (!info_win)
{
if (*nodename)
- info_error ("Cannot kill the node `%s'", nodename);
+ info_error (_("Cannot kill node `%s'"), nodename);
else
- window_clear_echo_area ();
+ window_clear_echo_area ();
return;
}
@@ -2355,13 +2314,12 @@ DECLARE_INFO_COMMAND (info_kill_node, "Kill this node")
/* If there are no more nodes left anywhere to view, complain and exit. */
if (info_windows_index == 1 && info_windows[0]->nodes_index == 1)
{
- info_error ("Cannot kill the last node");
+ info_error (_("Cannot kill the last node"));
return;
}
- /* INFO_WIN contains the node that the user wants to stop viewing.
- Delete this node from the list of nodes previously shown in this
- window. */
+ /* INFO_WIN contains the node that the user wants to stop viewing. Delete
+ this node from the list of nodes previously shown in this window. */
for (i = info_win->current; i < info_win->nodes_index; i++)
info_win->nodes[i] = info_win->nodes[i++];
@@ -2380,41 +2338,40 @@ DECLARE_INFO_COMMAND (info_kill_node, "Kill this node")
long point;
if (info_windows[iw + 1])
- stealer = info_windows[iw + 1];
+ stealer = info_windows[iw + 1];
else
- stealer = info_windows[0];
+ stealer = info_windows[0];
/* If the node being displayed in the next window is not the most
- recently loaded one, get the most recently loaded one. */
+ recently loaded one, get the most recently loaded one. */
if ((stealer->nodes_index - 1) != stealer->current)
- which = stealer->nodes_index - 1;
+ which = stealer->nodes_index - 1;
/* Else, if there is another node behind the stealers current node,
- use that one. */
+ use that one. */
else if (stealer->current > 0)
- which = stealer->current - 1;
+ which = stealer->current - 1;
/* Else, just use the node appearing in STEALER's window. */
else
- which = stealer->current;
+ which = stealer->current;
/* Copy this node. */
{
- NODE *copy;
-
- temp = stealer->nodes[which];
- point = stealer->points[which];
- pagetop = stealer->pagetops[which];
-
- copy = (NODE *)xmalloc (sizeof (NODE));
- copy->filename = temp->filename;
- copy->parent = temp->parent;
- copy->nodename = temp->nodename;
- copy->contents = temp->contents;
- copy->nodelen = temp->nodelen;
- copy->flags = temp->flags;
-
- temp = copy;
+ NODE *copy = xmalloc (sizeof (NODE));
+
+ temp = stealer->nodes[which];
+ point = stealer->points[which];
+ pagetop = stealer->pagetops[which];
+
+ copy->filename = temp->filename;
+ copy->parent = temp->parent;
+ copy->nodename = temp->nodename;
+ copy->contents = temp->contents;
+ copy->nodelen = temp->nodelen;
+ copy->flags = temp->flags;
+
+ temp = copy;
}
window_set_node_of_window (info_win->window, temp);
@@ -2427,16 +2384,39 @@ DECLARE_INFO_COMMAND (info_kill_node, "Kill this node")
temp = info_win->nodes[info_win->current];
window_set_node_of_window (info_win->window, temp);
}
+
if (!info_error_was_printed)
window_clear_echo_area ();
+
+ if (auto_footnotes_p)
+ info_get_or_remove_footnotes (window);
}
+/* Kill current node, thus going back one in the node history. I (karl)
+ do not think this is completely correct yet, because of the
+ window-changing stuff in kill_node, but it's a lot better than the
+ previous implementation, which did not account for nodes being
+ visited twice at all. */
+DECLARE_INFO_COMMAND (info_history_node,
+ _("Select the most recently selected node"))
+{
+ kill_node (window, active_window->node->nodename);
+}
+
+/* Kill named node. */
+DECLARE_INFO_COMMAND (info_kill_node, _("Kill this node"))
+{
+ char *nodename = read_nodename_to_kill (window);
+ kill_node (window, nodename);
+}
+
+
/* Read the name of a file and select the entire file. */
-DECLARE_INFO_COMMAND (info_view_file, "Read the name of a file and select it")
+DECLARE_INFO_COMMAND (info_view_file, _("Read the name of a file and select it"))
{
char *line;
- line = info_read_in_echo_area (window, "Find file: ");
+ line = info_read_in_echo_area (window, _("Find file: "));
if (!line)
{
info_abort_key (active_window, 1, 0);
@@ -2449,17 +2429,17 @@ DECLARE_INFO_COMMAND (info_view_file, "Read the name of a file and select it")
node = info_get_node (line, "*");
if (!node)
- {
- if (info_recent_file_error)
- info_error (info_recent_file_error);
- else
- info_error ("Cannot find \"%s\".", line);
- }
+ {
+ if (info_recent_file_error)
+ info_error (info_recent_file_error);
+ else
+ info_error (_("Cannot find \"%s\"."), line);
+ }
else
- {
- set_remembered_pagetop_and_point (active_window);
- info_set_node_of_window (window, node);
- }
+ {
+ set_remembered_pagetop_and_point (active_window);
+ info_set_node_of_window (window, node);
+ }
free (line);
}
@@ -2468,9 +2448,9 @@ DECLARE_INFO_COMMAND (info_view_file, "Read the name of a file and select it")
}
/* **************************************************************** */
-/* */
-/* Dumping and Printing Nodes */
-/* */
+/* */
+/* Dumping and Printing Nodes */
+/* */
/* **************************************************************** */
#define VERBOSE_NODE_DUMPING
@@ -2500,7 +2480,7 @@ dump_nodes_to_file (filename, nodenames, output_filename, dump_subnodes)
if (!output_stream)
{
- info_error ("Could not create output file \"%s\".", output_filename);
+ info_error (_("Could not create output file \"%s\"."), output_filename);
return;
}
@@ -2513,7 +2493,7 @@ dump_nodes_to_file (filename, nodenames, output_filename, dump_subnodes)
fclose (output_stream);
#if defined (VERBOSE_NODE_DUMPING)
- info_error ("Done.");
+ info_error (_("Done."));
#endif /* VERBOSE_NODE_DUMPING */
}
@@ -2545,15 +2525,15 @@ dump_node_to_stream (filename, nodename, stream, dump_subnodes)
if (!node)
{
if (info_recent_file_error)
- info_error (info_recent_file_error);
+ info_error (info_recent_file_error);
else
- {
- if (filename && *nodename != '(')
- info_error
- (CANT_FILE_NODE, filename_non_directory (filename), nodename);
- else
- info_error (CANT_FIND_NODE, nodename);
- }
+ {
+ if (filename && *nodename != '(')
+ info_error
+ (CANT_FILE_NODE, filename_non_directory (filename), nodename);
+ else
+ info_error (CANT_FIND_NODE, nodename);
+ }
return;
}
@@ -2561,19 +2541,19 @@ dump_node_to_stream (filename, nodename, stream, dump_subnodes)
for (i = 0; i < dumped_already_index; i++)
if (strcmp (node->nodename, dumped_already[i]) == 0)
{
- free (node);
- return;
+ free (node);
+ return;
}
add_pointer_to_array (node->nodename, dumped_already_index, dumped_already,
- dumped_already_slots, 50, char *);
+ dumped_already_slots, 50, char *);
#if defined (VERBOSE_NODE_DUMPING)
/* Maybe we should print some information about the node being output. */
if (node->filename)
- info_error ("Writing node \"(%s)%s\"...",
- filename_non_directory (node->filename), node->nodename);
+ info_error (_("Writing node \"(%s)%s\"..."),
+ filename_non_directory (node->filename), node->nodename);
else
- info_error ("Writing node \"%s\"...", node->nodename);
+ info_error (_("Writing node \"%s\"..."), node->nodename);
#endif /* VERBOSE_NODE_DUMPING */
write_node_to_stream (node, stream);
@@ -2586,20 +2566,20 @@ dump_node_to_stream (filename, nodename, stream, dump_subnodes)
/* If this node is an Index, do not dump the menu references. */
if (string_in_line ("Index", node->nodename) == -1)
- menu = info_menu_of_node (node);
+ menu = info_menu_of_node (node);
if (menu)
- {
- for (i = 0; menu[i]; i++)
- {
- /* We don't dump Info files which are different than the
- current one. */
- if (!menu[i]->filename)
- dump_node_to_stream
- (filename, menu[i]->nodename, stream, dump_subnodes);
- }
- info_free_references (menu);
- }
+ {
+ for (i = 0; menu[i]; i++)
+ {
+ /* We don't dump Info files which are different than the
+ current one. */
+ if (!menu[i]->filename)
+ dump_node_to_stream
+ (filename, menu[i]->nodename, stream, dump_subnodes);
+ }
+ info_free_references (menu);
+ }
}
free (node);
@@ -2625,7 +2605,7 @@ dump_node_to_file (node, filename, dump_subnodes)
if (!output_stream)
{
- info_error ("Could not create output file \"%s\".", filename);
+ info_error (_("Could not create output file \"%s\"."), filename);
return;
}
@@ -2642,7 +2622,7 @@ dump_node_to_file (node, filename, dump_subnodes)
fclose (output_stream);
#if defined (VERBOSE_NODE_DUMPING)
- info_error ("Done.");
+ info_error (_("Done."));
#endif /* VERBOSE_NODE_DUMPING */
}
@@ -2651,7 +2631,7 @@ dump_node_to_file (node, filename, dump_subnodes)
#endif /* !DEFAULT_INFO_PRINT_COMMAND */
DECLARE_INFO_COMMAND (info_print_node,
- "Pipe the contents of this node through INFO_PRINT_COMMAND")
+ _("Pipe the contents of this node through INFO_PRINT_COMMAND"))
{
print_node (window->node);
}
@@ -2661,10 +2641,8 @@ void
print_node (node)
NODE *node;
{
- char *print_command, *getenv ();
FILE *printer_pipe;
-
- print_command = getenv ("INFO_PRINT_COMMAND");
+ char *print_command = getenv ("INFO_PRINT_COMMAND");
if (!print_command || !*print_command)
print_command = DEFAULT_INFO_PRINT_COMMAND;
@@ -2673,24 +2651,24 @@ print_node (node)
if (!printer_pipe)
{
- info_error ("Cannot open pipe to \"%s\".", print_command);
+ info_error (_("Cannot open pipe to \"%s\"."), print_command);
return;
}
#if defined (VERBOSE_NODE_DUMPING)
/* Maybe we should print some information about the node being output. */
if (node->filename)
- info_error ("Printing node \"(%s)%s\"...",
- filename_non_directory (node->filename), node->nodename);
+ info_error (_("Printing node \"(%s)%s\"..."),
+ filename_non_directory (node->filename), node->nodename);
else
- info_error ("Printing node \"%s\"...", node->nodename);
+ info_error (_("Printing node \"%s\"..."), node->nodename);
#endif /* VERBOSE_NODE_DUMPING */
write_node_to_stream (node, printer_pipe);
pclose (printer_pipe);
#if defined (VERBOSE_NODE_DUMPING)
- info_error ("Done.");
+ info_error (_("Done."));
#endif /* VERBOSE_NODE_DUMPING */
}
@@ -2703,9 +2681,9 @@ write_node_to_stream (node, stream)
}
/* **************************************************************** */
-/* */
-/* Info Searching Commands */
-/* */
+/* */
+/* Info Searching Commands */
+/* */
/* **************************************************************** */
/* Variable controlling the garbage collection of files briefly visited
@@ -2780,7 +2758,7 @@ info_search_in_node (string, node, start, window, dir)
{
set_remembered_pagetop_and_point (window);
if (window->node != node)
- window_set_node_of_window (window, node);
+ window_set_node_of_window (window, node);
window->point = offset;
window_adjust_pagetop (window);
}
@@ -2800,7 +2778,7 @@ info_target_search_node (node, string, start)
long offset;
char *target;
- target = strdup (string);
+ target = xstrdup (string);
i = strlen (target);
/* Try repeatedly searching for this string while removing words from
@@ -2811,7 +2789,7 @@ info_target_search_node (node, string, start)
offset = info_search_in_node (target, node, start, (WINDOW *)NULL, 1);
if (offset != -1)
- break;
+ break;
/* Delete the last word from TARGET. */
for (; i && (!whitespace (target[i]) && (target[i] != ',')); i--);
@@ -2845,22 +2823,22 @@ info_search_internal (string, window, dir)
(strcmp (last_searched_for_string, string) == 0))
{
ret = info_search_in_node
- (string, window->node, window->point + dir, window, dir);
+ (string, window->node, window->point + dir, window, dir);
}
else
{
ret = info_search_in_node
- (string, window->node, window->point, window, dir);
+ (string, window->node, window->point, window, dir);
}
maybe_free (last_searched_for_string);
- last_searched_for_string = strdup (string);
+ last_searched_for_string = xstrdup (string);
if (ret != -1)
{
/* We won! */
if (!echo_area_is_active && !isearch_is_active)
- window_clear_echo_area ();
+ window_clear_echo_area ();
return (0);
}
@@ -2881,91 +2859,91 @@ info_search_internal (string, window, dir)
/* Find number of tags and current tag. */
last_subfile = (char *)NULL;
for (i = 0; file_buffer->tags[i]; i++)
- if (strcmp (initial_nodename, file_buffer->tags[i]->nodename) == 0)
- {
- current_tag = i;
- last_subfile = file_buffer->tags[i]->filename;
- }
+ if (strcmp (initial_nodename, file_buffer->tags[i]->nodename) == 0)
+ {
+ current_tag = i;
+ last_subfile = file_buffer->tags[i]->filename;
+ }
number_of_tags = i;
/* If there is no last_subfile, our tag wasn't found. */
if (!last_subfile)
- return (-1);
+ return (-1);
/* Search through subsequent nodes, wrapping around to the top
- of the info file until we find the string or return to this
- window's node and point. */
+ of the info file until we find the string or return to this
+ window's node and point. */
while (1)
- {
- NODE *node;
-
- /* Allow C-g to quit the search, failing it if pressed. */
- return_if_control_g (-1);
-
- current_tag += dir;
-
- if (current_tag < 0)
- current_tag = number_of_tags - 1;
- else if (current_tag == number_of_tags)
- current_tag = 0;
-
- tag = file_buffer->tags[current_tag];
-
- if (!echo_area_is_active && (last_subfile != tag->filename))
- {
- window_message_in_echo_area
- ("Searching subfile \"%s\"...",
- filename_non_directory (tag->filename));
-
- last_subfile = tag->filename;
- }
-
- node = info_get_node (file_buffer->filename, tag->nodename);
-
- if (!node)
- {
- /* If not doing i-search... */
- if (!echo_area_is_active)
- {
- if (info_recent_file_error)
- info_error (info_recent_file_error);
- else
- info_error (CANT_FILE_NODE,
- filename_non_directory (file_buffer->filename),
- tag->nodename);
- }
- return (-1);
- }
-
- if (dir < 0)
- start = tag->nodelen;
-
- ret =
- info_search_in_node (string, node, start, window, dir);
-
- /* Did we find the string in this node? */
- if (ret != -1)
- {
- /* Yes! We win. */
- remember_window_and_node (window, node);
- if (!echo_area_is_active)
- window_clear_echo_area ();
- return (0);
- }
-
- /* No. Free this node, and make sure that we haven't passed
- our starting point. */
- free (node);
-
- if (strcmp (initial_nodename, tag->nodename) == 0)
- return (-1);
- }
+ {
+ NODE *node;
+
+ /* Allow C-g to quit the search, failing it if pressed. */
+ return_if_control_g (-1);
+
+ current_tag += dir;
+
+ if (current_tag < 0)
+ current_tag = number_of_tags - 1;
+ else if (current_tag == number_of_tags)
+ current_tag = 0;
+
+ tag = file_buffer->tags[current_tag];
+
+ if (!echo_area_is_active && (last_subfile != tag->filename))
+ {
+ window_message_in_echo_area
+ (_("Searching subfile \"%s\"..."),
+ filename_non_directory (tag->filename));
+
+ last_subfile = tag->filename;
+ }
+
+ node = info_get_node (file_buffer->filename, tag->nodename);
+
+ if (!node)
+ {
+ /* If not doing i-search... */
+ if (!echo_area_is_active)
+ {
+ if (info_recent_file_error)
+ info_error (info_recent_file_error);
+ else
+ info_error (CANT_FILE_NODE,
+ filename_non_directory (file_buffer->filename),
+ tag->nodename);
+ }
+ return (-1);
+ }
+
+ if (dir < 0)
+ start = tag->nodelen;
+
+ ret =
+ info_search_in_node (string, node, start, window, dir);
+
+ /* Did we find the string in this node? */
+ if (ret != -1)
+ {
+ /* Yes! We win. */
+ remember_window_and_node (window, node);
+ if (!echo_area_is_active)
+ window_clear_echo_area ();
+ return (0);
+ }
+
+ /* No. Free this node, and make sure that we haven't passed
+ our starting point. */
+ free (node);
+
+ if (strcmp (initial_nodename, tag->nodename) == 0)
+ return (-1);
+ }
}
return (-1);
}
-DECLARE_INFO_COMMAND (info_search, "Read a string and search for it")
+DECLARE_INFO_COMMAND (info_search, _("Read a string and search for it"))
{
char *line, *prompt;
int result, old_pagetop;
@@ -2985,9 +2963,9 @@ DECLARE_INFO_COMMAND (info_search, "Read a string and search for it")
prompt = (char *)xmalloc (50 + strlen (search_string));
- sprintf (prompt, "%s for string [%s]: ",
- direction < 0 ? "Search backward" : "Search",
- search_string);
+ sprintf (prompt, _("%s for string [%s]: "),
+ direction < 0 ? _("Search backward") : _("Search"),
+ search_string);
line = info_read_in_echo_area (window, prompt);
free (prompt);
@@ -3001,8 +2979,8 @@ DECLARE_INFO_COMMAND (info_search, "Read a string and search for it")
if (*line)
{
if (strlen (line) + 1 > search_string_size)
- search_string = (char *)
- xrealloc (search_string, (search_string_size += 50 + strlen (line)));
+ search_string = (char *)
+ xrealloc (search_string, (search_string_size += 50 + strlen (line)));
strcpy (search_string, line);
search_string_index = strlen (line);
@@ -3013,7 +2991,7 @@ DECLARE_INFO_COMMAND (info_search, "Read a string and search for it")
result = info_search_internal (search_string, active_window, direction);
if (result != 0 && !info_error_was_printed)
- info_error ("Search failed.");
+ info_error (_("Search failed."));
else if (old_pagetop != active_window->pagetop)
{
int new_pagetop;
@@ -3022,7 +3000,7 @@ DECLARE_INFO_COMMAND (info_search, "Read a string and search for it")
active_window->pagetop = old_pagetop;
set_window_pagetop (active_window, new_pagetop);
if (auto_footnotes_p)
- info_get_or_remove_footnotes (active_window);
+ info_get_or_remove_footnotes (active_window);
}
/* Perhaps free the unreferenced file buffers that were searched, but
@@ -3031,21 +3009,21 @@ DECLARE_INFO_COMMAND (info_search, "Read a string and search for it")
}
/* **************************************************************** */
-/* */
-/* Incremental Searching */
-/* */
+/* */
+/* Incremental Searching */
+/* */
/* **************************************************************** */
static void incremental_search ();
DECLARE_INFO_COMMAND (isearch_forward,
- "Search interactively for a string as you type it")
+ _("Search interactively for a string as you type it"))
{
incremental_search (window, count, key);
}
DECLARE_INFO_COMMAND (isearch_backward,
- "Search interactively for a string as you type it")
+ _("Search interactively for a string as you type it"))
{
incremental_search (window, -count, key);
}
@@ -3062,10 +3040,10 @@ static unsigned char isearch_terminate_search_key = ESC;
/* Structure defining the current state of an incremental search. */
typedef struct {
- WINDOW_STATE_DECL; /* The node, pagetop and point. */
- int search_index; /* Offset of the last char in the search string. */
- int direction; /* The direction that this search is heading in. */
- int failing; /* Whether or not this search failed. */
+ WINDOW_STATE_DECL; /* The node, pagetop and point. */
+ int search_index; /* Offset of the last char in the search string. */
+ int direction; /* The direction that this search is heading in. */
+ int failing; /* Whether or not this search failed. */
} SEARCH_STATE;
/* Array of search states. */
@@ -3088,7 +3066,7 @@ push_isearch (window, search_index, direction, failing)
state->failing = failing;
add_pointer_to_array (state, isearch_states_index, isearch_states,
- isearch_states_slots, 20, SEARCH_STATE *);
+ isearch_states_slots, 20, SEARCH_STATE *);
}
/* Pop the state of this search to WINDOW, SEARCH_INDEX, and DIRECTION. */
@@ -3139,9 +3117,9 @@ show_isearch_prompt (dir, string, failing_p)
int prompt_len, p_rep_index, p_rep_size;
if (dir < 0)
- prefix = "I-search backward: ";
+ prefix = _("I-search backward: ");
else
- prefix = "I-search: ";
+ prefix = _("I-search: ");
p_rep_index = p_rep_size = 0;
p_rep = (char *)NULL;
@@ -3150,15 +3128,15 @@ show_isearch_prompt (dir, string, failing_p)
char *rep;
switch (string[i])
- {
- case ' ': rep = " "; break;
- case LFD: rep = "\\n"; break;
- case TAB: rep = "\\t"; break;
- default:
- rep = pretty_keyname (string[i]);
- }
+ {
+ case ' ': rep = " "; break;
+ case LFD: rep = "\\n"; break;
+ case TAB: rep = "\\t"; break;
+ default:
+ rep = pretty_keyname (string[i]);
+ }
if ((p_rep_index + strlen (rep) + 1) >= p_rep_size)
- p_rep = (char *)xrealloc (p_rep, p_rep_size += 100);
+ p_rep = (char *)xrealloc (p_rep, p_rep_size += 100);
strcpy (p_rep + p_rep_index, rep);
p_rep_index += strlen (rep);
@@ -3166,8 +3144,8 @@ show_isearch_prompt (dir, string, failing_p)
prompt_len = strlen (prefix) + p_rep_index + 20;
prompt = (char *)xmalloc (prompt_len);
- sprintf (prompt, "%s%s%s", failing_p ? "Failing " : "", prefix,
- p_rep ? p_rep : "");
+ sprintf (prompt, "%s%s%s", failing_p ? _("Failing ") : "", prefix,
+ p_rep ? p_rep : "");
window_message_in_echo_area ("%s", prompt);
maybe_free (p_rep);
@@ -3210,202 +3188,202 @@ incremental_search (window, count, ignore)
int quoted = 0;
/* If a recent display was interrupted, then do the redisplay now if
- it is convenient. */
+ it is convenient. */
if (!info_any_buffered_input_p () && display_was_interrupted_p)
- {
- display_update_one_window (window);
- display_cursor_at_point (active_window);
- }
+ {
+ display_update_one_window (window);
+ display_cursor_at_point (active_window);
+ }
/* Read a character and dispatch on it. */
key = info_get_input_char ();
window_get_state (window, &mystate);
if (key == DEL)
- {
- /* User wants to delete one level of search? */
- if (!isearch_states_index)
- {
- terminal_ring_bell ();
- continue;
- }
- else
- {
- pop_isearch
- (window, &isearch_string_index, &dir, &search_result);
- isearch_string[isearch_string_index] = '\0';
- show_isearch_prompt (dir, isearch_string, search_result);
- goto after_search;
- }
- }
+ {
+ /* User wants to delete one level of search? */
+ if (!isearch_states_index)
+ {
+ terminal_ring_bell ();
+ continue;
+ }
+ else
+ {
+ pop_isearch
+ (window, &isearch_string_index, &dir, &search_result);
+ isearch_string[isearch_string_index] = '\0';
+ show_isearch_prompt (dir, isearch_string, search_result);
+ goto after_search;
+ }
+ }
else if (key == Control ('q'))
- {
- key = info_get_input_char ();
- quoted = 1;
- }
+ {
+ key = info_get_input_char ();
+ quoted = 1;
+ }
/* We are about to search again, or quit. Save the current search. */
push_isearch (window, isearch_string_index, dir, search_result);
if (quoted)
- goto insert_and_search;
+ goto insert_and_search;
if (!Meta_p (key) || (ISO_Latin_p && key < 160))
- {
- func = window->keymap[key].function;
-
- /* If this key invokes an incremental search, then this means that
- we will either search again in the same direction, search
- again in the reverse direction, or insert the last search
- string that was accepted through incremental searching. */
- if (func == isearch_forward || func == isearch_backward)
- {
- if ((func == isearch_forward && dir > 0) ||
- (func == isearch_backward && dir < 0))
- {
- /* If the user has typed no characters, then insert the
- last successful search into the current search string. */
- if (isearch_string_index == 0)
- {
- /* Of course, there must be something to insert. */
- if (last_isearch_accepted)
- {
- if (strlen (last_isearch_accepted) + 1 >=
- isearch_string_size)
- isearch_string = (char *)
- xrealloc (isearch_string,
- isearch_string_size += 10 +
- strlen (last_isearch_accepted));
- strcpy (isearch_string, last_isearch_accepted);
- isearch_string_index = strlen (isearch_string);
- goto search_now;
- }
- else
- continue;
- }
- else
- {
- /* Search again in the same direction. This means start
- from a new place if the last search was successful. */
- if (search_result == 0)
- window->point += dir;
- }
- }
- else
- {
- /* Reverse the direction of the search. */
- dir = -dir;
- }
- }
- else if (isprint (key) || func == (VFunction *)NULL)
- {
- insert_and_search:
-
- if (isearch_string_index + 2 >= isearch_string_size)
- isearch_string = (char *)xrealloc
- (isearch_string, isearch_string_size += 100);
-
- isearch_string[isearch_string_index++] = key;
- isearch_string[isearch_string_index] = '\0';
- goto search_now;
- }
- else if (func == info_abort_key)
- {
- /* If C-g pressed, and the search is failing, pop the search
- stack back to the last unfailed search. */
- if (isearch_states_index && (search_result != 0))
- {
- terminal_ring_bell ();
- while (isearch_states_index && (search_result != 0))
- pop_isearch
- (window, &isearch_string_index, &dir, &search_result);
- isearch_string[isearch_string_index] = '\0';
- show_isearch_prompt (dir, isearch_string, search_result);
- continue;
- }
- else
- goto exit_search;
- }
- else
- goto exit_search;
- }
+ {
+ func = window->keymap[key].function;
+
+ /* If this key invokes an incremental search, then this means that
+ we will either search again in the same direction, search
+ again in the reverse direction, or insert the last search
+ string that was accepted through incremental searching. */
+ if (func == isearch_forward || func == isearch_backward)
+ {
+ if ((func == isearch_forward && dir > 0) ||
+ (func == isearch_backward && dir < 0))
+ {
+ /* If the user has typed no characters, then insert the
+ last successful search into the current search string. */
+ if (isearch_string_index == 0)
+ {
+ /* Of course, there must be something to insert. */
+ if (last_isearch_accepted)
+ {
+ if (strlen (last_isearch_accepted) + 1 >=
+ isearch_string_size)
+ isearch_string = (char *)
+ xrealloc (isearch_string,
+ isearch_string_size += 10 +
+ strlen (last_isearch_accepted));
+ strcpy (isearch_string, last_isearch_accepted);
+ isearch_string_index = strlen (isearch_string);
+ goto search_now;
+ }
+ else
+ continue;
+ }
+ else
+ {
+ /* Search again in the same direction. This means start
+ from a new place if the last search was successful. */
+ if (search_result == 0)
+ window->point += dir;
+ }
+ }
+ else
+ {
+ /* Reverse the direction of the search. */
+ dir = -dir;
+ }
+ }
+ else if (isprint (key) || func == (VFunction *)NULL)
+ {
+ insert_and_search:
+
+ if (isearch_string_index + 2 >= isearch_string_size)
+ isearch_string = (char *)xrealloc
+ (isearch_string, isearch_string_size += 100);
+
+ isearch_string[isearch_string_index++] = key;
+ isearch_string[isearch_string_index] = '\0';
+ goto search_now;
+ }
+ else if (func == info_abort_key)
+ {
+ /* If C-g pressed, and the search is failing, pop the search
+ stack back to the last unfailed search. */
+ if (isearch_states_index && (search_result != 0))
+ {
+ terminal_ring_bell ();
+ while (isearch_states_index && (search_result != 0))
+ pop_isearch
+ (window, &isearch_string_index, &dir, &search_result);
+ isearch_string[isearch_string_index] = '\0';
+ show_isearch_prompt (dir, isearch_string, search_result);
+ continue;
+ }
+ else
+ goto exit_search;
+ }
+ else
+ goto exit_search;
+ }
else
- {
- exit_search:
- /* The character is not printable, or it has a function which is
- non-null. Exit the search, remembering the search string. If
- the key is not the same as the isearch_terminate_search_key,
- then push it into pending input. */
- if (isearch_string_index && func != info_abort_key)
- {
- maybe_free (last_isearch_accepted);
- last_isearch_accepted = strdup (isearch_string);
- }
-
- if (key != isearch_terminate_search_key)
- info_set_pending_input (key);
-
- if (func == info_abort_key)
- {
- if (isearch_states_index)
- window_set_state (window, &orig_state);
- }
-
- if (!echo_area_is_active)
- window_clear_echo_area ();
-
- if (auto_footnotes_p)
- info_get_or_remove_footnotes (active_window);
-
- isearch_is_active = 0;
- continue;
- }
+ {
+ exit_search:
+ /* The character is not printable, or it has a function which is
+ non-null. Exit the search, remembering the search string. If
+ the key is not the same as the isearch_terminate_search_key,
+ then push it into pending input. */
+ if (isearch_string_index && func != info_abort_key)
+ {
+ maybe_free (last_isearch_accepted);
+ last_isearch_accepted = xstrdup (isearch_string);
+ }
+
+ if (key != isearch_terminate_search_key)
+ info_set_pending_input (key);
+
+ if (func == info_abort_key)
+ {
+ if (isearch_states_index)
+ window_set_state (window, &orig_state);
+ }
+
+ if (!echo_area_is_active)
+ window_clear_echo_area ();
+
+ if (auto_footnotes_p)
+ info_get_or_remove_footnotes (active_window);
+
+ isearch_is_active = 0;
+ continue;
+ }
/* Search for the contents of isearch_string. */
search_now:
show_isearch_prompt (dir, isearch_string, search_result);
if (search_result == 0)
- {
- /* Check to see if the current search string is right here. If
- we are looking at it, then don't bother calling the search
- function. */
- if (((dir < 0) &&
- (strncasecmp (window->node->contents + window->point,
- isearch_string, isearch_string_index) == 0)) ||
- ((dir > 0) &&
- ((window->point - isearch_string_index) >= 0) &&
- (strncasecmp (window->node->contents +
- (window->point - (isearch_string_index - 1)),
- isearch_string, isearch_string_index) == 0)))
- {
- if (dir > 0)
- window->point++;
- }
- else
- search_result = info_search_internal (isearch_string, window, dir);
- }
+ {
+ /* Check to see if the current search string is right here. If
+ we are looking at it, then don't bother calling the search
+ function. */
+ if (((dir < 0) &&
+ (strncasecmp (window->node->contents + window->point,
+ isearch_string, isearch_string_index) == 0)) ||
+ ((dir > 0) &&
+ ((window->point - isearch_string_index) >= 0) &&
+ (strncasecmp (window->node->contents +
+ (window->point - (isearch_string_index - 1)),
+ isearch_string, isearch_string_index) == 0)))
+ {
+ if (dir > 0)
+ window->point++;
+ }
+ else
+ search_result = info_search_internal (isearch_string, window, dir);
+ }
/* If this search failed, and we didn't already have a failed search,
- then ring the terminal bell. */
+ then ring the terminal bell. */
if (search_result != 0 && last_search_result == 0)
- terminal_ring_bell ();
+ terminal_ring_bell ();
after_search:
show_isearch_prompt (dir, isearch_string, search_result);
if (search_result == 0)
- {
- if ((mystate.node == window->node) &&
- (mystate.pagetop != window->pagetop))
- {
- int newtop = window->pagetop;
- window->pagetop = mystate.pagetop;
- set_window_pagetop (window, newtop);
- }
- display_update_one_window (window);
- display_cursor_at_point (window);
- }
+ {
+ if ((mystate.node == window->node) &&
+ (mystate.pagetop != window->pagetop))
+ {
+ int newtop = window->pagetop;
+ window->pagetop = mystate.pagetop;
+ set_window_pagetop (window, newtop);
+ }
+ display_update_one_window (window);
+ display_cursor_at_point (window);
+ }
last_search_result = search_result;
}
@@ -3435,52 +3413,52 @@ info_gc_file_buffers ()
if (!info_loaded_files)
return;
- for (fb_index = 0; fb = info_loaded_files[fb_index]; fb_index++)
+ for (fb_index = 0; (fb = info_loaded_files[fb_index]); fb_index++)
{
int fb_referenced_p = 0;
/* If already gc-ed, do nothing. */
if (!fb->contents)
- continue;
+ continue;
/* If this file had to be uncompressed, check to see if we should
- gc it. This means that the user-variable "gc-compressed-files"
- is non-zero. */
+ gc it. This means that the user-variable "gc-compressed-files"
+ is non-zero. */
if ((fb->flags & N_IsCompressed) && !gc_compressed_files)
- continue;
+ continue;
/* If this file's contents are not gc-able, move on. */
if (fb->flags & N_CannotGC)
- continue;
+ continue;
/* Check each INFO_WINDOW to see if it has any nodes which reference
- this file. */
- for (iw_index = 0; iw = info_windows[iw_index]; iw_index++)
- {
- for (i = 0; iw->nodes && iw->nodes[i]; i++)
- {
- if ((strcmp (fb->fullpath, iw->nodes[i]->filename) == 0) ||
- (strcmp (fb->filename, iw->nodes[i]->filename) == 0))
- {
- fb_referenced_p = 1;
- break;
- }
- }
- }
+ this file. */
+ for (iw_index = 0; (iw = info_windows[iw_index]); iw_index++)
+ {
+ for (i = 0; iw->nodes && iw->nodes[i]; i++)
+ {
+ if ((strcmp (fb->fullpath, iw->nodes[i]->filename) == 0) ||
+ (strcmp (fb->filename, iw->nodes[i]->filename) == 0))
+ {
+ fb_referenced_p = 1;
+ break;
+ }
+ }
+ }
/* If this file buffer wasn't referenced, free its contents. */
if (!fb_referenced_p)
- {
- free (fb->contents);
- fb->contents = (char *)NULL;
- }
+ {
+ free (fb->contents);
+ fb->contents = (char *)NULL;
+ }
}
}
/* **************************************************************** */
-/* */
-/* Traversing and Selecting References */
-/* */
+/* */
+/* Traversing and Selecting References */
+/* */
/* **************************************************************** */
/* Move to the next or previous cross reference in this node. */
@@ -3515,8 +3493,8 @@ info_move_to_xref (window, count, key, dir)
char *text = node->contents + firstmenu;
if (strncmp (text, INFO_MENU_LABEL, strlen (INFO_MENU_LABEL)) == 0)
- firstmenu = info_search_in_node
- (INFO_MENU_ENTRY_LABEL, node, firstmenu + dir, (WINDOW *)NULL, dir);
+ firstmenu = info_search_in_node
+ (INFO_MENU_ENTRY_LABEL, node, firstmenu + dir, (WINDOW *)NULL, dir);
}
firstxref =
@@ -3531,7 +3509,7 @@ info_move_to_xref (window, count, key, dir)
if (firstmenu == -1 && firstxref == -1)
{
- info_error ("No cross references in this node.");
+ info_error (_("No cross references in this node."));
return;
}
@@ -3555,8 +3533,8 @@ info_move_to_xref (window, count, key, dir)
char *text = node->contents + nextmenu;
if (strncmp (text, INFO_MENU_LABEL, strlen (INFO_MENU_LABEL)) == 0)
- nextmenu = info_search_in_node
- (INFO_MENU_ENTRY_LABEL, node, nextmenu + dir, (WINDOW *)NULL, dir);
+ nextmenu = info_search_in_node
+ (INFO_MENU_ENTRY_LABEL, node, nextmenu + dir, (WINDOW *)NULL, dir);
}
/* If there is both a next menu entry, and a next xref entry, choose the
@@ -3565,10 +3543,10 @@ info_move_to_xref (window, count, key, dir)
if (nextmenu != -1 && nextxref != -1)
{
if (((dir == 1) && (nextmenu < nextxref)) ||
- ((dir == -1) && (nextmenu > nextxref)))
- placement = nextmenu + 1;
+ ((dir == -1) && (nextmenu > nextxref)))
+ placement = nextmenu + 1;
else
- placement = nextxref;
+ placement = nextxref;
}
else if (nextmenu != -1)
placement = nextmenu + 1;
@@ -3580,17 +3558,17 @@ info_move_to_xref (window, count, key, dir)
if (placement == -1)
{
if (firstmenu != -1 && firstxref != -1)
- {
- if (((dir == 1) && (firstmenu < firstxref)) ||
- ((dir == -1) && (firstmenu > firstxref)))
- placement = firstmenu + 1;
- else
- placement = firstxref;
- }
+ {
+ if (((dir == 1) && (firstmenu < firstxref)) ||
+ ((dir == -1) && (firstmenu > firstxref)))
+ placement = firstmenu + 1;
+ else
+ placement = firstxref;
+ }
else if (firstmenu != -1)
- placement = firstmenu + 1;
+ placement = firstmenu + 1;
else
- placement = firstxref;
+ placement = firstxref;
}
window->point = placement;
window_adjust_pagetop (window);
@@ -3598,7 +3576,7 @@ info_move_to_xref (window, count, key, dir)
}
DECLARE_INFO_COMMAND (info_move_to_prev_xref,
- "Move to the previous cross reference")
+ _("Move to the previous cross reference"))
{
if (count < 0)
info_move_to_prev_xref (window, -count, key);
@@ -3607,7 +3585,7 @@ DECLARE_INFO_COMMAND (info_move_to_prev_xref,
}
DECLARE_INFO_COMMAND (info_move_to_next_xref,
- "Move to the next cross reference")
+ _("Move to the next cross reference"))
{
if (count < 0)
info_move_to_next_xref (window, -count, key);
@@ -3617,7 +3595,7 @@ DECLARE_INFO_COMMAND (info_move_to_next_xref,
/* Select the menu item or reference that appears on this line. */
DECLARE_INFO_COMMAND (info_select_reference_this_line,
- "Select reference or menu item appearing on this line")
+ _("Select reference or menu item appearing on this line"))
{
char *line;
NODE *orig;
@@ -3633,20 +3611,20 @@ DECLARE_INFO_COMMAND (info_select_reference_this_line,
}
/* **************************************************************** */
-/* */
-/* Miscellaneous Info Commands */
-/* */
+/* */
+/* Miscellaneous Info Commands */
+/* */
/* **************************************************************** */
/* What to do when C-g is pressed in a window. */
-DECLARE_INFO_COMMAND (info_abort_key, "Cancel current operation")
+DECLARE_INFO_COMMAND (info_abort_key, _("Cancel current operation"))
{
/* If error printing doesn't oridinarily ring the bell, do it now,
since C-g always rings the bell. Otherwise, let the error printer
do it. */
if (!info_error_rings_bell_p)
terminal_ring_bell ();
- info_error ("Quit");
+ info_error (_("Quit"));
info_initialize_numeric_arg ();
info_clear_pending_input ();
@@ -3655,7 +3633,7 @@ DECLARE_INFO_COMMAND (info_abort_key, "Cancel current operation")
/* Move the cursor to the desired line of the window. */
DECLARE_INFO_COMMAND (info_move_to_window_line,
- "Move to the cursor to a specific line of the window")
+ _("Move to the cursor to a specific line of the window"))
{
int line;
@@ -3665,9 +3643,9 @@ DECLARE_INFO_COMMAND (info_move_to_window_line,
else
{
if (count < 0)
- line = (window->height + count) + window->pagetop;
+ line = (window->height + count) + window->pagetop;
else
- line = window->pagetop + count;
+ line = window->pagetop + count;
}
/* If the line doesn't appear in this window, make it do so. */
@@ -3687,7 +3665,7 @@ DECLARE_INFO_COMMAND (info_move_to_window_line,
/* Clear the screen and redraw its contents. Given a numeric argument,
move the line the cursor is on to the COUNT'th line of the window. */
-DECLARE_INFO_COMMAND (info_redraw_display, "Redraw the display")
+DECLARE_INFO_COMMAND (info_redraw_display, _("Redraw the display"))
{
if ((!info_explicit_arg && count == 1) || echo_area_is_active)
{
@@ -3704,18 +3682,18 @@ DECLARE_INFO_COMMAND (info_redraw_display, "Redraw the display")
point_line = window_line_of_point (window) - window->pagetop;
if (count < 0)
- desired_line = window->height + count;
+ desired_line = window->height + count;
else
- desired_line = count;
+ desired_line = count;
if (desired_line < 0)
- desired_line = 0;
+ desired_line = 0;
if (desired_line >= window->height)
- desired_line = window->height - 1;
+ desired_line = window->height - 1;
if (desired_line == point_line)
- return;
+ return;
new_pagetop = window->pagetop + (point_line - desired_line);
@@ -3724,14 +3702,14 @@ DECLARE_INFO_COMMAND (info_redraw_display, "Redraw the display")
}
/* This command does nothing. It is the fact that a key is bound to it
that has meaning. See the code at the top of info_session (). */
-DECLARE_INFO_COMMAND (info_quit, "Quit using Info")
+DECLARE_INFO_COMMAND (info_quit, _("Quit using Info"))
{}
/* **************************************************************** */
-/* */
-/* Reading Keys and Dispatching on Them */
-/* */
+/* */
+/* Reading Keys and Dispatching on Them */
+/* */
/* **************************************************************** */
/* Declaration only. Special cased in info_dispatch_on_key (). */
@@ -3747,14 +3725,14 @@ dispatch_error (keyseq)
rep = pretty_keyseq (keyseq);
if (!echo_area_is_active)
- info_error ("Unknown command (%s).", rep);
+ info_error (_("Unknown command (%s)."), rep);
else
{
char *temp;
- temp = (char *)xmalloc (1 + strlen (rep) + strlen ("\"\" is invalid"));
+ temp = (char *)xmalloc (1 + strlen (rep) + strlen (_("\"\" is invalid")));
- sprintf (temp, "\"%s\" is invalid", rep);
+ sprintf (temp, _("\"%s\" is invalid"), rep);
terminal_ring_bell ();
inform_in_echo_area (temp);
free (temp);
@@ -3800,8 +3778,8 @@ pretty_keyseq (keyseq)
for (i = 0; keyseq[i]; i++)
{
sprintf (keyseq_rep + strlen (keyseq_rep), "%s%s",
- strlen (keyseq_rep) ? " " : "",
- pretty_keyname (keyseq[i]));
+ strlen (keyseq_rep) ? " " : "",
+ pretty_keyname (keyseq[i]));
}
return (keyseq_rep);
@@ -3834,25 +3812,30 @@ display_info_keyseq (expecting_future_input)
unsigned char
info_get_another_input_char ()
{
- int ready = 0;
+ int ready = !info_keyseq_displayed_p; /* ready if new and pending key */
/* If there isn't any input currently available, then wait a
moment looking for input. If we don't get it fast enough,
prompt a little bit with the current key sequence. */
- if (!info_keyseq_displayed_p &&
- !info_any_buffered_input_p () &&
- !info_input_pending_p ())
+ if (!info_keyseq_displayed_p)
{
+ ready = 1;
+ if (!info_any_buffered_input_p () &&
+ !info_input_pending_p ())
+ {
#if defined (FD_SET)
- struct timeval timer;
- fd_set readfds;
-
- FD_ZERO (&readfds);
- FD_SET (fileno (info_input_stream), &readfds);
- timer.tv_sec = 1;
- timer.tv_usec = 750;
- ready = select (1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
+ struct timeval timer;
+ fd_set readfds;
+
+ FD_ZERO (&readfds);
+ FD_SET (fileno (info_input_stream), &readfds);
+ timer.tv_sec = 1;
+ timer.tv_usec = 750;
+ ready = select (fileno(info_input_stream)+1, &readfds, (fd_set *)NULL, (fd_set *)NULL, &timer);
+#else
+ ready = 0;
#endif /* FD_SET */
+ }
}
if (!ready)
@@ -3871,16 +3854,16 @@ info_dispatch_on_key (key, map)
if (Meta_p (key) && (!ISO_Latin_p || map[key].function != ea_insert))
{
if (map[ESC].type == ISKMAP)
- {
- map = (Keymap)map[ESC].function;
- add_char_to_keyseq (ESC);
- key = UnMeta (key);
- info_dispatch_on_key (key, map);
- }
+ {
+ map = (Keymap)map[ESC].function;
+ add_char_to_keyseq (ESC);
+ key = UnMeta (key);
+ info_dispatch_on_key (key, map);
+ }
else
- {
- dispatch_error (info_keyseq);
- }
+ {
+ dispatch_error (info_keyseq);
+ }
return;
}
@@ -3888,74 +3871,74 @@ info_dispatch_on_key (key, map)
{
case ISFUNC:
{
- VFunction *func;
-
- func = map[key].function;
- if (func != (VFunction *)NULL)
- {
- /* Special case info_do_lowercase_version (). */
- if (func == info_do_lowercase_version)
- {
- info_dispatch_on_key (tolower (key), map);
- return;
- }
-
- add_char_to_keyseq (key);
-
- if (info_keyseq_displayed_p)
- display_info_keyseq (0);
-
- {
- WINDOW *where;
-
- where = active_window;
- (*map[key].function)
- (active_window, info_numeric_arg * info_numeric_arg_sign, key);
-
- /* If we have input pending, then the last command was a prefix
- command. Don't change the value of the last function vars.
- Otherwise, remember the last command executed in the var
- appropriate to the window in which it was executed. */
- if (!info_input_pending_p ())
- {
- if (where == the_echo_area)
- ea_last_executed_command = map[key].function;
- else
- info_last_executed_command = map[key].function;
- }
- }
- }
- else
- {
- add_char_to_keyseq (key);
- dispatch_error (info_keyseq);
- return;
- }
+ VFunction *func;
+
+ func = map[key].function;
+ if (func != (VFunction *)NULL)
+ {
+ /* Special case info_do_lowercase_version (). */
+ if (func == info_do_lowercase_version)
+ {
+ info_dispatch_on_key (tolower (key), map);
+ return;
+ }
+
+ add_char_to_keyseq (key);
+
+ if (info_keyseq_displayed_p)
+ display_info_keyseq (0);
+
+ {
+ WINDOW *where;
+
+ where = active_window;
+ (*map[key].function)
+ (active_window, info_numeric_arg * info_numeric_arg_sign, key);
+
+ /* If we have input pending, then the last command was a prefix
+ command. Don't change the value of the last function vars.
+ Otherwise, remember the last command executed in the var
+ appropriate to the window in which it was executed. */
+ if (!info_input_pending_p ())
+ {
+ if (where == the_echo_area)
+ ea_last_executed_command = map[key].function;
+ else
+ info_last_executed_command = map[key].function;
+ }
+ }
+ }
+ else
+ {
+ add_char_to_keyseq (key);
+ dispatch_error (info_keyseq);
+ return;
+ }
}
break;
case ISKMAP:
add_char_to_keyseq (key);
if (map[key].function != (VFunction *)NULL)
- {
- unsigned char newkey;
+ {
+ unsigned char newkey;
- newkey = info_get_another_input_char ();
- info_dispatch_on_key (newkey, (Keymap)map[key].function);
- }
+ newkey = info_get_another_input_char ();
+ info_dispatch_on_key (newkey, (Keymap)map[key].function);
+ }
else
- {
- dispatch_error (info_keyseq);
- return;
- }
+ {
+ dispatch_error (info_keyseq);
+ return;
+ }
break;
}
}
/* **************************************************************** */
-/* */
-/* Numeric Arguments */
-/* */
+/* */
+/* Numeric Arguments */
+/* */
/* **************************************************************** */
/* Handle C-u style numeric args, as well as M--, and M-digits. */
@@ -3972,7 +3955,7 @@ int info_numeric_arg = 1;
/* Add the current digit to the argument in progress. */
DECLARE_INFO_COMMAND (info_add_digit_to_numeric_arg,
- "Add this digit to the current numeric argument")
+ _("Add this digit to the current numeric argument"))
{
info_numeric_arg_digit_loop (window, 0, key);
}
@@ -3981,7 +3964,7 @@ DECLARE_INFO_COMMAND (info_add_digit_to_numeric_arg,
Read a key. If the key has nothing to do with arguments, then
dispatch on it. If the key is the abort character then abort. */
DECLARE_INFO_COMMAND (info_universal_argument,
- "Start (or multiply by 4) the current numeric argument")
+ _("Start (or multiply by 4) the current numeric argument"))
{
info_numeric_arg *= 4;
info_numeric_arg_digit_loop (window, 0, 0);
@@ -3996,7 +3979,7 @@ info_initialize_numeric_arg ()
}
DECLARE_INFO_COMMAND (info_numeric_arg_digit_loop,
- "Internally used by \\[universal-argument]")
+ _("Internally used by \\[universal-argument]"))
{
unsigned char pure_key;
Keymap keymap = window->keymap;
@@ -4004,64 +3987,64 @@ DECLARE_INFO_COMMAND (info_numeric_arg_digit_loop,
while (1)
{
if (key)
- pure_key = key;
+ pure_key = key;
else
- {
- if (display_was_interrupted_p && !info_any_buffered_input_p ())
- display_update_display (windows);
+ {
+ if (display_was_interrupted_p && !info_any_buffered_input_p ())
+ display_update_display (windows);
- if (active_window != the_echo_area)
- display_cursor_at_point (active_window);
+ if (active_window != the_echo_area)
+ display_cursor_at_point (active_window);
- pure_key = key = info_get_another_input_char ();
+ pure_key = key = info_get_another_input_char ();
- if (Meta_p (key))
- add_char_to_keyseq (ESC);
+ if (Meta_p (key))
+ add_char_to_keyseq (ESC);
- add_char_to_keyseq (UnMeta (key));
- }
+ add_char_to_keyseq (UnMeta (key));
+ }
if (Meta_p (key))
- key = UnMeta (key);
+ key = UnMeta (key);
if (keymap[key].type == ISFUNC &&
- keymap[key].function == info_universal_argument)
- {
- info_numeric_arg *= 4;
- key = 0;
- continue;
- }
+ keymap[key].function == info_universal_argument)
+ {
+ info_numeric_arg *= 4;
+ key = 0;
+ continue;
+ }
if (isdigit (key))
- {
- if (info_explicit_arg)
- info_numeric_arg = (info_numeric_arg * 10) + (key - '0');
- else
- info_numeric_arg = (key - '0');
- info_explicit_arg = 1;
- }
+ {
+ if (info_explicit_arg)
+ info_numeric_arg = (info_numeric_arg * 10) + (key - '0');
+ else
+ info_numeric_arg = (key - '0');
+ info_explicit_arg = 1;
+ }
else
- {
- if (key == '-' && !info_explicit_arg)
- {
- info_numeric_arg_sign = -1;
- info_numeric_arg = 1;
- }
- else
- {
- info_keyseq_index--;
- info_dispatch_on_key (pure_key, keymap);
- return;
- }
- }
+ {
+ if (key == '-' && !info_explicit_arg)
+ {
+ info_numeric_arg_sign = -1;
+ info_numeric_arg = 1;
+ }
+ else
+ {
+ info_keyseq_index--;
+ info_dispatch_on_key (pure_key, keymap);
+ return;
+ }
+ }
key = 0;
}
}
/* **************************************************************** */
-/* */
-/* Input Character Buffering */
-/* */
+/* */
+/* Input Character Buffering */
+/* */
/* **************************************************************** */
/* Character waiting to be read next. */
@@ -4110,7 +4093,7 @@ info_push_typeahead (key)
{
info_input_buffer[push_index++] = key;
if (push_index >= sizeof (info_input_buffer))
- push_index = 0;
+ push_index = 0;
}
}
@@ -4121,7 +4104,7 @@ info_input_buffer_space_available ()
if (pop_index > push_index)
return (pop_index - push_index);
else
- return (sizeof (info_input_buffer - (push_index - pop_index)));
+ return (sizeof (info_input_buffer) - (push_index - pop_index));
}
/* Get a key from the buffer of characters to be read.
@@ -4149,28 +4132,12 @@ info_any_buffered_input_p ()
return (push_index != pop_index);
}
-/* Push KEY into the *front* of the input buffer. Returns non-zero if
- successful, zero if there is no space left in the buffer. */
-static int
-info_replace_key_to_typeahead (key)
- unsigned char key;
-{
- if (info_input_buffer_space_available ())
- {
- pop_index--;
- if (pop_index < 0)
- pop_index = sizeof (info_input_buffer) - 1;
- info_input_buffer[pop_index] = key;
- return (1);
- }
- return (0);
-}
-
/* If characters are available to be read, then read them and stuff them into
info_input_buffer. Otherwise, do nothing. */
void
info_gather_typeahead ()
{
+ register int i = 0;
int tty, space_avail;
long chars_avail;
unsigned char input[MAX_INFO_INPUT_BUFFERING];
@@ -4189,7 +4156,7 @@ info_gather_typeahead ()
chars_avail = space_avail;
if (chars_avail)
- read (tty, &input[0], chars_avail);
+ chars_avail = read (tty, &input[0], chars_avail);
}
#else /* !FIONREAD */
# if defined (O_NDELAY)
@@ -4208,13 +4175,11 @@ info_gather_typeahead ()
# endif /* O_NDELAY */
#endif /* !FIONREAD */
- /* Store the input characters just read into our input buffer. */
- {
- register int i;
-
- for (i = 0; i < chars_avail; i++)
+ while (i < chars_avail)
+ {
info_push_typeahead (input[i]);
- }
+ i++;
+ }
}
/* How to read a single character. */
@@ -4233,34 +4198,55 @@ info_get_input_char ()
else if (info_get_key_from_typeahead (&keystroke) == 0)
{
int rawkey;
+ unsigned char c;
+ int tty = fileno (info_input_stream);
+
+ /* Using stream I/O causes FIONREAD etc to fail to work
+ so unless someone can find a portable way of finding
+ out how many characters are currently buffered, we
+ should stay with away from stream I/O.
+ --Egil Kvaleberg <egilk@sn.no>, January 1997. */
+#ifdef EINTR
+ /* Keep reading if we got EINTR, so that we don't just exit.
+ --Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>,
+ 22 Dec 1997. */
+ {
+ int n;
+ do
+ n = read (tty, &c, 1);
+ while (n == -1 && errno == EINTR);
+ rawkey = n == 1 ? c : EOF;
+ }
+#else
+ rawkey = (read (tty, &c, 1) == 1) ? c : EOF;
+#endif
- rawkey = getc (info_input_stream);
keystroke = rawkey;
if (rawkey == EOF)
- {
- if (info_input_stream != stdin)
- {
- fclose (info_input_stream);
- info_input_stream = stdin;
- display_inhibited = 0;
- display_update_display (windows);
- display_cursor_at_point (active_window);
- rawkey = getc (info_input_stream);
- keystroke = rawkey;
- }
-
- if (rawkey == EOF)
- {
- terminal_unprep_terminal ();
- close_dribble_file ();
- exit (0);
- }
- }
+ {
+ if (info_input_stream != stdin)
+ {
+ fclose (info_input_stream);
+ info_input_stream = stdin;
+ display_inhibited = 0;
+ display_update_display (windows);
+ display_cursor_at_point (active_window);
+ rawkey = (read (tty, &c, 1) == 1) ? c : EOF;
+ keystroke = rawkey;
+ }
+
+ if (rawkey == EOF)
+ {
+ terminal_unprep_terminal ();
+ close_dribble_file ();
+ exit (0);
+ }
+ }
}
if (info_dribble_file)
dribble (keystroke);
- return (keystroke);
+ return keystroke;
}
diff --git a/gnu/usr.bin/texinfo/info/signals.h b/gnu/usr.bin/texinfo/info/signals.h
index ab87a3b5495..ff82a0b3bee 100644
--- a/gnu/usr.bin/texinfo/info/signals.h
+++ b/gnu/usr.bin/texinfo/info/signals.h
@@ -1,9 +1,10 @@
-/* signals.h -- Header to include system dependent signal definitions. */
+/* signals.h -- Header to include system dependent signal definitions.
+ $Id: signals.h,v 1.2 1999/01/11 16:38:09 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
+ This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
+ Copyright (C) 1993, 94, 95, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,11 +22,17 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#if !defined (_SIGNALS_H_)
-#define _SIGNALS_H_
+#ifndef INFO_SIGNALS_H
+#define INFO_SIGNALS_H
+#include <sys/types.h>
#include <signal.h>
+/* For sysV68 --phdm@info.ucl.ac.be. */
+#if !defined (SIGCHLD) && defined (SIGCLD)
+#define SIGCHLD SIGCLD
+#endif
+
#if !defined (HAVE_SIGPROCMASK) && !defined (sigmask)
# define sigmask(x) (1 << ((x)-1))
#endif /* !HAVE_SIGPROCMASK && !sigmask */
@@ -86,4 +93,4 @@
# define UNBLOCK_SIGNAL(sig)
#endif /* !HAVE_SIGPROCMASK && !HAVE_SIGSETMASK */
-#endif /* !_SIGNALS_H_ */
+#endif /* not INFO_SIGNALS_H */
diff --git a/gnu/usr.bin/texinfo/info/termdep.h b/gnu/usr.bin/texinfo/info/termdep.h
index 4784b7ab7ee..6ba89ab89bc 100644
--- a/gnu/usr.bin/texinfo/info/termdep.h
+++ b/gnu/usr.bin/texinfo/info/termdep.h
@@ -1,9 +1,10 @@
-/* termdep.h -- System things that terminal.c depends on. */
+/* termdep.h -- System things that terminal.c depends on.
+ $Id: termdep.h,v 1.2 1999/01/11 16:38:09 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
+ This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 96, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,49 +22,36 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#if !defined (_TERMDEP_H_)
-# define _TERMDEP_H_
+#ifndef INFO_TERMDEP_H
+#define INFO_TERMDEP_H
-#if defined (HAVE_SYS_FCNTL_H)
-# include <sys/fcntl.h>
-#else
-# include <fcntl.h>
-#endif /* !HAVE_SYS_FCNTL_H */
-
-#if defined (HAVE_TERMIO_H)
-# include <termio.h>
-# include <string.h>
-# if defined (HAVE_SYS_PTEM_H)
-# if defined (M_UNIX) || !defined (M_XENIX)
-# include <sys/stream.h>
-# include <sys/ptem.h>
-# undef TIOCGETC
-# else /* M_XENIX */
-# define tchars tc
-# endif /* M_XENIX */
-# endif /* HAVE_SYS_PTEM_H */
-#else /* !HAVE_TERMIO_H */
-# if defined (HAVE_SYS_FILE_H)
-# include <sys/file.h>
-# endif /* HAVE_SYS_FILE_H */
-# include <sgtty.h>
-# include <strings.h>
-#endif /* !HAVE_TERMIO_H */
+/* NeXT supplies <termios.h> but it is broken. Probably Autoconf should
+ have a separate test, but anyway ... */
+#ifdef NeXT
+#undef HAVE_TERMIOS_H
+#endif
-#if defined (HAVE_SYS_TTOLD_H)
+#ifdef HAVE_TERMIOS_H
+# include <termios.h>
+#else
+# if defined (HAVE_TERMIO_H)
+# include <termio.h>
+# if defined (HAVE_SYS_PTEM_H)
+# if defined (M_UNIX) || !defined (M_XENIX)
+# include <sys/stream.h>
+# include <sys/ptem.h>
+# undef TIOCGETC
+# else /* M_XENIX */
+# define tchars tc
+# endif /* M_XENIX */
+# endif /* HAVE_SYS_PTEM_H */
+# else /* !HAVE_TERMIO_H */
+# include <sgtty.h>
+# endif /* !HAVE_TERMIO_H */
+#endif /* !HAVE_TERMIOS_H */
+
+#ifdef HAVE_SYS_TTOLD_H
# include <sys/ttold.h>
#endif /* HAVE_SYS_TTOLD_H */
-#if !defined (HAVE_STRCHR)
-# undef strchr
-# undef strrchr
-# define strchr index
-# define strrchr rindex
-#endif /* !HAVE_STRCHR */
-
-#if !defined (HAVE_MEMCPY)
-#undef memcpy
-#define memcpy(dest, source, count) bcopy(source, dest, count)
-#endif /* !HAVE_MEMCPY */
-
-#endif /* _TERMDEP_H_ */
+#endif /* not INFO_TERMDEP_H */
diff --git a/gnu/usr.bin/texinfo/info/terminal.c b/gnu/usr.bin/texinfo/info/terminal.c
index 2e3c411a146..e1e3d2d4d0c 100644
--- a/gnu/usr.bin/texinfo/info/terminal.c
+++ b/gnu/usr.bin/texinfo/info/terminal.c
@@ -1,8 +1,8 @@
/* terminal.c -- How to handle the physical terminal for Info.
- $Id: terminal.c,v 1.3 1997/08/01 22:37:40 kstailey Exp $
+ $Id: terminal.c,v 1.4 1999/01/11 16:38:09 espie Exp $
- Copyright (C) 1988, 89, 90, 91, 92, 93, 96, 97 Free Software
- Foundation, Inc.
+ Copyright (C) 1988, 89, 90, 91, 92, 93, 96, 97, 98
+ Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -141,7 +141,10 @@ terminal_begin_using_terminal ()
if (!term_begin_use || !*term_begin_use)
return;
+#ifdef SIGWINCH
sigsave = signal (SIGWINCH, SIG_IGN);
+#endif
+
send_to_terminal (term_begin_use);
/* Without this fflush and sleep, running info in a shelltool or
cmdtool (TERM=sun-cmd) with scrollbars loses -- the scrollbars are
@@ -149,7 +152,10 @@ terminal_begin_using_terminal ()
From: strube@physik3.gwdg.de (Hans Werner Strube). */
fflush (stdout);
sleep (1);
+
+#ifdef SIGWINCH
signal (SIGWINCH, sigsave);
+#endif
}
/* Tell the terminal that we will not be doing any more cursor
@@ -165,11 +171,17 @@ terminal_end_using_terminal ()
if (!term_end_use || !*term_end_use)
return;
+#ifdef SIGWINCH
sigsave = signal (SIGWINCH, SIG_IGN);
+#endif
+
send_to_terminal (term_end_use);
fflush (stdout);
sleep (1);
+
+#ifdef SIGWINCH
signal (SIGWINCH, sigsave);
+#endif
}
/* **************************************************************** */
diff --git a/gnu/usr.bin/texinfo/info/tilde.c b/gnu/usr.bin/texinfo/info/tilde.c
index df2f6dcde18..38cdf395396 100644
--- a/gnu/usr.bin/texinfo/info/tilde.c
+++ b/gnu/usr.bin/texinfo/info/tilde.c
@@ -1,13 +1,11 @@
-/* tilde.c -- Tilde expansion code (~/foo := $HOME/foo). */
+/* tilde.c -- Tilde expansion code (~/foo := $HOME/foo).
+ $Id: tilde.c,v 1.2 1999/01/11 16:38:10 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
+ This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- This file has appeared in prior works by the Free Software Foundation;
- thus it carries copyright dates from 1988 through 1993.
-
- Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993 Free Software
- Foundation, Inc.
+ Copyright (C) 1988, 89, 90, 91, 92, 93, 96, 98
+ Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,39 +23,29 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#if defined (__GNUC__)
-# define alloca __builtin_alloca
-#else /* !__GNUC__ */
-# if defined (_AIX)
+/* Indent #pragma so that older Cpp's don't try to parse it. */
+#ifdef _AIX
#pragma alloca
-# else /* !_AIX */
-# if defined (HAVE_ALLOCA_H)
-# include <alloca.h>
-# endif /* HAVE_ALLOCA_H */
-# endif /* !AIX */
-#endif /* !__GNUC__ */
-
-#if defined (HAVE_STDLIB_H)
-#include <stdlib.h>
-#endif
+#endif /* _AIX */
-#include "tilde.h"
-#include <pwd.h>
-
-#if defined (HAVE_STRING_H)
-#include <string.h>
-#endif
+/* Include config.h before doing alloca. */
+#include "info.h"
-#include "clib.h"
-
-#if !defined (NULL)
-# define NULL 0x0
+#ifdef __GNUC__
+# undef alloca
+# define alloca __builtin_alloca
+#else
+# ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+# else
+# ifndef _AIX
+char *alloca ();
+# endif
+# endif
#endif
#if defined (TEST) || defined (STATIC_MALLOC)
static void *xmalloc (), *xrealloc ();
-#else
-extern void *xmalloc (), *xrealloc ();
#endif /* TEST || STATIC_MALLOC */
/* The default value of tilde_additional_prefixes. This is set to
@@ -108,16 +96,16 @@ tilde_find_prefix (string, len)
if (prefixes)
{
for (i = 0; i < string_len; i++)
- {
- for (j = 0; prefixes[j]; j++)
- {
- if (strncmp (string + i, prefixes[j], strlen (prefixes[j])) == 0)
- {
- *len = strlen (prefixes[j]) - 1;
- return (i + *len);
- }
- }
- }
+ {
+ for (j = 0; prefixes[j]; j++)
+ {
+ if (strncmp (string + i, prefixes[j], strlen (prefixes[j])) == 0)
+ {
+ *len = strlen (prefixes[j]) - 1;
+ return (i + *len);
+ }
+ }
+ }
}
return (string_len);
}
@@ -136,13 +124,13 @@ tilde_find_suffix (string)
for (i = 0; i < string_len; i++)
{
if (string[i] == '/' || !string[i])
- break;
+ break;
for (j = 0; suffixes && suffixes[j]; j++)
- {
- if (strncmp (string + i, suffixes[j], strlen (suffixes[j])) == 0)
- return (i);
- }
+ {
+ if (strncmp (string + i, suffixes[j], strlen (suffixes[j])) == 0)
+ return (i);
+ }
}
return (i);
}
@@ -170,7 +158,7 @@ tilde_expand (string)
/* Copy the skipped text into the result. */
if ((result_index + start + 1) > result_size)
- result = (char *)xrealloc (result, 1 + (result_size += (start + 20)));
+ result = (char *)xrealloc (result, 1 + (result_size += (start + 20)));
strncpy (result + result_index, string, start);
result_index += start;
@@ -179,12 +167,12 @@ tilde_expand (string)
string += start;
/* Make END be the index of one after the last character of the
- username. */
+ username. */
end = tilde_find_suffix (string);
/* If both START and END are zero, we are all done. */
if (!start && !end)
- break;
+ break;
/* Expand the entire tilde word, and copy it into RESULT. */
tilde_word = (char *)xmalloc (1 + end);
@@ -197,7 +185,7 @@ tilde_expand (string)
len = strlen (expansion);
if ((result_index + len + 1) > result_size)
- result = (char *)xrealloc (result, 1 + (result_size += (len + 20)));
+ result = (char *)xrealloc (result, 1 + (result_size += (len + 20)));
strcpy (result + result_index, expansion);
result_index += len;
@@ -217,87 +205,87 @@ tilde_expand_word (filename)
{
char *dirname;
- dirname = filename ? strdup (filename) : (char *)NULL;
+ dirname = filename ? xstrdup (filename) : (char *)NULL;
if (dirname && *dirname == '~')
{
char *temp_name;
if (!dirname[1] || dirname[1] == '/')
- {
- /* Prepend $HOME to the rest of the string. */
- char *temp_home = (char *)getenv ("HOME");
-
- /* If there is no HOME variable, look up the directory in
- the password database. */
- if (!temp_home)
- {
- struct passwd *entry;
-
- entry = (struct passwd *) getpwuid (getuid ());
- if (entry)
- temp_home = entry->pw_dir;
- }
-
- temp_name = (char *)
- alloca (1 + strlen (&dirname[1])
- + (temp_home ? strlen (temp_home) : 0));
- temp_name[0] = '\0';
- if (temp_home)
- strcpy (temp_name, temp_home);
- strcat (temp_name, &dirname[1]);
- free (dirname);
- dirname = strdup (temp_name);
- }
+ {
+ /* Prepend $HOME to the rest of the string. */
+ char *temp_home = getenv ("HOME");
+
+ /* If there is no HOME variable, look up the directory in
+ the password database. */
+ if (!temp_home)
+ {
+ struct passwd *entry;
+
+ entry = (struct passwd *) getpwuid (getuid ());
+ if (entry)
+ temp_home = entry->pw_dir;
+ }
+
+ temp_name = (char *)
+ alloca (1 + strlen (&dirname[1])
+ + (temp_home ? strlen (temp_home) : 0));
+ temp_name[0] = '\0';
+ if (temp_home)
+ strcpy (temp_name, temp_home);
+ strcat (temp_name, &dirname[1]);
+ free (dirname);
+ dirname = xstrdup (temp_name);
+ }
else
- {
- struct passwd *user_entry;
- char *username = (char *)alloca (257);
- int i, c;
-
- for (i = 1; c = dirname[i]; i++)
- {
- if (c == '/')
- break;
- else
- username[i - 1] = c;
- }
- username[i - 1] = '\0';
-
- if (!(user_entry = (struct passwd *) getpwnam (username)))
- {
- /* If the calling program has a special syntax for
- expanding tildes, and we couldn't find a standard
- expansion, then let them try. */
- if (tilde_expansion_failure_hook)
- {
- char *expansion;
-
- expansion = (*tilde_expansion_failure_hook) (username);
-
- if (expansion)
- {
- temp_name = (char *)alloca
- (1 + strlen (expansion) + strlen (&dirname[i]));
- strcpy (temp_name, expansion);
- strcat (temp_name, &dirname[i]);
- free (expansion);
- goto return_name;
- }
- }
- /* We shouldn't report errors. */
- }
- else
- {
- temp_name = (char *)alloca
- (1 + strlen (user_entry->pw_dir) + strlen (&dirname[i]));
- strcpy (temp_name, user_entry->pw_dir);
- strcat (temp_name, &dirname[i]);
- return_name:
- free (dirname);
- dirname = strdup (temp_name);
- }
- endpwent ();
- }
+ {
+ struct passwd *user_entry;
+ char *username = (char *)alloca (257);
+ int i, c;
+
+ for (i = 1; (c = dirname[i]); i++)
+ {
+ if (c == '/')
+ break;
+ else
+ username[i - 1] = c;
+ }
+ username[i - 1] = '\0';
+
+ if (!(user_entry = (struct passwd *) getpwnam (username)))
+ {
+ /* If the calling program has a special syntax for
+ expanding tildes, and we couldn't find a standard
+ expansion, then let them try. */
+ if (tilde_expansion_failure_hook)
+ {
+ char *expansion;
+
+ expansion = (*tilde_expansion_failure_hook) (username);
+
+ if (expansion)
+ {
+ temp_name = (char *)alloca
+ (1 + strlen (expansion) + strlen (&dirname[i]));
+ strcpy (temp_name, expansion);
+ strcat (temp_name, &dirname[i]);
+ free (expansion);
+ goto return_name;
+ }
+ }
+ /* We shouldn't report errors. */
+ }
+ else
+ {
+ temp_name = (char *)alloca
+ (1 + strlen (user_entry->pw_dir) + strlen (&dirname[i]));
+ strcpy (temp_name, user_entry->pw_dir);
+ strcat (temp_name, &dirname[i]);
+ return_name:
+ free (dirname);
+ dirname = xstrdup (temp_name);
+ }
+ endpwent ();
+ }
}
return (dirname);
}
@@ -320,15 +308,15 @@ main (argc, argv)
fflush (stdout);
if (!gets (line))
- strcpy (line, "done");
+ strcpy (line, "done");
if ((strcmp (line, "done") == 0) ||
- (strcmp (line, "quit") == 0) ||
- (strcmp (line, "exit") == 0))
- {
- done = 1;
- break;
- }
+ (strcmp (line, "quit") == 0) ||
+ (strcmp (line, "exit") == 0))
+ {
+ done = 1;
+ break;
+ }
result = tilde_expand (line);
printf (" --> %s\n", result);
@@ -371,7 +359,7 @@ xrealloc (pointer, bytes)
static void
memory_error_and_abort ()
{
- fprintf (stderr, "readline: Out of virtual memory!\n");
+ fprintf (stderr, _("readline: Out of virtual memory!\n"));
abort ();
}
#endif /* TEST */
diff --git a/gnu/usr.bin/texinfo/info/variables.c b/gnu/usr.bin/texinfo/info/variables.c
index 7798701c124..d1e29499714 100644
--- a/gnu/usr.bin/texinfo/info/variables.c
+++ b/gnu/usr.bin/texinfo/info/variables.c
@@ -1,9 +1,10 @@
-/* variables.c -- How to manipulate user visible variables in Info. */
+/* variables.c -- How to manipulate user visible variables in Info.
+ $Id: variables.c,v 1.2 1999/01/11 16:38:10 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
+ This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -25,9 +26,9 @@
#include "variables.h"
/* **************************************************************** */
-/* */
-/* User Visible Variables in Info */
-/* */
+/* */
+/* User Visible Variables in Info */
+/* */
/* **************************************************************** */
/* Choices used by the completer when reading a zero/non-zero value for
@@ -36,73 +37,75 @@ static char *on_off_choices[] = { "Off", "On", (char *)NULL };
VARIABLE_ALIST info_variables[] = {
{ "automatic-footnotes",
- "When \"On\", footnotes appear and disappear automatically",
+ N_("When \"On\", footnotes appear and disappear automatically"),
&auto_footnotes_p, (char **)on_off_choices },
{ "automatic-tiling",
- "When \"On\", creating or deleting a window resizes other windows",
+ N_("When \"On\", creating or deleting a window resizes other windows"),
&auto_tiling_p, (char **)on_off_choices },
{ "visible-bell",
- "When \"On\", flash the screen instead of ringing the bell",
+ N_("When \"On\", flash the screen instead of ringing the bell"),
&terminal_use_visible_bell_p, (char **)on_off_choices },
{ "errors-ring-bell",
- "When \"On\", errors cause the bell to ring",
+ N_("When \"On\", errors cause the bell to ring"),
&info_error_rings_bell_p, (char **)on_off_choices },
{ "gc-compressed-files",
- "When \"On\", Info garbage collects files which had to be uncompressed",
+ N_("When \"On\", Info garbage collects files which had to be uncompressed"),
&gc_compressed_files, (char **)on_off_choices },
{ "show-index-match",
- "When \"On\", the portion of the matched search string is highlighted",
+ N_("When \"On\", the portion of the matched search string is highlighted"),
&show_index_match, (char **)on_off_choices },
{ "scroll-behaviour",
- "Controls what happens when scrolling is requested at the end of a node",
+ N_("Controls what happens when scrolling is requested at the end of a node"),
&info_scroll_behaviour, (char **)info_scroll_choices },
{ "scroll-step",
- "The number lines to scroll when the cursor moves out of the window",
+ N_("The number lines to scroll when the cursor moves out of the window"),
&window_scroll_step, (char **)NULL },
{ "ISO-Latin",
- "When \"On\", Info accepts and displays ISO Latin characters",
+ N_("When \"On\", Info accepts and displays ISO Latin characters"),
&ISO_Latin_p, (char **)on_off_choices },
{ (char *)NULL, (char *)NULL, (int *)NULL, (char **)NULL }
};
-DECLARE_INFO_COMMAND (describe_variable, "Explain the use of a variable")
+DECLARE_INFO_COMMAND (describe_variable, _("Explain the use of a variable"))
{
VARIABLE_ALIST *var;
char *description;
/* Get the variable's name. */
- var = read_variable_name ("Describe variable: ", window);
+ var = read_variable_name (_("Describe variable: "), window);
if (!var)
return;
- description = (char *)xmalloc (20 + strlen (var->name) + strlen (var->doc));
+ description = (char *)xmalloc (20 + strlen (var->name)
+ + strlen (_(var->doc)));
if (var->choices)
sprintf (description, "%s (%s): %s.",
- var->name, var->choices[*(var->value)], var->doc);
+ var->name, var->choices[*(var->value)], _(var->doc));
else
- sprintf (description, "%s (%d): %s.", var->name, *(var->value), var->doc);
+ sprintf (description, "%s (%d): %s.",
+ var->name, *(var->value), _(var->doc));
window_message_in_echo_area ("%s", description);
free (description);
}
-DECLARE_INFO_COMMAND (set_variable, "Set the value of an Info variable")
+DECLARE_INFO_COMMAND (set_variable, _("Set the value of an Info variable"))
{
VARIABLE_ALIST *var;
char *line;
/* Get the variable's name and value. */
- var = read_variable_name ("Set variable: ", window);
+ var = read_variable_name (_("Set variable: "), window);
if (!var)
return;
@@ -113,86 +116,86 @@ DECLARE_INFO_COMMAND (set_variable, "Set the value of an Info variable")
if (!var->choices)
{
- int potential_value;
+ int potential_value;
- if (info_explicit_arg || count != 1)
- potential_value = count;
- else
- potential_value = *(var->value);
+ if (info_explicit_arg || count != 1)
+ potential_value = count;
+ else
+ potential_value = *(var->value);
- sprintf (prompt, "Set %s to value (%d): ",
- var->name, potential_value);
- line = info_read_in_echo_area (active_window, prompt);
+ sprintf (prompt, _("Set %s to value (%d): "),
+ var->name, potential_value);
+ line = info_read_in_echo_area (active_window, prompt);
- /* If no error was printed, clear the echo area. */
- if (!info_error_was_printed)
- window_clear_echo_area ();
+ /* If no error was printed, clear the echo area. */
+ if (!info_error_was_printed)
+ window_clear_echo_area ();
- /* User aborted? */
- if (!line)
- return;
+ /* User aborted? */
+ if (!line)
+ return;
- /* If the user specified a value, get that, otherwise, we are done. */
- canonicalize_whitespace (line);
- if (*line)
- *(var->value) = atoi (line);
- else
- *(var->value) = potential_value;
+ /* If the user specified a value, get that, otherwise, we are done. */
+ canonicalize_whitespace (line);
+ if (*line)
+ *(var->value) = atoi (line);
+ else
+ *(var->value) = potential_value;
- free (line);
+ free (line);
}
else
{
- register int i;
- REFERENCE **array = (REFERENCE **)NULL;
- int array_index = 0;
- int array_slots = 0;
-
- for (i = 0; var->choices[i]; i++)
- {
- REFERENCE *entry;
-
- entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
- entry->label = strdup (var->choices[i]);
- entry->nodename = (char *)NULL;
- entry->filename = (char *)NULL;
-
- add_pointer_to_array
- (entry, array_index, array, array_slots, 10, REFERENCE *);
- }
-
- sprintf (prompt, "Set %s to value (%s): ",
- var->name, var->choices[*(var->value)]);
-
- /* Ask the completer to read a variable value for us. */
- line = info_read_completing_in_echo_area (window, prompt, array);
-
- info_free_references (array);
-
- if (!echo_area_is_active)
- window_clear_echo_area ();
-
- /* User aborted? */
- if (!line)
- {
- info_abort_key (active_window, 0, 0);
- return;
- }
-
- /* User accepted default choice? If so, no change. */
- if (!*line)
- {
- free (line);
- return;
- }
-
- /* Find the choice in our list of choices. */
- for (i = 0; var->choices[i]; i++)
- if (strcmp (var->choices[i], line) == 0)
- break;
-
- if (var->choices[i])
- *(var->value) = i;
+ register int i;
+ REFERENCE **array = (REFERENCE **)NULL;
+ int array_index = 0;
+ int array_slots = 0;
+
+ for (i = 0; var->choices[i]; i++)
+ {
+ REFERENCE *entry;
+
+ entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
+ entry->label = xstrdup (var->choices[i]);
+ entry->nodename = (char *)NULL;
+ entry->filename = (char *)NULL;
+
+ add_pointer_to_array
+ (entry, array_index, array, array_slots, 10, REFERENCE *);
+ }
+
+ sprintf (prompt, _("Set %s to value (%s): "),
+ var->name, var->choices[*(var->value)]);
+
+ /* Ask the completer to read a variable value for us. */
+ line = info_read_completing_in_echo_area (window, prompt, array);
+
+ info_free_references (array);
+
+ if (!echo_area_is_active)
+ window_clear_echo_area ();
+
+ /* User aborted? */
+ if (!line)
+ {
+ info_abort_key (active_window, 0, 0);
+ return;
+ }
+
+ /* User accepted default choice? If so, no change. */
+ if (!*line)
+ {
+ free (line);
+ return;
+ }
+
+ /* Find the choice in our list of choices. */
+ for (i = 0; var->choices[i]; i++)
+ if (strcmp (var->choices[i], line) == 0)
+ break;
+
+ if (var->choices[i])
+ *(var->value) = i;
}
}
}
@@ -259,13 +262,13 @@ make_variable_completions_array ()
{
REFERENCE *entry;
- entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
- entry->label = strdup (info_variables[i].name);
+ entry = (REFERENCE *) xmalloc (sizeof (REFERENCE));
+ entry->label = xstrdup (info_variables[i].name);
entry->nodename = (char *)NULL;
entry->filename = (char *)NULL;
add_pointer_to_array
- (entry, array_index, array, array_slots, 200, REFERENCE *);
+ (entry, array_index, array, array_slots, 200, REFERENCE *);
}
return (array);
diff --git a/gnu/usr.bin/texinfo/info/variables.h b/gnu/usr.bin/texinfo/info/variables.h
index 85bde27737b..ba6f1f33176 100644
--- a/gnu/usr.bin/texinfo/info/variables.h
+++ b/gnu/usr.bin/texinfo/info/variables.h
@@ -1,9 +1,10 @@
-/* variables.h -- Description of user visible variables in Info. */
+/* variables.h -- Description of user visible variables in Info.
+ $Id: variables.h,v 1.2 1999/01/11 16:38:10 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
+ This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#if !defined (_VARIABLES_H_)
-#define _VARIABLES_H_
+#ifndef INFO_VARIABLES_H
+#define INFO_VARIABLES_H
/* A variable (in the Info sense) is an integer value with a user-visible
name. You may supply an array of strings to complete over when the
@@ -32,10 +33,10 @@
/* Structure describing a user visible variable. */
typedef struct {
- char *name; /* Polite name. */
- char *doc; /* Documentation string. */
- int *value; /* Address of value. */
- char **choices; /* Array of strings or NULL if numeric only. */
+ char *name; /* Polite name. */
+ char *doc; /* Documentation string. */
+ int *value; /* Address of value. */
+ char **choices; /* Array of strings or NULL if numeric only. */
} VARIABLE_ALIST;
/* Read the name of an Info variable in the echo area and return the
@@ -61,4 +62,4 @@ extern int info_scroll_behaviour;
extern int window_scroll_step;
extern int ISO_Latin_p;
-#endif /* _VARIABLES_H_ */
+#endif /* not INFO_VARIABLES_H */
diff --git a/gnu/usr.bin/texinfo/info/window.c b/gnu/usr.bin/texinfo/info/window.c
index 304e89c0c75..944a8ce10be 100644
--- a/gnu/usr.bin/texinfo/info/window.c
+++ b/gnu/usr.bin/texinfo/info/window.c
@@ -1,9 +1,10 @@
-/* window.c -- Windows in Info. */
+/* window.c -- Windows in Info.
+ $Id: window.c,v 1.2 1999/01/11 16:38:10 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
+ This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,10 +22,7 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#include <stdio.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+#include "info.h"
#include "nodes.h"
#include "window.h"
#include "display.h"
@@ -136,36 +134,36 @@ window_new_screen_size (width, height)
while ((height - echo_area_required) / numwins <= WINDOW_MIN_SIZE)
{
/* If only one window, make the size of it be zero, and return
- immediately. */
+ immediately. */
if (!windows->next)
- {
- windows->height = 0;
- maybe_free (windows->line_starts);
- windows->line_starts = (char **)NULL;
- windows->line_count = 0;
- break;
- }
+ {
+ windows->height = 0;
+ maybe_free (windows->line_starts);
+ windows->line_starts = (char **)NULL;
+ windows->line_count = 0;
+ break;
+ }
/* If we have some temporary windows, delete one of them. */
for (win = windows; win; win = win->next)
- if (win->flags & W_TempWindow)
- break;
+ if (win->flags & W_TempWindow)
+ break;
/* Otherwise, delete the first window, and try again. */
if (!win)
- win = windows;
+ win = windows;
if (window_deletion_notifier)
- (*window_deletion_notifier) (win);
+ (*window_deletion_notifier) (win);
window_delete_window (win);
numwins--;
}
/* The screen has changed height and width. */
- delta_height = height - the_screen->height; /* This is how much. */
- the_screen->height = height; /* This is the new height. */
- the_screen->width = width; /* This is the new width. */
+ delta_height = height - the_screen->height; /* This is how much. */
+ the_screen->height = height; /* This is the new height. */
+ the_screen->width = width; /* This is the new width. */
/* Set the start of the echo area. */
the_echo_area->first_row = height - the_echo_area->height;
@@ -186,34 +184,34 @@ window_new_screen_size (width, height)
for (win = windows; win; win = win->next)
{
if ((win->width != width) && ((win->flags & W_InhibitMode) == 0))
- {
- win->width = width;
- maybe_free (win->modeline);
- win->modeline = (char *)xmalloc (1 + width);
- }
+ {
+ win->width = width;
+ maybe_free (win->modeline);
+ win->modeline = (char *)xmalloc (1 + width);
+ }
win->height += delta_each;
/* If the previous height of this window was zero, it was the only
- window, and it was not visible. Thus we need to compensate for
- the echo_area. */
+ window, and it was not visible. Thus we need to compensate for
+ the echo_area. */
if (win->height == delta_each)
- win->height -= (1 + the_echo_area->height);
+ win->height -= (1 + the_echo_area->height);
/* If this is not the first window in the chain, then change the
- first row of it. We cannot just add delta_each to the first row,
- since this window's first row is the sum of the collective increases
- that have gone before it. So we just add one to the location of the
- previous window's modeline. */
+ first row of it. We cannot just add delta_each to the first row,
+ since this window's first row is the sum of the collective increases
+ that have gone before it. So we just add one to the location of the
+ previous window's modeline. */
if (win->prev)
- win->first_row = (win->prev->first_row + win->prev->height) + 1;
+ win->first_row = (win->prev->first_row + win->prev->height) + 1;
/* The last window in the chain gets the extra space (or shrinkage). */
if (!win->next)
- win->height += delta_leftover;
+ win->height += delta_leftover;
if (win->node)
- recalculate_line_starts (win);
+ recalculate_line_starts (win);
win->flags |= W_UpdateWindow;
}
@@ -232,32 +230,32 @@ window_new_screen_size (width, height)
win = windows;
while (win)
- {
- if ((win->height < WINDOW_MIN_HEIGHT) ||
- (win->height > avail))
- {
- WINDOW *lastwin;
-
- /* Split the space among the available windows. */
- delta_each = avail / numwins;
- delta_leftover = avail - (delta_each * numwins);
-
- for (win = windows; win; win = win->next)
- {
- lastwin = win;
- if (win->prev)
- win->first_row =
- (win->prev->first_row + win->prev->height) + 1;
- win->height = delta_each;
- }
-
- /* Give the leftover space (if any) to the last window. */
- lastwin->height += delta_leftover;
- break;
- }
- else
- win= win->next;
- }
+ {
+ if ((win->height < WINDOW_MIN_HEIGHT) ||
+ (win->height > avail))
+ {
+ WINDOW *lastwin;
+
+ /* Split the space among the available windows. */
+ delta_each = avail / numwins;
+ delta_leftover = avail - (delta_each * numwins);
+
+ for (win = windows; win; win = win->next)
+ {
+ lastwin = win;
+ if (win->prev)
+ win->first_row =
+ (win->prev->first_row + win->prev->height) + 1;
+ win->height = delta_each;
+ }
+
+ /* Give the leftover space (if any) to the last window. */
+ lastwin->height += delta_leftover;
+ break;
+ }
+ else
+ win= win->next;
+ }
}
}
@@ -412,25 +410,25 @@ window_change_window_height (window, amount)
/* WINDOW decreasing in size? */
if (amount < 0)
{
- int abs_amount = -amount; /* It is easier to deal with this way. */
+ int abs_amount = -amount; /* It is easier to deal with this way. */
/* If the resultant window would be too small, stop here. */
if ((window->height - abs_amount) < WINDOW_MIN_HEIGHT)
- return;
+ return;
/* If we have two neighboring windows, choose the smaller one to get
- larger. */
+ larger. */
if (next && prev)
- {
- if (prev->height < next->height)
- shrink_me_growing_prev (window, prev, abs_amount);
- else
- shrink_me_growing_next (window, next, abs_amount);
- }
+ {
+ if (prev->height < next->height)
+ shrink_me_growing_prev (window, prev, abs_amount);
+ else
+ shrink_me_growing_next (window, next, abs_amount);
+ }
else if (next)
- shrink_me_growing_next (window, next, abs_amount);
+ shrink_me_growing_next (window, next, abs_amount);
else
- shrink_me_growing_prev (window, prev, abs_amount);
+ shrink_me_growing_prev (window, prev, abs_amount);
}
/* WINDOW increasing in size? */
@@ -439,65 +437,65 @@ window_change_window_height (window, amount)
int total_avail, next_avail = 0, prev_avail = 0;
if (next)
- next_avail = next->height - WINDOW_MIN_SIZE;
+ next_avail = next->height - WINDOW_MIN_SIZE;
if (prev)
- prev_avail = prev->height - WINDOW_MIN_SIZE;
+ prev_avail = prev->height - WINDOW_MIN_SIZE;
total_avail = next_avail + prev_avail;
/* If there isn't enough space available to grow this window, give up. */
if (amount > total_avail)
- return;
+ return;
/* If there aren't two neighboring windows, or if one of the neighbors
- is larger than the other one by at least AMOUNT, grow that one. */
+ is larger than the other one by at least AMOUNT, grow that one. */
if ((next && !prev) || ((next_avail - amount) >= prev_avail))
- grow_me_shrinking_next (window, next, amount);
+ grow_me_shrinking_next (window, next, amount);
else if ((prev && !next) || ((prev_avail - amount) >= next_avail))
- grow_me_shrinking_prev (window, prev, amount);
+ grow_me_shrinking_prev (window, prev, amount);
else
- {
- int change;
-
- /* This window has two neighbors. They both must be shrunk in to
- make enough space for WINDOW to grow. Make them both the same
- size. */
- if (prev_avail > next_avail)
- {
- change = prev_avail - next_avail;
- grow_me_shrinking_prev (window, prev, change);
- amount -= change;
- }
- else
- {
- change = next_avail - prev_avail;
- grow_me_shrinking_next (window, next, change);
- amount -= change;
- }
-
- /* Both neighbors are the same size. Split the difference in
- AMOUNT between them. */
- while (amount)
- {
- window->height++;
- amount--;
-
- /* Odd numbers grow next, even grow prev. */
- if (amount & 1)
- {
- prev->height--;
- window->first_row--;
- }
- else
- {
- next->height--;
- next->first_row++;
- }
- }
- window_adjust_pagetop (prev);
- window_adjust_pagetop (next);
- }
+ {
+ int change;
+
+ /* This window has two neighbors. They both must be shrunk in to
+ make enough space for WINDOW to grow. Make them both the same
+ size. */
+ if (prev_avail > next_avail)
+ {
+ change = prev_avail - next_avail;
+ grow_me_shrinking_prev (window, prev, change);
+ amount -= change;
+ }
+ else
+ {
+ change = next_avail - prev_avail;
+ grow_me_shrinking_next (window, next, change);
+ amount -= change;
+ }
+
+ /* Both neighbors are the same size. Split the difference in
+ AMOUNT between them. */
+ while (amount)
+ {
+ window->height++;
+ amount--;
+
+ /* Odd numbers grow next, even grow prev. */
+ if (amount & 1)
+ {
+ prev->height--;
+ window->first_row--;
+ }
+ else
+ {
+ next->height--;
+ next->first_row++;
+ }
+ }
+ window_adjust_pagetop (prev);
+ window_adjust_pagetop (next);
+ }
}
if (prev)
prev->flags |= W_UpdateWindow;
@@ -526,10 +524,10 @@ window_tile_windows (style)
for (win = windows; win; win = win->next)
if (do_internals || !win->node ||
- (win->node->flags & N_IsInternal) == 0)
+ (win->node->flags & N_IsInternal) == 0)
{
- avail += win->height;
- numwins++;
+ avail += win->height;
+ numwins++;
}
if (numwins <= 1 || !the_screen->height)
@@ -544,11 +542,11 @@ window_tile_windows (style)
for (win = windows; win; win = win->next)
{
if (do_internals || !win->node ||
- (win->node->flags & N_IsInternal) == 0)
- {
- last_adjusted = win;
- win->height = per_win_height;
- }
+ (win->node->flags & N_IsInternal) == 0)
+ {
+ last_adjusted = win;
+ win->height = per_win_height;
+ }
}
if (last_adjusted)
@@ -558,7 +556,7 @@ window_tile_windows (style)
for (win = windows; win; win = win->next)
{
if (win->prev)
- win->first_row = win->prev->first_row + win->prev->height + 1;
+ win->first_row = win->prev->first_row + win->prev->height + 1;
window_adjust_pagetop (win);
win->flags |= W_UpdateWindow;
@@ -591,11 +589,11 @@ window_toggle_wrap (window)
window_adjust_pagetop (window);
/* If the pagetop hasn't changed maybe we can do some scrolling now
- to speed up the display. Many of the line starts will be the same,
- so scrolling here is a very good optimization.*/
+ to speed up the display. Many of the line starts will be the same,
+ so scrolling here is a very good optimization.*/
if (old_pagetop == window->pagetop)
- display_scroll_line_starts
- (window, old_pagetop, old_starts, old_lines);
+ display_scroll_line_starts
+ (window, old_pagetop, old_starts, old_lines);
maybe_free (old_starts);
}
window->flags |= W_UpdateWindow;
@@ -650,12 +648,12 @@ window_delete_window (window)
if (window == active_window)
{
/* If there isn't a next window, then there must be a previous one,
- since we cannot delete the last window. If there is a next window,
- prefer to use that as the active window. */
+ since we cannot delete the last window. If there is a next window,
+ prefer to use that as the active window. */
if (next)
- active_window = next;
+ active_window = next;
else
- active_window = prev;
+ active_window = prev;
}
if (next && active_window == next)
@@ -674,13 +672,13 @@ window_delete_window (window)
int diff;
/* Try to adjust the visible part of the node so that as little
- text as possible has to move. */
+ text as possible has to move. */
diff = window_to_fix->first_row - window->first_row;
window_to_fix->first_row = window->first_row;
window_to_fix->pagetop -= diff;
if (window_to_fix->pagetop < 0)
- window_to_fix->pagetop = 0;
+ window_to_fix->pagetop = 0;
}
/* The `+ 1' is to offset the difference between the first_row locations.
@@ -725,24 +723,24 @@ character_width (character, hpos)
int width = 1;
if (ISO_Latin_p)
- printable_limit = 160;
+ printable_limit = 255;
if (character > printable_limit)
width = 3;
else if (iscntrl (character))
{
switch (character)
- {
- case '\r':
- case '\n':
- width = the_screen->width - hpos;
- break;
- case '\t':
- width = ((hpos + 8) & 0xf8) - hpos;
- break;
- default:
- width = 2;
- }
+ {
+ case '\r':
+ case '\n':
+ width = the_screen->width - hpos;
+ break;
+ case '\t':
+ width = ((hpos + 8) & 0xf8) - hpos;
+ break;
+ default:
+ width = 2;
+ }
}
else if (character == DEL)
width = 2;
@@ -820,61 +818,61 @@ calculate_line_starts (window)
unsigned int cwidth, c;
add_pointer_to_array (line, line_starts_index, line_starts,
- line_starts_slots, 100, char *);
+ line_starts_slots, 100, char *);
if (bump_index)
- {
- i++;
- bump_index = 0;
- }
+ {
+ i++;
+ bump_index = 0;
+ }
while (1)
- {
- c = node->contents[i];
- cwidth = character_width (c, hpos);
-
- /* If this character fits within this line, just do the next one. */
- if ((hpos + cwidth) < window->width)
- {
- i++;
- hpos += cwidth;
- continue;
- }
- else
- {
- /* If this character would position the cursor at the start of
- the next printed screen line, then do the next line. */
- if (c == '\n' || c == '\r' || c == '\t')
- {
- i++;
- hpos = 0;
- break;
- }
- else
- {
- /* This character passes the window width border. Postion
- the cursor after the printed character, but remember this
- line start as where this character is. A bit tricky. */
-
- /* If this window doesn't wrap lines, proceed to the next
- physical line here. */
- if (window->flags & W_NoWrap)
- {
- hpos = 0;
- while (i < node->nodelen && node->contents[i] != '\n')
- i++;
-
- if (node->contents[i] == '\n')
- i++;
- }
- else
- {
- hpos = the_screen->width - hpos;
- bump_index++;
- }
- break;
- }
- }
- }
+ {
+ c = node->contents[i];
+ cwidth = character_width (c, hpos);
+
+ /* If this character fits within this line, just do the next one. */
+ if ((hpos + cwidth) < window->width)
+ {
+ i++;
+ hpos += cwidth;
+ continue;
+ }
+ else
+ {
+ /* If this character would position the cursor at the start of
+ the next printed screen line, then do the next line. */
+ if (c == '\n' || c == '\r' || c == '\t')
+ {
+ i++;
+ hpos = 0;
+ break;
+ }
+ else
+ {
+ /* This character passes the window width border. Postion
+ the cursor after the printed character, but remember this
+ line start as where this character is. A bit tricky. */
+
+ /* If this window doesn't wrap lines, proceed to the next
+ physical line here. */
+ if (window->flags & W_NoWrap)
+ {
+ hpos = 0;
+ while (i < node->nodelen && node->contents[i] != '\n')
+ i++;
+
+ if (node->contents[i] == '\n')
+ i++;
+ }
+ else
+ {
+ hpos = the_screen->width - hpos;
+ bump_index++;
+ }
+ break;
+ }
+ }
+ }
}
window->line_starts = line_starts;
window->line_count = line_starts_index;
@@ -916,7 +914,7 @@ window_adjust_pagetop (window)
line_start = window->line_starts[line];
if ((line_start - contents) > window->point)
- break;
+ break;
}
/* The line index preceding the line start which is past point is the
@@ -929,26 +927,26 @@ window_adjust_pagetop (window)
(line - window->pagetop > (window->height - 1)))
{
/* The user-settable variable "scroll-step" is used to attempt
- to make point visible, iff it is non-zero. If that variable
- is zero, then the line containing point is centered within
- the window. */
+ to make point visible, iff it is non-zero. If that variable
+ is zero, then the line containing point is centered within
+ the window. */
if (window_scroll_step < window->height)
- {
- if ((line < window->pagetop) &&
- ((window->pagetop - window_scroll_step) <= line))
- window->pagetop -= window_scroll_step;
- else if ((line - window->pagetop > (window->height - 1)) &&
- ((line - (window->pagetop + window_scroll_step)
- < window->height)))
- window->pagetop += window_scroll_step;
- else
- window->pagetop = line - ((window->height - 1) / 2);
- }
+ {
+ if ((line < window->pagetop) &&
+ ((window->pagetop - window_scroll_step) <= line))
+ window->pagetop -= window_scroll_step;
+ else if ((line - window->pagetop > (window->height - 1)) &&
+ ((line - (window->pagetop + window_scroll_step)
+ < window->height)))
+ window->pagetop += window_scroll_step;
+ else
+ window->pagetop = line - ((window->height - 1) / 2);
+ }
else
- window->pagetop = line - ((window->height - 1) / 2);
+ window->pagetop = line - ((window->height - 1) / 2);
if (window->pagetop < 0)
- window->pagetop = 0;
+ window->pagetop = 0;
window->flags |= W_UpdateWindow;
}
}
@@ -970,7 +968,7 @@ window_line_of_point (window)
for (i = start; i < window->line_count; i++)
{
if ((window->line_starts[i] - window->node->contents) > window->point)
- break;
+ break;
}
return (i - 1);
@@ -1029,7 +1027,7 @@ window_chars_to_goal (line, goal)
check = hpos + character_width (line[i], hpos);
if (check > goal)
- break;
+ break;
hpos = check;
}
@@ -1056,26 +1054,26 @@ window_make_modeline (window)
if (window->pagetop == 0)
{
if (lines_remaining <= window->height)
- strcpy (location_indicator, "All");
+ strcpy (location_indicator, "All");
else
- strcpy (location_indicator, "Top");
+ strcpy (location_indicator, "Top");
}
else
{
if (lines_remaining <= window->height)
- strcpy (location_indicator, "Bot");
+ strcpy (location_indicator, "Bot");
else
- {
- float pt, lc;
- int percentage;
+ {
+ float pt, lc;
+ int percentage;
- pt = (float)window->pagetop;
- lc = (float)window->line_count;
+ pt = (float)window->pagetop;
+ lc = (float)window->line_count;
- percentage = 100 * (pt / lc);
+ percentage = 100 * (pt / lc);
- sprintf (location_indicator, "%2d%%", percentage);
- }
+ sprintf (location_indicator, "%2d%%", percentage);
+ }
}
/* Calculate the maximum size of the information to stick in MODELINE. */
@@ -1088,49 +1086,49 @@ window_make_modeline (window)
if (node)
{
- if (node->nodename)
- nodename = node->nodename;
+ if (node->nodename)
+ nodename = node->nodename;
- if (node->parent)
- {
- parent = filename_non_directory (node->parent);
- modeline_len += strlen ("Subfile: ") + strlen (node->filename);
- }
+ if (node->parent)
+ {
+ parent = filename_non_directory (node->parent);
+ modeline_len += strlen ("Subfile: ") + strlen (node->filename);
+ }
- if (node->filename)
- filename = filename_non_directory (node->filename);
+ if (node->filename)
+ filename = filename_non_directory (node->filename);
- if (node->flags & N_UpdateTags)
- update_message = "--*** Tags out of Date ***";
+ if (node->flags & N_UpdateTags)
+ update_message = _("--*** Tags out of Date ***");
}
if (update_message)
modeline_len += strlen (update_message);
modeline_len += strlen (filename);
modeline_len += strlen (nodename);
- modeline_len += 4; /* strlen (location_indicator). */
+ modeline_len += 4; /* strlen (location_indicator). */
/* 10 for the decimal representation of the number of lines in this
node, and the remainder of the text that can appear in the line. */
- modeline_len += 10 + strlen ("-----Info: (), lines ----, ");
+ modeline_len += 10 + strlen (_("-----Info: (), lines ----, "));
modeline_len += window->width;
modeline = (char *)xmalloc (1 + modeline_len);
/* Special internal windows have no filename. */
if (!parent && !*filename)
- sprintf (modeline, "-%s---Info: %s, %d lines --%s--",
- (window->flags & W_NoWrap) ? "$" : "-",
- nodename, window->line_count, location_indicator);
+ sprintf (modeline, _("-%s---Info: %s, %d lines --%s--"),
+ (window->flags & W_NoWrap) ? "$" : "-",
+ nodename, window->line_count, location_indicator);
else
- sprintf (modeline, "-%s%s-Info: (%s)%s, %d lines --%s--",
- (window->flags & W_NoWrap) ? "$" : "-",
- (node && (node->flags & N_IsCompressed)) ? "zz" : "--",
- parent ? parent : filename,
- nodename, window->line_count, location_indicator);
+ sprintf (modeline, _("-%s%s-Info: (%s)%s, %d lines --%s--"),
+ (window->flags & W_NoWrap) ? "$" : "-",
+ (node && (node->flags & N_IsCompressed)) ? "zz" : "--",
+ parent ? parent : filename,
+ nodename, window->line_count, location_indicator);
if (parent)
- sprintf (modeline + strlen (modeline), " Subfile: %s", filename);
+ sprintf (modeline + strlen (modeline), _(" Subfile: %s"), filename);
if (update_message)
sprintf (modeline + strlen (modeline), "%s", update_message);
@@ -1141,9 +1139,9 @@ window_make_modeline (window)
modeline[window->width] = '\0';
else
{
- while (i < window->width)
- modeline[i++] = '-';
- modeline[i] = '\0';
+ while (i < window->width)
+ modeline[i++] = '-';
+ modeline[i] = '\0';
}
strcpy (window->modeline, modeline);
@@ -1197,9 +1195,9 @@ window_set_state (window, state)
/* **************************************************************** */
-/* */
-/* Manipulating Home-Made Nodes */
-/* */
+/* */
+/* Manipulating Home-Made Nodes */
+/* */
/* **************************************************************** */
/* A place to buffer echo area messages. */
@@ -1259,8 +1257,8 @@ message_in_echo_area (format, arg1, arg2)
if (echo_area_node)
{
add_pointer_to_array (echo_area_node, old_echo_area_nodes_index,
- old_echo_area_nodes, old_echo_area_nodes_slots,
- 4, NODE *);
+ old_echo_area_nodes, old_echo_area_nodes_slots,
+ 4, NODE *);
}
echo_area_node = (NODE *)NULL;
window_message_in_echo_area (format, arg1, arg2);
@@ -1299,7 +1297,7 @@ message_buffer_resize (length)
while (message_buffer_size <= message_buffer_index + length)
message_buffer = (char *)
xrealloc (message_buffer,
- message_buffer_size += 100 + (2 * length));
+ message_buffer_size += 100 + (2 * length));
}
/* Format MESSAGE_BUFFER with the results of printing FORMAT with ARG1 and
@@ -1323,70 +1321,70 @@ build_message_buffer (format, arg1, arg2)
for (i = 0; format[i]; i++)
{
if (format[i] != '%')
- {
- message_buffer[message_buffer_index++] = format[i];
- len--;
- }
+ {
+ message_buffer[message_buffer_index++] = format[i];
+ len--;
+ }
else
- {
- char c;
-
- c = format[++i];
-
- switch (c)
- {
- case '%': /* Insert a percent sign. */
- message_buffer_resize (len + 1);
- message_buffer[message_buffer_index++] = '%';
- break;
-
- case 's': /* Insert the current arg as a string. */
- {
- char *string;
- int string_len;
-
- string = (char *)args[arg_index++];
- string_len = strlen (string);
-
- message_buffer_resize (len + string_len);
- sprintf
- (message_buffer + message_buffer_index, "%s", string);
- message_buffer_index += string_len;
- }
- break;
-
- case 'd': /* Insert the current arg as an integer. */
- {
- long long_val;
- int integer;
-
- long_val = (long)args[arg_index++];
- integer = (int)long_val;
-
- message_buffer_resize (len + 32);
- sprintf
- (message_buffer + message_buffer_index, "%d", integer);
- message_buffer_index = strlen (message_buffer);
- }
- break;
-
- case 'c': /* Insert the current arg as a character. */
- {
- long long_val;
- int character;
-
- long_val = (long)args[arg_index++];
- character = (int)long_val;
-
- message_buffer_resize (len + 1);
- message_buffer[message_buffer_index++] = character;
- }
- break;
-
- default:
- abort ();
- }
- }
+ {
+ char c;
+
+ c = format[++i];
+
+ switch (c)
+ {
+ case '%': /* Insert a percent sign. */
+ message_buffer_resize (len + 1);
+ message_buffer[message_buffer_index++] = '%';
+ break;
+
+ case 's': /* Insert the current arg as a string. */
+ {
+ char *string;
+ int string_len;
+
+ string = (char *)args[arg_index++];
+ string_len = strlen (string);
+
+ message_buffer_resize (len + string_len);
+ sprintf
+ (message_buffer + message_buffer_index, "%s", string);
+ message_buffer_index += string_len;
+ }
+ break;
+
+ case 'd': /* Insert the current arg as an integer. */
+ {
+ long long_val;
+ int integer;
+
+ long_val = (long)args[arg_index++];
+ integer = (int)long_val;
+
+ message_buffer_resize (len + 32);
+ sprintf
+ (message_buffer + message_buffer_index, "%d", integer);
+ message_buffer_index = strlen (message_buffer);
+ }
+ break;
+
+ case 'c': /* Insert the current arg as a character. */
+ {
+ long long_val;
+ int character;
+
+ long_val = (long)args[arg_index++];
+ character = (int)long_val;
+
+ message_buffer_resize (len + 1);
+ message_buffer[message_buffer_index++] = character;
+ }
+ break;
+
+ default:
+ abort ();
+ }
+ }
}
message_buffer[message_buffer_index] = '\0';
}
@@ -1474,7 +1472,7 @@ pad_to (count, string)
else
{
while (i < count)
- string[i++] = ' ';
+ string[i++] = ' ';
}
string[i] = '\0';
diff --git a/gnu/usr.bin/texinfo/info/window.h b/gnu/usr.bin/texinfo/info/window.h
index 5bde64a10ac..7c61f55464b 100644
--- a/gnu/usr.bin/texinfo/info/window.h
+++ b/gnu/usr.bin/texinfo/info/window.h
@@ -1,9 +1,10 @@
-/* window.h -- Structure and flags used in manipulating Info windows. */
+/* window.h -- Structure and flags used in manipulating Info windows.
+ $Id: window.h,v 1.2 1999/01/11 16:38:10 espie Exp $
-/* This file is part of GNU Info, a program for reading online documentation
+ This file is part of GNU Info, a program for reading online documentation
stored in Info format.
- Copyright (C) 1993 Free Software Foundation, Inc.
+ Copyright (C) 1993, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -21,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */
-#if !defined (_WINDOW_H_)
-#define _WINDOW_H_
+#ifndef INFO_WINDOW_H
+#define INFO_WINDOW_H
#include "nodes.h"
#include "infomap.h"
@@ -44,9 +45,9 @@
if you need to change window state information, here is where you would
do it. NB> The last element does NOT end with a semi-colon. */
#define WINDOW_STATE_DECL \
- NODE *node; /* The node displayed in this window. */ \
- int pagetop; /* LINE_STARTS[PAGETOP] is first line in WINDOW. */ \
- long point /* Offset within NODE of the cursor position. */
+ NODE *node; /* The node displayed in this window. */ \
+ int pagetop; /* LINE_STARTS[PAGETOP] is first line in WINDOW. */ \
+ long point /* Offset within NODE of the cursor position. */
/* Structure which defines a window. Windows are doubly linked, next
and prev. The list of windows is kept on WINDOWS. The structure member
@@ -54,37 +55,38 @@
(0, window->height + window->first_row) is the first character of this
windows modeline. The number of lines that can be displayed in a window
is equal to window->height - 1. */
-typedef struct __window__ {
- struct __window__ *next; /* Next window in this chain. */
- struct __window__ *prev; /* Previous window in this chain. */
- int width; /* Width of this window. */
- int height; /* Height of this window. */
- int first_row; /* Offset of the first line in the_screen. */
- int goal_column; /* The column we would like the cursor to appear in. */
- Keymap keymap; /* Keymap used to read commands in this window. */
- WINDOW_STATE_DECL; /* Node, pagetop and point. */
- char *modeline; /* Calculated text of the modeline for this window. */
- char **line_starts; /* Array of printed line starts for this node. */
- int line_count; /* Number of lines appearing in LINE_STARTS. */
- int flags; /* See below for details. */
+typedef struct window_struct
+{
+ struct window_struct *next; /* Next window in this chain. */
+ struct window_struct *prev; /* Previous window in this chain. */
+ int width; /* Width of this window. */
+ int height; /* Height of this window. */
+ int first_row; /* Offset of the first line in the_screen. */
+ int goal_column; /* The column we would like the cursor to appear in. */
+ Keymap keymap; /* Keymap used to read commands in this window. */
+ WINDOW_STATE_DECL; /* Node, pagetop and point. */
+ char *modeline; /* Calculated text of the modeline for this window. */
+ char **line_starts; /* Array of printed line starts for this node. */
+ int line_count; /* Number of lines appearing in LINE_STARTS. */
+ int flags; /* See below for details. */
} WINDOW;
typedef struct {
- WINDOW_STATE_DECL; /* What gets saved. */
+ WINDOW_STATE_DECL; /* What gets saved. */
} WINDOW_STATE;
-#define W_UpdateWindow 0x01 /* WINDOW needs updating. */
-#define W_WindowIsPerm 0x02 /* This WINDOW is a permanent object. */
-#define W_WindowVisible 0x04 /* This WINDOW is currently visible. */
-#define W_InhibitMode 0x08 /* This WINDOW has no modeline. */
-#define W_NoWrap 0x10 /* Lines do not wrap in this window. */
-#define W_InputWindow 0x20 /* Window accepts input. */
-#define W_TempWindow 0x40 /* Window is less important. */
+#define W_UpdateWindow 0x01 /* WINDOW needs updating. */
+#define W_WindowIsPerm 0x02 /* This WINDOW is a permanent object. */
+#define W_WindowVisible 0x04 /* This WINDOW is currently visible. */
+#define W_InhibitMode 0x08 /* This WINDOW has no modeline. */
+#define W_NoWrap 0x10 /* Lines do not wrap in this window. */
+#define W_InputWindow 0x20 /* Window accepts input. */
+#define W_TempWindow 0x40 /* Window is less important. */
-extern WINDOW *windows; /* List of visible Info windows. */
-extern WINDOW *active_window; /* The currently active window. */
-extern WINDOW *the_screen; /* The Info screen is just another window. */
-extern WINDOW *the_echo_area; /* THE_ECHO_AREA is a window in THE_SCREEN. */
+extern WINDOW *windows; /* List of visible Info windows. */
+extern WINDOW *active_window; /* The currently active window. */
+extern WINDOW *the_screen; /* The Info screen is just another window. */
+extern WINDOW *the_echo_area; /* THE_ECHO_AREA is a window in THE_SCREEN. */
/* Global variable control redisplay of scrolled windows. If non-zero, it
is the desired number of lines to scroll the window in order to make
@@ -226,4 +228,4 @@ extern void window_get_state (), window_set_state ();
offset of GOAL. */
extern int window_chars_to_goal ();
-#endif /* !_WINDOW_H_ */
+#endif /* not INFO_WINDOW_H */
diff --git a/gnu/usr.bin/texinfo/lib/Makefile.am b/gnu/usr.bin/texinfo/lib/Makefile.am
index aec88db7246..9e9f8776cbe 100644
--- a/gnu/usr.bin/texinfo/lib/Makefile.am
+++ b/gnu/usr.bin/texinfo/lib/Makefile.am
@@ -1,5 +1,5 @@
## Makefile.am for texinfo/lib.
-## $Id: Makefile.am,v 1.1 1997/08/01 21:59:40 kstailey Exp $
+## $Id: Makefile.am,v 1.2 1999/01/11 16:38:11 espie Exp $
## Run automake in .. to produce Makefile.in from this.
noinst_LIBRARIES = libtxi.a
diff --git a/gnu/usr.bin/texinfo/lib/system.h b/gnu/usr.bin/texinfo/lib/system.h
index c9edd9ff8df..fd2e858a381 100644
--- a/gnu/usr.bin/texinfo/lib/system.h
+++ b/gnu/usr.bin/texinfo/lib/system.h
@@ -1,5 +1,5 @@
/* system.h: System-dependent declarations. Include this first.
- $Id: system.h,v 1.1 1997/08/01 21:59:40 kstailey Exp $
+ $Id: system.h,v 1.2 1999/01/11 16:38:11 espie Exp $
Copyright (C) 1997 Free Software Foundation, Inc.
diff --git a/gnu/usr.bin/texinfo/makeinfo/Makefile.am b/gnu/usr.bin/texinfo/makeinfo/Makefile.am
index 3e341fb62cc..4668600367f 100644
--- a/gnu/usr.bin/texinfo/makeinfo/Makefile.am
+++ b/gnu/usr.bin/texinfo/makeinfo/Makefile.am
@@ -1,5 +1,5 @@
## Makefile.am for texinfo/makeinfo.
-## $Id: Makefile.am,v 1.1 1997/08/01 22:00:54 kstailey Exp $
+## $Id: Makefile.am,v 1.2 1999/01/11 16:38:11 espie Exp $
## Run automake in .. to produce Makefile.in from this.
bin_PROGRAMS = makeinfo
diff --git a/gnu/usr.bin/texinfo/makeinfo/makeinfo.c b/gnu/usr.bin/texinfo/makeinfo/makeinfo.c
index 91898aec115..ae44121aa82 100644
--- a/gnu/usr.bin/texinfo/makeinfo/makeinfo.c
+++ b/gnu/usr.bin/texinfo/makeinfo/makeinfo.c
@@ -1,7 +1,8 @@
/* Makeinfo -- convert Texinfo source files into Info files.
- $Id: makeinfo.c,v 1.4 1997/08/04 15:28:20 kstailey Exp $
+ $Id: makeinfo.c,v 1.5 1999/01/11 16:38:11 espie Exp $
- Copyright (C) 1987, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc.
+ Copyright (C) 1987, 92, 93, 94, 95, 96, 97, 98
+ Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -115,6 +116,9 @@ int must_start_paragraph = 0;
/* Nonzero means a string is in execution, as opposed to a file. */
static int executing_string = 0;
+/* Nonzero means a macro string is in execution, as opposed to a file. */
+static int me_executing_string = 0;
+
#if defined (HAVE_MACROS)
/* If non-NULL, this is an output stream to write the full macro expansion
of the input text to. The result is another texinfo file, but
@@ -1082,10 +1086,11 @@ main (argc, argv)
case 'V':
/* User requested version info. */
print_version_info ();
- puts (_("Copyright (C) 1996 Free Software Foundation, Inc.\n\
+ printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\
-For more information about these matters, see the files named COPYING."));
+For more information about these matters, see the files named COPYING.\n"),
+ "1998");
exit (NO_ERROR);
break;
@@ -1143,7 +1148,7 @@ For more information about these matters, see the files named COPYING."));
void
print_version_info ()
{
- printf (_("makeinfo (GNU %s %s) %d.%d\n"), PACKAGE, VERSION,
+ printf ("makeinfo (GNU %s %s) %d.%d\n", PACKAGE, VERSION,
major_version, minor_version);
}
@@ -1188,10 +1193,10 @@ Options:\n\
--verbose report about what is being done.\n\
--version display version information and exit.\n\
\n\
-Email bug reports to bug-texinfo@prep.ai.mit.edu.\n\
+Email bug reports to bug-texinfo@gnu.org.\n\
"),
- progname, paragraph_start_indent,
- fill_column, max_error_level, reference_warning_limit);
+ progname, max_error_level, fill_column,
+ paragraph_start_indent, reference_warning_limit);
exit (exit_value);
}
@@ -1248,8 +1253,8 @@ find_and_load (filename)
if (file < 0)
goto error_exit;
- /* Load the file. */
- result = (char *)xmalloc (1 + file_size);
+ /* Load the file, with enough room for a newline and a null. */
+ result = xmalloc (file_size + 2);
/* VMS stat lies about the st_size value. The actual number of
readable bytes is always less than this value. The arcane
@@ -1291,10 +1296,10 @@ find_and_load (filename)
line_number = 1;
/* Not strictly necessary. This magic prevents read_token () from doing
extra unnecessary work each time it is called (that is a lot of times).
- The SIZE_OF_INPUT_TEXT is one past the actual end of the text. */
+ SIZE_OF_INPUT_TEXT is one past the actual end of the text. */
input_text[size_of_input_text] = '\n';
- /* Strictly necessary. */
- input_text[size_of_input_text+1] = '\0';
+ /* This, on the other hand, is always necessary. */
+ input_text[size_of_input_text+1] = 0;
return (result);
}
@@ -1335,7 +1340,7 @@ popfile ()
filestack = filestack->next;
/* Make sure that commands with braces have been satisfied. */
- if (!executing_string)
+ if (!executing_string && !me_executing_string)
discard_braces ();
/* Get the top of the stack into the globals. */
@@ -1819,7 +1824,7 @@ get_until_in_line (expand, match, string)
`execution_strings' array. This happens when processing the
(synthetic) Overview-Footnotes node in the Texinfo manual. */
- if (expand && !executing_string)
+ if (expand && !executing_string && !me_executing_string)
{
char *xp;
unsigned xp_len, new_len;
@@ -1835,12 +1840,15 @@ get_until_in_line (expand, match, string)
xp_len = strlen (xp);
free (str);
- /* Plunk the expansion into the middle of input_text. */
- str = xstrdup (input_text + limit);
- new_len = input_text_offset + xp_len + strlen (str) + 1;
+ /* Plunk the expansion into the middle of `input_text' --
+ which is terminated by a newline, not a null. */
+ str = xmalloc (real_bottom - limit + 1);
+ strncpy (str, input_text + limit, real_bottom - limit + 1);
+ new_len = input_text_offset + xp_len + real_bottom - limit + 1;
input_text = xrealloc (input_text, new_len);
strcpy (input_text + input_text_offset, xp);
- strcat (input_text, str);
+ strncpy (input_text + input_text_offset + xp_len, str,
+ real_bottom - limit + 1);
free (str);
free (xp);
@@ -3975,7 +3983,7 @@ cm_today (arg)
{
time_t timer = time (0);
struct tm *ts = localtime (&timer);
- add_word_args (_("%d %s %d"), ts->tm_mday, _(months[ts->tm_mon]),
+ add_word_args ("%d %s %d", ts->tm_mday, _(months[ts->tm_mon]),
ts->tm_year + 1900);
}
}
@@ -4162,7 +4170,7 @@ insert_and_underscore (with_char)
no_indent = 1;
#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream)
+ if (macro_expansion_output_stream && !executing_string)
append_to_expansion_output (input_text_offset + 1);
#endif /* HAVE_MACROS */
@@ -4170,7 +4178,7 @@ insert_and_underscore (with_char)
starting_pos = output_position + output_paragraph_offset;
#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream)
+ if (macro_expansion_output_stream && !executing_string)
{
char *temp1 = (char *) xmalloc (2 + strlen (temp));
sprintf (temp1, "%s\n", temp);
@@ -4314,7 +4322,7 @@ cm_top ()
{
TAG_ENTRY *tag = tag_table;
- line_error (_("There already is a node having %ctop as a section"),
+ line_error (_("Node with %ctop as a section already exists"),
COMMAND_PREFIX);
while (tag != (TAG_ENTRY *)NULL)
@@ -4732,7 +4740,7 @@ cm_node ()
current_footnote_number = 1;
#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream)
+ if (macro_expansion_output_stream && !executing_string)
append_to_expansion_output (input_text_offset + 1);
#endif /* HAVE_MACROS */
@@ -4745,7 +4753,7 @@ cm_node ()
printf (_("Formatting node %s...\n"), node);
#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream)
+ if (macro_expansion_output_stream && !executing_string)
remember_itext (input_text, input_text_offset);
#endif /* HAVE_MACROS */
@@ -4755,7 +4763,7 @@ cm_node ()
add_word_args ("\037\nFile: %s, Node: ", pretty_output_filename);
#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream)
+ if (macro_expansion_output_stream && !executing_string)
me_execute_string (node);
else
#endif /* HAVE_MACROS */
@@ -4936,7 +4944,7 @@ cm_node ()
#if defined (HAVE_MACROS)
/* Insert the correct args if we are expanding macros, and the node's
pointers weren't defaulted. */
- if (macro_expansion_output_stream && !defaulting)
+ if (macro_expansion_output_stream && !executing_string && !defaulting)
{
char *temp;
int op_orig = output_paragraph_offset;
@@ -5835,7 +5843,7 @@ cm_uref (arg, start_pos, end_pos)
if (arg == END)
{
char *comma;
- char *arg = &output_paragraph[start_pos];
+ char *arg = (char *) &output_paragraph[start_pos];
output_paragraph[end_pos] = 0;
output_column -= end_pos - start_pos;
@@ -5879,7 +5887,7 @@ cm_email (arg, start_pos, end_pos)
if (arg == END)
{
char *comma;
- char *arg = &output_paragraph[start_pos];
+ char *arg = (char *) &output_paragraph[start_pos];
output_paragraph[end_pos] = 0;
output_column -= end_pos - start_pos;
@@ -6316,8 +6324,8 @@ cm_value (arg, start_pos, end_pos)
{
if (arg == END)
{
- char *name, *value;
- name = &output_paragraph[start_pos];
+ char *name = (char *) &output_paragraph[start_pos];
+ char *value;
output_paragraph[end_pos] = 0;
name = xstrdup (name);
value = set_p (name);
@@ -6625,13 +6633,10 @@ expansion (str, implicit_code)
/* Inhibit any real output. */
int start = output_paragraph_offset;
int saved_paragraph_is_open = paragraph_is_open;
- FILE *saved_macro_expansion_output_stream = macro_expansion_output_stream;
inhibit_output_flushing ();
- macro_expansion_output_stream = NULL;
paragraph_is_open = 1;
execute_string (implicit_code ? "@code{%s}" : "%s", str);
- macro_expansion_output_stream = saved_macro_expansion_output_stream;
uninhibit_output_flushing ();
/* Copy the expansion from the buffer. */
@@ -7270,29 +7275,27 @@ defun_internal (type, x_p)
current_indent -= default_indentation_increment;
close_single_paragraph ();
- if (!macro_expansion_output_stream)
- /* Make an entry in the appropriate index unless we are just
- expanding macros. */
- switch (base_type)
- {
- case deffn:
- case deftypefn:
- execute_string ("%cfindex %s\n", COMMAND_PREFIX, defined_name);
- break;
- case defvr:
- case deftypevr:
- case defcv:
- execute_string ("%cvindex %s\n", COMMAND_PREFIX, defined_name);
- break;
- case defop:
- case deftypemethod:
- execute_string ("%cfindex %s on %s\n",
- COMMAND_PREFIX, defined_name, type_name);
- break;
- case deftp:
- execute_string ("%ctindex %s\n", COMMAND_PREFIX, defined_name);
- break;
- }
+ /* Make an entry in the appropriate index. */
+ switch (base_type)
+ {
+ case deffn:
+ case deftypefn:
+ execute_string ("%cfindex %s\n", COMMAND_PREFIX, defined_name);
+ break;
+ case defvr:
+ case deftypevr:
+ case defcv:
+ execute_string ("%cvindex %s\n", COMMAND_PREFIX, defined_name);
+ break;
+ case defop:
+ case deftypemethod:
+ execute_string ("%cfindex %s on %s\n",
+ COMMAND_PREFIX, defined_name, type_name);
+ break;
+ case deftp:
+ execute_string ("%ctindex %s\n", COMMAND_PREFIX, defined_name);
+ break;
+ }
/* Deallocate the token list. */
scan_args = defun_args;
@@ -7564,7 +7567,7 @@ cm_include ()
char *filename;
#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream)
+ if (macro_expansion_output_stream && !executing_string)
me_append_before_this_command ();
#endif /* HAVE_MACROS */
@@ -7572,7 +7575,7 @@ cm_include ()
get_rest_of_line (&filename);
#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream)
+ if (macro_expansion_output_stream && !executing_string)
remember_itext (input_text, input_text_offset);
#endif /* HAVE_MACROS */
@@ -7610,7 +7613,7 @@ cm_include ()
else
{
#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream)
+ if (macro_expansion_output_stream && !executing_string)
remember_itext (input_text, input_text_offset);
#endif /* HAVE_MACROS */
reader_loop ();
@@ -7938,7 +7941,7 @@ index_add_arg (name)
which = tem ? tem->write_index : -1;
#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream)
+ if (macro_expansion_output_stream && !executing_string)
append_to_expansion_output (input_text_offset + 1);
#endif /* HAVE_MACROS */
@@ -7946,7 +7949,7 @@ index_add_arg (name)
ignore_blank_line ();
#if defined (HAVE_MACROS)
- if (macro_expansion_output_stream)
+ if (macro_expansion_output_stream && !executing_string)
{
int op_orig;
@@ -8438,12 +8441,12 @@ cm_footnote ()
char *marker;
char *note;
- if (macro_expansion_output_stream)
- append_to_expansion_output (input_text_offset + 1); /* include the { */
-
get_until ("{", &marker);
canon_white (marker);
+ if (macro_expansion_output_stream && !executing_string)
+ append_to_expansion_output (input_text_offset + 1); /* include the { */
+
/* Read the argument in braces. */
if (curchar () != '{')
{
@@ -8485,7 +8488,7 @@ cm_footnote ()
/* Must write the macro-expanded argument to the macro expansion
output stream. This is like the case in index_add_arg. */
- if (macro_expansion_output_stream)
+ if (macro_expansion_output_stream && !executing_string)
{
int op_orig;
@@ -8856,10 +8859,10 @@ apply (named, actuals, body)
}
else
{ /* not a parameter, restore \'s */
- char *trailer = body[i] ? "/" : "";
- len += 1 + strlen (trailer);
- text = (char *)xmalloc (1 + len);
- sprintf (text, "\\%s%s", param, trailer);
+ i = body[i] ? (i - 1) : i;
+ len++;
+ text = xmalloc (1 + len);
+ sprintf (text, "\\%s", param);
}
if ((2 + strlen (param)) < len)
@@ -8890,7 +8893,7 @@ execute_macro (def)
int num_args;
char *execution_string = (char *)NULL;
- if (macro_expansion_output_stream && !me_inhibit_expansion)
+ if (macro_expansion_output_stream && !executing_string && !me_inhibit_expansion)
me_append_before_this_command ();
/* Find out how many arguments this macro definition takes. */
@@ -8913,7 +8916,7 @@ execute_macro (def)
if (def->body)
{
- if (macro_expansion_output_stream && !me_inhibit_expansion)
+ if (macro_expansion_output_stream && !executing_string && !me_inhibit_expansion)
{
remember_itext (input_text, input_text_offset);
me_execute_string (execution_string);
@@ -8941,7 +8944,7 @@ cm_macro ()
body_size = 0;
body_index = 0;
- if (macro_expansion_output_stream)
+ if (macro_expansion_output_stream && !executing_string)
me_append_before_this_command ();
skip_whitespace ();
@@ -9138,7 +9141,7 @@ cm_macro ()
add_macro (name, arglist, body, input_filename, defining_line, flags);
- if (macro_expansion_output_stream)
+ if (macro_expansion_output_stream && !executing_string)
remember_itext (input_text, input_text_offset);
}
@@ -9149,7 +9152,7 @@ cm_unmacro ()
char *line, *name;
MACRO_DEF *def;
- if (macro_expansion_output_stream)
+ if (macro_expansion_output_stream && !executing_string)
me_append_before_this_command ();
get_rest_of_line (&line);
@@ -9183,7 +9186,7 @@ cm_unmacro ()
free (line);
free (name);
- if (macro_expansion_output_stream)
+ if (macro_expansion_output_stream && !executing_string)
remember_itext (input_text, input_text_offset);
}
@@ -9286,10 +9289,10 @@ me_execute_string (execution_string)
remember_itext (execution_string, 0);
- executing_string++;
+ me_executing_string++;
reader_loop ();
popfile ();
- executing_string--;
+ me_executing_string--;
}
/* Append the text which appears in input_text from the last offset to
@@ -9309,7 +9312,7 @@ append_to_expansion_output (offset)
}
if (!itext)
- itext = remember_itext (input_text, 0);
+ return;
if (offset > itext->offset)
{
diff --git a/gnu/usr.bin/texinfo/makeinfo/makeinfo.h b/gnu/usr.bin/texinfo/makeinfo/makeinfo.h
index 78fda8c4492..258c7c9c833 100644
--- a/gnu/usr.bin/texinfo/makeinfo/makeinfo.h
+++ b/gnu/usr.bin/texinfo/makeinfo/makeinfo.h
@@ -1,7 +1,7 @@
/* makeinfo.h -- Declarations for Makeinfo.
- $Id: makeinfo.h,v 1.1 1996/12/15 21:39:27 downsj Exp $
+ $Id: makeinfo.h,v 1.2 1999/01/11 16:38:13 espie Exp $
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright (C) 1996, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -35,12 +35,14 @@
enum insertion_type
{
- menu, detailmenu, quotation, lisp, smalllisp, example, smallexample,
- display, itemize, format, enumerate, cartouche, multitable, table,
- ftable, vtable, group, ifinfo, flushleft, flushright, ifset,
- ifclear, deffn, defun, defmac, defspec, defvr, defvar, defopt,
- deftypefn, deftypefun, deftypevr, deftypevar, defcv, defivar, defop,
- defmethod, deftypemethod, deftp, direntry, bad_type
+ cartouche, defcv, deffn, defivar, defmac, defmethod,
+ defop, defopt, defspec, deftp, deftypefn, deftypefun,
+ deftypemethod, deftypevar, deftypevr, defun, defvar,
+ defvr, detailmenu, direntry, display, enumerate, example,
+ flushleft, flushright, format, ftable, group, ifclear,
+ ifinfo, ifnothtml, ifnottex, ifset, itemize, lisp, menu,
+ multitable, quotation, smallexample, smalllisp, table, vtable,
+ bad_type
};
DECLARE (int, insertion_level, 0);
@@ -48,13 +50,13 @@ DECLARE (int, insertion_level, 0);
#if defined (COMPILING_MAKEINFO)
char *insertion_type_names[] =
{
- "menu", "detailmenu", "quotation", "lisp", "smalllisp", "example",
- "smallexample", "display", "itemize", "format", "enumerate",
- "cartouche", "multitable", "table", "ftable", "vtable", "group",
- "ifinfo", "flushleft", "flushright", "ifset", "ifclear", "deffn",
- "defun", "defmac", "defspec", "defvr", "defvar", "defopt",
- "deftypefn", "deftypefun", "deftypevr", "deftypevar", "defcv",
- "defivar", "defop", "defmethod", "deftypemethod", "deftp", "direntry",
+ "cartouche", "defcv", "deffn", "defivar", "defmac", "defmethod",
+ "defop", "defopt", "defspec", "deftp", "deftypefn", "deftypefun",
+ "deftypemethod", "deftypevar", "deftypevr", "defun", "defvar",
+ "defvr", "detailmenu", "direntry", "display", "enumerate", "example",
+ "flushleft", "flushright", "format", "ftable", "group", "ifclear",
+ "ifinfo", "ifnothtml", "ifnottex", "ifset", "itemize", "lisp", "menu",
+ "multitable", "quotation", "smallexample", "smalllisp", "table", "vtable",
"bad_type"
};
#endif
@@ -107,15 +109,15 @@ DECLARE (int, line_number, 0);
#define curchar() input_text[input_text_offset]
/* **************************************************************** */
-/* */
-/* Global Defines */
-/* */
+/* */
+/* Global Defines */
+/* */
/* **************************************************************** */
/* Error levels */
#define NO_ERROR 0
-#define SYNTAX 2
-#define FATAL 4
+#define SYNTAX 2
+#define FATAL 4
/* C's standard macros don't check to make sure that the characters being
changed are within range. So I have to check explicitly. */
@@ -164,29 +166,29 @@ DECLARE (int, line_number, 0);
#define SPLIT_SIZE_THRESHOLD 70000 /* What's good enough for Stallman... */
#define DEFAULT_SPLIT_SIZE 50000 /* Is probably good enough for me. */
-DECLARE (int, splitting, 1); /* Defaults to true for now. */
+DECLARE (int, splitting, 1); /* Defaults to true for now. */
typedef void COMMAND_FUNCTION (); /* So I can say COMMAND_FUNCTION *foo; */
#define command_char(c) ((!whitespace(c)) && \
- ((c) != '\n') && \
- ((c) != '{') && \
- ((c) != '}') && \
- ((c) != '='))
+ ((c) != '\n') && \
+ ((c) != '{') && \
+ ((c) != '}') && \
+ ((c) != '='))
#define skip_whitespace() \
while ((input_text_offset != size_of_input_text) && \
- whitespace (curchar())) \
+ whitespace (curchar())) \
input_text_offset++
#define skip_whitespace_and_newlines() \
do { \
while ((input_text_offset != size_of_input_text) && \
- (whitespace (curchar ()) || (curchar () == '\n'))) \
+ (whitespace (curchar ()) || (curchar () == '\n'))) \
{ \
- if (curchar () == '\n') \
- line_number++; \
- input_text_offset++; \
+ if (curchar () == '\n') \
+ line_number++; \
+ input_text_offset++; \
} \
} while (0)
diff --git a/gnu/usr.bin/texinfo/makeinfo/multi.c b/gnu/usr.bin/texinfo/makeinfo/multi.c
index 273f1461013..ff6358cb6d3 100644
--- a/gnu/usr.bin/texinfo/makeinfo/multi.c
+++ b/gnu/usr.bin/texinfo/makeinfo/multi.c
@@ -1,7 +1,7 @@
-/* multi.c -- Multitable stuff for makeinfo.
- $Id: multi.c,v 1.1 1996/12/15 21:39:29 downsj Exp $
+/* multi.c -- multitable stuff for makeinfo.
+ $Id: multi.c,v 1.2 1999/01/11 16:38:13 espie Exp $
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright (C) 1996, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,10 +17,10 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#include <stdio.h>
+#include "system.h"
#include "makeinfo.h"
-#define MAXCOLS 100 /* remove this limit later @@ */
+#define MAXCOLS 100 /* remove this limit later @@ */
/*
@@ -38,7 +38,7 @@
* `select_output_environment' function switches from one output
* environment to another.
*
- * Environment #0 (i.e. element #0 of the table) is the regular
+ * Environment #0 (i.e., element #0 of the table) is the regular
* environment that is used when we're not formatting a multitable.
*
* Environment #N (where N = 1,2,3,...) is the env. for column #N of
@@ -55,7 +55,7 @@ struct env
int paragraph_is_open;
int current_indent;
int fill_column;
-} envs[MAXCOLS]; /* the environment table */
+} envs[MAXCOLS]; /* the environment table */
/* index in environment table of currently selected environment */
static int current_env_no;
@@ -67,6 +67,40 @@ static int last_column;
to be drawn, separating rows and columns in the current multitable. */
static int hsep, vsep;
+/* Output a row. Have to keep `output_position' up-to-date for each
+ character we output, or the tags table will be off, leading to
+ chopped-off output files and undefined nodes (because they're in the
+ wrong file, etc.). Perhaps it would be better to accumulate this
+ value somewhere and add it once at the end of the table, or return it
+ as the value, but this seems simplest. */
+static void
+out_char (ch)
+ int ch;
+{
+ extern int output_position;
+ putc (ch, output_stream);
+ output_position++;
+}
+
+
+void
+draw_horizontal_separator ()
+{
+ int i, j, s;
+
+ for (s = 0; s < envs[0].current_indent; s++)
+ out_char (' ');
+ if (vsep)
+ out_char ('+');
+ for (i = 1; i <= last_column; i++) {
+ for (j = 0; j <= envs[i].fill_column; j++)
+ out_char ('-');
+ if (vsep)
+ out_char ('+');
+ }
+ out_char ('\n');
+}
+
void
do_multitable ()
{
@@ -116,7 +150,7 @@ setup_multitable_parameters ()
char *params = insertion_stack->item_function;
int nchars;
float columnfrac;
- char command[200];
+ char command[200]; /* naughty, should be no fixed limits */
int i = 1;
/* We implement @hsep and @vsep even though TeX doesn't.
@@ -129,22 +163,32 @@ setup_multitable_parameters ()
params++;
if (*params == '@') {
- sscanf (params, "%s%n", command, &nchars);
+ sscanf (params, "%200s", command);
+ nchars = strlen (command);
params += nchars;
if (strcmp (command, "@hsep") == 0)
- hsep++;
+ hsep++;
else if (strcmp (command, "@vsep") == 0)
- vsep++;
+ vsep++;
else if (strcmp (command, "@columnfractions") == 0) {
- /* Clobber old environments and create new ones,
- starting at #1. Environment #0 is the normal standard output,
- so we don't mess with it. */
- for ( ; i <= MAXCOLS; i++) {
- if (sscanf (params, "%f%n", &columnfrac, &nchars) < 1)
- goto done;
- params += nchars;
- setup_output_environment (i, (int) (columnfrac * fill_column + .5));
- }
+ /* Clobber old environments and create new ones, starting at #1.
+ Environment #0 is the normal output, so don't mess with it. */
+ for ( ; i <= MAXCOLS; i++) {
+ if (sscanf (params, "%f", &columnfrac) < 1)
+ goto done;
+ /* Unfortunately, can't use %n since some m68k-hp-bsd libc
+ doesn't support it. So skip whitespace (preceding the
+ number) and then non-whitespace (the number). */
+ while (*params && (*params == ' ' || *params == '\t'))
+ params++;
+ /* Hmm, but what what @columnfractions 3foo. Well, I suppose
+ it's invalid input anyway. */
+ while (*params && *params != ' ' && *params != '\t'
+ && *params != '\n' && *params != '@')
+ params++;
+ setup_output_environment (i,
+ (int) (columnfrac * (fill_column - current_indent) + .5));
+ }
}
} else if (*params == '{') {
@@ -154,18 +198,17 @@ setup_multitable_parameters ()
}
/* This gives us two spaces between columns. Seems reasonable.
Really should expand the text, though, so a template of
- `@code{foo}' has a width of three, not ten. Also have to match
- braces, then. */
+ `@code{foo}' has a width of five, not ten. Also have to match
+ braces, then. How to take into account current_indent here? */
setup_output_environment (i++, params++ - start);
} else {
- warning ("ignoring stray text `%s' after @multitable", params);
+ warning (_("ignoring stray text `%s' after @multitable"), params);
break;
}
}
done:
-
flush_output ();
inhibit_output_flushing ();
@@ -227,12 +270,12 @@ select_output_environment (n)
}
/* advance to the next environment number */
-int
+void
nselect_next_environment ()
{
if (current_env_no >= last_column) {
- line_error ("Too many columns in multitable item (max %d)", last_column);
- return 1;
+ line_error (_("Too many columns in multitable item (max %d)"), last_column);
+ return;
}
select_output_environment (current_env_no + 1);
}
@@ -240,12 +283,25 @@ nselect_next_environment ()
static void output_multitable_row ();
+/* do anything needed at the beginning of processing a
+ multitable column. */
+void
+init_column ()
+{
+ /* don't indent 1st paragraph in the item */
+ cm_noindent ();
+
+ /* throw away possible whitespace after @item or @tab command */
+ skip_whitespace ();
+}
+
/* start a new item (row) of a multitable */
+int
multitable_item ()
{
if (!multitable_active) {
/* impossible, I think. */
- error ("multitable item not in active multitable");
+ error (_("multitable item not in active multitable"));
exit (1);
}
if (current_env_no > 0) {
@@ -254,7 +310,7 @@ multitable_item ()
/* start at column 1 */
select_output_environment (1);
if (!output_paragraph) {
- line_error ("Cannot select column #%d in multitable", current_env_no);
+ line_error (_("Cannot select column #%d in multitable"), current_env_no);
exit (FATAL);
}
@@ -263,38 +319,10 @@ multitable_item ()
return 0;
}
-/* do anything needed at the beginning of processing a
- multitable column. */
-init_column ()
-{
- /* don't indent 1st paragraph in the item */
- cm_noindent ();
-
- /* throw away possible whitespace after @item or @tab command */
- skip_whitespace ();
-}
-
-/* Output a row. Have to keep `output_position' up-to-date for each
- character we output, or the tags table will be off, leading to
- chopped-off output files and undefined nodes (because they're in the
- wrong file, etc.). Perhaps it would be better to accumulate this
- value somewhere and add it once at the end of the table, or return it
- as the value, but this seems simplest. */
-
-static void
-out_char (ch)
- int ch;
-{
- extern int output_position;
- putc (ch, output_stream);
- output_position++;
-}
-
-
static void
output_multitable_row ()
{
- int i, j, remaining;
+ int i, j, s, remaining;
/* offset in the output paragraph of the next char needing
to be output for that column. */
@@ -325,29 +353,34 @@ output_multitable_row ()
/* first, see if there is any work to do */
for (i = 1; i <= last_column; i++) {
if (CHAR_ADDR (0) < envs[i].output_paragraph_offset) {
- remaining = 1;
- break;
+ remaining = 1;
+ break;
}
}
if (!remaining)
break;
-
+
+ for (s = 0; s < envs[0].current_indent; s++)
+ out_char (' ');
+
if (vsep)
out_char ('|');
for (i = 1; i <= last_column; i++) {
+ for (s = 0; i < envs[i].current_indent; s++)
+ out_char (' ');
for (j = 0; CHAR_ADDR (j) < envs[i].output_paragraph_offset; j++) {
- if (CHAR_AT (j) == '\n')
- break;
- out_char (CHAR_AT (j));
+ if (CHAR_AT (j) == '\n')
+ break;
+ out_char (CHAR_AT (j));
}
- offset[i] += j + 1; /* skip last text plus skip the newline */
+ offset[i] += j + 1; /* skip last text plus skip the newline */
for (; j <= envs[i].fill_column; j++)
- out_char (' ');
+ out_char (' ');
if (vsep)
- out_char ('|'); /* draw column separator */
+ out_char ('|'); /* draw column separator */
}
- out_char ('\n'); /* end of line */
+ out_char ('\n'); /* end of line */
}
if (hsep)
@@ -363,27 +396,12 @@ output_multitable_row ()
#undef CHAR_AT
#undef CHAR_ADDR
-int
-draw_horizontal_separator ()
-{
- int i, j;
- if (vsep)
- out_char ('+');
- for (i = 1; i <= last_column; i++) {
- for (j = 0; j <= envs[i].fill_column; j++)
- out_char ('-');
- if (vsep)
- out_char ('+');
- }
- out_char ('\n');
-}
-
/* select a new column in current row of multitable */
void
cm_tab ()
{
if (!multitable_active)
- error ("ignoring @tab outside of multitable");
+ error (_("ignoring @tab outside of multitable"));
nselect_next_environment ();
init_column ();
@@ -394,8 +412,6 @@ cm_tab ()
void
end_multitable ()
{
- int i;
-
output_multitable_row ();
/* Multitables cannot be nested. Otherwise, we'd have to save the
@@ -409,10 +425,10 @@ end_multitable ()
uninhibit_output_flushing ();
#if 0
- printf ("** Multicolumn output from last row:\n");
+ printf (_("** Multicolumn output from last row:\n"));
for (i = 1; i <= last_column; i++) {
select_output_environment (i);
- printf ("* column #%d: output = %s\n", i, output_paragraph);
+ printf (_("* column #%d: output = %s\n"), i, output_paragraph);
}
#endif
}
diff --git a/gnu/usr.bin/texinfo/mkinstalldirs b/gnu/usr.bin/texinfo/mkinstalldirs
index db46c289b06..4428e6fb42d 100644
--- a/gnu/usr.bin/texinfo/mkinstalldirs
+++ b/gnu/usr.bin/texinfo/mkinstalldirs
@@ -4,7 +4,7 @@
# Created: 1993-05-16
# Public domain
-# $Id: mkinstalldirs,v 1.1 1997/08/01 21:59:38 kstailey Exp $
+# $Id: mkinstalldirs,v 1.2 1999/01/11 16:38:01 espie Exp $
errstatus=0
diff --git a/gnu/usr.bin/texinfo/po/Makefile.in.in b/gnu/usr.bin/texinfo/po/Makefile.in.in
index 2c1be6d0f58..2b1d523a4c6 100644
--- a/gnu/usr.bin/texinfo/po/Makefile.in.in
+++ b/gnu/usr.bin/texinfo/po/Makefile.in.in
@@ -1,19 +1,10 @@
# Makefile for program source directory in GNU NLS utilities package.
-# Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.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, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# 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@
@@ -95,15 +86,10 @@ $(srcdir)/$(PACKAGE).pot: $(POTFILES)
$(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \
--add-comments --keyword=_ --keyword=N_ \
--files-from=$(srcdir)/POTFILES.in
- if [ ! -s $(PACKAGE).po ] \
- || cmp -s $(PACKAGE).po $(srcdir)/$(PACKAGE).pot; then \
- rm -f $(PACKAGE).po; \
- else \
- rm -f $(srcdir)/$(PACKAGE).pot \
- && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot; \
- fi
+ rm -f $(srcdir)/$(PACKAGE).pot
+ mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot
-$(srcdir)/cat-id-tbl.c: stamp-cat-id
+$(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 \
@@ -131,7 +117,7 @@ install-data-yes: all
*.gmo) destdir=$(gnulocaledir);; \
*) destdir=$(localedir);; \
esac; \
- lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
+ lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \
dir=$$destdir/$$lang/LC_MESSAGES; \
$(MKINSTALLDIRS) $$dir; \
if test -r $$cat; then \
@@ -158,8 +144,8 @@ install-data-yes: all
done
if test "$(PACKAGE)" = "gettext"; then \
$(MKINSTALLDIRS) $(gettextsrcdir); \
- cd $(srcdir) && \
- $(INSTALL_DATA) Makefile.in.in $(gettextsrcdir)/Makefile.in.in; \
+ $(INSTALL_DATA) $(srcdir)/Makefile.in.in \
+ $(gettextsrcdir)/Makefile.in.in; \
else \
: ; \
fi
@@ -170,7 +156,8 @@ installcheck:
uninstall:
catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
- lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
+ 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); \
@@ -196,6 +183,7 @@ distclean: clean
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)
@@ -211,7 +199,8 @@ update-po: Makefile
cd $(srcdir); \
catalogs='$(CATALOGS)'; \
for cat in $$catalogs; do \
- lang=`echo $$cat | sed 's/$(CATOBJEXT)$$//'`; \
+ 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 \
@@ -229,9 +218,12 @@ POTFILES: POTFILES.in
else \
posrcprefix="../"; \
fi; \
- sed -e '/^#/d' -e '/^[ ]*$$/d' \
- -e "s@.*@ $$posrcprefix& \\\\@" \
- -e '$$s/\(.*\) \\/\1/' < $(srcdir)/POTFILES.in > POTFILES )
+ 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 .. \
diff --git a/gnu/usr.bin/texinfo/po/cat-id-tbl.c b/gnu/usr.bin/texinfo/po/cat-id-tbl.c
index e0d2ce8083b..5639d50704a 100644
--- a/gnu/usr.bin/texinfo/po/cat-id-tbl.c
+++ b/gnu/usr.bin/texinfo/po/cat-id-tbl.c
@@ -8,268 +8,273 @@
const struct _msg_ent _msg_tbl[] = {
{"", 1},
- {"Move down to the next line", 2},
- {"Move up to the previous line", 3},
- {"Move to the end of the line", 4},
- {"Move to the start of the line", 5},
- {"Move forward a character", 6},
- {"Move backward a character", 7},
- {"Move forward a word", 8},
- {"Move backward a word", 9},
- {"Move forwards or down through node structure", 10},
- {"Move backwards or up through node structure", 11},
- {"Scroll forward in this window", 12},
- {"Scroll backward in this window", 13},
- {"Move to the start of this node", 14},
- {"Move to the end of this node", 15},
- {"Select the next window", 16},
- {"Select the previous window", 17},
- {"Split the current window", 18},
- {"Delete the current window", 19},
- {"Delete all other windows", 20},
- {"Scroll the other window", 21},
- {"Grow (or shrink) this window", 22},
- {"Divide the available screen space among the visible windows", 23},
- {"Toggle the state of line wrapping in the current window", 24},
- {"Select the `Next' node", 25},
- {"Select the `Prev' node", 26},
- {"Select the `Up' node", 27},
- {"Select the last node in this file", 28},
- {"Select the first node in this file", 29},
- {"Select the most recently selected node", 30},
- {"Select the last item in this node's menu", 31},
- {"Select this menu item", 32},
- {"Read a menu item and select its node", 33},
- {"Read a footnote or cross reference and select its node", 34},
- {"Move to the start of this node's menu", 35},
- {"Visit as many menu items at once as possible", 36},
- {"Read a node name and select it", 37},
- {"Read a manpage reference and select it", 38},
- {"Select the node `Top' in this file", 39},
- {"Select the node `(dir)'", 40},
- {"Kill this node", 41},
- {"Read the name of a file and select it", 42},
- {"Pipe the contents of this node through INFO_PRINT_COMMAND", 43},
- {"Read a string and search for it", 44},
- {"Search interactively for a string as you type it", 45},
- {"Move to the previous cross reference", 46},
- {"Move to the next cross reference", 47},
- {"Select reference or menu item appearing on this line", 48},
- {"Cancel current operation", 49},
- {"Move to the cursor to a specific line of the window", 50},
- {"Redraw the display", 51},
- {"Quit using Info", 52},
- {"Add this digit to the current numeric argument", 53},
- {"universal-argument", 54},
- {"Start (or multiply by 4) the current numeric argument", 55},
- {"Internally used by \\[universal-argument]", 56},
- {"Move to the start of this line", 57},
- {"Move to the end of this line", 58},
- {"Delete the character under the cursor", 59},
- {"Delete the character behind the cursor", 60},
- {"Cancel or quit operation", 61},
- {"Accept (or force completion of) this line", 62},
- {"Insert next character verbatim", 63},
- {"Insert this character", 64},
- {"Insert a TAB character", 65},
- {"Transpose characters at point", 66},
- {"Yank back the contents of the last kill", 67},
- {"Yank back a previous kill", 68},
- {"Kill to the end of the line", 69},
- {"Kill to the beginning of the line", 70},
- {"Kill the word following the cursor", 71},
- {"Kill the word preceding the cursor", 72},
- {"List possible completions", 73},
- {"Insert completion", 74},
- {"Scroll the completions window", 75},
- {"Display help message", 76},
- {"Visit Info node `(info)Help'", 77},
- {"Print documentation for KEY", 78},
- {"Show what to type to execute a given command", 79},
- {"Read the name of an Info command and describe it", 80},
- {"Read a command name in the echo area and execute it", 81},
- {"Set the height of the displayed window", 82},
- {"Look up a string in the index for this file", 83},
+ {"Move forward a character", 2},
+ {"Move backward a character", 3},
+ {"Move to the start of this line", 4},
+ {"Move to the end of this line", 5},
+ {"Move forward a word", 6},
+ {"Move backward a word", 7},
+ {"Delete the character under the cursor", 8},
+ {"Delete the character behind the cursor", 9},
+ {"Cancel or quit operation", 10},
+ {"Accept (or force completion of) this line", 11},
+ {"Insert next character verbatim", 12},
+ {"Insert this character", 13},
+ {"Insert a TAB character", 14},
+ {"Transpose characters at point", 15},
+ {"Yank back the contents of the last kill", 16},
+ {"Kill ring is empty", 17},
+ {"Yank back a previous kill", 18},
+ {"Kill to the end of the line", 19},
+ {"Kill to the beginning of the line", 20},
+ {"Kill the word following the cursor", 21},
+ {"Kill the word preceding the cursor", 22},
+ {"Not complete", 23},
+ {"List possible completions", 24},
+ {"No completions", 25},
+ {"Sole completion", 26},
+ {"One completion:\n", 27},
+ {"%d completions:\n", 28},
+ {"Insert completion", 29},
+ {"Building completions...", 30},
+ {"Scroll the completions window", 31},
+ {"Footnotes could not be displayed", 32},
+ {"Show the footnotes associated with this node in another window", 33},
+ {"Look up a string in the index for this file", 34},
+ {"Finding index entries...", 35},
+ {"No indices found.", 36},
+ {"Index entry: ", 37},
{"\
-Go to the next matching index item from the last `\\[index-search]' command", 84},
- {"Grovel all known info file's indices for a string and build a menu", 85},
- {"Make a window containing a menu of all of the currently visited nodes", 86},
- {"Select a node which has been previously visited in a visible window", 87},
- {"Show the footnotes associated with this node in another window", 88},
- {"Explain the use of a variable", 89},
- {"Set the value of an Info variable", 90},
- {"Kill ring is empty", 91},
- {"Not complete", 92},
- {"No completions", 93},
- {"Sole completion", 94},
- {"There %s %d ", 95},
- {"is", 96},
- {"are", 97},
- {"completion%s:\n", 98},
- {"Building completions...", 99},
- {"Footnotes could not be displayed", 100},
- {"Finding index entries...", 101},
- {"No indices found.", 102},
- {"Index entry: ", 103},
- {"No previous index search string.", 104},
- {"No index entries.", 105},
- {"No %sindex entries containing \"%s\".", 106},
- {"more ", 107},
- {"CAN'T SEE THIS", 108},
- {"Found \"%s\" in %s. (`\\[next-index-match]' tries to find next.)", 109},
- {"Scanning indices of \"%s\"...", 110},
- {"Index apropos: ", 111},
+Go to the next matching index item from the last `\\[index-search]' command", 38},
+ {"No previous index search string.", 39},
+ {"No index entries.", 40},
+ {"No %sindex entries containing \"%s\".", 41},
+ {"more ", 42},
+ {"CAN'T SEE THIS", 43},
+ {"Found \"%s\" in %s. (`\\[next-index-match]' tries to find next.)", 44},
+ {"Scanning indices of \"%s\"...", 45},
+ {"Grovel all known info file's indices for a string and build a menu", 46},
+ {"Index apropos: ", 47},
{"\
\n\
-* Menu: Nodes whoses indices contain \"%s\":\n", 112},
- {"no entries found\n", 113},
- {"There is no menu in this node.", 114},
- {"There is no menu item \"%s\" in this node.", 115},
- {"Unable to find the node referenced by \"%s\".", 116},
+* Menu: Nodes whoses indices contain \"%s\":\n", 48},
+ {"Try --help for more information.", 49},
{"\
-Usage: info [-d dir-path] [-f info-file] [-o output-file] [-n node-name]...", 117},
- {"\
- [--directory dir-path] [--file info-file] [--node node-name]...", 118},
- {" [--help] [--output output-file] [--subnodes] [--version]", 119},
- {" [--dribble dribble-file] [--restore from-file]", 120},
- {" [menu-selection ...]", 121},
+Copyright (C) %s Free Software Foundation, Inc.\n\
+There is NO warranty. You may redistribute this software\n\
+under the terms of the GNU General Public License.\n\
+For more information about these matters, see the files named COPYING.\n", 50},
+ {"no entries found\n", 51},
+ {"There is no menu in this node.", 52},
+ {"There is no menu item \"%s\" in this node.", 53},
+ {"Unable to find the node referenced by \"%s\".", 54},
{"\
-Here is a quick description of Info's options. For a more complete\n\
-description of how to use Info, type `info info options'.\n\
+Usage: %s [OPTION]... [INFO-FILE [MENU-ITEM...]]\n\
\n\
- --directory DIR Add DIR to INFOPATH.\n\
- --dribble FILENAME Remember user keystrokes in FILENAME.\n\
- --file FILENAME Specify Info file to visit.\n\
- --node NODENAME Specify nodes in first visited Info file.\n\
- --output FILENAME Output selected nodes to FILENAME.\n\
- --restore FILENAME Read initial keystrokes from FILENAME.\n\
- --subnodes Recursively output menu items.\n\
- --help Get this help message.\n\
- --version Display Info's version information.\n\
+Read documentation in Info format.\n\
+For more complete documentation on how to use Info, run `info info \
+options'.\n\
+\n\
+Options:\n\
+--directory DIR add DIR to INFOPATH.\n\
+--dribble FILENAME remember user keystrokes in FILENAME.\n\
+--file FILENAME specify Info file to visit.\n\
+--node NODENAME specify nodes in first visited Info file.\n\
+--output FILENAME output selected nodes to FILENAME.\n\
+--restore FILENAME read initial keystrokes from FILENAME.\n\
+--subnodes recursively output menu items.\n\
+--help display this help and exit.\n\
+--version display version information and exit.\n\
\n\
-Remaining arguments to Info are treated as the names of menu\n\
-items in the initial node visited. You can easily move to the\n\
-node of your choice by specifying the menu names which describe\n\
-the path to that node. For example, `info emacs buffers'.\n\
+The first argument, if present, is the name of the Info file to read.\n\
+Any remaining arguments are treated as the names of menu\n\
+items in the initial node visited. For example, `info emacs buffers'\n\
+moves to the node `buffers' in the info file `emacs'.\n\
\n\
-Email bug reports to bug-texinfo@prep.ai.mit.edu.", 122},
- {"Basic Commands in Info Windows", 123},
+Email bug reports to bug-texinfo@gnu.org.", 55},
+ {"Basic Commands in Info Windows", 56},
{"\
The following commands can only be invoked via M-x:\n\
-\n", 124},
- {"--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n", 125},
- {"Describe key: %s", 126},
- {"ESC %s is undefined.", 127},
- {"%s is undefined.", 128},
- {"%s is defined to %s.", 129},
- {"Where is command: ", 130},
- {"`%s' is not on any keys", 131},
- {"%s can only be invoked via %s.", 132},
- {"%s can be invoked via %s.", 133},
- {"There is no function named `%s'", 134},
- {"Describe command: ", 135},
- {"Cannot execute an `echo-area' command here.", 136},
- {"Set screen height to (%d): ", 137},
+\n", 57},
+ {"--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n", 58},
+ {"Display help message", 59},
+ {"Visit Info node `(info)Help'", 60},
+ {"Print documentation for KEY", 61},
+ {"Describe key: %s", 62},
+ {"ESC %s is undefined.", 63},
+ {"%s is undefined.", 64},
+ {"%s is defined to %s.", 65},
+ {"Where is command: ", 66},
+ {"`%s' is not on any keys", 67},
+ {"%s can only be invoked via %s.", 68},
+ {"%s can be invoked via %s.", 69},
+ {"There is no function named `%s'", 70},
+ {"Read the name of an Info command and describe it", 71},
+ {"Describe command: ", 72},
+ {"Read a command name in the echo area and execute it", 73},
+ {"Cannot execute an `echo-area' command here.", 74},
+ {"Set the height of the displayed window", 75},
+ {"Set screen height to (%d): ", 76},
{"\
Source files groveled to make this file include:\n\
-\n", 138},
- {"Couldn't manipulate the file %s.\n", 139},
+\n", 77},
+ {"Couldn't manipulate the file %s.\n", 78},
{"\
\n\
* Menu:\n\
(File)Node Lines Size Containing File\n\
- ---------- ----- ---- ---------------", 140},
+ ---------- ----- ---- ---------------", 79},
{"\
Here is the menu of nodes you have recently visited.\n\
-Select one from this menu, or use `\\[history-node]' in another window.\n", 141},
- {"Select visited node: ", 142},
- {"The reference disappeared! (%s).", 143},
+Select one from this menu, or use `\\[history-node]' in another window.\n", 80},
+ {"Make a window containing a menu of all of the currently visited nodes", 81},
+ {"Select a node which has been previously visited in a visible window", 82},
+ {"Select visited node: ", 83},
+ {"The reference disappeared! (%s).", 84},
{"\
Welcome to Info version %s. \"\\[get-help-window]\" for help, \
-\"\\[menu-item]\" for menu item.", 144},
- {" times", 145},
- {"%d times", 146},
- {"No \"Next\" pointer for this node.", 147},
- {"Following \"Next\" node...", 148},
- {"Next", 149},
- {"Selecting first menu item...", 150},
- {"Selecting \"Next\" node...", 151},
- {"Up", 152},
- {"No more nodes.", 153},
- {"No \"Prev\" for this node.", 154},
- {"Moving \"Prev\" in this window.", 155},
- {"Prev", 156},
- {"No \"Prev\" or \"Up\" for this node.", 157},
- {"Moving \"Up\" in this window.", 158},
- {"Moving to \"Prev\"'s last menu item.", 159},
- {"Cannot delete a permanent window", 160},
- {"This window has no additional nodes", 161},
- {"There aren't %d items in this menu.", 162},
- {"Menu item (%s): ", 163},
- {"Menu item: ", 164},
- {"Follow xref (%s): ", 165},
- {"Follow xref: ", 166},
- {"Goto Node: ", 167},
- {"Get Manpage: ", 168},
- {"Top", 169},
- {"Kill node (%s): ", 170},
- {"Cannot kill node `%s'", 171},
- {"Cannot kill the last node", 172},
- {"Find file: ", 173},
- {"Cannot find \"%s\".", 174},
- {"Could not create output file \"%s\".", 175},
- {"Done.", 176},
- {"Writing node \"(%s)%s\"...", 177},
- {"Writing node \"%s\"...", 178},
- {"Cannot open pipe to \"%s\".", 179},
- {"Printing node \"(%s)%s\"...", 180},
- {"Printing node \"%s\"...", 181},
- {"Searching subfile \"%s\"...", 182},
- {"%s for string [%s]: ", 183},
- {"Search backward", 184},
- {"Search", 185},
- {"Search failed.", 186},
- {"I-search backward: ", 187},
- {"I-search: ", 188},
- {"Failing ", 189},
- {"No cross references in this node.", 190},
- {"Quit", 191},
- {"Unknown command (%s).", 192},
- {"\"\" is invalid", 193},
- {"\"%s\" is invalid", 194},
- {"When \"On\", footnotes appear and disappear automatically", 195},
- {"When \"On\", creating or deleting a window resizes other windows", 196},
- {"When \"On\", flash the screen instead of ringing the bell", 197},
- {"When \"On\", errors cause the bell to ring", 198},
- {"When \"On\", Info garbage collects files which had to be uncompressed", 199},
- {"When \"On\", the portion of the matched search string is highlighted", 200},
- {"Controls what happens when scrolling is requested at the end of a node", 201},
- {"The number lines to scroll when the cursor moves out of the window", 202},
- {"When \"On\", Info accepts and displays ISO Latin characters", 203},
- {"Describe variable: ", 204},
- {"Set variable: ", 205},
- {"Set %s to value (%d): ", 206},
- {"Set %s to value (%s): ", 207},
- {"--*** Tags out of Date ***", 208},
- {"-----Info: (), lines ----, ", 209},
- {"-%s---Info: %s, %d lines --%s--", 210},
- {"-%s%s-Info: (%s)%s, %d lines --%s--", 211},
- {" Subfile: %s", 212},
- {"%s:%d: warning: ", 213},
- {"Too many errors! Gave up.\n", 214},
- {"%s: %s arg must be numeric, not `%s'.\n", 215},
- {"Couldn't open macro expansion output `%s'", 216},
- {"Cannot specify more than one macro expansion output", 217},
- {"%s: --paragraph-indent arg must be numeric/`none'/`asis', not `%s'.\n", 218},
- {"%s: --footnote-style arg must be `separate' or `end', not `%s'.\n", 219},
- {"\
-Copyright (C) 1996 Free Software Foundation, Inc.\n\
-There is NO warranty. You may redistribute this software\n\
-under the terms of the GNU General Public License.\n\
-For more information about these matters, see the files named COPYING.", 220},
- {"%s: missing file argument.\n", 221},
- {"makeinfo (GNU %s %s) %d.%d\n", 222},
- {"Try `%s --help' for more information.\n", 223},
+\"\\[menu-item]\" for menu item.", 85},
+ {"Move down to the next line", 86},
+ {"Move up to the previous line", 87},
+ {"Move to the end of the line", 88},
+ {"Move to the start of the line", 89},
+ {" times", 90},
+ {"%d times", 91},
+ {"No \"Next\" pointer for this node.", 92},
+ {"Following \"Next\" node...", 93},
+ {"Next", 94},
+ {"Selecting first menu item...", 95},
+ {"Selecting \"Next\" node...", 96},
+ {"Up", 97},
+ {"No more nodes.", 98},
+ {"No \"Prev\" for this node.", 99},
+ {"Moving \"Prev\" in this window.", 100},
+ {"Prev", 101},
+ {"No \"Prev\" or \"Up\" for this node.", 102},
+ {"Moving \"Up\" in this window.", 103},
+ {"Moving to \"Prev\"'s last menu item.", 104},
+ {"Move forwards or down through node structure", 105},
+ {"Move backwards or up through node structure", 106},
+ {"Scroll forward in this window", 107},
+ {"Scroll backward in this window", 108},
+ {"Move to the start of this node", 109},
+ {"Move to the end of this node", 110},
+ {"Select the next window", 111},
+ {"Select the previous window", 112},
+ {"Split the current window", 113},
+ {"Delete the current window", 114},
+ {"Cannot delete a permanent window", 115},
+ {"Delete all other windows", 116},
+ {"Scroll the other window", 117},
+ {"Grow (or shrink) this window", 118},
+ {"Divide the available screen space among the visible windows", 119},
+ {"Toggle the state of line wrapping in the current window", 120},
+ {"Select the `Next' node", 121},
+ {"Select the `Prev' node", 122},
+ {"Select the `Up' node", 123},
+ {"Select the last node in this file", 124},
+ {"This window has no additional nodes", 125},
+ {"Select the first node in this file", 126},
+ {"Select the last item in this node's menu", 127},
+ {"Select this menu item", 128},
+ {"There aren't %d items in this menu.", 129},
+ {"Menu item (%s): ", 130},
+ {"Menu item: ", 131},
+ {"Follow xref (%s): ", 132},
+ {"Follow xref: ", 133},
+ {"Read a menu item and select its node", 134},
+ {"Read a footnote or cross reference and select its node", 135},
+ {"Move to the start of this node's menu", 136},
+ {"Visit as many menu items at once as possible", 137},
+ {"Read a node name and select it", 138},
+ {"Goto Node: ", 139},
+ {"Read a manpage reference and select it", 140},
+ {"Get Manpage: ", 141},
+ {"Select the node `Top' in this file", 142},
+ {"Top", 143},
+ {"Select the node `(dir)'", 144},
+ {"Kill node (%s): ", 145},
+ {"Cannot kill node `%s'", 146},
+ {"Cannot kill the last node", 147},
+ {"Select the most recently selected node", 148},
+ {"Kill this node", 149},
+ {"Read the name of a file and select it", 150},
+ {"Find file: ", 151},
+ {"Cannot find \"%s\".", 152},
+ {"Could not create output file \"%s\".", 153},
+ {"Done.", 154},
+ {"Writing node \"(%s)%s\"...", 155},
+ {"Writing node \"%s\"...", 156},
+ {"Pipe the contents of this node through INFO_PRINT_COMMAND", 157},
+ {"Cannot open pipe to \"%s\".", 158},
+ {"Printing node \"(%s)%s\"...", 159},
+ {"Printing node \"%s\"...", 160},
+ {"Searching subfile \"%s\"...", 161},
+ {"Read a string and search for it", 162},
+ {"%s for string [%s]: ", 163},
+ {"Search backward", 164},
+ {"Search", 165},
+ {"Search failed.", 166},
+ {"Search interactively for a string as you type it", 167},
+ {"I-search backward: ", 168},
+ {"I-search: ", 169},
+ {"Failing ", 170},
+ {"No cross references in this node.", 171},
+ {"Move to the previous cross reference", 172},
+ {"Move to the next cross reference", 173},
+ {"Select reference or menu item appearing on this line", 174},
+ {"Cancel current operation", 175},
+ {"Quit", 176},
+ {"Move to the cursor to a specific line of the window", 177},
+ {"Redraw the display", 178},
+ {"Quit using Info", 179},
+ {"Unknown command (%s).", 180},
+ {"\"\" is invalid", 181},
+ {"\"%s\" is invalid", 182},
+ {"Add this digit to the current numeric argument", 183},
+ {"Start (or multiply by 4) the current numeric argument", 184},
+ {"Internally used by \\[universal-argument]", 185},
+ {"readline: Out of virtual memory!\n", 186},
+ {"When \"On\", footnotes appear and disappear automatically", 187},
+ {"When \"On\", creating or deleting a window resizes other windows", 188},
+ {"When \"On\", flash the screen instead of ringing the bell", 189},
+ {"When \"On\", errors cause the bell to ring", 190},
+ {"When \"On\", Info garbage collects files which had to be uncompressed", 191},
+ {"When \"On\", the portion of the matched search string is highlighted", 192},
+ {"Controls what happens when scrolling is requested at the end of a node", 193},
+ {"The number lines to scroll when the cursor moves out of the window", 194},
+ {"When \"On\", Info accepts and displays ISO Latin characters", 195},
+ {"Explain the use of a variable", 196},
+ {"Describe variable: ", 197},
+ {"Set the value of an Info variable", 198},
+ {"Set variable: ", 199},
+ {"Set %s to value (%d): ", 200},
+ {"Set %s to value (%s): ", 201},
+ {"--*** Tags out of Date ***", 202},
+ {"-----Info: (), lines ----, ", 203},
+ {"-%s---Info: %s, %d lines --%s--", 204},
+ {"-%s%s-Info: (%s)%s, %d lines --%s--", 205},
+ {" Subfile: %s", 206},
+ {"%s: option `%s' is ambiguous\n", 207},
+ {"%s: option `--%s' doesn't allow an argument\n", 208},
+ {"%s: option `%c%s' doesn't allow an argument\n", 209},
+ {"%s: option `%s' requires an argument\n", 210},
+ {"%s: unrecognized option `--%s'\n", 211},
+ {"%s: unrecognized option `%c%s'\n", 212},
+ {"%s: illegal option -- %c\n", 213},
+ {"%s: invalid option -- %c\n", 214},
+ {"%s: option requires an argument -- %c\n", 215},
+ {"%s: option `-W %s' is ambiguous\n", 216},
+ {"%s: option `-W %s' doesn't allow an argument\n", 217},
+ {"%s:%d: warning: ", 218},
+ {"Too many errors! Gave up.\n", 219},
+ {"%s: %s arg must be numeric, not `%s'.\n", 220},
+ {"Couldn't open macro expansion output `%s'", 221},
+ {"Cannot specify more than one macro expansion output", 222},
+ {"%s: --paragraph-indent arg must be numeric/`none'/`asis', not `%s'.\n", 223},
+ {"%s: --footnote-style arg must be `separate' or `end', not `%s'.\n", 224},
+ {"%s: missing file argument.\n", 225},
+ {"Try `%s --help' for more information.\n", 226},
{"\
Usage: %s [OPTION]... TEXINFO-FILE...\n\
\n\
@@ -302,125 +307,125 @@ Options:\n\
--verbose report about what is being done.\n\
--version display version information and exit.\n\
\n\
-Email bug reports to bug-texinfo@prep.ai.mit.edu.\n", 224},
- {"%s: getwd: %s, %s\n", 225},
- {"Expected `%s'", 226},
- {"No `%s' found in `%s'", 227},
- {"%s: Skipping macro expansion to stdout as Info output is going there.\n", 228},
- {"Making %s file `%s' from `%s'.\n", 229},
- {"This is Info file %s, produced by Makeinfo version %d.%d", 230},
- {" from the input file %s.\n", 231},
+Email bug reports to bug-texinfo@gnu.org.\n", 227},
+ {"%s: getwd: %s, %s\n", 228},
+ {"Expected `%s'", 229},
+ {"No `%s' found in `%s'", 230},
+ {"%s: Skipping macro expansion to stdout as Info output is going there.\n", 231},
+ {"Making %s file `%s' from `%s'.\n", 232},
+ {"This is Info file %s, produced by Makeinfo version %d.%d", 233},
+ {" from the input file %s.\n", 234},
{"\
-%s: Removing macro output file `%s' due to errors; use --force to preserve.\n", 232},
- {"%s: Removing output file `%s' due to errors; use --force to preserve.\n", 233},
- {"Misplaced %c", 234},
- {"Unknown command `%s'", 235},
- {"NO_NAME!", 236},
- {"%c%s expected `{...}'", 237},
- {"Unmatched }", 238},
- {"%c%s missing close brace", 239},
- {"Broken-Type in insertion_type_pname", 240},
- {"Enumeration stack overflow", 241},
- {"lettering overflow, restarting at %c", 242},
- {"* Menu:\n", 243},
- {"%s requires an argument: the formatter for %citem", 244},
- {"`%cend' expected `%s', but saw `%s'", 245},
- {"No matching `%cend %s'", 246},
- {"How did @%s end up in cm_special_char?\n", 247},
- {"%c%s expects `i' or `j' as argument, not `%c'", 248},
- {"%c%s expects a single character `i' or `j' as argument", 249},
- {"January", 250},
- {"February", 251},
- {"March", 252},
- {"April", 253},
- {"May", 254},
- {"June", 255},
- {"July", 256},
- {"August", 257},
- {"September", 258},
- {"October", 259},
- {"November", 260},
- {"December", 261},
- {"%d %s %d", 262},
- {"%c%s expects a single character as an argument", 263},
- {"%c%s is obsolete", 264},
- {"There already is a node having %ctop as a section", 265},
- {"Here is the %ctop node", 266},
- {"%ctop used before %cnode, defaulting to %s", 267},
- {"%c%s is obsolete; use %c%s instead", 268},
- {"Node `%s' multiply defined (line %d is first definition at)", 269},
- {"Formatting node %s...\n", 270},
- {"Node `%s' requires a sectioning command (e.g. %c%s)", 271},
- {"Node `%s''s Next field not pointed back to", 272},
- {"This node (`%s') is the one with the bad `Prev'", 273},
- {"Node `%s's Prev field not pointed back to", 274},
- {"This node (`%s') has the bad Next", 275},
- {"Node `%s' missing Up field", 276},
- {"`%s' has an Up field of `%s', but `%s' has no menu item for `%s'", 277},
- {"node `%s' has been referenced %d times", 278},
- {"unreferenced node `%s'", 279},
- {"%s reference to nonexistent node `%s'", 280},
- {"%cmenu seen before first node", 281},
- {"creating `Top' node", 282},
- {"`.' or `,' must follow cross reference, not %c", 283},
- {"@image file `%s' unreadable: %s", 284},
- {"@image missing filename argument", 285},
- {"%s requires letter or digit", 286},
- {"Unmatched `%c%s'", 287},
- {"`%c%s' needs something after it", 288},
- {"Bad argument to `%s', `%s', using `%s'", 289},
- {"{No Value For \"%s\"}", 290},
- {"%c%s requires a name", 291},
- {"Reached eof before matching @end %s", 292},
- {"The `%c%s' command is meaningless within a `@%s' block", 293},
- {"%citemx is not meaningful inside of a `%s' block", 294},
- {"%c%s found outside of an insertion block", 295},
- {"Missing `}' in %cdef arg", 296},
- {"Function", 297},
- {"Macro", 298},
- {"Special Form", 299},
- {"Variable", 300},
- {"User Option", 301},
- {"Instance Variable", 302},
- {"Method", 303},
- {"Must be in a `%s' insertion in order to use `%s'x", 304},
- {"%csp requires a positive numeric argument", 305},
- {"asis", 306},
- {"none", 307},
- {"Bad argument to %c%s", 308},
- {"Unknown index `%s'", 309},
- {"Index `%s' already exists", 310},
- {"Unknown index `%s' and/or `%s' in @synindex", 311},
- {"Unknown index `%s' in @printindex", 312},
+%s: Removing macro output file `%s' due to errors; use --force to preserve.\n", 235},
+ {"%s: Removing output file `%s' due to errors; use --force to preserve.\n", 236},
+ {"Misplaced %c", 237},
+ {"Unknown command `%s'", 238},
+ {"NO_NAME!", 239},
+ {"%c%s expected `{...}'", 240},
+ {"Unmatched }", 241},
+ {"%c%s missing close brace", 242},
+ {"Broken-Type in insertion_type_pname", 243},
+ {"Enumeration stack overflow", 244},
+ {"lettering overflow, restarting at %c", 245},
+ {"* Menu:\n", 246},
+ {"%s requires an argument: the formatter for %citem", 247},
+ {"`%cend' expected `%s', but saw `%s'", 248},
+ {"No matching `%cend %s'", 249},
+ {"How did @%s end up in cm_special_char?\n", 250},
+ {"%c%s expects `i' or `j' as argument, not `%c'", 251},
+ {"%c%s expects a single character `i' or `j' as argument", 252},
+ {"January", 253},
+ {"February", 254},
+ {"March", 255},
+ {"April", 256},
+ {"May", 257},
+ {"June", 258},
+ {"July", 259},
+ {"August", 260},
+ {"September", 261},
+ {"October", 262},
+ {"November", 263},
+ {"December", 264},
+ {"%c%s expects a single character as an argument", 265},
+ {"%c%s is obsolete", 266},
+ {"Node with %ctop as a section already exists", 267},
+ {"Here is the %ctop node", 268},
+ {"%ctop used before %cnode, defaulting to %s", 269},
+ {"%c%s is obsolete; use %c%s instead", 270},
+ {"Node `%s' multiply defined (line %d is first definition at)", 271},
+ {"Formatting node %s...\n", 272},
+ {"Node `%s' requires a sectioning command (e.g. %c%s)", 273},
+ {"Node `%s''s Next field not pointed back to", 274},
+ {"This node (`%s') is the one with the bad `Prev'", 275},
+ {"Node `%s's Prev field not pointed back to", 276},
+ {"This node (`%s') has the bad Next", 277},
+ {"Node `%s' missing Up field", 278},
+ {"`%s' has an Up field of `%s', but `%s' has no menu item for `%s'", 279},
+ {"node `%s' has been referenced %d times", 280},
+ {"unreferenced node `%s'", 281},
+ {"%s reference to nonexistent node `%s'", 282},
+ {"%cmenu seen before first node", 283},
+ {"creating `Top' node", 284},
+ {"`.' or `,' must follow cross reference, not %c", 285},
+ {"@image file `%s' unreadable: %s", 286},
+ {"@image missing filename argument", 287},
+ {"%s requires letter or digit", 288},
+ {"Unmatched `%c%s'", 289},
+ {"`%c%s' needs something after it", 290},
+ {"Bad argument to `%s', `%s', using `%s'", 291},
+ {"{No Value For \"%s\"}", 292},
+ {"%c%s requires a name", 293},
+ {"Reached eof before matching @end %s", 294},
+ {"The `%c%s' command is meaningless within a `@%s' block", 295},
+ {"%citemx is not meaningful inside of a `%s' block", 296},
+ {"%c%s found outside of an insertion block", 297},
+ {"Missing `}' in %cdef arg", 298},
+ {"Function", 299},
+ {"Macro", 300},
+ {"Special Form", 301},
+ {"Variable", 302},
+ {"User Option", 303},
+ {"Instance Variable", 304},
+ {"Method", 305},
+ {"Must be in a `%s' insertion in order to use `%s'x", 306},
+ {"%csp requires a positive numeric argument", 307},
+ {"asis", 308},
+ {"none", 309},
+ {"Bad argument to %c%s", 310},
+ {"Unknown index `%s'", 311},
+ {"Index `%s' already exists", 312},
+ {"Unknown index `%s' and/or `%s' in @synindex", 313},
+ {"Unknown index `%s' in @printindex", 314},
{"\
* Menu:\n\
-\n", 313},
- {"`%c%s' needs an argument `{...}', not just `%s'", 314},
- {"No closing brace for footnote `%s'", 315},
- {"Footnote defined without parent node", 316},
- {"-Footnotes", 317},
+\n", 315},
+ {"`%c%s' needs an argument `{...}', not just `%s'", 316},
+ {"No closing brace for footnote `%s'", 317},
+ {"Footnote defined without parent node", 318},
+ {"-Footnotes", 319},
{"\
---------- Footnotes ----------\n\
-\n", 318},
- {"macro `%s' previously defined", 319},
- {"here is the previous definition of `%s'", 320},
- {"Macro `%s' called with too many args", 321},
- {"%cend macro not found", 322},
- {"%cquote-arg only useful when the macro takes a single argument", 323},
- {"ignoring stray text `%s' after @multitable", 324},
- {"Too many columns in multitable item (max %d)", 325},
- {"multitable item not in active multitable", 326},
- {"Cannot select column #%d in multitable", 327},
- {"ignoring @tab outside of multitable", 328},
- {"** Multicolumn output from last row:\n", 329},
- {"* column #%d: output = %s\n", 330},
- {"virtual memory exhausted", 331},
- {"%s: warning: ", 332},
- {" for %s", 333},
- {"\tTry `%s --help' for a complete list of options.\n", 334},
+\n", 320},
+ {"macro `%s' previously defined", 321},
+ {"here is the previous definition of `%s'", 322},
+ {"Macro `%s' called with too many args", 323},
+ {"%cend macro not found", 324},
+ {"%cquote-arg only useful when the macro takes a single argument", 325},
+ {"ignoring stray text `%s' after @multitable", 326},
+ {"Too many columns in multitable item (max %d)", 327},
+ {"multitable item not in active multitable", 328},
+ {"Cannot select column #%d in multitable", 329},
+ {"ignoring @tab outside of multitable", 330},
+ {"** Multicolumn output from last row:\n", 331},
+ {"* column #%d: output = %s\n", 332},
+ {"virtual memory exhausted", 333},
+ {"%s: warning: ", 334},
+ {" for %s", 335},
+ {"\tTry `%s --help' for a complete list of options.\n", 336},
{"\
-%s [OPTION]... [INFO-FILE [DIR-FILE]]\n\
- Install INFO-FILE in the Info directory file DIR-FILE.\n\
+Usage: %s [OPTION]... [INFO-FILE [DIR-FILE]]\n\
+\n\
+Install INFO-FILE in the Info directory file DIR-FILE.\n\
\n\
Options:\n\
--delete Delete existing entries in INFO-FILE;\n\
@@ -448,13 +453,13 @@ Options:\n\
from information in the Info file itself.\n\
--version Display version information and exit.\n\
\n\
-Email bug reports to bug-texinfo@prep.ai.mit.edu.\n", 335},
+Email bug reports to bug-texinfo@gnu.org.\n", 337},
{"\
This is the file .../info/dir, which contains the\n\
topmost node of the Info hierarchy, called (dir)Top.\n\
The first time you invoke Info you start off looking at this node.\n\
\n\
-File: dir Node: Top This is the top of the INFO tree\n\
+File: dir,\tNode: Top,\tThis is the top of the INFO tree\n\
\n\
This (the Directory node) gives a menu of major topics.\n\
Typing \"q\" exits, \"?\" lists all Info commands, \"d\" returns here,\n\
@@ -464,38 +469,37 @@ File: dir Node: Top This is the top of the INFO tree\n\
In Emacs, you can click mouse button 2 on a menu item or cross reference\n\
to select it.\n\
\n\
-* Menu:\n", 336},
- {"%s: could not read (%s) and could not create (%s)\n", 337},
- {"%s: Specify the Info directory only once.\n", 338},
- {"%s: Specify the Info file only once.\n", 339},
- {"install-info (GNU %s) %s\n", 340},
- {"excess command line argument `%s'", 341},
- {"No input file specified; try --help for more information.", 342},
- {"No dir file specified; try --help for more information.", 343},
- {"START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY", 344},
- {"END-INFO-DIR-ENTRY without matching START-INFO-DIR-ENTRY", 345},
- {"no info dir entry in `%s'", 346},
- {"menu item `%s' already exists, for file `%s'", 347},
- {"no entries found for `%s'; nothing deleted", 348},
- {"keep temporary files around after processing", 349},
- {"do not keep temporary files around after processing (default)", 350},
- {"send output to FILE", 351},
- {"display version information and exit", 352},
- {"display this help and exit", 353},
- {"Usage: %s [OPTION]... FILE...\n", 354},
- {"Generate a sorted index for each TeX output FILE.\n", 355},
- {"Usually FILE... is `foo.??' for a document `foo.texi'.\n", 356},
+* Menu:\n", 338},
+ {"%s: could not read (%s) and could not create (%s)\n", 339},
+ {"%s: Specify the Info directory only once.\n", 340},
+ {"%s: Specify the Info file only once.\n", 341},
+ {"excess command line argument `%s'", 342},
+ {"No input file specified; try --help for more information.", 343},
+ {"No dir file specified; try --help for more information.", 344},
+ {"START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY", 345},
+ {"END-INFO-DIR-ENTRY without matching START-INFO-DIR-ENTRY", 346},
+ {"no info dir entry in `%s'", 347},
+ {"menu item `%s' already exists, for file `%s'", 348},
+ {"no entries found for `%s'; nothing deleted", 349},
+ {"keep temporary files around after processing", 350},
+ {"do not keep temporary files around after processing (default)", 351},
+ {"send output to FILE", 352},
+ {"display version information and exit", 353},
+ {"display this help and exit", 354},
+ {"Usage: %s [OPTION]... FILE...\n", 355},
+ {"Generate a sorted index for each TeX output FILE.\n", 356},
+ {"Usually FILE... is `foo.??' for a document `foo.texi'.\n", 357},
{"\
\n\
-Options:\n", 357},
+Options:\n", 358},
{"\
\n\
-Email bug reports to bug-texinfo@prep.ai.mit.edu.", 358},
- {"texindex (GNU %s %s) 2.1\n", 359},
+Email bug reports to bug-texinfo@gnu.org.", 359},
{"%s: not a texinfo index file", 360},
{"failure reopening %s", 361},
{"entry %s follows an entry with a secondary name", 362},
{"%s; for file `%s'.\n", 363},
{"Virtual memory exhausted in %s ()! Needed %d bytes.", 364},
};
+
int _msg_tbl_length = 364;
diff --git a/gnu/usr.bin/texinfo/util/Makefile.am b/gnu/usr.bin/texinfo/util/Makefile.am
index 4326f08c0d4..c4e691329bb 100644
--- a/gnu/usr.bin/texinfo/util/Makefile.am
+++ b/gnu/usr.bin/texinfo/util/Makefile.am
@@ -1,5 +1,5 @@
## Makefile.am for texinfo/util.
-## $Id: Makefile.am,v 1.1 1997/08/01 22:01:03 kstailey Exp $
+## $Id: Makefile.am,v 1.2 1999/01/11 16:38:15 espie Exp $
## Run automake in .. to produce Makefile.in from this.
bin_PROGRAMS = install-info texindex
diff --git a/gnu/usr.bin/texinfo/util/gen-dir-node b/gnu/usr.bin/texinfo/util/gen-dir-node
index 09574f83a00..9d7c92b9bed 100644
--- a/gnu/usr.bin/texinfo/util/gen-dir-node
+++ b/gnu/usr.bin/texinfo/util/gen-dir-node
@@ -1,8 +1,8 @@
#!/bin/sh
-
+# $Id: gen-dir-node,v 1.2 1999/01/11 16:38:15 espie Exp $
# Generate the top-level Info node, given a directory of Info files
# and (optionally) a skeleton file. The output will be suitable for a
-# dir.info file. The skeleton file contains info topic names in the
+# top-level dir file. The skeleton file contains info topic names in the
# order they should appear in the output. There are three special
# lines that alter the behavior: a line consisting of just "--" causes
# the next line to be echoed verbatim to the output. A line
@@ -42,9 +42,9 @@ if [ ! -d ${INFODIR} ] ; then
exit 1
fi
-### output the dir.info header
+### output the dir header
echo "-*- Text -*-"
-echo "This file was generated automatically by the gen-dir-node script."
+echo "This file was generated automatically by $0."
echo "This version was generated on `date`"
echo "by `whoami`@`hostname` for `(cd ${INFODIR}; pwd)`"
@@ -164,9 +164,14 @@ else
fi
for file in ${infofiles}; do
+ case $file in
+ *.gz) zcat=zcat; file=`echo $file|sed 's/\.gz$//'`; gz=.gz;;
+ *) zcat=cat; gz=;;
+ esac
infoname=`echo $file | sed 's/\.info$//'`
- entry=`sed -e '1,/START-INFO-DIR-ENTRY/d' \
- -e '/END-INFO-DIR-ENTRY/,$d' ${INFODIR}/${file}`
+ entry=`$zcat ${INFODIR}/${file}$gz \
+ |sed -e '1,/START-INFO-DIR-ENTRY/d' \
+ -e '/END-INFO-DIR-ENTRY/,$d'`
if [ ! -z "${entry}" ] ; then
echo "${entry}"
@@ -174,4 +179,3 @@ for file in ${infofiles}; do
echo "* ${infoname}: (${file})."
fi
done
-
diff --git a/gnu/usr.bin/texinfo/util/install-info.c b/gnu/usr.bin/texinfo/util/install-info.c
index 1ff309f0fa9..9106ee7c698 100644
--- a/gnu/usr.bin/texinfo/util/install-info.c
+++ b/gnu/usr.bin/texinfo/util/install-info.c
@@ -1,7 +1,7 @@
/* install-info -- create Info directory entry(ies) for an Info file.
- $Id: install-info.c,v 1.4 1997/08/01 22:37:47 kstailey Exp $
+ $Id: install-info.c,v 1.5 1999/01/11 16:38:15 espie Exp $
- Copyright (C) 1996, 97 Free Software Foundation, Inc.
+ Copyright (C) 1996, 97, 98 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,6 +20,10 @@
#include "system.h"
#include <getopt.h>
+#ifdef HAVE_LIBZ
+#include <zlib.h>
+#endif
+
/* Name this program was invoked with. */
char *progname;
@@ -283,8 +287,9 @@ suggest_asking_for_help ()
void
print_help ()
{
- printf (_("%s [OPTION]... [INFO-FILE [DIR-FILE]]\n\
- Install INFO-FILE in the Info directory file DIR-FILE.\n\
+ printf (_("Usage: %s [OPTION]... [INFO-FILE [DIR-FILE]]\n\
+\n\
+Install INFO-FILE in the Info directory file DIR-FILE.\n\
\n\
Options:\n\
--delete Delete existing entries in INFO-FILE;\n\
@@ -312,12 +317,14 @@ Options:\n\
from information in the Info file itself.\n\
--version Display version information and exit.\n\
\n\
-Email bug reports to bug-texinfo@prep.ai.mit.edu.\n\
+Email bug reports to bug-texinfo@gnu.org.\n\
"), progname);
}
+
/* If DIRFILE does not exist, create a minimal one (or abort). If it
already exists, do nothing. */
+
void
ensure_dirfile_exists (dirfile)
char *dirfile;
@@ -335,7 +342,7 @@ ensure_dirfile_exists (dirfile)
topmost node of the Info hierarchy, called (dir)Top.\n\
The first time you invoke Info you start off looking at this node.\n\
\n\
-File: dir Node: Top This is the top of the INFO tree\n\
+File: dir,\tNode: Top,\tThis is the top of the INFO tree\n\
\n\
This (the Directory node) gives a menu of major topics.\n\
Typing \"q\" exits, \"?\" lists all Info commands, \"d\" returns here,\n\
@@ -368,19 +375,20 @@ File: dir Node: Top This is the top of the INFO tree\n\
struct option longopts[] =
{
- { "delete", no_argument, NULL, 'r' },
- { "dir-file", required_argument, NULL, 'd' },
- { "entry", required_argument, NULL, 'e' },
- { "help", no_argument, NULL, 'h' },
- { "info-dir", required_argument, NULL, 'D' },
- { "info-file", required_argument, NULL, 'i' },
- { "item", required_argument, NULL, 'e' },
- { "quiet", no_argument, NULL, 'q' },
- { "remove", no_argument, NULL, 'r' },
- { "section", required_argument, NULL, 's' },
- { "version", no_argument, NULL, 'V' },
+ { "delete", no_argument, NULL, 'r' },
+ { "dir-file", required_argument, NULL, 'd' },
+ { "entry", required_argument, NULL, 'e' },
+ { "help", no_argument, NULL, 'h' },
+ { "info-dir", required_argument, NULL, 'D' },
+ { "info-file", required_argument, NULL, 'i' },
+ { "item", required_argument, NULL, 'e' },
+ { "quiet", no_argument, NULL, 'q' },
+ { "remove", no_argument, NULL, 'r' },
+ { "section", required_argument, NULL, 's' },
+ { "version", no_argument, NULL, 'V' },
{ 0 }
};
+
int
main (argc, argv)
@@ -518,11 +526,12 @@ main (argc, argv)
break;
case 'V':
- printf (_("install-info (GNU %s) %s\n"), PACKAGE, VERSION);
-puts (_("Copyright (C) 1996 Free Software Foundation, Inc.\n\
+ printf ("install-info (GNU %s) %s\n", PACKAGE, VERSION);
+ printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\
-For more information about these matters, see the files named COPYING."));
+For more information about these matters, see the files named COPYING.\n"),
+ "1998");
exit (0);
default:
@@ -955,18 +964,49 @@ readfile (filename, sizep)
char *filename;
int *sizep;
{
+ int desc;
int data_size = 1024;
char *data = (char *) xmalloc (data_size);
int filled = 0;
int nread = 0;
+#ifdef HAVE_LIBZ
+ int isGZ = 0;
+ gzFile zdesc;
+#endif
- int desc = open (filename, O_RDONLY);
+ desc = open (filename, O_RDONLY);
if (desc < 0)
pfatal_with_name (filename);
+#ifdef HAVE_LIBZ
+ /* The file should always be two bytes long. */
+ if (read (desc, data, 2) != 2)
+ pfatal_with_name (filename);
+
+ /* Undo that read. */
+ lseek (desc, 0, SEEK_SET);
+
+ /* If we see gzip magic, use gzdopen. */
+ if (data[0] == '\x1f' && data[1] == '\x8b')
+ {
+ isGZ = 1;
+ zdesc = gzdopen (desc, "r");
+ if (zdesc == NULL) {
+ close (desc);
+ pfatal_with_name (filename);
+ }
+ }
+#endif /* HAVE_LIBZ */
+
while (1)
{
- nread = read (desc, data + filled, data_size - filled);
+#ifdef HAVE_LIBZ
+ if (isGZ)
+ nread = gzread (zdesc, data + filled, data_size - filled);
+ else
+#endif
+ nread = read (desc, data + filled, data_size - filled);
+
if (nread < 0)
pfatal_with_name (filename);
if (nread == 0)
@@ -981,6 +1021,14 @@ readfile (filename, sizep)
}
*sizep = filled;
+
+#ifdef HAVE_LIBZ
+ if (isGZ)
+ gzclose (zdesc);
+ else
+#endif
+ close(desc);
+
return data;
}
diff --git a/gnu/usr.bin/texinfo/util/texi2dvi b/gnu/usr.bin/texinfo/util/texi2dvi
index 480967cfebf..6f196887fdf 100644
--- a/gnu/usr.bin/texinfo/util/texi2dvi
+++ b/gnu/usr.bin/texinfo/util/texi2dvi
@@ -1,10 +1,9 @@
#! /bin/sh
# texi2dvi --- smartly produce DVI files from texinfo sources
-
-# Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
-
-# $Id: texi2dvi,v 1.1 1995/12/22 16:47:17 niklas Exp $
-
+# $Id: texi2dvi,v 1.2 1999/01/11 16:38:15 espie Exp $
+#
+# Copyright (C) 1992, 93, 94, 95, 96, 97, 98 Free Software Foundation, Inc.
+#
# This program is free software; you can 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)
@@ -19,65 +18,73 @@
# along with this program; if not, you can either send email to this
# program's maintainer or write to: The Free Software Foundation,
# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
-
+#
# Commentary:
-
-# Author: Noah Friedman <friedman@prep.ai.mit.edu>
-
-# Please send bug reports, etc. to bug-texinfo@prep.ai.mit.edu
+#
+# Author: Noah Friedman <friedman@gnu.org>
+#
+# Please send bug reports, etc. to bug-texinfo@gnu.org.
# If possible, please send a copy of the output of the script called with
# the `--debug' option when making a bug report.
-
+#
# In the interest of general portability, some common bourne shell
# constructs were avoided because they weren't guaranteed to be available
# in some earlier implementations. I've tried to make this program as
# portable as possible. Welcome to unix, where the lowest common
# denominator is rapidly diminishing.
#
-# Among the more interesting lossages I noticed with some bourne shells
-# are:
+# Among the more interesting lossages I noticed among Bourne shells:
# * No shell functions.
# * No `unset' builtin.
# * `shift' cannot take a numeric argument, and signals an error if
# there are no arguments to shift.
-
+#
# Code:
# Name by which this script was invoked.
progname=`echo "$0" | sed -e 's/[^\/]*\///g'`
# This string is expanded by rcs automatically when this file is checked out.
-rcs_revision='$Revision: 1.1 $'
+rcs_revision='$Revision: 1.2 $'
version=`set - $rcs_revision; echo $2`
# To prevent hairy quoting and escaping later.
bq='`'
eq="'"
-usage="Usage: $progname {options} [file1] {file2 {...}}
-(version $version)
+usage="Usage: $0 [OPTION]... FILE...
+Run a Texinfo document through TeX.
-Options are:
+Options:
+-b, --batch No interaction (\nonstopmode in TeX).
+-c, --clean Remove all auxiliary files.
-D, --debug Turn on shell debugging ($bq${bq}set -x$eq$eq).
--h, --help You're looking at it.
--v, --version Print version number.
+-t, --texinfo CMD Insert CMD after @setfilename before running TeX.
+--verbose Report on what is done.
+-h, --help Display this help and exit.
+-v, --version Display version information and exit.
-Arguments in brackets are required. Those in braces are optional.
-"
+The values of the TEX, TEXINDEX, and MAKEINFO environment variables are
+used to run those commands, if they are set.
+
+Email bug reports to bug-texinfo@gnu.org."
# Initialize variables.
# Don't use `unset' since old bourne shells don't have this command.
# Instead, assign them an empty value.
-# Some of these, like TEX and TEXINDEX, may be inherited from the environment
-backup_extension=.bak
+# Some of these, like TEX and TEXINDEX, may be inherited from the environment.
+backup_extension=.bak # these files get deleted if all goes well.
+batch=
+clean=
debug=
orig_pwd="`pwd`"
-verbose=
+textra=
+verbose=false
+makeinfo="${MAKEINFO-makeinfo}"
texindex="${TEXINDEX-texindex}"
tex="${TEX-tex}"
-# Save this so we can construct a new TEXINPUTS path for each file to be
-# processed.
+# Save this so we can construct a new TEXINPUTS path for each file.
TEXINPUTS_orig="$TEXINPUTS"
export TEXINPUTS
@@ -86,190 +93,270 @@ export TEXINPUTS
# It's a good idea to document the full long option name in each case.
# Long options which take arguments will need a `*' appended to the
# canonical name to match the value appended after the `=' character.
-while : ; do
- case $# in 0) break ;; esac
+while :; do
+ test $# -eq 0 && break
+
case "$1" in
- -D | --debug | --d* )
- debug=t
- shift
- ;;
- -h | --help | --h* )
- echo "$usage" 1>&2
- exit 0
- ;;
- -v | --version | --v* )
- echo "texi2dvi version $version" 1>&2
- exit 0
- ;;
+ -b | --batch | --b* ) batch=t; shift ;;
+ -c | --clean | --c* ) clean=t; shift ;;
+ -D | --debug | --d* ) debug=t; shift ;;
+ -h | --help | --h* ) echo "$usage"; exit 0 ;;
+ # OK, we should do real option parsing here, but be lazy for now.
+ -t | --texinfo | --t*) shift; textra="$textra $1"; shift ;;
+ -v | --vers* )
+ echo "$progname (GNU Texinfo 3.12) $version"
+ echo "Copyright (C) 1998 Free Software Foundation, Inc.
+There is NO warranty. You may redistribute this software
+under the terms of the GNU General Public License.
+For more information about these matters, see the files named COPYING."
+ exit 0 ;;
+ --verb* ) verbose=echo; shift ;;
-- ) # Stop option processing
shift
- break
- ;;
+ break ;;
-* )
case "$1" in
--*=* ) arg=`echo "$1" | sed -e 's/=.*//'` ;;
* ) arg="$1" ;;
esac
exec 1>&2
- echo "$progname: unknown or ambiguous option $bq$arg$eq"
- echo "$progname: Use $bq--help$eq for a list of options."
- exit 1
- ;;
- * )
- break
- ;;
+ echo "$progname: Unknown or ambiguous option $bq$arg$eq."
+ echo "$progname: Try $bq--help$eq for more information."
+ exit 1 ;;
+ * ) break ;;
esac
done
# See if there are any command line args left (which will be interpreted as
-# filename arguments)
-case $# in
- 0 )
- exec 1>&2
- echo "$progname: at least one file name is required as an argument."
- echo "$progname: Use $bq--help$eq for a description of command syntax."
- exit 2
- ;;
-esac
-
-case "$debug" in t ) set -x ;; esac
+# filename arguments).
+if test $# -eq 0; then
+ exec 1>&2
+ echo "$progname: At least one file name is required as an argument."
+ echo "$progname: Try $bq--help$eq for more information."
+ exit 2
+fi
+
+test "$debug" = t && set -x
# Texify files
-for command_line_filename in ${1+"$@"} ; do
- # Roughly equivalent to `dirname ...`, but more portable
- directory="`echo ${command_line_filename} | sed 's/\/[^\/]*$//'`"
- filename_texi="`basename ${command_line_filename}`"
- # Strip off the last extension part (probably .texinfo or .texi)
- filename_noext="`echo ${filename_texi} | sed 's/\.[^.]*$//'`"
-
- # If directory and file are the same, then it's probably because there's
- # no pathname component. Set dirname to `.', the current directory.
- if test "z${directory}" = "z${command_line_filename}" ; then
- directory="."
- fi
-
- # Source file might @include additional texinfo sources. Put `.' and
- # directory where source file(s) reside in TEXINPUTS before anything
- # else. `.' goes first to ensure that any old .aux, .cps, etc. files in
- # ${directory} don't get used in preference to fresher files in `.'.
- TEXINPUTS=".:${directory}:${TEXINPUTS_orig}"
-
- # "Unset" variables that might have values from previous iterations and
- # which won't be completely reset later.
- definite_index_files=""
-
- # See if file exists here. If it doesn't we're in trouble since, even
- # though the user may be able to reenter a valid filename at the tex
- # prompt (assuming they're attending the terminal), this script won't be
- # able to find the right index files and so forth.
- if test ! -r "${command_line_filename}" ; then
- echo "${progname}: ${command_line_filename}: No such file or permission denied." 1>&2
- continue;
- fi
-
- # Find all files having root filename with a two-letter extension,
- # determine whether they're really index files, and save them. Foo.aux
- # is actually the cross-references file, but we need to keep track of
- # that too.
- possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
- for this_file in ${possible_index_files} ; do
+for command_line_filename in ${1+"$@"}; do
+ $verbose "Processing $command_line_filename ..."
+
+ # See if file exists. If it doesn't we're in trouble since, even
+ # though the user may be able to reenter a valid filename at the tex
+ # prompt (assuming they're attending the terminal), this script won't
+ # be able to find the right index files and so forth.
+ if test ! -r "${command_line_filename}"; then
+ echo "$0: Could not read ${command_line_filename}." >&2
+ continue
+ fi
+
+ # Roughly equivalent to `dirname ...`, but more portable
+ directory="`echo ${command_line_filename} | sed 's/\/[^\/]*$//'`"
+ filename_texi="`basename ${command_line_filename}`"
+ # Strip off the last extension part (probably .texinfo or .texi)
+ filename_noext="`echo ${filename_texi} | sed 's/\.[^.]*$//'`"
+
+ # Use same basename since we want to generate aux files with the same
+ # basename as the manual. Use extension .texi for the temp file so
+ # that TeX will ignore it. Thus, we must use a subdirectory.
+ #
+ # Output the macro-expanded file to here. The vastly abbreviated
+ # temporary directory name is so we don't have collisions on 8.3 or
+ # 14-character filesystems.
+ tmp_dir=${TMPDIR-/tmp}/txi2d.$$
+ filename_tmp=$tmp_dir/$filename_noext.texi
+ # Output the file with the user's extra commands to here.
+ tmp_dir2=${tmp_dir}.2
+ filename_tmp2=$tmp_dir2/$filename_noext.texi
+ mkdir $tmp_dir $tmp_dir2
+ # Always remove the temporary directories.
+ trap "rm -rf $tmp_dir $tmp_dir2" 1 2 15
+
+ # If directory and file are the same, then it's probably because there's
+ # no pathname component. Set dirname to `.', the current directory.
+ if test "z${directory}" = "z${command_line_filename}"; then
+ directory=.
+ fi
+
+ # Source file might @include additional texinfo sources. Put `.' and
+ # directory where source file(s) reside in TEXINPUTS before anything
+ # else. `.' goes first to ensure that any old .aux, .cps, etc. files in
+ # ${directory} don't get used in preference to fresher files in `.'.
+ TEXINPUTS=".:${directory}:${TEXINPUTS_orig}"
+
+ # Expand macro commands in the original source file using Makeinfo;
+ # the macro syntax bfox implemented is impossible to implement in TeX.
+ # Always use `end' footnote style, since the `separate' style
+ # generates different output (arguably this is a bug in -E).
+ # Discard main info output, the user asked to run TeX, not makeinfo.
+ # Redirect output to /dev/null to throw away `Making info file...' msg.
+ $verbose "Macro-expanding $command_line_filename to $filename_tmp ..."
+ $makeinfo --footnote-style=end -E $filename_tmp -o /dev/null \
+ $command_line_filename >/dev/null
+
+ # But if there were no macros, or makeinfo failed for some reason,
+ # just use the original file. (It shouldn't make any difference, but
+ # let's be safe.)
+ if test $? -ne 0 || cmp -s $filename_tmp $command_line_filename; then
+ $verbose "Reverting to $command_line_filename ..."
+ cp -p $command_line_filename $filename_tmp
+ fi
+ filename_input=$filename_tmp
+ dirname_input=$tmp_dir
+
+ # Used most commonly for @finalout, @smallbook, etc.
+ if test -n "$textra"; then
+ $verbose "Inserting extra commands: $textra."
+ sed '/^@setfilename/a\
+'"$textra" $filename_input >$filename_tmp2
+ filename_input=$filename_tmp2
+ dirname_input=$tmp_dir2
+ fi
+
+ # If clean mode was specified, then move to the temporary directory.
+ if test "$clean" = t; then
+ $verbose "cd $dirname_input"
+ cd $dirname_input || exit 1
+ filename_input=`basename $filename_input`
+ fi
+
+ while true; do # will break out of loop below
+ # "Unset" variables that might have values from previous iterations and
+ # which won't be completely reset later.
+ definite_index_files=
+
+ # Find all files having root filename with a two-letter extension,
+ # determine whether they're really index files, and save them. Foo.aux
+ # is actually the cross-references file, but we need to keep track of
+ # that too.
+ possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
+ for this_file in ${possible_index_files}; do
# If file is empty, forget it.
- if test ! -s "${this_file}" ; then
- continue;
- fi
+ test -s "${this_file}" || continue
- # Examine first character of file. If it's not a backslash or
- # single quote, then it's definitely not an index or xref file.
+ # Examine first character of file. If it's not suitable to be an
+ # index or xref file, don't process it.
first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
- if test "${first_character}" = "\\" -o "${first_character}" = "'" ; then
- definite_index_files="${definite_index_files} ${this_file}"
+ if test "x${first_character}" = "x\\" \
+ || test "x${first_character}" = "x'"; then
+ definite_index_files="${definite_index_files} ${this_file}"
fi
- done
- orig_index_files="${definite_index_files}"
- orig_index_files_sans_aux="`echo ${definite_index_files} \
- | sed 's/'${filename_noext}'\.aux//;
- s/^[ ]*//;s/[ ]*$//;'`"
-
- # Now save copies of original index files so we have some means of
- # comparison later.
- for index_file_to_save in ${orig_index_files} ; do
- cp "${index_file_to_save}" "${index_file_to_save}${backup_extension}"
- done
-
- # Run texindex on current index files. If they already exist, and
- # after running TeX a first time the index files don't change, then
- # there's no reason to run TeX again. But we won't know that if the
- # index files are out of date or nonexistent.
- if test "${orig_index_files_sans_aux}" ; then
+ done
+ orig_index_files="${definite_index_files}"
+ orig_index_files_sans_aux="`echo ${definite_index_files} \
+ | sed 's/'${filename_noext}'\.aux//;
+ s/^[ ]*//;s/[ ]*$//;'`"
+
+ # Now save copies of original index files so we have some means of
+ # comparison later.
+ $verbose "Backing up current index files: $orig_index_files ..."
+ for index_file_to_save in ${orig_index_files}; do
+ cp "${index_file_to_save}" "${index_file_to_save}${backup_extension}"
+ done
+
+ # Run texindex on current index files. If they already exist, and
+ # after running TeX a first time the index files don't change, then
+ # there's no reason to run TeX again. But we won't know that if the
+ # index files are out of date or nonexistent.
+ if test -n "${orig_index_files_sans_aux}"; then
+ $verbose "Running $texindex $orig_index_files_sans_aux ..."
${texindex} ${orig_index_files_sans_aux}
- fi
-
- if ${tex} ${command_line_filename} ; then # TeX run first time
- definite_index_files=""
- # Get list of new index files
- possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
- for this_file in ${possible_index_files} ; do
- # If file is empty, forget it.
- if test ! -s ${this_file} ; then
- continue;
- fi
-
- # Examine first character of file. If it's not a backslash or
- # single quote, then it's definitely not an index or xref file.
- first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
- if test "${first_character}" = "\\" -o "${first_character}" = "'" ; then
- definite_index_files="${definite_index_files} ${this_file}"
- fi
+ fi
+
+ # Finally, run TeX.
+ if test "$batch" = t; then
+ tex_mode='\nonstopmode'
+ else
+ tex_mode=
+ fi
+ $verbose "Running $tex $filename_input ..."
+ cmd="$tex $tex_mode \\input $filename_input"
+ $cmd
+
+ # Check if index files changed.
+ #
+ definite_index_files=
+ # Get list of new index files.
+ possible_index_files="`eval echo ${filename_noext}.?? ${filename_noext}.aux`"
+ for this_file in ${possible_index_files}; do
+ # If file is empty, forget it.
+ test -s "${this_file}" || continue
+
+ # Examine first character of file. If it's not a backslash or
+ # single quote, then it's definitely not an index or xref file.
+ # (Will have to check for @ when we switch to Texinfo syntax in
+ # all these files...)
+ first_character="`sed -n '1s/^\(.\).*$/\1/p;q' ${this_file}`"
+ if test "x${first_character}" = "x\\" \
+ || test "x${first_character}" = "x'"; then
+ definite_index_files="${definite_index_files} ${this_file}"
+ fi
+ done
+ new_index_files="${definite_index_files}"
+ new_index_files_sans_aux="`echo ${definite_index_files} \
+ | sed 's/'${filename_noext}'\.aux//;
+ s/^[ ]*//;s/[ ]*$//;'`"
+
+ # If old and new list don't at least have the same file list, then one
+ # file or another has definitely changed.
+ $verbose "Original index files =$orig_index_files"
+ $verbose "New index files =$new_index_files"
+ if test "z${orig_index_files}" != "z${new_index_files}"; then
+ index_files_changed_p=t
+ else
+ # File list is the same. We must compare each file until we find a
+ # difference.
+ index_files_changed_p=
+ for this_file in ${new_index_files}; do
+ $verbose "Comparing index file $this_file ..."
+ # cmp -s will return nonzero exit status if files differ.
+ cmp -s "${this_file}" "${this_file}${backup_extension}"
+ if test $? -ne 0; then
+ # We only need to keep comparing until we find *one* that
+ # differs, because we'll have to run texindex & tex no
+ # matter what.
+ index_files_changed_p=t
+ $verbose "Index file $this_file differed:"
+ test $verbose = echo \
+ && diff -c "${this_file}${backup_extension}" "${this_file}"
+ break
+ fi
done
- new_index_files="${definite_index_files}"
- new_index_files_sans_aux="`echo ${definite_index_files} \
- | sed 's/'${filename_noext}'\.aux//;
- s/^[ ]*//;s/[ ]*$//;'`"
-
- # If old and new list don't at least have the same file list, then one
- # file or another has definitely changed.
- if test "${orig_index_files}" != "${new_index_files}" ; then
- index_files_changed_p=t
- else
- # File list is the same. We must compare each file until we find a
- # difference.
- index_files_changed_p=""
- for this_file in ${new_index_files} ; do
- # cmp -s will return nonzero exit status if files differ.
- cmp -s "${this_file}" "${this_file}${backup_extension}"
- if test $? -ne 0 ; then
- # We only need to keep comparing until we find *one* that
- # differs, because we'll have to run texindex & tex no
- # matter what.
- index_files_changed_p=t
- break
- fi
- done
- fi
+ fi
- # If index files have changed since TeX has been run, or if the aux
- # file wasn't present originally, run texindex and TeX again.
- if test "${index_files_changed_p}" ; then
- retval=0
- if test "${new_index_files_sans_aux}" ; then
- ${texindex} ${new_index_files_sans_aux}
- retval=$?
- fi
- if test ${retval} -eq 0 ; then
- ${tex} "${command_line_filename}"
- fi
- fi
- fi
-
- # Generate list of files to delete, then call rm once with the entire
- # list. This is significantly faster than multiple executions of rm.
- file_list=""
- for file in ${orig_index_files} ; do
- file_list="${file_list} ${file}${backup_extension}"
- done
- if test "${file_list}" ; then
- rm -f ${file_list}
- fi
+ # If index files have changed since TeX has been run, or if the aux
+ # file wasn't present originally, run texindex and TeX again.
+ if test "${index_files_changed_p}"; then :; else
+ # Nothing changed. We're done with TeX.
+ break
+ fi
+ done
+
+ # If we were in clean mode, compilation was in a tmp directory.
+ # Copy the DVI file into the directory where the compilation
+ # has been done. (The temp dir is about to get removed anyway.)
+ # We also return to the original directory so that
+ # - the next file is processed in correct conditions
+ # - the temporary file can be removed
+ if test -n "$clean"; then
+ $verbose "Copying DVI file from `pwd` to $orig_pwd"
+ cp -p $filename_noext.dvi $orig_pwd
+ cd $orig_pwd || exit 1
+ fi
+
+ # Generate list of files to delete, then call rm once with the entire
+ # list. This is significantly faster than multiple executions of rm.
+ file_list=
+ for file in ${orig_index_files}; do
+ file_list="${file_list} ${file}${backup_extension}"
+ done
+ if test -n "${file_list}"; then
+ $verbose "Removing $file_list $tmp_dir $tmp_dir2 ..."
+ rm -f ${file_list}
+ rm -rf $tmp_dir $tmp_dir2
+ fi
done
-# texi2dvi ends here
+$verbose "$0 done."
+true # exit successfully.
diff --git a/gnu/usr.bin/texinfo/util/texindex.c b/gnu/usr.bin/texinfo/util/texindex.c
index f9a3003dc3b..b1017555ee4 100644
--- a/gnu/usr.bin/texinfo/util/texindex.c
+++ b/gnu/usr.bin/texinfo/util/texindex.c
@@ -1,8 +1,7 @@
/* Prepare TeX index dribble output into an actual index.
+ $Id: texindex.c,v 1.2 1999/01/11 16:38:15 espie Exp $
- Version 1.45
-
- Copyright (C) 1987, 1991, 1992 Free Software Foundation, Inc.
+ Copyright (C) 1987, 91, 92, 96, 97, 98 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,14 +16,9 @@
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. */
-
-
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-#include "getopt.h"
-#define TEXINDEX_VERSION_STRING "GNU Texindex 2.0 for Texinfo release 3.4"
+#include "system.h"
+#include <getopt.h>
#if defined (emacs)
# include "../src/config.h"
@@ -35,26 +29,6 @@
# undef open
#endif
-#if defined (HAVE_STRING_H)
-# include <string.h>
-#endif /* HAVE_STRING_H */
-
-#if !defined (HAVE_STRCHR)
-char *strrchr ();
-#endif /* !HAVE_STRCHR */
-
-#if defined (STDC_HEADERS)
-# include <stdlib.h>
-#else /* !STDC_HEADERS */
-char *getenv (), *malloc (), *realloc ();
-#endif /* !STDC_HEADERS */
-
-#if defined (HAVE_UNISTD_H)
-# include <unistd.h>
-#else /* !HAVE_UNISTD_H */
-off_t lseek ();
-#endif /* !HAVE_UNISTD_H */
-
#if !defined (HAVE_MEMSET)
#undef memset
#define memset(ptr, ignore, count) bzero (ptr, count)
@@ -69,18 +43,6 @@ char *mktemp ();
# define TI_FATAL_ERROR ((1 << 28) | 4)
# define unlink delete
#else /* !VMS */
-# if defined (HAVE_SYS_FCNTL_H)
-# include <sys/types.h>
-# include <sys/fcntl.h>
-# endif /* HAVE_SYS_FCNTL_H */
-
-# if defined (_AIX) || !defined (_POSIX_VERSION)
-# include <sys/file.h>
-# else /* !AIX && _POSIX_VERSION */
-# if !defined (HAVE_SYS_FCNTL_H)
-# include <fcntl.h>
-# endif /* !HAVE_FCNTL_H */
-# endif /* !_AIX && _POSIX_VERSION */
# define TI_NO_ERROR 0
# define TI_FATAL_ERROR 1
#endif /* !VMS */
@@ -91,36 +53,31 @@ char *mktemp ();
# define SEEK_END 2
#endif /* !SEEK_SET */
-#if !defined (errno)
-extern int errno;
-#endif
-char *strerror ();
-
/* When sorting in core, this structure describes one line
and the position and length of its first keyfield. */
struct lineinfo
{
- char *text; /* The actual text of the line. */
+ char *text; /* The actual text of the line. */
union {
- char *text; /* The start of the key (for textual comparison). */
- long number; /* The numeric value (for numeric comparison). */
+ char *text; /* The start of the key (for textual comparison). */
+ long number; /* The numeric value (for numeric comparison). */
} key;
- long keylen; /* Length of KEY field. */
+ long keylen; /* Length of KEY field. */
};
/* This structure describes a field to use as a sort key. */
struct keyfield
{
- int startwords; /* Number of words to skip. */
- int startchars; /* Number of additional chars to skip. */
- int endwords; /* Number of words to ignore at end. */
- int endchars; /* Ditto for characters of last word. */
- char ignore_blanks; /* Non-zero means ignore spaces and tabs. */
- char fold_case; /* Non-zero means case doesn't matter. */
- char reverse; /* Non-zero means compare in reverse order. */
- char numeric; /* Non-zeros means field is ASCII numeric. */
- char positional; /* Sort according to file position. */
- char braced; /* Count balanced-braced groupings as fields. */
+ int startwords; /* Number of words to skip. */
+ int startchars; /* Number of additional chars to skip. */
+ int endwords; /* Number of words to ignore at end. */
+ int endchars; /* Ditto for characters of last word. */
+ char ignore_blanks; /* Non-zero means ignore spaces and tabs. */
+ char fold_case; /* Non-zero means case doesn't matter. */
+ char reverse; /* Non-zero means compare in reverse order. */
+ char numeric; /* Non-zeros means field is ASCII numeric. */
+ char positional; /* Sort according to file position. */
+ char braced; /* Count balanced-braced groupings as fields. */
};
/* Vector of keyfields to use. */
@@ -198,7 +155,7 @@ char *tempcopy ();
#define MAX_IN_CORE_SORT 500000
-void
+int
main (argc, argv)
int argc;
char **argv;
@@ -214,6 +171,15 @@ main (argc, argv)
else
program_name = argv[0];
+#ifdef HAVE_SETLOCALE
+ /* Set locale via LC_ALL. */
+ setlocale (LC_ALL, "");
+#endif
+
+ /* Set the text message domain. */
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
/* Describe the kind of sorting to do. */
/* The first keyfield uses the first braced field and folds case. */
keyfields[0].braced = 1;
@@ -247,7 +213,7 @@ main (argc, argv)
desc = open (infiles[i], O_RDONLY, 0);
if (desc < 0)
- pfatal_with_name (infiles[i]);
+ pfatal_with_name (infiles[i]);
lseek (desc, (off_t) 0, SEEK_END);
ptr = (long) lseek (desc, (off_t) 0, SEEK_CUR);
@@ -255,19 +221,21 @@ main (argc, argv)
outfile = outfiles[i];
if (!outfile)
- {
- outfile = concat (infiles[i], "s", "");
- }
+ {
+ outfile = concat (infiles[i], "s", "");
+ }
if (ptr < MAX_IN_CORE_SORT)
- /* Sort a small amount of data. */
- sort_in_core (infiles[i], ptr, outfile);
+ /* Sort a small amount of data. */
+ sort_in_core (infiles[i], ptr, outfile);
else
- sort_offline (infiles[i], ptr, outfile);
+ sort_offline (infiles[i], ptr, outfile);
}
flush_tempfiles (tempcount);
exit (TI_NO_ERROR);
+
+ return 0; /* Avoid bogus warnings. */
}
typedef struct
@@ -282,14 +250,15 @@ typedef struct
TEXINDEX_OPTION texindex_options[] = {
{ "--keep", "-k", &keep_tempfiles, 1, (char *)NULL,
- "Keep temporary files around after processing" },
+ N_("keep temporary files around after processing") },
{ "--no-keep", 0, &keep_tempfiles, 0, (char *)NULL,
- "Do not keep temporary files around after processing (default)" },
+ N_("do not keep temporary files around after processing (default)") },
{ "--output", "-o", (int *)NULL, 0, "FILE",
- "Send output to FILE" },
+ N_("send output to FILE") },
{ "--version", (char *)NULL, (int *)NULL, 0, (char *)NULL,
- "Show version information" },
- { "--help", "-h", (int *)NULL, 0, (char *)NULL, "Produce this listing" },
+ N_("display version information and exit") },
+ { "--help", "-h", (int *)NULL, 0, (char *)NULL,
+ N_("display this help and exit") },
{ (char *)NULL, (char *)NULL, (int *)NULL, 0, (char *)NULL }
};
@@ -298,26 +267,28 @@ usage (result_value)
int result_value;
{
register int i;
+ FILE *f = result_value ? stderr : stdout;
- fprintf (stderr, "Usage: %s [OPTIONS] FILE...\n", program_name);
- fprintf (stderr, " Generate a permuted index for the TeX files given.\n");
- fprintf (stderr, " Usually FILE... is `foo.??' for the source file `foo.tex'.\n");
- fprintf (stderr, " The OPTIONS are:\n");
+ fprintf (f, _("Usage: %s [OPTION]... FILE...\n"), program_name);
+ fprintf (f, _("Generate a sorted index for each TeX output FILE.\n"));
+ /* Avoid trigraph nonsense. */
+ fprintf (f, _("Usually FILE... is `foo.??\' for a document `foo.texi'.\n"));
+ fprintf (f, _("\nOptions:\n"));
for (i = 0; texindex_options[i].long_name; i++)
{
- fprintf (stderr, " %s %s",
- texindex_options[i].long_name,
- texindex_options[i].arg_name ?
- texindex_options[i].arg_name : "");
-
if (texindex_options[i].short_name)
- fprintf (stderr, " \n or %s %s",
- texindex_options[i].short_name,
- texindex_options[i].arg_name ?
- texindex_options[i].arg_name : "");
- fprintf (stderr, "\t%s\n", texindex_options[i].doc_string);
+ fprintf (f, "%s, ", texindex_options[i].short_name);
+
+ fprintf (f, "%s %s",
+ texindex_options[i].long_name,
+ texindex_options[i].arg_name
+ ? texindex_options[i].arg_name : "");
+
+ fprintf (f, "\t%s\n", _(texindex_options[i].doc_string));
}
+ puts (_("\nEmail bug reports to bug-texinfo@gnu.org."));
+
exit (result_value);
}
@@ -330,7 +301,6 @@ decode_command (argc, argv)
char **argv;
{
int arg_index = 1;
- int optc;
char **ip;
char **op;
@@ -361,42 +331,47 @@ decode_command (argc, argv)
char *arg = argv[arg_index++];
if (*arg == '-')
- {
- if (strcmp (arg, "--version") == 0)
- {
- fprintf (stderr, "%s\n", TEXINDEX_VERSION_STRING);
- exit (0);
- }
- else if ((strcmp (arg, "--keep") == 0) ||
- (strcmp (arg, "-k") == 0))
- {
- keep_tempfiles = 1;
- }
- else if ((strcmp (arg, "--help") == 0) ||
- (strcmp (arg, "-h") == 0))
- {
- usage (0);
- }
- else if ((strcmp (arg, "--output") == 0) ||
- (strcmp (arg, "-o") == 0))
- {
- if (argv[arg_index] != (char *)NULL)
- {
- arg_index++;
- if (op > outfiles)
- *(op - 1) = argv[arg_index];
- }
- else
- usage (1);
- }
- else
- usage (1);
- }
+ {
+ if (strcmp (arg, "--version") == 0)
+ {
+ printf ("texindex (GNU %s) %s\n", PACKAGE, VERSION);
+ printf (_("Copyright (C) %s Free Software Foundation, Inc.\n\
+There is NO warranty. You may redistribute this software\n\
+under the terms of the GNU General Public License.\n\
+For more information about these matters, see the files named COPYING.\n"),
+ "1998");
+ exit (0);
+ }
+ else if ((strcmp (arg, "--keep") == 0) ||
+ (strcmp (arg, "-k") == 0))
+ {
+ keep_tempfiles = 1;
+ }
+ else if ((strcmp (arg, "--help") == 0) ||
+ (strcmp (arg, "-h") == 0))
+ {
+ usage (0);
+ }
+ else if ((strcmp (arg, "--output") == 0) ||
+ (strcmp (arg, "-o") == 0))
+ {
+ if (argv[arg_index] != (char *)NULL)
+ {
+ arg_index++;
+ if (op > outfiles)
+ *(op - 1) = argv[arg_index];
+ }
+ else
+ usage (1);
+ }
+ else
+ usage (1);
+ }
else
- {
- *ip++ = arg;
- *op++ = (char *)NULL;
- }
+ {
+ *ip++ = arg;
+ *op++ = (char *)NULL;
+ }
}
/* Record number of keyfields and terminate list of filenames. */
@@ -452,7 +427,7 @@ tempcopy (idesc)
int nread = read (idesc, buffer, BUFSIZE);
write (odesc, buffer, nread);
if (!nread)
- break;
+ break;
}
close (odesc);
@@ -478,16 +453,16 @@ compare_full (line1, line2)
char *start1 = find_field (&keyfields[i], *line1, &length1);
char *start2 = find_field (&keyfields[i], *line2, &length2);
int tem = compare_field (&keyfields[i], start1, length1, *line1 - text_base,
- start2, length2, *line2 - text_base);
+ start2, length2, *line2 - text_base);
if (tem)
- {
- if (keyfields[i].reverse)
- return -tem;
- return tem;
- }
+ {
+ if (keyfields[i].reverse)
+ return -tem;
+ return tem;
+ }
}
- return 0; /* Lines match exactly. */
+ return 0; /* Lines match exactly. */
}
/* Compare LINE1 and LINE2, described by structures
@@ -507,19 +482,19 @@ compare_prepared (line1, line2)
if (keyfields->positional)
{
if (line1->text - text_base > line2->text - text_base)
- tem = 1;
+ tem = 1;
else
- tem = -1;
+ tem = -1;
}
else if (keyfields->numeric)
tem = line1->key.number - line2->key.number;
else
tem = compare_field (keyfields, line1->key.text, line1->keylen, 0,
- line2->key.text, line2->keylen, 0);
+ line2->key.text, line2->keylen, 0);
if (tem)
{
if (keyfields->reverse)
- return -tem;
+ return -tem;
return tem;
}
@@ -536,16 +511,16 @@ compare_prepared (line1, line2)
char *start1 = find_field (&keyfields[i], text1, &length1);
char *start2 = find_field (&keyfields[i], text2, &length2);
int tem = compare_field (&keyfields[i], start1, length1, text1 - text_base,
- start2, length2, text2 - text_base);
+ start2, length2, text2 - text_base);
if (tem)
- {
- if (keyfields[i].reverse)
- return -tem;
- return tem;
- }
+ {
+ if (keyfields[i].reverse)
+ return -tem;
+ return tem;
+ }
}
- return 0; /* Lines match exactly. */
+ return 0; /* Lines match exactly. */
}
/* Like compare_full but more general.
@@ -571,16 +546,16 @@ compare_general (str1, str2, pos1, pos2, use_keyfields)
char *start1 = find_field (&keyfields[i], str1, &length1);
char *start2 = find_field (&keyfields[i], str2, &length2);
int tem = compare_field (&keyfields[i], start1, length1, pos1,
- start2, length2, pos2);
+ start2, length2, pos2);
if (tem)
- {
- if (keyfields[i].reverse)
- return -tem;
- return tem;
- }
+ {
+ if (keyfields[i].reverse)
+ return -tem;
+ return tem;
+ }
}
- return 0; /* Lines match exactly. */
+ return 0; /* Lines match exactly. */
}
/* Find the start and length of a field in STR according to KEYFIELD.
@@ -603,23 +578,23 @@ find_field (keyfield, str, lengthptr)
fun = find_pos;
start = (*fun) (str, keyfield->startwords, keyfield->startchars,
- keyfield->ignore_blanks);
+ keyfield->ignore_blanks);
if (keyfield->endwords < 0)
{
if (keyfield->braced)
- end = find_braced_end (start);
+ end = find_braced_end (start);
else
- {
- end = start;
- while (*end && *end != '\n')
- end++;
- }
+ {
+ end = start;
+ while (*end && *end != '\n')
+ end++;
+ }
}
else
{
end = (*fun) (str, keyfield->endwords, keyfield->endchars, 0);
if (end - str < start - str)
- end = start;
+ end = start;
}
*lengthptr = end - start;
return start;
@@ -644,11 +619,11 @@ find_pos (str, words, chars, ignore_blanks)
char c;
/* Find next bunch of nonblanks and skip them. */
while ((c = *p) == ' ' || c == '\t')
- p++;
+ p++;
while ((c = *p) && c != '\n' && !(c == ' ' || c == '\t'))
- p++;
+ p++;
if (!*p || *p == '\n')
- return p;
+ return p;
}
while (*p == ' ' || *p == '\t')
@@ -657,7 +632,7 @@ find_pos (str, words, chars, ignore_blanks)
for (i = 0; i < chars; i++)
{
if (!*p || *p == '\n')
- break;
+ break;
p++;
}
return p;
@@ -681,19 +656,19 @@ find_braced_pos (str, words, chars, ignore_blanks)
{
bracelevel = 1;
while ((c = *p++) != '{' && c != '\n' && c)
- /* Do nothing. */ ;
+ /* Do nothing. */ ;
if (c != '{')
- return p - 1;
+ return p - 1;
while (bracelevel)
- {
- c = *p++;
- if (c == '{')
- bracelevel++;
- if (c == '}')
- bracelevel--;
- if (c == 0 || c == '\n')
- return p - 1;
- }
+ {
+ c = *p++;
+ if (c == '{')
+ bracelevel++;
+ if (c == '}')
+ bracelevel--;
+ if (c == 0 || c == '\n')
+ return p - 1;
+ }
}
while ((c = *p++) != '{' && c != '\n' && c)
@@ -709,7 +684,7 @@ find_braced_pos (str, words, chars, ignore_blanks)
for (i = 0; i < chars; i++)
{
if (!*p || *p == '\n')
- break;
+ break;
p++;
}
return p;
@@ -731,11 +706,11 @@ find_braced_end (str)
{
c = *p++;
if (c == '{')
- bracelevel++;
+ bracelevel++;
if (c == '}')
- bracelevel--;
+ bracelevel--;
if (c == 0 || c == '\n')
- return p - 1;
+ return p - 1;
}
return p - 1;
}
@@ -748,7 +723,7 @@ find_value (start, length)
while (length != 0L)
{
if (isdigit (*start))
- return atol (start);
+ return atol (start);
length--;
start++;
}
@@ -794,17 +769,17 @@ compare_field (keyfield, start1, length1, pos1, start2, length2, pos2)
if (keyfields->positional)
{
if (pos1 > pos2)
- return 1;
+ return 1;
else
- return -1;
+ return -1;
}
if (keyfield->numeric)
{
long value = find_value (start1, length1) - find_value (start2, length2);
if (value > 0)
- return 1;
+ return 1;
if (value < 0)
- return -1;
+ return -1;
return 0;
}
else
@@ -815,46 +790,46 @@ compare_field (keyfield, start1, length1, pos1, start2, length2, pos2)
char *e2 = start2 + length2;
while (1)
- {
- int c1, c2;
-
- if (p1 == e1)
- c1 = 0;
- else
- c1 = *p1++;
- if (p2 == e2)
- c2 = 0;
- else
- c2 = *p2++;
-
- if (char_order[c1] != char_order[c2])
- return char_order[c1] - char_order[c2];
- if (!c1)
- break;
- }
+ {
+ int c1, c2;
+
+ if (p1 == e1)
+ c1 = 0;
+ else
+ c1 = *p1++;
+ if (p2 == e2)
+ c2 = 0;
+ else
+ c2 = *p2++;
+
+ if (char_order[c1] != char_order[c2])
+ return char_order[c1] - char_order[c2];
+ if (!c1)
+ break;
+ }
/* Strings are equal except possibly for case. */
p1 = start1;
p2 = start2;
while (1)
- {
- int c1, c2;
-
- if (p1 == e1)
- c1 = 0;
- else
- c1 = *p1++;
- if (p2 == e2)
- c2 = 0;
- else
- c2 = *p2++;
-
- if (c1 != c2)
- /* Reverse sign here so upper case comes out last. */
- return c2 - c1;
- if (!c1)
- break;
- }
+ {
+ int c1, c2;
+
+ if (p1 == e1)
+ c1 = 0;
+ else
+ c1 = *p1++;
+ if (p2 == e2)
+ c2 = 0;
+ else
+ c2 = *p2++;
+
+ if (c1 != c2)
+ /* Reverse sign here so upper case comes out last. */
+ return c2 - c1;
+ if (!c1)
+ break;
+ }
return 0;
}
@@ -896,17 +871,17 @@ readline (linebuffer, stream)
{
int c = getc (stream);
if (p == end)
- {
- buffer = (char *) xrealloc (buffer, linebuffer->size *= 2);
- p += buffer - linebuffer->buffer;
- end += buffer - linebuffer->buffer;
- linebuffer->buffer = buffer;
- }
+ {
+ buffer = (char *) xrealloc (buffer, linebuffer->size *= 2);
+ p += buffer - linebuffer->buffer;
+ end += buffer - linebuffer->buffer;
+ linebuffer->buffer = buffer;
+ }
if (c < 0 || c == '\n')
- {
- *p = 0;
- break;
- }
+ {
+ *p = 0;
+ break;
+ }
*p++ = c;
}
@@ -939,7 +914,7 @@ sort_offline (infile, nfiles, total, outfile)
if (lb.buffer[0] != '\\' && lb.buffer[0] != '@')
{
- error ("%s: not a texinfo index file", infile);
+ error (_("%s: not a texinfo index file"), infile);
return;
}
@@ -953,34 +928,34 @@ sort_offline (infile, nfiles, total, outfile)
long tempsize = 0;
if (!ostream)
- pfatal_with_name (outname);
+ pfatal_with_name (outname);
tempfiles[i] = outname;
/* Copy lines into this temp file as long as it does not make file
- "too big" or until there are no more lines. */
+ "too big" or until there are no more lines. */
while (tempsize + linelength + 1 <= MAX_IN_CORE_SORT)
- {
- tempsize += linelength + 1;
- fputs (lb.buffer, ostream);
- putc ('\n', ostream);
-
- /* Read another line of input data. */
-
- linelength = readline (&lb, istream);
- if (!linelength && feof (istream))
- break;
-
- if (lb.buffer[0] != '\\' && lb.buffer[0] != '@')
- {
- error ("%s: not a texinfo index file", infile);
- failure = 1;
- goto fail;
- }
- }
+ {
+ tempsize += linelength + 1;
+ fputs (lb.buffer, ostream);
+ putc ('\n', ostream);
+
+ /* Read another line of input data. */
+
+ linelength = readline (&lb, istream);
+ if (!linelength && feof (istream))
+ break;
+
+ if (lb.buffer[0] != '\\' && lb.buffer[0] != '@')
+ {
+ error (_("%s: not a texinfo index file"), infile);
+ failure = 1;
+ goto fail;
+ }
+ }
fclose (ostream);
if (feof (istream))
- break;
+ break;
}
free (lb.buffer);
@@ -999,7 +974,7 @@ fail:
char *newtemp = maketempname (++tempcount);
sort_in_core (&tempfiles[i], MAX_IN_CORE_SORT, newtemp);
if (!keep_tempfiles)
- unlink (tempfiles[i]);
+ unlink (tempfiles[i]);
tempfiles[i] = newtemp;
}
@@ -1034,12 +1009,12 @@ sort_in_core (infile, total, outfile)
int desc = open (infile, O_RDONLY, 0);
if (desc < 0)
- fatal ("failure reopening %s", infile);
+ fatal (_("failure reopening %s"), infile);
for (file_size = 0;;)
{
i = read (desc, data + file_size, total - file_size);
if (i <= 0)
- break;
+ break;
file_size += i;
}
file_data = data;
@@ -1049,7 +1024,7 @@ sort_in_core (infile, total, outfile)
if (file_size > 0 && data[0] != '\\' && data[0] != '@')
{
- error ("%s: not a texinfo index file", infile);
+ error (_("%s: not a texinfo index file"), infile);
return;
}
@@ -1077,7 +1052,7 @@ sort_in_core (infile, total, outfile)
nextline = parsefile (infile, nextline, file_data, file_size);
if (nextline == 0)
{
- error ("%s: not a texinfo index file", infile);
+ error (_("%s: not a texinfo index file"), infile);
return;
}
@@ -1095,17 +1070,18 @@ sort_in_core (infile, total, outfile)
char **p;
for (lp = lineinfo, p = linearray; p != nextline; lp++, p++)
- {
- lp->text = *p;
- lp->key.text = find_field (keyfields, *p, &lp->keylen);
- if (keyfields->numeric)
- lp->key.number = find_value (lp->key.text, lp->keylen);
- }
+ {
+ lp->text = *p;
+ lp->key.text = find_field (keyfields, *p, &lp->keylen);
+ if (keyfields->numeric)
+ lp->key.number = find_value (lp->key.text, lp->keylen);
+ }
- qsort (lineinfo, nextline - linearray, sizeof (struct lineinfo), compare_prepared);
+ qsort (lineinfo, nextline - linearray, sizeof (struct lineinfo),
+ compare_prepared);
for (lp = lineinfo, p = linearray; p != nextline; lp++, p++)
- *p = lp->text;
+ *p = lp->text;
free (lineinfo);
}
@@ -1118,7 +1094,7 @@ sort_in_core (infile, total, outfile)
{
ostream = fopen (outfile, "w");
if (!ostream)
- pfatal_with_name (outfile);
+ pfatal_with_name (outfile);
}
writelines (linearray, nextline - linearray, ostream);
@@ -1152,21 +1128,21 @@ parsefile (filename, nextline, data, size)
while (p != end)
{
if (p[0] != '\\' && p[0] != '@')
- return 0;
+ return 0;
*line = p;
while (*p && *p != '\n')
- p++;
+ p++;
if (p != end)
- p++;
+ p++;
line++;
if (line == linearray + nlines)
- {
- char **old = linearray;
- linearray = (char **) xrealloc (linearray, sizeof (char *) * (nlines *= 4));
- line += linearray - old;
- }
+ {
+ char **old = linearray;
+ linearray = (char **) xrealloc (linearray, sizeof (char *) * (nlines *= 4));
+ line += linearray - old;
+ }
}
return line;
@@ -1258,7 +1234,7 @@ indexify (line, ostream)
{
initial = p;
/* Get length of inner pair of braces starting at `p',
- including that inner pair of braces. */
+ including that inner pair of braces. */
initiallength = find_braced_end (p + 1) + 1 - p;
}
else
@@ -1269,7 +1245,7 @@ indexify (line, ostream)
initiallength = 1;
if (initial1[0] >= 'a' && initial1[0] <= 'z')
- initial1[0] -= 040;
+ initial1[0] -= 040;
}
pagenumber = find_braced_pos (line, 1, 0, 0);
@@ -1290,52 +1266,52 @@ indexify (line, ostream)
{
/* Close off current secondary entry first, if one is open. */
if (pending)
- {
- fputs ("}\n", ostream);
- pending = 0;
- }
+ {
+ fputs ("}\n", ostream);
+ pending = 0;
+ }
/* If this primary has a different initial, include an entry for
- the initial. */
+ the initial. */
if (initiallength != lastinitiallength ||
- strncmp (initial, lastinitial, initiallength))
- {
- fprintf (ostream, "\\initial {");
- fwrite (initial, 1, initiallength, ostream);
- fprintf (ostream, "}\n", initial);
- if (initial == initial1)
- {
- lastinitial = lastinitial1;
- *lastinitial1 = *initial1;
- }
- else
- {
- lastinitial = initial;
- }
- lastinitiallength = initiallength;
- }
+ strncmp (initial, lastinitial, initiallength))
+ {
+ fprintf (ostream, "\\initial {");
+ fwrite (initial, 1, initiallength, ostream);
+ fputs ("}\n", ostream);
+ if (initial == initial1)
+ {
+ lastinitial = lastinitial1;
+ *lastinitial1 = *initial1;
+ }
+ else
+ {
+ lastinitial = initial;
+ }
+ lastinitiallength = initiallength;
+ }
/* Make the entry for the primary. */
if (nosecondary)
- fputs ("\\entry {", ostream);
+ fputs ("\\entry {", ostream);
else
- fputs ("\\primary {", ostream);
+ fputs ("\\primary {", ostream);
fwrite (primary, primarylength, 1, ostream);
if (nosecondary)
- {
- fputs ("}{", ostream);
- pending = 1;
- }
+ {
+ fputs ("}{", ostream);
+ pending = 1;
+ }
else
- fputs ("}\n", ostream);
+ fputs ("}\n", ostream);
/* Record name of most recent primary. */
if (lastprimarylength < primarylength)
- {
- lastprimarylength = primarylength + 100;
- lastprimary = (char *) xrealloc (lastprimary,
- 1 + lastprimarylength);
- }
+ {
+ lastprimarylength = primarylength + 100;
+ lastprimary = (char *) xrealloc (lastprimary,
+ 1 + lastprimarylength);
+ }
strncpy (lastprimary, primary, primarylength);
lastprimary[primarylength] = 0;
@@ -1346,16 +1322,16 @@ indexify (line, ostream)
/* Should not have an entry with no subtopic following one with a subtopic. */
if (nosecondary && *lastsecondary)
- error ("entry %s follows an entry with a secondary name", line);
+ error (_("entry %s follows an entry with a secondary name"), line);
/* Start a new secondary entry if necessary. */
if (!nosecondary && strncmp (secondary, lastsecondary, secondarylength))
{
if (pending)
- {
- fputs ("}\n", ostream);
- pending = 0;
- }
+ {
+ fputs ("}\n", ostream);
+ pending = 0;
+ }
/* Write the entry for the secondary. */
fputs ("\\secondary {", ostream);
@@ -1365,18 +1341,18 @@ indexify (line, ostream)
/* Record name of most recent secondary. */
if (lastsecondarylength < secondarylength)
- {
- lastsecondarylength = secondarylength + 100;
- lastsecondary = (char *) xrealloc (lastsecondary,
- 1 + lastsecondarylength);
- }
+ {
+ lastsecondarylength = secondarylength + 100;
+ lastsecondary = (char *) xrealloc (lastsecondary,
+ 1 + lastsecondarylength);
+ }
strncpy (lastsecondary, secondary, secondarylength);
lastsecondary[secondarylength] = 0;
}
/* Here to add one more page number to the current entry. */
if (pending++ != 1)
- fputs (", ", ostream); /* Punctuate first, if this is not the first. */
+ fputs (", ", ostream); /* Punctuate first, if this is not the first. */
fwrite (pagenumber, pagelength, 1, ostream);
}
@@ -1414,16 +1390,16 @@ writelines (linearray, nlines, ostream)
if (next_line == linearray
/* Compare previous line with this one, using only the
explicitly specd keyfields. */
- || compare_general (*(next_line - 1), *next_line, 0L, 0L, num_keyfields - 1))
- {
- char *p = *next_line;
- char c;
-
- while ((c = *p++) && c != '\n')
- /* Do nothing. */ ;
- *(p - 1) = 0;
- indexify (*next_line, ostream);
- }
+ || compare_general (*(next_line - 1), *next_line, 0L, 0L, num_keyfields - 1))
+ {
+ char *p = *next_line;
+ char c;
+
+ while ((c = *p++) && c != '\n')
+ /* Do nothing. */ ;
+ *(p - 1) = 0;
+ indexify (*next_line, ostream);
+ }
}
finish_index (ostream);
@@ -1462,7 +1438,7 @@ merge_files (infiles, nfiles, outfile)
{
int nf = MAX_DIRECT_MERGE;
if (i + 1 == ntemps)
- nf = nfiles - i * MAX_DIRECT_MERGE;
+ nf = nfiles - i * MAX_DIRECT_MERGE;
tempfiles[i] = maketempname (++tempcount);
value |= merge_direct (&infiles[i * MAX_DIRECT_MERGE], nf, tempfiles[i]);
}
@@ -1517,7 +1493,7 @@ merge_direct (infiles, nfiles, outfile)
if (nfiles == 0)
{
if (outfile)
- fclose (ostream);
+ fclose (ostream);
return 0;
}
@@ -1559,7 +1535,7 @@ merge_direct (infiles, nfiles, outfile)
file_lossage[i] = 0;
streams[i] = fopen (infiles[i], "r");
if (!streams[i])
- pfatal_with_name (infiles[i]);
+ pfatal_with_name (infiles[i]);
readline (thisline[i], streams[i]);
}
@@ -1577,48 +1553,48 @@ merge_direct (infiles, nfiles, outfile)
/* Look at the next avail line of each file; choose the least one. */
for (i = 0; i < nfiles; i++)
- {
- if (thisline[i] &&
- (!best ||
- 0 < compare_general (best->buffer, thisline[i]->buffer,
- (long) bestfile, (long) i, num_keyfields)))
- {
- best = thisline[i];
- bestfile = i;
- }
- }
+ {
+ if (thisline[i] &&
+ (!best ||
+ 0 < compare_general (best->buffer, thisline[i]->buffer,
+ (long) bestfile, (long) i, num_keyfields)))
+ {
+ best = thisline[i];
+ bestfile = i;
+ }
+ }
/* Output that line, unless it matches the previous one and we
- don't want duplicates. */
+ don't want duplicates. */
if (!(prev_out &&
- !compare_general (prev_out->buffer,
- best->buffer, 0L, 1L, num_keyfields - 1)))
- indexify (best->buffer, ostream);
+ !compare_general (prev_out->buffer,
+ best->buffer, 0L, 1L, num_keyfields - 1)))
+ indexify (best->buffer, ostream);
prev_out = best;
/* Now make the line the previous of its file, and fetch a new
- line from that file. */
+ line from that file. */
exch = prevline[bestfile];
prevline[bestfile] = thisline[bestfile];
thisline[bestfile] = exch;
while (1)
- {
- /* If the file has no more, mark it empty. */
-
- if (feof (streams[bestfile]))
- {
- thisline[bestfile] = 0;
- /* Update the number of files still not empty. */
- nleft--;
- break;
- }
- readline (thisline[bestfile], streams[bestfile]);
- if (thisline[bestfile]->buffer[0] || !feof (streams[bestfile]))
- break;
- }
+ {
+ /* If the file has no more, mark it empty. */
+
+ if (feof (streams[bestfile]))
+ {
+ thisline[bestfile] = 0;
+ /* Update the number of files still not empty. */
+ nleft--;
+ break;
+ }
+ readline (thisline[bestfile], streams[bestfile]);
+ if (thisline[bestfile]->buffer[0] || !feof (streams[bestfile]))
+ break;
+ }
}
finish_index (ostream);
@@ -1684,7 +1660,7 @@ pfatal_with_name (name)
s = strerror (errno);
printf ("%s: ", program_name);
- printf ("%s; for file `%s'.\n", s, name);
+ printf (_("%s; for file `%s'.\n"), s, name);
exit (TI_FATAL_ERROR);
}
@@ -1737,6 +1713,21 @@ strrchr (string, character)
}
#endif /* HAVE_STRCHR */
+void
+memory_error (callers_name, bytes_wanted)
+ char *callers_name;
+ int bytes_wanted;
+{
+ char printable_string[80];
+
+ sprintf (printable_string,
+ _("Virtual memory exhausted in %s ()! Needed %d bytes."),
+ callers_name, bytes_wanted);
+
+ error (printable_string);
+ abort ();
+}
+
/* Just like malloc, but kills the program in case of fatal error. */
void *
xmalloc (nbytes)
@@ -1768,18 +1759,3 @@ xrealloc (pointer, nbytes)
return (temp);
}
-
-memory_error (callers_name, bytes_wanted)
- char *callers_name;
- int bytes_wanted;
-{
- char printable_string[80];
-
- sprintf (printable_string,
- "Virtual memory exhausted in %s ()! Needed %d bytes.",
- callers_name, bytes_wanted);
-
- error (printable_string);
- abort ();
-}
-