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 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. 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 Texinfo is a documentation system that uses a single source file to
produce both on-line information and printed output. This means that produce both online information and printed output. This means that
instead of writing two different documents, one for the on-line help instead of writing two different documents, one for the online help or
or other on-line information and the other for a typeset manual or other online information and the other for a typeset manual or other
other printed work, you need write only one document. When the work printed work, you need write only one document. When the work is
is revised, you need revise only one document. You can read the revised, you need revise only one document. You can read the online
on-line information, known as an "Info file", with an Info information, known as an "Info file", with an Info documentation-reading
documentation-reading program. By convention, Texinfo source file program. By convention, Texinfo source file names end with a `.texi' or
names end with a `.texi' or `.texinfo' extension. Texinfo is `.texinfo' extension. Texinfo is described in the Texinfo manual (the
described in the Texinfo manual (the file ./texinfo.texi). file ./doc/texinfo.texi).
You can write and format Texinfo files into Info files within GNU Emacs, 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, 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 ...@@ -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 `How to Obtain TeX' in the Texinfo manual for information), to typeset
Texinfo files for printing. 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: This distribution includes (but is not limited to) the following files:
README This file. README This file.
INTRODUCTION This file tells you how to create INTRODUCTION This file tells you how to create
readable files from the Texinfo source readable files from the Texinfo source
files in this distribution. files in this distribution.
Texinfo source files: Texinfo source files (in ./doc):
texinfo.texi This manual describes Texinfo. It texinfo.texi This manual describes Texinfo. It
tells how to use Texinfo to write tells how to use Texinfo to write
...@@ -61,15 +69,8 @@ Texinfo source files: ...@@ -61,15 +69,8 @@ Texinfo source files:
info-stnd.texi This manual tells you how to use info-stnd.texi This manual tells you how to use
the standalone GNU Info reader that is the standalone GNU Info reader that is
included in this distribution as a C included in this distribution as C
source file, `info.c'. source (./info).
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.
Printing related files: Printing related files:
...@@ -78,18 +79,18 @@ Printing related files: ...@@ -78,18 +79,18 @@ Printing related files:
Texinfo file into a DVI file ready for Texinfo file into a DVI file ready for
printing. printing.
texindex.c This file contains the source for util/texindex.c This file contains the source for
the `texindex' program that generates the `texindex' program that generates
sorted indices used by TeX when sorted indices used by TeX when
typesetting a file for printing. 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 producing an indexed DVI file using
TeX and texindex. Must be used if the TeX and texindex. Must be used if the
source document uses Texinfo @macros. source document uses Texinfo @macros.
GNU Emacs related files: GNU Emacs related files (in ./emacs):
texinfmt.el This Emacs Lisp file provides the texinfmt.el This Emacs Lisp file provides the
functions that GNU Emacs uses to functions that GNU Emacs uses to
...@@ -100,19 +101,15 @@ GNU Emacs related files: ...@@ -100,19 +101,15 @@ GNU Emacs related files:
for GNU Emacs. for GNU Emacs.
texnfo-upd.el These files provides commands to texnfo-upd.el These files provides commands to
texnfo-tex.el help you write Texinfo files makeinfo.el help you write Texinfo files
makeinfo.el using GNU Emacs Texinfo mode. using GNU Emacs Texinfo mode.
detexinfo.el This extra utility file contains functions
to remove Texinfo commands from a
Texinfo source file.
info.el These are the standard GNU Emacs info.el These are the standard GNU Emacs
informat.el Info reading and support files, informat.el Info reading and support files,
included here for your convenience. 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 makeinfo.c This file contains the source for
the `makeinfo' program that you can the `makeinfo' program that you can
...@@ -128,7 +125,7 @@ Source files for standalone C programs: ...@@ -128,7 +125,7 @@ Source files for standalone C programs:
getopt.h getopt.h
C Installation files: Installation files:
configure This file creates creates a Makefile configure This file creates creates a Makefile
which in turn creates an `info' or which in turn creates an `info' or
...@@ -136,10 +133,14 @@ C Installation files: ...@@ -136,10 +133,14 @@ C Installation files:
distribution. distribution.
configure.in This is a template for creating configure.in This is a template for creating
`configure' using m4 macros. `configure' using Autoconf.
Makefile.in This is a template for `configure' 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: Other files:
...@@ -148,10 +149,6 @@ Other files: ...@@ -148,10 +149,6 @@ Other files:
features since the first edition features since the first edition
of Texinfo. 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 fixfonts This is a shell script to install the
`lcircle10' TeX fonts as an alias for `lcircle10' TeX fonts as an alias for
the `circle10' fonts. In some older the `circle10' fonts. In some older
......
If you are interested in working on any of these, If you are interested in working on any of these,
email bug-texinfo@prep.ai.mit.edu. email bug-texinfo@prep.ai.mit.edu.
* Use Automake. * Makeinfo:
- HTML output.
* Use a config header file instead of @DEFS@. - A detexinfo program, like detex or delatex. This command would
* A detexinfo program, like detex or delatex. This command would
strip all the texinfo commands out, and would be used as a filter on 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. the way to a speller. An option would be to NOT strip comments out.
makeinfo --no-headers come close. makeinfo --no-headers comes close.
- If node name contains an @ command, complain explicitly.
* Change bars. This is difficult or impossible in TeX, - Better ASCII output: convert menus to single table of contents,
unfortunately. To do it right requires device driver support. enumerate chapters and sections, convert cross-refs and indices to
chapter/section references. See:
* The dark corner symbol for the gawk manual. ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2/faq201s.zip
* Better i18n support, including support for 8-bit input n* TeX:
characters. Requires fonts, and the DC fonts are not (as of this - Use @ as the escape character, and Texinfo syntax generally, in the
writing) free. table of contents, aux, and index files. Eliminate all the crazy
multiple redefinitions of every Texinfo command in different contexts.
* @exercise/@answer command for, e.g., gawk. - Handle @hsep and @vsep in @multitables.
* @figure. * 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.
* HTML output in makeinfo. * 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.
* Include a complete functional summary, a la a reference card, in the 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.
* Use @ as the escape character, and Texinfo syntax generally, in the * Info:
table of contents, aux, and index files. Eliminate all the crazy - Search all nodes of dir file at startup, then can have
redefinitions of every Texinfo command (which lists always seem to be INFO-DIR-SEPARATE-GROUPS and other such.
incomplete). - 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)
* 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.
...@@ -3,7 +3,7 @@ topmost node of the Info hierarchy. This file is merely made available ...@@ -3,7 +3,7 @@ topmost node of the Info hierarchy. This file is merely made available
for your hacking pleasure, not official or standard in any way. for your hacking pleasure, not official or standard in any way.
If it doesn't make sense to you, or you don't like it, ignore it. If it doesn't make sense to you, or you don't like it, ignore it.
$Id: dir-example,v 1.1 1997/08/21 22:57:52 jason Exp $ $Id: dir,v 1.23 1997/07/25 18:05:32 karl Exp $
 
File: dir Node: Top This is the top of the INFO tree. File: dir Node: Top This is the top of the INFO tree.
...@@ -26,7 +26,7 @@ GNU packages ...@@ -26,7 +26,7 @@ GNU packages
* File utilities: (fileutils). GNU file utilities. * File utilities: (fileutils). GNU file utilities.
* Finding files: (find). Operating on files matching certain criteria. * Finding files: (find). Operating on files matching certain criteria.
* Font utilities: (fontu). Programs for font manipulation. * Font utilities: (fontu). Programs for font manipulation.
* Gawk: (gawk). A text processing and scanning language. * Gawk: (gawk.info). A text scanning and processing language.
* Gzip: (gzip). General (de)compression. * Gzip: (gzip). General (de)compression.
* Identifier DB: (id-utils). Identifier database utilities. * Identifier DB: (id-utils). Identifier database utilities.
* Ispell: (ispell). Interactive spelling corrector. * Ispell: (ispell). Interactive spelling corrector.
...@@ -35,11 +35,12 @@ GNU packages ...@@ -35,11 +35,12 @@ GNU packages
* Ptx: (ptx). Permuted index generator. * Ptx: (ptx). Permuted index generator.
* Shar: (sharutils). Shell archiver, uudecode/uuencode. * Shar: (sharutils). Shell archiver, uudecode/uuencode.
* Shell utilities: (sh-utils). GNU shell utilities. * Shell utilities: (sh-utils). GNU shell utilities.
* Tar: (tar). ``Tape'' archiver. * tar: (tar). Making tape (or disk) archives.
* Text utilities: (textutils). GNU text utilities. * Text utilities: (textutils). GNU text utilities.
* Time: (time). Measuring program resource usage. * Time: (time). Measuring program resource usage.
* UUCP: (uucp). Copying between machines, offline. * UUCP: (uucp). Copying between machines, offline.
* Wdiff: (wdiff). Word-by-word comparison. * Wdiff: (wdiff). Word-by-word comparison.
* Wget: (wget). URL download.
GNU programming tools GNU programming tools
* As: (as). Assembler. * As: (as). Assembler.
...@@ -53,6 +54,7 @@ GNU programming tools ...@@ -53,6 +54,7 @@ GNU programming tools
* Libtool: (libtool). Generic library support script. * Libtool: (libtool). Generic library support script.
* GCC: (gcc). C compiler. * GCC: (gcc). C compiler.
* GDB: (gdb). Source-level debugger for C and C++. * GDB: (gdb). Source-level debugger for C and C++.
* Gettext Utilities: (gettext). GNU gettext utilities.
* Gperf: (gperf). Perfect hash function generator. * Gperf: (gperf). Perfect hash function generator.
* Gprof: (gprof). Profiler. * Gprof: (gprof). Profiler.
* Indent: (indent). Prettyprinter for programs. * Indent: (indent). Prettyprinter for programs.
...@@ -61,11 +63,11 @@ GNU programming tools ...@@ -61,11 +63,11 @@ GNU programming tools
Texinfo documentation system Texinfo documentation system
* Info: (info). Documentation browsing system. * Info: (info). Documentation browsing system.
* Texinfo: (texinfo). The GNU documentation format. * Texinfo: (texinfo). The GNU documentation format.
* info program: (info-stnd). Standalone Info-reading program.
* install-info: (texinfo)Invoking install-info. Updating info/dir entries. * install-info: (texinfo)Invoking install-info. Updating info/dir entries.
* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation. * texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation.
* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files. * texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files.
* info program: (info-stnd). Standalone Info-reading program. * makeinfo: (texinfo)makeinfo preferred. Translate Texinfo source.
* makeinfo: (makeinfo). Convert Texinfo source to Info or plain ASCII.
GNU Emacs Lisp GNU Emacs Lisp
* Elisp: (elisp). GNU Emacs Lisp reference manual. * Elisp: (elisp). GNU Emacs Lisp reference manual.
...@@ -90,17 +92,12 @@ GNU Emacs Lisp ...@@ -90,17 +92,12 @@ GNU Emacs Lisp
* VM: (vm). Mail reader. * VM: (vm). Mail reader.
* W3: (w3). WWW browser. * W3: (w3). WWW browser.
GNU admin GNU programming support
* Autoconf: (autoconf). Automatic generation of package configuration. * Autoconf: (autoconf). Automatic generation of package configuration.
* Automake: (automake). Making Makefile.in's.
* Configure: (configure). Cygnus configure. * Configure: (configure). Cygnus configure.
* Gettext: (gettext). Internationalization.
* Gnats: (gnats). Cygnus bug tracking system. * Gnats: (gnats). Cygnus bug tracking system.
* Maintaining: (maintain). Maintaining GNU software.
* Remsync: (remsync). Remote synchronization of directory trees. * Remsync: (remsync). Remote synchronization of directory trees.
* Send PR: (send-pr). Cygnus bug reporting for Gnats. * Send PR: (send-pr). Cygnus bug reporting for Gnats.
* Source config: (cfg-paper). Some theory on configuring source packages.
* Standards: (standards). GNU coding standards.
GNU libraries GNU libraries
* Annotate: (annotate). High-level GDB to GUI's. * Annotate: (annotate). High-level GDB to GUI's.
...@@ -119,7 +116,10 @@ GNU libraries ...@@ -119,7 +116,10 @@ GNU libraries
GNU programming documentation GNU programming documentation
* GDB internals: (gdbint). Debugger internals. * GDB internals: (gdbint). Debugger internals.
* Ld internals: (ldint). GNU linker internals. * Ld internals: (ldint). GNU linker internals.
* Maintaining: (maintain). Maintaining GNU software.
* Source config: (cfg-paper). Some theory on configuring source packages.
* Stabs: (stabs). Symbol table debugging information format. * Stabs: (stabs). Symbol table debugging information format.
* Standards: (standards). GNU coding standards.
DOS DOS
* Demacs: (demacs). GNU Emacs for DOS. * Demacs: (demacs). GNU Emacs for DOS.
...@@ -133,6 +133,7 @@ TeX things ...@@ -133,6 +133,7 @@ TeX things
* LaTeX: (latex). LaTeX. * LaTeX: (latex). LaTeX.
* MakeIndex: (makeindex). Index creation for TeX. * MakeIndex: (makeindex). Index creation for TeX.
* Naming fonts: (fontname). Filenames for TeX fonts. * Naming fonts: (fontname). Filenames for TeX fonts.
* TDS: (tds). Standard TeX directory structure.
* TeXDraw: (texdraw). Drawing PostScript diagrams within TeX. * TeXDraw: (texdraw). Drawing PostScript diagrams within TeX.
* Web2c: (web2c). TeX, Metafont, and their companion programs. * Web2c: (web2c). TeX, Metafont, and their companion programs.
...@@ -140,6 +141,7 @@ Other things ...@@ -140,6 +141,7 @@ Other things
* Amd: (amdref). Filesystem automounter. * Amd: (amdref). Filesystem automounter.
* CMUCL: (cmu-user). CMU Common Lisp. * CMUCL: (cmu-user). CMU Common Lisp.
* File headers: (filehdr). Bibliographic information for computer files. * File headers: (filehdr). Bibliographic information for computer files.
* GCP: (gcp). Game club protocol.
* HTML: (snafu). Hypertext Markup Language 2.0 specification. * HTML: (snafu). Hypertext Markup Language 2.0 specification.
* Jargon: (jargon). The jargon file. * Jargon: (jargon). The jargon file.
* Perl: (perl). Practical extraction and report language. * Perl: (perl). Practical extraction and report language.
...@@ -148,12 +150,14 @@ Other things ...@@ -148,12 +150,14 @@ Other things
* UMB C.S. Dept.: (csinfo). UMass/Boston Computer Science Dept. info. * UMB C.S. Dept.: (csinfo). UMass/Boston Computer Science Dept. info.
Individual utilities Individual utilities
* aclocal: (automake)Invoking aclocal. Generating aclocal.m4.
* aid: (id-utils)aid invocation. Matching strings. * aid: (id-utils)aid invocation. Matching strings.
* ar: (binutils)ar. Create/modify/extract archives. * ar: (binutils)ar. Create/modify/extract archives.
* at-pr: (gnats)at-pr. Bug report timely reminders. * at-pr: (gnats)at-pr. Bug report timely reminders.
* automake: (automake). Making Makefile.in's.
* autoreconf: (autoconf)Invoking autoreconf. Remake multiple configure's. * autoreconf: (autoconf)Invoking autoreconf. Remake multiple configure's.
* autoscan: (autoconf)Invoking autoscan. Automate initial configure.in. * autoscan: (autoconf)Invoking autoscan. Automate initial configure.in.
* awk: (Gawk)Invoking gawk. Text processing and scanning. * awk: (gawk)Invoking gawk. Text processing and scanning.
* basename: (sh-utils)basename invocation. Strip directory and suffix. * basename: (sh-utils)basename invocation. Strip directory and suffix.
* bibtex: (web2c)BibTeX invocation. Maintaining bibliographies. * bibtex: (web2c)BibTeX invocation. Maintaining bibliographies.
* c++filt: (binutils)c++filt. Demangle C++ symbols. * c++filt: (binutils)c++filt. Demangle C++ symbols.
...@@ -170,9 +174,10 @@ Individual utilities ...@@ -170,9 +174,10 @@ Individual utilities
* cut: (textutils)cut invocation. Print selected parts of lines. * cut: (textutils)cut invocation. Print selected parts of lines.
* date: (sh-utils)date invocation. Print/set system date and time. * date: (sh-utils)date invocation. Print/set system date and time.
* dd: (fileutils)dd invocation. Copy and convert a file. * dd: (fileutils)dd invocation. Copy and convert a file.
* df: (fileutils)df invocation. Report filesystems' disk usage. * df: (fileutils)df invocation. Report filesystem disk usage.
* diff3: (diff)Invoking diff3. Three-way diff. * diff3: (diff)Invoking diff3. Three-way diff.
* dir: (fileutils)dir invocation. List directories briefly. * dir: (fileutils)dir invocation. List directories briefly.
* dircolors: (fileutils)dircolors invocation. Color setup for ls.
* dirname: (sh-utils)dirname invocation. Strip non-directory suffix. * dirname: (sh-utils)dirname invocation. Strip non-directory suffix.
* dmp: (web2c)Dmp invocation. Troff->MPX (MetaPost pictures). * dmp: (web2c)Dmp invocation. Troff->MPX (MetaPost pictures).
* du: (fileutils)du invocation. Report on disk usage. * du: (fileutils)du invocation. Report on disk usage.
...@@ -188,6 +193,7 @@ Individual utilities ...@@ -188,6 +193,7 @@ Individual utilities
* etags: (emacs)Create Tags Table. Creating a TAGS table. * etags: (emacs)Create Tags Table. Creating a TAGS table.
* expand: (textutils)expand invocation. Convert tabs to spaces. * expand: (textutils)expand invocation. Convert tabs to spaces.
* expr: (sh-utils)expr invocation. Evaluate expressions. * expr: (sh-utils)expr invocation. Evaluate expressions.
* factor: (sh-utils)factor invocation. Print prime factors
* false: (sh-utils)false invocation. Do nothing, unsuccessfully. * false: (sh-utils)false invocation. Do nothing, unsuccessfully.
* fid: (id-utils)fid invocation. Listing a file's identifiers. * fid: (id-utils)fid invocation. Listing a file's identifiers.
* file-pr: (gnats)file-pr. Processing incoming traffic. * file-pr: (gnats)file-pr. Processing incoming traffic.
...@@ -195,6 +201,7 @@ Individual utilities ...@@ -195,6 +201,7 @@ Individual utilities
* fmt: (textutils)fmt invocation. Reformat paragraph text. * fmt: (textutils)fmt invocation. Reformat paragraph text.
* fold: (textutils)fold invocation. Wrap long input lines. * fold: (textutils)fold invocation. Wrap long input lines.
* g++: (gcc)Invoking G++. The GNU C++ compiler. * g++: (gcc)Invoking G++. The GNU C++ compiler.
* gettextize: (gettext)gettextize Invocation. Prepare a package for gettext.
* gftodvi: (web2c)GFtoDVI invocation. Generic font proofsheets. * gftodvi: (web2c)GFtoDVI invocation. Generic font proofsheets.
* gftopk: (web2c)GFtoPK invocation. Generic to packed fonts. * gftopk: (web2c)GFtoPK invocation. Generic to packed fonts.
* gftype: (web2c)GFtype invocation. GF to human-readable text. * gftype: (web2c)GFtype invocation. GF to human-readable text.
...@@ -223,6 +230,7 @@ Individual utilities ...@@ -223,6 +230,7 @@ Individual utilities
* maketexpk: (kpathsea)MakeTeX scripts. PK bitmap generation. * maketexpk: (kpathsea)MakeTeX scripts. PK bitmap generation.
* maketextex: (kpathsea)MakeTeX scripts. TeX source generation. * maketextex: (kpathsea)MakeTeX scripts. TeX source generation.
* maketextfm: (kpathsea)MakeTeX scripts. TeX font metric generation. * maketextfm: (kpathsea)MakeTeX scripts. TeX font metric generation.
* md5sum: (textutils)md5sum invocation. Print or check message-digests.
* mf: (web2c)mf invocation. Creating typeface families. * mf: (web2c)mf invocation. Creating typeface families.
* mft: (web2c)MFT invocation. Prettyprinting Metafont source. * mft: (web2c)MFT invocation. Prettyprinting Metafont source.
* mkdir: (fileutils)mkdir invocation. Create directories. * mkdir: (fileutils)mkdir invocation. Create directories.
...@@ -231,6 +239,8 @@ Individual utilities ...@@ -231,6 +239,8 @@ Individual utilities
* mknod: (fileutils)mknod invocation. Create special files. * mknod: (fileutils)mknod invocation. Create special files.
* mp: (web2c)mp invocation. Creating technical diagrams. * mp: (web2c)mp invocation. Creating technical diagrams.
* mpto: (web2c)MPto invocation. MetaPost label extraction. * mpto: (web2c)MPto invocation. MetaPost label extraction.
* msgfmt: (gettext)msgfmt Invocation. Make MO files out of PO files.
* msgmerge: (gettext)msgmerge Invocation. Update two PO files into one.
* mv: (fileutils)mv invocation. Rename files. * mv: (fileutils)mv invocation. Rename files.
* newer: (web2c)Newer invocation. Compare modification times. * newer: (web2c)Newer invocation. Compare modification times.
* nice: (sh-utils)nice invocation. Modify scheduling priority. * nice: (sh-utils)nice invocation. Modify scheduling priority.
...@@ -263,6 +273,7 @@ Individual utilities ...@@ -263,6 +273,7 @@ Individual utilities
* rmdir: (fileutils)rmdir invocation. Remove empty directories. * rmdir: (fileutils)rmdir invocation. Remove empty directories.
* sdiff: (diff)Invoking sdiff. Interactively merge files. * sdiff: (diff)Invoking sdiff. Interactively merge files.
* send-pr: (gnats)Invoking send-pr. Submitting bugs. * send-pr: (gnats)Invoking send-pr. Submitting bugs.
* seq: (sh-utils)seq invocation. Print numeric sequences
* shar: (sharutils)shar invocation. Create shell archive. * shar: (sharutils)shar invocation. Create shell archive.
* size: (binutils)size. List object file section sizes. * size: (binutils)size. List object file section sizes.
* sleep: (sh-utils)sleep invocation. Delay for a specified time. * sleep: (sh-utils)sleep invocation. Delay for a specified time.
...@@ -305,5 +316,6 @@ Individual utilities ...@@ -305,5 +316,6 @@ Individual utilities
* who: (sh-utils)who invocation. Print who is logged in. * who: (sh-utils)who invocation. Print who is logged in.
* whoami: (sh-utils)whoami invocation. Print effective user id. * whoami: (sh-utils)whoami invocation. Print effective user id.
* xargs: (find)Invoking xargs. Operating on many files. * xargs: (find)Invoking xargs. Operating on many files.
* xgettext: (gettext)xgettext Invocation. Extract strings into a PO file.
* yes: (sh-utils)yes invocation. Print a string indefinitely. * yes: (sh-utils)yes invocation. Print a string indefinitely.
* zcat: (gzip)Overview. Decompression to stdout. * zcat: (gzip)Overview. Decompression to stdout.
# Makefile for Texinfo/emacs. # Makefile.in generated automatically by automake 1.2 from Makefile.am
# 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)
#
srcdir = @srcdir@ # Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
VPATH = @srcdir@ # This Makefile.in is free software; the Free Software Foundation
SHELL = /bin/sh # gives unlimited permission to copy, distribute and modify it.
RM = rm -f
# 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 = @srcdir@
$(srcdir)/elisp-comp $< 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: Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
sub-all: all 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: dvi:
check: all
$(MAKE)
installcheck:
install-info: install-info:
install-exec:
@$(NORMAL_INSTALL)
elisp: $(ELISP_OBJS) install-data: install-data-local
.PHONY: elisp @$(NORMAL_INSTALL)
# Nobody likes any of these install targets. Fine. Install it install: install-exec install-data all
# manually, then. @:
install:
@echo Please install the Emacs Lisp files manually.
uninstall: 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:
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."
# 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 @@ ...@@ -71,7 +71,8 @@
(delete-region (point) end))) (delete-region (point) end)))
(goto-char (point-max)) (goto-char (point-max))
(insert "\^_\f\nTag table:\n") (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)) (setq list (nreverse list))
(while list (while list
(insert "Node: " (car (car list)) ?\177) (insert "Node: " (car (car list)) ?\177)
...@@ -152,6 +153,10 @@ contains just the tag table and a directory of subfiles." ...@@ -152,6 +153,10 @@ contains just the tag table and a directory of subfiles."
(search-forward "\nTag Table:\n") (search-forward "\nTag Table:\n")
(insert "(Indirect)\n"))) (insert "(Indirect)\n")))
(defvar Info-validate-allnodes)
(defvar Info-validate-thisnode)
(defvar Info-validate-lossages)
;;;###autoload ;;;###autoload
(defun Info-validate () (defun Info-validate ()
"Check current buffer for validity as an Info file. "Check current buffer for validity as an Info file.
...@@ -165,11 +170,11 @@ Check that every node pointer points to an existing node." ...@@ -165,11 +170,11 @@ Check that every node pointer points to an existing node."
(error "Don't yet know how to validate indirect info files: \"%s\"" (error "Don't yet know how to validate indirect info files: \"%s\""
(buffer-name (current-buffer)))) (buffer-name (current-buffer))))
(goto-char (point-min)) (goto-char (point-min))
(let ((allnodes '(("*"))) (let ((Info-validate-allnodes '(("*")))
(regexp "Node:[ \t]*\\([^,\n\t]*\\)[,\t\n]") (regexp "Node:[ \t]*\\([^,\n\t]*\\)[,\t\n]")
(case-fold-search t) (case-fold-search t)
(tags-losing nil) (tags-losing nil)
(lossages ())) (Info-validate-lossages ()))
(while (search-forward "\n\^_" nil t) (while (search-forward "\n\^_" nil t)
(forward-line 1) (forward-line 1)
(let ((beg (point))) (let ((beg (point)))
...@@ -182,11 +187,11 @@ Check that every node pointer points to an existing node." ...@@ -182,11 +187,11 @@ Check that every node pointer points to an existing node."
(goto-char (match-end 1)) (goto-char (match-end 1))
(skip-chars-backward " \t") (skip-chars-backward " \t")
(point)))))) (point))))))
(if (assoc name allnodes) (if (assoc name Info-validate-allnodes)
(setq lossages (setq Info-validate-lossages
(cons (list name "Duplicate node-name" nil) (cons (list name "Duplicate node-name" nil)
lossages)) Info-validate-lossages))
(setq allnodes (setq Info-validate-allnodes
(cons (list name (cons (list name
(progn (progn
(end-of-line) (end-of-line)
...@@ -197,18 +202,18 @@ Check that every node pointer points to an existing node." ...@@ -197,18 +202,18 @@ Check that every node pointer points to an existing node."
(downcase (downcase
(Info-following-node-name))))) (Info-following-node-name)))))
beg) beg)
allnodes))))))) Info-validate-allnodes)))))))
(goto-char (point-min)) (goto-char (point-min))
(while (search-forward "\n\^_" nil t) (while (search-forward "\n\^_" nil t)
(forward-line 1) (forward-line 1)
(let ((beg (point)) (let ((beg (point))
thisnode next) Info-validate-thisnode next)
(forward-line 1) (forward-line 1)
(if (re-search-backward regexp beg t) (if (re-search-backward regexp beg t)
(save-restriction (save-restriction
(search-forward "\n\^_" nil 'move) (search-forward "\n\^_" nil 'move)
(narrow-to-region beg (point)) (narrow-to-region beg (point))
(setq thisnode (downcase (setq Info-validate-thisnode (downcase
(buffer-substring-no-properties (buffer-substring-no-properties
(match-beginning 1) (match-beginning 1)
(progn (progn
...@@ -218,23 +223,24 @@ Check that every node pointer points to an existing node." ...@@ -218,23 +223,24 @@ Check that every node pointer points to an existing node."
(end-of-line) (end-of-line)
(and (search-backward "next:" nil t) (and (search-backward "next:" nil t)
(setq next (Info-validate-node-name "invalid Next")) (setq next (Info-validate-node-name "invalid Next"))
(assoc next allnodes) (assoc next Info-validate-allnodes)
(if (equal (car (cdr (assoc next allnodes))) (if (equal (car (cdr (assoc next Info-validate-allnodes)))
thisnode) Info-validate-thisnode)
;; allow multiple `next' pointers to one node ;; allow multiple `next' pointers to one node
(let ((tem lossages)) (let ((tem Info-validate-lossages))
(while tem (while tem
(if (and (equal (car (cdr (car tem))) (if (and (equal (car (cdr (car tem)))
"should have Previous") "should have Previous")
(equal (car (car tem)) (equal (car (car tem))
next)) next))
(setq lossages (delq (car tem) lossages))) (setq Info-validate-lossages
(delq (car tem) Info-validate-lossages)))
(setq tem (cdr tem)))) (setq tem (cdr tem))))
(setq lossages (setq Info-validate-lossages
(cons (list next (cons (list next
"should have Previous" "should have Previous"
thisnode) Info-validate-thisnode)
lossages)))) Info-validate-lossages))))
(end-of-line) (end-of-line)
(if (re-search-backward "prev[ious]*:" nil t) (if (re-search-backward "prev[ious]*:" nil t)
(Info-validate-node-name "invalid Previous")) (Info-validate-node-name "invalid Previous"))
...@@ -262,29 +268,29 @@ Check that every node pointer points to an existing node." ...@@ -262,29 +268,29 @@ Check that every node pointer points to an existing node."
(point)))) (point))))
(Info-extract-menu-node-name "Bad format cross-reference"))))))) (Info-extract-menu-node-name "Bad format cross-reference")))))))
(setq tags-losing (not (Info-validate-tags-table))) (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*" (with-output-to-temp-buffer " *problems in info file*"
(while lossages (while Info-validate-lossages
(princ "In node \"") (princ "In node \"")
(princ (car (car lossages))) (princ (car (car Info-validate-lossages)))
(princ "\", ") (princ "\", ")
(let ((tem (nth 1 (car lossages)))) (let ((tem (nth 1 (car Info-validate-lossages))))
(cond ((string-match "\n" tem) (cond ((string-match "\n" tem)
(princ (substring tem 0 (match-beginning 0))) (princ (substring tem 0 (match-beginning 0)))
(princ "...")) (princ "..."))
(t (t
(princ tem)))) (princ tem))))
(if (nth 2 (car lossages)) (if (nth 2 (car Info-validate-lossages))
(progn (progn
(princ ": ") (princ ": ")
(let ((tem (nth 2 (car lossages)))) (let ((tem (nth 2 (car Info-validate-lossages))))
(cond ((string-match "\n" tem) (cond ((string-match "\n" tem)
(princ (substring tem 0 (match-beginning 0))) (princ (substring tem 0 (match-beginning 0)))
(princ "...")) (princ "..."))
(t (t
(princ tem)))))) (princ tem))))))
(terpri) (terpri)
(setq lossages (cdr lossages))) (setq Info-validate-lossages (cdr Info-validate-lossages)))
(if tags-losing (princ "\nTags table must be recomputed\n"))) (if tags-losing (princ "\nTags table must be recomputed\n")))
;; Here if info file is valid. ;; Here if info file is valid.
;; If we already made a list of problems, clear it out. ;; If we already made a list of problems, clear it out.
...@@ -313,9 +319,10 @@ Check that every node pointer points to an existing node." ...@@ -313,9 +319,10 @@ Check that every node pointer points to an existing node."
nil nil
(setq name (downcase name)) (setq name (downcase name))
(or (and (> (length name) 0) (= (aref name 0) ?\()) (or (and (> (length name) 0) (= (aref name 0) ?\())
(assoc name allnodes) (assoc name Info-validate-allnodes)
(setq lossages (setq Info-validate-lossages
(cons (list thisnode kind name) lossages)))) (cons (list Info-validate-thisnode kind name)
Info-validate-lossages))))
name) name)
(defun Info-validate-tags-table () (defun Info-validate-tags-table ()
...@@ -327,7 +334,7 @@ Check that every node pointer points to an existing node." ...@@ -327,7 +334,7 @@ Check that every node pointer points to an existing node."
(start (progn (search-backward "\nTag table:\n") (start (progn (search-backward "\nTag table:\n")
(1- (match-end 0)))) (1- (match-end 0))))
tem) tem)
(setq tem allnodes) (setq tem Info-validate-allnodes)
(while tem (while tem
(goto-char start) (goto-char start)
(or (equal (car (car tem)) "*") (or (equal (car (car tem)) "*")
...@@ -342,7 +349,7 @@ Check that every node pointer points to an existing node." ...@@ -342,7 +349,7 @@ Check that every node pointer points to an existing node."
(setq tem (downcase (buffer-substring-no-properties (setq tem (downcase (buffer-substring-no-properties
(match-beginning 1) (match-beginning 1)
(match-end 1)))) (match-end 1))))
(setq tem (assoc tem allnodes)) (setq tem (assoc tem Info-validate-allnodes))
(if (or (not tem) (if (or (not tem)
(< 1000 (progn (< 1000 (progn
(goto-char (match-beginning 2)) (goto-char (match-beginning 2))
...@@ -426,4 +433,6 @@ For example, invoke \"emacs -batch -f batch-info-validate $info/ ~/*.info\"" ...@@ -426,4 +433,6 @@ For example, invoke \"emacs -batch -f batch-info-validate $info/ ~/*.info\""
(error (message ">> Error: %s" (prin1-to-string err)))))) (error (message ">> Error: %s" (prin1-to-string err))))))
(kill-emacs error)))) (kill-emacs error))))
(provide 'informat)
;;; informat.el ends here ;;; informat.el ends here
...@@ -47,15 +47,24 @@ ...@@ -47,15 +47,24 @@
(require 'compile) (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. "*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'. "*String containing options for running `makeinfo'.
Do not include `--footnote-style' or `--paragraph-indent'; Do not include `--footnote-style' or `--paragraph-indent';
the proper way to specify those is with the Texinfo commands the proper way to specify those is with the Texinfo commands
`@footnotestyle` and `@paragraphindent'.") `@footnotestyle` and `@paragraphindent'."
:type 'string
:group 'makeinfo)
(require 'texinfo) (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 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 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 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 Copyright (C) 1993, 97 Free Software Foundation, Inc.
stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -21,13 +19,7 @@ ...@@ -21,13 +19,7 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#include <stdio.h> #include "info.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-utils.h" #include "info-utils.h"
#include "filesys.h" #include "filesys.h"
#include "tilde.h" #include "tilde.h"
...@@ -37,23 +29,53 @@ ...@@ -37,23 +29,53 @@
dirs_to_add which are found in INFOPATH. */ dirs_to_add which are found in INFOPATH. */
static void add_menu_to_file_buffer (), insert_text_into_fb_at_binding (); static void add_menu_to_file_buffer (), insert_text_into_fb_at_binding ();
static void build_dir_node_internal ();
static char *dirs_to_add[] = { static char *dirs_to_add[] = {
"dir", "localdir", (char *)NULL "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 void
maybe_build_dir_node (dirname) maybe_build_dir_node (dirname)
char *dirname; char *dirname;
{ {
FILE_BUFFER *dir_buffer;
int path_index, update_tags; int path_index, update_tags;
char *this_dir; char *this_dir;
FILE_BUFFER *dir_buffer = info_find_file (dirname);
/* Check to see if the file has already been built. If so, then
do not build it again. */
dir_buffer = info_find_file (dirname);
/* If there is no "dir" in the current info path, we cannot build one /* If there is no "dir" in the current info path, we cannot build one
from nothing. */ from nothing. */
...@@ -64,6 +86,10 @@ maybe_build_dir_node (dirname) ...@@ -64,6 +86,10 @@ maybe_build_dir_node (dirname)
if (dir_buffer->flags & N_CannotGC) if (dir_buffer->flags & N_CannotGC)
return; 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; path_index = update_tags = 0;
/* Using each element of the path, check for one of the files in /* Using each element of the path, check for one of the files in
...@@ -71,7 +97,7 @@ maybe_build_dir_node (dirname) ...@@ -71,7 +97,7 @@ maybe_build_dir_node (dirname)
Only files explictly named are eligible. This is a design decision. Only files explictly named are eligible. This is a design decision.
There can be an info file name "localdir.info" which contains There can be an info file name "localdir.info" which contains
information on the setting up of "localdir" files. */ 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; register int da_index;
char *from_file; char *from_file;
...@@ -89,17 +115,15 @@ maybe_build_dir_node (dirname) ...@@ -89,17 +115,15 @@ maybe_build_dir_node (dirname)
} }
} }
/* For every file named in DIRS_TO_ADD found in the search path, /* For every different file named in DIRS_TO_ADD found in the
add the contents of that file's menu to our "dir" node. */ search path, add that file's menu to our "dir" node. */
for (da_index = 0; from_file = dirs_to_add[da_index]; da_index++) for (da_index = 0; (from_file = dirs_to_add[da_index]); da_index++)
{ {
struct stat finfo; struct stat finfo;
char *fullpath; int statable;
int namelen, statable; int namelen = strlen (from_file);
char *fullpath = xmalloc (3 + strlen (this_dir) + namelen);
namelen = strlen (from_file);
fullpath = (char *)xmalloc (3 + strlen (this_dir) + namelen);
strcpy (fullpath, this_dir); strcpy (fullpath, this_dir);
if (fullpath[strlen (fullpath) - 1] != '/') if (fullpath[strlen (fullpath) - 1] != '/')
strcat (fullpath, "/"); strcat (fullpath, "/");
...@@ -107,16 +131,12 @@ maybe_build_dir_node (dirname) ...@@ -107,16 +131,12 @@ maybe_build_dir_node (dirname)
statable = (stat (fullpath, &finfo) == 0); statable = (stat (fullpath, &finfo) == 0);
/* Only add the contents of this file if it is not identical to the /* Only add this file if we have not seen it before. */
file of the DIR buffer. */ if (statable && S_ISREG (finfo.st_mode) && new_dir_file_p (&finfo))
if ((statable && S_ISREG (finfo.st_mode)) &&
(strcmp (dir_buffer->fullpath, fullpath) != 0))
{ {
long filesize; long filesize;
char *contents; char *contents = filesys_read_info_file (fullpath, &filesize,
&finfo);
contents = filesys_read_info_file (fullpath, &filesize, &finfo);
if (contents) if (contents)
{ {
update_tags++; update_tags++;
......
/* display.c -- How to display Info windows. */ /* display.c -- How to display Info windows.
$Id: display.c,v 1.6 1997/07/24 21:13:27 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation Copyright (C) 1993, 97 Free Software Foundation, Inc.
stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -21,10 +19,7 @@ ...@@ -21,10 +19,7 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#include <stdio.h> #include "info.h"
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "display.h" #include "display.h"
extern int info_any_buffered_input_p (); /* Found in session.c. */ extern int info_any_buffered_input_p (); /* Found in session.c. */
...@@ -57,7 +52,7 @@ display_clear_display (display) ...@@ -57,7 +52,7 @@ display_clear_display (display)
register int i; register int i;
register DISPLAY_LINE *display_line; register DISPLAY_LINE *display_line;
for (i = 0; display_line = display[i]; i++) for (i = 0; (display_line = display[i]); i++)
{ {
display[i]->text[0] = '\0'; display[i]->text[0] = '\0';
display[i]->textlen = 0; display[i]->textlen = 0;
...@@ -512,6 +507,7 @@ display_cursor_at_point (window) ...@@ -512,6 +507,7 @@ display_cursor_at_point (window)
vpos = window_line_of_point (window) - window->pagetop + window->first_row; vpos = window_line_of_point (window) - window->pagetop + window->first_row;
hpos = window_get_cursor_column (window); hpos = window_get_cursor_column (window);
terminal_goto_xy (hpos, vpos); terminal_goto_xy (hpos, vpos);
fflush (stdout);
} }
/* **************************************************************** */ /* **************************************************************** */
...@@ -552,7 +548,7 @@ free_display (display) ...@@ -552,7 +548,7 @@ free_display (display)
if (!display) if (!display)
return; return;
for (i = 0; display_line = display[i]; i++) for (i = 0; (display_line = display[i]); i++)
{ {
free (display_line->text); free (display_line->text);
free (display_line); free (display_line);
......
/* 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. 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 This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -21,8 +22,8 @@ ...@@ -21,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_DISPLAY_H_) #ifndef INFO_DISPLAY_H
#define _DISPLAY_H_ #define INFO_DISPLAY_H
#include "info-utils.h" #include "info-utils.h"
#include "terminal.h" #include "terminal.h"
...@@ -73,4 +74,4 @@ extern void display_scroll_display (); ...@@ -73,4 +74,4 @@ extern void display_scroll_display ();
that appear in the OLD_STARTS array. */ that appear in the OLD_STARTS array. */
extern void display_scroll_line_starts (); extern void display_scroll_line_starts ();
#endif /* !_DISPLAY_H_ */ #endif /* not INFO_DISPLAY_H */
...@@ -21,18 +21,10 @@ ...@@ -21,18 +21,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_DOC_H_) #if !defined (DOC_H)
#define _DOC_H_ #define DOC_H
#if !defined (NULL) #include "info.h" /* for NAMED_FUNCTIONS, VFunction, etc. */
# define NULL 0x0
#endif /* !NULL */
#if !defined (__FUNCTION_DEF)
# define __FUNCTION_DEF
typedef int Function ();
typedef void VFunction ();
#endif /* _FUNCTION_DEF */
typedef struct { typedef struct {
VFunction *func; VFunction *func;
...@@ -55,4 +47,4 @@ extern void dump_map_to_message_buffer (); ...@@ -55,4 +47,4 @@ extern void dump_map_to_message_buffer ();
extern char *function_name (); extern char *function_name ();
extern VFunction *named_function (); extern VFunction *named_function ();
#endif /* NAMED_FUNCTIONS */ #endif /* NAMED_FUNCTIONS */
#endif /* !_DOC_H_ */ #endif /* !DOC_H */
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#include <stdio.h> #include "info.h"
#include "dribble.h" #include "dribble.h"
/* When non-zero, it is a stream to write all input characters to for the /* When non-zero, it is a stream to write all input characters to for the
......
/* filesys.c -- File system specific functions for hacking this system. */ /* filesys.c -- File system specific functions for hacking this system.
$Id: filesys.c,v 1.4 1997/07/24 21:23:07 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation Copyright (C) 1993, 97 Free Software Foundation, Inc.
stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -21,49 +19,17 @@ ...@@ -21,49 +19,17 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#include <stdio.h> #include "info.h"
#include <sys/types.h>
#include <sys/stat.h>
#if defined (HAVE_SYS_FILE_H)
#include <sys/file.h>
#endif /* HAVE_SYS_FILE_H */
#include <sys/errno.h>
#include "general.h"
#include "tilde.h" #include "tilde.h"
#include "filesys.h" #include "filesys.h"
#if !defined (O_RDONLY)
#if defined (HAVE_SYS_FCNTL_H)
#include <sys/fcntl.h>
#else /* !HAVE_SYS_FCNTL_H */
#include <fcntl.h>
#endif /* !HAVE_SYS_FCNTL_H */
#endif /* !O_RDONLY */
#if !defined (errno)
extern int errno;
#endif /* !errno */
/* Found in info-utils.c. */
extern char *filename_non_directory ();
#if !defined (BUILDING_LIBRARY)
/* Found in session.c */
extern int info_windows_initialized_p;
/* Found in window.c. */
extern void message_in_echo_area (), unmessage_in_echo_area ();
#endif /* !BUILDING_LIBRARY */
/* Local to this file. */ /* Local to this file. */
static char *info_file_in_path (), *lookup_info_filename (); static char *info_file_in_path (), *lookup_info_filename ();
static void remember_info_filename (), maybe_initialize_infopath (); static void remember_info_filename (), maybe_initialize_infopath ();
#if !defined (NULL) typedef struct
# define NULL 0x0 {
#endif /* !NULL */
typedef struct {
char *suffix; char *suffix;
char *decompressor; char *decompressor;
} COMPRESSION_ALIST; } COMPRESSION_ALIST;
...@@ -183,7 +149,7 @@ info_file_in_path (filename, path) ...@@ -183,7 +149,7 @@ info_file_in_path (filename, path)
dirname_index = 0; dirname_index = 0;
while (temp_dirname = extract_colon_unit (path, &dirname_index)) while ((temp_dirname = extract_colon_unit (path, &dirname_index)))
{ {
register int i, pre_suffix_length; register int i, pre_suffix_length;
char *temp; char *temp;
...@@ -226,7 +192,7 @@ info_file_in_path (filename, path) ...@@ -226,7 +192,7 @@ info_file_in_path (filename, path)
{ {
char *newpath, *filename_only, *newtemp; char *newpath, *filename_only, *newtemp;
newpath = strdup (temp); newpath = xstrdup (temp);
filename_only = filename_non_directory (filename); filename_only = filename_non_directory (filename);
newtemp = info_file_in_path (filename_only, newpath); newtemp = info_file_in_path (filename_only, newpath);
...@@ -344,8 +310,8 @@ remember_info_filename (filename, expansion) ...@@ -344,8 +310,8 @@ remember_info_filename (filename, expansion)
} }
new = (FILENAME_LIST *)xmalloc (sizeof (FILENAME_LIST)); new = (FILENAME_LIST *)xmalloc (sizeof (FILENAME_LIST));
new->filename = strdup (filename); new->filename = xstrdup (filename);
new->expansion = expansion ? strdup (expansion) : (char *)NULL; new->expansion = expansion ? xstrdup (expansion) : (char *)NULL;
names_and_files[names_and_files_index++] = new; names_and_files[names_and_files_index++] = new;
names_and_files[names_and_files_index] = (FILENAME_LIST *)NULL; names_and_files[names_and_files_index] = (FILENAME_LIST *)NULL;
...@@ -392,7 +358,7 @@ info_add_path (path, where) ...@@ -392,7 +358,7 @@ info_add_path (path, where)
} }
else if (where == INFOPATH_PREPEND) else if (where == INFOPATH_PREPEND)
{ {
char *temp = strdup (infopath); char *temp = xstrdup (infopath);
strcpy (infopath, path); strcpy (infopath, path);
strcat (infopath, ":"); strcat (infopath, ":");
strcat (infopath, temp); strcat (infopath, temp);
......
/* 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. 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 This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -21,8 +22,8 @@ ...@@ -21,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_FILESYS_H_) #ifndef INFO_FILESYS_H
#define _FILESYS_H_ #define INFO_FILESYS_H
/* The path on which we look for info files. You can initialize this /* 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 from the environment variable INFOPATH if there is one, or you can
...@@ -70,7 +71,7 @@ extern char *extract_colon_unit (); ...@@ -70,7 +71,7 @@ extern char *extract_colon_unit ();
/* The default value of INFOPATH. */ /* The default value of INFOPATH. */
#if !defined (DEFAULT_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 */ #endif /* !DEFAULT_INFOPATH */
#if !defined (S_ISREG) && defined (S_IFREG) #if !defined (S_ISREG) && defined (S_IFREG)
...@@ -81,4 +82,4 @@ extern char *extract_colon_unit (); ...@@ -81,4 +82,4 @@ extern char *extract_colon_unit ();
# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) # define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
#endif /* !S_ISDIR && 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 Copyright (C) 1993, 97 Free Software Foundation, Inc.
stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -205,7 +203,7 @@ info_get_or_remove_footnotes (window) ...@@ -205,7 +203,7 @@ info_get_or_remove_footnotes (window)
/* If we are hacking automatic footnotes, and there are footnotes /* If we are hacking automatic footnotes, and there are footnotes
but we couldn't display them, print a message to that effect. */ but we couldn't display them, print a message to that effect. */
if (auto_footnotes_p) if (auto_footnotes_p)
inform_in_echo_area ("Footnotes could not be displayed"); inform_in_echo_area (_("Footnotes could not be displayed"));
return (FN_UNABLE); return (FN_UNABLE);
} }
} }
...@@ -231,10 +229,8 @@ info_get_or_remove_footnotes (window) ...@@ -231,10 +229,8 @@ info_get_or_remove_footnotes (window)
/* Show the footnotes associated with this node in another window. */ /* Show the footnotes associated with this node in another window. */
DECLARE_INFO_COMMAND (info_show_footnotes, 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. */ /* A negative argument means just make the window go away. */
if (count < 0) if (count < 0)
{ {
......
/* 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. 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 This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -21,11 +22,11 @@ ...@@ -21,11 +22,11 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_FOOTNOTES_H_) #ifndef INFO_FOOTNOTES_H
#define _FOOTNOTES_H_ #define INFO_FOOTNOTES_H
/* Magic string which indicates following text is footnotes. */ /* Magic string which indicates following text is footnotes. */
#define FOOTNOTE_LABEL "---------- Footnotes ----------" #define FOOTNOTE_LABEL _("---------- Footnotes ----------")
#define FN_FOUND 0 #define FN_FOUND 0
#define FN_UNFOUND 1 #define FN_UNFOUND 1
...@@ -42,5 +43,4 @@ extern int info_get_or_remove_footnotes (); ...@@ -42,5 +43,4 @@ extern int info_get_or_remove_footnotes ();
/* Non-zero means attempt to show footnotes when displaying a new window. */ /* Non-zero means attempt to show footnotes when displaying a new window. */
extern int auto_footnotes_p; extern int auto_footnotes_p;
#endif /* !_FOOTNOTES_H_ */ #endif /* not INFO_FOOTNOTES_H */
...@@ -56,7 +56,7 @@ gc_pointers () ...@@ -56,7 +56,7 @@ gc_pointers ()
if (!info_windows || !gcable_pointers_index) if (!info_windows || !gcable_pointers_index)
return; 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++) 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. 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 This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -21,8 +22,8 @@ ...@@ -21,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_GC_H_) #ifndef INFO_GC_H
#define _GC_H_ #define INFO_GC_H
/* Add POINTER to the list of garbage collectible pointers. A pointer /* Add POINTER to the list of garbage collectible pointers. A pointer
is not actually garbage collected until no info window contains a node is not actually garbage collected until no info window contains a node
...@@ -33,4 +34,4 @@ extern void add_gcable_pointer (); ...@@ -33,4 +34,4 @@ extern void add_gcable_pointer ();
node->contents which are collectible, and free them. */ node->contents which are collectible, and free them. */
extern void gc_pointers (); 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. 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 This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -21,8 +22,8 @@ ...@@ -21,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_INDICES_H_) #ifndef INFO_INDICES_H
#define _INDICES_H_ #define INFO_INDICES_H
/* User-visible variable controls the output of info-index-next. */ /* User-visible variable controls the output of info-index-next. */
extern int show_index_match; extern int show_index_match;
...@@ -35,5 +36,7 @@ REFERENCE **apropos_in_all_indices (); ...@@ -35,5 +36,7 @@ REFERENCE **apropos_in_all_indices ();
/* User visible functions declared in indices.c. */ /* User visible functions declared in indices.c. */
extern void info_index_search (), info_next_index_match (); 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 @@ ...@@ -21,15 +21,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#include <stdio.h> /* For "NULL". Yechhh! */ #include "info.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 "info-utils.h" #include "info-utils.h"
#if defined (HANDLE_MAN_PAGES) #if defined (HANDLE_MAN_PAGES)
# include "man.h" # include "man.h"
#endif /* HANDLE_MAN_PAGES */ #endif /* HANDLE_MAN_PAGES */
...@@ -280,7 +273,7 @@ info_references_internal (label, binding) ...@@ -280,7 +273,7 @@ info_references_internal (label, binding)
nodename is the same as the label. */ nodename is the same as the label. */
if (*refdef == ':') if (*refdef == ':')
{ {
entry->nodename = strdup (entry->label); entry->nodename = xstrdup (entry->label);
} }
else else
{ {
...@@ -295,10 +288,10 @@ info_references_internal (label, binding) ...@@ -295,10 +288,10 @@ info_references_internal (label, binding)
info_parse_node (refdef, SKIP_NEWLINES); info_parse_node (refdef, SKIP_NEWLINES);
if (info_parsed_filename) if (info_parsed_filename)
entry->filename = strdup (info_parsed_filename); entry->filename = xstrdup (info_parsed_filename);
if (info_parsed_nodename) if (info_parsed_nodename)
entry->nodename = strdup (info_parsed_nodename); entry->nodename = xstrdup (info_parsed_nodename);
} }
add_pointer_to_array add_pointer_to_array
......
/* info-utils.h -- Exported functions and variables from info-util.c. /* info-utils.h -- Exported functions and variables from info-util.c.
$Id: info-utils.h,v 1.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 This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_INFO_UTILS_H_) #ifndef INFO_UTILS_H
#define _INFO_UTILS_H_ #define INFO_UTILS_H
#if !defined (HAVE_STRCHR) #if !defined (HAVE_STRCHR)
# undef strchr # undef strchr
...@@ -137,4 +137,4 @@ extern void info_parse_label (/* label, node */); ...@@ -137,4 +137,4 @@ extern void info_parse_label (/* label, node */);
info_parse_label (INFO_ALTPREV_LABEL, n); \ info_parse_label (INFO_ALTPREV_LABEL, n); \
} while (0) } 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. 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 This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -21,24 +22,77 @@ ...@@ -21,24 +22,77 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_INFO_H_) #if !defined (INFO_H)
#define _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 "filesys.h"
#include "display.h" #include "display.h"
#include "session.h" #include "session.h"
#include "echo_area.h" #include "echo-area.h"
#include "doc.h" #include "doc.h"
#include "footnotes.h" #include "footnotes.h"
#include "gc.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. */ /* A structure associating the nodes visited in a particular window. */
typedef struct { typedef struct {
WINDOW *window; /* The window that this list is attached to. */ WINDOW *window; /* The window that this list is attached to. */
...@@ -78,23 +132,34 @@ extern int info_major_version, info_minor_version, info_patch_level; ...@@ -78,23 +132,34 @@ extern int info_major_version, info_minor_version, info_patch_level;
extern char *version_string (); extern char *version_string ();
/* Error message defines. */ /* Error message defines. */
#define CANT_FIND_NODE "Cannot find the node \"%s\"." #define CANT_FIND_NODE _("Cannot find the node \"%s\".")
#define CANT_FILE_NODE "Cannot find the node \"(%s)%s\"." #define CANT_FILE_NODE _("Cannot find the node \"(%s)%s\".")
#define CANT_FIND_WIND "Cannot find a window!" #define CANT_FIND_WIND _("Cannot find a window!")
#define CANT_FIND_POINT "Point doesn't appear within this window's node!" #define CANT_FIND_POINT _("Point doesn't appear within this window's node!")
#define CANT_KILL_LAST "Cannot delete the last window." #define CANT_KILL_LAST _("Cannot delete the last window.")
#define NO_MENU_NODE "No menu in this node." #define NO_MENU_NODE _("No menu in this node.")
#define NO_FOOT_NODE "No footnotes in this node." #define NO_FOOT_NODE _("No footnotes in this node.")
#define NO_XREF_NODE "No cross references in this node." #define NO_XREF_NODE _("No cross references in this node.")
#define NO_POINTER "No \"%s\" pointer for this node." #define NO_POINTER _("No \"%s\" pointer for this node.")
#define UNKNOWN_COMMAND "Unknown Info command `%c'. `?' for help." #define UNKNOWN_COMMAND _("Unknown Info command `%c'. `?' for help.")
#define TERM_TOO_DUMB "Terminal type \"%s\" is not smart enough to run Info." #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_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 AT_NODE_TOP _("You are already at the first page of this node.")
#define ONE_WINDOW "Only one window." #define ONE_WINDOW _("Only one window.")
#define WIN_TOO_SMALL "Resulting window would be too small." #define WIN_TOO_SMALL _("Resulting window would be too small.")
#define CANT_MAKE_HELP \ #define CANT_MAKE_HELP \
"There isn't enough room to make a help window. Please delete a window." _("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;
#endif /* !_INFO_H_ */ /* Found in window.c. */
extern void message_in_echo_area (), unmessage_in_echo_area ();
#endif /* !BUILDING_LIBRARY */
#endif /* !INFO_H */
/* infodoc.c -- Functions which build documentation nodes. */ /* infodoc.c -- Functions which build documentation nodes.
$Id: infodoc.c,v 1.4 1997/07/25 21:08:40 karl Exp $
/* This file is part of GNU Info, a program for reading online documentation Copyright (C) 1993, 97 Free Software Foundation, Inc.
stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -49,10 +47,12 @@ static char *internal_info_help_node_contents = (char *)NULL; ...@@ -49,10 +47,12 @@ static char *internal_info_help_node_contents = (char *)NULL;
/* The static text which appears in the internal info help node. */ /* The static text which appears in the internal info help node. */
static char *info_internal_help_text[] = { static char *info_internal_help_text[] = {
"Basic Commands in Info Windows", N_ ("Basic Commands in Info Windows"),
"******************************", "******************************",
"", "",
" h Invoke the Info tutorial.", " h Invoke the Info tutorial.",
" CTRL-x 0 Quit this help.",
" q Quit Info altogether.",
"", "",
"Selecting other nodes:", "Selecting other nodes:",
"----------------------", "----------------------",
...@@ -72,9 +72,8 @@ static char *info_internal_help_text[] = { ...@@ -72,9 +72,8 @@ static char *info_internal_help_text[] = {
" b Go to the beginning of this node.", " b Go to the beginning of this node.",
" e Go to the end of this node.", " e Go to the end of this node.",
"", "",
"\"Advanced\" commands:", "Other commands:",
"--------------------", "--------------------",
" q Quit Info.",
" 1 Pick first item in node's menu.", " 1 Pick first item in node's menu.",
" 2-9 Pick second ... ninth item in node's menu.", " 2-9 Pick second ... ninth item in node's menu.",
" 0 Pick last item in node's menu.", " 0 Pick last item in node's menu.",
...@@ -82,7 +81,7 @@ static char *info_internal_help_text[] = { ...@@ -82,7 +81,7 @@ static char *info_internal_help_text[] = {
" You may include a filename as well, as in (FILENAME)NODENAME.", " You may include a filename as well, as in (FILENAME)NODENAME.",
" s Search through this Info file for a specified string,", " s Search through this Info file for a specified string,",
" and select the node in which the next occurrence is found.", " and select the node in which the next occurrence is found.",
(char *)NULL NULL
}; };
static char *where_is (), *where_is_internal (); static char *where_is (), *where_is_internal ();
...@@ -209,7 +208,7 @@ create_internal_info_help_node () ...@@ -209,7 +208,7 @@ create_internal_info_help_node ()
{ {
printf_to_message_buffer ("---------------------\n\n"); printf_to_message_buffer ("---------------------\n\n");
printf_to_message_buffer printf_to_message_buffer
("The following commands can only be invoked via M-x:\n\n"); (_("The following commands can only be invoked via M-x:\n\n"));
printed_one_mx = 1; printed_one_mx = 1;
} }
...@@ -226,7 +225,7 @@ create_internal_info_help_node () ...@@ -226,7 +225,7 @@ create_internal_info_help_node ()
printf_to_message_buffer printf_to_message_buffer
("%s", replace_in_documentation ("%s", replace_in_documentation
("--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n")); (_("--- Use `\\[history-node]' or `\\[kill-node]' to exit ---\n")));
node = message_buffer_to_node (); node = message_buffer_to_node ();
internal_info_help_node_contents = node->contents; internal_info_help_node_contents = node->contents;
} }
...@@ -326,7 +325,7 @@ info_find_or_create_help_window () ...@@ -326,7 +325,7 @@ info_find_or_create_help_window ()
} }
/* Create or move to the help window. */ /* Create or move to the help window. */
DECLARE_INFO_COMMAND (info_get_help_window, "Display help message") DECLARE_INFO_COMMAND (info_get_help_window, _("Display help message"))
{ {
WINDOW *help_window; WINDOW *help_window;
...@@ -344,7 +343,7 @@ DECLARE_INFO_COMMAND (info_get_help_window, "Display help message") ...@@ -344,7 +343,7 @@ DECLARE_INFO_COMMAND (info_get_help_window, "Display help message")
/* Show the Info help node. This means that the "info" file is installed /* Show the Info help node. This means that the "info" file is installed
where it can easily be found on your system. */ where it can easily be found on your system. */
DECLARE_INFO_COMMAND (info_get_info_help_node, "Visit Info node `(info)Help'") DECLARE_INFO_COMMAND (info_get_info_help_node, _("Visit Info node `(info)Help'"))
{ {
NODE *node; NODE *node;
char *nodename; char *nodename;
...@@ -468,7 +467,7 @@ key_documentation (key, map) ...@@ -468,7 +467,7 @@ key_documentation (key, map)
return ((char *)NULL); return ((char *)NULL);
} }
DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY") DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY"))
{ {
char keyname[50]; char keyname[50];
int keyname_index = 0; int keyname_index = 0;
...@@ -481,7 +480,7 @@ DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY") ...@@ -481,7 +480,7 @@ DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY")
while (1) while (1)
{ {
message_in_echo_area ("Describe key: %s", keyname); message_in_echo_area (_("Describe key: %s"), keyname);
keystroke = info_get_input_char (); keystroke = info_get_input_char ();
unmessage_in_echo_area (); unmessage_in_echo_area ();
...@@ -490,7 +489,7 @@ DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY") ...@@ -490,7 +489,7 @@ DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY")
if (map[ESC].type != ISKMAP) if (map[ESC].type != ISKMAP)
{ {
window_message_in_echo_area window_message_in_echo_area
("ESC %s is undefined.", pretty_keyname (UnMeta (keystroke))); (_("ESC %s is undefined."), pretty_keyname (UnMeta (keystroke)));
return; return;
} }
...@@ -507,7 +506,7 @@ DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY") ...@@ -507,7 +506,7 @@ DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY")
if (map[keystroke].function == (VFunction *)NULL) if (map[keystroke].function == (VFunction *)NULL)
{ {
message_in_echo_area ("%s is undefined.", keyname); message_in_echo_area (_("%s is undefined."), keyname);
return; return;
} }
else if (map[keystroke].type == ISKMAP) else if (map[keystroke].type == ISKMAP)
...@@ -533,7 +532,7 @@ DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY") ...@@ -533,7 +532,7 @@ DECLARE_INFO_COMMAND (describe_key, "Print documentation for KEY")
#if defined (NAMED_FUNCTIONS) #if defined (NAMED_FUNCTIONS)
sprintf (message, "%s (%s): %s.", keyname, funname, fundoc); sprintf (message, "%s (%s): %s.", keyname, funname, fundoc);
#else #else
sprintf (message, "%s is defined to %s.", keyname, fundoc); sprintf (message, _("%s is defined to %s."), keyname, fundoc);
#endif /* !NAMED_FUNCTIONS */ #endif /* !NAMED_FUNCTIONS */
window_message_in_echo_area ("%s", message); window_message_in_echo_area ("%s", message);
...@@ -729,7 +728,7 @@ DECLARE_INFO_COMMAND (info_where_is, ...@@ -729,7 +728,7 @@ DECLARE_INFO_COMMAND (info_where_is,
{ {
char *command_name; char *command_name;
command_name = read_function_name ("Where is command: ", window); command_name = read_function_name (_("Where is command: "), window);
if (!command_name) if (!command_name)
{ {
...@@ -751,20 +750,20 @@ DECLARE_INFO_COMMAND (info_where_is, ...@@ -751,20 +750,20 @@ DECLARE_INFO_COMMAND (info_where_is,
if (!location) if (!location)
{ {
info_error ("`%s' is not on any keys", command_name); info_error (_("`%s' is not on any keys"), command_name);
} }
else else
{ {
if (strncmp (location, "M-x ", 4) == 0) if (strncmp (location, "M-x ", 4) == 0)
window_message_in_echo_area window_message_in_echo_area
("%s can only be invoked via %s.", command_name, location); (_("%s can only be invoked via %s."), command_name, location);
else else
window_message_in_echo_area window_message_in_echo_area
("%s can be invoked via %s.", command_name, location); (_("%s can be invoked via %s."), command_name, location);
} }
} }
else else
info_error ("There is no function named `%s'", command_name); info_error (_("There is no function named `%s'"), command_name);
} }
free (command_name); free (command_name);
......
/* 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 Copyright (C) 1993, 97 Free Software Foundation, Inc.
stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -21,10 +19,10 @@ ...@@ -21,10 +19,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#include "stdio.h" #include "info.h"
#include "ctype.h"
#include "infomap.h" #include "infomap.h"
#include "funs.h" #include "funs.h"
#include "terminal.h"
/* Return a new keymap which has all the uppercase letters mapped to run /* Return a new keymap which has all the uppercase letters mapped to run
the function info_do_lowercase_version (). */ the function info_do_lowercase_version (). */
...@@ -94,6 +92,53 @@ keymap_discard_keymap (map) ...@@ -94,6 +92,53 @@ keymap_discard_keymap (map)
} }
} }
/* 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. */ /* Initialize the standard info keymaps. */
Keymap info_keymap = (Keymap)NULL; Keymap info_keymap = (Keymap)NULL;
...@@ -182,6 +227,31 @@ initialize_info_keymaps () ...@@ -182,6 +227,31 @@ initialize_info_keymaps ()
map['o'].function = info_next_window; map['o'].function = info_next_window;
map[DEL].function = ea_backward_kill_line; 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. */ /* Bind commands for Info window keymaps. */
map = info_keymap; map = info_keymap;
map[TAB].function = info_move_to_next_xref; map[TAB].function = info_move_to_next_xref;
...@@ -264,11 +334,35 @@ initialize_info_keymaps () ...@@ -264,11 +334,35 @@ initialize_info_keymaps ()
map['o'].function = info_next_window; map['o'].function = info_next_window;
map['t'].function = info_tile_windows; map['t'].function = info_tile_windows;
map['w'].function = info_toggle_wrap; map['w'].function = info_toggle_wrap;
}
/* Strings which represent the sequence of characters that the arrow keys /* Arrow key bindings for Info windows keymap. */
produce. If these keys begin with ESC, and the second character of the map = info_keymap;
sequence does not conflict with an existing binding in the Meta keymap, keymap_bind_keyseq (map, term_kN, &map[Control ('v')]); /* pagedown */
then bind the keys to do what C-p, C-n, C-f, and C-b do. */ keymap_bind_keyseq (map, term_ku, &map[Control ('p')]); /* up */
extern char *term_ku, *term_kd, *term_kr, *term_kl; 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,10 +21,10 @@ ...@@ -21,10 +21,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_INFOMAP_H_) #ifndef INFOMAP_H
#define _INFOMAP_H_ #define INFOMAP_H
#include "general.h" #include "info.h"
#define ESC '\033' #define ESC '\033'
#define DEL '\177' #define DEL '\177'
...@@ -79,4 +79,4 @@ extern void keymap_discard_keymap (); ...@@ -79,4 +79,4 @@ extern void keymap_discard_keymap ();
/* Initialize the info keymaps. */ /* Initialize the info keymaps. */
extern void initialize_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 Copyright (C) 1993, 97 Free Software Foundation, Inc.
stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -49,7 +47,7 @@ read_function_name (prompt, window) ...@@ -49,7 +47,7 @@ read_function_name (prompt, window)
REFERENCE *entry; REFERENCE *entry;
entry = (REFERENCE *)xmalloc (sizeof (REFERENCE)); 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->nodename = (char *)NULL;
entry->filename = (char *)NULL; entry->filename = (char *)NULL;
...@@ -68,11 +66,11 @@ read_function_name (prompt, window) ...@@ -68,11 +66,11 @@ read_function_name (prompt, window)
} }
DECLARE_INFO_COMMAND (describe_command, 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; char *line;
line = read_function_name ("Describe command: ", window); line = read_function_name (_("Describe command: "), window);
if (!line) if (!line)
{ {
...@@ -83,10 +81,7 @@ DECLARE_INFO_COMMAND (describe_command, ...@@ -83,10 +81,7 @@ DECLARE_INFO_COMMAND (describe_command,
/* Describe the function named in "LINE". */ /* Describe the function named in "LINE". */
if (*line) if (*line)
{ {
char *fundoc; VFunction *fun = named_function (line);
VFunction *fun;
fun = named_function (line);
if (!fun) if (!fun)
return; return;
...@@ -98,7 +93,7 @@ DECLARE_INFO_COMMAND (describe_command, ...@@ -98,7 +93,7 @@ DECLARE_INFO_COMMAND (describe_command,
} }
DECLARE_INFO_COMMAND (info_execute_command, 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; char *line;
...@@ -136,7 +131,7 @@ DECLARE_INFO_COMMAND (info_execute_command, ...@@ -136,7 +131,7 @@ DECLARE_INFO_COMMAND (info_execute_command,
(strncmp (line, "echo-area-", 10) == 0)) (strncmp (line, "echo-area-", 10) == 0))
{ {
free (line); free (line);
info_error ("Cannot execute an `echo-area' command here."); info_error (_("Cannot execute an `echo-area' command here."));
return; return;
} }
...@@ -152,7 +147,7 @@ DECLARE_INFO_COMMAND (info_execute_command, ...@@ -152,7 +147,7 @@ DECLARE_INFO_COMMAND (info_execute_command,
/* Okay, now that we have M-x, let the user set the screen height. */ /* Okay, now that we have M-x, let the user set the screen height. */
DECLARE_INFO_COMMAND (set_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; int new_height;
...@@ -165,7 +160,7 @@ DECLARE_INFO_COMMAND (set_screen_height, ...@@ -165,7 +160,7 @@ DECLARE_INFO_COMMAND (set_screen_height,
new_height = screenheight; 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); line = info_read_in_echo_area (window, prompt);
......
/* makedoc.c -- Make DOC.C and FUNS.H from input files. */ /* makedoc.c -- Make doc.c and funs.h from input files.
$Id: makedoc.c,v 1.4 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. 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 This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -26,24 +27,8 @@ ...@@ -26,24 +27,8 @@
a header file which describes the contents. This only does the functions a header file which describes the contents. This only does the functions
declared with DECLARE_INFO_COMMAND. */ declared with DECLARE_INFO_COMMAND. */
#include <stdio.h> #include "info.h"
#include <ctype.h>
#include <sys/types.h>
#if defined (HAVE_SYS_FILE_H)
#include <sys/file.h>
#endif /* HAVE_SYS_FILE_H */
#include <sys/stat.h>
#include "general.h"
#if !defined (O_RDONLY)
#if defined (HAVE_SYS_FCNTL_H)
#include <sys/fcntl.h>
#else /* !HAVE_SYS_FCNTL_H */
#include <fcntl.h>
#endif /* !HAVE_SYS_FCNTL_H */
#endif /* !O_RDONLY */
extern void *xmalloc (), *xrealloc ();
static void fatal_file_error (); static void fatal_file_error ();
/* Name of the header file which receives the declarations of functions. */ /* Name of the header file which receives the declarations of functions. */
...@@ -138,7 +123,7 @@ main (argc, argv) ...@@ -138,7 +123,7 @@ main (argc, argv)
} }
fprintf (doc_stream, fprintf (doc_stream,
" Source files groveled to make this file include:\n\n"); _(" Source files groveled to make this file include:\n\n"));
for (i = 1; i < argc; i++) for (i = 1; i < argc; i++)
fprintf (doc_stream, "\t%s\n", argv[i]); fprintf (doc_stream, "\t%s\n", argv[i]);
...@@ -199,19 +184,19 @@ maybe_dump_tags (stream) ...@@ -199,19 +184,19 @@ maybe_dump_tags (stream)
char digits[30]; char digits[30];
etag = block->entries[j]; etag = block->entries[j];
block_len += 3 + strlen (etag->name); block_len += 3 + strlen (etag->name);
sprintf (digits, "%d,%d", etag->line, etag->char_offset); sprintf (digits, "%d,%ld", etag->line, etag->char_offset);
block_len += strlen (digits); block_len += strlen (digits);
} }
/* Print out the defining line. */ /* Print out the defining line. */
fprintf (stream, "\f\n%s,%d\n", block->filename, block_len); fprintf (stream, "\f\n%s,%ld\n", block->filename, block_len);
/* Print out the individual tags. */ /* Print out the individual tags. */
for (j = 0; j < block->entries_index; j++) for (j = 0; j < block->entries_index; j++)
{ {
etag = block->entries[j]; etag = block->entries[j];
fprintf (stream, "%s,\177%d,%d\n", fprintf (stream, "%s,\177%d,%ld\n",
etag->name, etag->line, etag->char_offset); etag->name, etag->line, etag->char_offset);
} }
} }
...@@ -226,7 +211,7 @@ make_emacs_tag_block (filename) ...@@ -226,7 +211,7 @@ make_emacs_tag_block (filename)
EMACS_TAG_BLOCK *block; EMACS_TAG_BLOCK *block;
block = (EMACS_TAG_BLOCK *)xmalloc (sizeof (EMACS_TAG_BLOCK)); block = (EMACS_TAG_BLOCK *)xmalloc (sizeof (EMACS_TAG_BLOCK));
block->filename = strdup (filename); block->filename = xstrdup (filename);
block->entrylen = 0; block->entrylen = 0;
block->entries = (EMACS_TAG **)NULL; block->entries = (EMACS_TAG **)NULL;
block->entries_index = 0; block->entries_index = 0;
...@@ -370,7 +355,7 @@ process_one_file (filename, doc_stream, funs_stream) ...@@ -370,7 +355,7 @@ process_one_file (filename, doc_stream, funs_stream)
if (strncmp (name_start, "info_", 5) == 0) if (strncmp (name_start, "info_", 5) == 0)
name_start += 5; name_start += 5;
func_name = strdup (name_start); func_name = xstrdup (name_start);
/* Fix up "ea" commands. */ /* Fix up "ea" commands. */
if (strncmp (func_name, "ea_", 3) == 0) if (strncmp (func_name, "ea_", 3) == 0)
...@@ -462,7 +447,7 @@ static void ...@@ -462,7 +447,7 @@ static void
fatal_file_error (filename) fatal_file_error (filename)
char *filename; char *filename;
{ {
fprintf (stderr, "Couldn't manipulate the file %s.\n", filename); fprintf (stderr, _("Couldn't manipulate the file %s.\n"), filename);
exit (2); exit (2);
} }
......
/* 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. 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 This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -21,8 +22,8 @@ ...@@ -21,8 +22,8 @@
Author: Brian J. Fox (bfox@ai.mit.edu) Sat May 6 16:19:13 1995. */ Author: Brian J. Fox (bfox@ai.mit.edu) Sat May 6 16:19:13 1995. */
#if !defined (_MAN_H_) #ifndef INFO_MAN_H
#define _MAN_H_ #define INFO_MAN_H
#define MANPAGE_FILE_BUFFER_NAME "*manpages*" #define MANPAGE_FILE_BUFFER_NAME "*manpages*"
...@@ -33,4 +34,4 @@ extern long locate_manpage_xref (/* NODE *node, long start, int dir */); ...@@ -33,4 +34,4 @@ extern long locate_manpage_xref (/* NODE *node, long start, int dir */);
extern REFERENCE **xrefs_of_manpage (/* NODE *node */); extern REFERENCE **xrefs_of_manpage (/* NODE *node */);
extern REFERENCE **manpage_xrefs_in_binding (/* NODE *node, SEARCH_BINDING *binding */); 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 Copyright (C) 1993, 97 Free Software Foundation, Inc.
stored in Info format.
Copyright (C) 1993 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -27,10 +25,10 @@ ...@@ -27,10 +25,10 @@
static char * static char *
nodemenu_format_info () nodemenu_format_info ()
{ {
return ("\n\ return (_("\n\
* Menu:\n\ * Menu:\n\
(File)Node Lines Size Containing File\n\ (File)Node Lines Size Containing File\n\
---------- ----- ---- ---------------"); ---------- ----- ---- ---------------"));
} }
/* Produce a formatted line of information about NODE. Here is what we want /* Produce a formatted line of information about NODE. Here is what we want
...@@ -98,7 +96,7 @@ format_node_info (node) ...@@ -98,7 +96,7 @@ format_node_info (node)
} }
len = pad_to (44, line_buffer); 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)) if (node->filename && *(node->filename))
{ {
...@@ -106,7 +104,7 @@ format_node_info (node) ...@@ -106,7 +104,7 @@ format_node_info (node)
sprintf (line_buffer + len, node->filename); sprintf (line_buffer + len, node->filename);
} }
return (strdup (line_buffer)); return xstrdup (line_buffer);
} }
/* Little string comparison routine for qsort (). */ /* Little string comparison routine for qsort (). */
...@@ -137,7 +135,7 @@ get_visited_nodes (filter_func) ...@@ -137,7 +135,7 @@ get_visited_nodes (filter_func)
if (!info_windows) if (!info_windows)
return ((NODE *)NULL); 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++) for (i = 0; i < info_win->nodes_index; i++)
{ {
...@@ -196,8 +194,8 @@ get_visited_nodes (filter_func) ...@@ -196,8 +194,8 @@ get_visited_nodes (filter_func)
printf_to_message_buffer printf_to_message_buffer
("%s", replace_in_documentation ("%s", replace_in_documentation
("Here is the menu of nodes you have recently visited.\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")); Select one from this menu, or use `\\[history-node]' in another window.\n")));
printf_to_message_buffer ("%s\n", nodemenu_format_info ()); 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")); ...@@ -216,7 +214,7 @@ Select one from this menu, or use `\\[history-node]' in another window.\n"));
} }
DECLARE_INFO_COMMAND (list_visited_nodes, 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; WINDOW *new;
NODE *node; NODE *node;
...@@ -235,8 +233,14 @@ DECLARE_INFO_COMMAND (list_visited_nodes, ...@@ -235,8 +233,14 @@ DECLARE_INFO_COMMAND (list_visited_nodes,
/* If we couldn't find an existing window, try to use the next window /* If we couldn't find an existing window, try to use the next window
in the chain. */ in the chain. */
if (!new && window->next) if (!new)
{
if (window->next)
new = 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 we still don't have a window, make a new one to contain the list. */
if (!new) if (!new)
...@@ -258,10 +262,16 @@ DECLARE_INFO_COMMAND (list_visited_nodes, ...@@ -258,10 +262,16 @@ DECLARE_INFO_COMMAND (list_visited_nodes,
node = get_visited_nodes ((Function *)NULL); node = get_visited_nodes ((Function *)NULL);
name_internal_node (node, nodemenu_nodename); name_internal_node (node, nodemenu_nodename);
#if 0
/* Even if this is an internal node, we don't want the window /* Even if this is an internal node, we don't want the window
system to treat it specially. So we turn off the internalness system to treat it specially. So we turn off the internalness
of it here. */ 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; node->flags &= ~N_IsInternal;
#endif
/* If this window is already showing a node menu, reuse the existing node /* If this window is already showing a node menu, reuse the existing node
slot. */ slot. */
...@@ -284,7 +294,7 @@ DECLARE_INFO_COMMAND (list_visited_nodes, ...@@ -284,7 +294,7 @@ DECLARE_INFO_COMMAND (list_visited_nodes,
} }
DECLARE_INFO_COMMAND (select_visited_node, 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; char *line;
NODE *node; NODE *node;
...@@ -296,7 +306,7 @@ DECLARE_INFO_COMMAND (select_visited_node, ...@@ -296,7 +306,7 @@ DECLARE_INFO_COMMAND (select_visited_node,
free (node); free (node);
line = 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; window = active_window;
...@@ -316,7 +326,7 @@ DECLARE_INFO_COMMAND (select_visited_node, ...@@ -316,7 +326,7 @@ DECLARE_INFO_COMMAND (select_visited_node,
entry = info_get_labeled_reference (line, menu); entry = info_get_labeled_reference (line, menu);
if (!entry) if (!entry)
info_error ("The reference disappeared! (%s).", line); info_error (_("The reference disappeared! (%s)."), line);
else else
info_select_reference (window, entry); info_select_reference (window, entry);
} }
......
...@@ -21,17 +21,8 @@ ...@@ -21,17 +21,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#include <stdio.h> #include "info.h"
#include <ctype.h>
#include <sys/types.h>
#if defined (HAVE_SYS_FILE_H)
#include <sys/file.h>
#endif /* HAVE_SYS_FILE_H */
#include <sys/errno.h>
#include <sys/stat.h>
#if defined (HAVE_STRING_H)
#include <string.h>
#endif /* HAVE_STRING_H */
#include "nodes.h" #include "nodes.h"
#include "search.h" #include "search.h"
#include "filesys.h" #include "filesys.h"
...@@ -41,18 +32,6 @@ ...@@ -41,18 +32,6 @@
# include "man.h" # include "man.h"
#endif /* HANDLE_MAN_PAGES */ #endif /* HANDLE_MAN_PAGES */
#if !defined (O_RDONLY)
#if defined (HAVE_SYS_FCNTL_H)
#include <sys/fcntl.h>
#else /* !HAVE_SYS_FCNTL_H */
#include <fcntl.h>
#endif /* !HAVE_SYS_FCNTL_H */
#endif /* !O_RDONLY */
#if !defined (errno)
extern int errno;
#endif /* !errno */
/* **************************************************************** */ /* **************************************************************** */
/* */ /* */
/* Functions Static to this File */ /* Functions Static to this File */
...@@ -193,7 +172,7 @@ info_get_node_of_file_buffer (nodename, file_buffer) ...@@ -193,7 +172,7 @@ info_get_node_of_file_buffer (nodename, file_buffer)
node = (NODE *)xmalloc (sizeof (NODE)); node = (NODE *)xmalloc (sizeof (NODE));
node->filename = file_buffer->fullpath; node->filename = file_buffer->fullpath;
node->parent = (char *)NULL; node->parent = (char *)NULL;
node->nodename = strdup ("*"); node->nodename = xstrdup ("*");
node->contents = file_buffer->contents; node->contents = file_buffer->contents;
node->nodelen = file_buffer->filesize; node->nodelen = file_buffer->filesize;
node->flags = 0; node->flags = 0;
...@@ -263,7 +242,7 @@ info_find_file_internal (filename, get_tags) ...@@ -263,7 +242,7 @@ info_find_file_internal (filename, get_tags)
/* First try to find the file in our list of already loaded files. */ /* First try to find the file in our list of already loaded files. */
if (info_loaded_files) if (info_loaded_files)
{ {
for (i = 0; file_buffer = info_loaded_files[i]; i++) for (i = 0; (file_buffer = info_loaded_files[i]); i++)
if ((strcmp (filename, file_buffer->filename) == 0) || if ((strcmp (filename, file_buffer->filename) == 0) ||
(strcmp (filename, file_buffer->fullpath) == 0) || (strcmp (filename, file_buffer->fullpath) == 0) ||
((*filename != '/') && ((*filename != '/') &&
...@@ -364,7 +343,7 @@ info_load_file_internal (filename, get_tags) ...@@ -364,7 +343,7 @@ info_load_file_internal (filename, get_tags)
char *lowered_name; char *lowered_name;
char *basename; char *basename;
lowered_name = strdup (filename); lowered_name = xstrdup (filename);
basename = (char *) strrchr (lowered_name, '/'); basename = (char *) strrchr (lowered_name, '/');
if (basename) if (basename)
...@@ -402,8 +381,8 @@ info_load_file_internal (filename, get_tags) ...@@ -402,8 +381,8 @@ info_load_file_internal (filename, get_tags)
/* The file was found, and can be read. Allocate FILE_BUFFER and fill /* The file was found, and can be read. Allocate FILE_BUFFER and fill
in the various members. */ in the various members. */
file_buffer = make_file_buffer (); file_buffer = make_file_buffer ();
file_buffer->filename = strdup (filename); file_buffer->filename = xstrdup (filename);
file_buffer->fullpath = strdup (fullpath); file_buffer->fullpath = xstrdup (fullpath);
file_buffer->finfo = finfo; file_buffer->finfo = finfo;
file_buffer->filesize = filesize; file_buffer->filesize = filesize;
file_buffer->contents = contents; file_buffer->contents = contents;
...@@ -786,7 +765,7 @@ get_tags_of_indirect_tags_table (file_buffer, indirect_binding, tags_binding) ...@@ -786,7 +765,7 @@ get_tags_of_indirect_tags_table (file_buffer, indirect_binding, tags_binding)
char *containing_dir, *temp; char *containing_dir, *temp;
int len_containing_dir; int len_containing_dir;
containing_dir = strdup (file_buffer->fullpath); containing_dir = xstrdup (file_buffer->fullpath);
temp = (char *) strrchr (containing_dir, '/'); temp = (char *) strrchr (containing_dir, '/');
if (temp) if (temp)
...@@ -816,8 +795,7 @@ get_tags_of_indirect_tags_table (file_buffer, indirect_binding, tags_binding) ...@@ -816,8 +795,7 @@ get_tags_of_indirect_tags_table (file_buffer, indirect_binding, tags_binding)
/* For each node in the file's tags table, remember the starting /* For each node in the file's tags table, remember the starting
position. */ position. */
for (tags_index = 0; for (tags_index = 0; (entry = file_buffer->tags[tags_index]);
entry = file_buffer->tags[tags_index];
tags_index++) tags_index++)
{ {
for (i = 0; for (i = 0;
...@@ -878,7 +856,7 @@ info_node_of_file_buffer_tags (file_buffer, nodename) ...@@ -878,7 +856,7 @@ info_node_of_file_buffer_tags (file_buffer, nodename)
register int i; register int i;
TAG *tag; TAG *tag;
for (i = 0; tag = file_buffer->tags[i]; i++) for (i = 0; (tag = file_buffer->tags[i]); i++)
if (strcmp (nodename, tag->nodename) == 0) if (strcmp (nodename, tag->nodename) == 0)
{ {
FILE_BUFFER *subfile; FILE_BUFFER *subfile;
...@@ -1032,7 +1010,7 @@ forget_info_file (filename) ...@@ -1032,7 +1010,7 @@ forget_info_file (filename)
if (!info_loaded_files) if (!info_loaded_files)
return; return;
for (i = 0; file_buffer = info_loaded_files[i]; i++) for (i = 0; (file_buffer = info_loaded_files[i]); i++)
if ((strcmp (filename, file_buffer->filename) == 0) || if ((strcmp (filename, file_buffer->filename) == 0) ||
(strcmp (filename, file_buffer->fullpath) == 0)) (strcmp (filename, file_buffer->fullpath) == 0))
{ {
...@@ -1047,7 +1025,7 @@ forget_info_file (filename) ...@@ -1047,7 +1025,7 @@ forget_info_file (filename)
with tags. */ with tags. */
free_file_buffer_tags (file_buffer); free_file_buffer_tags (file_buffer);
while (info_loaded_files[i] = info_loaded_files[++i]) while ((info_loaded_files[i] = info_loaded_files[++i]))
; ;
break; break;
...@@ -1065,7 +1043,7 @@ free_file_buffer_tags (file_buffer) ...@@ -1065,7 +1043,7 @@ free_file_buffer_tags (file_buffer)
{ {
register TAG *tag; register TAG *tag;
for (i = 0; tag = file_buffer->tags[i]; i++) for (i = 0; (tag = file_buffer->tags[i]); i++)
free_info_tag (tag); free_info_tag (tag);
free (file_buffer->tags); free (file_buffer->tags);
......
/* 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. 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 This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -21,10 +22,10 @@ ...@@ -21,10 +22,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_NODES_H_) #if !defined (NODES_H)
#define _NODES_H_ #define NODES_H
#include "general.h" #include "info.h"
/* **************************************************************** */ /* **************************************************************** */
/* */ /* */
...@@ -165,4 +166,4 @@ extern char *info_recent_file_error; ...@@ -165,4 +166,4 @@ extern char *info_recent_file_error;
/* Create a new, empty file buffer. */ /* Create a new, empty file buffer. */
extern FILE_BUFFER *make_file_buffer (); extern FILE_BUFFER *make_file_buffer ();
#endif /* !_NODES_H_ */ #endif /* !NODES_H */
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
/* 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. 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 This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -21,17 +21,11 @@ ...@@ -21,17 +21,11 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#include <ctype.h> #include "info.h"
#include <sys/types.h>
#include <sys/stat.h>
#include "general.h"
#include "search.h" #include "search.h"
#include "nodes.h" #include "nodes.h"
#if !defined (NULL)
# define NULL 0x0
#endif /* !NULL */
/* The search functions take two arguments: /* The search functions take two arguments:
1) a string to search for, and 1) a string to search for, and
...@@ -115,7 +109,7 @@ search_forward (string, binding) ...@@ -115,7 +109,7 @@ search_forward (string, binding)
if (binding->flags & S_FoldCase) if (binding->flags & S_FoldCase)
{ {
alternate = strdup (string); alternate = xstrdup (string);
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
...@@ -184,7 +178,7 @@ search_backward (input_string, binding) ...@@ -184,7 +178,7 @@ search_backward (input_string, binding)
if (binding->flags & S_FoldCase) if (binding->flags & S_FoldCase)
{ {
alternate = strdup (string); alternate = xstrdup (string);
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
...@@ -364,7 +358,13 @@ skip_node_characters (string, newlines_okay) ...@@ -364,7 +358,13 @@ skip_node_characters (string, newlines_okay)
((paren_seen && string[i - 1] == ')') && ((paren_seen && string[i - 1] == ')') &&
(c == ' ' || c == '.')) || (c == ' ' || c == '.')) ||
(c == '.' && (c == '.' &&
((!string[i + 1]) || (
#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])) || (whitespace_or_newline (string[i + 1])) ||
(string[i + 1] == ')')))) (string[i + 1] == ')'))))
break; break;
...@@ -482,8 +482,8 @@ find_node_in_binding (nodename, binding) ...@@ -482,8 +482,8 @@ find_node_in_binding (nodename, binding)
char *nodename; char *nodename;
SEARCH_BINDING *binding; SEARCH_BINDING *binding;
{ {
register long position; long position;
register int offset, namelen; int offset, namelen;
SEARCH_BINDING search; SEARCH_BINDING search;
namelen = strlen (nodename); namelen = strlen (nodename);
......
/* 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. 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 This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -31,8 +32,8 @@ ...@@ -31,8 +32,8 @@
They return a long, which is the offset from the start of the buffer 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. */ at which the match was found. An offset of -1 indicates failure. */
#if !defined (_SEARCH_H_) #ifndef INFO_SEARCH_H
#define _SEARCH_H_ #define INFO_SEARCH_H
typedef struct { typedef struct {
char *buffer; /* The buffer of text to search. */ char *buffer; /* The buffer of text to search. */
...@@ -71,5 +72,4 @@ extern int skip_node_characters (), skip_node_separator (); ...@@ -71,5 +72,4 @@ extern int skip_node_characters (), skip_node_separator ();
extern long find_node_separator (), find_tags_table (); extern long find_node_separator (), find_tags_table ();
extern long find_node_in_binding (); extern long find_node_in_binding ();
#endif /* !_SEARCH_H_ */ #endif /* not INFO_SEARCH_H */
...@@ -21,10 +21,10 @@ ...@@ -21,10 +21,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_SESSION_H_) #if !defined (SESSION_H)
#define _SESSION_H_ #define SESSION_H
#include "general.h" #include "info.h"
#include "dribble.h" #include "dribble.h"
/* All commands that can be invoked from within info_session () receive /* All commands that can be invoked from within info_session () receive
...@@ -143,4 +143,4 @@ extern void info_print_node (); ...@@ -143,4 +143,4 @@ extern void info_print_node ();
/* Miscellaneous commands. */ /* Miscellaneous commands. */
extern void info_abort_key (), info_quit (), info_do_lowercase_version (); extern void info_abort_key (), info_quit (), info_do_lowercase_version ();
#endif /* _SESSION_H_ */ #endif /* SESSION_H */
...@@ -62,28 +62,27 @@ sigprocmask (operation, newset, oldset) ...@@ -62,28 +62,27 @@ sigprocmask (operation, newset, oldset)
/* */ /* */
/* **************************************************************** */ /* **************************************************************** */
typedef void SigHandlerType; typedef RETSIGTYPE signal_handler ();
typedef SigHandlerType SigHandler ();
static SigHandlerType info_signal_handler (); static RETSIGTYPE info_signal_handler ();
static SigHandler *old_TSTP, *old_TTOU, *old_TTIN; static signal_handler *old_TSTP, *old_TTOU, *old_TTIN;
static SigHandler *old_WINCH, *old_INT; static signal_handler *old_WINCH, *old_INT;
void void
initialize_info_signal_handler () initialize_info_signal_handler ()
{ {
#if defined (SIGTSTP) #if defined (SIGTSTP)
old_TSTP = (SigHandler *) signal (SIGTSTP, info_signal_handler); old_TSTP = (signal_handler *) signal (SIGTSTP, info_signal_handler);
old_TTOU = (SigHandler *) signal (SIGTTOU, info_signal_handler); old_TTOU = (signal_handler *) signal (SIGTTOU, info_signal_handler);
old_TTIN = (SigHandler *) signal (SIGTTIN, info_signal_handler); old_TTIN = (signal_handler *) signal (SIGTTIN, info_signal_handler);
#endif /* SIGTSTP */ #endif /* SIGTSTP */
#if defined (SIGWINCH) #if defined (SIGWINCH)
old_WINCH = (SigHandler *) signal (SIGWINCH, info_signal_handler); old_WINCH = (signal_handler *) signal (SIGWINCH, info_signal_handler);
#endif #endif
#if defined (SIGINT) #if defined (SIGINT)
old_INT = (SigHandler *) signal (SIGINT, info_signal_handler); old_INT = (signal_handler *) signal (SIGINT, info_signal_handler);
#endif #endif
} }
...@@ -98,11 +97,11 @@ redisplay_after_signal () ...@@ -98,11 +97,11 @@ redisplay_after_signal ()
fflush (stdout); fflush (stdout);
} }
static SigHandlerType static RETSIGTYPE
info_signal_handler (sig) info_signal_handler (sig)
int sig; int sig;
{ {
SigHandler **old_signal_handler; signal_handler **old_signal_handler;
switch (sig) switch (sig)
{ {
...@@ -140,7 +139,7 @@ info_signal_handler (sig) ...@@ -140,7 +139,7 @@ info_signal_handler (sig)
turn on terminal handling, redraw the screen, and place the turn on terminal handling, redraw the screen, and place the
cursor where it belongs. */ cursor where it belongs. */
terminal_prep_terminal (); terminal_prep_terminal ();
*old_signal_handler = (SigHandler *) signal (sig, info_signal_handler); *old_signal_handler = (signal_handler *) signal (sig, info_signal_handler);
redisplay_after_signal (); redisplay_after_signal ();
fflush (stdout); fflush (stdout);
} }
...@@ -164,7 +163,7 @@ info_signal_handler (sig) ...@@ -164,7 +163,7 @@ info_signal_handler (sig)
terminal_prep_terminal (); terminal_prep_terminal ();
display_initialize_display (screenwidth, screenheight); display_initialize_display (screenwidth, screenheight);
window_new_screen_size (screenwidth, screenheight, (VFunction *)NULL); window_new_screen_size (screenwidth, screenheight, (VFunction *)NULL);
*old_signal_handler = (SigHandler *) signal (sig, info_signal_handler); *old_signal_handler = (signal_handler *) signal (sig, info_signal_handler);
redisplay_after_signal (); redisplay_after_signal ();
} }
break; break;
......
/* 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. 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 This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -21,11 +22,17 @@ ...@@ -21,11 +22,17 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_SIGNALS_H_) #ifndef INFO_SIGNALS_H
#define _SIGNALS_H_ #define INFO_SIGNALS_H
#include <sys/types.h>
#include <signal.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) #if !defined (HAVE_SIGPROCMASK) && !defined (sigmask)
# define sigmask(x) (1 << ((x)-1)) # define sigmask(x) (1 << ((x)-1))
#endif /* !HAVE_SIGPROCMASK && !sigmask */ #endif /* !HAVE_SIGPROCMASK && !sigmask */
...@@ -86,4 +93,4 @@ ...@@ -86,4 +93,4 @@
# define UNBLOCK_SIGNAL(sig) # define UNBLOCK_SIGNAL(sig)
#endif /* !HAVE_SIGPROCMASK && !HAVE_SIGSETMASK */ #endif /* !HAVE_SIGPROCMASK && !HAVE_SIGSETMASK */
#endif /* !_SIGNALS_H_ */ #endif /* not INFO_SIGNALS_H */
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
/* 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. 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 This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -21,15 +21,10 @@ ...@@ -21,15 +21,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_TERMINAL_H_) #if !defined (TERMINAL_H)
#define _TERMINAL_H_ #define TERMINAL_H
/* We use the following data type to talk about pointers to functions. */ #include "info.h"
#if !defined (__FUNCTION_DEF)
# define __FUNCTION_DEF
typedef int Function ();
typedef void VFunction ();
#endif /* _FUNCTION_DEF */
/* For almost every function externally visible from terminal.c, there is /* For almost every function externally visible from terminal.c, there is
a corresponding "hook" function which can be bound in order to replace a corresponding "hook" function which can be bound in order to replace
...@@ -125,5 +120,6 @@ extern VFunction *terminal_ring_bell_hook; ...@@ -125,5 +120,6 @@ extern VFunction *terminal_ring_bell_hook;
/* The key sequences output by the arrow keys, if this terminal has any. */ /* 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_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). /* 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 This file is part of GNU Info, a program for reading online documentation
stored in Info format. stored in Info format.
...@@ -22,6 +22,10 @@ ...@@ -22,6 +22,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
/* Include config.h before doing alloca. */
#include "info.h"
#ifndef alloca
#if defined (__GNUC__) #if defined (__GNUC__)
# define alloca __builtin_alloca # define alloca __builtin_alloca
#else /* !__GNUC__ */ #else /* !__GNUC__ */
...@@ -33,28 +37,10 @@ ...@@ -33,28 +37,10 @@
# endif /* HAVE_ALLOCA_H */ # endif /* HAVE_ALLOCA_H */
# endif /* !AIX */ # endif /* !AIX */
#endif /* !__GNUC__ */ #endif /* !__GNUC__ */
#endif /* ! defined alloca */
#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
#if defined (TEST) || defined (STATIC_MALLOC) #if defined (TEST) || defined (STATIC_MALLOC)
static void *xmalloc (), *xrealloc (); static void *xmalloc (), *xrealloc ();
#else
extern void *xmalloc (), *xrealloc ();
#endif /* TEST || STATIC_MALLOC */ #endif /* TEST || STATIC_MALLOC */
/* The default value of tilde_additional_prefixes. This is set to /* The default value of tilde_additional_prefixes. This is set to
...@@ -214,7 +200,7 @@ tilde_expand_word (filename) ...@@ -214,7 +200,7 @@ tilde_expand_word (filename)
{ {
char *dirname; char *dirname;
dirname = filename ? strdup (filename) : (char *)NULL; dirname = filename ? xstrdup (filename) : (char *)NULL;
if (dirname && *dirname == '~') if (dirname && *dirname == '~')
{ {
...@@ -222,7 +208,6 @@ tilde_expand_word (filename) ...@@ -222,7 +208,6 @@ tilde_expand_word (filename)
if (!dirname[1] || dirname[1] == '/') if (!dirname[1] || dirname[1] == '/')
{ {
/* Prepend $HOME to the rest of the string. */ /* Prepend $HOME to the rest of the string. */
extern char *getenv ();
char *temp_home = getenv ("HOME"); char *temp_home = getenv ("HOME");
/* If there is no HOME variable, look up the directory in /* If there is no HOME variable, look up the directory in
...@@ -244,7 +229,7 @@ tilde_expand_word (filename) ...@@ -244,7 +229,7 @@ tilde_expand_word (filename)
strcpy (temp_name, temp_home); strcpy (temp_name, temp_home);
strcat (temp_name, &dirname[1]); strcat (temp_name, &dirname[1]);
free (dirname); free (dirname);
dirname = strdup (temp_name); dirname = xstrdup (temp_name);
} }
else else
{ {
...@@ -252,7 +237,7 @@ tilde_expand_word (filename) ...@@ -252,7 +237,7 @@ tilde_expand_word (filename)
char *username = (char *)alloca (257); char *username = (char *)alloca (257);
int i, c; int i, c;
for (i = 1; c = dirname[i]; i++) for (i = 1; (c = dirname[i]); i++)
{ {
if (c == '/') if (c == '/')
break; break;
...@@ -292,7 +277,7 @@ tilde_expand_word (filename) ...@@ -292,7 +277,7 @@ tilde_expand_word (filename)
strcat (temp_name, &dirname[i]); strcat (temp_name, &dirname[i]);
return_name: return_name:
free (dirname); free (dirname);
dirname = strdup (temp_name); dirname = xstrdup (temp_name);
} }
endpwent (); endpwent ();
} }
...@@ -369,7 +354,7 @@ xrealloc (pointer, bytes) ...@@ -369,7 +354,7 @@ xrealloc (pointer, bytes)
static void static void
memory_error_and_abort () memory_error_and_abort ()
{ {
fprintf (stderr, "readline: Out of virtual memory!\n"); fprintf (stderr, _("readline: Out of virtual memory!\n"));
abort (); abort ();
} }
#endif /* TEST */ #endif /* TEST */
......
...@@ -25,13 +25,10 @@ ...@@ -25,13 +25,10 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
/* Function pointers can be declared as (Function *)foo. */ #ifndef TILDE_H
#if !defined (__FUNCTION_DEF) #define TILDE_H
# define __FUNCTION_DEF
typedef int Function (); #include "info.h"
typedef void VFunction ();
typedef char *CFunction ();
#endif /* _FUNCTION_DEF */
/* If non-null, this contains the address of a function to call if the /* 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 standard meaning for expanding a tilde fails. The function is called
...@@ -56,3 +53,4 @@ extern char *tilde_expand (); ...@@ -56,3 +53,4 @@ extern char *tilde_expand ();
tilde. If there is no expansion, call tilde_expansion_failure_hook. */ tilde. If there is no expansion, call tilde_expansion_failure_hook. */
extern char *tilde_expand_word (); 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. 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 This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -36,73 +37,75 @@ static char *on_off_choices[] = { "Off", "On", (char *)NULL }; ...@@ -36,73 +37,75 @@ static char *on_off_choices[] = { "Off", "On", (char *)NULL };
VARIABLE_ALIST info_variables[] = { VARIABLE_ALIST info_variables[] = {
{ "automatic-footnotes", { "automatic-footnotes",
"When \"On\", footnotes appear and disappear automatically", N_("When \"On\", footnotes appear and disappear automatically"),
&auto_footnotes_p, (char **)on_off_choices }, &auto_footnotes_p, (char **)on_off_choices },
{ "automatic-tiling", { "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 }, &auto_tiling_p, (char **)on_off_choices },
{ "visible-bell", { "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 }, &terminal_use_visible_bell_p, (char **)on_off_choices },
{ "errors-ring-bell", { "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 }, &info_error_rings_bell_p, (char **)on_off_choices },
{ "gc-compressed-files", { "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 }, &gc_compressed_files, (char **)on_off_choices },
{ "show-index-match", { "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 }, &show_index_match, (char **)on_off_choices },
{ "scroll-behaviour", { "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 }, &info_scroll_behaviour, (char **)info_scroll_choices },
{ "scroll-step", { "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 }, &window_scroll_step, (char **)NULL },
{ "ISO-Latin", { "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 }, &ISO_Latin_p, (char **)on_off_choices },
{ (char *)NULL, (char *)NULL, (int *)NULL, (char **)NULL } { (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; VARIABLE_ALIST *var;
char *description; char *description;
/* Get the variable's name. */ /* Get the variable's name. */
var = read_variable_name ("Describe variable: ", window); var = read_variable_name (_("Describe variable: "), window);
if (!var) if (!var)
return; return;
description = (char *)xmalloc (20 + strlen (var->name) + strlen (var->doc)); description = (char *)xmalloc (20 + strlen (var->name)
+ strlen (_(var->doc)));
if (var->choices) if (var->choices)
sprintf (description, "%s (%s): %s.", sprintf (description, "%s (%s): %s.",
var->name, var->choices[*(var->value)], var->doc); var->name, var->choices[*(var->value)], _(var->doc));
else 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); window_message_in_echo_area ("%s", description);
free (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; VARIABLE_ALIST *var;
char *line; char *line;
/* Get the variable's name and value. */ /* Get the variable's name and value. */
var = read_variable_name ("Set variable: ", window); var = read_variable_name (_("Set variable: "), window);
if (!var) if (!var)
return; return;
...@@ -120,7 +123,7 @@ DECLARE_INFO_COMMAND (set_variable, "Set the value of an Info variable") ...@@ -120,7 +123,7 @@ DECLARE_INFO_COMMAND (set_variable, "Set the value of an Info variable")
else else
potential_value = *(var->value); potential_value = *(var->value);
sprintf (prompt, "Set %s to value (%d): ", sprintf (prompt, _("Set %s to value (%d): "),
var->name, potential_value); var->name, potential_value);
line = info_read_in_echo_area (active_window, prompt); line = info_read_in_echo_area (active_window, prompt);
...@@ -153,7 +156,7 @@ DECLARE_INFO_COMMAND (set_variable, "Set the value of an Info variable") ...@@ -153,7 +156,7 @@ DECLARE_INFO_COMMAND (set_variable, "Set the value of an Info variable")
REFERENCE *entry; REFERENCE *entry;
entry = (REFERENCE *)xmalloc (sizeof (REFERENCE)); entry = (REFERENCE *)xmalloc (sizeof (REFERENCE));
entry->label = strdup (var->choices[i]); entry->label = xstrdup (var->choices[i]);
entry->nodename = (char *)NULL; entry->nodename = (char *)NULL;
entry->filename = (char *)NULL; entry->filename = (char *)NULL;
...@@ -161,7 +164,7 @@ DECLARE_INFO_COMMAND (set_variable, "Set the value of an Info variable") ...@@ -161,7 +164,7 @@ DECLARE_INFO_COMMAND (set_variable, "Set the value of an Info variable")
(entry, array_index, array, array_slots, 10, REFERENCE *); (entry, array_index, array, array_slots, 10, REFERENCE *);
} }
sprintf (prompt, "Set %s to value (%s): ", sprintf (prompt, _("Set %s to value (%s): "),
var->name, var->choices[*(var->value)]); var->name, var->choices[*(var->value)]);
/* Ask the completer to read a variable value for us. */ /* Ask the completer to read a variable value for us. */
...@@ -259,8 +262,8 @@ make_variable_completions_array () ...@@ -259,8 +262,8 @@ make_variable_completions_array ()
{ {
REFERENCE *entry; REFERENCE *entry;
entry = (REFERENCE *)xmalloc (sizeof (REFERENCE)); entry = (REFERENCE *) xmalloc (sizeof (REFERENCE));
entry->label = strdup (info_variables[i].name); entry->label = xstrdup (info_variables[i].name);
entry->nodename = (char *)NULL; entry->nodename = (char *)NULL;
entry->filename = (char *)NULL; entry->filename = (char *)NULL;
......
/* 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. 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 This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -21,8 +22,8 @@ ...@@ -21,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_VARIABLES_H_) #ifndef INFO_VARIABLES_H
#define _VARIABLES_H_ #define INFO_VARIABLES_H
/* A variable (in the Info sense) is an integer value with a user-visible /* 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 name. You may supply an array of strings to complete over when the
...@@ -61,4 +62,4 @@ extern int info_scroll_behaviour; ...@@ -61,4 +62,4 @@ extern int info_scroll_behaviour;
extern int window_scroll_step; extern int window_scroll_step;
extern int ISO_Latin_p; extern int ISO_Latin_p;
#endif /* _VARIABLES_H_ */ #endif /* not INFO_VARIABLES_H */
/* window.c -- Windows in Info. */ /* window.c -- Windows in Info.
$Id: window.c,v 1.4 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. 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 This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -21,10 +22,7 @@ ...@@ -21,10 +22,7 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#include <stdio.h> #include "info.h"
#include <ctype.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "nodes.h" #include "nodes.h"
#include "window.h" #include "window.h"
#include "display.h" #include "display.h"
...@@ -1101,7 +1099,7 @@ window_make_modeline (window) ...@@ -1101,7 +1099,7 @@ window_make_modeline (window)
filename = filename_non_directory (node->filename); filename = filename_non_directory (node->filename);
if (node->flags & N_UpdateTags) if (node->flags & N_UpdateTags)
update_message = "--*** Tags out of Date ***"; update_message = _("--*** Tags out of Date ***");
} }
if (update_message) if (update_message)
...@@ -1112,25 +1110,25 @@ window_make_modeline (window) ...@@ -1112,25 +1110,25 @@ window_make_modeline (window)
/* 10 for the decimal representation of the number of lines in this /* 10 for the decimal representation of the number of lines in this
node, and the remainder of the text that can appear in the line. */ node, and the remainder of the text that can appear in the line. */
modeline_len += 10 + strlen ("-----Info: (), lines ----, "); modeline_len += 10 + strlen (_("-----Info: (), lines ----, "));
modeline_len += window->width; modeline_len += window->width;
modeline = (char *)xmalloc (1 + modeline_len); modeline = (char *)xmalloc (1 + modeline_len);
/* Special internal windows have no filename. */ /* Special internal windows have no filename. */
if (!parent && !*filename) if (!parent && !*filename)
sprintf (modeline, "-%s---Info: %s, %d lines --%s--", sprintf (modeline, _("-%s---Info: %s, %d lines --%s--"),
(window->flags & W_NoWrap) ? "$" : "-", (window->flags & W_NoWrap) ? "$" : "-",
nodename, window->line_count, location_indicator); nodename, window->line_count, location_indicator);
else else
sprintf (modeline, "-%s%s-Info: (%s)%s, %d lines --%s--", sprintf (modeline, _("-%s%s-Info: (%s)%s, %d lines --%s--"),
(window->flags & W_NoWrap) ? "$" : "-", (window->flags & W_NoWrap) ? "$" : "-",
(node && (node->flags & N_IsCompressed)) ? "zz" : "--", (node && (node->flags & N_IsCompressed)) ? "zz" : "--",
parent ? parent : filename, parent ? parent : filename,
nodename, window->line_count, location_indicator); nodename, window->line_count, location_indicator);
if (parent) if (parent)
sprintf (modeline + strlen (modeline), " Subfile: %s", filename); sprintf (modeline + strlen (modeline), _(" Subfile: %s"), filename);
if (update_message) if (update_message)
sprintf (modeline + strlen (modeline), "%s", update_message); sprintf (modeline + strlen (modeline), "%s", update_message);
......
/* 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. 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 This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -21,8 +22,8 @@ ...@@ -21,8 +22,8 @@
Written by Brian Fox (bfox@ai.mit.edu). */ Written by Brian Fox (bfox@ai.mit.edu). */
#if !defined (_WINDOW_H_) #ifndef INFO_WINDOW_H
#define _WINDOW_H_ #define INFO_WINDOW_H
#include "nodes.h" #include "nodes.h"
#include "infomap.h" #include "infomap.h"
...@@ -54,9 +55,10 @@ ...@@ -54,9 +55,10 @@
(0, window->height + window->first_row) is the first character of this (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 windows modeline. The number of lines that can be displayed in a window
is equal to window->height - 1. */ is equal to window->height - 1. */
typedef struct __window__ { typedef struct window_struct
struct __window__ *next; /* Next window in this chain. */ {
struct __window__ *prev; /* Previous window in this chain. */ 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 width; /* Width of this window. */
int height; /* Height of this window. */ int height; /* Height of this window. */
int first_row; /* Offset of the first line in the_screen. */ int first_row; /* Offset of the first line in the_screen. */
...@@ -226,4 +228,4 @@ extern void window_get_state (), window_set_state (); ...@@ -226,4 +228,4 @@ extern void window_get_state (), window_set_state ();
offset of GOAL. */ offset of GOAL. */
extern int window_chars_to_goal (); extern int window_chars_to_goal ();
#endif /* !_WINDOW_H_ */ #endif /* not INFO_WINDOW_H */
# Makefile for GNU makeinfo. # Makefile.in generated automatically by automake 1.2 from Makefile.am
# $Id: Makefile.in,v 1.1 1997/08/21 22:58:07 jason Exp $
#
# Copyright (C) 1993, 96 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
# it under the terms of the GNU General Public License as published by # This Makefile.in is free software; the Free Software Foundation
# the Free Software Foundation; either version 2, or (at your option) # gives unlimited permission to copy, distribute and modify it.
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License SHELL = /bin/sh
# 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. ####
srcdir = @srcdir@ 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 = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@ 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@ DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
LIBS = -L../libtxi -ltxi @LIBS@
LOADLIBES = $(LIBS)
SHELL = /bin/sh TAR = tar
GZIP = --best
SOURCES = $(makeinfo_SOURCES)
OBJECTS = $(makeinfo_OBJECTS)
CFLAGS = @CFLAGS@ default: all
LDFLAGS = @LDFLAGS@
prefix = @prefix@ .SUFFIXES:
exec_prefix = @exec_prefix@ .SUFFIXES: .c .o
bindir = @bindir@ $(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
# Prefix for each installed program, normally empty or `g'. cd $(top_srcdir) && $(AUTOMAKE) --cygnus makeinfo/Makefile
binprefix =
infodir = @infodir@ 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 distclean-binPROGRAMS:
OBJS = makeinfo.o multi.o
PROGS = makeinfo$(EXEEXT) maintainer-clean-binPROGRAMS:
all: $(PROGS) makeinfo.info install-binPROGRAMS: $(bin_PROGRAMS)
sub-all: all @$(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: .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): $(OBJS) ../libtxi/libtxi.a makeinfo$(EXEEXT): $(makeinfo_OBJECTS) $(makeinfo_DEPENDENCIES)
$(CC) $(LDFLAGS) -o makeinfo $(OBJS) $(LOADLIBES) @rm -f makeinfo$(EXEEXT)
$(LINK) $(makeinfo_LDFLAGS) $(makeinfo_OBJECTS) $(makeinfo_LDADD) $(LIBS)
../libtxi/libtxi.a: tags: TAGS
(cd ../libtxi && $(MAKE) $(MFLAGS) libtxi.a)
makeinfo.o: makeinfo.c $(common)/getopt.h ID: $(HEADERS) $(SOURCES)
here=`pwd` && cd $(srcdir) && mkid -f$$here/ID $(SOURCES) $(HEADERS)
$(OBJS): makeinfo.h 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)
info makeinfo.info: ./makeinfo makeinfo.texi #macro.texi mostlyclean-tags:
./makeinfo --no-split -I$(srcdir) makeinfo.texi
# makeinfo.texi: ./makeinfo makeinfo.mki clean-tags:
# ./makeinfo -E makeinfo.texi -I$(srcdir) makeinfo.mki
dvi makeinfo.dvi: ./makeinfo makeinfo.texi #macro.texi distclean-tags:
$(srcdir)/../util/texi2dvi makeinfo.txi rm -f TAGS ID
install: all maintainer-clean-tags:
$(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)
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
subdir = makeinfo
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-info:
-d=$(srcdir); test -f ./makeinfo.info && d=.; $(INSTALL_DATA) $$d/makeinfo.info $(infodir)/makeinfo.info install-exec: install-binPROGRAMS
../util/install-info --info-dir=$(infodir) $(infodir)/makeinfo.info @$(NORMAL_INSTALL)
install-data:
@$(NORMAL_INSTALL)
install: install-exec install-data all
@:
uninstall: uninstall-binPROGRAMS
all: Makefile $(PROGRAMS)
install-strip:
$(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
installdirs:
$(mkinstalldirs) $(bindir)
mostlyclean-generic:
test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
clean-generic:
test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
uninstall: distclean-generic:
for f in $(PROGS); do rm -f $(bindir)/$(binprefix)$$f; done rm -f Makefile $(DISTCLEANFILES)
rm -f $(infodir)/makeinfo.info rm -f config.cache config.log stamp-h stamp-h[0-9]*
test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
TAGS: $(SRCS) maintainer-clean-generic:
etags $(SRCS) test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
mostlyclean: mostlyclean-binPROGRAMS mostlyclean-compile \
mostlyclean-tags mostlyclean-generic
clean: clean: clean-binPROGRAMS clean-compile clean-tags clean-generic \
rm -f *.o a.out core core.* $(PROGS) mostlyclean
mostlyclean: clean distclean: distclean-binPROGRAMS distclean-compile distclean-tags \
distclean-generic clean
rm -f config.status
distclean: clean maintainer-clean: maintainer-clean-binPROGRAMS maintainer-clean-compile \
rm -f TAGS Makefile config.status *.info */*.info 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 .PHONY: default mostlyclean-binPROGRAMS distclean-binPROGRAMS \
maintainer-clean: distclean 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: .NOEXPORT:
/* makeinfo.h -- Declarations for Makeinfo. /* makeinfo.h -- Declarations for Makeinfo.
$Id: makeinfo.h,v 1.1 1997/08/21 22:58:08 jason Exp $ $Id: makeinfo.h,v 1.3 1997/07/15 18:28:38 karl Exp $
Copyright (C) 1996 Free Software Foundation, Inc. Copyright (C) 1996, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -35,12 +35,14 @@ ...@@ -35,12 +35,14 @@
enum insertion_type enum insertion_type
{ {
menu, detailmenu, quotation, lisp, smalllisp, example, smallexample, cartouche, defcv, deffn, defivar, defmac, defmethod,
display, itemize, format, enumerate, cartouche, multitable, table, defop, defopt, defspec, deftp, deftypefn, deftypefun,
ftable, vtable, group, ifinfo, flushleft, flushright, ifset, deftypemethod, deftypevar, deftypevr, defun, defvar,
ifclear, deffn, defun, defmac, defspec, defvr, defvar, defopt, defvr, detailmenu, direntry, display, enumerate, example,
deftypefn, deftypefun, deftypevr, deftypevar, defcv, defivar, defop, flushleft, flushright, format, ftable, group, ifclear,
defmethod, deftypemethod, deftp, direntry, bad_type ifinfo, ifnothtml, ifnottex, ifset, itemize, lisp, menu,
multitable, quotation, smallexample, smalllisp, table, vtable,
bad_type
}; };
DECLARE (int, insertion_level, 0); DECLARE (int, insertion_level, 0);
...@@ -48,13 +50,13 @@ DECLARE (int, insertion_level, 0); ...@@ -48,13 +50,13 @@ DECLARE (int, insertion_level, 0);
#if defined (COMPILING_MAKEINFO) #if defined (COMPILING_MAKEINFO)
char *insertion_type_names[] = char *insertion_type_names[] =
{ {
"menu", "detailmenu", "quotation", "lisp", "smalllisp", "example", "cartouche", "defcv", "deffn", "defivar", "defmac", "defmethod",
"smallexample", "display", "itemize", "format", "enumerate", "defop", "defopt", "defspec", "deftp", "deftypefn", "deftypefun",
"cartouche", "multitable", "table", "ftable", "vtable", "group", "deftypemethod", "deftypevar", "deftypevr", "defun", "defvar",
"ifinfo", "flushleft", "flushright", "ifset", "ifclear", "deffn", "defvr", "detailmenu", "direntry", "display", "enumerate", "example",
"defun", "defmac", "defspec", "defvr", "defvar", "defopt", "flushleft", "flushright", "format", "ftable", "group", "ifclear",
"deftypefn", "deftypefun", "deftypevr", "deftypevar", "defcv", "ifinfo", "ifnothtml", "ifnottex", "ifset", "itemize", "lisp", "menu",
"defivar", "defop", "defmethod", "deftypemethod", "deftp", "direntry", "multitable", "quotation", "smallexample", "smalllisp", "table", "vtable",
"bad_type" "bad_type"
}; };
#endif #endif
......
/* multi.c -- Multitable stuff for makeinfo. /* multi.c -- multitable stuff for makeinfo.
$Id: multi.c,v 1.1 1997/08/21 22:58:08 jason Exp $ $Id: multi.c,v 1.9 1997/07/24 22:01:00 karl Exp $
Copyright (C) 1996 Free Software Foundation, Inc. Copyright (C) 1996, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software Foundation, along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <stdio.h> #include "system.h"
#include "makeinfo.h" #include "makeinfo.h"
#define MAXCOLS 100 /* remove this limit later @@ */ #define MAXCOLS 100 /* remove this limit later @@ */
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
* `select_output_environment' function switches from one output * `select_output_environment' function switches from one output
* environment to another. * environment to another.
* *
* Environment #0 (i.e. element #0 of the table) is the regular * Environment #0 (i.e., element #0 of the table) is the regular
* environment that is used when we're not formatting a multitable. * environment that is used when we're not formatting a multitable.
* *
* Environment #N (where N = 1,2,3,...) is the env. for column #N of * Environment #N (where N = 1,2,3,...) is the env. for column #N of
...@@ -67,6 +67,40 @@ static int last_column; ...@@ -67,6 +67,40 @@ static int last_column;
to be drawn, separating rows and columns in the current multitable. */ to be drawn, separating rows and columns in the current multitable. */
static int hsep, vsep; static int hsep, vsep;
/* Output a row. Have to keep `output_position' up-to-date for each
character we output, or the tags table will be off, leading to
chopped-off output files and undefined nodes (because they're in the
wrong file, etc.). Perhaps it would be better to accumulate this
value somewhere and add it once at the end of the table, or return it
as the value, but this seems simplest. */
static void
out_char (ch)
int ch;
{
extern int output_position;
putc (ch, output_stream);
output_position++;
}
void
draw_horizontal_separator ()
{
int i, j, s;
for (s = 0; s < envs[0].current_indent; s++)
out_char (' ');
if (vsep)
out_char ('+');
for (i = 1; i <= last_column; i++) {
for (j = 0; j <= envs[i].fill_column; j++)
out_char ('-');
if (vsep)
out_char ('+');
}
out_char ('\n');
}
void void
do_multitable () do_multitable ()
{ {
...@@ -116,7 +150,7 @@ setup_multitable_parameters () ...@@ -116,7 +150,7 @@ setup_multitable_parameters ()
char *params = insertion_stack->item_function; char *params = insertion_stack->item_function;
int nchars; int nchars;
float columnfrac; float columnfrac;
char command[200]; char command[200]; /* naughty, should be no fixed limits */
int i = 1; int i = 1;
/* We implement @hsep and @vsep even though TeX doesn't. /* We implement @hsep and @vsep even though TeX doesn't.
...@@ -129,21 +163,31 @@ setup_multitable_parameters () ...@@ -129,21 +163,31 @@ setup_multitable_parameters ()
params++; params++;
if (*params == '@') { if (*params == '@') {
sscanf (params, "%s%n", command, &nchars); sscanf (params, "%200s", command);
nchars = strlen (command);
params += nchars; params += nchars;
if (strcmp (command, "@hsep") == 0) if (strcmp (command, "@hsep") == 0)
hsep++; hsep++;
else if (strcmp (command, "@vsep") == 0) else if (strcmp (command, "@vsep") == 0)
vsep++; vsep++;
else if (strcmp (command, "@columnfractions") == 0) { else if (strcmp (command, "@columnfractions") == 0) {
/* Clobber old environments and create new ones, /* Clobber old environments and create new ones, starting at #1.
starting at #1. Environment #0 is the normal standard output, Environment #0 is the normal output, so don't mess with it. */
so we don't mess with it. */
for ( ; i <= MAXCOLS; i++) { for ( ; i <= MAXCOLS; i++) {
if (sscanf (params, "%f%n", &columnfrac, &nchars) < 1) if (sscanf (params, "%f", &columnfrac) < 1)
goto done; goto done;
params += nchars; /* Unfortunately, can't use %n since some m68k-hp-bsd libc
setup_output_environment (i, (int) (columnfrac * fill_column + .5)); doesn't support it. So skip whitespace (preceding the
number) and then non-whitespace (the number). */
while (*params && (*params == ' ' || *params == '\t'))
params++;
/* Hmm, but what what @columnfractions 3foo. Well, I suppose
it's invalid input anyway. */
while (*params && *params != ' ' && *params != '\t'
&& *params != '\n' && *params != '@')
params++;
setup_output_environment (i,
(int) (columnfrac * (fill_column - current_indent) + .5));
} }
} }
...@@ -154,18 +198,17 @@ setup_multitable_parameters () ...@@ -154,18 +198,17 @@ setup_multitable_parameters ()
} }
/* This gives us two spaces between columns. Seems reasonable. /* This gives us two spaces between columns. Seems reasonable.
Really should expand the text, though, so a template of Really should expand the text, though, so a template of
`@code{foo}' has a width of three, not ten. Also have to match `@code{foo}' has a width of five, not ten. Also have to match
braces, then. */ braces, then. How to take into account current_indent here? */
setup_output_environment (i++, params++ - start); setup_output_environment (i++, params++ - start);
} else { } else {
warning ("ignoring stray text `%s' after @multitable", params); warning (_("ignoring stray text `%s' after @multitable"), params);
break; break;
} }
} }
done: done:
flush_output (); flush_output ();
inhibit_output_flushing (); inhibit_output_flushing ();
...@@ -227,12 +270,12 @@ select_output_environment (n) ...@@ -227,12 +270,12 @@ select_output_environment (n)
} }
/* advance to the next environment number */ /* advance to the next environment number */
int void
nselect_next_environment () nselect_next_environment ()
{ {
if (current_env_no >= last_column) { if (current_env_no >= last_column) {
line_error ("Too many columns in multitable item (max %d)", last_column); line_error (_("Too many columns in multitable item (max %d)"), last_column);
return 1; return;
} }
select_output_environment (current_env_no + 1); select_output_environment (current_env_no + 1);
} }
...@@ -240,12 +283,25 @@ nselect_next_environment () ...@@ -240,12 +283,25 @@ nselect_next_environment ()
static void output_multitable_row (); static void output_multitable_row ();
/* do anything needed at the beginning of processing a
multitable column. */
void
init_column ()
{
/* don't indent 1st paragraph in the item */
cm_noindent ();
/* throw away possible whitespace after @item or @tab command */
skip_whitespace ();
}
/* start a new item (row) of a multitable */ /* start a new item (row) of a multitable */
int
multitable_item () multitable_item ()
{ {
if (!multitable_active) { if (!multitable_active) {
/* impossible, I think. */ /* impossible, I think. */
error ("multitable item not in active multitable"); error (_("multitable item not in active multitable"));
exit (1); exit (1);
} }
if (current_env_no > 0) { if (current_env_no > 0) {
...@@ -254,7 +310,7 @@ multitable_item () ...@@ -254,7 +310,7 @@ multitable_item ()
/* start at column 1 */ /* start at column 1 */
select_output_environment (1); select_output_environment (1);
if (!output_paragraph) { if (!output_paragraph) {
line_error ("Cannot select column #%d in multitable", current_env_no); line_error (_("Cannot select column #%d in multitable"), current_env_no);
exit (FATAL); exit (FATAL);
} }
...@@ -263,38 +319,10 @@ multitable_item () ...@@ -263,38 +319,10 @@ multitable_item ()
return 0; return 0;
} }
/* do anything needed at the beginning of processing a
multitable column. */
init_column ()
{
/* don't indent 1st paragraph in the item */
cm_noindent ();
/* throw away possible whitespace after @item or @tab command */
skip_whitespace ();
}
/* Output a row. Have to keep `output_position' up-to-date for each
character we output, or the tags table will be off, leading to
chopped-off output files and undefined nodes (because they're in the
wrong file, etc.). Perhaps it would be better to accumulate this
value somewhere and add it once at the end of the table, or return it
as the value, but this seems simplest. */
static void
out_char (ch)
int ch;
{
extern int output_position;
putc (ch, output_stream);
output_position++;
}
static void static void
output_multitable_row () output_multitable_row ()
{ {
int i, j, remaining; int i, j, s, remaining;
/* offset in the output paragraph of the next char needing /* offset in the output paragraph of the next char needing
to be output for that column. */ to be output for that column. */
...@@ -332,10 +360,15 @@ output_multitable_row () ...@@ -332,10 +360,15 @@ output_multitable_row ()
if (!remaining) if (!remaining)
break; break;
for (s = 0; s < envs[0].current_indent; s++)
out_char (' ');
if (vsep) if (vsep)
out_char ('|'); out_char ('|');
for (i = 1; i <= last_column; i++) { for (i = 1; i <= last_column; i++) {
for (s = 0; i < envs[i].current_indent; s++)
out_char (' ');
for (j = 0; CHAR_ADDR (j) < envs[i].output_paragraph_offset; j++) { for (j = 0; CHAR_ADDR (j) < envs[i].output_paragraph_offset; j++) {
if (CHAR_AT (j) == '\n') if (CHAR_AT (j) == '\n')
break; break;
...@@ -363,27 +396,12 @@ output_multitable_row () ...@@ -363,27 +396,12 @@ output_multitable_row ()
#undef CHAR_AT #undef CHAR_AT
#undef CHAR_ADDR #undef CHAR_ADDR
int
draw_horizontal_separator ()
{
int i, j;
if (vsep)
out_char ('+');
for (i = 1; i <= last_column; i++) {
for (j = 0; j <= envs[i].fill_column; j++)
out_char ('-');
if (vsep)
out_char ('+');
}
out_char ('\n');
}
/* select a new column in current row of multitable */ /* select a new column in current row of multitable */
void void
cm_tab () cm_tab ()
{ {
if (!multitable_active) if (!multitable_active)
error ("ignoring @tab outside of multitable"); error (_("ignoring @tab outside of multitable"));
nselect_next_environment (); nselect_next_environment ();
init_column (); init_column ();
...@@ -394,8 +412,6 @@ cm_tab () ...@@ -394,8 +412,6 @@ cm_tab ()
void void
end_multitable () end_multitable ()
{ {
int i;
output_multitable_row (); output_multitable_row ();
/* Multitables cannot be nested. Otherwise, we'd have to save the /* Multitables cannot be nested. Otherwise, we'd have to save the
...@@ -409,10 +425,10 @@ end_multitable () ...@@ -409,10 +425,10 @@ end_multitable ()
uninhibit_output_flushing (); uninhibit_output_flushing ();
#if 0 #if 0
printf ("** Multicolumn output from last row:\n"); printf (_("** Multicolumn output from last row:\n"));
for (i = 1; i <= last_column; i++) { for (i = 1; i <= last_column; i++) {
select_output_environment (i); select_output_environment (i);
printf ("* column #%d: output = %s\n", i, output_paragraph); printf (_("* column #%d: output = %s\n"), i, output_paragraph);
} }
#endif #endif
} }
#!/bin/sh #!/bin/sh
# $Id: gen-dir-node,v 1.1 1997/08/21 22:58:12 jason Exp $ # $Id: gen-dir-node,v 1.1 1997/05/22 22:02:43 karl Exp $
# Generate the top-level Info node, given a directory of Info files # Generate the top-level Info node, given a directory of Info files
# and (optionally) a skeleton file. The output will be suitable for a # and (optionally) a skeleton file. The output will be suitable for a
# top-level dir file. The skeleton file contains info topic names in the # top-level dir file. The skeleton file contains info topic names in the
...@@ -164,9 +164,14 @@ else ...@@ -164,9 +164,14 @@ else
fi fi
for file in ${infofiles}; do for file in ${infofiles}; do
case $file in
*.gz) zcat=zcat; file=`echo $file|sed 's/\.gz$//'`; gz=.gz;;
*) zcat=cat; gz=;;
esac
infoname=`echo $file | sed 's/\.info$//'` infoname=`echo $file | sed 's/\.info$//'`
entry=`sed -e '1,/START-INFO-DIR-ENTRY/d' \ entry=`$zcat ${INFODIR}/${file}$gz \
-e '/END-INFO-DIR-ENTRY/,$d' ${INFODIR}/${file}` |sed -e '1,/START-INFO-DIR-ENTRY/d' \
-e '/END-INFO-DIR-ENTRY/,$d'`
if [ ! -z "${entry}" ] ; then if [ ! -z "${entry}" ] ; then
echo "${entry}" echo "${entry}"
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
# $Id: texi2dvi,v 1.1 1997/08/21 22:58:13 jason Exp $ # $Id: texi2dvi,v 0.6 1997/07/14 19:23:18 karl Exp $
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
progname=`echo "$0" | sed -e 's/[^\/]*\///g'` progname=`echo "$0" | sed -e 's/[^\/]*\///g'`
# This string is expanded by rcs automatically when this file is checked out. # This string is expanded by rcs automatically when this file is checked out.
rcs_revision='$Revision: 1.1 $' rcs_revision='$Revision: 0.6 $'
version=`set - $rcs_revision; echo $2` version=`set - $rcs_revision; echo $2`
# To prevent hairy quoting and escaping later. # To prevent hairy quoting and escaping later.
...@@ -329,39 +329,6 @@ done ...@@ -329,39 +329,6 @@ done
$verbose "$0 done." $verbose "$0 done."
true # exit successfully. true # exit successfully.
# texi2dvi ends here
# $Log: texi2dvi,v $
# Revision 1.1 1997/08/21 22:58:13 jason
# Initial revision
#
# Revision 1.10 1996/10/04 18:21:55 karl
# Include only the current year in the copyright message.
#
# Revision 1.9 1996/10/04 11:49:48 karl
# Exit successfully. From arnold.
#
# Revision 1.8 1996/10/03 23:14:26 karl
# Only show diff if verbose.
# Update version number.
#
# Revision 1.7 1996/09/29 22:56:08 karl
# Use $progname instead of $0 for --version.
#
# Revision 1.6 1996/09/28 21:01:23 karl
# Recompute original index files each time through loop.
# Make indentation uniform.
# Use same basename for the temp input files.
# Standardize --version output.
#
# Revision 1.5 1996/09/26 14:46:34 karl
# (texi2dvi): Run TeX until the aux/index files stabilize, instead of just
# twice. From: David Shaw <daves@gsms01.alcatel.com.au>.
#
# Revision 1.4 1996/08/27 18:59:26 karl
# Include bug reporting address.
#
# Revision 1.3 1996/07/26 18:20:56 karl
# Do macro expansion with makeinfo before running TeX. # Do macro expansion with makeinfo before running TeX.
# Various expansion safety measures added for test; avoid use of -o. # Various expansion safety measures added for test; avoid use of -o.
# #
/* Prepare TeX index dribble output into an actual index. /* Prepare TeX index dribble output into an actual index.
$Id: texindex.c,v 1.1 1997/08/21 22:58:13 jason Exp $ $Id: texindex.c,v 1.17 1997/07/24 23:34:45 karl Exp $
Copyright (C) 1987, 91, 92, 96 Free Software Foundation, Inc. Copyright (C) 1987, 91, 92, 96, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -17,12 +17,8 @@ ...@@ -17,12 +17,8 @@
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307. */ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307. */
#include <stdio.h> #include "system.h"
#include <ctype.h> #include <getopt.h>
#include <errno.h>
#include "getopt.h"
#define TEXINDEX_VERSION_STRING "GNU Texindex (Texinfo 3.9) 2.1"
#if defined (emacs) #if defined (emacs)
# include "../src/config.h" # include "../src/config.h"
...@@ -33,26 +29,6 @@ ...@@ -33,26 +29,6 @@
# undef open # undef open
#endif #endif
#if defined (HAVE_STRING_H)
# include <string.h>
#endif /* HAVE_STRING_H */
#if !defined (HAVE_STRCHR)
char *strrchr ();
#endif /* !HAVE_STRCHR */
#if defined (STDC_HEADERS)
# include <stdlib.h>
#else /* !STDC_HEADERS */
char *getenv (), *malloc (), *realloc ();
#endif /* !STDC_HEADERS */
#if defined (HAVE_UNISTD_H)
# include <unistd.h>
#else /* !HAVE_UNISTD_H */
off_t lseek ();
#endif /* !HAVE_UNISTD_H */
#if !defined (HAVE_MEMSET) #if !defined (HAVE_MEMSET)
#undef memset #undef memset
#define memset(ptr, ignore, count) bzero (ptr, count) #define memset(ptr, ignore, count) bzero (ptr, count)
...@@ -89,13 +65,6 @@ char *mktemp (); ...@@ -89,13 +65,6 @@ char *mktemp ();
# define SEEK_END 2 # define SEEK_END 2
#endif /* !SEEK_SET */ #endif /* !SEEK_SET */
#ifndef errno
extern int errno;
#endif
#ifndef strerror
extern char *strerror ();
#endif
/* When sorting in core, this structure describes one line /* When sorting in core, this structure describes one line
and the position and length of its first keyfield. */ and the position and length of its first keyfield. */
struct lineinfo struct lineinfo
...@@ -214,6 +183,15 @@ main (argc, argv) ...@@ -214,6 +183,15 @@ main (argc, argv)
else else
program_name = argv[0]; program_name = argv[0];
#ifdef HAVE_SETLOCALE
/* Set locale via LC_ALL. */
setlocale (LC_ALL, "");
#endif
/* Set the text message domain. */
bindtextdomain (PACKAGE, LOCALEDIR);
textdomain (PACKAGE);
/* Describe the kind of sorting to do. */ /* Describe the kind of sorting to do. */
/* The first keyfield uses the first braced field and folds case. */ /* The first keyfield uses the first braced field and folds case. */
keyfields[0].braced = 1; keyfields[0].braced = 1;
...@@ -282,15 +260,15 @@ typedef struct ...@@ -282,15 +260,15 @@ typedef struct
TEXINDEX_OPTION texindex_options[] = { TEXINDEX_OPTION texindex_options[] = {
{ "--keep", "-k", &keep_tempfiles, 1, (char *)NULL, { "--keep", "-k", &keep_tempfiles, 1, (char *)NULL,
"keep temporary files around after processing" }, N_("keep temporary files around after processing") },
{ "--no-keep", 0, &keep_tempfiles, 0, (char *)NULL, { "--no-keep", 0, &keep_tempfiles, 0, (char *)NULL,
"do not keep temporary files around after processing (default)" }, N_("do not keep temporary files around after processing (default)") },
{ "--output", "-o", (int *)NULL, 0, "FILE", { "--output", "-o", (int *)NULL, 0, "FILE",
"send output to FILE" }, N_("send output to FILE") },
{ "--version", (char *)NULL, (int *)NULL, 0, (char *)NULL, { "--version", (char *)NULL, (int *)NULL, 0, (char *)NULL,
"display version information and exit" }, N_("display version information and exit") },
{ "--help", "-h", (int *)NULL, 0, (char *)NULL, { "--help", "-h", (int *)NULL, 0, (char *)NULL,
"display this help and exit" }, N_("display this help and exit") },
{ (char *)NULL, (char *)NULL, (int *)NULL, 0, (char *)NULL } { (char *)NULL, (char *)NULL, (int *)NULL, 0, (char *)NULL }
}; };
...@@ -301,11 +279,11 @@ usage (result_value) ...@@ -301,11 +279,11 @@ usage (result_value)
register int i; register int i;
FILE *f = result_value ? stderr : stdout; FILE *f = result_value ? stderr : stdout;
fprintf (f, "Usage: %s [OPTION]... FILE...\n", program_name); fprintf (f, _("Usage: %s [OPTION]... FILE...\n"), program_name);
fprintf (f, "Generate a sorted index for each TeX output FILE.\n"); fprintf (f, _("Generate a sorted index for each TeX output FILE.\n"));
/* Avoid trigraph nonsense. */ /* Avoid trigraph nonsense. */
fprintf (f, "Usually FILE... is `foo.??\' for a document `foo.texi'.\n"); fprintf (f, _("Usually FILE... is `foo.??\' for a document `foo.texi'.\n"));
fprintf (f, "\nOptions:\n"); fprintf (f, _("\nOptions:\n"));
for (i = 0; texindex_options[i].long_name; i++) for (i = 0; texindex_options[i].long_name; i++)
{ {
...@@ -317,9 +295,9 @@ usage (result_value) ...@@ -317,9 +295,9 @@ usage (result_value)
texindex_options[i].arg_name texindex_options[i].arg_name
? texindex_options[i].arg_name : ""); ? texindex_options[i].arg_name : "");
fprintf (f, "\t%s\n", texindex_options[i].doc_string); fprintf (f, "\t%s\n", _(texindex_options[i].doc_string));
} }
puts ("\nEmail bug reports to bug-texinfo@prep.ai.mit.edu."); puts (_("\nEmail bug reports to bug-texinfo@prep.ai.mit.edu."));
exit (result_value); exit (result_value);
} }
...@@ -333,7 +311,6 @@ decode_command (argc, argv) ...@@ -333,7 +311,6 @@ decode_command (argc, argv)
char **argv; char **argv;
{ {
int arg_index = 1; int arg_index = 1;
int optc;
char **ip; char **ip;
char **op; char **op;
...@@ -367,11 +344,11 @@ decode_command (argc, argv) ...@@ -367,11 +344,11 @@ decode_command (argc, argv)
{ {
if (strcmp (arg, "--version") == 0) if (strcmp (arg, "--version") == 0)
{ {
puts (TEXINDEX_VERSION_STRING); printf (_("texindex (GNU %s %s) 2.1\n"), PACKAGE, VERSION);
puts ("Copyright (C) 1996 Free Software Foundation, Inc.\n\ puts (_("Copyright (C) 1996 Free Software Foundation, Inc.\n\
There is NO warranty. You may redistribute this software\n\ There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\ under the terms of the GNU General Public License.\n\
For more information about these matters, see the files named COPYING."); For more information about these matters, see the files named COPYING."));
exit (0); exit (0);
} }
else if ((strcmp (arg, "--keep") == 0) || else if ((strcmp (arg, "--keep") == 0) ||
...@@ -946,7 +923,7 @@ sort_offline (infile, nfiles, total, outfile) ...@@ -946,7 +923,7 @@ sort_offline (infile, nfiles, total, outfile)
if (lb.buffer[0] != '\\' && lb.buffer[0] != '@') if (lb.buffer[0] != '\\' && lb.buffer[0] != '@')
{ {
error ("%s: not a texinfo index file", infile); error (_("%s: not a texinfo index file"), infile);
return; return;
} }
...@@ -980,7 +957,7 @@ sort_offline (infile, nfiles, total, outfile) ...@@ -980,7 +957,7 @@ sort_offline (infile, nfiles, total, outfile)
if (lb.buffer[0] != '\\' && lb.buffer[0] != '@') if (lb.buffer[0] != '\\' && lb.buffer[0] != '@')
{ {
error ("%s: not a texinfo index file", infile); error (_("%s: not a texinfo index file"), infile);
failure = 1; failure = 1;
goto fail; goto fail;
} }
...@@ -1041,7 +1018,7 @@ sort_in_core (infile, total, outfile) ...@@ -1041,7 +1018,7 @@ sort_in_core (infile, total, outfile)
int desc = open (infile, O_RDONLY, 0); int desc = open (infile, O_RDONLY, 0);
if (desc < 0) if (desc < 0)
fatal ("failure reopening %s", infile); fatal (_("failure reopening %s"), infile);
for (file_size = 0;;) for (file_size = 0;;)
{ {
i = read (desc, data + file_size, total - file_size); i = read (desc, data + file_size, total - file_size);
...@@ -1056,7 +1033,7 @@ sort_in_core (infile, total, outfile) ...@@ -1056,7 +1033,7 @@ sort_in_core (infile, total, outfile)
if (file_size > 0 && data[0] != '\\' && data[0] != '@') if (file_size > 0 && data[0] != '\\' && data[0] != '@')
{ {
error ("%s: not a texinfo index file", infile); error (_("%s: not a texinfo index file"), infile);
return; return;
} }
...@@ -1084,7 +1061,7 @@ sort_in_core (infile, total, outfile) ...@@ -1084,7 +1061,7 @@ sort_in_core (infile, total, outfile)
nextline = parsefile (infile, nextline, file_data, file_size); nextline = parsefile (infile, nextline, file_data, file_size);
if (nextline == 0) if (nextline == 0)
{ {
error ("%s: not a texinfo index file", infile); error (_("%s: not a texinfo index file"), infile);
return; return;
} }
...@@ -1310,7 +1287,7 @@ indexify (line, ostream) ...@@ -1310,7 +1287,7 @@ indexify (line, ostream)
{ {
fprintf (ostream, "\\initial {"); fprintf (ostream, "\\initial {");
fwrite (initial, 1, initiallength, ostream); fwrite (initial, 1, initiallength, ostream);
fprintf (ostream, "}\n", initial); fputs ("}\n", ostream);
if (initial == initial1) if (initial == initial1)
{ {
lastinitial = lastinitial1; lastinitial = lastinitial1;
...@@ -1354,7 +1331,7 @@ indexify (line, ostream) ...@@ -1354,7 +1331,7 @@ indexify (line, ostream)
/* Should not have an entry with no subtopic following one with a subtopic. */ /* Should not have an entry with no subtopic following one with a subtopic. */
if (nosecondary && *lastsecondary) if (nosecondary && *lastsecondary)
error ("entry %s follows an entry with a secondary name", line); error (_("entry %s follows an entry with a secondary name"), line);
/* Start a new secondary entry if necessary. */ /* Start a new secondary entry if necessary. */
if (!nosecondary && strncmp (secondary, lastsecondary, secondarylength)) if (!nosecondary && strncmp (secondary, lastsecondary, secondarylength))
...@@ -1692,7 +1669,7 @@ pfatal_with_name (name) ...@@ -1692,7 +1669,7 @@ pfatal_with_name (name)
s = strerror (errno); s = strerror (errno);
printf ("%s: ", program_name); printf ("%s: ", program_name);
printf ("%s; for file `%s'.\n", s, name); printf (_("%s; for file `%s'.\n"), s, name);
exit (TI_FATAL_ERROR); exit (TI_FATAL_ERROR);
} }
...@@ -1745,6 +1722,21 @@ strrchr (string, character) ...@@ -1745,6 +1722,21 @@ strrchr (string, character)
} }
#endif /* HAVE_STRCHR */ #endif /* HAVE_STRCHR */
void
memory_error (callers_name, bytes_wanted)
char *callers_name;
int bytes_wanted;
{
char printable_string[80];
sprintf (printable_string,
_("Virtual memory exhausted in %s ()! Needed %d bytes."),
callers_name, bytes_wanted);
error (printable_string);
abort ();
}
/* Just like malloc, but kills the program in case of fatal error. */ /* Just like malloc, but kills the program in case of fatal error. */
void * void *
xmalloc (nbytes) xmalloc (nbytes)
...@@ -1776,18 +1768,3 @@ xrealloc (pointer, nbytes) ...@@ -1776,18 +1768,3 @@ xrealloc (pointer, nbytes)
return (temp); return (temp);
} }
memory_error (callers_name, bytes_wanted)
char *callers_name;
int bytes_wanted;
{
char printable_string[80];
sprintf (printable_string,
"Virtual memory exhausted in %s ()! Needed %d bytes.",
callers_name, bytes_wanted);
error (printable_string);
abort ();
}
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