Commit 8491377b by Jeff Law

This commit was generated by cvs2svn to compensate for changes in r18765,

which included commits to RCS files with non-trunk default branches.

From-SVN: r18766
parent 7e98cc16
Texinfo, Version 3
==================
This is the README file for the GNU Texinfo distribution.
Please email bugs or suggestions to bug-texinfo@prep.ai.mit.edu.
This is the README file for version 3 of the Texinfo distribution.
Files within this distribution have their own version and edition
numbers. When you refer to a file, please mention its own number, as
numbers. When you refer to a file, please mention its own version, as
well as the version number of the Texinfo distribution.
PLEASE REPORT BUGS TO: bug-texinfo@prep.ai.mit.edu
For instructions on compiling and installing info, makeinfo, texi2dvi,
and texindex, please read the file `INSTALL'. Also:
* The Emacs Lisp files are not compiled or installed by default; to
install them, use `make install' in the `emacs' subdirectory. See
./emacs/README for some considerations.
* The Info tree uses a file `dir' as its root node; the `dir-example'
file in this distribution is included for informative purposes.
Use it or not as you like.
* You can create a file texinfo.cnf to be read by TeX when
processing Texinfo manuals. For example, it might contain the
command @afourpaper. See the `Preparing for TeX' node in
texinfo.texi for more details.
Texinfo is a documentation system that uses a single source file to
produce both on-line information and printed output. This means that
instead of writing two different documents, one for the on-line help
or other on-line information and the other for a typeset manual or
other printed work, you need write only one document. When the work
is revised, you need revise only one document. You can read the
on-line information, known as an "Info file", with an Info
documentation-reading program. By convention, Texinfo source file
names end with a `.texi' or `.texinfo' extension. Texinfo is
described in the Texinfo manual (the file ./texinfo.texi).
produce both online information and printed output. This means that
instead of writing two different documents, one for the online help or
other online information and the other for a typeset manual or other
printed work, you need write only one document. When the work is
revised, you need revise only one document. You can read the online
information, known as an "Info file", with an Info documentation-reading
program. By convention, Texinfo source file names end with a `.texi' or
`.texinfo' extension. Texinfo is described in the Texinfo manual (the
file ./doc/texinfo.texi).
You can write and format Texinfo files into Info files within GNU Emacs,
and read them using the Emacs Info reader. If you do not have Emacs,
......@@ -26,22 +41,15 @@ them using `info'. Use TeX, which is not included in this package (see
`How to Obtain TeX' in the Texinfo manual for information), to typeset
Texinfo files for printing.
For instructions on compiling and installing info, makeinfo, texi2dvi,
and texindex, please read the file `INSTALL'. The Emacs Lisp files are
not installed by default; to install them, use `make install' in the
`emacs' subdirectory. The Info tree uses a file `dir' as its root node;
a sample `dir' file is included in the distribution, but not installed
anywhere. Use it or not as you like.
This distribution includes (but is not limited to) the following files:
README This file.
INTRODUCTION This file tells you how to create
readable files from the Texinfo source
files in this distribution.
Texinfo source files:
Texinfo source files (in ./doc):
texinfo.texi This manual describes Texinfo. It
tells how to use Texinfo to write
......@@ -61,15 +69,8 @@ Texinfo source files:
info-stnd.texi This manual tells you how to use
the standalone GNU Info reader that is
included in this distribution as a C
source file, `info.c'.
makeinfo.texi This manual tells you how to use
makeinfo. The same information is
contained in a chapter of the Texinfo
manual; it has been extracted here for
your convenience.
included in this distribution as C
source (./info).
Printing related files:
......@@ -78,18 +79,18 @@ Printing related files:
Texinfo file into a DVI file ready for
printing.
texindex.c This file contains the source for
util/texindex.c This file contains the source for
the `texindex' program that generates
sorted indices used by TeX when
typesetting a file for printing.
texi2dvi This is a shell script for
util/texi2dvi This is a shell script for
producing an indexed DVI file using
TeX and texindex. Must be used if the
source document uses Texinfo @macros.
GNU Emacs related files:
GNU Emacs related files (in ./emacs):
texinfmt.el This Emacs Lisp file provides the
functions that GNU Emacs uses to
......@@ -100,19 +101,15 @@ GNU Emacs related files:
for GNU Emacs.
texnfo-upd.el These files provides commands to
texnfo-tex.el help you write Texinfo files
makeinfo.el using GNU Emacs Texinfo mode.
detexinfo.el This extra utility file contains functions
to remove Texinfo commands from a
Texinfo source file.
makeinfo.el help you write Texinfo files
using GNU Emacs Texinfo mode.
info.el These are the standard GNU Emacs
informat.el Info reading and support files,
included here for your convenience.
Source files for standalone C programs:
Source files for standalone C programs (./lib, ./makeinfo, ./info):
makeinfo.c This file contains the source for
the `makeinfo' program that you can
......@@ -128,7 +125,7 @@ Source files for standalone C programs:
getopt.h
C Installation files:
Installation files:
configure This file creates creates a Makefile
which in turn creates an `info' or
......@@ -136,10 +133,14 @@ C Installation files:
distribution.
configure.in This is a template for creating
`configure' using m4 macros.
`configure' using Autoconf.
Makefile.in This is a template for `configure'
to use to make a Makefile.
to use to make a Makefile. Created by
Automake.
Makefile.am This is a template for Automake
to use to make a Makefile.in.
Other files:
......@@ -148,10 +149,6 @@ Other files:
features since the first edition
of Texinfo.
info.1 This is a `man' page that briefly
describes the standalone `info'
program.
fixfonts This is a shell script to install the
`lcircle10' TeX fonts as an alias for
the `circle10' fonts. In some older
......
If you are interested in working on any of these,
email bug-texinfo@prep.ai.mit.edu.
* Use Automake.
* Makeinfo:
- HTML output.
- A detexinfo program, like detex or delatex. This command would
strip all the texinfo commands out, and would be used as a filter on
the way to a speller. An option would be to NOT strip comments out.
makeinfo --no-headers comes close.
- If node name contains an @ command, complain explicitly.
- Better ASCII output: convert menus to single table of contents,
enumerate chapters and sections, convert cross-refs and indices to
chapter/section references. See:
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2/faq201s.zip
* Use a config header file instead of @DEFS@.
n* TeX:
- Use @ as the escape character, and Texinfo syntax generally, in the
table of contents, aux, and index files. Eliminate all the crazy
multiple redefinitions of every Texinfo command in different contexts.
- Handle @hsep and @vsep in @multitables.
* A detexinfo program, like detex or delatex. This command would
strip all the texinfo commands out, and would be used as a filter on
the way to a speller. An option would be to NOT strip comments out.
makeinfo --no-headers come close.
* General:
- Better i18n support, including support for 8-bit input characters,
and 8-bit output in info. Perhaps have to use the ec fonts.
- Support compressed image files, automatic generation of .txt
or .jpg from .eps by Ghostscript.
- Repeat TeX run until cross-references stabilize, not just twice.
(Document this in manual and fix texi2dvi.)
- Handle reference card creation, perhaps by only paying attention to
sectioning and @def... commands.
- Allow : in node names for info files, for names like `class::method'.
- Get Info declared as a MIME Content-Type.
* Change bars. This is difficult or impossible in TeX,
unfortunately. To do it right requires device driver support.
* Language:
- @figure:
@figure [xref-label]
@figureinclude <filename>, [<height>], [<width>]
@figurehsize <dimen>
@figurevsize <dimen>
@caption ... @end caption
<arbitrary Texinfo commands>
@end figure
- @flushboth to combine @flushleft and @flushright, for RFC's.
- @part sectioning command.
- Anchors a la HTML?
- Allow subitems and `see' and `see also' in indices.
- @exercise/@answer command for, e.g., gawk.
- Allow @hsep/@vsep at @item, instead of just in template.
- The dark corner symbol for the gawk manual.
- Change bars. This is difficult or impossible in TeX,
unfortunately. To do it right requires device driver support.
* The dark corner symbol for the gawk manual.
* Doc:
- Include a complete functional summary, as in a reference card, in
the manual.
- Improve the manuals for makeinfo, standalone info, etc.
- Page 39, need a new section on doing dedication pages. See gawk.texi
for an example of doing it in both the tex and info versions.
* Better i18n support, including support for 8-bit input
characters. Requires fonts, and the DC fonts are not (as of this
writing) free.
* Info:
- Search all nodes of dir file at startup, then can have
INFO-DIR-SEPARATE-GROUPS and other such.
- Better dir file merging.
- Steal interface ideas from Lynx: TAB for navigating to next link
within a page, number links, etc.
- q within help should quit help like C-x 0.
- Full-text search on all available info files.
- Incorporate an X-based viewer, perhaps tkinfo:
http://www.math.ucsb.edu/~boldt/tkinfo/.
- Perhaps process Texinfo files directly instead of converting to Info:
ftp://ftp.cs.berkeley.edu/ucb/people/phelps/tcltk/tkman.tar.Z
+ ftp://ftp.cs.berkeley.edu/ucb/people/phelps/tcltk/rman.tar.Z
+ Tcl/Tk 8.0 from ftp.smli.com in the /pub/tcl directory.
From: phelps@ecstasy.CS.Berkeley.EDU (Tom Phelps)
* @exercise/@answer command for, e.g., gawk.
* @figure.
* HTML output in makeinfo.
* Include a complete functional summary, a la a reference card, in the manual.
* Use @ as the escape character, and Texinfo syntax generally, in the
table of contents, aux, and index files. Eliminate all the crazy
redefinitions of every Texinfo command (which lists always seem to be
incomplete).
* Improve the manuals for makeinfo, standalone info, etc.
* Install-info:
- be able to copy the info file to compile-time $(infodir), to
simplify by-hand installation.
# Makefile for Texinfo/emacs.
# Copyright (C) 1995, 96 Free Software Foundation, Inc.
# $Id: Makefile.in,v 1.1 1997/08/21 22:57:56 jason Exp $
# This program is free software; you can 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.
#
# Author: Brian J. Fox (bfox@ai.mit.edu)
#
# Makefile.in generated automatically by automake 1.2 from Makefile.am
srcdir = @srcdir@
VPATH = @srcdir@
SHELL = /bin/sh
RM = rm -f
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
# Do not byte compile our Elisp files by default.
ELISP_SRCS = info.el makeinfo.el texinfo.el texnfo-upd.el \
texnfo-tex.el texinfmt.el informat.el detexinfo.el
ELISP_OBJS = info.elc makeinfo.elc texinfo.elc texnfo-upd.elc \
texnfo-tex.elc texinfmt.elc informat.elc detexinfo.elc
.SUFFIXES: .el .elc
SHELL = /bin/sh
.el.elc:
$(srcdir)/elisp-comp $<
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
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
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
DATADIRNAME = @DATADIRNAME@
EXEEXT = @EXEEXT@
GENCAT = @GENCAT@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
TERMLIBS = @TERMLIBS@
TEXCONFIG = @TEXCONFIG@
TEXMF = @TEXMF@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
l = @l@
ELCFILES =
# Do not install our Elisp files by default, either.
noinst_LISP = info.el informat.el makeinfo.el \
texinfmt.el texinfo.el texnfo-upd.el
EXTRA_DIST = README elisp-comp new-useful-setqs $(noinst_LISP)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
LISP = $(noinst_LISP)
lispdir = @lispdir@
EMACS = @EMACS@
DIST_COMMON = README Makefile.am Makefile.in elisp-comp
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
TAR = tar
GZIP = --best
default: all
.SUFFIXES:
.SUFFIXES: .el .elc
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --cygnus emacs/Makefile
all:
sub-all: all
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
.el.elc:
@echo 'WARNING: Warnings can be ignored. :-)'
if test $(EMACS) != no; then \
EMACS=$(EMACS) $(SHELL) $(srcdir)/elisp-comp $<; \
fi
tags: TAGS
TAGS:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = emacs
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
info:
dvi:
check: all
$(MAKE)
installcheck:
install-info:
install-exec:
@$(NORMAL_INSTALL)
install-data: install-data-local
@$(NORMAL_INSTALL)
install: install-exec install-data all
@:
uninstall:
all: Makefile $(LISP) $(ELCFILES)
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
mostlyclean-generic:
test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
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)
maintainer-clean-generic:
test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-lisp mostlyclean-generic
clean: clean-lisp clean-generic mostlyclean
distclean: distclean-lisp distclean-generic clean
rm -f config.status
maintainer-clean: maintainer-clean-lisp maintainer-clean-generic \
distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
.PHONY: default mostlyclean-lisp distclean-lisp clean-lisp \
maintainer-clean-lisp tags distdir info dvi installcheck install-info \
install-exec install-data install uninstall all installdirs \
mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
install-data-local:
@echo "WARNING: You must (compile and) install the Emacs Lisp files"
@echo "WARNING: manually. See ./emacs/README for some considerations."
elisp: $(ELISP_OBJS)
.PHONY: elisp
# Nobody likes any of these install targets. Fine. Install it
# manually, then.
install:
@echo Please install the Emacs Lisp files manually.
uninstall:
@echo Please uninstall the Emacs Lisp files manually.
# install: $(ELISP_OBJS)
# @(echo "(print (car load-path))" >/tmp/elc.$$$$; \
# lispdir=`emacs -batch -q -l /tmp/elc.$$$$ -nw | grep site-lisp`; \
# rm /tmp/elc.$$$$; \
# if [ "$$lispdir" != "" ]; then \
# lispdir=`echo $$lispdir | sed -e 's/"//g'`; \
# echo "Installing .elc files in $$lispdir."; \
# $(CP) $(ELISP_OBJS) $$lispdir; \
# else \
# echo "To install the elisp files, please copy *.elc to the"; \
# echo "emacs site-lisp directory."; \
# fi)
#
# install: $(ELISP_OBJS)
# for file in $(ELISP_OBJS); do \
# $(INSTALL_DATA) $$file $(lispdir); \
# done
#
# uninstall: $(ELISP_OBJS)
# cd $(lispdir) && rm -f $(ELISP_OBJS)
#
informat.elc: info.elc
makeinfo.elc: texinfo.elc
texinfmt.elc: texinfo.elc
texinfmt.elc: texnfo-upd.elc
Makefile: $(srcdir)/Makefile.in ../config.status
cd .. && sh config.status
realclean distclean: clean
$(RM) Makefile *.log
clean: FORCE
$(RM) *.elc
FORCE:
# For some reason these do not get defined.
distclean-lisp:
clean-lisp:
mostlyclean-lisp:
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
......@@ -71,7 +71,8 @@
(delete-region (point) end)))
(goto-char (point-max))
(insert "\^_\f\nTag table:\n")
(move-marker Info-tag-table-marker (point))
(if (eq major-mode 'info-mode)
(move-marker Info-tag-table-marker (point)))
(setq list (nreverse list))
(while list
(insert "Node: " (car (car list)) ?\177)
......@@ -152,6 +153,10 @@ contains just the tag table and a directory of subfiles."
(search-forward "\nTag Table:\n")
(insert "(Indirect)\n")))
(defvar Info-validate-allnodes)
(defvar Info-validate-thisnode)
(defvar Info-validate-lossages)
;;;###autoload
(defun Info-validate ()
"Check current buffer for validity as an Info file.
......@@ -165,76 +170,77 @@ Check that every node pointer points to an existing node."
(error "Don't yet know how to validate indirect info files: \"%s\""
(buffer-name (current-buffer))))
(goto-char (point-min))
(let ((allnodes '(("*")))
(let ((Info-validate-allnodes '(("*")))
(regexp "Node:[ \t]*\\([^,\n\t]*\\)[,\t\n]")
(case-fold-search t)
(tags-losing nil)
(lossages ()))
(Info-validate-lossages ()))
(while (search-forward "\n\^_" nil t)
(forward-line 1)
(let ((beg (point)))
(forward-line 1)
(if (re-search-backward regexp beg t)
(let ((name (downcase
(buffer-substring-no-properties
(match-beginning 1)
(progn
(goto-char (match-end 1))
(skip-chars-backward " \t")
(point))))))
(if (assoc name allnodes)
(setq lossages
(buffer-substring-no-properties
(match-beginning 1)
(progn
(goto-char (match-end 1))
(skip-chars-backward " \t")
(point))))))
(if (assoc name Info-validate-allnodes)
(setq Info-validate-lossages
(cons (list name "Duplicate node-name" nil)
lossages))
(setq allnodes
(cons (list name
(progn
(end-of-line)
(and (re-search-backward
"prev[ious]*:" beg t)
(progn
(goto-char (match-end 0))
(downcase
(Info-following-node-name)))))
beg)
allnodes)))))))
Info-validate-lossages))
(setq Info-validate-allnodes
(cons (list name
(progn
(end-of-line)
(and (re-search-backward
"prev[ious]*:" beg t)
(progn
(goto-char (match-end 0))
(downcase
(Info-following-node-name)))))
beg)
Info-validate-allnodes)))))))
(goto-char (point-min))
(while (search-forward "\n\^_" nil t)
(forward-line 1)
(let ((beg (point))
thisnode next)
Info-validate-thisnode next)
(forward-line 1)
(if (re-search-backward regexp beg t)
(save-restriction
(search-forward "\n\^_" nil 'move)
(narrow-to-region beg (point))
(setq thisnode (downcase
(buffer-substring-no-properties
(match-beginning 1)
(progn
(goto-char (match-end 1))
(skip-chars-backward " \t")
(point)))))
(setq Info-validate-thisnode (downcase
(buffer-substring-no-properties
(match-beginning 1)
(progn
(goto-char (match-end 1))
(skip-chars-backward " \t")
(point)))))
(end-of-line)
(and (search-backward "next:" nil t)
(setq next (Info-validate-node-name "invalid Next"))
(assoc next allnodes)
(if (equal (car (cdr (assoc next allnodes)))
thisnode)
(assoc next Info-validate-allnodes)
(if (equal (car (cdr (assoc next Info-validate-allnodes)))
Info-validate-thisnode)
;; allow multiple `next' pointers to one node
(let ((tem lossages))
(let ((tem Info-validate-lossages))
(while tem
(if (and (equal (car (cdr (car tem)))
"should have Previous")
(equal (car (car tem))
next))
(setq lossages (delq (car tem) lossages)))
(setq Info-validate-lossages
(delq (car tem) Info-validate-lossages)))
(setq tem (cdr tem))))
(setq lossages
(setq Info-validate-lossages
(cons (list next
"should have Previous"
thisnode)
lossages))))
Info-validate-thisnode)
Info-validate-lossages))))
(end-of-line)
(if (re-search-backward "prev[ious]*:" nil t)
(Info-validate-node-name "invalid Previous"))
......@@ -244,12 +250,12 @@ Check that every node pointer points to an existing node."
(if (re-search-forward "\n* Menu:" nil t)
(while (re-search-forward "\n\\* " nil t)
(Info-validate-node-name
(concat "invalid menu item "
(buffer-substring (point)
(save-excursion
(skip-chars-forward "^:")
(point))))
(Info-extract-menu-node-name))))
(concat "invalid menu item "
(buffer-substring (point)
(save-excursion
(skip-chars-forward "^:")
(point))))
(Info-extract-menu-node-name))))
(goto-char (point-min))
(while (re-search-forward "\\*note[ \n]*[^:\t]*:" nil t)
(goto-char (+ (match-beginning 0) 5))
......@@ -262,29 +268,29 @@ Check that every node pointer points to an existing node."
(point))))
(Info-extract-menu-node-name "Bad format cross-reference")))))))
(setq tags-losing (not (Info-validate-tags-table)))
(if (or lossages tags-losing)
(if (or Info-validate-lossages tags-losing)
(with-output-to-temp-buffer " *problems in info file*"
(while lossages
(while Info-validate-lossages
(princ "In node \"")
(princ (car (car lossages)))
(princ (car (car Info-validate-lossages)))
(princ "\", ")
(let ((tem (nth 1 (car lossages))))
(let ((tem (nth 1 (car Info-validate-lossages))))
(cond ((string-match "\n" tem)
(princ (substring tem 0 (match-beginning 0)))
(princ "..."))
(t
(princ tem))))
(if (nth 2 (car lossages))
(if (nth 2 (car Info-validate-lossages))
(progn
(princ ": ")
(let ((tem (nth 2 (car lossages))))
(let ((tem (nth 2 (car Info-validate-lossages))))
(cond ((string-match "\n" tem)
(princ (substring tem 0 (match-beginning 0)))
(princ "..."))
(t
(princ tem))))))
(terpri)
(setq lossages (cdr lossages)))
(setq Info-validate-lossages (cdr Info-validate-lossages)))
(if tags-losing (princ "\nTags table must be recomputed\n")))
;; Here if info file is valid.
;; If we already made a list of problems, clear it out.
......@@ -306,16 +312,17 @@ Check that every node pointer points to an existing node."
(buffer-substring-no-properties
(point)
(progn
(skip-chars-forward "^,\t\n")
(skip-chars-backward " ")
(point))))))
(skip-chars-forward "^,\t\n")
(skip-chars-backward " ")
(point))))))
(if (null name)
nil
(setq name (downcase name))
(or (and (> (length name) 0) (= (aref name 0) ?\())
(assoc name allnodes)
(setq lossages
(cons (list thisnode kind name) lossages))))
(assoc name Info-validate-allnodes)
(setq Info-validate-lossages
(cons (list Info-validate-thisnode kind name)
Info-validate-lossages))))
name)
(defun Info-validate-tags-table ()
......@@ -327,7 +334,7 @@ Check that every node pointer points to an existing node."
(start (progn (search-backward "\nTag table:\n")
(1- (match-end 0))))
tem)
(setq tem allnodes)
(setq tem Info-validate-allnodes)
(while tem
(goto-char start)
(or (equal (car (car tem)) "*")
......@@ -342,7 +349,7 @@ Check that every node pointer points to an existing node."
(setq tem (downcase (buffer-substring-no-properties
(match-beginning 1)
(match-end 1))))
(setq tem (assoc tem allnodes))
(setq tem (assoc tem Info-validate-allnodes))
(if (or (not tem)
(< 1000 (progn
(goto-char (match-beginning 2))
......@@ -426,4 +433,6 @@ For example, invoke \"emacs -batch -f batch-info-validate $info/ ~/*.info\""
(error (message ">> Error: %s" (prin1-to-string err))))))
(kill-emacs error))))
(provide 'informat)
;;; informat.el ends here
......@@ -47,15 +47,24 @@
(require 'compile)
(defvar makeinfo-run-command "makeinfo"
(defgroup makeinfo nil
"Run makeinfo conveniently"
:group 'docs)
(defcustom makeinfo-run-command "makeinfo"
"*Command used to run `makeinfo' subjob.
The name of the file is appended to this string, separated by a space.")
The name of the file is appended to this string, separated by a space."
:type 'string
:group 'makeinfo)
(defvar makeinfo-options "--fill-column=70"
(defcustom makeinfo-options "--fill-column=70"
"*String containing options for running `makeinfo'.
Do not include `--footnote-style' or `--paragraph-indent';
the proper way to specify those is with the Texinfo commands
`@footnotestyle` and `@paragraphindent'.")
`@footnotestyle` and `@paragraphindent'."
:type 'string
:group 'makeinfo)
(require 'texinfo)
......
The file NEWS contains information about what has changed since the last
release.
The file ../INSTALL contains instructions on how to install Info.
Info 2.0 is a complete rewrite of the original standalone Info I wrote in
1987, the first program I wrote for rms. That program was something like
my second Unix program ever, and my die-hard machine language coding habits
......
/* 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.6 1997/07/27 21:09:20 karl 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;
}
}
......
/* display.h -- How the display in Info is done. */
/* display.h -- How the display in Info is done.
$Id: display.h,v 1.2 1997/07/15 18:37:29 karl 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 */
......@@ -21,18 +21,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_DOC_H_)
#define _DOC_H_
#if !defined (DOC_H)
#define DOC_H
#if !defined (NULL)
# define NULL 0x0
#endif /* !NULL */
#if !defined (__FUNCTION_DEF)
# define __FUNCTION_DEF
typedef int Function ();
typedef void VFunction ();
#endif /* _FUNCTION_DEF */
#include "info.h" /* for NAMED_FUNCTIONS, VFunction, etc. */
typedef struct {
VFunction *func;
......@@ -55,4 +47,4 @@ extern void dump_map_to_message_buffer ();
extern char *function_name ();
extern VFunction *named_function ();
#endif /* NAMED_FUNCTIONS */
#endif /* !_DOC_H_ */
#endif /* !DOC_H */
......@@ -21,7 +21,7 @@
Written by Brian Fox (bfox@ai.mit.edu). */
#include <stdio.h>
#include "info.h"
#include "dribble.h"
/* When non-zero, it is a stream to write all input characters to for the
......
/* 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.3 1997/07/15 18:39:08 karl 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 */
/* footnotes.c -- Some functions for manipulating footnotes. */
/* footnotes.c -- Some functions for manipulating footnotes.
$Id: footnotes.c,v 1.4 1997/07/24 21:23:33 karl 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;
}
}
}
/* footnotes.h -- Some functions for manipulating footnotes. */
/* footnotes.h -- Some functions for manipulating footnotes.
$Id: footnotes.h,v 1.3 1997/07/15 18:40:27 karl 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 */
......@@ -56,7 +56,7 @@ gc_pointers ()
if (!info_windows || !gcable_pointers_index)
return;
for (i = 0; iw = info_windows[i]; i++)
for (i = 0; (iw = info_windows[i]); i++)
{
for (j = 0; j < iw->nodes_index; j++)
{
......
/* gc.h -- Functions for garbage collecting unused node contents. */
/* gc.h -- Functions for garbage collecting unused node contents.
$Id: gc.h,v 1.2 1997/07/15 18:41:53 karl 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 */
/* indices.h -- Functions defined in indices.c. */
/* indices.h -- Functions defined in indices.c.
$Id: indices.h,v 1.2 1997/07/06 20:50:29 karl 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 */
......@@ -21,15 +21,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */
#include <stdio.h> /* For "NULL". Yechhh! */
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#if defined (HAVE_STRING_H)
# include <string.h>
#endif /* HAVE_STRING_H */
#include "info.h"
#include "info-utils.h"
#if defined (HANDLE_MAN_PAGES)
# include "man.h"
#endif /* HANDLE_MAN_PAGES */
......@@ -84,7 +77,7 @@ info_parse_node (string, newlines_okay)
/* Find the closing paren. */
while (string[i] && string[i] != ')')
i++;
i++;
/* Remember parsed filename. */
saven_filename (string, i);
......@@ -93,7 +86,7 @@ info_parse_node (string, newlines_okay)
string += i;
if (*string)
string++;
string++;
}
/* Parse out nodename. */
......@@ -136,9 +129,9 @@ info_parse_label (label, node)
}
/* **************************************************************** */
/* */
/* Finding and Building Menus */
/* */
/* */
/* Finding and Building Menus */
/* */
/* **************************************************************** */
/* Return a NULL terminated array of REFERENCE * which represents the menu
......@@ -246,23 +239,23 @@ info_references_internal (label, binding)
offset = string_in_line (":", refdef);
/* When searching for menu items, if no colon, there is no
menu item on this line. */
menu item on this line. */
if (offset == -1)
{
if (searching_for_menu_items)
continue;
else
{
int temp;
temp = skip_line (refdef);
offset = string_in_line (":", refdef + temp);
if (offset == -1)
continue; /* Give up? */
else
offset += temp;
}
}
{
if (searching_for_menu_items)
continue;
else
{
int temp;
temp = skip_line (refdef);
offset = string_in_line (":", refdef + temp);
if (offset == -1)
continue; /* Give up? */
else
offset += temp;
}
}
entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
entry->filename = (char *)NULL;
......@@ -277,32 +270,32 @@ info_references_internal (label, binding)
entry->end = refdef - binding->buffer;
/* If this reference entry continues with another ':' then the
nodename is the same as the label. */
nodename is the same as the label. */
if (*refdef == ':')
{
entry->nodename = strdup (entry->label);
}
{
entry->nodename = xstrdup (entry->label);
}
else
{
/* This entry continues with a specific nodename. Parse the
nodename from the specification. */
{
/* This entry continues with a specific nodename. Parse the
nodename from the specification. */
refdef += skip_whitespace_and_newlines (refdef);
refdef += skip_whitespace_and_newlines (refdef);
if (searching_for_menu_items)
info_parse_node (refdef, DONT_SKIP_NEWLINES);
else
info_parse_node (refdef, SKIP_NEWLINES);
if (searching_for_menu_items)
info_parse_node (refdef, DONT_SKIP_NEWLINES);
else
info_parse_node (refdef, SKIP_NEWLINES);
if (info_parsed_filename)
entry->filename = strdup (info_parsed_filename);
if (info_parsed_filename)
entry->filename = xstrdup (info_parsed_filename);
if (info_parsed_nodename)
entry->nodename = strdup (info_parsed_nodename);
}
if (info_parsed_nodename)
entry->nodename = xstrdup (info_parsed_nodename);
}
add_pointer_to_array
(entry, refs_index, refs, refs_slots, 50, REFERENCE *);
(entry, refs_index, refs, refs_slots, 50, REFERENCE *);
}
return (refs);
}
......@@ -320,7 +313,7 @@ info_get_labeled_reference (label, references)
for (i = 0; references && (entry = references[i]); i++)
{
if (strcmp (label, entry->label) == 0)
return (entry);
return (entry);
}
return ((REFERENCE *)NULL);
}
......@@ -375,13 +368,13 @@ info_free_references (references)
if (references)
{
for (i = 0; references && (entry = references[i]); i++)
{
maybe_free (entry->label);
maybe_free (entry->filename);
maybe_free (entry->nodename);
{
maybe_free (entry->label);
maybe_free (entry->filename);
maybe_free (entry->nodename);
free (entry);
}
free (entry);
}
free (references);
}
......@@ -411,24 +404,24 @@ canonicalize_whitespace (string)
for (i = 0, j = 0; string[i]; i++)
{
if (whitespace_or_newline (string[i]))
{
whitespace_found++;
whitespace_loc = i;
continue;
}
{
whitespace_found++;
whitespace_loc = i;
continue;
}
else
{
if (whitespace_found && whitespace_loc)
{
whitespace_found = 0;
/* Suppress whitespace at start of string. */
if (j)
temp[j++] = ' ';
}
temp[j++] = string[i];
}
{
if (whitespace_found && whitespace_loc)
{
whitespace_found = 0;
/* Suppress whitespace at start of string. */
if (j)
temp[j++] = ' ';
}
temp[j++] = string[i];
}
}
/* Kill trailing whitespace. */
......@@ -466,26 +459,26 @@ printed_representation (character, hpos)
else if (iscntrl (character))
{
switch (character)
{
case '\r':
case '\n':
the_rep[i++] = character;
break;
case '\t':
{
int tw;
tw = ((hpos + 8) & 0xf8) - hpos;
while (i < tw)
the_rep[i++] = ' ';
}
break;
default:
the_rep[i++] = '^';
the_rep[i++] = (character | 0x40);
}
{
case '\r':
case '\n':
the_rep[i++] = character;
break;
case '\t':
{
int tw;
tw = ((hpos + 8) & 0xf8) - hpos;
while (i < tw)
the_rep[i++] = ' ';
}
break;
default:
the_rep[i++] = '^';
the_rep[i++] = (character | 0x40);
}
}
else if (character > printable_limit)
{
......@@ -502,9 +495,9 @@ printed_representation (character, hpos)
/* **************************************************************** */
/* */
/* Functions Static To This File */
/* */
/* */
/* Functions Static To This File */
/* */
/* **************************************************************** */
/* Amount of space allocated to INFO_PARSED_FILENAME via xmalloc (). */
......@@ -531,7 +524,7 @@ saven_filename (filename, len)
int len;
{
saven_string (filename, len,
&info_parsed_filename, &parsed_filename_size);
&info_parsed_filename, &parsed_filename_size);
}
/* Remember NODENAME in PARSED_NODENAME. An empty NODENAME is translated
......@@ -550,7 +543,7 @@ saven_nodename (nodename, len)
int len;
{
saven_string (nodename, len,
&info_parsed_nodename, &parsed_nodename_size);
&info_parsed_nodename, &parsed_nodename_size);
}
/* Remember STRING in STRING_P. STRING_P should currently have STRING_SIZE_P
......@@ -565,7 +558,7 @@ save_string (string, string_p, string_size_p)
if (!string || !*string)
{
if (*string_p)
free (*string_p);
free (*string_p);
*string_p = (char *)NULL;
*string_size_p = 0;
......@@ -573,8 +566,8 @@ save_string (string, string_p, string_size_p)
else
{
if (strlen (string) >= *string_size_p)
*string_p = (char *)xrealloc
(*string_p, (*string_size_p = 1 + strlen (string)));
*string_p = (char *)xrealloc
(*string_p, (*string_size_p = 1 + strlen (string)));
strcpy (*string_p, string);
}
......@@ -591,7 +584,7 @@ saven_string (string, len, string_p, string_size_p)
if (!string)
{
if (*string_p)
free (*string_p);
free (*string_p);
*string_p = (char *)NULL;
*string_size_p = 0;
......@@ -599,7 +592,7 @@ saven_string (string, len, string_p, string_size_p)
else
{
if (len >= *string_size_p)
*string_p = (char *)xrealloc (*string_p, (*string_size_p = 1 + len));
*string_p = (char *)xrealloc (*string_p, (*string_size_p = 1 + len));
strncpy (*string_p, string, len);
(*string_p)[len] = '\0';
......@@ -665,7 +658,7 @@ get_internal_info_window (name)
for (win = windows; win; win = win->next)
if (internal_info_node_p (win->node) &&
(strcmp (win->node->nodename, name) == 0))
(strcmp (win->node->nodename, name) == 0))
break;
return (win);
......
/* info-utils.h -- Exported functions and variables from info-util.c.
$Id: info-utils.h,v 1.1 1997/08/21 22:58:02 jason Exp $
$Id: info-utils.h,v 1.3 1997/07/15 18:42:20 karl Exp $
This file is part of GNU Info, a program for reading online documentation
stored in Info format.
......@@ -22,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
......@@ -40,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
......@@ -137,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 */
/* 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.6 1997/07/15 18:34:15 karl 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,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
......@@ -78,23 +132,34 @@ extern int info_major_version, info_minor_version, info_patch_level;
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 */
/* infomap.c -- Keymaps for Info. */
/* infomap.c -- Keymaps for Info.
$Id: infomap.c,v 1.7 1997/07/31 20:37:32 karl 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,11 +334,35 @@ initialize_info_keymaps ()
map['o'].function = info_next_window;
map['t'].function = info_tile_windows;
map['w'].function = info_toggle_wrap;
}
/* Strings which represent the sequence of characters that the arrow keys
produce. If these keys begin with ESC, and the second character of the
sequence does not conflict with an existing binding in the Meta keymap,
then bind the keys to do what C-p, C-n, C-f, and C-b do. */
extern char *term_ku, *term_kd, *term_kr, *term_kl;
/* 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 */
}
......@@ -21,14 +21,14 @@
Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_INFOMAP_H_)
#define _INFOMAP_H_
#ifndef INFOMAP_H
#define INFOMAP_H
#include "general.h"
#include "info.h"
#define ESC '\033'
#define DEL '\177'
#define TAB '\011'
#define TAB '\011'
#define RET '\r'
#define LFD '\n'
#define SPC ' '
......@@ -79,4 +79,4 @@ extern void keymap_discard_keymap ();
/* Initialize the info keymaps. */
extern void initialize_info_keymaps ();
#endif /* !_INFOMAP_H_ */
#endif /* not INFOMAP_H */
/* m-x.c -- Meta-X minibuffer reader. */
/* m-x.c -- Meta-X minibuffer reader.
$Id: m-x.c,v 1.5 1997/07/24 21:28:00 karl 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);
}
......
/* 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 1997/07/15 18:42:56 karl 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 */
/* nodemenu.c -- Produce a menu of all visited nodes. */
/* nodemenu.c -- Produce a menu of all visited nodes.
$Id: nodemenu.c,v 1.7 1997/07/24 21:30:30 karl 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);
......
/* nodes.h -- How we represent nodes internally. */
/* nodes.h -- How we represent nodes internally.
$Id: nodes.h,v 1.5 1997/07/18 14:33:44 karl 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 */
......@@ -3,7 +3,7 @@
/* 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,17 +21,11 @@
Written by Brian Fox (bfox@ai.mit.edu). */
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "general.h"
#include "info.h"
#include "search.h"
#include "nodes.h"
#if !defined (NULL)
# define NULL 0x0
#endif /* !NULL */
/* The search functions take two arguments:
1) a string to search for, and
......@@ -73,9 +67,9 @@ copy_binding (binding)
/* **************************************************************** */
/* */
/* The Actual Searching Functions */
/* */
/* */
/* The Actual Searching Functions */
/* */
/* **************************************************************** */
/* Search forwards or backwards for the text delimited by BINDING.
......@@ -115,15 +109,15 @@ search_forward (string, binding)
if (binding->flags & S_FoldCase)
{
alternate = strdup (string);
alternate = xstrdup (string);
for (i = 0; i < len; i++)
{
if (islower (alternate[i]))
alternate[i] = toupper (alternate[i]);
else if (isupper (alternate[i]))
alternate[i] = tolower (alternate[i]);
}
{
if (islower (alternate[i]))
alternate[i] = toupper (alternate[i]);
else if (isupper (alternate[i]))
alternate[i] = tolower (alternate[i]);
}
}
buff = binding->buffer + binding->start;
......@@ -132,21 +126,21 @@ search_forward (string, binding)
while (buff < (end - len))
{
for (i = 0; i < len; i++)
{
c = buff[i];
{
c = buff[i];
if ((c != string[i]) && (!alternate || c != alternate[i]))
break;
}
if ((c != string[i]) && (!alternate || c != alternate[i]))
break;
}
if (!string[i])
{
if (alternate)
free (alternate);
if (binding->flags & S_SkipDest)
buff += len;
return ((long) (buff - binding->buffer));
}
{
if (alternate)
free (alternate);
if (binding->flags & S_SkipDest)
buff += len;
return ((long) (buff - binding->buffer));
}
buff++;
}
......@@ -184,15 +178,15 @@ search_backward (input_string, binding)
if (binding->flags & S_FoldCase)
{
alternate = strdup (string);
alternate = xstrdup (string);
for (i = 0; i < len; i++)
{
if (islower (alternate[i]))
alternate[i] = toupper (alternate[i]);
else if (isupper (alternate[i]))
alternate[i] = tolower (alternate[i]);
}
{
if (islower (alternate[i]))
alternate[i] = toupper (alternate[i]);
else if (isupper (alternate[i]))
alternate[i] = tolower (alternate[i]);
}
}
buff = binding->buffer + binding->start - 1;
......@@ -201,23 +195,23 @@ search_backward (input_string, binding)
while (buff > (end + len))
{
for (i = 0; i < len; i++)
{
c = *(buff - i);
{
c = *(buff - i);
if (c != string[i] && (alternate && c != alternate[i]))
break;
}
if (c != string[i] && (alternate && c != alternate[i]))
break;
}
if (!string[i])
{
free (string);
if (alternate)
free (alternate);
{
free (string);
if (alternate)
free (alternate);
if (binding->flags & S_SkipDest)
buff -= len;
return ((long) (1 + (buff - binding->buffer)));
}
if (binding->flags & S_SkipDest)
buff -= len;
return ((long) (1 + (buff - binding->buffer)));
}
buff--;
}
......@@ -268,9 +262,9 @@ looking_at (string, binding)
}
/* **************************************************************** */
/* */
/* Small String Searches */
/* */
/* */
/* Small String Searches */
/* */
/* **************************************************************** */
/* Function names that start with "skip" are passed a string, and return
......@@ -346,37 +340,43 @@ skip_node_characters (string, newlines_okay)
for (; string && (c = string[i]); i++)
{
if (paren)
{
if (c == '(')
paren++;
else if (c == ')')
paren--;
continue;
}
{
if (c == '(')
paren++;
else if (c == ')')
paren--;
continue;
}
/* If the character following the close paren is a space or period,
then this node name has no more characters associated with it. */
then this node name has no more characters associated with it. */
if (c == '\t' ||
c == ',' ||
c == INFO_TAGSEP ||
((!newlines_okay) && (c == '\n')) ||
((paren_seen && string[i - 1] == ')') &&
(c == ' ' || c == '.')) ||
(c == '.' &&
((!string[i + 1]) ||
(whitespace_or_newline (string[i + 1])) ||
(string[i + 1] == ')'))))
break;
c == ',' ||
c == INFO_TAGSEP ||
((!newlines_okay) && (c == '\n')) ||
((paren_seen && string[i - 1] == ')') &&
(c == ' ' || c == '.')) ||
(c == '.' &&
(
#if 0
/* This test causes a node name ending in a period, like `This.', not to
be found. The trailing . is stripped. This occurs in the jargon
file (`I see no X here.' is a node name). */
(!string[i + 1]) ||
#endif
(whitespace_or_newline (string[i + 1])) ||
(string[i + 1] == ')'))))
break;
}
return (i);
}
/* **************************************************************** */
/* */
/* Searching FILE_BUFFER's */
/* */
/* */
/* Searching FILE_BUFFER's */
/* */
/* **************************************************************** */
/* Return the absolute position of the first occurence of a node separator in
......@@ -397,11 +397,11 @@ find_node_separator (binding)
table (if present) and the indirect tags table (if present). */
for (i = binding->start; i < binding->end - 1; i++)
if (((body[i] == INFO_FF && body[i + 1] == INFO_COOKIE) &&
(body[i + 2] == '\n' ||
(body[i + 2] == INFO_FF && body[i + 3] == '\n'))) ||
((body[i] == INFO_COOKIE) &&
(body[i + 1] == '\n' ||
(body[i + 1] == INFO_FF && body[i + 2] == '\n'))))
(body[i + 2] == '\n' ||
(body[i + 2] == INFO_FF && body[i + 3] == '\n'))) ||
((body[i] == INFO_COOKIE) &&
(body[i + 1] == '\n' ||
(body[i + 1] == INFO_FF && body[i + 2] == '\n'))))
return (i);
return (-1);
}
......@@ -467,7 +467,7 @@ find_tags_table (binding)
search.start += skip_node_separator (search.buffer + search.start);
if (looking_at (TAGS_TABLE_BEG_LABEL, &search))
return (position);
return (position);
}
return (-1);
}
......@@ -482,8 +482,8 @@ find_node_in_binding (nodename, binding)
char *nodename;
SEARCH_BINDING *binding;
{
register long position;
register int offset, namelen;
long position;
int offset, namelen;
SEARCH_BINDING search;
namelen = strlen (nodename);
......@@ -501,19 +501,19 @@ find_node_in_binding (nodename, binding)
offset = string_in_line (INFO_NODE_LABEL, search.buffer + search.start);
if (offset == -1)
continue;
continue;
search.start += offset;
search.start += skip_whitespace (search.buffer + search.start);
offset = skip_node_characters
(search.buffer + search.start, DONT_SKIP_NEWLINES);
(search.buffer + search.start, DONT_SKIP_NEWLINES);
/* Notice that this is an exact match. You cannot grovel through
the buffer with this function looking for random nodes. */
the buffer with this function looking for random nodes. */
if ((offset == namelen) &&
(search.buffer[search.start] == nodename[0]) &&
(strncmp (search.buffer + search.start, nodename, offset) == 0))
return (position);
(search.buffer[search.start] == nodename[0]) &&
(strncmp (search.buffer + search.start, nodename, offset) == 0))
return (position);
}
return (-1);
}
/* 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.3 1997/07/15 18:43:49 karl 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 */
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -21,10 +21,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_SESSION_H_)
#define _SESSION_H_
#if !defined (SESSION_H)
#define SESSION_H
#include "general.h"
#include "info.h"
#include "dribble.h"
/* All commands that can be invoked from within info_session () receive
......@@ -55,11 +55,11 @@ extern int info_scroll_behaviour;
extern char *info_scroll_choices[];
/* Values for info_scroll_behaviour. */
#define IS_Continuous 0 /* Try to get first menu item, or failing that, the
"Next:" pointer, or failing that, the "Up:" and
"Next:" of the up. */
#define IS_Continuous 0 /* Try to get first menu item, or failing that, the
"Next:" pointer, or failing that, the "Up:" and
"Next:" of the up. */
#define IS_NextOnly 1 /* Try to get "Next:" menu item. */
#define IS_PageOnly 2 /* Simply give up at the bottom of a node. */
#define IS_PageOnly 2 /* Simply give up at the bottom of a node. */
/* Utility functions found in session.c */
extern void info_dispatch_on_key ();
......@@ -143,4 +143,4 @@ extern void info_print_node ();
/* Miscellaneous commands. */
extern void info_abort_key (), info_quit (), info_do_lowercase_version ();
#endif /* _SESSION_H_ */
#endif /* SESSION_H */
......@@ -25,9 +25,9 @@
#include "signals.h"
/* **************************************************************** */
/* */
/* Pretending That We Have POSIX Signals */
/* */
/* */
/* Pretending That We Have POSIX Signals */
/* */
/* **************************************************************** */
#if !defined (HAVE_SIGPROCMASK) && defined (HAVE_SIGSETMASK)
......@@ -57,33 +57,32 @@ sigprocmask (operation, newset, oldset)
#endif /* !HAVE_SIGPROCMASK && HAVE_SIGSETMASK */
/* **************************************************************** */
/* */
/* Signal Handling for Info */
/* */
/* */
/* Signal Handling for Info */
/* */
/* **************************************************************** */
typedef void SigHandlerType;
typedef SigHandlerType SigHandler ();
typedef RETSIGTYPE signal_handler ();
static SigHandlerType info_signal_handler ();
static SigHandler *old_TSTP, *old_TTOU, *old_TTIN;
static SigHandler *old_WINCH, *old_INT;
static RETSIGTYPE info_signal_handler ();
static signal_handler *old_TSTP, *old_TTOU, *old_TTIN;
static signal_handler *old_WINCH, *old_INT;
void
initialize_info_signal_handler ()
{
#if defined (SIGTSTP)
old_TSTP = (SigHandler *) signal (SIGTSTP, info_signal_handler);
old_TTOU = (SigHandler *) signal (SIGTTOU, info_signal_handler);
old_TTIN = (SigHandler *) signal (SIGTTIN, info_signal_handler);
old_TSTP = (signal_handler *) signal (SIGTSTP, info_signal_handler);
old_TTOU = (signal_handler *) signal (SIGTTOU, info_signal_handler);
old_TTIN = (signal_handler *) signal (SIGTTIN, info_signal_handler);
#endif /* SIGTSTP */
#if defined (SIGWINCH)
old_WINCH = (SigHandler *) signal (SIGWINCH, info_signal_handler);
old_WINCH = (signal_handler *) signal (SIGWINCH, info_signal_handler);
#endif
#if defined (SIGINT)
old_INT = (SigHandler *) signal (SIGINT, info_signal_handler);
old_INT = (signal_handler *) signal (SIGINT, info_signal_handler);
#endif
}
......@@ -98,11 +97,11 @@ redisplay_after_signal ()
fflush (stdout);
}
static SigHandlerType
static RETSIGTYPE
info_signal_handler (sig)
int sig;
{
SigHandler **old_signal_handler;
signal_handler **old_signal_handler;
switch (sig)
{
......@@ -116,56 +115,56 @@ info_signal_handler (sig)
#endif
{
#if defined (SIGTSTP)
if (sig == SIGTSTP)
old_signal_handler = &old_TSTP;
if (sig == SIGTTOU)
old_signal_handler = &old_TTOU;
if (sig == SIGTTIN)
old_signal_handler = &old_TTIN;
if (sig == SIGTSTP)
old_signal_handler = &old_TSTP;
if (sig == SIGTTOU)
old_signal_handler = &old_TTOU;
if (sig == SIGTTIN)
old_signal_handler = &old_TTIN;
#endif /* SIGTSTP */
if (sig == SIGINT)
old_signal_handler = &old_INT;
/* For stop signals, restore the terminal IO, leave the cursor
at the bottom of the window, and stop us. */
terminal_goto_xy (0, screenheight - 1);
terminal_clear_to_eol ();
fflush (stdout);
terminal_unprep_terminal ();
signal (sig, *old_signal_handler);
UNBLOCK_SIGNAL (sig);
kill (getpid (), sig);
/* The program is returning now. Restore our signal handler,
turn on terminal handling, redraw the screen, and place the
cursor where it belongs. */
terminal_prep_terminal ();
*old_signal_handler = (SigHandler *) signal (sig, info_signal_handler);
redisplay_after_signal ();
fflush (stdout);
if (sig == SIGINT)
old_signal_handler = &old_INT;
/* For stop signals, restore the terminal IO, leave the cursor
at the bottom of the window, and stop us. */
terminal_goto_xy (0, screenheight - 1);
terminal_clear_to_eol ();
fflush (stdout);
terminal_unprep_terminal ();
signal (sig, *old_signal_handler);
UNBLOCK_SIGNAL (sig);
kill (getpid (), sig);
/* The program is returning now. Restore our signal handler,
turn on terminal handling, redraw the screen, and place the
cursor where it belongs. */
terminal_prep_terminal ();
*old_signal_handler = (signal_handler *) signal (sig, info_signal_handler);
redisplay_after_signal ();
fflush (stdout);
}
break;
#if defined (SIGWINCH)
case SIGWINCH:
{
/* Turn off terminal IO, tell our parent that the window has changed,
then reinitialize the terminal and rebuild our windows. */
old_signal_handler = &old_WINCH;
terminal_goto_xy (0, 0);
fflush (stdout);
terminal_unprep_terminal ();
signal (sig, *old_signal_handler);
UNBLOCK_SIGNAL (sig);
kill (getpid (), sig);
/* After our old signal handler returns... */
terminal_get_screen_size ();
terminal_prep_terminal ();
display_initialize_display (screenwidth, screenheight);
window_new_screen_size (screenwidth, screenheight, (VFunction *)NULL);
*old_signal_handler = (SigHandler *) signal (sig, info_signal_handler);
redisplay_after_signal ();
/* Turn off terminal IO, tell our parent that the window has changed,
then reinitialize the terminal and rebuild our windows. */
old_signal_handler = &old_WINCH;
terminal_goto_xy (0, 0);
fflush (stdout);
terminal_unprep_terminal ();
signal (sig, *old_signal_handler);
UNBLOCK_SIGNAL (sig);
kill (getpid (), sig);
/* After our old signal handler returns... */
terminal_get_screen_size ();
terminal_prep_terminal ();
display_initialize_display (screenwidth, screenheight);
window_new_screen_size (screenwidth, screenheight, (VFunction *)NULL);
*old_signal_handler = (signal_handler *) signal (sig, info_signal_handler);
redisplay_after_signal ();
}
break;
#endif /* SIGWINCH */
......
/* signals.h -- Header to include system dependent signal definitions. */
/* signals.h -- Header to include system dependent signal definitions.
$Id: signals.h,v 1.3 1997/07/15 18:35:59 karl 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 */
......@@ -3,7 +3,7 @@
/* This file is part of GNU Info, a program for reading online documentation
stored in Info format.
Copyright (C) 1993, 96 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,15 +21,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_TERMINAL_H_)
#define _TERMINAL_H_
#if !defined (TERMINAL_H)
#define TERMINAL_H
/* We use the following data type to talk about pointers to functions. */
#if !defined (__FUNCTION_DEF)
# define __FUNCTION_DEF
typedef int Function ();
typedef void VFunction ();
#endif /* _FUNCTION_DEF */
#include "info.h"
/* For almost every function externally visible from terminal.c, there is
a corresponding "hook" function which can be bound in order to replace
......@@ -125,5 +120,6 @@ extern VFunction *terminal_ring_bell_hook;
/* The key sequences output by the arrow keys, if this terminal has any. */
extern char *term_ku, *term_kd, *term_kr, *term_kl;
extern char *term_kP, *term_kN;
#endif /* !_TERMINAL_H_ */
#endif /* !TERMINAL_H */
/* tilde.c -- Tilde expansion code (~/foo := $HOME/foo).
$Id: tilde.c,v 1.1 1997/08/21 22:58:05 jason Exp $
$Id: tilde.c,v 1.8 1997/07/24 21:49:03 karl Exp $
This file is part of GNU Info, a program for reading online documentation
stored in Info format.
......@@ -22,6 +22,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */
/* Include config.h before doing alloca. */
#include "info.h"
#ifndef alloca
#if defined (__GNUC__)
# define alloca __builtin_alloca
#else /* !__GNUC__ */
......@@ -33,28 +37,10 @@
# endif /* HAVE_ALLOCA_H */
# endif /* !AIX */
#endif /* !__GNUC__ */
#if defined (HAVE_STDLIB_H)
#include <stdlib.h>
#endif
#include "tilde.h"
#include <pwd.h>
#if defined (HAVE_STRING_H)
#include <string.h>
#endif
#include "clib.h"
#if !defined (NULL)
# define NULL 0x0
#endif
#endif /* ! defined alloca */
#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
......@@ -105,16 +91,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);
}
......@@ -133,13 +119,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);
}
......@@ -167,7 +153,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;
......@@ -176,12 +162,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);
......@@ -194,7 +180,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;
......@@ -214,88 +200,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. */
extern char *getenv ();
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 = 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);
}
......@@ -318,15 +303,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);
......@@ -369,7 +354,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 */
......
......@@ -25,13 +25,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */
/* Function pointers can be declared as (Function *)foo. */
#if !defined (__FUNCTION_DEF)
# define __FUNCTION_DEF
typedef int Function ();
typedef void VFunction ();
typedef char *CFunction ();
#endif /* _FUNCTION_DEF */
#ifndef TILDE_H
#define TILDE_H
#include "info.h"
/* If non-null, this contains the address of a function to call if the
standard meaning for expanding a tilde fails. The function is called
......@@ -56,3 +53,4 @@ extern char *tilde_expand ();
tilde. If there is no expansion, call tilde_expansion_failure_hook. */
extern char *tilde_expand_word ();
#endif /* not TILDE_H */
/* 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.5 1997/07/18 14:34:23 karl 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);
......
/* variables.h -- Description of user visible variables in Info. */
/* variables.h -- Description of user visible variables in Info.
$Id: variables.h,v 1.3 1997/07/15 18:44:23 karl 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 */
/* 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.4 1997/07/15 18:45:47 karl 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 */
# Makefile for GNU makeinfo.
# $Id: Makefile.in,v 1.1 1997/08/21 22:58:07 jason Exp $
#
# Copyright (C) 1993, 96 Free Software Foundation, Inc.
# Makefile.in generated automatically by automake 1.2 from Makefile.am
# This program is free software; you can 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.
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU 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.
#### Start of system configuration section. ####
SHELL = /bin/sh
srcdir = @srcdir@
VPATH = $(srcdir):$(common)
top_srcdir = @top_srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
common = $(srcdir)/../libtxi
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = ..
ACLOCAL = @ACLOCAL@
AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
EXEEXT = @EXEEXT@
CC = @CC@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
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
CATALOGS = @CATALOGS@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
DATADIRNAME = @DATADIRNAME@
EXEEXT = @EXEEXT@
GENCAT = @GENCAT@
GMOFILES = @GMOFILES@
GMSGFMT = @GMSGFMT@
GT_NO = @GT_NO@
GT_YES = @GT_YES@
INSTOBJEXT = @INSTOBJEXT@
INTLDEPS = @INTLDEPS@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
PACKAGE = @PACKAGE@
POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
TERMLIBS = @TERMLIBS@
TEXCONFIG = @TEXCONFIG@
TEXMF = @TEXMF@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
l = @l@
bin_PROGRAMS = makeinfo
localedir = $(datadir)/locale
INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
LDADD = ../lib/libtxi.a @INTLLIBS@
makeinfo_SOURCES = makeinfo.c makeinfo.h multi.c
EXTRA_DIST = README
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = ../config.h
CONFIG_CLEAN_FILES =
bin_PROGRAMS = makeinfo$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS)
DEFS = @DEFS@ -I. -I$(srcdir) -I..
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
makeinfo_OBJECTS = makeinfo.o multi.o
makeinfo_LDADD = $(LDADD)
makeinfo_DEPENDENCIES = ../lib/libtxi.a
makeinfo_LDFLAGS =
CFLAGS = @CFLAGS@
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
DIST_COMMON = README Makefile.am Makefile.in
LN = ln
RM = rm -f
MKDIR = mkdir
DEFS = @DEFS@
LIBS = -L../libtxi -ltxi @LIBS@
LOADLIBES = $(LIBS)
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
SHELL = /bin/sh
TAR = tar
GZIP = --best
SOURCES = $(makeinfo_SOURCES)
OBJECTS = $(makeinfo_OBJECTS)
CFLAGS = @CFLAGS@
LDFLAGS = @LDFLAGS@
default: all
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
# Prefix for each installed program, normally empty or `g'.
binprefix =
infodir = @infodir@
.SUFFIXES:
.SUFFIXES: .c .o
$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && $(AUTOMAKE) --cygnus makeinfo/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
mostlyclean-binPROGRAMS:
#### End of system configuration section. ####
clean-binPROGRAMS:
test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
SRCS = makeinfo.c multi.c
OBJS = makeinfo.o multi.o
distclean-binPROGRAMS:
PROGS = makeinfo$(EXEEXT)
maintainer-clean-binPROGRAMS:
all: $(PROGS) makeinfo.info
sub-all: all
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(bindir)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
if test -f $$p; then \
echo " $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`"; \
$(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
else :; fi; \
done
uninstall-binPROGRAMS:
$(NORMAL_UNINSTALL)
list='$(bin_PROGRAMS)'; for p in $$list; do \
rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
done
.c.o:
$(CC) -c $(CPPFLAGS) -I. -I$(srcdir) -I$(common) $(DEFS) $(CFLAGS) $<
$(COMPILE) -c $<
mostlyclean-compile:
rm -f *.o core
clean-compile:
distclean-compile:
rm -f *.tab.c
maintainer-clean-compile:
makeinfo$(EXEEXT): $(makeinfo_OBJECTS) $(makeinfo_DEPENDENCIES)
@rm -f makeinfo$(EXEEXT)
$(LINK) $(makeinfo_LDFLAGS) $(makeinfo_OBJECTS) $(makeinfo_LDADD) $(LIBS)
tags: TAGS
ID: $(HEADERS) $(SOURCES)
here=`pwd` && cd $(srcdir) && mkid -f$$here/ID $(SOURCES) $(HEADERS)
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES)
tags=; \
here=`pwd`; \
test -z "$(ETAGS_ARGS)$(SOURCES)$(HEADERS)$$tags" \
|| (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $(SOURCES) $(HEADERS) -o $$here/TAGS)
mostlyclean-tags:
clean-tags:
distclean-tags:
rm -f TAGS ID
maintainer-clean-tags:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = makeinfo
makeinfo$(EXEEXT): $(OBJS) ../libtxi/libtxi.a
$(CC) $(LDFLAGS) -o makeinfo $(OBJS) $(LOADLIBES)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
if test -f $$file; then d=.; else d=$(srcdir); fi; \
test -f $(distdir)/$$file \
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|| cp -p $$d/$$file $(distdir)/$$file; \
done
info:
dvi:
check: all
$(MAKE)
installcheck:
install-info:
install-exec: install-binPROGRAMS
@$(NORMAL_INSTALL)
../libtxi/libtxi.a:
(cd ../libtxi && $(MAKE) $(MFLAGS) libtxi.a)
install-data:
@$(NORMAL_INSTALL)
makeinfo.o: makeinfo.c $(common)/getopt.h
install: install-exec install-data all
@:
$(OBJS): makeinfo.h
uninstall: uninstall-binPROGRAMS
info makeinfo.info: ./makeinfo makeinfo.texi #macro.texi
./makeinfo --no-split -I$(srcdir) makeinfo.texi
all: Makefile $(PROGRAMS)
# makeinfo.texi: ./makeinfo makeinfo.mki
# ./makeinfo -E makeinfo.texi -I$(srcdir) makeinfo.mki
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
$(mkinstalldirs) $(bindir)
dvi makeinfo.dvi: ./makeinfo makeinfo.texi #macro.texi
$(srcdir)/../util/texi2dvi makeinfo.txi
install: all
$(INSTALL_PROGRAM) makeinfo$(EXEEXT) $(bindir)/$(binprefix)makeinfo$(EXEEXT)
-d=$(srcdir); test -f ./makeinfo.info && d=.; $(INSTALL_DATA) $$d/makeinfo.info $(infodir)/makeinfo.info
$(POST_INSTALL)
mostlyclean-generic:
test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
install-info:
-d=$(srcdir); test -f ./makeinfo.info && d=.; $(INSTALL_DATA) $$d/makeinfo.info $(infodir)/makeinfo.info
../util/install-info --info-dir=$(infodir) $(infodir)/makeinfo.info
clean-generic:
test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
uninstall:
for f in $(PROGS); do rm -f $(bindir)/$(binprefix)$$f; done
rm -f $(infodir)/makeinfo.info
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)
TAGS: $(SRCS)
etags $(SRCS)
maintainer-clean-generic:
test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-binPROGRAMS mostlyclean-compile \
mostlyclean-tags mostlyclean-generic
clean:
rm -f *.o a.out core core.* $(PROGS)
clean: clean-binPROGRAMS clean-compile clean-tags clean-generic \
mostlyclean
mostlyclean: clean
distclean: distclean-binPROGRAMS distclean-compile distclean-tags \
distclean-generic clean
rm -f config.status
distclean: clean
rm -f TAGS Makefile config.status *.info */*.info
maintainer-clean: maintainer-clean-binPROGRAMS maintainer-clean-compile \
maintainer-clean-tags maintainer-clean-generic \
distclean
@echo "This command is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
realclean: distclean
maintainer-clean: distclean
.PHONY: default mostlyclean-binPROGRAMS distclean-binPROGRAMS \
clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
install-binPROGRAMS mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile tags mostlyclean-tags distclean-tags \
clean-tags maintainer-clean-tags distdir info dvi installcheck \
install-info install-exec install-data install uninstall all \
installdirs mostlyclean-generic distclean-generic clean-generic \
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
Makefile: Makefile.in ../config.status
cd .. && sh config.status
# Prevent GNU make v3 from overflowing arg limit on SysV.
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment