mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-29 02:22:43 +00:00
This commit was generated by cvs2svn to compensate for changes in r93139,
which included commits to RCS files with non-trunk default branches.
This commit is contained in:
commit
093e96ffd9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=93140
@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -313,7 +313,7 @@ Also add information on how to contact you by electronic and paper mail.
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
355
contrib/texinfo/COPYING.DOC
Normal file
355
contrib/texinfo/COPYING.DOC
Normal file
@ -0,0 +1,355 @@
|
||||
GNU Free Documentation License
|
||||
Version 1.1, March 2000
|
||||
|
||||
Copyright (C) 2000 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
||||
0. PREAMBLE
|
||||
|
||||
The purpose of this License is to make a manual, textbook, or other
|
||||
written document "free" in the sense of freedom: to assure everyone
|
||||
the effective freedom to copy and redistribute it, with or without
|
||||
modifying it, either commercially or noncommercially. Secondarily,
|
||||
this License preserves for the author and publisher a way to get
|
||||
credit for their work, while not being considered responsible for
|
||||
modifications made by others.
|
||||
|
||||
This License is a kind of "copyleft", which means that derivative
|
||||
works of the document must themselves be free in the same sense. It
|
||||
complements the GNU General Public License, which is a copyleft
|
||||
license designed for free software.
|
||||
|
||||
We have designed this License in order to use it for manuals for free
|
||||
software, because free software needs free documentation: a free
|
||||
program should come with manuals providing the same freedoms that the
|
||||
software does. But this License is not limited to software manuals;
|
||||
it can be used for any textual work, regardless of subject matter or
|
||||
whether it is published as a printed book. We recommend this License
|
||||
principally for works whose purpose is instruction or reference.
|
||||
|
||||
|
||||
1. APPLICABILITY AND DEFINITIONS
|
||||
|
||||
This License applies to any manual or other work that contains a
|
||||
notice placed by the copyright holder saying it can be distributed
|
||||
under the terms of this License. The "Document", below, refers to any
|
||||
such manual or work. Any member of the public is a licensee, and is
|
||||
addressed as "you".
|
||||
|
||||
A "Modified Version" of the Document means any work containing the
|
||||
Document or a portion of it, either copied verbatim, or with
|
||||
modifications and/or translated into another language.
|
||||
|
||||
A "Secondary Section" is a named appendix or a front-matter section of
|
||||
the Document that deals exclusively with the relationship of the
|
||||
publishers or authors of the Document to the Document's overall subject
|
||||
(or to related matters) and contains nothing that could fall directly
|
||||
within that overall subject. (For example, if the Document is in part a
|
||||
textbook of mathematics, a Secondary Section may not explain any
|
||||
mathematics.) The relationship could be a matter of historical
|
||||
connection with the subject or with related matters, or of legal,
|
||||
commercial, philosophical, ethical or political position regarding
|
||||
them.
|
||||
|
||||
The "Invariant Sections" are certain Secondary Sections whose titles
|
||||
are designated, as being those of Invariant Sections, in the notice
|
||||
that says that the Document is released under this License.
|
||||
|
||||
The "Cover Texts" are certain short passages of text that are listed,
|
||||
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
|
||||
the Document is released under this License.
|
||||
|
||||
A "Transparent" copy of the Document means a machine-readable copy,
|
||||
represented in a format whose specification is available to the
|
||||
general public, whose contents can be viewed and edited directly and
|
||||
straightforwardly with generic text editors or (for images composed of
|
||||
pixels) generic paint programs or (for drawings) some widely available
|
||||
drawing editor, and that is suitable for input to text formatters or
|
||||
for automatic translation to a variety of formats suitable for input
|
||||
to text formatters. A copy made in an otherwise Transparent file
|
||||
format whose markup has been designed to thwart or discourage
|
||||
subsequent modification by readers is not Transparent. A copy that is
|
||||
not "Transparent" is called "Opaque".
|
||||
|
||||
Examples of suitable formats for Transparent copies include plain
|
||||
ASCII without markup, Texinfo input format, LaTeX input format, SGML
|
||||
or XML using a publicly available DTD, and standard-conforming simple
|
||||
HTML designed for human modification. Opaque formats include
|
||||
PostScript, PDF, proprietary formats that can be read and edited only
|
||||
by proprietary word processors, SGML or XML for which the DTD and/or
|
||||
processing tools are not generally available, and the
|
||||
machine-generated HTML produced by some word processors for output
|
||||
purposes only.
|
||||
|
||||
The "Title Page" means, for a printed book, the title page itself,
|
||||
plus such following pages as are needed to hold, legibly, the material
|
||||
this License requires to appear in the title page. For works in
|
||||
formats which do not have any title page as such, "Title Page" means
|
||||
the text near the most prominent appearance of the work's title,
|
||||
preceding the beginning of the body of the text.
|
||||
|
||||
|
||||
2. VERBATIM COPYING
|
||||
|
||||
You may copy and distribute the Document in any medium, either
|
||||
commercially or noncommercially, provided that this License, the
|
||||
copyright notices, and the license notice saying this License applies
|
||||
to the Document are reproduced in all copies, and that you add no other
|
||||
conditions whatsoever to those of this License. You may not use
|
||||
technical measures to obstruct or control the reading or further
|
||||
copying of the copies you make or distribute. However, you may accept
|
||||
compensation in exchange for copies. If you distribute a large enough
|
||||
number of copies you must also follow the conditions in section 3.
|
||||
|
||||
You may also lend copies, under the same conditions stated above, and
|
||||
you may publicly display copies.
|
||||
|
||||
|
||||
3. COPYING IN QUANTITY
|
||||
|
||||
If you publish printed copies of the Document numbering more than 100,
|
||||
and the Document's license notice requires Cover Texts, you must enclose
|
||||
the copies in covers that carry, clearly and legibly, all these Cover
|
||||
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
|
||||
the back cover. Both covers must also clearly and legibly identify
|
||||
you as the publisher of these copies. The front cover must present
|
||||
the full title with all words of the title equally prominent and
|
||||
visible. You may add other material on the covers in addition.
|
||||
Copying with changes limited to the covers, as long as they preserve
|
||||
the title of the Document and satisfy these conditions, can be treated
|
||||
as verbatim copying in other respects.
|
||||
|
||||
If the required texts for either cover are too voluminous to fit
|
||||
legibly, you should put the first ones listed (as many as fit
|
||||
reasonably) on the actual cover, and continue the rest onto adjacent
|
||||
pages.
|
||||
|
||||
If you publish or distribute Opaque copies of the Document numbering
|
||||
more than 100, you must either include a machine-readable Transparent
|
||||
copy along with each Opaque copy, or state in or with each Opaque copy
|
||||
a publicly-accessible computer-network location containing a complete
|
||||
Transparent copy of the Document, free of added material, which the
|
||||
general network-using public has access to download anonymously at no
|
||||
charge using public-standard network protocols. If you use the latter
|
||||
option, you must take reasonably prudent steps, when you begin
|
||||
distribution of Opaque copies in quantity, to ensure that this
|
||||
Transparent copy will remain thus accessible at the stated location
|
||||
until at least one year after the last time you distribute an Opaque
|
||||
copy (directly or through your agents or retailers) of that edition to
|
||||
the public.
|
||||
|
||||
It is requested, but not required, that you contact the authors of the
|
||||
Document well before redistributing any large number of copies, to give
|
||||
them a chance to provide you with an updated version of the Document.
|
||||
|
||||
|
||||
4. MODIFICATIONS
|
||||
|
||||
You may copy and distribute a Modified Version of the Document under
|
||||
the conditions of sections 2 and 3 above, provided that you release
|
||||
the Modified Version under precisely this License, with the Modified
|
||||
Version filling the role of the Document, thus licensing distribution
|
||||
and modification of the Modified Version to whoever possesses a copy
|
||||
of it. In addition, you must do these things in the Modified Version:
|
||||
|
||||
A. Use in the Title Page (and on the covers, if any) a title distinct
|
||||
from that of the Document, and from those of previous versions
|
||||
(which should, if there were any, be listed in the History section
|
||||
of the Document). You may use the same title as a previous version
|
||||
if the original publisher of that version gives permission.
|
||||
B. List on the Title Page, as authors, one or more persons or entities
|
||||
responsible for authorship of the modifications in the Modified
|
||||
Version, together with at least five of the principal authors of the
|
||||
Document (all of its principal authors, if it has less than five).
|
||||
C. State on the Title page the name of the publisher of the
|
||||
Modified Version, as the publisher.
|
||||
D. Preserve all the copyright notices of the Document.
|
||||
E. Add an appropriate copyright notice for your modifications
|
||||
adjacent to the other copyright notices.
|
||||
F. Include, immediately after the copyright notices, a license notice
|
||||
giving the public permission to use the Modified Version under the
|
||||
terms of this License, in the form shown in the Addendum below.
|
||||
G. Preserve in that license notice the full lists of Invariant Sections
|
||||
and required Cover Texts given in the Document's license notice.
|
||||
H. Include an unaltered copy of this License.
|
||||
I. Preserve the section entitled "History", and its title, and add to
|
||||
it an item stating at least the title, year, new authors, and
|
||||
publisher of the Modified Version as given on the Title Page. If
|
||||
there is no section entitled "History" in the Document, create one
|
||||
stating the title, year, authors, and publisher of the Document as
|
||||
given on its Title Page, then add an item describing the Modified
|
||||
Version as stated in the previous sentence.
|
||||
J. Preserve the network location, if any, given in the Document for
|
||||
public access to a Transparent copy of the Document, and likewise
|
||||
the network locations given in the Document for previous versions
|
||||
it was based on. These may be placed in the "History" section.
|
||||
You may omit a network location for a work that was published at
|
||||
least four years before the Document itself, or if the original
|
||||
publisher of the version it refers to gives permission.
|
||||
K. In any section entitled "Acknowledgements" or "Dedications",
|
||||
preserve the section's title, and preserve in the section all the
|
||||
substance and tone of each of the contributor acknowledgements
|
||||
and/or dedications given therein.
|
||||
L. Preserve all the Invariant Sections of the Document,
|
||||
unaltered in their text and in their titles. Section numbers
|
||||
or the equivalent are not considered part of the section titles.
|
||||
M. Delete any section entitled "Endorsements". Such a section
|
||||
may not be included in the Modified Version.
|
||||
N. Do not retitle any existing section as "Endorsements"
|
||||
or to conflict in title with any Invariant Section.
|
||||
|
||||
If the Modified Version includes new front-matter sections or
|
||||
appendices that qualify as Secondary Sections and contain no material
|
||||
copied from the Document, you may at your option designate some or all
|
||||
of these sections as invariant. To do this, add their titles to the
|
||||
list of Invariant Sections in the Modified Version's license notice.
|
||||
These titles must be distinct from any other section titles.
|
||||
|
||||
You may add a section entitled "Endorsements", provided it contains
|
||||
nothing but endorsements of your Modified Version by various
|
||||
parties--for example, statements of peer review or that the text has
|
||||
been approved by an organization as the authoritative definition of a
|
||||
standard.
|
||||
|
||||
You may add a passage of up to five words as a Front-Cover Text, and a
|
||||
passage of up to 25 words as a Back-Cover Text, to the end of the list
|
||||
of Cover Texts in the Modified Version. Only one passage of
|
||||
Front-Cover Text and one of Back-Cover Text may be added by (or
|
||||
through arrangements made by) any one entity. If the Document already
|
||||
includes a cover text for the same cover, previously added by you or
|
||||
by arrangement made by the same entity you are acting on behalf of,
|
||||
you may not add another; but you may replace the old one, on explicit
|
||||
permission from the previous publisher that added the old one.
|
||||
|
||||
The author(s) and publisher(s) of the Document do not by this License
|
||||
give permission to use their names for publicity for or to assert or
|
||||
imply endorsement of any Modified Version.
|
||||
|
||||
|
||||
5. COMBINING DOCUMENTS
|
||||
|
||||
You may combine the Document with other documents released under this
|
||||
License, under the terms defined in section 4 above for modified
|
||||
versions, provided that you include in the combination all of the
|
||||
Invariant Sections of all of the original documents, unmodified, and
|
||||
list them all as Invariant Sections of your combined work in its
|
||||
license notice.
|
||||
|
||||
The combined work need only contain one copy of this License, and
|
||||
multiple identical Invariant Sections may be replaced with a single
|
||||
copy. If there are multiple Invariant Sections with the same name but
|
||||
different contents, make the title of each such section unique by
|
||||
adding at the end of it, in parentheses, the name of the original
|
||||
author or publisher of that section if known, or else a unique number.
|
||||
Make the same adjustment to the section titles in the list of
|
||||
Invariant Sections in the license notice of the combined work.
|
||||
|
||||
In the combination, you must combine any sections entitled "History"
|
||||
in the various original documents, forming one section entitled
|
||||
"History"; likewise combine any sections entitled "Acknowledgements",
|
||||
and any sections entitled "Dedications". You must delete all sections
|
||||
entitled "Endorsements."
|
||||
|
||||
|
||||
6. COLLECTIONS OF DOCUMENTS
|
||||
|
||||
You may make a collection consisting of the Document and other documents
|
||||
released under this License, and replace the individual copies of this
|
||||
License in the various documents with a single copy that is included in
|
||||
the collection, provided that you follow the rules of this License for
|
||||
verbatim copying of each of the documents in all other respects.
|
||||
|
||||
You may extract a single document from such a collection, and distribute
|
||||
it individually under this License, provided you insert a copy of this
|
||||
License into the extracted document, and follow this License in all
|
||||
other respects regarding verbatim copying of that document.
|
||||
|
||||
|
||||
7. AGGREGATION WITH INDEPENDENT WORKS
|
||||
|
||||
A compilation of the Document or its derivatives with other separate
|
||||
and independent documents or works, in or on a volume of a storage or
|
||||
distribution medium, does not as a whole count as a Modified Version
|
||||
of the Document, provided no compilation copyright is claimed for the
|
||||
compilation. Such a compilation is called an "aggregate", and this
|
||||
License does not apply to the other self-contained works thus compiled
|
||||
with the Document, on account of their being thus compiled, if they
|
||||
are not themselves derivative works of the Document.
|
||||
|
||||
If the Cover Text requirement of section 3 is applicable to these
|
||||
copies of the Document, then if the Document is less than one quarter
|
||||
of the entire aggregate, the Document's Cover Texts may be placed on
|
||||
covers that surround only the Document within the aggregate.
|
||||
Otherwise they must appear on covers around the whole aggregate.
|
||||
|
||||
|
||||
8. TRANSLATION
|
||||
|
||||
Translation is considered a kind of modification, so you may
|
||||
distribute translations of the Document under the terms of section 4.
|
||||
Replacing Invariant Sections with translations requires special
|
||||
permission from their copyright holders, but you may include
|
||||
translations of some or all Invariant Sections in addition to the
|
||||
original versions of these Invariant Sections. You may include a
|
||||
translation of this License provided that you also include the
|
||||
original English version of this License. In case of a disagreement
|
||||
between the translation and the original English version of this
|
||||
License, the original English version will prevail.
|
||||
|
||||
|
||||
9. TERMINATION
|
||||
|
||||
You may not copy, modify, sublicense, or distribute the Document except
|
||||
as expressly provided for under this License. Any other attempt to
|
||||
copy, modify, sublicense or distribute the Document is void, and will
|
||||
automatically terminate your rights under this License. However,
|
||||
parties who have received copies, or rights, from you under this
|
||||
License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
|
||||
10. FUTURE REVISIONS OF THIS LICENSE
|
||||
|
||||
The Free Software Foundation may publish new, revised versions
|
||||
of the GNU Free Documentation License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns. See
|
||||
http://www.gnu.org/copyleft/.
|
||||
|
||||
Each version of the License is given a distinguishing version number.
|
||||
If the Document specifies that a particular numbered version of this
|
||||
License "or any later version" applies to it, you have the option of
|
||||
following the terms and conditions either of that specified version or
|
||||
of any later version that has been published (not as a draft) by the
|
||||
Free Software Foundation. If the Document does not specify a version
|
||||
number of this License, you may choose any version ever published (not
|
||||
as a draft) by the Free Software Foundation.
|
||||
|
||||
|
||||
ADDENDUM: How to use this License for your documents
|
||||
|
||||
To use this License in a document you have written, include a copy of
|
||||
the License in the document and put the following copyright and
|
||||
license notices just after the title page:
|
||||
|
||||
Copyright (c) YEAR YOUR NAME.
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.1
|
||||
or any later version published by the Free Software Foundation;
|
||||
with the Invariant Sections being LIST THEIR TITLES, with the
|
||||
Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
|
||||
A copy of the license is included in the section entitled "GNU
|
||||
Free Documentation License".
|
||||
|
||||
If you have no Invariant Sections, write "with no Invariant Sections"
|
||||
instead of saying which ones are invariant. If you have no
|
||||
Front-Cover Texts, write "no Front-Cover Texts" instead of
|
||||
"Front-Cover Texts being LIST"; likewise for Back-Cover Texts.
|
||||
|
||||
If your document contains nontrivial examples of program code, we
|
||||
recommend releasing these examples in parallel under your choice of
|
||||
free software license, such as the GNU General Public License,
|
||||
to permit their use in free software.
|
File diff suppressed because it is too large
Load Diff
@ -167,7 +167,9 @@ operates.
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made.
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
|
@ -1,3 +1,12 @@
|
||||
Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000, 01
|
||||
Free Software Foundation.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.1 or
|
||||
any later version published by the Free Software Foundation; with no
|
||||
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts.
|
||||
|
||||
|
||||
Getting Started with Texinfo
|
||||
============================
|
||||
|
||||
|
@ -1,5 +1,39 @@
|
||||
Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000, 01, 02
|
||||
Free Software Foundation.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.1 or
|
||||
any later version published by the Free Software Foundation; with no
|
||||
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts.
|
||||
|
||||
This file records noteworthy changes.
|
||||
|
||||
4.1 (4 March 2002)
|
||||
* Language:
|
||||
. new commands @verbatim and @verb for printing verbatim inserts.
|
||||
. new command @verbatiminclude for verbatim include of files.
|
||||
. new environment @documentdescription for defining the HTML description.
|
||||
. new command @afivepaper for the A5 paper size.
|
||||
* makeinfo:
|
||||
. supports xml and docbook output.
|
||||
. supports HTML splitting by node, which is now the default.
|
||||
. new option --split-size to control maximum size of split info files.
|
||||
* info:
|
||||
. user-specified key bindings supported.
|
||||
. ANSI escape sequences (as produced by groff) removed from man output
|
||||
by default; use --raw-escapes to let them through if your terminal
|
||||
supports them.
|
||||
* texinfo.tex:
|
||||
. @math implies @tex, so all the usual plain TeX math is supported.
|
||||
. smaller fonts for @smallexample, in all page sizes.
|
||||
. improvements in the PDF support.
|
||||
* texi2dvi:
|
||||
. new option -o to explicitly specify output filename.
|
||||
* Distribution:
|
||||
. switch to GNU Free Documentation License (http://www.gnu.org/copyleft/).
|
||||
. update to GNU gettext 0.11, autoconf 2.52, and automake 1.5.
|
||||
. Danish, Swedish, and Hebrew message translations.
|
||||
|
||||
4.0 (28 September 1999)
|
||||
* Language:
|
||||
. New command @anchor for cross references to arbitrary points.
|
||||
@ -34,6 +68,7 @@ This file records noteworthy changes.
|
||||
. @emph and @i use true italic type (cmti) instead of slanted (cmsl).
|
||||
. implements pdf output when run with pdftex.
|
||||
. better support for internationalization via txi-??.tex files.
|
||||
. footnotes now set in a smaller point size.
|
||||
* makeinfo:
|
||||
. supports HTML output with the --html option.
|
||||
. implication of --html: @top nodes should be wrapped in @ifnottex
|
||||
|
@ -1,31 +1,42 @@
|
||||
Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000, 01, 02
|
||||
Free Software Foundation.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.1 or
|
||||
any later version published by the Free Software Foundation; with no
|
||||
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts.
|
||||
|
||||
|
||||
This is the README file for the GNU Texinfo distribution.
|
||||
The primary distribution point is ftp://ftp.gnu.org/gnu/texinfo/.
|
||||
The primary distribution point is ftp://ftp.gnu.org/gnu/texinfo/
|
||||
and the primary home page is http://www.gnu.org/software/texinfo/,
|
||||
secondary home page at http://texinfo.org/.
|
||||
|
||||
Mailing lists:
|
||||
- bug-texinfo@gnu.org for bug reports or enhancement suggestions,
|
||||
archived at ftp://ftp-mailing-list-archives.gnu.org/.
|
||||
archived at ftp://ftp-mailing-list-archives.gnu.org/bug-texinfo/.
|
||||
- help-texinfo@gnu.org for authoring questions and general discussion.
|
||||
archived at the same place.
|
||||
- texinfo-pretest@tug.org for pretests of new releases,
|
||||
archived at http://tug.org/archives/texinfo-pretest/.
|
||||
archived at ftp://ftp-mailing-list-archives.gnu.org/help-texinfo/.
|
||||
- texinfo-pretest@texinfo.org for pretests of new releases,
|
||||
archived at ftp://ftp.texinfo.org/texinfo/texinfo-pretest-archive/.
|
||||
There are as yet no corresponding newsgroups.
|
||||
|
||||
For bug reports, please include enough information for the maintainers
|
||||
to reproduce the problem. Generally speaking, that means:
|
||||
- the contents of any input files necessary to reproduce the bug (crucial!).
|
||||
- a description of the problem and any samples of the erroneous output.
|
||||
- the version number of Texinfo and the program(s) involved (use --version).
|
||||
- hardware, operating system, and compiler versions (uname -a).
|
||||
- any unusual options you gave to configure (see config.status).
|
||||
- the contents of any input files necessary to reproduce the bug (crucial!).
|
||||
- a description of the problem and any samples of the erroneous output.
|
||||
- anything else that you think would be helpful.
|
||||
|
||||
Patches are most welcome; if possible, please make them with diff -c and
|
||||
include ChangeLog entries.
|
||||
|
||||
When sending email, please do not encode or split the messages in any
|
||||
way if at all possible; it's much easier to deal with one large message
|
||||
than many small ones. GNU shar is a convenient way of packaging
|
||||
multiple and/or binary files for email.
|
||||
way if at all possible; it's easier to deal with one large message than
|
||||
many small ones. GNU shar is a convenient way of packaging multiple
|
||||
and/or binary files for email.
|
||||
|
||||
|
||||
For generic installation instructions on compiling and installing this
|
||||
@ -47,7 +58,7 @@ Installation notes specific to Texinfo:
|
||||
to config.h after running configure.
|
||||
|
||||
* For instructions on compiling this distribution with DJGPP tools
|
||||
for MS-DOS and MS-Windows, please see the file djgpp/README.
|
||||
for MS-DOS and MS-Windows, see the file djgpp/README.
|
||||
|
||||
|
||||
If you would like to contribute to the GNU project by implementing
|
||||
@ -56,11 +67,14 @@ great. But please do not write a separate translator texi2foo for your
|
||||
favorite format foo! That is the hard way to do the job, and makes
|
||||
extra work in subsequent maintenance, since the Texinfo language is
|
||||
continually being enhanced and updated. Instead, the best approach is
|
||||
modify Makeinfo to generate the new format, as it does now for Info and HTML.
|
||||
modify Makeinfo to generate the new format, as it does now for Info,
|
||||
HTML, XML, and DocBook.
|
||||
|
||||
If you want to convert from DocBook to Texinfo, please see
|
||||
http://docbook2X.sourceforge.net/.
|
||||
|
||||
|
||||
This distribution includes the following files, among others:
|
||||
|
||||
README This file.
|
||||
|
||||
NEWS Summary of new features by release.
|
||||
@ -70,7 +84,6 @@ This distribution includes the following files, among others:
|
||||
Texinfo source files in this distribution.
|
||||
|
||||
Texinfo source files (in ./doc):
|
||||
|
||||
texinfo.txi Describes the Texinfo language and many
|
||||
of the associated tools. It tells how
|
||||
to use Texinfo to write documentation,
|
||||
@ -93,7 +106,6 @@ Texinfo source files (in ./doc):
|
||||
source (./info).
|
||||
|
||||
Printing related files:
|
||||
|
||||
doc/texinfo.tex This TeX definitions file tells
|
||||
the TeX program how to typeset a
|
||||
Texinfo file into a DVI file ready for
|
||||
@ -121,7 +133,6 @@ Source files for standalone C programs (./lib, ./makeinfo, ./info):
|
||||
view Info files on an ASCII terminal.
|
||||
|
||||
Installation files:
|
||||
|
||||
configure This file creates creates a Makefile
|
||||
which in turn creates an `info' or
|
||||
`makeinfo' executable, or a C sources
|
||||
@ -139,7 +150,6 @@ Installation files:
|
||||
|
||||
|
||||
Other files:
|
||||
|
||||
fixfonts This is a shell script to install the
|
||||
`lcircle10' TeX fonts as an alias for
|
||||
the `circle10' fonts. In some older
|
||||
|
@ -1,21 +1,26 @@
|
||||
Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2000, 01
|
||||
Free Software Foundation.
|
||||
|
||||
Permission is granted to copy, distribute and/or modify this document
|
||||
under the terms of the GNU Free Documentation License, Version 1.1 or
|
||||
any later version published by the Free Software Foundation; with no
|
||||
Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts.
|
||||
|
||||
|
||||
If you are interested in working on any of these, email bug-texinfo@gnu.org.
|
||||
|
||||
* Makeinfo:
|
||||
- Support output of Docbook format and SGML-Tools format.
|
||||
- Support output of true 8-bit characters from accent commands, etc.
|
||||
- Try directory of main source file.
|
||||
- Support @`{@dotless{i}} et al. in HTML.
|
||||
- A detexinfo program, like detex or delatex. This command would
|
||||
strip all the texinfo commands out, and would be used as a filter on
|
||||
the way to a speller. An option would be to NOT strip comments out.
|
||||
makeinfo --no-headers comes close.
|
||||
- If node name contains an @ command, complain explicitly.
|
||||
- Better ASCII output: convert menus to single table of contents,
|
||||
enumerate chapters and sections, convert cross-refs and indices to
|
||||
chapter/section references. See:
|
||||
ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2/faq201s.zip
|
||||
- Call Ghostscript to get ASCII output for the @image command.
|
||||
- Call Ghostscript to get ASCII/jpg output for the @image command.
|
||||
- Better HTML output: allow settable background color, table colors
|
||||
and spacing, <head> meta tags, back link from footnote marker, etc.
|
||||
- Could warn if @sc{TEXT} for all-caps TEXT, since it's a no-op.
|
||||
- Rewrite completely to simplify generation of different formats.
|
||||
|
||||
* TeX:
|
||||
- Use @ as the escape character, and Texinfo syntax generally, in the
|
||||
@ -23,16 +28,16 @@ If you are interested in working on any of these, email bug-texinfo@gnu.org.
|
||||
multiple redefinitions of every Texinfo command in different contexts.
|
||||
- Handle @hsep and @vsep in @multitables.
|
||||
- Introduce new command to change \bindingoffset.
|
||||
- Reasonable way to change fonts from the default (some work has been done).
|
||||
- How about using latex2html to produce HTML?
|
||||
- Support 8-bit input characters, perhaps via the ec fonts.
|
||||
- Repeat table headings if a @multitable is multiple pages long.
|
||||
|
||||
* 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.
|
||||
- @xindexterm [def] primary [,secondary [,tertiary]] or some such?
|
||||
- Support compressed image files.
|
||||
- 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'.
|
||||
- Allow @end (and other?) commands to be indented in the source.
|
||||
- Get Info declared as a MIME Content-Type.
|
||||
|
||||
@ -45,29 +50,31 @@ If you are interested in working on any of these, email bug-texinfo@gnu.org.
|
||||
@caption ... @end caption
|
||||
<arbitrary Texinfo commands>
|
||||
@end figure
|
||||
- multicolumn * width to take up `the rest'.
|
||||
- another table command to take N succeeding items and split them
|
||||
into M columns (see eplain).
|
||||
- support bibliographies with BibTeX (see web2c/doc for kludge prototype).
|
||||
- @flushboth to combine @flushleft and @flushright, for RFC's.
|
||||
- @part sectioning command.
|
||||
- Allow subitems and `see' and `see also' in indices.
|
||||
- @verbatim ... @end verbatim.
|
||||
- @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.
|
||||
- Support automatic line numbering of examples.
|
||||
- Better macro syntax.
|
||||
- Allow : in node names for info files, for names like `class::method'.
|
||||
- Change bars. This is difficult or impossible in TeX,
|
||||
unfortunately. To do it right requires device driver support.
|
||||
wdiff or ediff may be better in some cases, anyway.
|
||||
wdiff or ediff may be all we can do.
|
||||
|
||||
* 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
|
||||
- Improve the manuals, especially for makeinfo, standalone info, etc.
|
||||
- new section on doing dedication pages. See gawk.texi
|
||||
for an example of doing it in both the tex and info versions.
|
||||
|
||||
* Info:
|
||||
- Regular expression search.
|
||||
- Allow key rebinding, perhaps through the readline library.
|
||||
- Full-text search across all info files installed on the system.
|
||||
- Support character sets other than ISO Latin 1.
|
||||
- Perhaps comply with LANGUAGE setting on a per-node basis, to allow
|
||||
@ -75,21 +82,32 @@ If you are interested in working on any of these, email bug-texinfo@gnu.org.
|
||||
- Search all nodes of dir file at startup, then can have
|
||||
INFO-DIR-SEPARATE-GROUPS and other such.
|
||||
- Better dir file merging.
|
||||
- Steal interface ideas from Lynx: TAB for navigating to next link
|
||||
within a page, number links, use color, etc. Perhaps code from the pinfo
|
||||
viewer can be reused: http://zeus.polsl.gliwice.pl/~pborys/.
|
||||
- Steal interface ideas from Lynx: number links, use color, etc.
|
||||
Perhaps code from the pinfo viewer can be reused:
|
||||
http://zeus.polsl.gliwice.pl/~pborys/.
|
||||
- More sample .infokey files, so people can choose without writing their own.
|
||||
- q within help should quit help like C-x 0.
|
||||
- Incorporate an X-based viewer, perhaps tkinfo
|
||||
http://www.math.ucsb.edu/~boldt/tkinfo/
|
||||
or saxinfo.
|
||||
- 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)
|
||||
(But this has the disadvantage of needing to be updated when the
|
||||
Texinfo language changes, so don't.)
|
||||
|
||||
* Install-info:
|
||||
* PDF:
|
||||
- make each letter of the index (A, B, ...) a section in the TOC.
|
||||
From Carsten Dominik <dominik@astro.uva.nl>.
|
||||
|
||||
|
||||
* install-info:
|
||||
- be able to copy the info file to compile-time $(infodir), to
|
||||
simplify by-hand installation.
|
||||
|
||||
|
||||
Ideas that will not be implemented:
|
||||
- Process Texinfo files directly instead of converting to Info:
|
||||
ftp://ftp.cs.berkeley.edu/ucb/people/phelps/tcltk/tkman.tar.Z, which
|
||||
uses Tcl/Tk 8.0 from ftp.smli.com in the /pub/tcl directory.
|
||||
From: phelps@ecstasy.CS.Berkeley.EDU (Tom Phelps)
|
||||
[This has the disadvantage of needing to be updated when the
|
||||
Texinfo language changes, so don't.]
|
||||
|
||||
- Split HTML output by chapter.
|
||||
[Then cross-references in HTML cannot be generated consistently.]
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* config.in. Generated automatically from configure.in by autoheader. */
|
||||
/* config.in. Generated automatically from configure.ac by autoheader. */
|
||||
/* acconfig.h
|
||||
This file is in the public domain.
|
||||
$Id: acconfig.h,v 1.3 1998/12/06 22:04:03 karl Exp $
|
||||
@ -17,78 +17,9 @@
|
||||
|
||||
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
#undef C_ALLOCA
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||
This function is required for alloca.c support on those systems. */
|
||||
#undef CRAY_STACKSEG_END
|
||||
|
||||
/* Define if you have alloca, as a function or macro. */
|
||||
#undef HAVE_ALLOCA
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
#undef HAVE_MMAP
|
||||
|
||||
/* Define if you have the strcoll function and it is properly defined. */
|
||||
#undef HAVE_STRCOLL
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#undef HAVE_VPRINTF
|
||||
|
||||
/* Define as __inline if that's what the C compiler calls it. */
|
||||
#undef inline
|
||||
|
||||
/* Define if on MINIX. */
|
||||
#undef _MINIX
|
||||
|
||||
/* Define to `long' if <sys/types.h> doesn't define. */
|
||||
#undef off_t
|
||||
|
||||
/* Define if the system does not provide POSIX.1 features except
|
||||
with this defined. */
|
||||
#undef _POSIX_1_SOURCE
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define if the setvbuf function takes the buffering type as its second
|
||||
argument and the buffer pointer as the third, as on System V
|
||||
before release 3. */
|
||||
#undef SETVBUF_REVERSED
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
#undef size_t
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
#undef STACK_DIRECTION
|
||||
|
||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
#undef STAT_MACROS_BROKEN
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if your <sys/time.h> declares struct tm. */
|
||||
#undef TM_IN_SYS_TIME
|
||||
/* Define to 1 if including sys/ioctl.h is needed to get TIOCGWINSZ. */
|
||||
#undef GWINSZ_IN_SYS_IOCTL
|
||||
|
||||
/* Define to 1 if NLS is requested. */
|
||||
#undef ENABLE_NLS
|
||||
@ -105,171 +36,311 @@
|
||||
/* Define as 1 if you have the stpcpy function. */
|
||||
#undef HAVE_STPCPY
|
||||
|
||||
/* Define if you have the __argz_count function. */
|
||||
#undef HAVE___ARGZ_COUNT
|
||||
|
||||
/* Define if you have the __argz_next function. */
|
||||
#undef HAVE___ARGZ_NEXT
|
||||
|
||||
/* Define if you have the __argz_stringify function. */
|
||||
#undef HAVE___ARGZ_STRINGIFY
|
||||
|
||||
/* Define if you have the bzero function. */
|
||||
#undef HAVE_BZERO
|
||||
|
||||
/* Define if you have the dcgettext function. */
|
||||
#undef HAVE_DCGETTEXT
|
||||
|
||||
/* Define if you have the getcwd function. */
|
||||
#undef HAVE_GETCWD
|
||||
|
||||
/* Define if you have the getpagesize function. */
|
||||
#undef HAVE_GETPAGESIZE
|
||||
|
||||
/* Define if you have the memcpy function. */
|
||||
#undef HAVE_MEMCPY
|
||||
|
||||
/* Define if you have the memmove function. */
|
||||
#undef HAVE_MEMMOVE
|
||||
|
||||
/* Define if you have the memset function. */
|
||||
#undef HAVE_MEMSET
|
||||
|
||||
/* Define if you have the munmap function. */
|
||||
#undef HAVE_MUNMAP
|
||||
|
||||
/* Define if you have the putenv function. */
|
||||
#undef HAVE_PUTENV
|
||||
|
||||
/* Define if you have the setenv function. */
|
||||
#undef HAVE_SETENV
|
||||
|
||||
/* Define if you have the setlocale function. */
|
||||
#undef HAVE_SETLOCALE
|
||||
|
||||
/* Define if you have the setvbuf function. */
|
||||
#undef HAVE_SETVBUF
|
||||
|
||||
/* Define if you have the sigprocmask function. */
|
||||
#undef HAVE_SIGPROCMASK
|
||||
|
||||
/* Define if you have the sigsetmask function. */
|
||||
#undef HAVE_SIGSETMASK
|
||||
|
||||
/* Define if you have the stpcpy function. */
|
||||
#undef HAVE_STPCPY
|
||||
|
||||
/* Define if you have the strcasecmp function. */
|
||||
#undef HAVE_STRCASECMP
|
||||
|
||||
/* Define if you have the strchr function. */
|
||||
#undef HAVE_STRCHR
|
||||
|
||||
/* Define if you have the strdup function. */
|
||||
#undef HAVE_STRDUP
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#undef HAVE_STRERROR
|
||||
|
||||
/* Define if you have the strncasecmp function. */
|
||||
#undef HAVE_STRNCASECMP
|
||||
|
||||
/* Define if you have the <argz.h> header file. */
|
||||
#undef HAVE_ARGZ_H
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#undef HAVE_LIMITS_H
|
||||
|
||||
/* Define if you have the <locale.h> header file. */
|
||||
#undef HAVE_LOCALE_H
|
||||
|
||||
/* Define if you have the <malloc.h> header file. */
|
||||
#undef HAVE_MALLOC_H
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define if you have the <ncurses/termcap.h> header file. */
|
||||
#undef HAVE_NCURSES_TERMCAP_H
|
||||
|
||||
/* Define if you have the <nl_types.h> header file. */
|
||||
#undef HAVE_NL_TYPES_H
|
||||
|
||||
/* Define if you have the <pwd.h> header file. */
|
||||
#undef HAVE_PWD_H
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define if you have the <sys/fcntl.h> header file. */
|
||||
#undef HAVE_SYS_FCNTL_H
|
||||
|
||||
/* Define if you have the <sys/file.h> header file. */
|
||||
#undef HAVE_SYS_FILE_H
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define if you have the <sys/ptem.h> header file. */
|
||||
#undef HAVE_SYS_PTEM_H
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
/* Define if you have the <sys/ttold.h> header file. */
|
||||
#undef HAVE_SYS_TTOLD_H
|
||||
|
||||
/* Define if you have the <sys/wait.h> header file. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if you have the <termcap.h> header file. */
|
||||
#undef HAVE_TERMCAP_H
|
||||
|
||||
/* Define if you have the <termio.h> header file. */
|
||||
#undef HAVE_TERMIO_H
|
||||
|
||||
/* Define if you have the <termios.h> header file. */
|
||||
#undef HAVE_TERMIOS_H
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have the bsd library (-lbsd). */
|
||||
#undef HAVE_LIBBSD
|
||||
|
||||
/* Define if you have the i library (-li). */
|
||||
#undef HAVE_LIBI
|
||||
|
||||
/* Name of package */
|
||||
/* Define to the name of the distribution. */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Version number of package */
|
||||
/* Define to the version of the distribution. */
|
||||
#undef VERSION
|
||||
|
||||
/* Define if TIOCGWINSZ requires sys/ioctl.h */
|
||||
|
||||
/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
|
||||
systems. This function is required for `alloca.c' support on those systems.
|
||||
*/
|
||||
#undef CRAY_STACKSEG_END
|
||||
|
||||
/* Define if using `alloca.c'. */
|
||||
#undef C_ALLOCA
|
||||
|
||||
/* Define to 1 if translation of program messages to the user's native
|
||||
language is requested. */
|
||||
#undef ENABLE_NLS
|
||||
|
||||
/* Define if `TIOCGWINSZ' requires <sys/ioctl.h> */
|
||||
#undef GWINSZ_IN_SYS_IOCTL
|
||||
|
||||
/* Define if this function is declared. */
|
||||
#undef HAVE_DECL_STRERROR
|
||||
/* Define if you have `alloca', as a function or macro. */
|
||||
#undef HAVE_ALLOCA
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define if you have the <argz.h> header file. */
|
||||
#undef HAVE_ARGZ_H
|
||||
|
||||
/* Define if you have the `bzero' function. */
|
||||
#undef HAVE_BZERO
|
||||
|
||||
/* Define if the GNU dcgettext() function is already present or preinstalled.
|
||||
*/
|
||||
#undef HAVE_DCGETTEXT
|
||||
|
||||
/* Define if this function is declared. */
|
||||
#undef HAVE_DECL_STRCASECMP
|
||||
|
||||
/* Define if this function is declared. */
|
||||
#undef HAVE_DECL_STRNCASECMP
|
||||
|
||||
/* Define if this function is declared. */
|
||||
#undef HAVE_DECL_STRCOLL
|
||||
|
||||
/* Define if this function is declared. */
|
||||
#undef HAVE_DECL_STRERROR
|
||||
|
||||
/* Define if this function is declared. */
|
||||
#undef HAVE_DECL_STRNCASECMP
|
||||
|
||||
/* Define if you don't have `vprintf' but do have `_doprnt.' */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define if you have the `feof_unlocked' function. */
|
||||
#undef HAVE_FEOF_UNLOCKED
|
||||
|
||||
/* Define if you have the `fgets_unlocked' function. */
|
||||
#undef HAVE_FGETS_UNLOCKED
|
||||
|
||||
/* Define if you have the `getcwd' function. */
|
||||
#undef HAVE_GETCWD
|
||||
|
||||
/* Define if you have the `getc_unlocked' function. */
|
||||
#undef HAVE_GETC_UNLOCKED
|
||||
|
||||
/* Define if you have the `getegid' function. */
|
||||
#undef HAVE_GETEGID
|
||||
|
||||
/* Define if you have the `geteuid' function. */
|
||||
#undef HAVE_GETEUID
|
||||
|
||||
/* Define if you have the `getgid' function. */
|
||||
#undef HAVE_GETGID
|
||||
|
||||
/* Define if you have the `getpagesize' function. */
|
||||
#undef HAVE_GETPAGESIZE
|
||||
|
||||
/* Define if the GNU gettext() function is already present or preinstalled. */
|
||||
#undef HAVE_GETTEXT
|
||||
|
||||
/* Define if you have the `getuid' function. */
|
||||
#undef HAVE_GETUID
|
||||
|
||||
/* Define if you have the iconv() function. */
|
||||
#undef HAVE_ICONV
|
||||
|
||||
/* Define if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define if you have the <io.h> header file. */
|
||||
#undef HAVE_IO_H
|
||||
|
||||
/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
|
||||
#undef HAVE_LANGINFO_CODESET
|
||||
|
||||
/* Define if your <locale.h> file defines LC_MESSAGES. */
|
||||
#undef HAVE_LC_MESSAGES
|
||||
|
||||
/* Define if you have the `bsd' library (-lbsd). */
|
||||
#undef HAVE_LIBBSD
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#undef HAVE_LIMITS_H
|
||||
|
||||
/* Define if you have the <locale.h> header file. */
|
||||
#undef HAVE_LOCALE_H
|
||||
|
||||
/* Define if you have the <malloc.h> header file. */
|
||||
#undef HAVE_MALLOC_H
|
||||
|
||||
/* Define if you have the `memcpy' function. */
|
||||
#undef HAVE_MEMCPY
|
||||
|
||||
/* Define if you have the `memmove' function. */
|
||||
#undef HAVE_MEMMOVE
|
||||
|
||||
/* Define if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define if you have the `mempcpy' function. */
|
||||
#undef HAVE_MEMPCPY
|
||||
|
||||
/* Define if you have the `memset' function. */
|
||||
#undef HAVE_MEMSET
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
#undef HAVE_MMAP
|
||||
|
||||
/* Define if you have the `munmap' function. */
|
||||
#undef HAVE_MUNMAP
|
||||
|
||||
/* Define if you have the <ncurses/termcap.h> header file. */
|
||||
#undef HAVE_NCURSES_TERMCAP_H
|
||||
|
||||
/* Define if you have the <nl_types.h> header file. */
|
||||
#undef HAVE_NL_TYPES_H
|
||||
|
||||
/* Define if you have the `putenv' function. */
|
||||
#undef HAVE_PUTENV
|
||||
|
||||
/* Define if you have the <pwd.h> header file. */
|
||||
#undef HAVE_PWD_H
|
||||
|
||||
/* Define if you have the `setenv' function. */
|
||||
#undef HAVE_SETENV
|
||||
|
||||
/* Define if you have the `setlocale' function. */
|
||||
#undef HAVE_SETLOCALE
|
||||
|
||||
/* Define if you have the `setvbuf' function. */
|
||||
#undef HAVE_SETVBUF
|
||||
|
||||
/* Define if you have the `sigprocmask' function. */
|
||||
#undef HAVE_SIGPROCMASK
|
||||
|
||||
/* Define if you have the `sigsetmask' function. */
|
||||
#undef HAVE_SIGSETMASK
|
||||
|
||||
/* Define if you have the <stddef.h> header file. */
|
||||
#undef HAVE_STDDEF_H
|
||||
|
||||
/* Define if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define if you have the `stpcpy' function. */
|
||||
#undef HAVE_STPCPY
|
||||
|
||||
/* Define if you have the `strcasecmp' function. */
|
||||
#undef HAVE_STRCASECMP
|
||||
|
||||
/* Define if you have the `strchr' function. */
|
||||
#undef HAVE_STRCHR
|
||||
|
||||
/* Define if you have the `strcoll' function and it is properly defined. */
|
||||
#undef HAVE_STRCOLL
|
||||
|
||||
/* Define if you have the `strdup' function. */
|
||||
#undef HAVE_STRDUP
|
||||
|
||||
/* Define if you have the `strerror' function. */
|
||||
#undef HAVE_STRERROR
|
||||
|
||||
/* Define if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define if you have the `strncasecmp' function. */
|
||||
#undef HAVE_STRNCASECMP
|
||||
|
||||
/* Define if you have the `strtoul' function. */
|
||||
#undef HAVE_STRTOUL
|
||||
|
||||
/* Define if you have the <sys/fcntl.h> header file. */
|
||||
#undef HAVE_SYS_FCNTL_H
|
||||
|
||||
/* Define if you have the <sys/file.h> header file. */
|
||||
#undef HAVE_SYS_FILE_H
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define if you have the <sys/ptem.h> header file. */
|
||||
#undef HAVE_SYS_PTEM_H
|
||||
|
||||
/* Define if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
/* Define if you have the <sys/ttold.h> header file. */
|
||||
#undef HAVE_SYS_TTOLD_H
|
||||
|
||||
/* Define if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define if you have the <sys/wait.h> header file. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if you have the <termcap.h> header file. */
|
||||
#undef HAVE_TERMCAP_H
|
||||
|
||||
/* Define if you have the <termios.h> header file. */
|
||||
#undef HAVE_TERMIOS_H
|
||||
|
||||
/* Define if you have the <termio.h> header file. */
|
||||
#undef HAVE_TERMIO_H
|
||||
|
||||
/* Define if you have the `tsearch' function. */
|
||||
#undef HAVE_TSEARCH
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have the `vprintf' function. */
|
||||
#undef HAVE_VPRINTF
|
||||
|
||||
/* Define if you have the `__argz_count' function. */
|
||||
#undef HAVE___ARGZ_COUNT
|
||||
|
||||
/* Define if you have the `__argz_next' function. */
|
||||
#undef HAVE___ARGZ_NEXT
|
||||
|
||||
/* Define if you have the `__argz_stringify' function. */
|
||||
#undef HAVE___ARGZ_STRINGIFY
|
||||
|
||||
/* Define as const if the declaration of iconv() needs const. */
|
||||
#undef ICONV_CONST
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define as the return type of signal handlers (`int' or `void'). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||
#undef STACK_DIRECTION
|
||||
|
||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
#undef STAT_MACROS_BROKEN
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if your <sys/time.h> declares `struct tm'. */
|
||||
#undef TM_IN_SYS_TIME
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define if on MINIX. */
|
||||
#undef _MINIX
|
||||
|
||||
/* Define if the system does not provide POSIX.1 features except with this
|
||||
defined. */
|
||||
#undef _POSIX_1_SOURCE
|
||||
|
||||
/* Define if you need to in order for `stat' and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
||||
|
||||
/* Define to empty if `const' does not conform to ANSI C. */
|
||||
#undef const
|
||||
|
||||
/* Define as `__inline' if that's what the C compiler calls it, or to nothing
|
||||
if it is not supported. */
|
||||
#undef inline
|
||||
|
||||
/* Define to `long' if <sys/types.h> does not define. */
|
||||
#undef off_t
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> does not define. */
|
||||
#undef size_t
|
||||
|
||||
|
||||
/* Leave that blank line there!! Autoheader needs it.
|
||||
|
@ -1,6 +1,6 @@
|
||||
This directory contains documentation on the Texinfo system and the TeX
|
||||
sources needed to process Texinfo sources. We recommend using the
|
||||
texi2dvi included in the distribution to run a Texinfo manual through
|
||||
texi2dvi included in this distribution to run a Texinfo manual through
|
||||
TeX to produce a DVI file.
|
||||
|
||||
The .tex files are not installed automatically because TeX installations
|
||||
@ -8,14 +8,14 @@ vary so widely. Installing them in the wrong place would give a false
|
||||
sense of security. So, you should simply cp *.tex to the appropriate
|
||||
place. If your installation follows the TeX Directory Structure
|
||||
standard (http://tug.org/tds/), this will be the directory
|
||||
<texmf>/tex/texinfo/ for texinfo.tex and <texmf>/tex/plain/dvips/ for
|
||||
epsf.tex. If you use the default installation paths, <texmf> will be
|
||||
/usr/local/share/texmf. On systems with TeX preinstalled, as most
|
||||
GNU/Linux distributions offer, <texmf> will often be something like
|
||||
/usr/share/texmf.
|
||||
TEXMF/tex/texinfo/ for texinfo.tex, TEXMF/tex/plain/dvips/ for epsf.tex,
|
||||
and TEXMF/pdftex/plain/misc for pdfcolor.tex. If you use the default
|
||||
installation paths, TEXMF will be /usr/local/share/texmf. On systems
|
||||
with TeX preinstalled, as most GNU/Linux distributions offer, TEXMF
|
||||
will often be something like /usr/share/texmf.
|
||||
|
||||
It is also possible to put these .tex files in a `local' place instead
|
||||
of overwriting existing ones, but it is more complicated. See your TeX
|
||||
of overwriting existing ones, but this is more complicated. See your TeX
|
||||
documentation in general and the texmf.cnf file in particular for information.
|
||||
|
||||
If you add files to your TeX installations, not just replace existing
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/usr/local/bin/perl -w
|
||||
|
||||
# Generate a short man page from --help and --version output.
|
||||
# Copyright © 1997, 98, 99 Free Software Foundation, Inc.
|
||||
# Copyright © 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -18,6 +18,7 @@
|
||||
# Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
# Written by Brendan O'Dea <bod@compusol.com.au>
|
||||
# Available from ftp://ftp.gnu.org/gnu/help2man/
|
||||
|
||||
use 5.004;
|
||||
use strict;
|
||||
@ -26,11 +27,11 @@ use Text::Tabs qw(expand);
|
||||
use POSIX qw(strftime setlocale LC_TIME);
|
||||
|
||||
my $this_program = 'help2man';
|
||||
my $this_version = '1.013';
|
||||
my $this_version = '1.24';
|
||||
my $version_info = <<EOT;
|
||||
$this_program $this_version
|
||||
GNU $this_program $this_version
|
||||
|
||||
Copyright (C) 1997, 98, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
@ -49,95 +50,134 @@ Usage: $this_program [OPTION]... EXECUTABLE
|
||||
-o, --output=FILE send output to `FILE'
|
||||
-N, --no-info suppress pointer to Texinfo manual
|
||||
--help print this help, then exit
|
||||
--version print $this_program program version number, then exit
|
||||
--version print version number, then exit
|
||||
|
||||
EXECUTABLE should accept `--help' and `--version' options.
|
||||
|
||||
Report bugs to <bug-help2man\@gnu.org>.
|
||||
EOT
|
||||
|
||||
my $section = 1;
|
||||
my ($include, $opt_name, $opt_include, $opt_output, $opt_no_info);
|
||||
my ($opt_name, @opt_include, $opt_output, $opt_no_info);
|
||||
my %opt_def = (
|
||||
'n|name=s' => \$opt_name,
|
||||
's|section=s' => \$section,
|
||||
'i|include=s' => sub { push @opt_include, [ pop, 1 ] },
|
||||
'I|opt-include=s' => sub { push @opt_include, [ pop, 0 ] },
|
||||
'o|output=s' => \$opt_output,
|
||||
'N|no-info' => \$opt_no_info,
|
||||
);
|
||||
|
||||
# Parse options.
|
||||
Getopt::Long::config('bundling');
|
||||
GetOptions (
|
||||
'n|name=s' => \$opt_name,
|
||||
's|section=s' => \$section,
|
||||
'i|include=s' => \$include,
|
||||
'I|opt-include=s' => \$opt_include,
|
||||
'o|output=s' => \$opt_output,
|
||||
'N|no-info' => \$opt_no_info,
|
||||
help => sub { print $help_info; exit },
|
||||
version => sub { print $version_info; exit },
|
||||
GetOptions (%opt_def,
|
||||
help => sub { print $help_info; exit },
|
||||
version => sub { print $version_info; exit },
|
||||
) or die $help_info;
|
||||
|
||||
die $help_info unless @ARGV == 1;
|
||||
|
||||
my %include = ();
|
||||
my @include = (); # to retain order
|
||||
my %append = ();
|
||||
my @include = (); # retain order given in include file
|
||||
|
||||
# Provide replacement `quote-regex' operator for pre-5.005.
|
||||
BEGIN { eval q(sub qr { '' =~ $_[0]; $_[0] }) if $] < 5.005 }
|
||||
|
||||
# Process include file (if given). Format is:
|
||||
#
|
||||
# [section name]
|
||||
# verbatim text
|
||||
# [section name]
|
||||
# verbatim text
|
||||
#
|
||||
# or
|
||||
#
|
||||
# /pattern/
|
||||
# verbatim text
|
||||
#
|
||||
|
||||
if ($include or $opt_include)
|
||||
while (@opt_include)
|
||||
{
|
||||
if (open INC, $include || $opt_include)
|
||||
{
|
||||
my $sect;
|
||||
my ($inc, $required) = @{shift @opt_include};
|
||||
|
||||
while (<INC>)
|
||||
next unless -f $inc or $required;
|
||||
die "$this_program: can't open `$inc' ($!)\n"
|
||||
unless open INC, $inc;
|
||||
|
||||
my $key;
|
||||
my $hash = \%include;
|
||||
|
||||
while (<INC>)
|
||||
{
|
||||
# [section]
|
||||
if (/^\[([^]]+)\]/)
|
||||
{
|
||||
if (/^\[([^]]+)\]/)
|
||||
$key = uc $1;
|
||||
$key =~ s/^\s+//;
|
||||
$key =~ s/\s+$//;
|
||||
$hash = \%include;
|
||||
push @include, $key unless $include{$key};
|
||||
next;
|
||||
}
|
||||
|
||||
# /pattern/
|
||||
if (m!^/(.*)/([ims]*)!)
|
||||
{
|
||||
my $pat = $2 ? "(?$2)$1" : $1;
|
||||
|
||||
# Check pattern.
|
||||
eval { $key = qr($pat) };
|
||||
if ($@)
|
||||
{
|
||||
$sect = uc $1;
|
||||
$sect =~ s/^\s+//;
|
||||
$sect =~ s/\s+$//;
|
||||
next;
|
||||
$@ =~ s/ at .*? line \d.*//;
|
||||
die "$inc:$.:$@";
|
||||
}
|
||||
|
||||
# Silently ignore anything before the first
|
||||
# section--allows for comments and revision info.
|
||||
next unless $sect;
|
||||
|
||||
push @include, $sect unless $include{$sect};
|
||||
$include{$sect} ||= '';
|
||||
$include{$sect} .= $_;
|
||||
$hash = \%append;
|
||||
next;
|
||||
}
|
||||
|
||||
close INC;
|
||||
|
||||
die "$this_program: no valid information found in `$include'\n"
|
||||
unless %include;
|
||||
|
||||
# Compress trailing blank lines.
|
||||
for (keys %include)
|
||||
# Check for options before the first section--anything else is
|
||||
# silently ignored, allowing the first for comments and
|
||||
# revision info.
|
||||
unless ($key)
|
||||
{
|
||||
$include{$_} =~ s/\n+$//;
|
||||
$include{$_} .= "\n" unless /^NAME$/;
|
||||
# handle options
|
||||
if (/^-/)
|
||||
{
|
||||
local @ARGV = split;
|
||||
GetOptions %opt_def;
|
||||
}
|
||||
|
||||
next;
|
||||
}
|
||||
|
||||
$hash->{$key} ||= '';
|
||||
$hash->{$key} .= $_;
|
||||
}
|
||||
else
|
||||
{
|
||||
die "$this_program: can't open `$include' ($!)\n" if $include;
|
||||
}
|
||||
|
||||
close INC;
|
||||
|
||||
die "$this_program: no valid information found in `$inc'\n"
|
||||
unless $key;
|
||||
}
|
||||
|
||||
# Compress trailing blank lines.
|
||||
for my $hash (\(%include, %append))
|
||||
{
|
||||
for (keys %$hash) { $hash->{$_} =~ s/\n+$/\n/ }
|
||||
}
|
||||
|
||||
# Turn off localisation of executable's ouput.
|
||||
@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
|
||||
|
||||
# Turn off localisation of date (for strftime)
|
||||
# Turn off localisation of date (for strftime).
|
||||
setlocale LC_TIME, 'C';
|
||||
|
||||
# Expand tabs, strip trailing spaces and break into paragraphs
|
||||
sub paragraphs { split /\n\n+/, join '', expand @_ }
|
||||
|
||||
# Grab help and version paragraphs from executable
|
||||
my @help = paragraphs `$ARGV[0] --help 2>/dev/null`
|
||||
or die "$this_program: can't get `--help' info from $ARGV[0]\n";
|
||||
|
||||
my @version = paragraphs `$ARGV[0] --version 2>/dev/null`
|
||||
or die "$this_program: can't get `--version' info from $ARGV[0]\n";
|
||||
# Grab help and version info from executable.
|
||||
my ($help_text, $version_text) = map {
|
||||
join '', map { s/ +$//; expand $_ } `$ARGV[0] --$_ 2>/dev/null`
|
||||
or die "$this_program: can't get `--$_' info from $ARGV[0]\n"
|
||||
} qw(help version);
|
||||
|
||||
my $date = strftime "%B %Y", localtime;
|
||||
(my $program = $ARGV[0]) =~ s!.*/!!;
|
||||
@ -165,7 +205,7 @@ if ($opt_output)
|
||||
#
|
||||
# and seperated from any copyright/author details by a blank line.
|
||||
|
||||
$_ = shift @version;
|
||||
($_, $version_text) = split /\n+/, $version_text, 2;
|
||||
|
||||
if (/^(\S+) +\(((?:GNU|Free) +[^)]+)\) +(.*)/ or
|
||||
/^(\S+) +- *((?:GNU|Free) +\S+) +(.*)/)
|
||||
@ -187,163 +227,245 @@ else
|
||||
|
||||
$program =~ s!.*/!!;
|
||||
|
||||
# no info for `info' itself
|
||||
# No info for `info' itself.
|
||||
$opt_no_info = 1 if $program eq 'info';
|
||||
|
||||
# --name overrides --include contents
|
||||
$include{NAME} = "$program \\- $opt_name" if $opt_name;
|
||||
# --name overrides --include contents.
|
||||
$include{NAME} = "$program \\- $opt_name\n" if $opt_name;
|
||||
|
||||
# Default (useless) NAME paragraph
|
||||
$include{NAME} ||= "$program \\- manual page for $program $version";
|
||||
# Default (useless) NAME paragraph.
|
||||
$include{NAME} ||= "$program \\- manual page for $program $version\n";
|
||||
|
||||
# Man pages traditionally have the page title in caps.
|
||||
my $PROGRAM = uc $program;
|
||||
|
||||
# Header.
|
||||
print <<EOT;
|
||||
.\\" DO NOT MODIFY THIS FILE! It was generated by $this_program $this_version.
|
||||
.TH $PROGRAM "$section" "$date" "$package $version" FSF
|
||||
.SH NAME
|
||||
$include{NAME}
|
||||
EOT
|
||||
# Extract usage clause(s) [if any] for SYNOPSIS.
|
||||
if ($help_text =~ s/^Usage:( +(\S+))(.*)((?:\n(?: {6}\1| *or: +\S).*)*)//m)
|
||||
{
|
||||
my @syn = $2 . $3;
|
||||
|
||||
my $break;
|
||||
my $accumulate = 1;
|
||||
my @description = ();
|
||||
if ($_ = $4)
|
||||
{
|
||||
s/^\n//;
|
||||
for (split /\n/) { s/^ *(or: +)?//; push @syn, $_ }
|
||||
}
|
||||
|
||||
my $synopsis = '';
|
||||
for (@syn)
|
||||
{
|
||||
$synopsis .= ".br\n" if $synopsis;
|
||||
s!^\S*/!!;
|
||||
s/^(\S+) *//;
|
||||
$synopsis .= ".B $1\n";
|
||||
s/\s+$//;
|
||||
s/(([][]|\.\.+)+)/\\fR$1\\fI/g;
|
||||
s/^/\\fI/ unless s/^\\fR//;
|
||||
$_ .= '\fR';
|
||||
s/(\\fI)( *)/$2$1/g;
|
||||
s/\\fI\\fR//g;
|
||||
s/^\\fR//;
|
||||
s/\\fI$//;
|
||||
s/^\./\\&./;
|
||||
|
||||
$synopsis .= "$_\n";
|
||||
}
|
||||
|
||||
$include{SYNOPSIS} ||= $synopsis;
|
||||
}
|
||||
|
||||
# Process text, initial section is DESCRIPTION.
|
||||
my $sect = 'DESCRIPTION';
|
||||
$_ = "$help_text\n\n$version_text";
|
||||
|
||||
# Normalise paragraph breaks.
|
||||
s/^\n+//;
|
||||
s/\n*$/\n/;
|
||||
s/\n\n+/\n\n/g;
|
||||
|
||||
# Temporarily exchange leading dots, apostrophes and backslashes for
|
||||
# tokens.
|
||||
s/^\./\x80/mg;
|
||||
s/^'/\x81/mg;
|
||||
s/\\/\x82/g;
|
||||
|
||||
# Start a new paragraph (if required) for these.
|
||||
s/([^\n])\n(Report +bugs|Email +bug +reports +to|Written +by)/$1\n\n$2/g;
|
||||
|
||||
sub convert_option;
|
||||
|
||||
# Output converted --help information.
|
||||
for (@help)
|
||||
while (length)
|
||||
{
|
||||
chomp;
|
||||
|
||||
if (s/^Usage: +\S+ +(.*)\n?//)
|
||||
# Convert some standard paragraph names.
|
||||
if (s/^(Options|Examples): *\n//)
|
||||
{
|
||||
# Turn the usage clause into a synopsis.
|
||||
my $synopsis = '';
|
||||
|
||||
do {
|
||||
my $syn = $1;
|
||||
$syn =~ s/(([][]|\.\.+)+)/\\fR$1\\fI/g;
|
||||
$syn =~ s/^/\\fI/ unless $syn =~ s/^\\fR//;
|
||||
$syn .= '\fR';
|
||||
$syn =~ s/\\fI( *)\\fR/$1/g;
|
||||
|
||||
$synopsis .= ".br\n" unless $accumulate;
|
||||
$synopsis .= ".B $program\n";
|
||||
$synopsis .= "$syn\n";
|
||||
$accumulate = 0;
|
||||
} while s/^(?:Usage| *or): +\S+ +(.*)\n?//;
|
||||
|
||||
# Include file overrides SYNOPSIS.
|
||||
print ".SH SYNOPSIS\n", $include{SYNOPSIS} || $synopsis;
|
||||
|
||||
# Dump any accumulated description text.
|
||||
print ".SH DESCRIPTION\n";
|
||||
print @description;
|
||||
|
||||
# Add additional description text from include file.
|
||||
if ($include{DESCRIPTION})
|
||||
{
|
||||
print ".PP\n" unless $include{DESCRIPTION} =~ /^\..P/;
|
||||
print $include{DESCRIPTION};
|
||||
}
|
||||
|
||||
$break = 1;
|
||||
next unless $_;
|
||||
}
|
||||
|
||||
# Accumulate text if the synopsis has not been produced yet.
|
||||
if ($accumulate)
|
||||
{
|
||||
push @description, ".PP\n" if @description;
|
||||
push @description, "$_\n";
|
||||
$sect = uc $1;
|
||||
next;
|
||||
}
|
||||
|
||||
# Convert some standard paragraph names
|
||||
if (s/^(Options|Examples): *\n//)
|
||||
# Copyright section
|
||||
if (/^Copyright +[(\xa9]/)
|
||||
{
|
||||
print qq(.SH \U$1\n);
|
||||
$break = '';
|
||||
next unless length;
|
||||
$sect = 'COPYRIGHT';
|
||||
$include{$sect} ||= '';
|
||||
$include{$sect} .= ".PP\n" if $include{$sect};
|
||||
|
||||
my $copy;
|
||||
($copy, $_) = split /\n\n/, $_, 2;
|
||||
|
||||
for ($copy)
|
||||
{
|
||||
# Add back newline
|
||||
s/\n*$/\n/;
|
||||
|
||||
# Convert iso9959-1 copyright symbol or (c) to nroff
|
||||
# character.
|
||||
s/^Copyright +(?:\xa9|\([Cc]\))/Copyright \\(co/mg;
|
||||
|
||||
# Insert line breaks before additional copyright messages
|
||||
# and the disclaimer.
|
||||
s/(.)\n(Copyright |This +is +free +software)/$1\n.br\n$2/g;
|
||||
|
||||
# Join hyphenated lines.
|
||||
s/([A-Za-z])-\n */$1/g;
|
||||
}
|
||||
|
||||
$include{$sect} .= $copy;
|
||||
$_ ||= '';
|
||||
next;
|
||||
}
|
||||
|
||||
# Catch bug report text.
|
||||
if (/^Report bugs |^Email bug reports to /)
|
||||
if (/^(Report +bugs|Email +bug +reports +to) /)
|
||||
{
|
||||
print qq(.SH "REPORTING BUGS"\n$_\n);
|
||||
$break = '';
|
||||
$sect = 'REPORTING BUGS';
|
||||
}
|
||||
|
||||
# Author section.
|
||||
elsif (/^Written +by/)
|
||||
{
|
||||
$sect = 'AUTHOR';
|
||||
}
|
||||
|
||||
# Examples, indicated by an indented leading $, % or > are
|
||||
# rendered in a constant width font.
|
||||
if (/^( +)([\$\%>] )\S/)
|
||||
{
|
||||
my $indent = $1;
|
||||
my $prefix = $2;
|
||||
my $break = '.IP';
|
||||
$include{$sect} ||= '';
|
||||
while (s/^$indent\Q$prefix\E(\S.*)\n*//)
|
||||
{
|
||||
$include{$sect} .= "$break\n\\f(CW$prefix$1\\fR\n";
|
||||
$break = '.br';
|
||||
}
|
||||
|
||||
next;
|
||||
}
|
||||
|
||||
# Option subsections have second line indented.
|
||||
if (s/^(\S.*)\n / /)
|
||||
my $matched = '';
|
||||
$include{$sect} ||= '';
|
||||
|
||||
# Sub-sections have a trailing colon and the second line indented.
|
||||
if (s/^(\S.*:) *\n / /)
|
||||
{
|
||||
print qq(.SS "$1"\n);
|
||||
$break = '';
|
||||
$matched .= $& if %append;
|
||||
$include{$sect} .= qq(.SS "$1"\n);
|
||||
}
|
||||
|
||||
my $output = '';
|
||||
while (length)
|
||||
my $indent = 0;
|
||||
my $content = '';
|
||||
|
||||
# Option with description.
|
||||
if (s/^( {1,10}([+-]\S.*?))(?:( +)|\n( {20,}))(\S.*)\n//)
|
||||
{
|
||||
my $indent = 0;
|
||||
|
||||
# Tagged paragraph
|
||||
if (s/^( +(\S.*?) +)(\S.*)\n?//)
|
||||
$matched .= $& if %append;
|
||||
$indent = length ($4 || "$1$3");
|
||||
$content = ".TP\n\x83$2\n\x83$5\n";
|
||||
unless ($4)
|
||||
{
|
||||
$indent = length $1;
|
||||
$output .= ".TP\n$2\n$3\n";
|
||||
$break = 1;
|
||||
# Indent may be different on second line.
|
||||
$indent = length $& if /^ {20,}/;
|
||||
}
|
||||
|
||||
# Indented paragraph
|
||||
elsif (s/^( +)(\S.*)\n?//)
|
||||
{
|
||||
$indent = length $1;
|
||||
$output .= ".IP\n$2\n";
|
||||
$break = 1;
|
||||
}
|
||||
|
||||
# Left justified paragraph
|
||||
else
|
||||
{
|
||||
s/(.*)\n?//;
|
||||
$output .= ".PP\n" if $break;
|
||||
$output .= "$1\n";
|
||||
$break = 1;
|
||||
}
|
||||
|
||||
# Continuations
|
||||
$output .= "$1\n" while s/^ {$indent}(\S.*)\n?//;
|
||||
}
|
||||
|
||||
$_ = $output;
|
||||
# Option without description.
|
||||
elsif (s/^ {1,10}([+-]\S.*)\n//)
|
||||
{
|
||||
$matched .= $& if %append;
|
||||
$content = ".HP\n\x83$1\n";
|
||||
$indent = 80; # not continued
|
||||
}
|
||||
|
||||
# Escape backslashes.
|
||||
s/\\/\\e/g;
|
||||
# Indented paragraph with tag.
|
||||
elsif (s/^( +(\S.*?) +)(\S.*)\n//)
|
||||
{
|
||||
$matched .= $& if %append;
|
||||
$indent = length $1;
|
||||
$content = ".TP\n\x83$2\n\x83$3\n";
|
||||
}
|
||||
|
||||
# Convert options.
|
||||
s/(^| )(-[][\w=-]+)/$1 . convert_option $2/mge;
|
||||
print;
|
||||
}
|
||||
# Indented paragraph.
|
||||
elsif (s/^( +)(\S.*)\n//)
|
||||
{
|
||||
$matched .= $& if %append;
|
||||
$indent = length $1;
|
||||
$content = ".IP\n\x83$2\n";
|
||||
}
|
||||
|
||||
# Print any include items other than the ones we have already dealt
|
||||
# with.
|
||||
for (@include)
|
||||
{
|
||||
print qq(.SH "$_"\n$include{$_})
|
||||
unless /^(NAME|SYNOPSIS|DESCRIPTION|SEE ALSO)$/;
|
||||
# Left justified paragraph.
|
||||
else
|
||||
{
|
||||
s/(.*)\n//;
|
||||
$matched .= $& if %append;
|
||||
$content = ".PP\n" if $include{$sect};
|
||||
$content .= "$1\n";
|
||||
}
|
||||
|
||||
# Append continuations.
|
||||
while (s/^ {$indent}(\S.*)\n//)
|
||||
{
|
||||
$matched .= $& if %append;
|
||||
$content .= "\x83$1\n"
|
||||
}
|
||||
|
||||
# Move to next paragraph.
|
||||
s/^\n+//;
|
||||
|
||||
for ($content)
|
||||
{
|
||||
# Leading dot and apostrophe protection.
|
||||
s/\x83\./\x80/g;
|
||||
s/\x83'/\x81/g;
|
||||
s/\x83//g;
|
||||
|
||||
# Convert options.
|
||||
s/(^| )(-[][\w=-]+)/$1 . convert_option $2/mge;
|
||||
}
|
||||
|
||||
# Check if matched paragraph contains /pat/.
|
||||
if (%append)
|
||||
{
|
||||
for my $pat (keys %append)
|
||||
{
|
||||
if ($matched =~ $pat)
|
||||
{
|
||||
$content .= ".PP\n" unless $append{$pat} =~ /^\./;
|
||||
$content .= $append{$pat};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$include{$sect} .= $content;
|
||||
}
|
||||
|
||||
# Refer to the real documentation.
|
||||
if ($include{'SEE ALSO'} or !$opt_no_info)
|
||||
unless ($opt_no_info)
|
||||
{
|
||||
print qq(.SH "SEE ALSO"\n);
|
||||
print $include{'SEE ALSO'}, ".PP\n" if $include{'SEE ALSO'};
|
||||
|
||||
print <<EOT unless $opt_no_info;
|
||||
$sect = 'SEE ALSO';
|
||||
$include{$sect} ||= '';
|
||||
$include{$sect} .= ".PP\n" if $include{$sect};
|
||||
$include{$sect} .= <<EOT;
|
||||
The full documentation for
|
||||
.B $program
|
||||
is maintained as a Texinfo manual. If the
|
||||
@ -358,27 +480,34 @@ should give you access to the complete manual.
|
||||
EOT
|
||||
}
|
||||
|
||||
# Output converted --version information.
|
||||
for (@version)
|
||||
# Output header.
|
||||
print <<EOT;
|
||||
.\\" DO NOT MODIFY THIS FILE! It was generated by $this_program $this_version.
|
||||
.TH $PROGRAM "$section" "$date" "$package $version" FSF
|
||||
EOT
|
||||
|
||||
# Section ordering.
|
||||
my @pre = qw(NAME SYNOPSIS DESCRIPTION OPTIONS EXAMPLES);
|
||||
my @post = ('AUTHOR', 'REPORTING BUGS', 'COPYRIGHT', 'SEE ALSO');
|
||||
my $filter = join '|', @pre, @post;
|
||||
|
||||
# Output content.
|
||||
for (@pre, (grep ! /^($filter)$/o, @include), @post)
|
||||
{
|
||||
chomp;
|
||||
|
||||
# Join hyphenated lines.
|
||||
s/([A-Za-z])-\n */$1/g;
|
||||
|
||||
# Convert copyright symbol or (c) to nroff character.
|
||||
s/Copyright +(?:\xa9|\([Cc]\))/Copyright \\(co/g;
|
||||
|
||||
# Insert appropriate headings for copyright and author.
|
||||
if (/^Copyright \\/) { print ".SH COPYRIGHT\n" }
|
||||
elsif (/^Written +by/) { print ".SH AUTHOR\n" }
|
||||
else { print ".PP\n"; }
|
||||
|
||||
# Insert line breaks before additional copyright messages and the
|
||||
# disclaimer.
|
||||
s/(.)\n(Copyright |This is free software)/$1\n.br\n$2/g;
|
||||
|
||||
print "$_\n";
|
||||
if ($include{$_})
|
||||
{
|
||||
my $quote = /\W/ ? '"' : '';
|
||||
print ".SH $quote$_$quote\n";
|
||||
|
||||
for ($include{$_})
|
||||
{
|
||||
# Replace leading dot, apostrophe and backslash tokens.
|
||||
s/\x80/\\&./g;
|
||||
s/\x81/\\&'/g;
|
||||
s/\x82/\\e/g;
|
||||
print;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exit;
|
||||
@ -387,15 +516,15 @@ exit;
|
||||
# embolden. Option arguments get italicised.
|
||||
sub convert_option
|
||||
{
|
||||
my $option = '\fB' . shift;
|
||||
local $_ = '\fB' . shift;
|
||||
|
||||
$option =~ s/-/\\-/g;
|
||||
unless ($option =~ s/\[=(.*)\]$/\\fR[=\\fI$1\\fR]/)
|
||||
s/-/\\-/g;
|
||||
unless (s/\[=(.*)\]$/\\fR[=\\fI$1\\fR]/)
|
||||
{
|
||||
$option =~ s/=(.)/\\fR=\\fI$1/;
|
||||
$option =~ s/ (.)/ \\fI$1/;
|
||||
$option .= '\fR';
|
||||
s/=(.)/\\fR=\\fI$1/;
|
||||
s/ (.)/ \\fI$1/;
|
||||
$_ .= '\fR';
|
||||
}
|
||||
|
||||
$option;
|
||||
$_;
|
||||
}
|
||||
|
@ -6,13 +6,14 @@
|
||||
@synindex fn cp
|
||||
@synindex ky cp
|
||||
@comment %**end of header
|
||||
@comment $Id: info-stnd.texi,v 1.23 1999/06/25 21:57:04 karl Exp $
|
||||
@comment $Id: info-stnd.texi,v 1.33 2002/03/02 15:03:54 karl Exp $
|
||||
|
||||
@include version.texi
|
||||
@include version-stnd.texi
|
||||
|
||||
@dircategory Texinfo documentation system
|
||||
@direntry
|
||||
* Standalone info program: (info-stnd). Standalone Info-reading program.
|
||||
* info standalone: (info-stnd). Read Info documents without Emacs.
|
||||
* infokey: (info-stnd)Invoking infokey. Compile Info customizations.
|
||||
@end direntry
|
||||
|
||||
@ifinfo
|
||||
@ -22,7 +23,8 @@ documentation for the Info reader that is part of GNU Emacs. If you do
|
||||
not know how to use Info, but have a working Info reader, you should
|
||||
read that documentation first.
|
||||
|
||||
Copyright @copyright{} 1992, 93, 96, 97, 98, 99 Free Software Foundation, Inc.
|
||||
Copyright @copyright{} 1992, 93, 96, 97, 98, 99,
|
||||
2001, 02 Free Software Foundation, Inc.
|
||||
|
||||
Permission is granted to make and distribute verbatim copies of this
|
||||
manual provided the copyright notice and this permission notice are
|
||||
@ -54,7 +56,7 @@ approved by the Free Software Foundation.
|
||||
@author Brian J. Fox (bfox@@gnu.org)
|
||||
@page
|
||||
@vskip 0pt plus 1filll
|
||||
Copyright @copyright{} 1992, 93, 97, 98, 99 Free Software Foundation
|
||||
Copyright @copyright{} 1992, 93, 97, 98, 99, 2001, 02 Free Software Foundation
|
||||
|
||||
This manual is for GNU Info version @value{VERSION}, @value{UPDATED}.
|
||||
|
||||
@ -75,6 +77,8 @@ except that this permission notice may be stated in a translation
|
||||
approved by the Free Software Foundation.
|
||||
@end titlepage
|
||||
|
||||
@contents
|
||||
|
||||
@ifnottex
|
||||
@node Top
|
||||
@top GNU Info
|
||||
@ -91,8 +95,7 @@ This manual is for Info version @value{VERSION}, updated @value{UPDATED}.
|
||||
* What is Info:: What is Info?
|
||||
* Invoking Info:: Options you can pass on the command line.
|
||||
* Cursor Commands:: Commands which move the cursor within a node.
|
||||
* Scrolling Commands:: Commands for moving the node around
|
||||
in a window.
|
||||
* Scrolling Commands:: Commands for reading the text within a node.
|
||||
* Node Commands:: Commands for selecting a new node.
|
||||
* Searching Commands:: Commands for searching an Info file.
|
||||
* Xref Commands:: Commands for selecting cross references.
|
||||
@ -100,7 +103,9 @@ This manual is for Info version @value{VERSION}, updated @value{UPDATED}.
|
||||
* Printing Nodes:: How to print out the contents of a node.
|
||||
* Miscellaneous Commands:: A few commands that defy categories.
|
||||
* Variables:: How to change the default behavior of Info.
|
||||
* GNU Info Global Index:: Global index containing keystrokes,
|
||||
* Custom Key Bindings:: How to define your own key-to-command
|
||||
bindings.
|
||||
* Index:: Global index containing keystrokes,
|
||||
command names, variable names,
|
||||
and general concepts.
|
||||
@end menu
|
||||
@ -120,7 +125,9 @@ that you read in Info.
|
||||
|
||||
@node Invoking Info
|
||||
@chapter Invoking Info
|
||||
@cindex invoking info
|
||||
|
||||
@cindex Info, invoking
|
||||
@cindex invoking Info
|
||||
@cindex command line options
|
||||
@cindex options, command line
|
||||
@cindex arguments, command line
|
||||
@ -136,6 +143,7 @@ info [@var{option}]@dots{} [@var{menu-item}@dots{}]
|
||||
The program accepts the following options:
|
||||
|
||||
@table @code
|
||||
@anchor{--apropos}
|
||||
@item --apropos=@var{string}
|
||||
@cindex Searching all indices
|
||||
@cindex Info files@r{, searching all indices}
|
||||
@ -147,6 +155,9 @@ you are not sure which Info file explains certain issues, this option is
|
||||
your friend. Note that if your system has a lot of Info files
|
||||
installed, searching all of them might take some time.
|
||||
|
||||
You can invoke the apropos command from inside Info; see
|
||||
@ref{Searching Commands}.
|
||||
|
||||
@cindex directory path
|
||||
@item --directory @var{directory-path}
|
||||
@itemx -d @var{directory-path}
|
||||
@ -229,6 +240,9 @@ another program as a way to provide online help, or as a quick way of
|
||||
starting to read an Info file at a certain node when you don't know the
|
||||
exact name of that node.
|
||||
|
||||
This command can also be invoked from inside Info; see @ref{Searching
|
||||
Commands}.
|
||||
|
||||
@item --node @var{nodename}
|
||||
@itemx -n @var{nodename}
|
||||
@cindex node, selecting from the command line
|
||||
@ -251,6 +265,18 @@ Each node that Info visits will be output to @var{filename} instead of
|
||||
interactively viewed. A value of @code{-} for @var{filename} specifies
|
||||
the standard output.
|
||||
|
||||
@cindex colors in man pages
|
||||
@cindex ANSI escape sequences in man pages
|
||||
@item --raw-escapes
|
||||
@itemx -R
|
||||
Do not remove ANSI escape sequences from man pages. Some versions of
|
||||
Groff, the GNU document formatter, produce man pages with ANSI escape
|
||||
sequences for bold, italics, and underlined characters, and for
|
||||
colorized text. By default, Info removes those escape sequences
|
||||
before it displays the man page. If your terminal supports these
|
||||
escapes, use @code{--raw-escapes} to let the terminal handle them and
|
||||
display the man pages with those attributes.
|
||||
|
||||
@cindex replaying recorded keystrokes
|
||||
@item --restore=@var{dribble-file}
|
||||
Read keystrokes from @var{dribble-file}, presumably recorded during
|
||||
@ -300,6 +326,8 @@ Prints the version information of Info and exits.
|
||||
This option binds functions to keys differently, to emulate the key
|
||||
bindings of @code{vi} and Less. The default key bindings are generally
|
||||
modeled after Emacs.
|
||||
(@xref{Custom Key Bindings},
|
||||
for a more general way of altering GNU Info's key bindings.)
|
||||
|
||||
@item @var{menu-item}
|
||||
@cindex menu, following
|
||||
@ -455,7 +483,8 @@ center of the window. With a numeric argument of @var{n}, @code{M-r}
|
||||
moves the cursor to the start of the @var{n}th line in the window.
|
||||
@end table
|
||||
|
||||
@node Scrolling Commands, Node Commands, Cursor Commands, Top
|
||||
|
||||
@node Scrolling Commands
|
||||
@chapter Moving Text Within a Window
|
||||
@cindex scrolling
|
||||
|
||||
@ -470,17 +499,7 @@ with ``vi-like operation''.
|
||||
|
||||
@table @asis
|
||||
@item @key{SPC} (@code{scroll-forward})
|
||||
@itemx @key{NEXT} (an arrow key)
|
||||
@itemx @key{C-v}
|
||||
@itemx @key{C-f}, vi-like operation
|
||||
@itemx @key{f}, vi-like operation
|
||||
@itemx @key{M-SPC}, vi-like operation
|
||||
@kindex SPC, in Info windows
|
||||
@kindex NEXT
|
||||
@kindex C-v
|
||||
@kindex C-f, vi-like operation
|
||||
@kindex f, vi-like operation
|
||||
@kindex M-SPC, vi-like operation
|
||||
@findex scroll-forward
|
||||
Shift the text in this window up. That is, show more of the node which
|
||||
is currently below the bottom of the window. With a numeric argument,
|
||||
@ -490,46 +509,71 @@ argument of 4 would shift all of the text in the window up 4 lines
|
||||
of the window. Without a numeric argument, @key{SPC} takes the bottom
|
||||
two lines of the window and places them at the top of the window,
|
||||
redisplaying almost a completely new screenful of lines. If you are at
|
||||
the end of a node, SPC takes you to the ``next'' node, so that you can
|
||||
read an entire manual from start to finish by repeating SPC.
|
||||
the end of a node, @key{SPC} takes you to the ``next'' node, so that you can
|
||||
read an entire manual from start to finish by repeating @key{SPC}.
|
||||
|
||||
The default scroll size is one screen-full, but it can be changed by
|
||||
invoking the (@code{scroll-forward-set-window}) command, @samp{z} under
|
||||
@samp{--vi-keys}, with a numeric argument.
|
||||
invoking the (@code{scroll-forward-page-only-set-window}) command,
|
||||
@samp{z} under @samp{--vi-keys}, with a numeric argument.
|
||||
|
||||
@item @key{NEXT} (an arrow key) (@code{scroll-forward-page-only})
|
||||
@itemx @key{C-v}
|
||||
@itemx @key{C-f}, vi-like operation
|
||||
@itemx @key{f}, vi-like operation
|
||||
@itemx @key{M-SPC}, vi-like operation
|
||||
@kindex NEXT
|
||||
@kindex C-v
|
||||
@kindex C-f, vi-like operation
|
||||
@kindex f, vi-like operation
|
||||
@kindex M-SPC, vi-like operation
|
||||
@findex scroll-forward-page-only
|
||||
Shift the text in this window up. This is identical to the @key{SPC}
|
||||
operation above, except that it never scrolls beyond the end of the
|
||||
current node.
|
||||
|
||||
@kindex PageDown
|
||||
The @key{NEXT} key is known as the @key{PageDown} key on some
|
||||
keyboards. When you use @key{NEXT} or @key{PageDown} to scroll, Info
|
||||
never scrolls beyond the end of the current node.
|
||||
keyboards.
|
||||
|
||||
@item @key{z} (@code{scroll-forward-set-window}, vi-like operation)
|
||||
@item @key{z} (@code{scroll-forward-page-only-set-window}, vi-like operation)
|
||||
@kindex z, vi-like operation
|
||||
@findex scroll-forward-set-window
|
||||
Scroll forward, like with @key{SPC}, but if a numeric argument is
|
||||
@findex scroll-forward-page-only-set-window
|
||||
Scroll forward, like with @key{NEXT}, but if a numeric argument is
|
||||
specified, it becomes the default scroll size for subsequent
|
||||
@code{scroll-forward} and @code{scroll-backward} commands.
|
||||
@code{scroll-forward} and @code{scroll-backward} commands and their
|
||||
ilk.
|
||||
|
||||
@item @key{DEL} (@code{scroll-backward})
|
||||
@itemx @key{PREVIOUS} (arrow key)
|
||||
@kindex DEL, in Info windows
|
||||
@findex scroll-backward
|
||||
Shift the text in this window down. The inverse of
|
||||
@code{scroll-forward}.
|
||||
If you are at the start of a node, @key{DEL} takes you to the
|
||||
``previous'' node, so that you can read an entire manual from finish to
|
||||
start by repeating @key{DEL}. The default scroll size can be changed by
|
||||
invoking the (@code{scroll-backward-page-only-set-window}) command,
|
||||
@samp{w} under @samp{--vi-keys}, with a numeric argument.
|
||||
|
||||
@itemx @key{PREVIOUS} (arrow key) (@code{scroll-backward-page-only})
|
||||
@itemx @key{PRIOR} (arrow key)
|
||||
@itemx @key{M-v}
|
||||
@itemx @key{b}, vi-like operation
|
||||
@itemx @key{C-b}, vi-like operation
|
||||
@kindex DEL, in Info windows
|
||||
@kindex PREVIOUS
|
||||
@kindex M-v
|
||||
@kindex b, vi-like operation
|
||||
@kindex C-b, vi-like operation
|
||||
@findex scroll-backward
|
||||
@findex scroll-backward-page-only
|
||||
Shift the text in this window down. The inverse of
|
||||
@code{scroll-forward}. The default scroll size can be changed by
|
||||
invoking the(@code{scroll-backward-set-window}) command, @samp{w} under
|
||||
@code{scroll-forward-page-only}. Does not scroll beyond the start of
|
||||
the current node. The default scroll size can be changed by invoking
|
||||
the(@code{scroll-backward-page-only-set-window}) command, @samp{w} under
|
||||
@samp{--vi-keys}, with a numeric argument.
|
||||
|
||||
@item @key{w} (@code{scroll-backward-set-window}, vi-like operation)
|
||||
@item @key{w} (@code{scroll-backward-page-only-set-window}, vi-like operation)
|
||||
@kindex w, vi-like operation
|
||||
@findex scroll-backward-set-window
|
||||
Scroll backward, like with @key{DEL}, but if a numeric argument is
|
||||
@findex scroll-backward-page-only-set-window
|
||||
Scroll backward, like with @key{PREVIOUS}, but if a numeric argument is
|
||||
specified, it becomes the default scroll size for subsequent
|
||||
@code{scroll-forward} and @code{scroll-backward} commands.
|
||||
|
||||
@ -592,6 +636,9 @@ viewing the beginning of a node, what happens is controlled by the
|
||||
variable @code{scroll-behavior}. @xref{Variables,
|
||||
@code{scroll-behavior}}, for more information.
|
||||
|
||||
The @code{scroll-forward-page-only} and @code{scroll-backward-page-only}
|
||||
commands never scroll beyond the current node.
|
||||
|
||||
@kindex PageUp
|
||||
The @key{PREVIOUS} key is the @key{PageUp} key on many keyboards. Emacs
|
||||
refers to it by the name @key{PRIOR}. When you use @key{PRIOR} or
|
||||
@ -628,8 +675,9 @@ invisible. When long lines are truncated, the modeline displays the
|
||||
@samp{$} character near its left edge.
|
||||
@end table
|
||||
|
||||
@node Node Commands, Searching Commands, Scrolling Commands, Top
|
||||
@chapter Selecting a New Node
|
||||
|
||||
@node Node Commands
|
||||
@chapter Selecting a Node
|
||||
@cindex nodes, selection of
|
||||
|
||||
This section details the numerous Info commands which select a new node
|
||||
@ -879,7 +927,8 @@ This is similar to @samp{C-x C-b} followed by @samp{m}, but no window is
|
||||
created.
|
||||
@end table
|
||||
|
||||
@node Searching Commands, Xref Commands, Node Commands, Top
|
||||
|
||||
@node Searching Commands
|
||||
@chapter Searching an Info File
|
||||
@cindex searching
|
||||
|
||||
@ -965,6 +1014,11 @@ where the found index entry points to.
|
||||
@findex next-index-match
|
||||
Move to the node containing the next matching index item from the last
|
||||
@samp{i} command.
|
||||
|
||||
@item @kbd{M-x index-apropos}
|
||||
@findex index-apropos
|
||||
Grovel the indices of all the known Info files on your system for a
|
||||
string, and build a menu of the possible matches.
|
||||
@end table
|
||||
|
||||
The most basic searching command is @samp{s} or @samp{/}
|
||||
@ -993,7 +1047,23 @@ even for a string that includes only lower-case letters, by using the
|
||||
@samp{N} commands operate case-sensitively if the last search command
|
||||
was @samp{S}.
|
||||
|
||||
@node Xref Commands, Window Commands, Searching Commands, Top
|
||||
The most efficient means of finding something quickly in a manual is
|
||||
the @samp{i} command (@code{index-search}). This command prompts for
|
||||
a string, and then looks for that string in all the indices of the
|
||||
current Info manual. If it finds a matching index entry, it displays
|
||||
the node to which that entry refers and prints the full text of the
|
||||
entry in the echo area. You can press @samp{,}
|
||||
(@code{next-index-match}) to find more matches. A good Info manual
|
||||
has all of its important concepts indexed, so the @samp{i} command
|
||||
lets you use a manual as a reference.
|
||||
|
||||
If you don't know what manual documents something, try the @kbd{M-x
|
||||
index-apropos}. It prompts for a string and then looks up that string
|
||||
in all the indices of all the Info documents installed on your system.
|
||||
It can also be invoked from the command line; see @ref{--apropos}.
|
||||
|
||||
|
||||
@node Xref Commands
|
||||
@chapter Selecting Cross References
|
||||
|
||||
We have already discussed the @samp{Next}, @samp{Prev}, and @samp{Up}
|
||||
@ -1144,7 +1214,8 @@ On DOS/Windows only, the @kbd{Shift-@key{TAB}} key is an alias for
|
||||
Select the menu item or note reference appearing on this line.
|
||||
@end table
|
||||
|
||||
@node Window Commands, Printing Nodes, Xref Commands, Top
|
||||
|
||||
@node Window Commands
|
||||
@chapter Manipulating Multiple Windows
|
||||
@cindex windows, manipulating
|
||||
|
||||
@ -1530,8 +1601,9 @@ Scroll the completions window, if that is visible, or the "other"
|
||||
window if not.
|
||||
@end table
|
||||
|
||||
@node Printing Nodes, Miscellaneous Commands, Window Commands, Top
|
||||
@chapter Printing Out Nodes
|
||||
|
||||
@node Printing Nodes
|
||||
@chapter Printing Nodes
|
||||
@cindex printing
|
||||
|
||||
In general, we recommend that you use @TeX{} to format the document and
|
||||
@ -1559,7 +1631,8 @@ under the assumption that text written to that file will be printed by
|
||||
the underlying OS.
|
||||
@end table
|
||||
|
||||
@node Miscellaneous Commands, Variables, Printing Nodes, Top
|
||||
|
||||
@node Miscellaneous Commands
|
||||
@chapter Miscellaneous Commands
|
||||
|
||||
GNU Info contains several commands which self-document GNU Info:
|
||||
@ -1729,7 +1802,8 @@ associated with a node when the node is selected by setting the variable
|
||||
@code{automatic-footnotes}. @xref{Variables, , @code{automatic-footnotes}}.
|
||||
@end table
|
||||
|
||||
@node Variables, GNU Info Global Index, Miscellaneous Commands, Top
|
||||
|
||||
@node Variables
|
||||
@chapter Manipulating Variables
|
||||
|
||||
GNU Info contains several @dfn{variables} whose values are looked at by
|
||||
@ -1737,6 +1811,10 @@ various Info commands. You can change the values of these variables,
|
||||
and thus change the behavior of Info to more closely match your
|
||||
environment and Info file reading manner.
|
||||
|
||||
There are two ways to set the value of a variable: interactively, using
|
||||
the @code{set-variable} command described below, or in the @code{#var}
|
||||
section of the @code{.infokey} file. @xref{Custom Key Bindings}.
|
||||
|
||||
@table @asis
|
||||
@item @kbd{M-x set-variable}
|
||||
@cindex variables, setting
|
||||
@ -1781,15 +1859,6 @@ window. There are exceptions to the automatic tiling; specifically, the
|
||||
windows @samp{*Completions*} and @samp{*Footnotes*} are @emph{not}
|
||||
resized through automatic tiling; they remain their original size.
|
||||
|
||||
@item visible-bell
|
||||
@vindex visible-bell
|
||||
When set to @code{On}, GNU Info attempts to flash the screen instead of
|
||||
ringing the bell. This variable is @code{Off} by default. Of course,
|
||||
Info can only flash the screen if the terminal allows it; in the case
|
||||
that the terminal does not allow it, the setting of this variable has no
|
||||
effect. However, you can make Info perform quietly by setting the
|
||||
@code{errors-ring-bell} variable to @code{Off}.
|
||||
|
||||
@item errors-ring-bell
|
||||
@vindex errors-ring-bell
|
||||
When set to @code{On}, errors cause the bell to ring. The default
|
||||
@ -1810,15 +1879,14 @@ consuming operation, and so Info tries hard not to do it twice.
|
||||
@code{gc-compressed-files} tells Info it is okay to garbage collect the
|
||||
text of the nodes of a file which was compressed on disk.
|
||||
|
||||
@item show-index-match
|
||||
@vindex show-index-match
|
||||
When set to @code{On}, the portion of the matched search string is
|
||||
highlighted in the message which explains where the matched search
|
||||
string was found. The default value of this variable is @code{On}.
|
||||
When Info displays the location where an index match was found,
|
||||
(@pxref{Searching Commands, , @code{next-index-match}}), the portion of the
|
||||
string that you had typed is highlighted by displaying it in the inverse
|
||||
case from its surrounding characters.
|
||||
@item ISO-Latin
|
||||
@cindex ISO Latin characters
|
||||
@vindex ISO-Latin
|
||||
When set to @code{On}, Info accepts and displays ISO Latin characters.
|
||||
By default, Info assumes an ASCII character set. @code{ISO-Latin} tells
|
||||
Info that it is running in an environment where the European standard
|
||||
character set is in use, and allows you to input such characters to
|
||||
Info, as well as display them.
|
||||
|
||||
@item scroll-behavior
|
||||
@vindex scroll-behavior
|
||||
@ -1858,17 +1926,235 @@ cursor (and the text it is attached to) in the center of the window.
|
||||
Setting this variable to 1 causes a kind of "smooth scrolling" which
|
||||
some people prefer.
|
||||
|
||||
@item ISO-Latin
|
||||
@cindex ISO Latin characters
|
||||
@vindex ISO-Latin
|
||||
When set to @code{On}, Info accepts and displays ISO Latin characters.
|
||||
By default, Info assumes an ASCII character set. @code{ISO-Latin} tells
|
||||
Info that it is running in an environment where the European standard
|
||||
character set is in use, and allows you to input such characters to
|
||||
Info, as well as display them.
|
||||
@item show-index-match
|
||||
@vindex show-index-match
|
||||
When set to @code{On}, the portion of the matched search string is
|
||||
highlighted in the message which explains where the matched search
|
||||
string was found. The default value of this variable is @code{On}.
|
||||
When Info displays the location where an index match was found,
|
||||
(@pxref{Searching Commands, , @code{next-index-match}}), the portion of the
|
||||
string that you had typed is highlighted by displaying it in the inverse
|
||||
case from its surrounding characters.
|
||||
|
||||
@item visible-bell
|
||||
@vindex visible-bell
|
||||
When set to @code{On}, GNU Info attempts to flash the screen instead of
|
||||
ringing the bell. This variable is @code{Off} by default. Of course,
|
||||
Info can only flash the screen if the terminal allows it; in the case
|
||||
that the terminal does not allow it, the setting of this variable has no
|
||||
effect. However, you can make Info perform quietly by setting the
|
||||
@code{errors-ring-bell} variable to @code{Off}.
|
||||
|
||||
@end table
|
||||
|
||||
|
||||
@node Custom Key Bindings
|
||||
@chapter Customizing Key Bindings and Variables
|
||||
|
||||
@cindex default key bindings, overriding
|
||||
@cindex overriding default key bindings
|
||||
@cindex customizing key bindings
|
||||
@cindex key bindings, customizing
|
||||
@cindex infokey
|
||||
@cindex .info
|
||||
@cindex .infokey
|
||||
@cindex _info file (MS-DOS)
|
||||
|
||||
For those whose editor/pager of choice is not Emacs and who are not
|
||||
entirely satisfied with the --vi-keys option (@pxref{--vi-keys}), GNU
|
||||
Info provides a way to define different key-to-command bindings and
|
||||
variable settings from the defaults described in this document.
|
||||
|
||||
On startup, GNU Info looks for a configuration file in the invoker's
|
||||
HOME directory called @file{.info}@footnote{Due to the limitations of
|
||||
DOS filesystems, the MS-DOS version of Info looks for a file
|
||||
@file{_info} instead. If the @env{HOME} variable is not defined, Info
|
||||
additionally looks in the current directory.}. If it is present, and
|
||||
appears to contain Info configuration data, and was created with the
|
||||
current version of the @code{infokey} command, then Info adopts the
|
||||
key bindings and variable settings contained therein.
|
||||
|
||||
The @file{.info} file contains compact, non-textual data for reasons of
|
||||
efficiency and because its design was lifted wholesale from the GNU Less
|
||||
program, which also does it that way. It must be created by compiling a
|
||||
textual source file using the @code{infokey} command.
|
||||
|
||||
@menu
|
||||
* Invoking infokey::
|
||||
* infokey source format::
|
||||
@end menu
|
||||
|
||||
|
||||
@node Invoking infokey
|
||||
@section Invoking @command{infokey}
|
||||
|
||||
@cindex invoking infokey
|
||||
@cindex infokey, invoking
|
||||
@cindex _infokey file (MS-DOS)
|
||||
|
||||
@command{infokey} compiles a source file
|
||||
(@file{$HOME/.infokey}@footnote{This file is named @file{_infokey} in
|
||||
the MS-DOS version, and is looked for in the current directory if
|
||||
@env{HOME} is undefined.} by default) containing Info customizations
|
||||
into a binary format (@file{$HOME/.info} by default). GNU Info reads
|
||||
the binary file at startup to override the default key bindings and
|
||||
variable definitions. Synopsis:
|
||||
|
||||
@example
|
||||
infokey [@var{option}@dots{}] [@var{input-file}]
|
||||
@end example
|
||||
|
||||
Besides the standard @option{--help} and @option{--version}, the only
|
||||
option is @option{--output @var{file}}. This tells @command{infokey} to
|
||||
write the binary data to @var{file} instead of @file{$HOME/.info}.
|
||||
|
||||
|
||||
@node infokey source format
|
||||
@section @command{infokey} source format
|
||||
|
||||
@cindex infokey source format
|
||||
@cindex .infokey source format
|
||||
@cindex format of .infokey source
|
||||
|
||||
The format of the source file read by @command{infokey} is most easily
|
||||
illustrated by example. For instance, here is a sample @file{.infokey}
|
||||
source file suitable for aficionados of @command{vi} or @command{less}:
|
||||
|
||||
@example
|
||||
#info
|
||||
j next-line
|
||||
k prev-line
|
||||
l forward-char
|
||||
h backward-char
|
||||
\kd next-line
|
||||
\ku prev-line
|
||||
\kr forward-char
|
||||
\kl backward-char
|
||||
\ scroll-forward
|
||||
\kD scroll-forward-page-only
|
||||
b scroll-backward
|
||||
\kU scroll-backward-page-only
|
||||
g beginning-of-node
|
||||
\kh beginning-of-node
|
||||
G end-of-node
|
||||
\ke end-of-node
|
||||
\t select-reference-this-line
|
||||
- history-node
|
||||
n next-node
|
||||
p prev-node
|
||||
u up-node
|
||||
t top-node
|
||||
d dir-node
|
||||
#var
|
||||
scroll-step=1
|
||||
@end example
|
||||
|
||||
The source file consists of one or more @dfn{sections}.
|
||||
Each section starts with a line that identifies the type of section.
|
||||
Possible sections are:
|
||||
|
||||
@table @code
|
||||
@item #info
|
||||
Key bindings for Info windows.
|
||||
The start of this section is indicated by a line containing just
|
||||
@code{#info} by itself. If this is the first section in the source
|
||||
file, the @code{#info} line can be omitted. The rest of this section
|
||||
consists of lines of the form:
|
||||
|
||||
@example
|
||||
@var{string} whitespace @var{action} [ whitespace [ # comment ] ] newline
|
||||
@end example
|
||||
|
||||
Whitespace is any sequence of one or more spaces and/or tabs. Comment
|
||||
is any sequence of any characters, excluding newline. @var{string} is
|
||||
the key sequence which invokes the action. @var{action} is the name of
|
||||
an Info command. The characters in @var{string} are interpreted
|
||||
literally or prefixed by a caret (@code{^}) to indicate a control
|
||||
character. A backslash followed by certain characters specifies input
|
||||
keystrokes as follows:
|
||||
|
||||
@table @code
|
||||
@item \b
|
||||
Backspace
|
||||
@item \e
|
||||
Escape (ESC)
|
||||
@item \n
|
||||
Newline
|
||||
@item \r
|
||||
Return
|
||||
@item \t
|
||||
Tab
|
||||
@item \ku
|
||||
Up arrow
|
||||
@item \kd
|
||||
Down arrow
|
||||
@item \kl
|
||||
Left arrow
|
||||
@item \kr
|
||||
Right arrow
|
||||
@item \kU
|
||||
Page Up
|
||||
@item \kD
|
||||
Page Down
|
||||
@item \kh
|
||||
HOME
|
||||
@item \ke
|
||||
END
|
||||
@item \kx
|
||||
Delete (DEL)
|
||||
@item \m@var{x}
|
||||
Meta-@var{x} where @var{x} is any character as described above.
|
||||
@end table
|
||||
|
||||
Backslash followed by any other character indicates that character is to
|
||||
be taken literally. Characters which must be preceded by a backslash
|
||||
include caret, space, tab, and backslash itself.
|
||||
|
||||
@item #echo-area
|
||||
Key bindings for the echo area.
|
||||
The start of this section is indicated by a line containing just
|
||||
@code{#echo-area} by itself. The rest of this section has a syntax
|
||||
identical to that for the key definitions for the Info area, described
|
||||
above.
|
||||
|
||||
@item #var
|
||||
Variable initializations.
|
||||
The start of this section is indicated by a line containing just
|
||||
@code{#var} by itself. Following this line is a list of variable
|
||||
assignments, one per line. Each line consists of a variable name
|
||||
(@xref{Variables},) followed by @code{=} followed by a value.
|
||||
There may be no white space between the variable name and the @code{=},
|
||||
and all characters following the @code{=}, including white space,
|
||||
are included in the value.
|
||||
@end table
|
||||
|
||||
Blank lines and lines starting with @code{#} are ignored, except for
|
||||
the special section header lines.
|
||||
|
||||
Key bindings defined in the @file{.info} file take precedence over GNU
|
||||
Info's default key bindings, whether or not @samp{--vi-keys} is used. A
|
||||
default key binding may be disabled by overriding it in the @file{.info}
|
||||
file with the action @code{invalid}. In addition, @emph{all} default
|
||||
key bindings can be disabled by adding this line @emph{anywhere} in the
|
||||
relevant section:
|
||||
|
||||
@example
|
||||
#stop
|
||||
@end example
|
||||
|
||||
This will cause GNU Info to ignore all the default key commands for that
|
||||
section.
|
||||
|
||||
Beware: @code{#stop} can be dangerous. Since it disables all default
|
||||
key bindings, you must supply enough new key bindings to enable all
|
||||
necessary actions. Failure to bind any key to the @code{quit} command,
|
||||
for example, can lead to frustration.
|
||||
|
||||
The order in which key bindings are defined in the @file{.info} file is
|
||||
not important, except that the command summary produced by the
|
||||
@code{get-help-window} command only displays the @emph{first} key that
|
||||
is bound to each command.
|
||||
|
||||
|
||||
@c the following is incomplete
|
||||
@ignore
|
||||
@ -1916,10 +2202,10 @@ Building DIR on the fly.
|
||||
Some common ways to organize Info files.
|
||||
@end ignore
|
||||
|
||||
@node GNU Info Global Index, , Variables, Top
|
||||
@appendix Global Index
|
||||
|
||||
@node Index
|
||||
@appendix Index
|
||||
|
||||
@printindex cp
|
||||
|
||||
@contents
|
||||
@bye
|
||||
|
@ -1,12 +1,11 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.013.
|
||||
.TH INFO "1" "September 1999" "GNU texinfo 4.0" FSF
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.24.
|
||||
.TH INFO "1" "March 2002" "GNU texinfo 4.1" FSF
|
||||
.SH NAME
|
||||
info \- read Info documents
|
||||
.SH SYNOPSIS
|
||||
.B info
|
||||
[\fIOPTION\fR]... [\fIMENU-ITEM\fR...]
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Read documentation in Info format.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
@ -34,6 +33,9 @@ specify nodes in first visited Info file.
|
||||
\fB\-\-output\fR=\fIFILENAME\fR
|
||||
output selected nodes to FILENAME.
|
||||
.TP
|
||||
\fB\-\-raw\-escapes\fR
|
||||
don't remove ANSI escapes from man pages.
|
||||
.TP
|
||||
\fB\-\-restore\fR=\fIFILENAME\fR
|
||||
read initial keystrokes from FILENAME.
|
||||
.TP
|
||||
@ -74,7 +76,7 @@ show file ./foo.info, not searching dir
|
||||
Email bug reports to bug-texinfo@gnu.org,
|
||||
general questions and discussion to help-texinfo@gnu.org.
|
||||
.SH COPYRIGHT
|
||||
Copyright \(co 1999 Free Software Foundation, Inc.
|
||||
Copyright \(co 2002 Free Software Foundation, Inc.
|
||||
There is NO warranty. You may redistribute this software
|
||||
under the terms of the GNU General Public License.
|
||||
For more information about these matters, see the files named COPYING.
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,29 +1,25 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.013.
|
||||
.TH INSTALL-INFO "1" "September 1999" "GNU texinfo 4.0" FSF
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.24.
|
||||
.TH INSTALL-INFO "1" "March 2002" "GNU texinfo 4.1" FSF
|
||||
.SH NAME
|
||||
install-info \- update info/dir entries
|
||||
.SH SYNOPSIS
|
||||
.B install-info
|
||||
[\fIOPTION\fR]... [\fIINFO-FILE \fR[\fIDIR-FILE\fR]]
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Install or delete dir entries from INFO-FILE in the Info directory file
|
||||
DIR-FILE.
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
\fB\-\-delete\fR
|
||||
delete existing entries for INFO-FILE from DIR-FILE;
|
||||
.IP
|
||||
don't insert any new entries.
|
||||
.TP
|
||||
\fB\-\-dir\-file\fR=\fINAME\fR
|
||||
specify file name of Info directory file.
|
||||
.IP
|
||||
This is equivalent to using the DIR-FILE argument.
|
||||
.TP
|
||||
\fB\-\-entry\fR=\fITEXT\fR
|
||||
insert TEXT as an Info directory entry.
|
||||
.IP
|
||||
TEXT should have the form of an Info menu item line
|
||||
plus zero or more extra lines starting with whitespace.
|
||||
If you specify more than one entry, they are all added.
|
||||
@ -35,7 +31,6 @@ display this help and exit.
|
||||
.TP
|
||||
\fB\-\-info\-file\fR=\fIFILE\fR
|
||||
specify Info file to install in the directory.
|
||||
.IP
|
||||
This is equivalent to using the INFO-FILE argument.
|
||||
.TP
|
||||
\fB\-\-info\-dir\fR=\fIDIR\fR
|
||||
@ -43,7 +38,6 @@ same as \fB\-\-dir\-file\fR=\fIDIR\fR/dir.
|
||||
.TP
|
||||
\fB\-\-item\fR=\fITEXT\fR
|
||||
same as \fB\-\-entry\fR TEXT.
|
||||
.IP
|
||||
An Info directory entry is actually a menu item.
|
||||
.TP
|
||||
\fB\-\-quiet\fR
|
||||
@ -54,7 +48,6 @@ same as \fB\-\-delete\fR.
|
||||
.TP
|
||||
\fB\-\-section\fR=\fISEC\fR
|
||||
put this file's entries in section SEC of the directory.
|
||||
.IP
|
||||
If you specify more than one section, all the entries
|
||||
are added in each of the sections.
|
||||
If you don't specify any sections, they are determined
|
||||
@ -65,6 +58,11 @@ display version information and exit.
|
||||
.SH "REPORTING BUGS"
|
||||
Email bug reports to bug-texinfo@gnu.org,
|
||||
general questions and discussion to help-texinfo@gnu.org.
|
||||
.SH COPYRIGHT
|
||||
Copyright \(co 2002 Free Software Foundation, Inc.
|
||||
There is NO warranty. You may redistribute this software
|
||||
under the terms of the GNU General Public License.
|
||||
For more information about these matters, see the files named COPYING.
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B install-info
|
||||
@ -77,8 +75,3 @@ programs are properly installed at your site, the command
|
||||
.B info install-info
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
.SH COPYRIGHT
|
||||
Copyright \(co 1999 Free Software Foundation, Inc.
|
||||
There is NO warranty. You may redistribute this software
|
||||
under the terms of the GNU General Public License.
|
||||
For more information about these matters, see the files named COPYING.
|
||||
|
@ -1,69 +1,117 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.013.
|
||||
.TH MAKEINFO "1" "September 1999" "GNU texinfo 4.0" FSF
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.24.
|
||||
.TH MAKEINFO "1" "March 2002" "GNU texinfo 4.1" FSF
|
||||
.SH NAME
|
||||
makeinfo \- translate Texinfo documents
|
||||
.SH SYNOPSIS
|
||||
.B makeinfo
|
||||
[\fIOPTION\fR]...\fI TEXINFO-FILE\fR...
|
||||
[\fIOPTION\fR]... \fITEXINFO-FILE\fR...
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Translate Texinfo source documentation to various other formats:
|
||||
Info files suitable for reading online with Emacs or standalone GNU Info
|
||||
(by default); plain text (with \fB\-\-no\-headers\fR); or HTML (with \fB\-\-html\fR).
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
\fB\-\-commands\-in\-node\-names\fR
|
||||
allow @ commands in node names.
|
||||
.TP
|
||||
\fB\-D\fR VAR
|
||||
define a variable, as with @set.
|
||||
.TP
|
||||
\fB\-E\fR, \fB\-\-macro\-expand\fR FILE
|
||||
output macro-expanded source to FILE.
|
||||
Translate Texinfo source documentation to various other formats, by default
|
||||
Info files suitable for reading online with Emacs or standalone GNU Info.
|
||||
.SS "General options:"
|
||||
.TP
|
||||
\fB\-\-error\-limit\fR=\fINUM\fR
|
||||
quit after NUM errors (default 100).
|
||||
.TP
|
||||
\fB\-\-fill\-column\fR=\fINUM\fR
|
||||
break Info lines at NUM characters (default 72).
|
||||
.TP
|
||||
\fB\-\-footnote\-style\fR=\fISTYLE\fR
|
||||
output footnotes according to STYLE:
|
||||
.IP
|
||||
`separate' to place footnotes in their own node,
|
||||
`end' to place the footnotes at the end of the
|
||||
.IP
|
||||
node in which they are defined (the default).
|
||||
.TP
|
||||
\fB\-\-force\fR
|
||||
preserve output even if errors.
|
||||
.TP
|
||||
\fB\-\-help\fR
|
||||
display this help and exit.
|
||||
.TP
|
||||
\fB\-\-no\-validate\fR
|
||||
suppress node cross-reference validation.
|
||||
.TP
|
||||
\fB\-\-no\-warn\fR
|
||||
suppress warnings (but not errors).
|
||||
.TP
|
||||
\fB\-\-reference\-limit\fR=\fINUM\fR
|
||||
warn about at most NUM references (default 1000).
|
||||
.TP
|
||||
\fB\-v\fR, \fB\-\-verbose\fR
|
||||
explain what is being done.
|
||||
.TP
|
||||
\fB\-\-version\fR
|
||||
display version information and exit.
|
||||
.SS "Output format selection (default is to produce Info):"
|
||||
.TP
|
||||
\fB\-\-docbook\fR
|
||||
output DocBook rather than Info.
|
||||
.TP
|
||||
\fB\-\-html\fR
|
||||
output HTML rather than Info format;
|
||||
output HTML rather than Info.
|
||||
.TP
|
||||
\fB\-\-no\-headers\fR
|
||||
output plain text, suppressing Info node
|
||||
separators and Node: lines; also, write to
|
||||
standard output without \fB\-\-output\fR.
|
||||
.TP
|
||||
\fB\-\-xml\fR
|
||||
output XML (TexinfoML) rather than Info.
|
||||
.SS "General output options:"
|
||||
.TP
|
||||
\fB\-E\fR, \fB\-\-macro\-expand\fR FILE
|
||||
output macro-expanded source to FILE.
|
||||
ignoring any @setfilename.
|
||||
.TP
|
||||
\fB\-\-no\-split\fR
|
||||
suppress splitting of Info or HTML output,
|
||||
generate only one output file.
|
||||
.TP
|
||||
\fB\-\-number\-sections\fR
|
||||
output chapter and sectioning numbers.
|
||||
.TP
|
||||
\fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR
|
||||
output to FILE (directory if split HTML),
|
||||
.SS "Options for Info and plain text:"
|
||||
.TP
|
||||
\fB\-\-enable\-encoding\fR
|
||||
output accented and special characters in
|
||||
Info output based on @documentencoding.
|
||||
.TP
|
||||
\fB\-\-fill\-column\fR=\fINUM\fR
|
||||
break Info lines at NUM characters (default 72).
|
||||
.TP
|
||||
\fB\-\-footnote\-style\fR=\fISTYLE\fR
|
||||
output footnotes in Info according to STYLE:
|
||||
`separate' to put them in their own node;
|
||||
`end' to put them at the end of the node
|
||||
.IP
|
||||
in which they are defined (default).
|
||||
.TP
|
||||
\fB\-\-paragraph\-indent\fR=\fIVAL\fR
|
||||
indent Info paragraphs by VAL spaces (default 3).
|
||||
If VAL is `none', do not indent; if VAL is
|
||||
`asis', preserve existing indentation.
|
||||
.TP
|
||||
\fB\-\-split\-size\fR=\fINUM\fR
|
||||
split Info files at size NUM (default 50000).
|
||||
.SS "Input file options:"
|
||||
.TP
|
||||
\fB\-\-commands\-in\-node\-names\fR
|
||||
allow @ commands in node names.
|
||||
.TP
|
||||
\fB\-D\fR VAR
|
||||
define the variable VAR, as with @set.
|
||||
.TP
|
||||
\fB\-I\fR DIR
|
||||
append DIR to the @include search path.
|
||||
.TP
|
||||
\fB\-P\fR DIR
|
||||
prepend DIR to the @include search path.
|
||||
.TP
|
||||
\fB\-U\fR VAR
|
||||
undefine the variable VAR, as with @clear.
|
||||
.SS "Conditional processing in input:"
|
||||
.TP
|
||||
\fB\-\-ifhtml\fR
|
||||
process @ifhtml and @html text even when not
|
||||
.IP
|
||||
generating HTML.
|
||||
process @ifhtml and @html even if not generating HTML.
|
||||
.TP
|
||||
\fB\-\-ifinfo\fR
|
||||
process @ifinfo text even when generating HTML.
|
||||
.TP
|
||||
\fB\-\-iftex\fR
|
||||
process @iftex and @tex text.
|
||||
.IP
|
||||
implies \fB\-\-no\-split\fR.
|
||||
.TP
|
||||
\fB\-\-no\-headers\fR
|
||||
suppress Info node separators and Node: lines and
|
||||
.IP
|
||||
write to standard output without \fB\-\-output\fR.
|
||||
process @iftex and @tex text; implies \fB\-\-no\-split\fR.
|
||||
.TP
|
||||
\fB\-\-no\-ifhtml\fR
|
||||
do not process @ifhtml and @html text.
|
||||
@ -73,44 +121,7 @@ do not process @ifinfo text.
|
||||
.TP
|
||||
\fB\-\-no\-iftex\fR
|
||||
do not process @iftex and @tex text.
|
||||
.TP
|
||||
\fB\-\-no\-split\fR
|
||||
suppress splitting of large Info output files or
|
||||
generation of one HTML file per node.
|
||||
.TP
|
||||
\fB\-\-no\-validate\fR
|
||||
suppress node cross-reference validation.
|
||||
.TP
|
||||
\fB\-\-no\-warn\fR
|
||||
suppress warnings (but not errors).
|
||||
.TP
|
||||
\fB\-\-number\-sections\fR
|
||||
include chapter, section, etc. numbers in output.
|
||||
.TP
|
||||
\fB\-o\fR, \fB\-\-output\fR=\fIFILE\fR
|
||||
output to FILE, ignoring any @setfilename.
|
||||
.TP
|
||||
\fB\-P\fR DIR
|
||||
prepend DIR to the @include search path.
|
||||
.TP
|
||||
\fB\-\-paragraph\-indent\fR=\fIVAL\fR
|
||||
indent Info paragraphs by VAL spaces (default 3).
|
||||
.IP
|
||||
if VAL is `none', do not indent;
|
||||
if VAL is `asis', preserve existing indentation.
|
||||
.TP
|
||||
\fB\-\-reference\-limit\fR=\fINUM\fR
|
||||
warn about at most NUM references (default 1000).
|
||||
.TP
|
||||
\fB\-U\fR VAR
|
||||
undefine a variable, as with @clear.
|
||||
.TP
|
||||
\fB\-v\fR, \fB\-\-verbose\fR
|
||||
explain what is being done.
|
||||
.TP
|
||||
\fB\-\-version\fR
|
||||
display version information and exit.
|
||||
.PP
|
||||
The defaults for the @if... conditionals depend on the output format:
|
||||
if generating HTML, \fB\-\-ifhtml\fR is on and the others are off;
|
||||
if generating Info or plain text, \fB\-\-ifinfo\fR is on and the others are off.
|
||||
@ -133,6 +144,11 @@ write one Info file however big
|
||||
.SH "REPORTING BUGS"
|
||||
Email bug reports to bug-texinfo@gnu.org,
|
||||
general questions and discussion to help-texinfo@gnu.org.
|
||||
.SH COPYRIGHT
|
||||
Copyright \(co 2002 Free Software Foundation, Inc.
|
||||
There is NO warranty. You may redistribute this software
|
||||
under the terms of the GNU General Public License.
|
||||
For more information about these matters, see the files named COPYING.
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B makeinfo
|
||||
@ -145,8 +161,3 @@ programs are properly installed at your site, the command
|
||||
.B info makeinfo
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
.SH COPYRIGHT
|
||||
Copyright \(co 1999 Free Software Foundation, Inc.
|
||||
There is NO warranty. You may redistribute this software
|
||||
under the terms of the GNU General Public License.
|
||||
For more information about these matters, see the files named COPYING.
|
||||
|
@ -1,12 +1,11 @@
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.013.
|
||||
.TH TEXINDEX "1" "September 1999" "GNU texinfo 4.0" FSF
|
||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.24.
|
||||
.TH TEXINDEX "1" "March 2002" "GNU texinfo 4.1" FSF
|
||||
.SH NAME
|
||||
texindex \- sort Texinfo index files
|
||||
.SH SYNOPSIS
|
||||
.B texindex
|
||||
[\fIOPTION\fR]...\fI FILE\fR...
|
||||
[\fIOPTION\fR]... \fIFILE\fR...
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Generate a sorted index for each TeX output FILE.
|
||||
Usually FILE... is specified as `foo.??' for a document `foo.texi'.
|
||||
.SH OPTIONS
|
||||
@ -28,6 +27,11 @@ display version information and exit
|
||||
.SH "REPORTING BUGS"
|
||||
Email bug reports to bug-texinfo@gnu.org,
|
||||
general questions and discussion to help-texinfo@gnu.org.
|
||||
.SH COPYRIGHT
|
||||
Copyright \(co 2002 Free Software Foundation, Inc.
|
||||
There is NO warranty. You may redistribute this software
|
||||
under the terms of the GNU General Public License.
|
||||
For more information about these matters, see the files named COPYING.
|
||||
.SH "SEE ALSO"
|
||||
The full documentation for
|
||||
.B texindex
|
||||
@ -40,8 +44,3 @@ programs are properly installed at your site, the command
|
||||
.B info texindex
|
||||
.PP
|
||||
should give you access to the complete manual.
|
||||
.SH COPYRIGHT
|
||||
Copyright \(co 1999 Free Software Foundation, Inc.
|
||||
There is NO warranty. You may redistribute this software
|
||||
under the terms of the GNU General Public License.
|
||||
For more information about these matters, see the files named COPYING.
|
||||
|
File diff suppressed because it is too large
Load Diff
4
contrib/texinfo/doc/version-stnd.texi
Normal file
4
contrib/texinfo/doc/version-stnd.texi
Normal file
@ -0,0 +1,4 @@
|
||||
@set UPDATED 2 March 2002
|
||||
@set UPDATED-MONTH March 2002
|
||||
@set EDITION 4.1
|
||||
@set VERSION 4.1
|
@ -1,3 +1,4 @@
|
||||
@set UPDATED 28 September 1999
|
||||
@set EDITION 4.0
|
||||
@set VERSION 4.0
|
||||
@set UPDATED 4 March 2002
|
||||
@set UPDATED-MONTH March 2002
|
||||
@set EDITION 4.1
|
||||
@set VERSION 4.1
|
||||
|
@ -1,9 +1,7 @@
|
||||
/* doc.h -- Structure associating function pointers with documentation. */
|
||||
/* doc.h -- Structures associating function pointers with documentation.
|
||||
$Id: doc.h,v 1.5 2001/11/16 23:16:40 karl Exp $
|
||||
|
||||
/* This file is part of GNU Info, a program for reading online documentation
|
||||
stored in Info format.
|
||||
|
||||
Copyright (C) 1993 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -26,12 +24,44 @@
|
||||
|
||||
#include "info.h" /* for NAMED_FUNCTIONS, VFunction, etc. */
|
||||
|
||||
typedef struct {
|
||||
#if defined (INFOKEY)
|
||||
/* For each function, we keep track of the first defined key sequence
|
||||
which invokes that function, for each different map. This is so that
|
||||
the dynamic documentation generation in infodoc.c (a) doesn't have to
|
||||
search through copious KEYMAP_ENTRYs, and, more importantly, (b) the
|
||||
user and programmer can choose the preferred key sequence that is
|
||||
printed for any given function -- it's just the first one that
|
||||
appears in the user's infokey file or the default keymaps in
|
||||
infomap.c.
|
||||
|
||||
Each FUNCTION_DOC has a linked list of FUNCTION_KEYSEQ structs
|
||||
hanging off it, which are created on startup when the user and/or
|
||||
default keymaps are being parsed. */
|
||||
typedef struct function_keyseq
|
||||
{
|
||||
struct function_keyseq *next;
|
||||
struct keymap_entry *map;
|
||||
char *keyseq;
|
||||
} FUNCTION_KEYSEQ;
|
||||
|
||||
#endif /* INFOKEY */
|
||||
|
||||
|
||||
/* An array of FUNCTION_DOC structures is defined in doc.c, which is
|
||||
automagically generated by the makedoc utility, whose job is to scan
|
||||
through the source files for command function declarations and
|
||||
compile a list of all the ones it finds. This saves tedious
|
||||
housekeeping and avoids errors of omission. */
|
||||
typedef struct
|
||||
{
|
||||
VFunction *func;
|
||||
#if defined (NAMED_FUNCTIONS)
|
||||
char *func_name;
|
||||
#endif /* NAMED_FUNCTIONS */
|
||||
char *doc;
|
||||
#if defined (INFOKEY)
|
||||
FUNCTION_KEYSEQ *keys;
|
||||
#endif /* INFOKEY */
|
||||
char *doc;
|
||||
} FUNCTION_DOC;
|
||||
|
||||
extern FUNCTION_DOC function_doc_array[];
|
||||
@ -39,12 +69,31 @@ extern FUNCTION_DOC function_doc_array[];
|
||||
extern char *function_documentation ();
|
||||
extern char *key_documentation ();
|
||||
extern char *pretty_keyname ();
|
||||
extern char *pretty_keyseq ();
|
||||
extern char *where_is ();
|
||||
extern char *replace_in_documentation ();
|
||||
extern void info_document_key ();
|
||||
extern void dump_map_to_message_buffer ();
|
||||
|
||||
/* Under the old key-binding system, an info command is specified by
|
||||
the pointer to its function. Under the new INFOKEY binding system,
|
||||
it is specified by a pointer to the command's FUNCTION_DOC structure,
|
||||
defined in doc.c, from which the pointer to the function can be
|
||||
easily divined using the InfoFunction() extractor. */
|
||||
#if defined(INFOKEY)
|
||||
typedef FUNCTION_DOC InfoCommand;
|
||||
#define InfoFunction(ic) ((ic) ? (ic)->func : NULL)
|
||||
#define InfoCmd(fn) (&function_doc_array[A_##fn])
|
||||
#define DocInfoCmd(fd) ((fd) && (fd)->func ? (fd) : NULL)
|
||||
#else /* !INFOKEY */
|
||||
typedef VFunction InfoCommand;
|
||||
#define InfoFunction(vf) ((vf))
|
||||
#define InfoCmd(fn) fn
|
||||
#define DocInfoCmd(fd) ((fd)->func)
|
||||
#endif /* !INFOKEY */
|
||||
|
||||
#if defined (NAMED_FUNCTIONS)
|
||||
extern char *function_name ();
|
||||
extern VFunction *named_function ();
|
||||
extern InfoCommand *named_function ();
|
||||
#endif /* NAMED_FUNCTIONS */
|
||||
#endif /* !DOC_H */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* echo-area.c -- how to read a line in the echo area.
|
||||
$Id: echo-area.c,v 1.12 1999/03/03 22:22:14 karl Exp $
|
||||
$Id: echo-area.c,v 1.15 2001/12/12 16:19:39 karl Exp $
|
||||
|
||||
Copyright (C) 1993, 97, 98, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 97, 98, 99, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -868,7 +868,10 @@ info_read_completing_internal (window, prompt, completions, force)
|
||||
/* If no match, go back and try again. */
|
||||
if (i == completions_found_index)
|
||||
{
|
||||
inform_in_echo_area (_("Not complete"));
|
||||
if (!completions_found_index)
|
||||
inform_in_echo_area (_("No completions"));
|
||||
else
|
||||
inform_in_echo_area (_("Not complete"));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -1258,7 +1261,26 @@ build_completions ()
|
||||
|
||||
maybe_free (LCD_reference.label);
|
||||
LCD_reference.label = (char *)xmalloc (1 + shortest);
|
||||
strncpy (LCD_reference.label, completions_found[0]->label, shortest);
|
||||
/* Since both the sorting done inside remove_completion_duplicates
|
||||
and all the comparisons above are case-insensitive, it's
|
||||
possible that the completion we are going to return is
|
||||
identical to what the user typed but for the letter-case. This
|
||||
is confusing, since the user could type FOOBAR<TAB> and get her
|
||||
string change letter-case for no good reason. So try to find a
|
||||
possible completion whose letter-case is identical, and if so,
|
||||
use that. */
|
||||
if (completions_found_index > 1)
|
||||
{
|
||||
int req_len = strlen (request);
|
||||
|
||||
for (i = 0; i < completions_found_index; i++)
|
||||
if (strncmp (request, completions_found[i]->label, req_len) == 0)
|
||||
break;
|
||||
/* If none of the candidates match exactly, use the first one. */
|
||||
if (i >= completions_found_index)
|
||||
i = 0;
|
||||
}
|
||||
strncpy (LCD_reference.label, completions_found[i]->label, shortest);
|
||||
LCD_reference.label[shortest] = '\0';
|
||||
LCD_completion = &LCD_reference;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* filesys.c -- filesystem specific functions.
|
||||
$Id: filesys.c,v 1.10 1998/12/06 21:58:30 karl Exp $
|
||||
$Id: filesys.c,v 1.14 2002/03/02 15:05:04 karl Exp $
|
||||
|
||||
Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 97, 98, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -163,6 +163,11 @@ info_file_in_path (filename, path)
|
||||
char *temp_dirname;
|
||||
int statable, dirname_index;
|
||||
|
||||
/* Reject ridiculous cases up front, to prevent infinite recursion
|
||||
later on. E.g., someone might say "info '(.)foo'"... */
|
||||
if (!*filename || STREQ (filename, ".") || STREQ (filename, ".."))
|
||||
return NULL;
|
||||
|
||||
dirname_index = 0;
|
||||
|
||||
while ((temp_dirname = extract_colon_unit (path, &dirname_index)))
|
||||
@ -557,7 +562,7 @@ filesys_read_compressed (pathname, filesize, finfo)
|
||||
/* Read chunks from this file until there are none left to read. */
|
||||
if (stream)
|
||||
{
|
||||
int offset, size;
|
||||
long offset, size;
|
||||
char *chunk;
|
||||
|
||||
offset = size = 0;
|
||||
@ -689,25 +694,34 @@ filesys_error_string (filename, error_num)
|
||||
}
|
||||
|
||||
|
||||
/* Check for FILENAME eq "dir" first, then all the compression
|
||||
suffixes. */
|
||||
/* Check for "dir" with all the possible info and compression suffixes,
|
||||
in combination. */
|
||||
|
||||
int
|
||||
is_dir_name (filename)
|
||||
char *filename;
|
||||
{
|
||||
unsigned i;
|
||||
if (strcasecmp (filename, "dir") == 0)
|
||||
return 1;
|
||||
|
||||
for (i = 0; compress_suffixes[i].suffix; i++)
|
||||
|
||||
for (i = 0; info_suffixes[i]; i++)
|
||||
{
|
||||
char dir_compressed[50]; /* can be short */
|
||||
strcpy (dir_compressed, "dir");
|
||||
strcat (dir_compressed, compress_suffixes[i].suffix);
|
||||
if (strcasecmp (filename, dir_compressed) == 0)
|
||||
unsigned c;
|
||||
char trydir[50];
|
||||
strcpy (trydir, "dir");
|
||||
strcat (trydir, info_suffixes[i]);
|
||||
|
||||
if (strcasecmp (filename, trydir) == 0)
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
for (c = 0; compress_suffixes[c].suffix; c++)
|
||||
{
|
||||
char dir_compressed[50]; /* can be short */
|
||||
strcpy (dir_compressed, trydir);
|
||||
strcat (dir_compressed, compress_suffixes[c].suffix);
|
||||
if (strcasecmp (filename, dir_compressed) == 0)
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -1,7 +1,8 @@
|
||||
/* info.c -- Display nodes of Info files in multiple windows.
|
||||
$Id: info.c,v 1.41 1999/09/25 16:10:04 karl Exp $
|
||||
$Id: info.c,v 1.53 2002/03/02 15:18:58 karl Exp $
|
||||
|
||||
Copyright (C) 1993, 96, 97, 98, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 96, 97, 98, 99, 2000, 01, 02
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -76,6 +77,9 @@ int dump_subnodes = 0;
|
||||
/* Non-zero means make default keybindings be loosely modeled on vi(1). */
|
||||
int vi_keys_p = 0;
|
||||
|
||||
/* Non-zero means don't remove ANSI escape sequences from man pages. */
|
||||
int raw_escapes_p = 0;
|
||||
|
||||
#ifdef __MSDOS__
|
||||
/* Non-zero indicates that screen output should be made 'speech-friendly'.
|
||||
Since on MSDOS the usual behavior is to write directly to the video
|
||||
@ -99,6 +103,7 @@ static struct option long_options[] = {
|
||||
{ "file", 1, 0, 'f' },
|
||||
{ "subnodes", 0, &dump_subnodes, 1 },
|
||||
{ "output", 1, 0, 'o' },
|
||||
{ "raw-escapes", 0, &raw_escapes_p, 1 },
|
||||
{ "show-options", 0, 0, 'O' },
|
||||
{ "usage", 0, 0, 'O' },
|
||||
{ "vi-keys", 0, &vi_keys_p, 1 },
|
||||
@ -115,9 +120,9 @@ static struct option long_options[] = {
|
||||
|
||||
/* String describing the shorthand versions of the long options found above. */
|
||||
#ifdef __MSDOS__
|
||||
static char *short_options = "d:n:f:o:Osb";
|
||||
static char *short_options = "d:n:f:o:ORsb";
|
||||
#else
|
||||
static char *short_options = "d:n:f:o:Os";
|
||||
static char *short_options = "d:n:f:o:ORs";
|
||||
#endif
|
||||
|
||||
/* When non-zero, the Info window system has been initialized. */
|
||||
@ -126,6 +131,7 @@ int info_windows_initialized_p = 0;
|
||||
/* Some "forward" declarations. */
|
||||
static void info_short_help (), remember_info_program_name ();
|
||||
static void init_messages ();
|
||||
extern void add_file_directory_to_path ();
|
||||
|
||||
|
||||
/* **************************************************************** */
|
||||
@ -206,6 +212,12 @@ main (argc, argv)
|
||||
goto_invocation_p = 1;
|
||||
break;
|
||||
|
||||
/* User has specified that she wants the escape sequences
|
||||
in man pages to be passed thru unaltered. */
|
||||
case 'R':
|
||||
raw_escapes_p = 1;
|
||||
break;
|
||||
|
||||
/* User is specifying that she wishes to dump the subnodes of
|
||||
the node that she is dumping. */
|
||||
case 's':
|
||||
@ -213,7 +225,7 @@ main (argc, argv)
|
||||
break;
|
||||
|
||||
#ifdef __MSDOS__
|
||||
/* User specifies that she wants speech-friendly output. */
|
||||
/* User wants speech-friendly output. */
|
||||
case 'b':
|
||||
speech_friendly = 1;
|
||||
break;
|
||||
@ -268,7 +280,7 @@ main (argc, argv)
|
||||
There is NO warranty. You may redistribute this software\n\
|
||||
under the terms of the GNU General Public License.\n\
|
||||
For more information about these matters, see the files named COPYING.\n"),
|
||||
"1999");
|
||||
"2002");
|
||||
xexit (0);
|
||||
}
|
||||
|
||||
@ -313,25 +325,7 @@ For more information about these matters, see the files named COPYING.\n"),
|
||||
/* If the user specified a particular filename, add the path of that
|
||||
file to the contents of INFOPATH. */
|
||||
if (user_filename)
|
||||
{
|
||||
char *directory_name = xstrdup (user_filename);
|
||||
char *temp = filename_non_directory (directory_name);
|
||||
|
||||
if (temp != directory_name)
|
||||
{
|
||||
if (HAVE_DRIVE (directory_name) && temp == directory_name + 2)
|
||||
{
|
||||
/* The directory of "d:foo" is stored as "d:.", to avoid
|
||||
mixing it with "d:/" when a slash is appended. */
|
||||
*temp = '.';
|
||||
temp += 2;
|
||||
}
|
||||
temp[-1] = 0;
|
||||
info_add_path (directory_name, INFOPATH_PREPEND);
|
||||
}
|
||||
|
||||
free (directory_name);
|
||||
}
|
||||
add_file_directory_to_path (user_filename);
|
||||
|
||||
/* If the user wants to search every known index for a given string,
|
||||
do that now, and report the results. */
|
||||
@ -382,13 +376,14 @@ For more information about these matters, see the files named COPYING.\n"),
|
||||
char *errstr, *errarg1, *errarg2;
|
||||
NODE *new_initial_node = info_follow_menus (initial_node, argv + optind,
|
||||
&errstr, &errarg1, &errarg2);
|
||||
|
||||
if (new_initial_node && new_initial_node != initial_node)
|
||||
initial_node = new_initial_node;
|
||||
|
||||
/* If the user specified that this node should be output, then do that
|
||||
now. Otherwise, start the Info session with this node. Or act
|
||||
accordingly if the initial node was not found. */
|
||||
if (user_output_filename)
|
||||
if (user_output_filename && !goto_invocation_p)
|
||||
{
|
||||
if (!errstr)
|
||||
dump_node_to_file (initial_node, user_output_filename,
|
||||
@ -447,7 +442,13 @@ For more information about these matters, see the files named COPYING.\n"),
|
||||
free (program);
|
||||
}
|
||||
|
||||
info_read_and_dispatch ();
|
||||
if (user_output_filename)
|
||||
{
|
||||
dump_node_to_file (windows->node, user_output_filename,
|
||||
dump_subnodes);
|
||||
}
|
||||
else
|
||||
info_read_and_dispatch ();
|
||||
|
||||
/* On program exit, leave the cursor at the bottom of the
|
||||
window, and restore the terminal IO. */
|
||||
@ -474,6 +475,29 @@ For more information about these matters, see the files named COPYING.\n"),
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
add_file_directory_to_path (filename)
|
||||
char *filename;
|
||||
{
|
||||
char *directory_name = xstrdup (filename);
|
||||
char *temp = filename_non_directory (directory_name);
|
||||
|
||||
if (temp != directory_name)
|
||||
{
|
||||
if (HAVE_DRIVE (directory_name) && temp == directory_name + 2)
|
||||
{
|
||||
/* The directory of "d:foo" is stored as "d:.", to avoid
|
||||
mixing it with "d:/" when a slash is appended. */
|
||||
*temp = '.';
|
||||
temp += 2;
|
||||
}
|
||||
temp[-1] = 0;
|
||||
info_add_path (directory_name, INFOPATH_PREPEND);
|
||||
}
|
||||
|
||||
free (directory_name);
|
||||
}
|
||||
|
||||
|
||||
/* Error handling. */
|
||||
|
||||
@ -527,6 +551,14 @@ info_error (format, arg1, arg2)
|
||||
static void
|
||||
info_short_help ()
|
||||
{
|
||||
#ifdef __MSDOS__
|
||||
static const char speech_friendly_string[] = N_("\
|
||||
--speech-friendly be friendly to speech synthesizers.\n");
|
||||
#else
|
||||
static const char speech_friendly_string[] = "";
|
||||
#endif
|
||||
|
||||
|
||||
printf (_("\
|
||||
Usage: %s [OPTION]... [MENU-ITEM...]\n\
|
||||
\n\
|
||||
@ -541,9 +573,10 @@ Options:\n\
|
||||
--index-search=STRING go to node pointed by index entry STRING.\n\
|
||||
--node=NODENAME specify nodes in first visited Info file.\n\
|
||||
--output=FILENAME output selected nodes to FILENAME.\n\
|
||||
--raw-escapes don't remove ANSI escapes from man pages.\n\
|
||||
--restore=FILENAME read initial keystrokes from FILENAME.\n\
|
||||
--show-options, --usage go to command-line options node.\n\
|
||||
--subnodes recursively output menu items.\n%s\
|
||||
--show-options, --usage go to command-line options node.\n%s\
|
||||
--subnodes recursively output menu items.\n\
|
||||
--vi-keys use vi-like and less-like key bindings.\n\
|
||||
--version display version information and exit.\n\
|
||||
\n\
|
||||
@ -563,14 +596,7 @@ Examples:\n\
|
||||
Email bug reports to bug-texinfo@gnu.org,\n\
|
||||
general questions and discussion to help-texinfo@gnu.org.\n\
|
||||
"),
|
||||
program_name,
|
||||
#ifdef __MSDOS__
|
||||
"\
|
||||
--speech-friendly be friendly to speech synthesizers.\n"
|
||||
#else
|
||||
""
|
||||
#endif
|
||||
);
|
||||
program_name, speech_friendly_string);
|
||||
|
||||
xexit (0);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* info.h -- Header file which includes all of the other headers.
|
||||
$Id: info.h,v 1.14 1999/09/25 16:10:04 karl Exp $
|
||||
$Id: info.h,v 1.16 2002/02/23 19:12:02 karl Exp $
|
||||
|
||||
Copyright (C) 1993, 97, 98, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 97, 98, 99, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -25,6 +25,7 @@
|
||||
/* We always want these, so why clutter up the compile command? */
|
||||
#define HANDLE_MAN_PAGES
|
||||
#define NAMED_FUNCTIONS
|
||||
#define INFOKEY
|
||||
|
||||
/* System dependencies. */
|
||||
#include "system.h"
|
||||
@ -34,12 +35,11 @@ typedef int Function ();
|
||||
typedef void VFunction ();
|
||||
typedef char *CFunction ();
|
||||
|
||||
|
||||
#include "filesys.h"
|
||||
#include "doc.h"
|
||||
#include "display.h"
|
||||
#include "session.h"
|
||||
#include "echo-area.h"
|
||||
#include "doc.h"
|
||||
#include "footnotes.h"
|
||||
#include "gc.h"
|
||||
|
||||
@ -119,14 +119,14 @@ extern int info_error_rings_bell_p;
|
||||
/* Non-zero means default keybindings are loosely modeled on vi(1). */
|
||||
extern int vi_keys_p;
|
||||
|
||||
/* Non-zero means don't remove ANSI escape sequences from man pages. */
|
||||
extern int raw_escapes_p;
|
||||
|
||||
/* Print FORMAT with ARG1 and ARG2. If the window system was initialized,
|
||||
then the message is printed in the echo area. Otherwise, a message is
|
||||
output to stderr. */
|
||||
extern void info_error ();
|
||||
|
||||
/* The version numbers of Info. */
|
||||
extern int info_major_version, info_minor_version;
|
||||
|
||||
/* Error message defines. */
|
||||
extern char *msg_cant_find_node;
|
||||
extern char *msg_cant_file_node;
|
||||
@ -146,13 +146,14 @@ extern char *msg_win_too_small;
|
||||
extern char *msg_cant_make_help;
|
||||
|
||||
|
||||
/* Found in info-utils.c. */
|
||||
extern char *filename_non_directory ();
|
||||
extern char *filename_non_directory (); /* Found in info-utils.c. */
|
||||
|
||||
#if defined(INFOKEY)
|
||||
extern void set_variable_to_value (); /* Found in variables.c. */
|
||||
#endif /* INFOKEY */
|
||||
|
||||
#if !defined (BUILDING_LIBRARY)
|
||||
/* Found in session.c */
|
||||
extern int info_windows_initialized_p;
|
||||
|
||||
extern int info_windows_initialized_p; /* Found in session.c */
|
||||
/* Found in window.c. */
|
||||
extern void message_in_echo_area (), unmessage_in_echo_area ();
|
||||
#endif /* !BUILDING_LIBRARY */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* infodoc.c -- Functions which build documentation nodes.
|
||||
$Id: infodoc.c,v 1.23 1999/09/25 16:10:04 karl Exp $
|
||||
$Id: infodoc.c,v 1.28 2002/02/27 13:37:33 karl Exp $
|
||||
|
||||
Copyright (C) 1993, 97, 98, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 97, 98, 99, 2001, 02 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -20,17 +20,12 @@
|
||||
Written by Brian Fox (bfox@ai.mit.edu). */
|
||||
|
||||
#include "info.h"
|
||||
#include "funs.h"
|
||||
|
||||
/* HELP_NODE_GETS_REGENERATED is always defined now that keys may get
|
||||
rebound, or other changes in the help text may occur. */
|
||||
#define HELP_NODE_GETS_REGENERATED 1
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
/* Info Help Windows */
|
||||
/* */
|
||||
/* **************************************************************** */
|
||||
|
||||
/* The name of the node used in the help window. */
|
||||
static char *info_help_nodename = "*Info Help*";
|
||||
|
||||
@ -40,26 +35,71 @@ static NODE *internal_info_help_node = (NODE *)NULL;
|
||||
/* A pointer to the contents of the help node. */
|
||||
static char *internal_info_help_node_contents = (char *)NULL;
|
||||
|
||||
/* The static text which appears in the internal info help node. */
|
||||
/* The (more or less) static text which appears in the internal info
|
||||
help node. The actual key bindings are inserted. Keep the
|
||||
underlines (****, etc.) in the same N_ call as the text lines they
|
||||
refer to, so translations can make the number of *'s or -'s match. */
|
||||
#if defined(INFOKEY)
|
||||
|
||||
static char *info_internal_help_text[] = {
|
||||
N_("Basic Commands in Info Windows\n"),
|
||||
N_("******************************\n"),
|
||||
N_("Basic Commands in Info Windows\n\
|
||||
******************************\n"),
|
||||
"\n",
|
||||
N_("\\%-10[quit-help] Quit this help.\n"),
|
||||
N_("\\%-10[quit] Quit Info altogether.\n"),
|
||||
N_("\\%-10[get-info-help-node] Invoke the Info tutorial.\n"),
|
||||
"\n",
|
||||
N_("Selecting other nodes:\n\
|
||||
----------------------\n"),
|
||||
N_("\\%-10[next-node] Move to the \"next\" node of this node.\n"),
|
||||
N_("\\%-10[prev-node] Move to the \"previous\" node of this node.\n"),
|
||||
N_("\\%-10[up-node] Move \"up\" from this node.\n"),
|
||||
N_("\\%-10[menu-item] Pick menu item specified by name.\n\
|
||||
Picking a menu item causes another node to be selected.\n"),
|
||||
N_("\\%-10[xref-item] Follow a cross reference. Reads name of reference.\n"),
|
||||
N_("\\%-10[history-node] Move to the last node seen in this window.\n"),
|
||||
N_("\\%-10[move-to-next-xref] Skip to next hypertext link within this node.\n"),
|
||||
N_("\\%-10[move-to-prev-xref] Skip to previous hypertext link within this node.\n"),
|
||||
N_("\\%-10[select-reference-this-line] Follow the hypertext link under cursor.\n"),
|
||||
N_("\\%-10[dir-node] Move to the `directory' node. Equivalent to `\\[goto-node] (DIR)'.\n"),
|
||||
N_("\\%-10[top-node] Move to the Top node. Equivalent to `\\[goto-node] Top'.\n"),
|
||||
"\n",
|
||||
N_("Moving within a node:\n\
|
||||
---------------------\n"),
|
||||
N_("\\%-10[scroll-forward] Scroll forward a page.\n"),
|
||||
N_("\\%-10[scroll-backward] Scroll backward a page.\n"),
|
||||
N_("\\%-10[beginning-of-node] Go to the beginning of this node.\n"),
|
||||
N_("\\%-10[end-of-node] Go to the end of this node.\n"),
|
||||
N_("\\%-10[scroll-forward] Scroll forward 1 line.\n"),
|
||||
N_("\\%-10[scroll-backward] Scroll backward 1 line.\n"),
|
||||
"\n",
|
||||
N_("Other commands:\n\
|
||||
---------------\n"),
|
||||
N_("\\%-10[menu-digit] Pick first ... ninth item in node's menu.\n"),
|
||||
N_("\\%-10[last-menu-item] Pick last item in node's menu.\n"),
|
||||
N_("\\%-10[index-search] Search for a specified string in the index entries of this Info\n\
|
||||
file, and select the node referenced by the first entry found.\n"),
|
||||
N_("\\%-10[goto-node] Move to node specified by name.\n\
|
||||
You may include a filename as well, as in (FILENAME)NODENAME.\n"),
|
||||
N_("\\%-10[search] Search forward for a specified string\n\
|
||||
and select the node in which the next occurrence is found.\n"),
|
||||
N_("\\%-10[search-backward] Search backward for a specified string\n\
|
||||
and select the node in which the previous occurrence is found.\n"),
|
||||
NULL
|
||||
};
|
||||
|
||||
#else /* !INFOKEY */
|
||||
|
||||
static char *info_internal_help_text[] = {
|
||||
N_("Basic Commands in Info Windows\n\
|
||||
******************************\n"),
|
||||
"\n",
|
||||
N_(" %-10s Quit this help.\n"),
|
||||
N_(" %-10s Quit Info altogether.\n"),
|
||||
N_(" %-10s Invoke the Info tutorial.\n"),
|
||||
"\n",
|
||||
N_("Moving within a node:\n"),
|
||||
N_("---------------------\n"),
|
||||
N_(" %-10s Scroll forward a page.\n"),
|
||||
N_(" %-10s Scroll backward a page.\n"),
|
||||
N_(" %-10s Go to the beginning of this node.\n"),
|
||||
N_(" %-10s Go to the end of this node.\n"),
|
||||
N_(" %-10s Scroll forward 1 line.\n"),
|
||||
N_(" %-10s Scroll backward 1 line.\n"),
|
||||
"\n",
|
||||
N_("Selecting other nodes:\n"),
|
||||
N_("----------------------\n"),
|
||||
N_("Selecting other nodes:\n\
|
||||
----------------------\n",
|
||||
N_(" %-10s Move to the `next' node of this node.\n"),
|
||||
N_(" %-10s Move to the `previous' node of this node.\n"),
|
||||
N_(" %-10s Move `up' from this node.\n"),
|
||||
@ -72,17 +112,26 @@ static char *info_internal_help_text[] = {
|
||||
N_(" %-10s Move to the `directory' node. Equivalent to `g (DIR)'.\n"),
|
||||
N_(" %-10s Move to the Top node. Equivalent to `g Top'.\n"),
|
||||
"\n",
|
||||
N_("Other commands:\n"),
|
||||
N_("---------------\n"),
|
||||
N_("Moving within a node:\n\
|
||||
---------------------\n"),
|
||||
N_(" %-10s Scroll forward a page.\n"),
|
||||
N_(" %-10s Scroll backward a page.\n"),
|
||||
N_(" %-10s Go to the beginning of this node.\n"),
|
||||
N_(" %-10s Go to the end of this node.\n"),
|
||||
N_(" %-10s Scroll forward 1 line.\n"),
|
||||
N_(" %-10s Scroll backward 1 line.\n"),
|
||||
"\n",
|
||||
N_("Other commands:\n\
|
||||
---------------\n"),
|
||||
N_(" %-10s Pick first ... ninth item in node's menu.\n"),
|
||||
N_(" %-10s Pick last item in node's menu.\n"),
|
||||
N_(" %-10s Search for a specified string in the index entries of this Info\n"),
|
||||
N_(" file, and select the node referenced by the first entry found.\n"),
|
||||
N_(" %-10s Move to node specified by name.\n"),
|
||||
N_(" You may include a filename as well, as in (FILENAME)NODENAME.\n"),
|
||||
N_(" %-10s Search forward through this Info file for a specified string,\n"),
|
||||
N_(" %-10s Search forward for a specified string,\n"),
|
||||
N_(" and select the node in which the next occurrence is found.\n"),
|
||||
N_(" %-10s Search backward in this Info file for a specified string,\n"),
|
||||
N_(" %-10s Search backward for a specified string\n"),
|
||||
N_(" and select the node in which the next occurrence is found.\n"),
|
||||
NULL
|
||||
};
|
||||
@ -133,7 +182,9 @@ static char *info_help_keys_text[][2] = {
|
||||
NULL
|
||||
};
|
||||
|
||||
static char *where_is (), *where_is_internal ();
|
||||
#endif /* !INFOKEY */
|
||||
|
||||
static char *where_is_internal ();
|
||||
|
||||
void
|
||||
dump_map_to_message_buffer (prefix, map)
|
||||
@ -141,20 +192,18 @@ dump_map_to_message_buffer (prefix, map)
|
||||
Keymap map;
|
||||
{
|
||||
register int i;
|
||||
unsigned prefix_len = strlen (prefix);
|
||||
char *new_prefix = (char *)xmalloc (prefix_len + 2);
|
||||
|
||||
strncpy (new_prefix, prefix, prefix_len);
|
||||
new_prefix[prefix_len + 1] = '\0';
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
{
|
||||
new_prefix[prefix_len] = i;
|
||||
if (map[i].type == ISKMAP)
|
||||
{
|
||||
char *new_prefix, *keyname;
|
||||
|
||||
keyname = pretty_keyname (i);
|
||||
new_prefix = (char *)
|
||||
xmalloc (3 + strlen (prefix) + strlen (keyname));
|
||||
sprintf (new_prefix, "%s%s%s ", prefix, *prefix ? " " : "", keyname);
|
||||
|
||||
dump_map_to_message_buffer (new_prefix, (Keymap)map[i].function);
|
||||
free (new_prefix);
|
||||
}
|
||||
else if (map[i].function)
|
||||
{
|
||||
@ -176,14 +225,13 @@ dump_map_to_message_buffer (prefix, map)
|
||||
|
||||
if (last - 1 != i)
|
||||
{
|
||||
printf_to_message_buffer
|
||||
("%s%s .. ", prefix, pretty_keyname (i));
|
||||
printf_to_message_buffer
|
||||
("%s%s\t", prefix, pretty_keyname (last - 1));
|
||||
printf_to_message_buffer ("%s .. ", pretty_keyseq (new_prefix));
|
||||
new_prefix[prefix_len] = last - 1;
|
||||
printf_to_message_buffer ("%s\t", pretty_keyseq (new_prefix));
|
||||
i = last - 1;
|
||||
}
|
||||
else
|
||||
printf_to_message_buffer ("%s%s\t", prefix, pretty_keyname (i));
|
||||
printf_to_message_buffer ("%s\t", pretty_keyseq (new_prefix));
|
||||
|
||||
#if defined (NAMED_FUNCTIONS)
|
||||
/* Print the name of the function, and some padding before the
|
||||
@ -210,6 +258,7 @@ dump_map_to_message_buffer (prefix, map)
|
||||
printf_to_message_buffer ("%s\n", doc);
|
||||
}
|
||||
}
|
||||
free (new_prefix);
|
||||
}
|
||||
|
||||
/* How to create internal_info_help_node. HELP_IS_ONLY_WINDOW_P says
|
||||
@ -225,6 +274,7 @@ create_internal_info_help_node (help_is_only_window_p)
|
||||
register int i;
|
||||
NODE *node;
|
||||
char *contents = NULL;
|
||||
char *exec_keys;
|
||||
|
||||
#ifndef HELP_NODE_GETS_REGENERATED
|
||||
if (internal_info_help_node_contents)
|
||||
@ -239,6 +289,10 @@ create_internal_info_help_node (help_is_only_window_p)
|
||||
|
||||
for (i = 0; info_internal_help_text[i]; i++)
|
||||
{
|
||||
#ifdef INFOKEY
|
||||
printf_to_message_buffer (replace_in_documentation (
|
||||
_(info_internal_help_text[i]), help_is_only_window_p));
|
||||
#else
|
||||
/* Don't translate blank lines, gettext outputs the po file
|
||||
header in that case. We want a blank line. */
|
||||
char *msg = *(info_internal_help_text[i])
|
||||
@ -252,6 +306,7 @@ create_internal_info_help_node (help_is_only_window_p)
|
||||
key = "l";
|
||||
|
||||
printf_to_message_buffer (msg, key);
|
||||
#endif /* !INFOKEY */
|
||||
}
|
||||
|
||||
printf_to_message_buffer ("---------------------\n\n");
|
||||
@ -265,35 +320,46 @@ create_internal_info_help_node (help_is_only_window_p)
|
||||
dump_map_to_message_buffer ("", echo_area_keymap);
|
||||
|
||||
#if defined (NAMED_FUNCTIONS)
|
||||
/* Get a list of the M-x commands which have no keystroke equivs. */
|
||||
/* Get a list of commands which have no keystroke equivs. */
|
||||
exec_keys = where_is (info_keymap, InfoCmd(info_execute_command));
|
||||
if (exec_keys)
|
||||
exec_keys = xstrdup (exec_keys);
|
||||
for (i = 0; function_doc_array[i].func; i++)
|
||||
{
|
||||
VFunction *func = function_doc_array[i].func;
|
||||
InfoCommand *cmd = DocInfoCmd(&function_doc_array[i]);
|
||||
|
||||
if ((!where_is_internal (info_keymap, func)) &&
|
||||
(!where_is_internal (echo_area_keymap, func)))
|
||||
if (InfoFunction(cmd) != info_do_lowercase_version
|
||||
&& !where_is_internal (info_keymap, cmd)
|
||||
&& !where_is_internal (echo_area_keymap, cmd))
|
||||
{
|
||||
if (!printed_one_mx)
|
||||
{
|
||||
printf_to_message_buffer ("---------------------\n\n");
|
||||
printf_to_message_buffer
|
||||
(_("The following commands can only be invoked via M-x:\n\n"));
|
||||
if (exec_keys && exec_keys[0])
|
||||
printf_to_message_buffer
|
||||
(_("The following commands can only be invoked via %s:\n\n"), exec_keys);
|
||||
else
|
||||
printf_to_message_buffer
|
||||
(_("The following commands cannot be invoked at all:\n\n"));
|
||||
printed_one_mx = 1;
|
||||
}
|
||||
|
||||
printf_to_message_buffer
|
||||
("M-x %s\n %s\n",
|
||||
("%s %s\n %s\n",
|
||||
exec_keys,
|
||||
function_doc_array[i].func_name,
|
||||
replace_in_documentation (strlen (function_doc_array[i].doc)
|
||||
== 0
|
||||
? function_doc_array[i].doc
|
||||
: _(function_doc_array[i].doc)));
|
||||
? _(function_doc_array[i].doc)
|
||||
: "")
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (printed_one_mx)
|
||||
printf_to_message_buffer ("\n");
|
||||
|
||||
maybe_free (exec_keys);
|
||||
#endif /* NAMED_FUNCTIONS */
|
||||
|
||||
printf_to_message_buffer
|
||||
@ -492,39 +558,56 @@ DECLARE_INFO_COMMAND (info_get_info_help_node, _("Visit Info node `(info)Help'")
|
||||
|
||||
/* Return the documentation associated with the Info command FUNCTION. */
|
||||
char *
|
||||
function_documentation (function)
|
||||
VFunction *function;
|
||||
function_documentation (cmd)
|
||||
InfoCommand *cmd;
|
||||
{
|
||||
char *doc;
|
||||
|
||||
#if defined (INFOKEY)
|
||||
|
||||
doc = cmd->doc;
|
||||
|
||||
#else /* !INFOKEY */
|
||||
|
||||
register int i;
|
||||
|
||||
for (i = 0; function_doc_array[i].func; i++)
|
||||
if (function == function_doc_array[i].func)
|
||||
if (InfoFunction(cmd) == function_doc_array[i].func)
|
||||
break;
|
||||
|
||||
return replace_in_documentation ((strlen (function_doc_array[i].doc) == 0)
|
||||
? function_doc_array[i].doc
|
||||
: _(function_doc_array[i].doc));
|
||||
doc = function_doc_array[i].func ? function_doc_array[i].doc : "";
|
||||
|
||||
#endif /* !INFOKEY */
|
||||
|
||||
return replace_in_documentation ((strlen (doc) == 0) ? doc : _(doc));
|
||||
}
|
||||
|
||||
#if defined (NAMED_FUNCTIONS)
|
||||
/* Return the user-visible name of the function associated with the
|
||||
Info command FUNCTION. */
|
||||
char *
|
||||
function_name (function)
|
||||
|
||||
VFunction *function;
|
||||
function_name (cmd)
|
||||
InfoCommand *cmd;
|
||||
{
|
||||
#if defined (INFOKEY)
|
||||
|
||||
return cmd->func_name;
|
||||
|
||||
#else /* !INFOKEY */
|
||||
|
||||
register int i;
|
||||
|
||||
for (i = 0; function_doc_array[i].func; i++)
|
||||
if (function == function_doc_array[i].func)
|
||||
if (InfoFunction(cmd) == function_doc_array[i].func)
|
||||
break;
|
||||
|
||||
return (function_doc_array[i].func_name);
|
||||
|
||||
#endif /* !INFOKEY */
|
||||
}
|
||||
|
||||
/* Return a pointer to the function named NAME. */
|
||||
VFunction *
|
||||
/* Return a pointer to the info command for function NAME. */
|
||||
InfoCommand *
|
||||
named_function (name)
|
||||
char *name;
|
||||
{
|
||||
@ -534,7 +617,7 @@ named_function (name)
|
||||
if (strcmp (function_doc_array[i].func_name, name) == 0)
|
||||
break;
|
||||
|
||||
return (function_doc_array[i].func);
|
||||
return (DocInfoCmd(&function_doc_array[i]));
|
||||
}
|
||||
#endif /* NAMED_FUNCTIONS */
|
||||
|
||||
@ -544,7 +627,7 @@ key_documentation (key, map)
|
||||
char key;
|
||||
Keymap map;
|
||||
{
|
||||
VFunction *function = map[key].function;
|
||||
InfoCommand *function = map[key].function;
|
||||
|
||||
if (function)
|
||||
return (function_documentation (function));
|
||||
@ -554,21 +637,21 @@ key_documentation (key, map)
|
||||
|
||||
DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY"))
|
||||
{
|
||||
char keyname[50];
|
||||
int keyname_index = 0;
|
||||
char keys[50];
|
||||
unsigned char keystroke;
|
||||
char *rep;
|
||||
char *k = keys;
|
||||
Keymap map;
|
||||
|
||||
keyname[0] = 0;
|
||||
*k = '\0';
|
||||
map = window->keymap;
|
||||
|
||||
for (;;)
|
||||
{
|
||||
message_in_echo_area (_("Describe key: %s"), keyname);
|
||||
message_in_echo_area (_("Describe key: %s"), pretty_keyseq (keys));
|
||||
keystroke = info_get_input_char ();
|
||||
unmessage_in_echo_area ();
|
||||
|
||||
#if !defined (INFOKEY)
|
||||
if (Meta_p (keystroke))
|
||||
{
|
||||
if (map[ESC].type != ISKMAP)
|
||||
@ -578,32 +661,53 @@ DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY"))
|
||||
return;
|
||||
}
|
||||
|
||||
strcpy (keyname + keyname_index, "ESC ");
|
||||
keyname_index = strlen (keyname);
|
||||
*k++ = '\e';
|
||||
keystroke = UnMeta (keystroke);
|
||||
map = (Keymap)map[ESC].function;
|
||||
}
|
||||
#endif /* !INFOKEY */
|
||||
|
||||
/* Add the printed representation of KEYSTROKE to our keyname. */
|
||||
rep = pretty_keyname (keystroke);
|
||||
strcpy (keyname + keyname_index, rep);
|
||||
keyname_index = strlen (keyname);
|
||||
/* Add the KEYSTROKE to our list. */
|
||||
*k++ = keystroke;
|
||||
*k = '\0';
|
||||
|
||||
if (map[keystroke].function == (VFunction *)NULL)
|
||||
if (map[keystroke].function == (InfoCommand *)NULL)
|
||||
{
|
||||
message_in_echo_area (_("%s is undefined."), keyname);
|
||||
message_in_echo_area (_("%s is undefined."), pretty_keyseq (keys));
|
||||
return;
|
||||
}
|
||||
else if (map[keystroke].type == ISKMAP)
|
||||
{
|
||||
map = (Keymap)map[keystroke].function;
|
||||
strcat (keyname, " ");
|
||||
keyname_index = strlen (keyname);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
char *message, *fundoc, *funname = "";
|
||||
char *keyname, *message, *fundoc, *funname = "";
|
||||
|
||||
#if defined (INFOKEY)
|
||||
/* If the key is bound to do-lowercase-version, but its
|
||||
lower-case variant is undefined, say that this key is
|
||||
also undefined. This is especially important for unbound
|
||||
edit keys that emit an escape sequence: it's terribly
|
||||
confusing to see a message "Home (do-lowercase-version)"
|
||||
or some such when Home is unbound. */
|
||||
if (InfoFunction(map[keystroke].function) == info_do_lowercase_version)
|
||||
{
|
||||
unsigned char lowerkey = Meta_p(keystroke)
|
||||
? Meta (tolower (UnMeta (keystroke)))
|
||||
: tolower (keystroke);
|
||||
|
||||
if (map[lowerkey].function == (InfoCommand *)NULL)
|
||||
{
|
||||
message_in_echo_area (_("%s is undefined."),
|
||||
pretty_keyseq (keys));
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
keyname = pretty_keyseq (keys);
|
||||
|
||||
#if defined (NAMED_FUNCTIONS)
|
||||
funname = function_name (map[keystroke].function);
|
||||
@ -627,13 +731,12 @@ DECLARE_INFO_COMMAND (describe_key, _("Print documentation for KEY"))
|
||||
}
|
||||
}
|
||||
|
||||
/* How to get the pretty printable name of a character. */
|
||||
static char rep_buffer[30];
|
||||
|
||||
/* Return the pretty printable name of a single character. */
|
||||
char *
|
||||
pretty_keyname (key)
|
||||
unsigned char key;
|
||||
{
|
||||
static char rep_buffer[30];
|
||||
char *rep;
|
||||
|
||||
if (Meta_p (key))
|
||||
@ -642,7 +745,11 @@ pretty_keyname (key)
|
||||
|
||||
rep = pretty_keyname (UnMeta (key));
|
||||
|
||||
#if defined (INFOKEY)
|
||||
sprintf (temp, "M-%s", rep);
|
||||
#else /* !INFOKEY */
|
||||
sprintf (temp, "ESC %s", rep);
|
||||
#endif /* !INFOKEY */
|
||||
strcpy (rep_buffer, temp);
|
||||
rep = rep_buffer;
|
||||
}
|
||||
@ -675,57 +782,269 @@ pretty_keyname (key)
|
||||
return (rep);
|
||||
}
|
||||
|
||||
/* Return the pretty printable string which represents KEYSEQ. */
|
||||
|
||||
static void pretty_keyseq_internal ();
|
||||
|
||||
char *
|
||||
pretty_keyseq (keyseq)
|
||||
char *keyseq;
|
||||
{
|
||||
static char keyseq_rep[200];
|
||||
|
||||
keyseq_rep[0] = '\0';
|
||||
if (*keyseq)
|
||||
pretty_keyseq_internal (keyseq, keyseq_rep);
|
||||
return (keyseq_rep);
|
||||
}
|
||||
|
||||
static void
|
||||
pretty_keyseq_internal (keyseq, rep)
|
||||
char *keyseq, *rep;
|
||||
{
|
||||
if (term_kP && strncmp(keyseq, term_kP, strlen(term_kP)) == 0)
|
||||
{
|
||||
strcpy(rep, "PgUp");
|
||||
keyseq += strlen(term_kP);
|
||||
}
|
||||
else if (term_kN && strncmp(keyseq, term_kN, strlen(term_kN)) == 0)
|
||||
{
|
||||
strcpy(rep, "PgDn");
|
||||
keyseq += strlen(term_kN);
|
||||
}
|
||||
#if defined(INFOKEY)
|
||||
else if (term_kh && strncmp(keyseq, term_kh, strlen(term_kh)) == 0)
|
||||
{
|
||||
strcpy(rep, "Home");
|
||||
keyseq += strlen(term_kh);
|
||||
}
|
||||
else if (term_ke && strncmp(keyseq, term_ke, strlen(term_ke)) == 0)
|
||||
{
|
||||
strcpy(rep, "End");
|
||||
keyseq += strlen(term_ke);
|
||||
}
|
||||
else if (term_ki && strncmp(keyseq, term_ki, strlen(term_ki)) == 0)
|
||||
{
|
||||
strcpy(rep, "INS");
|
||||
keyseq += strlen(term_ki);
|
||||
}
|
||||
else if (term_kx && strncmp(keyseq, term_kx, strlen(term_kx)) == 0)
|
||||
{
|
||||
strcpy(rep, "DEL");
|
||||
keyseq += strlen(term_kx);
|
||||
}
|
||||
#endif /* INFOKEY */
|
||||
else if (term_ku && strncmp(keyseq, term_ku, strlen(term_ku)) == 0)
|
||||
{
|
||||
strcpy(rep, "Up");
|
||||
keyseq += strlen(term_ku);
|
||||
}
|
||||
else if (term_kd && strncmp(keyseq, term_kd, strlen(term_kd)) == 0)
|
||||
{
|
||||
strcpy(rep, "Down");
|
||||
keyseq += strlen(term_kd);
|
||||
}
|
||||
else if (term_kl && strncmp(keyseq, term_kl, strlen(term_kl)) == 0)
|
||||
{
|
||||
strcpy(rep, "Left");
|
||||
keyseq += strlen(term_kl);
|
||||
}
|
||||
else if (term_kr && strncmp(keyseq, term_kr, strlen(term_kr)) == 0)
|
||||
{
|
||||
strcpy(rep, "Right");
|
||||
keyseq += strlen(term_kr);
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpy (rep, pretty_keyname (keyseq[0]));
|
||||
keyseq++;
|
||||
}
|
||||
if (*keyseq)
|
||||
{
|
||||
strcat (rep, " ");
|
||||
pretty_keyseq_internal (keyseq, rep + strlen(rep));
|
||||
}
|
||||
}
|
||||
|
||||
/* Return a pointer to the last character in s that is found in f. */
|
||||
static char *
|
||||
strrpbrk (s, f)
|
||||
const char *s, *f;
|
||||
{
|
||||
register const char *e = s + strlen(s);
|
||||
register const char *t;
|
||||
|
||||
while (e-- != s)
|
||||
{
|
||||
for (t = f; *t; t++)
|
||||
if (*e == *t)
|
||||
return (char *)e;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* Replace the names of functions with the key that invokes them. */
|
||||
char *
|
||||
replace_in_documentation (string)
|
||||
replace_in_documentation (string, help_is_only_window_p)
|
||||
char *string;
|
||||
int help_is_only_window_p;
|
||||
{
|
||||
unsigned reslen = strlen (string);
|
||||
register int i, start, next;
|
||||
static char *result = (char *)NULL;
|
||||
|
||||
maybe_free (result);
|
||||
result = (char *)xmalloc (1 + strlen (string));
|
||||
result = (char *)xmalloc (1 + reslen);
|
||||
|
||||
i = next = start = 0;
|
||||
|
||||
/* Skip to the beginning of a replaceable function. */
|
||||
for (i = start; string[i]; i++)
|
||||
{
|
||||
int j = i + 1;
|
||||
|
||||
/* Is this the start of a replaceable function name? */
|
||||
if (string[i] == '\\' && string[i + 1] == '[')
|
||||
{
|
||||
char *fun_name, *rep;
|
||||
VFunction *function;
|
||||
if (string[i] == '\\')
|
||||
{
|
||||
char *fmt = NULL;
|
||||
unsigned min = 0;
|
||||
unsigned max = 0;
|
||||
|
||||
/* Copy in the old text. */
|
||||
strncpy (result + next, string + start, i - start);
|
||||
next += (i - start);
|
||||
start = i + 2;
|
||||
if(string[j] == '%')
|
||||
{
|
||||
if (string[++j] == '-')
|
||||
j++;
|
||||
if (isdigit(string[j]))
|
||||
{
|
||||
min = atoi(string + j);
|
||||
while (isdigit(string[j]))
|
||||
j++;
|
||||
if (string[j] == '.' && isdigit(string[j + 1]))
|
||||
{
|
||||
j += 1;
|
||||
max = atoi(string + j);
|
||||
while (isdigit(string[j]))
|
||||
j++;
|
||||
}
|
||||
fmt = (char *)xmalloc (j - i + 2);
|
||||
strncpy (fmt, string + i + 1, j - i);
|
||||
fmt[j - i - 1] = 's';
|
||||
fmt[j - i] = '\0';
|
||||
}
|
||||
else
|
||||
j = i + 1;
|
||||
}
|
||||
if (string[j] == '[')
|
||||
{
|
||||
unsigned arg = 0;
|
||||
char *argstr = NULL;
|
||||
char *rep_name, *fun_name, *rep;
|
||||
InfoCommand *command;
|
||||
char *repstr = NULL;
|
||||
unsigned replen;
|
||||
|
||||
/* Move to the end of the function name. */
|
||||
for (i = start; string[i] && (string[i] != ']'); i++);
|
||||
/* Copy in the old text. */
|
||||
strncpy (result + next, string + start, i - start);
|
||||
next += (i - start);
|
||||
start = j + 1;
|
||||
|
||||
fun_name = (char *)xmalloc (1 + i - start);
|
||||
strncpy (fun_name, string + start, i - start);
|
||||
fun_name[i - start] = '\0';
|
||||
/* Look for an optional numeric arg. */
|
||||
i = start;
|
||||
if (isdigit(string[i])
|
||||
|| (string[i] == '-' && isdigit(string[i + 1])) )
|
||||
{
|
||||
arg = atoi(string + i);
|
||||
if (string[i] == '-')
|
||||
i++;
|
||||
while (isdigit(string[i]))
|
||||
i++;
|
||||
}
|
||||
start = i;
|
||||
|
||||
/* Find a key which invokes this function in the info_keymap. */
|
||||
function = named_function (fun_name);
|
||||
/* Move to the end of the function name. */
|
||||
for (i = start; string[i] && (string[i] != ']'); i++);
|
||||
|
||||
/* If the internal documentation string fails, there is a
|
||||
serious problem with the associated command's documentation.
|
||||
We croak so that it can be fixed immediately. */
|
||||
if (!function)
|
||||
abort ();
|
||||
rep_name = (char *)xmalloc (1 + i - start);
|
||||
strncpy (rep_name, string + start, i - start);
|
||||
rep_name[i - start] = '\0';
|
||||
|
||||
rep = where_is (info_keymap, function);
|
||||
strcpy (result + next, rep);
|
||||
next = strlen (result);
|
||||
/* If we have only one window (because the window size was too
|
||||
small to split it), we have to quit help by going back one
|
||||
noew in the history list, not deleting the window. */
|
||||
if (strcmp (rep_name, "quit-help") == 0)
|
||||
fun_name = help_is_only_window_p ? "history-node"
|
||||
: "delete-window";
|
||||
else
|
||||
fun_name = rep_name;
|
||||
|
||||
start = i;
|
||||
if (string[i])
|
||||
start++;
|
||||
}
|
||||
/* Find a key which invokes this function in the info_keymap. */
|
||||
command = named_function (fun_name);
|
||||
|
||||
free (rep_name);
|
||||
|
||||
/* If the internal documentation string fails, there is a
|
||||
serious problem with the associated command's documentation.
|
||||
We croak so that it can be fixed immediately. */
|
||||
if (!command)
|
||||
abort ();
|
||||
|
||||
if (arg)
|
||||
{
|
||||
char *argrep, *p;
|
||||
|
||||
argrep = where_is (info_keymap, InfoCmd(info_add_digit_to_numeric_arg));
|
||||
p = argrep ? strrpbrk (argrep, "0123456789-") : NULL;
|
||||
if (p)
|
||||
{
|
||||
argstr = (char *)xmalloc (p - argrep + 21);
|
||||
strncpy (argstr, argrep, p - argrep);
|
||||
sprintf (argstr + (p - argrep), "%d", arg);
|
||||
}
|
||||
else
|
||||
command = NULL;
|
||||
}
|
||||
rep = command ? where_is (info_keymap, command) : NULL;
|
||||
if (!rep)
|
||||
rep = "N/A";
|
||||
replen = (argstr ? strlen (argstr) + 1 : 0) + strlen (rep);
|
||||
repstr = (char *)xmalloc (replen);
|
||||
repstr[0] = '\0';
|
||||
if (argstr)
|
||||
{
|
||||
strcat(repstr, argstr);
|
||||
strcat(repstr, " ");
|
||||
free (argstr);
|
||||
}
|
||||
strcat(repstr, rep);
|
||||
|
||||
if (fmt)
|
||||
{
|
||||
if (replen > max)
|
||||
replen = max;
|
||||
if (replen < min)
|
||||
replen = min;
|
||||
}
|
||||
if (next + replen > reslen)
|
||||
{
|
||||
reslen = next + replen + 1;
|
||||
result = (char *)xrealloc (result, reslen + 1);
|
||||
}
|
||||
|
||||
if (fmt)
|
||||
sprintf (result + next, fmt, repstr);
|
||||
else
|
||||
strcpy (result + next, repstr);
|
||||
|
||||
next = strlen (result);
|
||||
free (repstr);
|
||||
|
||||
start = i;
|
||||
if (string[i])
|
||||
start++;
|
||||
}
|
||||
|
||||
maybe_free (fmt);
|
||||
}
|
||||
}
|
||||
strcpy (result + next, string + start);
|
||||
return (result);
|
||||
@ -737,10 +1056,10 @@ static char *where_is_rep = (char *)NULL;
|
||||
static int where_is_rep_index = 0;
|
||||
static int where_is_rep_size = 0;
|
||||
|
||||
static char *
|
||||
where_is (map, function)
|
||||
char *
|
||||
where_is (map, cmd)
|
||||
Keymap map;
|
||||
VFunction *function;
|
||||
InfoCommand *cmd;
|
||||
{
|
||||
char *rep;
|
||||
|
||||
@ -748,35 +1067,53 @@ where_is (map, function)
|
||||
where_is_rep = (char *)xmalloc (where_is_rep_size = 100);
|
||||
where_is_rep_index = 0;
|
||||
|
||||
rep = where_is_internal (map, function);
|
||||
rep = where_is_internal (map, cmd);
|
||||
|
||||
/* If it couldn't be found, return "M-x Foo". */
|
||||
/* If it couldn't be found, return "M-x Foo" (or equivalent). */
|
||||
if (!rep)
|
||||
{
|
||||
char *name;
|
||||
|
||||
name = function_name (function);
|
||||
name = function_name (cmd);
|
||||
if (!name)
|
||||
return NULL; /* no such function */
|
||||
|
||||
if (name)
|
||||
sprintf (where_is_rep, "M-x %s", name);
|
||||
rep = where_is_internal (map, InfoCmd(info_execute_command));
|
||||
if (!rep)
|
||||
return ""; /* function exists but can't be got to by user */
|
||||
|
||||
sprintf (where_is_rep, "%s %s", rep, name);
|
||||
|
||||
rep = where_is_rep;
|
||||
}
|
||||
return (rep);
|
||||
}
|
||||
|
||||
/* Return the printed rep of FUNCTION as found in MAP, or NULL. */
|
||||
/* Return the printed rep of the keystrokes that invoke FUNCTION,
|
||||
as found in MAP, or NULL. */
|
||||
static char *
|
||||
where_is_internal (map, function)
|
||||
where_is_internal (map, cmd)
|
||||
Keymap map;
|
||||
VFunction *function;
|
||||
InfoCommand *cmd;
|
||||
{
|
||||
#if defined(INFOKEY)
|
||||
|
||||
register FUNCTION_KEYSEQ *k;
|
||||
|
||||
for (k = cmd->keys; k; k = k->next)
|
||||
if (k->map == map)
|
||||
return pretty_keyseq (k->keyseq);
|
||||
|
||||
return NULL;
|
||||
|
||||
#else /* !INFOKEY */
|
||||
|
||||
register int i;
|
||||
|
||||
/* If the function is directly invokable in MAP, return the representation
|
||||
of that keystroke. */
|
||||
for (i = 0; i < 256; i++)
|
||||
if ((map[i].type == ISFUNC) && map[i].function == function)
|
||||
if ((map[i].type == ISFUNC) && map[i].function == cmd)
|
||||
{
|
||||
sprintf (where_is_rep + where_is_rep_index, "%s", pretty_keyname (i));
|
||||
return (where_is_rep);
|
||||
@ -794,7 +1131,7 @@ where_is_internal (map, function)
|
||||
pretty_keyname (i));
|
||||
|
||||
where_is_rep_index = strlen (where_is_rep);
|
||||
rep = where_is_internal ((Keymap)map[i].function, function);
|
||||
rep = where_is_internal ((Keymap)map[i].function, cmd);
|
||||
|
||||
if (rep)
|
||||
return (where_is_rep);
|
||||
@ -804,6 +1141,8 @@ where_is_internal (map, function)
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
||||
#endif /* INFOKEY */
|
||||
}
|
||||
|
||||
extern char *read_function_name ();
|
||||
@ -823,23 +1162,23 @@ DECLARE_INFO_COMMAND (info_where_is,
|
||||
|
||||
if (*command_name)
|
||||
{
|
||||
VFunction *function;
|
||||
InfoCommand *command;
|
||||
|
||||
function = named_function (command_name);
|
||||
command = named_function (command_name);
|
||||
|
||||
if (function)
|
||||
if (command)
|
||||
{
|
||||
char *location;
|
||||
|
||||
location = where_is (active_window->keymap, function);
|
||||
location = where_is (active_window->keymap, command);
|
||||
|
||||
if (!location)
|
||||
if (!location || !location[0])
|
||||
{
|
||||
info_error (_("`%s' is not on any keys"), command_name);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (strncmp (location, "M-x ", 4) == 0)
|
||||
if (strstr (location, function_name (command)))
|
||||
window_message_in_echo_area
|
||||
(_("%s can only be invoked via %s."), command_name, location);
|
||||
else
|
||||
|
908
contrib/texinfo/info/infokey.c
Normal file
908
contrib/texinfo/info/infokey.c
Normal file
@ -0,0 +1,908 @@
|
||||
/* infokey.c -- compile ~/.infokey to ~/.info.
|
||||
$Id: infokey.c,v 1.5 2002/02/26 16:17:57 karl Exp $
|
||||
|
||||
Copyright (C) 1999, 2001, 02 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Written by Andrew Bettison <andrewb@zip.com.au>. */
|
||||
|
||||
#include "info.h"
|
||||
#include "infomap.h"
|
||||
#include "infokey.h"
|
||||
#include "key.h"
|
||||
#include "getopt.h"
|
||||
|
||||
static char *program_name = "infokey";
|
||||
|
||||
/* Non-zero means print version info only. */
|
||||
static int print_version_p = 0;
|
||||
|
||||
/* Non-zero means print a short description of the options. */
|
||||
static int print_help_p = 0;
|
||||
|
||||
/* String specifying the source file. This is set by the user on the
|
||||
command line, or a default is used. */
|
||||
static char *input_filename = (char *) NULL;
|
||||
|
||||
/* String specifying the name of the file to output to. This is
|
||||
set by the user on the command line, or a default is used. */
|
||||
static char *output_filename = (char *) NULL;
|
||||
|
||||
/* Structure describing the options that Infokey accepts. We pass this
|
||||
structure to getopt_long (). If you add or otherwise change this
|
||||
structure, you must also change the string which follows it. */
|
||||
static struct option long_options[] =
|
||||
{
|
||||
{"output", 1, 0, 'o'},
|
||||
{"help", 0, &print_help_p, 1},
|
||||
{"version", 0, &print_version_p, 1},
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
/* String describing the shorthand versions of the long options found above. */
|
||||
static char *short_options = "o:";
|
||||
|
||||
/* Structure for holding the compiled sections. */
|
||||
enum sect_e
|
||||
{
|
||||
info = 0,
|
||||
ea = 1,
|
||||
var = 2,
|
||||
};
|
||||
struct sect
|
||||
{
|
||||
unsigned int cur;
|
||||
unsigned char data[INFOKEY_MAX_SECTIONLEN];
|
||||
};
|
||||
|
||||
/* Some "forward" declarations. */
|
||||
static char *mkpath ();
|
||||
static int compile (), write_infokey_file ();
|
||||
static void syntax_error (), error_message (), suggest_help (), short_help ();
|
||||
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
/* Main Entry Point to the Infokey Program */
|
||||
/* */
|
||||
/* **************************************************************** */
|
||||
|
||||
int
|
||||
main (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
int getopt_long_index; /* Index returned by getopt_long (). */
|
||||
NODE *initial_node; /* First node loaded by Info. */
|
||||
|
||||
#ifdef HAVE_SETLOCALE
|
||||
/* Set locale via LC_ALL. */
|
||||
setlocale (LC_ALL, "");
|
||||
#endif
|
||||
|
||||
/* Set the text message domain. */
|
||||
bindtextdomain (PACKAGE, LOCALEDIR);
|
||||
textdomain (PACKAGE);
|
||||
|
||||
while (1)
|
||||
{
|
||||
int option_character;
|
||||
|
||||
option_character = getopt_long
|
||||
(argc, argv, short_options, long_options, &getopt_long_index);
|
||||
|
||||
/* getopt_long () returns EOF when there are no more long options. */
|
||||
if (option_character == EOF)
|
||||
break;
|
||||
|
||||
/* If this is a long option, then get the short version of it. */
|
||||
if (option_character == 0 && long_options[getopt_long_index].flag == 0)
|
||||
option_character = long_options[getopt_long_index].val;
|
||||
|
||||
/* Case on the option that we have received. */
|
||||
switch (option_character)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
|
||||
/* User is specifying the name of a file to output to. */
|
||||
case 'o':
|
||||
if (output_filename)
|
||||
free (output_filename);
|
||||
output_filename = xstrdup (optarg);
|
||||
break;
|
||||
|
||||
default:
|
||||
suggest_help ();
|
||||
xexit (1);
|
||||
}
|
||||
}
|
||||
|
||||
/* If the user specified --version, then show the version and exit. */
|
||||
if (print_version_p)
|
||||
{
|
||||
printf ("%s (GNU %s) %s\n", program_name, PACKAGE, VERSION);
|
||||
puts ("");
|
||||
printf (_ ("Copyright (C) %s Free Software Foundation, Inc.\n\
|
||||
There is NO warranty. You may redistribute this software\n\
|
||||
under the terms of the GNU General Public License.\n\
|
||||
For more information about these matters, see the files named COPYING.\n"),
|
||||
"1999");
|
||||
xexit (0);
|
||||
}
|
||||
|
||||
/* If the `--help' option was present, show the help and exit. */
|
||||
if (print_help_p)
|
||||
{
|
||||
short_help ();
|
||||
xexit (0);
|
||||
}
|
||||
|
||||
/* If there is one argument remaining, it is the name of the input
|
||||
file. */
|
||||
if (optind == argc - 1)
|
||||
{
|
||||
if (input_filename)
|
||||
free (input_filename);
|
||||
input_filename = xstrdup (argv[optind]);
|
||||
}
|
||||
else if (optind != argc)
|
||||
{
|
||||
error_message (0, _("incorrect number of arguments"));
|
||||
suggest_help ();
|
||||
xexit (1);
|
||||
}
|
||||
|
||||
/* Use default filenames where none given. */
|
||||
{
|
||||
char *homedir;
|
||||
|
||||
homedir = getenv ("HOME");
|
||||
#ifdef __MSDOS__
|
||||
if (!homedir)
|
||||
homedir = ".";
|
||||
#endif
|
||||
if (!input_filename)
|
||||
input_filename = mkpath (homedir, INFOKEY_SRCFILE);
|
||||
if (!output_filename)
|
||||
output_filename = mkpath (homedir, INFOKEY_FILE);
|
||||
}
|
||||
|
||||
{
|
||||
FILE *inf;
|
||||
FILE *outf;
|
||||
int write_error;
|
||||
static struct sect sections[3];
|
||||
|
||||
/* Open the input file. */
|
||||
inf = fopen (input_filename, "r");
|
||||
if (!inf)
|
||||
{
|
||||
error_message (errno, _("cannot open input file `%s'"), input_filename);
|
||||
xexit (1);
|
||||
}
|
||||
|
||||
/* Compile the input file to its verious sections, then write the
|
||||
section data to the output file. */
|
||||
|
||||
if (compile (inf, input_filename, sections))
|
||||
{
|
||||
/* Open the output file. */
|
||||
outf = fopen (output_filename, FOPEN_WBIN);
|
||||
if (!outf)
|
||||
{
|
||||
error_message (errno, _("cannot create output file `%s'"), output_filename);
|
||||
xexit (1);
|
||||
}
|
||||
|
||||
/* Write the contents of the output file and close it. If there is
|
||||
an error writing to the file, delete it and exit with a failure
|
||||
status. */
|
||||
write_error = 0;
|
||||
if (!write_infokey_file (outf, sections))
|
||||
{
|
||||
error_message (errno, _("error writing to `%s'"), output_filename);
|
||||
write_error = 1;
|
||||
}
|
||||
if (fclose (outf) == EOF)
|
||||
{
|
||||
error_message (errno, _("error closing output file `%s'"), output_filename);
|
||||
write_error = 1;
|
||||
}
|
||||
if (write_error)
|
||||
{
|
||||
unlink (output_filename);
|
||||
xexit (1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Close the input file. */
|
||||
fclose (inf);
|
||||
}
|
||||
|
||||
xexit (0);
|
||||
}
|
||||
|
||||
static char *
|
||||
mkpath (dir, file)
|
||||
const char *dir;
|
||||
const char *file;
|
||||
{
|
||||
char *p;
|
||||
|
||||
p = xmalloc (strlen (dir) + 1 + strlen (file) + 2);
|
||||
strcpy (p, dir);
|
||||
strcat (p, "/");
|
||||
strcat (p, file);
|
||||
return p;
|
||||
}
|
||||
|
||||
|
||||
/* Compilation - the real work.
|
||||
|
||||
Source file syntax
|
||||
------------------
|
||||
The source file is a line-based text file with the following
|
||||
structure:
|
||||
|
||||
# comments
|
||||
# more comments
|
||||
|
||||
#info
|
||||
u prev-line
|
||||
d next-line
|
||||
^a invalid # just beep
|
||||
\ku prev-line
|
||||
#stop
|
||||
\kd next-line
|
||||
q quit # of course!
|
||||
|
||||
#echo-area
|
||||
^a echo-area-beg-of-line
|
||||
^e echo-area-end-of-line
|
||||
\kr echo-area-forward
|
||||
\kl echo-area-backward
|
||||
\kh echo-area-beg-of-line
|
||||
\ke echo-area-end-of-line
|
||||
|
||||
#var
|
||||
scroll-step=1
|
||||
ISO-Latin=Off
|
||||
|
||||
Lines starting with '#' are comments, and are ignored. Blank
|
||||
lines are ignored. Each section is introduced by one of the
|
||||
following lines:
|
||||
|
||||
#info
|
||||
#echo-area
|
||||
#var
|
||||
|
||||
The sections may occur in any order. Each section may be
|
||||
omitted completely. If the 'info' section is the first in the
|
||||
file, its '#info' line may be omitted.
|
||||
|
||||
The 'info' and 'echo-area' sections
|
||||
-----------------------------------
|
||||
Each line in the 'info' or 'echo-area' sections has the
|
||||
following syntax:
|
||||
|
||||
key-sequence SPACE action-name [ SPACE [ # comment ] ] \n
|
||||
|
||||
Where SPACE is one or more white space characters excluding
|
||||
newline, "action-name" is the name of a GNU Info command,
|
||||
"comment" is any sequence of characters excluding newline, and
|
||||
"key-sequence" is a concatenation of one or more key definitions
|
||||
using the following syntax:
|
||||
|
||||
1. A carat ^ followed by one character indicates a single
|
||||
control character;
|
||||
|
||||
2. A backslash \ followed by one, two, or three octal
|
||||
digits indicates a single character having that ASCII
|
||||
code;
|
||||
|
||||
3. \n indicates a single NEWLINE;
|
||||
\e indicates a single ESC;
|
||||
\r indicates a single CR;
|
||||
\t indicates a single TAB;
|
||||
\b indicates a single BACKSPACE;
|
||||
|
||||
4. \ku indicates the Up Arrow key;
|
||||
\kd indicates the Down Arrow key;
|
||||
\kl indicates the Left Arrow key;
|
||||
\kr indicates the Right Arrow key;
|
||||
\kP indicates the Page Up (PRIOR) key;
|
||||
\kN indicates the Page Down (NEXT) key;
|
||||
\kh indicates the Home key;
|
||||
\ke indicates the End key;
|
||||
\kx indicates the DEL key;
|
||||
\k followed by any other character indicates a single
|
||||
control-K, and the following character is interpreted
|
||||
as in rules 1, 2, 3, 5 and 6.
|
||||
|
||||
5. \m followed by any sequence defined in rules 1, 2, 3, 4
|
||||
or 6 indicates the "Meta" modification of that key.
|
||||
|
||||
6. A backslash \ followed by any character not described
|
||||
above indicates that character itself. In particular:
|
||||
\\ indicates a single backslash \,
|
||||
\ (backslash-space) indicates a single space,
|
||||
\^ indicates a single caret ^,
|
||||
|
||||
If the following line:
|
||||
|
||||
#stop
|
||||
|
||||
occurs anywhere in an 'info' or 'echo-area' section, that
|
||||
indicates to GNU Info to suppress all of its default key
|
||||
bindings in that context.
|
||||
|
||||
The 'var' section
|
||||
-----------------
|
||||
Each line in the 'var' section has the following syntax:
|
||||
|
||||
variable-name = value \n
|
||||
|
||||
Where "variable-name" is the name of a GNU Info variable and
|
||||
"value" is the value that GNU Info will assign to that variable
|
||||
when commencing execution. There must be no white space in the
|
||||
variable name, nor between the variable name and the '='. All
|
||||
characters immediately following the '=', up to but not
|
||||
including the terminating newline, are considered to be the
|
||||
value that will be assigned. In other words, white space
|
||||
following the '=' is not ignored.
|
||||
*/
|
||||
|
||||
static int add_to_section (), lookup_action ();
|
||||
|
||||
/* Compile the input file into its various sections. Return true if no
|
||||
error was encountered.
|
||||
*/
|
||||
static int
|
||||
compile (fp, filename, sections)
|
||||
FILE *fp;
|
||||
const char *filename;
|
||||
struct sect sections[];
|
||||
{
|
||||
int error = 0;
|
||||
char rescan = 0;
|
||||
unsigned int lnum = 0;
|
||||
int c;
|
||||
|
||||
/* This parser is a true state machine, with no sneaky fetching
|
||||
of input characters inside the main loop. In other words, all
|
||||
state is fully represented by the following variables:
|
||||
*/
|
||||
enum
|
||||
{
|
||||
start_of_line,
|
||||
start_of_comment,
|
||||
in_line_comment,
|
||||
in_trailing_comment,
|
||||
get_keyseq,
|
||||
got_keyseq,
|
||||
get_action,
|
||||
got_action,
|
||||
get_varname,
|
||||
got_varname,
|
||||
get_equals,
|
||||
got_equals,
|
||||
get_value,
|
||||
}
|
||||
state = start_of_line;
|
||||
enum sect_e section = info;
|
||||
enum
|
||||
{
|
||||
normal,
|
||||
slosh,
|
||||
control,
|
||||
octal,
|
||||
special_key,
|
||||
}
|
||||
seqstate; /* used if state == get_keyseq */
|
||||
char meta = 0;
|
||||
char ocnt; /* used if state == get_keyseq && seqstate == octal */
|
||||
|
||||
/* Data is accumulated in the following variables. The code
|
||||
avoids overflowing these strings, and throws an error
|
||||
where appropriate if a string limit is exceeded. These string
|
||||
lengths are arbitrary (and should be large enough) and their
|
||||
lengths are not hard-coded anywhere else, so increasing them
|
||||
here will not break anything. */
|
||||
char oval;
|
||||
char comment[10];
|
||||
unsigned int clen;
|
||||
char seq[20];
|
||||
unsigned int slen;
|
||||
char act[80];
|
||||
unsigned int alen;
|
||||
char varn[80];
|
||||
unsigned int varlen;
|
||||
char val[80];
|
||||
unsigned int vallen;
|
||||
|
||||
#define To_seq(c) \
|
||||
do { \
|
||||
if (slen < sizeof seq) \
|
||||
seq[slen++] = meta ? Meta(c) : (c); \
|
||||
else \
|
||||
{ \
|
||||
syntax_error(filename, lnum, _("key sequence too long")); \
|
||||
error = 1; \
|
||||
} \
|
||||
meta = 0; \
|
||||
} while (0)
|
||||
|
||||
sections[info].cur = 1;
|
||||
sections[info].data[0] = 0;
|
||||
sections[ea].cur = 1;
|
||||
sections[ea].data[0] = 0;
|
||||
sections[var].cur = 0;
|
||||
|
||||
while (!error && (rescan || (c = fgetc (fp)) != EOF))
|
||||
{
|
||||
rescan = 0;
|
||||
switch (state)
|
||||
{
|
||||
case start_of_line:
|
||||
lnum++;
|
||||
if (c == '#')
|
||||
state = start_of_comment;
|
||||
else if (c != '\n')
|
||||
{
|
||||
switch (section)
|
||||
{
|
||||
case info:
|
||||
case ea:
|
||||
state = get_keyseq;
|
||||
seqstate = normal;
|
||||
slen = 0;
|
||||
break;
|
||||
case var:
|
||||
state = get_varname;
|
||||
varlen = 0;
|
||||
break;
|
||||
}
|
||||
rescan = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case start_of_comment:
|
||||
clen = 0;
|
||||
state = in_line_comment;
|
||||
/* fall through */
|
||||
case in_line_comment:
|
||||
if (c == '\n')
|
||||
{
|
||||
state = start_of_line;
|
||||
comment[clen] = '\0';
|
||||
if (strcmp (comment, "info") == 0)
|
||||
section = info;
|
||||
else if (strcmp (comment, "echo-area") == 0)
|
||||
section = ea;
|
||||
else if (strcmp (comment, "var") == 0)
|
||||
section = var;
|
||||
else if (strcmp (comment, "stop") == 0
|
||||
&& (section == info || section == ea))
|
||||
sections[section].data[0] = 1;
|
||||
}
|
||||
else if (clen < sizeof comment - 1)
|
||||
comment[clen++] = c;
|
||||
break;
|
||||
|
||||
case in_trailing_comment:
|
||||
if (c == '\n')
|
||||
state = start_of_line;
|
||||
break;
|
||||
|
||||
case get_keyseq:
|
||||
switch (seqstate)
|
||||
{
|
||||
case normal:
|
||||
if (c == '\n' || isspace (c))
|
||||
{
|
||||
state = got_keyseq;
|
||||
rescan = 1;
|
||||
if (slen == 0)
|
||||
{
|
||||
syntax_error (filename, lnum, _("missing key sequence"));
|
||||
error = 1;
|
||||
}
|
||||
}
|
||||
else if (c == '\\')
|
||||
seqstate = slosh;
|
||||
else if (c == '^')
|
||||
seqstate = control;
|
||||
else
|
||||
To_seq (c);
|
||||
break;
|
||||
|
||||
case slosh:
|
||||
switch (c)
|
||||
{
|
||||
case '0': case '1': case '2': case '3':
|
||||
case '4': case '5': case '6': case '7':
|
||||
seqstate = octal;
|
||||
oval = c - '0';
|
||||
ocnt = 1;
|
||||
break;
|
||||
case 'b':
|
||||
To_seq ('\b');
|
||||
seqstate = normal;
|
||||
break;
|
||||
case 'e':
|
||||
To_seq ('\033');
|
||||
seqstate = normal;
|
||||
break;
|
||||
case 'n':
|
||||
To_seq ('\n');
|
||||
seqstate = normal;
|
||||
break;
|
||||
case 'r':
|
||||
To_seq ('\r');
|
||||
seqstate = normal;
|
||||
break;
|
||||
case 't':
|
||||
To_seq ('\t');
|
||||
seqstate = normal;
|
||||
break;
|
||||
case 'm':
|
||||
meta = 1;
|
||||
seqstate = normal;
|
||||
break;
|
||||
case 'k':
|
||||
seqstate = special_key;
|
||||
break;
|
||||
default:
|
||||
/* Backslash followed by any other char
|
||||
just means that char. */
|
||||
To_seq (c);
|
||||
seqstate = normal;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case octal:
|
||||
switch (c)
|
||||
{
|
||||
case '0': case '1': case '2': case '3':
|
||||
case '4': case '5': case '6': case '7':
|
||||
if (++ocnt <= 3)
|
||||
oval = oval * 8 + c - '0';
|
||||
if (ocnt == 3)
|
||||
seqstate = normal;
|
||||
break;
|
||||
default:
|
||||
ocnt = 4;
|
||||
seqstate = normal;
|
||||
rescan = 1;
|
||||
break;
|
||||
}
|
||||
if (seqstate != octal)
|
||||
{
|
||||
if (oval)
|
||||
To_seq (oval);
|
||||
else
|
||||
{
|
||||
syntax_error (filename, lnum, _("NUL character (\\000) not permitted"));
|
||||
error = 1;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case special_key:
|
||||
To_seq (SK_ESCAPE);
|
||||
switch (c)
|
||||
{
|
||||
case 'u': To_seq (SK_UP_ARROW); break;
|
||||
case 'd': To_seq (SK_DOWN_ARROW); break;
|
||||
case 'r': To_seq (SK_RIGHT_ARROW); break;
|
||||
case 'l': To_seq (SK_LEFT_ARROW); break;
|
||||
case 'U': To_seq (SK_PAGE_UP); break;
|
||||
case 'D': To_seq (SK_PAGE_DOWN); break;
|
||||
case 'h': To_seq (SK_HOME); break;
|
||||
case 'e': To_seq (SK_END); break;
|
||||
case 'x': To_seq (SK_DELETE); break;
|
||||
default: To_seq (SK_LITERAL); rescan = 1; break;
|
||||
}
|
||||
seqstate = normal;
|
||||
break;
|
||||
|
||||
case control:
|
||||
if (CONTROL (c))
|
||||
To_seq (CONTROL (c));
|
||||
else
|
||||
{
|
||||
syntax_error (filename, lnum, _("NUL character (^%c) not permitted"), c);
|
||||
error = 1;
|
||||
}
|
||||
seqstate = normal;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case got_keyseq:
|
||||
if (isspace (c) && c != '\n')
|
||||
break;
|
||||
state = get_action;
|
||||
alen = 0;
|
||||
/* fall through */
|
||||
case get_action:
|
||||
if (c == '\n' || isspace (c))
|
||||
{
|
||||
int a;
|
||||
|
||||
state = got_action;
|
||||
rescan = 1;
|
||||
if (alen == 0)
|
||||
{
|
||||
syntax_error (filename, lnum, _("missing action name"), c);
|
||||
error = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
act[alen] = '\0';
|
||||
a = lookup_action (act);
|
||||
if (a != -1)
|
||||
{
|
||||
char av = a;
|
||||
|
||||
if (!(add_to_section (§ions[section], seq, slen)
|
||||
&& add_to_section (§ions[section], "", 1)
|
||||
&& add_to_section (§ions[section], &av, 1)))
|
||||
{
|
||||
syntax_error (filename, lnum, _("section too long"));
|
||||
error = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
syntax_error (filename, lnum, _("unknown action `%s'"), act);
|
||||
error = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (alen < sizeof act - 1)
|
||||
act[alen++] = c;
|
||||
else
|
||||
{
|
||||
syntax_error (filename, lnum, _("action name too long"));
|
||||
error = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case got_action:
|
||||
if (c == '#')
|
||||
state = in_trailing_comment;
|
||||
else if (c == '\n')
|
||||
state = start_of_line;
|
||||
else if (!isspace (c))
|
||||
{
|
||||
syntax_error (filename, lnum, _("extra characters following action `%s'"), act);
|
||||
error = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case get_varname:
|
||||
if (c == '=')
|
||||
{
|
||||
if (varlen == 0)
|
||||
{
|
||||
syntax_error (filename, lnum, _("missing variable name"));
|
||||
error = 1;
|
||||
}
|
||||
state = get_value;
|
||||
vallen = 0;
|
||||
}
|
||||
else if (c == '\n' || isspace (c))
|
||||
{
|
||||
syntax_error (filename, lnum, _("missing `=' immediately after variable name"));
|
||||
error = 1;
|
||||
}
|
||||
else if (varlen < sizeof varn)
|
||||
varn[varlen++] = c;
|
||||
else
|
||||
{
|
||||
syntax_error (filename, lnum, _("variable name too long"));
|
||||
error = 1;
|
||||
}
|
||||
break;
|
||||
|
||||
case get_value:
|
||||
if (c == '\n')
|
||||
{
|
||||
state = start_of_line;
|
||||
if (!(add_to_section (§ions[section], varn, varlen)
|
||||
&& add_to_section (§ions[section], "", 1)
|
||||
&& add_to_section (§ions[section], val, vallen)
|
||||
&& add_to_section (§ions[section], "", 1)))
|
||||
{
|
||||
syntax_error (filename, lnum, _("section too long"));
|
||||
error = 1;
|
||||
}
|
||||
}
|
||||
else if (vallen < sizeof val)
|
||||
val[vallen++] = c;
|
||||
else
|
||||
{
|
||||
syntax_error (filename, lnum, _("value too long"));
|
||||
error = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#undef To_seq
|
||||
|
||||
return !error;
|
||||
}
|
||||
|
||||
/* Add some characters to a section's data. Return true if all the
|
||||
characters fit, or false if the section's size limit was exceeded.
|
||||
*/
|
||||
static int
|
||||
add_to_section (s, str, len)
|
||||
struct sect *s;
|
||||
const char *str;
|
||||
unsigned int len;
|
||||
{
|
||||
if (s->cur + len > sizeof s->data)
|
||||
return 0;
|
||||
strncpy (s->data + s->cur, str, len);
|
||||
s->cur += len;
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* Translate from an action name to its numeric code. This uses the
|
||||
auto-generated array in key.c.
|
||||
*/
|
||||
static int
|
||||
lookup_action (actname)
|
||||
const char *actname;
|
||||
{
|
||||
int i;
|
||||
|
||||
if (strcmp ("invalid", actname) == 0)
|
||||
return A_INVALID;
|
||||
for (i = 0; function_key_array[i].name != NULL; i++)
|
||||
if (strcmp (function_key_array[i].name, actname) == 0)
|
||||
return function_key_array[i].code;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Put an integer to an infokey file.
|
||||
Integers are stored as two bytes, low order first,
|
||||
in radix INFOKEY_RADIX.
|
||||
*/
|
||||
static int
|
||||
putint (i, fp)
|
||||
int i;
|
||||
FILE *fp;
|
||||
{
|
||||
return fputc (i % INFOKEY_RADIX, fp) != EOF
|
||||
&& fputc ((i / INFOKEY_RADIX) % INFOKEY_RADIX, fp) != EOF;
|
||||
}
|
||||
|
||||
/* Write an entire section to an infokey file. If the section is
|
||||
empty, simply omit it.
|
||||
*/
|
||||
static int
|
||||
putsect (s, code, fp)
|
||||
struct sect *s;
|
||||
int code;
|
||||
FILE *fp;
|
||||
{
|
||||
if (s->cur == 0)
|
||||
return 1;
|
||||
return fputc (code, fp) != EOF
|
||||
&& putint (s->cur, fp)
|
||||
&& fwrite (s->data, s->cur, 1, fp) == 1;
|
||||
}
|
||||
|
||||
/* Write an entire infokey file, given an array containing its sections.
|
||||
*/
|
||||
static int
|
||||
write_infokey_file (fp, sections)
|
||||
FILE *fp;
|
||||
struct sect sections[];
|
||||
{
|
||||
/* Get rid of sections with no effect. */
|
||||
if (sections[info].cur == 1 && sections[info].data[0] == 0)
|
||||
sections[info].cur = 0;
|
||||
if (sections[ea].cur == 1 && sections[ea].data[0] == 0)
|
||||
sections[ea].cur = 0;
|
||||
|
||||
/* Write all parts of the file out in order (no lseeks),
|
||||
checking for errors all the way. */
|
||||
return fputc (INFOKEY_MAGIC_S0, fp) != EOF
|
||||
&& fputc (INFOKEY_MAGIC_S1, fp) != EOF
|
||||
&& fputc (INFOKEY_MAGIC_S2, fp) != EOF
|
||||
&& fputc (INFOKEY_MAGIC_S3, fp) != EOF
|
||||
&& fputs (VERSION, fp) != EOF
|
||||
&& fputc ('\0', fp) != EOF
|
||||
&& putsect (§ions[info], INFOKEY_SECTION_INFO, fp)
|
||||
&& putsect (§ions[ea], INFOKEY_SECTION_EA, fp)
|
||||
&& putsect (§ions[var], INFOKEY_SECTION_VAR, fp)
|
||||
&& fputc (INFOKEY_MAGIC_E0, fp) != EOF
|
||||
&& fputc (INFOKEY_MAGIC_E1, fp) != EOF
|
||||
&& fputc (INFOKEY_MAGIC_E2, fp) != EOF
|
||||
&& fputc (INFOKEY_MAGIC_E3, fp) != EOF;
|
||||
}
|
||||
|
||||
|
||||
/* Error handling. */
|
||||
|
||||
/* Give the user a "syntax error" message in the form
|
||||
progname: "filename", line N: message
|
||||
*/
|
||||
static void
|
||||
error_message (error_code, fmt, a1, a2, a3, a4)
|
||||
int error_code;
|
||||
const char *fmt;
|
||||
const void *a1, *a2, *a3, *a4;
|
||||
{
|
||||
fprintf (stderr, "%s: ", program_name);
|
||||
fprintf (stderr, fmt, a1, a2, a3, a4);
|
||||
if (error_code)
|
||||
fprintf (stderr, " - %s", strerror (error_code));
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
|
||||
/* Give the user a generic error message in the form
|
||||
progname: message
|
||||
*/
|
||||
static void
|
||||
syntax_error (filename, linenum, fmt, a1, a2, a3, a4)
|
||||
const char *filename;
|
||||
unsigned int linenum;
|
||||
const char *fmt;
|
||||
const void *a1, *a2, *a3, *a4;
|
||||
{
|
||||
fprintf (stderr, "%s: ", program_name);
|
||||
fprintf (stderr, _("\"%s\", line %u: "), filename, linenum);
|
||||
fprintf (stderr, fmt, a1, a2, a3, a4);
|
||||
fprintf (stderr, "\n");
|
||||
}
|
||||
|
||||
/* Produce a gentle rtfm. */
|
||||
static void
|
||||
suggest_help ()
|
||||
{
|
||||
fprintf (stderr, _("Try --help for more information.\n"));
|
||||
}
|
||||
|
||||
/* Produce a scaled down description of the available options to Info. */
|
||||
static void
|
||||
short_help ()
|
||||
{
|
||||
printf (_ ("\
|
||||
Usage: %s [OPTION]... [INPUT-FILE]\n\
|
||||
\n\
|
||||
Compile infokey source file to infokey file. Reads INPUT-FILE (default\n\
|
||||
$HOME/.infokey) and writes compiled key file to (by default) $HOME/.info.\n\
|
||||
\n\
|
||||
Options:\n\
|
||||
--output FILE output to FILE instead of $HOME/.info\n\
|
||||
--help display this help and exit.\n\
|
||||
--version display version information and exit.\n\
|
||||
\n\
|
||||
Email bug reports to bug-texinfo@gnu.org,\n\
|
||||
general questions and discussion to help-texinfo@gnu.org.\n\
|
||||
"),
|
||||
program_name
|
||||
);
|
||||
xexit (0);
|
||||
}
|
128
contrib/texinfo/info/infokey.h
Normal file
128
contrib/texinfo/info/infokey.h
Normal file
@ -0,0 +1,128 @@
|
||||
/* infokey.h -- Custom keystroke definition support.
|
||||
$Id: $
|
||||
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Written by Andrew Bettison <andrewb@zip.com.au>.
|
||||
|
||||
This design was derived from the "lesskey" system in less 3.4.0. by
|
||||
Mark Nudelman.
|
||||
|
||||
The following terminology is confusing:
|
||||
source file = $HOME/.infokey
|
||||
infokey file = $HOME/.info
|
||||
Oh, well.
|
||||
*/
|
||||
|
||||
|
||||
/* Default source file, where user writes text definitions to be
|
||||
compiled to the infokey file. MS-DOS doesn't allow leading
|
||||
dots in file names. */
|
||||
#ifdef __MSDOS__
|
||||
#define INFOKEY_SRCFILE "_infokey"
|
||||
#else
|
||||
#define INFOKEY_SRCFILE ".infokey"
|
||||
#endif
|
||||
|
||||
/* Default "infokey file", where compiled user defs are kept and
|
||||
read by Info. MS-DOS doesn't allow leading dots in file names. */
|
||||
#ifdef __MSDOS__
|
||||
#define INFOKEY_FILE "_info"
|
||||
#else
|
||||
#define INFOKEY_FILE ".info"
|
||||
#endif
|
||||
|
||||
/*
|
||||
Format of entire infokey file:
|
||||
|
||||
4 bytes magic number S
|
||||
X bytes version string
|
||||
1 byte '\0' terminator
|
||||
|
||||
any number of sections:
|
||||
1 byte section id
|
||||
2 bytes section length (N)
|
||||
N bytes section definitions: format depends on section
|
||||
|
||||
4 bytes magic number E
|
||||
|
||||
Format of INFO and EA sections:
|
||||
|
||||
1 byte flag: 1 == suppress default key bindings
|
||||
Repeat:
|
||||
X bytes key sequence
|
||||
1 byte '\0' terminator
|
||||
1 byte action code (A_xxx)
|
||||
|
||||
Format of VAR section:
|
||||
|
||||
Repeat:
|
||||
X bytes variable name
|
||||
1 byte '\0' terminator
|
||||
Y bytes value
|
||||
1 byte '\0' terminator
|
||||
|
||||
*/
|
||||
|
||||
#define INFOKEY_NMAGIC 8
|
||||
|
||||
#define INFOKEY_MAGIC_S0 '\001'
|
||||
#define INFOKEY_MAGIC_S1 'I'
|
||||
#define INFOKEY_MAGIC_S2 'n'
|
||||
#define INFOKEY_MAGIC_S3 'f'
|
||||
|
||||
#define INFOKEY_SECTION_INFO 'i'
|
||||
#define INFOKEY_SECTION_EA 'e'
|
||||
#define INFOKEY_SECTION_VAR 'v'
|
||||
|
||||
#define INFOKEY_MAGIC_E0 'A'
|
||||
#define INFOKEY_MAGIC_E1 'l'
|
||||
#define INFOKEY_MAGIC_E2 'f'
|
||||
#define INFOKEY_MAGIC_E3 'n'
|
||||
|
||||
#define INFOKEY_RADIX 64
|
||||
#define INFOKEY_MAX_SECTIONLEN 500
|
||||
#define INFOKEY_MAX_DEFLEN 16
|
||||
|
||||
#define A_MAX_COMMAND 120
|
||||
#define A_INVALID 121
|
||||
|
||||
/* Character transformations (independent of info's own) */
|
||||
|
||||
#define CONTROL(c) ((c) & 0x1f)
|
||||
#define ISCONTROL(c) (((c) & ~0x1f) == 0)
|
||||
#define META(c) ((c) | 0x80)
|
||||
#define UNMETA(c) ((c) & ~0x80)
|
||||
#define ISMETA(c) (((c) & 0x80) != 0)
|
||||
|
||||
/* Special keys (keys which output different strings on different terminals) */
|
||||
|
||||
#define SK_ESCAPE CONTROL('k')
|
||||
#define SK_RIGHT_ARROW 1
|
||||
#define SK_LEFT_ARROW 2
|
||||
#define SK_UP_ARROW 3
|
||||
#define SK_DOWN_ARROW 4
|
||||
#define SK_PAGE_UP 5
|
||||
#define SK_PAGE_DOWN 6
|
||||
#define SK_HOME 7
|
||||
#define SK_END 8
|
||||
#define SK_DELETE 9
|
||||
#define SK_INSERT 10
|
||||
#define SK_CTL_LEFT_ARROW 11
|
||||
#define SK_CTL_RIGHT_ARROW 12
|
||||
#define SK_CTL_DELETE 13
|
||||
#define SK_LITERAL 40
|
@ -1,9 +1,7 @@
|
||||
/* infomap.h -- Description of a keymap in Info and related functions. */
|
||||
/* infomap.h -- description of a keymap in Info and related functions.
|
||||
$Id: infomap.h,v 1.6 2001/11/16 23:16:59 karl Exp $
|
||||
|
||||
/* This file is part of GNU Info, a program for reading online documentation
|
||||
stored in Info format.
|
||||
|
||||
Copyright (C) 1993 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -52,9 +50,10 @@
|
||||
FUNCTION is the address of a function to run, or the
|
||||
address of a keymap to indirect through.
|
||||
TYPE says which kind of thing FUNCTION is. */
|
||||
typedef struct {
|
||||
typedef struct keymap_entry
|
||||
{
|
||||
char type;
|
||||
VFunction *function;
|
||||
InfoCommand *function;
|
||||
} KEYMAP_ENTRY;
|
||||
|
||||
typedef KEYMAP_ENTRY *Keymap;
|
||||
|
146
contrib/texinfo/info/key.c
Normal file
146
contrib/texinfo/info/key.c
Normal file
@ -0,0 +1,146 @@
|
||||
/* key.c -- Generated array containing function names.
|
||||
|
||||
This file was automatically made from various source files with the
|
||||
command "./makedoc". DO NOT EDIT THIS FILE, only "./makedoc.c".
|
||||
|
||||
Source files groveled to make this file include:
|
||||
|
||||
./session.c
|
||||
./echo-area.c
|
||||
./infodoc.c
|
||||
./m-x.c
|
||||
./indices.c
|
||||
./nodemenu.c
|
||||
./footnotes.c
|
||||
./variables.c
|
||||
|
||||
An entry in the array FUNCTION_KEY_ARRAY is made for each command
|
||||
found in the above files; each entry consists of
|
||||
a string which is the user-visible name of the function. */
|
||||
|
||||
#include "key.h"
|
||||
#include "funs.h"
|
||||
|
||||
FUNCTION_KEY function_key_array[] = {
|
||||
|
||||
/* Commands found in "./session.c". */
|
||||
{ "next-line", A_info_next_line },
|
||||
{ "prev-line", A_info_prev_line },
|
||||
{ "end-of-line", A_info_end_of_line },
|
||||
{ "beginning-of-line", A_info_beginning_of_line },
|
||||
{ "forward-char", A_info_forward_char },
|
||||
{ "backward-char", A_info_backward_char },
|
||||
{ "forward-word", A_info_forward_word },
|
||||
{ "backward-word", A_info_backward_word },
|
||||
{ "global-next-node", A_info_global_next_node },
|
||||
{ "global-prev-node", A_info_global_prev_node },
|
||||
{ "scroll-forward", A_info_scroll_forward },
|
||||
{ "scroll-forward-set-window", A_info_scroll_forward_set_window },
|
||||
{ "scroll-forward-page-only", A_info_scroll_forward_page_only },
|
||||
{ "scroll-forward-page-only-set-window", A_info_scroll_forward_page_only_set_window },
|
||||
{ "scroll-backward", A_info_scroll_backward },
|
||||
{ "scroll-backward-set-window", A_info_scroll_backward_set_window },
|
||||
{ "scroll-backward-page-only", A_info_scroll_backward_page_only },
|
||||
{ "scroll-backward-page-only-set-window", A_info_scroll_backward_page_only_set_window },
|
||||
{ "beginning-of-node", A_info_beginning_of_node },
|
||||
{ "end-of-node", A_info_end_of_node },
|
||||
{ "down-line", A_info_down_line },
|
||||
{ "up-line", A_info_up_line },
|
||||
{ "scroll-half-screen-down", A_info_scroll_half_screen_down },
|
||||
{ "scroll-half-screen-up", A_info_scroll_half_screen_up },
|
||||
{ "next-window", A_info_next_window },
|
||||
{ "prev-window", A_info_prev_window },
|
||||
{ "split-window", A_info_split_window },
|
||||
{ "delete-window", A_info_delete_window },
|
||||
{ "keep-one-window", A_info_keep_one_window },
|
||||
{ "scroll-other-window", A_info_scroll_other_window },
|
||||
{ "scroll-other-window-backward", A_info_scroll_other_window_backward },
|
||||
{ "grow-window", A_info_grow_window },
|
||||
{ "tile-windows", A_info_tile_windows },
|
||||
{ "toggle-wrap", A_info_toggle_wrap },
|
||||
{ "next-node", A_info_next_node },
|
||||
{ "prev-node", A_info_prev_node },
|
||||
{ "up-node", A_info_up_node },
|
||||
{ "last-node", A_info_last_node },
|
||||
{ "first-node", A_info_first_node },
|
||||
{ "last-menu-item", A_info_last_menu_item },
|
||||
{ "menu-digit", A_info_menu_digit },
|
||||
{ "menu-item", A_info_menu_item },
|
||||
{ "xref-item", A_info_xref_item },
|
||||
{ "find-menu", A_info_find_menu },
|
||||
{ "visit-menu", A_info_visit_menu },
|
||||
{ "goto-node", A_info_goto_node },
|
||||
{ "menu-sequence", A_info_menu_sequence },
|
||||
{ "goto-invocation-node", A_info_goto_invocation_node },
|
||||
{ "man", A_info_man },
|
||||
{ "top-node", A_info_top_node },
|
||||
{ "dir-node", A_info_dir_node },
|
||||
{ "history-node", A_info_history_node },
|
||||
{ "kill-node", A_info_kill_node },
|
||||
{ "view-file", A_info_view_file },
|
||||
{ "print-node", A_info_print_node },
|
||||
{ "search-case-sensitively", A_info_search_case_sensitively },
|
||||
{ "search", A_info_search },
|
||||
{ "search-backward", A_info_search_backward },
|
||||
{ "search-next", A_info_search_next },
|
||||
{ "search-previous", A_info_search_previous },
|
||||
{ "isearch-forward", A_isearch_forward },
|
||||
{ "isearch-backward", A_isearch_backward },
|
||||
{ "move-to-prev-xref", A_info_move_to_prev_xref },
|
||||
{ "move-to-next-xref", A_info_move_to_next_xref },
|
||||
{ "select-reference-this-line", A_info_select_reference_this_line },
|
||||
{ "abort-key", A_info_abort_key },
|
||||
{ "move-to-window-line", A_info_move_to_window_line },
|
||||
{ "redraw-display", A_info_redraw_display },
|
||||
{ "quit", A_info_quit },
|
||||
{ "do-lowercase-version", A_info_do_lowercase_version },
|
||||
{ "add-digit-to-numeric-arg", A_info_add_digit_to_numeric_arg },
|
||||
{ "universal-argument", A_info_universal_argument },
|
||||
{ "numeric-arg-digit-loop", A_info_numeric_arg_digit_loop },
|
||||
/* Commands found in "./echo-area.c". */
|
||||
{ "echo-area-forward", A_ea_forward },
|
||||
{ "echo-area-backward", A_ea_backward },
|
||||
{ "echo-area-beg-of-line", A_ea_beg_of_line },
|
||||
{ "echo-area-end-of-line", A_ea_end_of_line },
|
||||
{ "echo-area-forward-word", A_ea_forward_word },
|
||||
{ "echo-area-backward-word", A_ea_backward_word },
|
||||
{ "echo-area-delete", A_ea_delete },
|
||||
{ "echo-area-rubout", A_ea_rubout },
|
||||
{ "echo-area-abort", A_ea_abort },
|
||||
{ "echo-area-newline", A_ea_newline },
|
||||
{ "echo-area-quoted-insert", A_ea_quoted_insert },
|
||||
{ "echo-area-insert", A_ea_insert },
|
||||
{ "echo-area-tab-insert", A_ea_tab_insert },
|
||||
{ "echo-area-transpose-chars", A_ea_transpose_chars },
|
||||
{ "echo-area-yank", A_ea_yank },
|
||||
{ "echo-area-yank-pop", A_ea_yank_pop },
|
||||
{ "echo-area-kill-line", A_ea_kill_line },
|
||||
{ "echo-area-backward-kill-line", A_ea_backward_kill_line },
|
||||
{ "echo-area-kill-word", A_ea_kill_word },
|
||||
{ "echo-area-backward-kill-word", A_ea_backward_kill_word },
|
||||
{ "echo-area-possible-completions", A_ea_possible_completions },
|
||||
{ "echo-area-complete", A_ea_complete },
|
||||
{ "echo-area-scroll-completions-window", A_ea_scroll_completions_window },
|
||||
/* Commands found in "./infodoc.c". */
|
||||
{ "get-help-window", A_info_get_help_window },
|
||||
{ "get-info-help-node", A_info_get_info_help_node },
|
||||
{ "describe-key", A_describe_key },
|
||||
{ "where-is", A_info_where_is },
|
||||
/* Commands found in "./m-x.c". */
|
||||
{ "describe-command", A_describe_command },
|
||||
{ "execute-command", A_info_execute_command },
|
||||
{ "set-screen-height", A_set_screen_height },
|
||||
/* Commands found in "./indices.c". */
|
||||
{ "index-search", A_info_index_search },
|
||||
{ "next-index-match", A_info_next_index_match },
|
||||
{ "index-apropos", A_info_index_apropos },
|
||||
/* Commands found in "./nodemenu.c". */
|
||||
{ "list-visited-nodes", A_list_visited_nodes },
|
||||
{ "select-visited-node", A_select_visited_node },
|
||||
/* Commands found in "./footnotes.c". */
|
||||
{ "show-footnotes", A_info_show_footnotes },
|
||||
/* Commands found in "./variables.c". */
|
||||
{ "describe-variable", A_describe_variable },
|
||||
{ "set-variable", A_set_variable },
|
||||
(char *)0
|
||||
};
|
35
contrib/texinfo/info/key.h
Normal file
35
contrib/texinfo/info/key.h
Normal file
@ -0,0 +1,35 @@
|
||||
/* key.h -- Structure associating function names with numeric codes. */
|
||||
|
||||
/* This file is part of GNU Info, a program for reading online documentation
|
||||
stored in Info format.
|
||||
|
||||
Copyright (C) 1993 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Written by Andrew Bettison <andrewb@zip.com.au> */
|
||||
|
||||
#if !defined (KEY_H)
|
||||
#define KEY_H
|
||||
|
||||
typedef struct {
|
||||
char *name;
|
||||
unsigned char code;
|
||||
}
|
||||
FUNCTION_KEY;
|
||||
|
||||
extern FUNCTION_KEY function_key_array[];
|
||||
|
||||
#endif /* !KEY_H */
|
@ -1,7 +1,7 @@
|
||||
/* m-x.c -- Meta-x minibuffer reader.
|
||||
$Id: m-x.c,v 1.8 1999/06/25 21:57:40 karl Exp $
|
||||
$Id: m-x.c,v 1.9 2001/11/16 23:14:33 karl Exp $
|
||||
|
||||
Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 97, 98, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -20,6 +20,7 @@
|
||||
Written by Brian Fox (bfox@ai.mit.edu). */
|
||||
|
||||
#include "info.h"
|
||||
#include "funs.h"
|
||||
|
||||
/* **************************************************************** */
|
||||
/* */
|
||||
@ -81,13 +82,13 @@ DECLARE_INFO_COMMAND (describe_command,
|
||||
/* Describe the function named in "LINE". */
|
||||
if (*line)
|
||||
{
|
||||
VFunction *fun = named_function (line);
|
||||
InfoCommand *cmd = named_function (line);
|
||||
|
||||
if (!fun)
|
||||
if (!cmd)
|
||||
return;
|
||||
|
||||
window_message_in_echo_area ("%s: %s.",
|
||||
line, function_documentation (fun));
|
||||
line, function_documentation (cmd));
|
||||
}
|
||||
free (line);
|
||||
}
|
||||
@ -96,18 +97,24 @@ DECLARE_INFO_COMMAND (info_execute_command,
|
||||
_("Read a command name in the echo area and execute it"))
|
||||
{
|
||||
char *line;
|
||||
char *keys;
|
||||
char *prompt;
|
||||
|
||||
prompt = (char *)xmalloc (20);
|
||||
|
||||
keys = where_is (info_keymap, InfoCmd(info_execute_command));
|
||||
/* If the where_is () function thinks that this command doesn't exist,
|
||||
there's something very wrong! */
|
||||
if (!keys)
|
||||
abort();
|
||||
|
||||
if (info_explicit_arg || count != 1)
|
||||
sprintf (prompt, "%d %s ", count, keys);
|
||||
else
|
||||
sprintf (prompt, "%s ", keys);
|
||||
|
||||
/* Ask the completer to read a reference for us. */
|
||||
if (info_explicit_arg || count != 1)
|
||||
{
|
||||
char *prompt;
|
||||
|
||||
prompt = (char *)xmalloc (20);
|
||||
sprintf (prompt, "%d M-x ", count);
|
||||
line = read_function_name (prompt, window);
|
||||
}
|
||||
else
|
||||
line = read_function_name ("M-x ", window);
|
||||
line = read_function_name (prompt, window);
|
||||
|
||||
/* User aborted? */
|
||||
if (!line)
|
||||
@ -125,7 +132,7 @@ DECLARE_INFO_COMMAND (info_execute_command,
|
||||
|
||||
/* User wants to execute a named command. Do it. */
|
||||
{
|
||||
VFunction *function;
|
||||
InfoCommand *command;
|
||||
|
||||
if ((active_window != the_echo_area) &&
|
||||
(strncmp (line, "echo-area-", 10) == 0))
|
||||
@ -135,13 +142,13 @@ DECLARE_INFO_COMMAND (info_execute_command,
|
||||
return;
|
||||
}
|
||||
|
||||
function = named_function (line);
|
||||
command = named_function (line);
|
||||
free (line);
|
||||
|
||||
if (!function)
|
||||
if (!command)
|
||||
return;
|
||||
|
||||
(*function) (active_window, count, 0);
|
||||
(*InfoFunction(command)) (active_window, count, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* man.c: How to read and format man files.
|
||||
$Id: man.c,v 1.13 1999/07/05 20:43:23 karl Exp $
|
||||
$Id: man.c,v 1.16 2002/02/23 19:12:02 karl Exp $
|
||||
|
||||
Copyright (C) 1995, 97, 98, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1995, 97, 98, 99, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -397,11 +397,36 @@ clean_manpage (manpage)
|
||||
newline_count--;
|
||||
}
|
||||
|
||||
if (manpage[i] == '\b' || manpage[i] == '\f')
|
||||
/* A malformed man page could have a \b as its first character,
|
||||
in which case decrementing j by 2 will cause us to write into
|
||||
newpage[-1], smashing the hidden info stored there by malloc. */
|
||||
if (manpage[i] == '\b' || manpage[i] == '\f' && j > 0)
|
||||
j -= 2;
|
||||
else if (!raw_escapes_p)
|
||||
{
|
||||
/* Remove the ANSI escape sequences for color, boldface,
|
||||
underlining, and italics, generated by some versions of
|
||||
Groff. */
|
||||
if (manpage[i] == '\033' && manpage[i + 1] == '['
|
||||
&& isdigit (manpage[i + 2]))
|
||||
{
|
||||
if (isdigit (manpage[i + 3]) && manpage[i + 4] == 'm')
|
||||
{
|
||||
i += 4;
|
||||
j--;
|
||||
}
|
||||
else if (manpage[i + 3] == 'm')
|
||||
{
|
||||
i += 3;
|
||||
j--;
|
||||
}
|
||||
/* Else do nothing: it's some unknown escape sequence,
|
||||
so let's leave it alone. */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
newpage[j++] = '\0';
|
||||
newpage[j++] = 0;
|
||||
|
||||
strcpy (manpage, newpage);
|
||||
free (newpage);
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* nodes.c -- how to get an Info file and node.
|
||||
$Id: nodes.c,v 1.14 1999/08/15 10:18:09 karl Exp $
|
||||
$Id: nodes.c,v 1.15 2000/11/11 00:40:37 karl Exp $
|
||||
|
||||
Copyright (C) 1993, 98, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 98, 99, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -222,11 +222,12 @@ info_find_file_internal (filename, get_tags)
|
||||
if (info_loaded_files)
|
||||
{
|
||||
for (i = 0; (file_buffer = info_loaded_files[i]); i++)
|
||||
if ((FILENAME_CMP (filename, file_buffer->filename) == 0) ||
|
||||
(FILENAME_CMP (filename, file_buffer->fullpath) == 0) ||
|
||||
(!IS_ABSOLUTE (filename) &&
|
||||
FILENAME_CMP (filename,
|
||||
filename_non_directory (file_buffer->fullpath)) == 0))
|
||||
if ((FILENAME_CMP (filename, file_buffer->filename) == 0)
|
||||
|| (FILENAME_CMP (filename, file_buffer->fullpath) == 0)
|
||||
|| (!IS_ABSOLUTE (filename)
|
||||
&& FILENAME_CMP (filename,
|
||||
filename_non_directory (file_buffer->fullpath))
|
||||
== 0))
|
||||
{
|
||||
struct stat new_info, *old_info;
|
||||
|
||||
@ -241,9 +242,8 @@ info_find_file_internal (filename, get_tags)
|
||||
return file_buffer;
|
||||
#endif /* HANDLE_MAN_PAGES */
|
||||
|
||||
/* The file appears to be already loaded, and it is not "dir".
|
||||
Check to see if it has changed since the last time it was
|
||||
loaded. */
|
||||
/* The file appears to be already loaded, and is not "dir". Check
|
||||
to see if it's changed since the last time it was loaded. */
|
||||
if (stat (file_buffer->fullpath, &new_info) == -1)
|
||||
{
|
||||
filesys_error_number = errno;
|
||||
@ -252,8 +252,8 @@ info_find_file_internal (filename, get_tags)
|
||||
|
||||
old_info = &file_buffer->finfo;
|
||||
|
||||
if ((new_info.st_size != old_info->st_size) ||
|
||||
(new_info.st_mtime != old_info->st_mtime))
|
||||
if (new_info.st_size != old_info->st_size
|
||||
|| new_info.st_mtime != old_info->st_mtime)
|
||||
{
|
||||
/* The file has changed. Forget that we ever had loaded it
|
||||
in the first place. */
|
||||
@ -267,13 +267,13 @@ info_find_file_internal (filename, get_tags)
|
||||
for this file, and there isn't one here, build the nodes
|
||||
for this file_buffer. In any case, return the file_buffer
|
||||
object. */
|
||||
if (!file_buffer->contents)
|
||||
{
|
||||
/* The file's contents have been gc'ed. Reload it. */
|
||||
info_reload_file_buffer_contents (file_buffer);
|
||||
if (!file_buffer->contents)
|
||||
return NULL;
|
||||
}
|
||||
if (!file_buffer->contents)
|
||||
{
|
||||
/* The file's contents have been gc'ed. Reload it. */
|
||||
info_reload_file_buffer_contents (file_buffer);
|
||||
if (!file_buffer->contents)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (get_tags && !file_buffer->tags)
|
||||
build_tags_and_nodes (file_buffer);
|
||||
@ -770,20 +770,20 @@ get_tags_of_indirect_tags_table (file_buffer, indirect_binding, tags_binding)
|
||||
/* Build the file buffer's list of subfiles. */
|
||||
{
|
||||
char *containing_dir = xstrdup (file_buffer->fullpath);
|
||||
char *temp = filename_non_directory (containing_dir);
|
||||
char *temp = filename_non_directory (containing_dir);
|
||||
int len_containing_dir;
|
||||
|
||||
if (temp > containing_dir)
|
||||
{
|
||||
if (HAVE_DRIVE (file_buffer->fullpath) &&
|
||||
temp == containing_dir + 2)
|
||||
{
|
||||
/* Avoid converting "d:foo" into "d:/foo" below. */
|
||||
*temp = '.';
|
||||
temp += 2;
|
||||
}
|
||||
temp[-1] = 0;
|
||||
}
|
||||
if (temp > containing_dir)
|
||||
{
|
||||
if (HAVE_DRIVE (file_buffer->fullpath) &&
|
||||
temp == containing_dir + 2)
|
||||
{
|
||||
/* Avoid converting "d:foo" into "d:/foo" below. */
|
||||
*temp = '.';
|
||||
temp += 2;
|
||||
}
|
||||
temp[-1] = 0;
|
||||
}
|
||||
|
||||
len_containing_dir = strlen (containing_dir);
|
||||
|
||||
@ -940,20 +940,22 @@ info_node_of_file_buffer_tags (file_buffer, nodename)
|
||||
TAG *tag;
|
||||
int i;
|
||||
|
||||
/* If no tags at all (possibly a misformatted info file), quit. */
|
||||
if (!file_buffer->tags) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (i = 0; (tag = file_buffer->tags[i]); i++)
|
||||
if (strcmp (nodename, tag->nodename) == 0)
|
||||
{
|
||||
FILE_BUFFER *subfile;
|
||||
|
||||
subfile = info_find_file_internal (tag->filename, INFO_NO_TAGS);
|
||||
|
||||
FILE_BUFFER *subfile = info_find_file_internal (tag->filename,
|
||||
INFO_NO_TAGS);
|
||||
if (!subfile)
|
||||
return NULL;
|
||||
|
||||
if (!subfile->contents)
|
||||
{
|
||||
info_reload_file_buffer_contents (subfile);
|
||||
|
||||
if (!subfile->contents)
|
||||
return NULL;
|
||||
}
|
||||
@ -1187,7 +1189,7 @@ info_reload_file_buffer_contents (fb)
|
||||
/* Let the filesystem do all the work for us. */
|
||||
fb->contents =
|
||||
filesys_read_info_file (fb->fullpath, &(fb->filesize), &(fb->finfo),
|
||||
&is_compressed);
|
||||
&is_compressed);
|
||||
if (is_compressed)
|
||||
fb->flags |= N_IsCompressed;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* session.h -- Functions found in session.c.
|
||||
$Id: session.h,v 1.9 1999/06/25 21:57:40 karl Exp $
|
||||
$Id: session.h,v 1.10 2001/11/16 23:17:15 karl Exp $
|
||||
|
||||
Copyright (C) 1993, 98, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 98, 99, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -65,7 +65,6 @@ extern unsigned char info_get_input_char (), info_get_another_input_char ();
|
||||
extern unsigned char info_input_pending_p ();
|
||||
extern void remember_window_and_node (), set_remembered_pagetop_and_point ();
|
||||
extern void set_window_pagetop (), info_set_node_of_window ();
|
||||
extern char *pretty_keyseq ();
|
||||
extern void initialize_keyseq (), add_char_to_keyseq ();
|
||||
extern void info_gather_typeahead ();
|
||||
extern FILE_BUFFER *file_buffer_of_window ();
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* termdep.h -- System things that terminal.c depends on.
|
||||
$Id: termdep.h,v 1.4 1998/04/13 22:02:57 karl Exp $
|
||||
$Id: termdep.h,v 1.5 2001/09/12 17:26:03 karl Exp $
|
||||
|
||||
Copyright (C) 1993, 96, 97, 98 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 96, 97, 98, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -30,9 +30,6 @@
|
||||
|
||||
#ifdef HAVE_TERMIOS_H
|
||||
# include <termios.h>
|
||||
# ifdef GWINSZ_IN_SYS_IOCTL
|
||||
# include <sys/ioctl.h>
|
||||
# endif
|
||||
#else
|
||||
# if defined (HAVE_TERMIO_H)
|
||||
# include <termio.h>
|
||||
@ -50,6 +47,10 @@
|
||||
# endif /* !HAVE_TERMIO_H */
|
||||
#endif /* !HAVE_TERMIOS_H */
|
||||
|
||||
#ifdef GWINSZ_IN_SYS_IOCTL
|
||||
# include <sys/ioctl.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TTOLD_H
|
||||
# include <sys/ttold.h>
|
||||
#endif /* HAVE_SYS_TTOLD_H */
|
||||
|
@ -1,9 +1,7 @@
|
||||
/* terminal.h -- The external interface to terminal I/O. */
|
||||
/* terminal.h -- The external interface to terminal I/O.
|
||||
$Id: terminal.h,v 1.7 2001/11/16 23:17:29 karl Exp $
|
||||
|
||||
/* This file is part of GNU Info, a program for reading online documentation
|
||||
stored in Info format.
|
||||
|
||||
Copyright (C) 1993, 96, 97 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 96, 97, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -118,8 +116,11 @@ extern VFunction *terminal_scroll_terminal_hook;
|
||||
extern void terminal_ring_bell ();
|
||||
extern VFunction *terminal_ring_bell_hook;
|
||||
|
||||
/* The key sequences output by the arrow keys, if this terminal has any. */
|
||||
/* The key sequences output by special keys, if this terminal has any. */
|
||||
extern char *term_ku, *term_kd, *term_kr, *term_kl;
|
||||
extern char *term_kP, *term_kN;
|
||||
extern char *term_ke, *term_kh;
|
||||
extern char *term_kx, *term_ki;
|
||||
extern char *term_kD;
|
||||
|
||||
#endif /* !TERMINAL_H */
|
||||
|
@ -1,10 +1,7 @@
|
||||
/* variables.c -- How to manipulate user visible variables in Info.
|
||||
$Id: variables.c,v 1.7 1999/06/25 21:57:40 karl Exp $
|
||||
$Id: variables.c,v 1.8 2001/11/16 23:16:19 karl Exp $
|
||||
|
||||
This file is part of GNU Info, a program for reading online documentation
|
||||
stored in Info format.
|
||||
|
||||
Copyright (C) 1993, 97 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 97, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -273,3 +270,40 @@ make_variable_completions_array ()
|
||||
|
||||
return (array);
|
||||
}
|
||||
|
||||
#if defined(INFOKEY)
|
||||
|
||||
void
|
||||
set_variable_to_value(name, value)
|
||||
char *name;
|
||||
char *value;
|
||||
{
|
||||
register int i;
|
||||
|
||||
/* Find the variable in our list of variables. */
|
||||
for (i = 0; info_variables[i].name; i++)
|
||||
if (strcmp(info_variables[i].name, name) == 0)
|
||||
break;
|
||||
|
||||
if (!info_variables[i].name)
|
||||
return;
|
||||
|
||||
if (info_variables[i].choices)
|
||||
{
|
||||
register int j;
|
||||
|
||||
/* Find the choice in our list of choices. */
|
||||
for (j = 0; info_variables[i].choices[j]; j++)
|
||||
if (strcmp (info_variables[i].choices[j], value) == 0)
|
||||
break;
|
||||
|
||||
if (info_variables[i].choices[j])
|
||||
*info_variables[i].value = j;
|
||||
}
|
||||
else
|
||||
{
|
||||
*info_variables[i].value = atoi(value);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* INFOKEY */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* window.c -- windows in Info.
|
||||
$Id: window.c,v 1.11 1999/06/25 21:57:40 karl Exp $
|
||||
$Id: window.c,v 1.15 2002/01/19 01:08:20 karl Exp $
|
||||
|
||||
Copyright (C) 1993, 97, 98 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 97, 98, 2001, 02 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -826,7 +826,10 @@ calculate_line_starts (window)
|
||||
|
||||
while (1)
|
||||
{
|
||||
c = node->contents[i];
|
||||
/* The cast to unsigned char is for 8-bit characters, which
|
||||
could be passed as negative integers to character_width
|
||||
and wreak havoc on some naive implementations of iscntrl. */
|
||||
c = (unsigned char) node->contents[i];
|
||||
cwidth = character_width (c, hpos);
|
||||
|
||||
/* If this character fits within this line, just do the next one. */
|
||||
@ -1298,16 +1301,17 @@ message_buffer_resize (length)
|
||||
/* Format MESSAGE_BUFFER with the results of printing FORMAT with ARG1 and
|
||||
ARG2. */
|
||||
static void
|
||||
build_message_buffer (format, arg1, arg2)
|
||||
build_message_buffer (format, arg1, arg2, arg3)
|
||||
char *format;
|
||||
void *arg1, *arg2;
|
||||
void *arg1, *arg2, *arg3;
|
||||
{
|
||||
register int i, len;
|
||||
void *args[2];
|
||||
void *args[3];
|
||||
int arg_index = 0;
|
||||
|
||||
args[0] = arg1;
|
||||
args[1] = arg2;
|
||||
args[2] = arg3;
|
||||
|
||||
len = strlen (format);
|
||||
|
||||
@ -1326,7 +1330,9 @@ build_message_buffer (format, arg1, arg2)
|
||||
char *fmt_start = format + i;
|
||||
char *fmt;
|
||||
int fmt_len, formatted_len;
|
||||
int paramed = 0;
|
||||
|
||||
format_again:
|
||||
i++;
|
||||
while (format[i] && strchr ("-. +0123456789", format[i]))
|
||||
i++;
|
||||
@ -1335,18 +1341,39 @@ build_message_buffer (format, arg1, arg2)
|
||||
if (c == '\0')
|
||||
abort ();
|
||||
|
||||
if (c == '$') {
|
||||
/* position parameter parameter */
|
||||
/* better to use bprintf from bfox's metahtml? */
|
||||
arg_index = atoi(fmt_start + 1) - 1;
|
||||
if (arg_index < 0)
|
||||
arg_index = 0;
|
||||
if (arg_index >= 2)
|
||||
arg_index = 1;
|
||||
paramed = 1;
|
||||
goto format_again;
|
||||
}
|
||||
|
||||
fmt_len = format + i - fmt_start + 1;
|
||||
fmt = (char *) xmalloc (fmt_len + 1);
|
||||
strncpy (fmt, fmt_start, fmt_len);
|
||||
fmt[fmt_len] = '\0';
|
||||
|
||||
if (paramed) {
|
||||
/* removed positioned parameter */
|
||||
char *p;
|
||||
for (p = fmt + 1; *p && *p != '$'; p++) {
|
||||
;
|
||||
}
|
||||
strcpy(fmt + 1, p + 1);
|
||||
}
|
||||
|
||||
/* If we have "%-98s", maybe 98 calls for a longer string. */
|
||||
if (fmt_len > 2)
|
||||
{
|
||||
int j;
|
||||
|
||||
for (j = 0; j < fmt_len; j++)
|
||||
if (isdigit (fmt[j]))
|
||||
for (j = fmt_len - 2; j >= 0; j--)
|
||||
if (isdigit (fmt[j]) || fmt[j] == '$')
|
||||
break;
|
||||
|
||||
formatted_len = atoi (fmt + j);
|
||||
@ -1430,7 +1457,7 @@ build_message_node (format, arg1, arg2)
|
||||
NODE *node;
|
||||
|
||||
message_buffer_index = 0;
|
||||
build_message_buffer (format, arg1, arg2);
|
||||
build_message_buffer (format, arg1, arg2, 0);
|
||||
|
||||
node = message_buffer_to_node ();
|
||||
return (node);
|
||||
@ -1467,11 +1494,11 @@ initialize_message_buffer ()
|
||||
|
||||
/* Print FORMAT with ARG1,2 to the end of the current message buffer. */
|
||||
void
|
||||
printf_to_message_buffer (format, arg1, arg2)
|
||||
printf_to_message_buffer (format, arg1, arg2, arg3)
|
||||
char *format;
|
||||
void *arg1, *arg2;
|
||||
void *arg1, *arg2, *arg3;
|
||||
{
|
||||
build_message_buffer (format, arg1, arg2);
|
||||
build_message_buffer (format, arg1, arg2, arg3);
|
||||
}
|
||||
|
||||
/* Return the current horizontal position of the "cursor" on the most
|
||||
|
@ -1,14 +1,10 @@
|
||||
/* Getopt for GNU.
|
||||
NOTE: getopt is now part of the C library, so if you don't know what
|
||||
"Keep this file name-space clean" means, talk to drepper@gnu.org
|
||||
before changing it!
|
||||
NOTE: The canonical source of this file is maintained with the GNU
|
||||
C Library. Bugs can be reported to bug-glibc@gnu.org.
|
||||
|
||||
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98
|
||||
Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@gnu.org.
|
||||
|
||||
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
|
||||
@ -20,9 +16,8 @@
|
||||
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. */
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* This tells Alpha OSF/1 not to define a getopt prototype in <stdio.h>.
|
||||
Ditto for AIX 3.2 and <stdlib.h>. */
|
||||
@ -32,13 +27,13 @@
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if !defined __STDC__ || !__STDC__
|
||||
#else
|
||||
# if !defined __STDC__ || !__STDC__
|
||||
/* This is a separate conditional since some stdc systems
|
||||
reject `defined (const)'. */
|
||||
# ifndef const
|
||||
# define const
|
||||
# ifndef const
|
||||
# define const
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@ -112,7 +107,7 @@
|
||||
Also, when `ordering' is RETURN_IN_ORDER,
|
||||
each non-option ARGV-element is returned here. */
|
||||
|
||||
char *optarg = NULL;
|
||||
char *optarg;
|
||||
|
||||
/* Index in ARGV of the next element to be scanned.
|
||||
This is used for communication to and from the caller
|
||||
@ -133,7 +128,7 @@ int optind = 1;
|
||||
causes problems with re-calling getopt as programs generally don't
|
||||
know that. */
|
||||
|
||||
int __getopt_initialized = 0;
|
||||
int __getopt_initialized;
|
||||
|
||||
/* The next char to be scanned in the option-element
|
||||
in which the last option character we returned was found.
|
||||
@ -698,16 +693,18 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
|
||||
else
|
||||
{
|
||||
if (opterr)
|
||||
if (argv[optind - 1][1] == '-')
|
||||
/* --option */
|
||||
fprintf (stderr,
|
||||
_("%s: option `--%s' doesn't allow an argument\n"),
|
||||
argv[0], pfound->name);
|
||||
else
|
||||
/* +option or -option */
|
||||
fprintf (stderr,
|
||||
_("%s: option `%c%s' doesn't allow an argument\n"),
|
||||
argv[0], argv[optind - 1][0], pfound->name);
|
||||
{
|
||||
if (argv[optind - 1][1] == '-')
|
||||
/* --option */
|
||||
fprintf (stderr,
|
||||
_("%s: option `--%s' doesn't allow an argument\n"),
|
||||
argv[0], pfound->name);
|
||||
else
|
||||
/* +option or -option */
|
||||
fprintf (stderr,
|
||||
_("%s: option `%c%s' doesn't allow an argument\n"),
|
||||
argv[0], argv[optind - 1][0], pfound->name);
|
||||
}
|
||||
|
||||
nextchar += strlen (nextchar);
|
||||
|
||||
|
@ -1,9 +1,7 @@
|
||||
/* Declarations for getopt.
|
||||
Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc.
|
||||
|
||||
Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc.
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@gnu.org.
|
||||
|
||||
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
|
||||
@ -20,7 +18,10 @@
|
||||
USA. */
|
||||
|
||||
#ifndef _GETOPT_H
|
||||
#define _GETOPT_H 1
|
||||
|
||||
#ifndef __need_getopt
|
||||
# define _GETOPT_H 1
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -57,6 +58,7 @@ extern int opterr;
|
||||
|
||||
extern int optopt;
|
||||
|
||||
#ifndef __need_getopt
|
||||
/* Describe the long-named options requested by the application.
|
||||
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
|
||||
of `struct option' terminated by an element containing a name which is
|
||||
@ -80,11 +82,11 @@ extern int optopt;
|
||||
|
||||
struct option
|
||||
{
|
||||
#if defined (__STDC__) && __STDC__
|
||||
# if defined __STDC__ && __STDC__
|
||||
const char *name;
|
||||
#else
|
||||
# else
|
||||
char *name;
|
||||
#endif
|
||||
# endif
|
||||
/* has_arg can't be an enum because some compilers complain about
|
||||
type mismatches in all the code that assumes it is an int. */
|
||||
int has_arg;
|
||||
@ -94,40 +96,74 @@ struct option
|
||||
|
||||
/* Names for the values of the `has_arg' field of `struct option'. */
|
||||
|
||||
#define no_argument 0
|
||||
#define required_argument 1
|
||||
#define optional_argument 2
|
||||
# define no_argument 0
|
||||
# define required_argument 1
|
||||
# define optional_argument 2
|
||||
#endif /* need getopt */
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
#ifdef __GNU_LIBRARY__
|
||||
|
||||
/* Get definitions and prototypes for functions to process the
|
||||
arguments in ARGV (ARGC of them, minus the program name) for
|
||||
options given in OPTS.
|
||||
|
||||
Return the option character from OPTS just read. Return -1 when
|
||||
there are no more options. For unrecognized options, or options
|
||||
missing arguments, `optopt' is set to the option letter, and '?' is
|
||||
returned.
|
||||
|
||||
The OPTS string is a list of characters which are recognized option
|
||||
letters, optionally followed by colons, specifying that that letter
|
||||
takes an argument, to be placed in `optarg'.
|
||||
|
||||
If a letter in OPTS is followed by two colons, its argument is
|
||||
optional. This behavior is specific to the GNU `getopt'.
|
||||
|
||||
The argument `--' causes premature termination of argument
|
||||
scanning, explicitly telling `getopt' that there are no more
|
||||
options.
|
||||
|
||||
If OPTS begins with `--', then non-option arguments are treated as
|
||||
arguments to the option '\0'. This behavior is specific to the GNU
|
||||
`getopt'. */
|
||||
|
||||
#if defined __STDC__ && __STDC__
|
||||
# ifdef __GNU_LIBRARY__
|
||||
/* Many other libraries have conflicting prototypes for getopt, with
|
||||
differences in the consts, in stdlib.h. To avoid compilation
|
||||
errors, only prototype getopt for the GNU C library. */
|
||||
extern int getopt (int argc, char *const *argv, const char *shortopts);
|
||||
#else /* not __GNU_LIBRARY__ */
|
||||
extern int getopt (int __argc, char *const *__argv, const char *__shortopts);
|
||||
# else /* not __GNU_LIBRARY__ */
|
||||
extern int getopt ();
|
||||
#endif /* __GNU_LIBRARY__ */
|
||||
extern int getopt_long (int argc, char *const *argv, const char *shortopts,
|
||||
const struct option *longopts, int *longind);
|
||||
extern int getopt_long_only (int argc, char *const *argv,
|
||||
const char *shortopts,
|
||||
const struct option *longopts, int *longind);
|
||||
# endif /* __GNU_LIBRARY__ */
|
||||
|
||||
# ifndef __need_getopt
|
||||
extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts,
|
||||
const struct option *__longopts, int *__longind);
|
||||
extern int getopt_long_only (int __argc, char *const *__argv,
|
||||
const char *__shortopts,
|
||||
const struct option *__longopts, int *__longind);
|
||||
|
||||
/* Internal only. Users should not call this directly. */
|
||||
extern int _getopt_internal (int argc, char *const *argv,
|
||||
const char *shortopts,
|
||||
const struct option *longopts, int *longind,
|
||||
int long_only);
|
||||
extern int _getopt_internal (int __argc, char *const *__argv,
|
||||
const char *__shortopts,
|
||||
const struct option *__longopts, int *__longind,
|
||||
int __long_only);
|
||||
# endif
|
||||
#else /* not __STDC__ */
|
||||
extern int getopt ();
|
||||
# ifndef __need_getopt
|
||||
extern int getopt_long ();
|
||||
extern int getopt_long_only ();
|
||||
|
||||
extern int _getopt_internal ();
|
||||
# endif
|
||||
#endif /* __STDC__ */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Make sure we later can get all the definitions and declarations. */
|
||||
#undef __need_getopt
|
||||
|
||||
#endif /* getopt.h */
|
||||
|
@ -1,7 +1,6 @@
|
||||
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
||||
Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@gnu.org.
|
||||
|
||||
@ -16,16 +15,12 @@
|
||||
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. */
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "getopt.h"
|
||||
|
||||
#else
|
||||
#if !defined __STDC__ || !__STDC__
|
||||
/* This is a separate conditional since some stdc systems
|
||||
reject `defined (const)'. */
|
||||
@ -33,6 +28,9 @@
|
||||
#define const
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "getopt.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
74
contrib/texinfo/lib/gettext.h
Normal file
74
contrib/texinfo/lib/gettext.h
Normal file
@ -0,0 +1,74 @@
|
||||
/* Convenience header for conditional use of GNU <libintl.h>.
|
||||
Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU Library General Public License as published
|
||||
by the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
#ifndef _LIBGETTEXT_H
|
||||
#define _LIBGETTEXT_H 1
|
||||
|
||||
/* NLS can be disabled through the configure --disable-nls option. */
|
||||
#if ENABLE_NLS
|
||||
|
||||
/* Get declarations of GNU message catalog functions. */
|
||||
# include <libintl.h>
|
||||
|
||||
#else
|
||||
|
||||
/* Disabled NLS.
|
||||
The casts to 'const char *' serve the purpose of producing warnings
|
||||
for invalid uses of the value returned from these functions.
|
||||
On pre-ANSI systems without 'const', the config.h file is supposed to
|
||||
contain "#define const". */
|
||||
#if 0
|
||||
/* no thanks, not ready to go const --karl, 26feb02 */
|
||||
# define gettext(Msgid) ((const char *) (Msgid))
|
||||
# define dgettext(Domainname, Msgid) ((const char *) (Msgid))
|
||||
# define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid))
|
||||
# define ngettext(Msgid1, Msgid2, N) \
|
||||
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
|
||||
# define dngettext(Domainname, Msgid1, Msgid2, N) \
|
||||
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
|
||||
# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
|
||||
((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2))
|
||||
# define textdomain(Domainname) ((const char *) (Domainname))
|
||||
# define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname))
|
||||
# define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset))
|
||||
#else /* not 0 */
|
||||
# define gettext(Msgid) ((Msgid))
|
||||
# define dgettext(Domainname, Msgid) (Msgid)
|
||||
# define dcgettext(Domainname, Msgid, Category) (Msgid)
|
||||
# define ngettext(Msgid1, Msgid2, N) \
|
||||
((N) == 1 ? (Msgid1) : (Msgid2))
|
||||
# define dngettext(Domainname, Msgid1, Msgid2, N) \
|
||||
((N) == 1 ? (Msgid1) : (Msgid2))
|
||||
# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
|
||||
((N) == 1 ? (Msgid1) : (Msgid2))
|
||||
# define textdomain(Domainname) (Domainname)
|
||||
# define bindtextdomain(Domainname, Dirname) (Dirname)
|
||||
# define bind_textdomain_codeset(Domainname, Codeset) (Codeset)
|
||||
#endif /* 0 */
|
||||
#endif
|
||||
|
||||
/* A pseudo function call that serves as a marker for the automated
|
||||
extraction of messages, but does not call gettext(). The run-time
|
||||
translation is done at a different place in the code.
|
||||
The argument, String, should be a literal string. Concatenated strings
|
||||
and other string expressions won't work.
|
||||
The macro's expansion is not parenthesized, so that it is suitable as
|
||||
initializer for static 'char[]' or 'const char[]' variables. */
|
||||
#define gettext_noop(String) String
|
||||
|
||||
#endif /* _LIBGETTEXT_H */
|
@ -1,7 +1,7 @@
|
||||
/* system.h: system-dependent declarations; include this first.
|
||||
$Id: system.h,v 1.14 1999/07/17 21:11:34 karl Exp $
|
||||
$Id: system.h,v 1.22 2002/02/26 14:31:18 karl Exp $
|
||||
|
||||
Copyright (C) 1997, 98, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1997, 98, 99, 00, 01, 02 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -34,6 +34,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <ctype.h>
|
||||
|
||||
/* All systems nowadays probably have these functions, but ... */
|
||||
#ifdef HAVE_LOCALE_H
|
||||
#include <locale.h>
|
||||
#endif
|
||||
@ -42,10 +43,14 @@
|
||||
#endif
|
||||
|
||||
/* For gettext (NLS). */
|
||||
#include <libintl.h>
|
||||
#include "gettext.h"
|
||||
#define _(String) gettext (String)
|
||||
#define N_(String) (String)
|
||||
|
||||
#ifndef HAVE_LC_MESSAGES
|
||||
#define LC_MESSAGES (-1)
|
||||
#endif
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
#define getopt system_getopt
|
||||
#include <stdlib.h>
|
||||
@ -78,6 +83,16 @@ extern int errno;
|
||||
extern char *strerror ();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#endif
|
||||
#ifndef PATH_MAX
|
||||
#ifndef _POSIX_PATH_MAX
|
||||
# define _POSIX_PATH_MAX 255
|
||||
#endif
|
||||
#define PATH_MAX _POSIX_PATH_MAX
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_DECL_STRCASECMP
|
||||
extern int strcasecmp ();
|
||||
#endif
|
||||
@ -123,7 +138,6 @@ extern int strcoll ();
|
||||
- directories in environment variables (like INFOPATH) are separated
|
||||
by `;' rather than `:';
|
||||
- text files can have their lines ended either with \n or with \r\n pairs;
|
||||
|
||||
These are all parameterized here except the last, which is
|
||||
handled by the source code as appropriate (mostly, in info/). */
|
||||
#ifndef O_BINARY
|
||||
@ -134,13 +148,35 @@ extern int strcoll ();
|
||||
# endif
|
||||
#endif /* O_BINARY */
|
||||
|
||||
/* We'd like to take advantage of _doprnt if it's around, a la error.c,
|
||||
but then we'd have no VA_SPRINTF. */
|
||||
#if HAVE_VPRINTF
|
||||
# if __STDC__
|
||||
# include <stdarg.h>
|
||||
# define VA_START(args, lastarg) va_start(args, lastarg)
|
||||
# else
|
||||
# include <varargs.h>
|
||||
# define VA_START(args, lastarg) va_start(args)
|
||||
# endif
|
||||
# define VA_FPRINTF(file, fmt, ap) vfprintf (file, fmt, ap)
|
||||
# define VA_SPRINTF(str, fmt, ap) vsprintf (str, fmt, ap)
|
||||
#else /* not HAVE_VPRINTF */
|
||||
# define VA_START(args, lastarg)
|
||||
# define va_alist a1, a2, a3, a4, a5, a6, a7, a8
|
||||
# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
|
||||
# define va_end(args)
|
||||
#endif
|
||||
|
||||
#if O_BINARY
|
||||
# include <io.h>
|
||||
# ifdef HAVE_IO_H
|
||||
# include <io.h>
|
||||
# endif
|
||||
# ifdef __MSDOS__
|
||||
# include <limits.h>
|
||||
# ifdef __DJGPP__
|
||||
# define HAVE_LONG_FILENAMES(dir) (pathconf (dir, _PC_NAME_MAX) > 12)
|
||||
# define NULL_DEVICE "/dev/null"
|
||||
# define DEFAULT_INFOPATH "c:/djgpp/info;/usr/local/info;/usr/info;."
|
||||
# else /* !__DJGPP__ */
|
||||
# define HAVE_LONG_FILENAMES(dir) (0)
|
||||
# define NULL_DEVICE "NUL"
|
||||
@ -185,6 +221,15 @@ extern int strcoll ();
|
||||
# define PIPE_USE_FORK 1
|
||||
#endif /* not O_BINARY */
|
||||
|
||||
/* DJGPP supports /dev/null, which is okay for Unix aficionados,
|
||||
shell scripts and Makefiles, but interactive DOS die-hards
|
||||
would probably want to have NUL as well. */
|
||||
#ifdef __DJGPP__
|
||||
# define ALSO_NULL_DEVICE "NUL"
|
||||
#else
|
||||
# define ALSO_NULL_DEVICE ""
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_PWD_H
|
||||
#include <pwd.h>
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* xstrdup.c -- copy a string with out of memory checking
|
||||
Copyright (C) 1990, 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1990, 1996, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -19,24 +19,28 @@
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
|
||||
#ifndef PARAMS
|
||||
# if defined PROTOTYPES || (defined __STDC__ && __STDC__)
|
||||
# define PARAMS(Args) Args
|
||||
# else
|
||||
# define PARAMS(Args) ()
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if STDC_HEADERS || HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#else
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
char *xmalloc (size_t);
|
||||
char *xstrdup (char *string);
|
||||
#else
|
||||
char *xmalloc ();
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
|
||||
char *xmalloc PARAMS ((size_t n));
|
||||
|
||||
/* Return a newly allocated copy of STRING. */
|
||||
|
||||
char *
|
||||
xstrdup (string)
|
||||
char *string;
|
||||
xstrdup (const char *string)
|
||||
{
|
||||
return strcpy (xmalloc (strlen (string) + 1), string);
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ makeinfo is a standalone program to convert Texinfo source into Info
|
||||
files readable with standalone info or M-x info in Emacs.
|
||||
|
||||
makeinfo can also output plain ASCII (with --no-headers)
|
||||
or HTML (with --html).
|
||||
or HTML (with --html) or XML (with --xml).
|
||||
|
||||
The Emacs function M-x texinfo-format-buffer does more or less the same
|
||||
job, but makeinfo is faster and gives better error messages.
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* cmds.c -- Texinfo commands.
|
||||
$Id: cmds.c,v 1.57 1999/09/19 16:39:35 karl Exp $
|
||||
$Id: cmds.c,v 1.69 2002/02/09 00:54:51 karl Exp $
|
||||
|
||||
Copyright (C) 1998, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 99, 2000, 01 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -29,6 +29,7 @@
|
||||
#include "node.h"
|
||||
#include "sectioning.h"
|
||||
#include "toc.h"
|
||||
#include "xml.h"
|
||||
|
||||
#ifdef TM_IN_SYS_TIME
|
||||
#include <sys/time.h>
|
||||
@ -45,7 +46,8 @@ void
|
||||
cm_direntry (), cm_dmn (), cm_dots (), cm_emph (), cm_enddots (), cm_i (),
|
||||
cm_image (), cm_kbd (), cm_key (), cm_no_op (),
|
||||
cm_novalidate (), cm_not_fixed_width (), cm_r (),
|
||||
cm_strong (), cm_var (), cm_sc (), cm_w (), cm_email (), cm_url ();
|
||||
cm_strong (), cm_var (), cm_sc (), cm_w (), cm_email (), cm_url (),
|
||||
cm_verb (), cm_documentdescription ();
|
||||
|
||||
void
|
||||
cm_anchor (), cm_node (), cm_menu (), cm_xref (), cm_ftable (),
|
||||
@ -61,7 +63,8 @@ void
|
||||
cm_defcodeindex (), cm_result (), cm_expansion (), cm_equiv (),
|
||||
cm_print (), cm_error (), cm_point (), cm_today (), cm_flushleft (),
|
||||
cm_flushright (), cm_finalout (), cm_cartouche (), cm_detailmenu (),
|
||||
cm_multitable (), cm_settitle (), cm_titlefont (), cm_tt ();
|
||||
cm_multitable (), cm_settitle (), cm_titlefont (), cm_tt (),
|
||||
cm_verbatim (), cm_verbatiminclude (), cm_titlepage ();
|
||||
|
||||
/* Conditionals. */
|
||||
void cm_set (), cm_clear (), cm_ifset (), cm_ifclear ();
|
||||
@ -80,7 +83,7 @@ static const char small_tag[] = "small";
|
||||
COMMAND command_table[] = {
|
||||
{ "\t", insert_space, NO_BRACE_ARGS },
|
||||
{ "\n", insert_space, NO_BRACE_ARGS },
|
||||
{ " ", insert_self, NO_BRACE_ARGS },
|
||||
{ " ", insert_space, NO_BRACE_ARGS },
|
||||
{ "!", insert_self, NO_BRACE_ARGS },
|
||||
{ "\"", cm_accent_umlaut, MAYBE_BRACE_ARGS },
|
||||
{ "'", cm_accent_acute, MAYBE_BRACE_ARGS },
|
||||
@ -108,7 +111,10 @@ COMMAND command_table[] = {
|
||||
{ "aa", cm_special_char, BRACE_ARGS },
|
||||
{ "acronym", cm_acronym, BRACE_ARGS },
|
||||
{ "ae", cm_special_char, BRACE_ARGS },
|
||||
{ "afivepaper", cm_ignore_line, NO_BRACE_ARGS },
|
||||
{ "afourlatex", cm_ignore_line, NO_BRACE_ARGS },
|
||||
{ "afourpaper", cm_ignore_line, NO_BRACE_ARGS },
|
||||
{ "afourwide", cm_ignore_line, NO_BRACE_ARGS },
|
||||
{ "alias", cm_alias, NO_BRACE_ARGS },
|
||||
{ "anchor", cm_anchor, BRACE_ARGS },
|
||||
{ "appendix", cm_appendix, NO_BRACE_ARGS },
|
||||
@ -182,6 +188,7 @@ COMMAND command_table[] = {
|
||||
{ "direntry", cm_direntry, NO_BRACE_ARGS },
|
||||
{ "display", cm_display, NO_BRACE_ARGS },
|
||||
{ "dmn", cm_no_op, BRACE_ARGS },
|
||||
{ "documentdescription", cm_documentdescription, NO_BRACE_ARGS },
|
||||
{ "documentencoding", cm_documentencoding, NO_BRACE_ARGS },
|
||||
{ "documentlanguage", cm_documentlanguage, NO_BRACE_ARGS },
|
||||
{ "dotaccent", cm_accent, MAYBE_BRACE_ARGS },
|
||||
@ -294,7 +301,7 @@ COMMAND command_table[] = {
|
||||
{ "subsection", cm_subsection, NO_BRACE_ARGS },
|
||||
{ "subsubheading", cm_subsubheading, NO_BRACE_ARGS },
|
||||
{ "subsubsection", cm_subsubsection, NO_BRACE_ARGS },
|
||||
{ "summarycontents", cm_no_op, NO_BRACE_ARGS },
|
||||
{ "summarycontents", cm_shortcontents, NO_BRACE_ARGS },
|
||||
{ "syncodeindex", cm_synindex, NO_BRACE_ARGS },
|
||||
{ "synindex", cm_synindex, NO_BRACE_ARGS },
|
||||
{ "t", cm_tt, BRACE_ARGS },
|
||||
@ -320,6 +327,9 @@ COMMAND command_table[] = {
|
||||
{ "v", cm_accent, MAYBE_BRACE_ARGS },
|
||||
{ "value", cm_value, BRACE_ARGS },
|
||||
{ "var", cm_var, BRACE_ARGS },
|
||||
{ "verb", cm_verb, NO_BRACE_ARGS },
|
||||
{ "verbatim", cm_verbatim, NO_BRACE_ARGS },
|
||||
{ "verbatiminclude", cm_verbatiminclude, NO_BRACE_ARGS },
|
||||
{ "vindex", cm_vindex, NO_BRACE_ARGS },
|
||||
{ "vtable", cm_vtable, NO_BRACE_ARGS },
|
||||
{ "w", cm_w, BRACE_ARGS },
|
||||
@ -363,7 +373,12 @@ insert_space (arg)
|
||||
int arg;
|
||||
{
|
||||
if (arg == START)
|
||||
add_char (' ');
|
||||
{
|
||||
if (xml && !docbook)
|
||||
xml_insert_entity ("space");
|
||||
else
|
||||
add_char (' ');
|
||||
}
|
||||
}
|
||||
|
||||
/* Force a line break in the output. */
|
||||
@ -372,6 +387,10 @@ cm_asterisk ()
|
||||
{
|
||||
if (html)
|
||||
add_word ("<br>");
|
||||
else if (xml && !docbook)
|
||||
xml_insert_entity ("linebreak");
|
||||
else if (docbook)
|
||||
xml_asterisk ();
|
||||
else
|
||||
{
|
||||
close_single_paragraph ();
|
||||
@ -385,7 +404,14 @@ cm_dots (arg)
|
||||
int arg;
|
||||
{
|
||||
if (arg == START)
|
||||
add_word (html ? "<small>...</small>" : "...");
|
||||
{
|
||||
if (xml && !docbook)
|
||||
xml_insert_entity ("dots");
|
||||
else if (docbook)
|
||||
xml_insert_entity ("hellip");
|
||||
else
|
||||
add_word (html ? "<small>...</small>" : "...");
|
||||
}
|
||||
}
|
||||
|
||||
/* Insert ellipsis for sentence end. */
|
||||
@ -394,7 +420,17 @@ cm_enddots (arg)
|
||||
int arg;
|
||||
{
|
||||
if (arg == START)
|
||||
add_word (html ? "<small>...</small>." : "....");
|
||||
{
|
||||
if (xml && !docbook)
|
||||
xml_insert_entity ("enddots");
|
||||
else if (docbook)
|
||||
{
|
||||
xml_insert_entity ("hellip");
|
||||
add_char ('.');
|
||||
}
|
||||
else
|
||||
add_word (html ? "<small>...</small>." : "....");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -405,6 +441,10 @@ cm_bullet (arg)
|
||||
{
|
||||
if (html)
|
||||
add_word ("•");
|
||||
else if (xml && !docbook)
|
||||
xml_insert_entity ("bullet");
|
||||
else if (docbook)
|
||||
xml_insert_entity ("bull");
|
||||
else
|
||||
add_char ('*');
|
||||
}
|
||||
@ -415,7 +455,12 @@ cm_minus (arg)
|
||||
int arg;
|
||||
{
|
||||
if (arg == START)
|
||||
add_char ('-');
|
||||
{
|
||||
if (xml)
|
||||
xml_insert_entity ("minus");
|
||||
else
|
||||
add_char ('-');
|
||||
}
|
||||
}
|
||||
|
||||
/* Insert "TeX". */
|
||||
@ -424,7 +469,12 @@ cm_TeX (arg)
|
||||
int arg;
|
||||
{
|
||||
if (arg == START)
|
||||
add_word ("TeX");
|
||||
{
|
||||
if (xml && ! docbook)
|
||||
xml_insert_entity ("tex");
|
||||
else
|
||||
add_word ("TeX");
|
||||
}
|
||||
}
|
||||
|
||||
/* Copyright symbol. */
|
||||
@ -433,10 +483,16 @@ cm_copyright (arg)
|
||||
int arg;
|
||||
{
|
||||
if (arg == START)
|
||||
{
|
||||
if (html)
|
||||
add_word ("©");
|
||||
else if (xml && !docbook)
|
||||
xml_insert_entity ("copyright");
|
||||
else if (docbook)
|
||||
xml_insert_entity ("copy");
|
||||
else
|
||||
add_word ("(C)");
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -462,6 +518,8 @@ cm_acronym (arg)
|
||||
{
|
||||
if (html)
|
||||
insert_html_tag (arg, small_tag);
|
||||
else if (xml)
|
||||
xml_insert_element (ACRONYM, arg);
|
||||
}
|
||||
|
||||
void
|
||||
@ -471,12 +529,18 @@ cm_tt (arg)
|
||||
/* @t{} is a no-op in Info. */
|
||||
if (html)
|
||||
insert_html_tag (arg, "tt");
|
||||
else if (xml)
|
||||
xml_insert_element (TT, arg);
|
||||
}
|
||||
|
||||
void
|
||||
cm_code (arg)
|
||||
int arg;
|
||||
{
|
||||
if (xml)
|
||||
xml_insert_element (CODE, arg);
|
||||
else
|
||||
{
|
||||
extern int printing_index;
|
||||
|
||||
if (arg == START)
|
||||
@ -495,13 +559,16 @@ cm_code (arg)
|
||||
if (!printing_index)
|
||||
add_meta_char ('\'');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
cm_kbd (arg)
|
||||
int arg;
|
||||
{
|
||||
if (html)
|
||||
if (xml)
|
||||
xml_insert_element (KBD, arg);
|
||||
else if (html)
|
||||
{ /* Seems like we should increment in_fixed_width_font for Info
|
||||
format too, but then the quote-omitting special case gets
|
||||
confused. Punt. */
|
||||
@ -520,7 +587,9 @@ cm_kbd (arg)
|
||||
void
|
||||
cm_url (arg, start, end)
|
||||
{
|
||||
if (html)
|
||||
if (xml)
|
||||
xml_insert_element (URL, arg);
|
||||
else if (html)
|
||||
{
|
||||
if (arg == START)
|
||||
add_word ("<<code>");
|
||||
@ -538,7 +607,9 @@ void
|
||||
cm_key (arg)
|
||||
int arg;
|
||||
{
|
||||
if (html)
|
||||
if (xml)
|
||||
xml_insert_element (KEY, arg);
|
||||
else if (html)
|
||||
add_word (arg == START ? "<" : ">");
|
||||
else
|
||||
add_char (arg == START ? '<' : '>');
|
||||
@ -558,6 +629,10 @@ void
|
||||
cm_var (arg, start_pos, end_pos)
|
||||
int arg, start_pos, end_pos;
|
||||
{
|
||||
if (xml)
|
||||
xml_insert_element (VAR, arg);
|
||||
else
|
||||
{
|
||||
not_fixed_width (arg);
|
||||
|
||||
if (html)
|
||||
@ -573,12 +648,17 @@ cm_var (arg, start_pos, end_pos)
|
||||
start_pos++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
cm_sc (arg, start_pos, end_pos)
|
||||
int arg, start_pos, end_pos;
|
||||
{
|
||||
if (xml)
|
||||
xml_insert_element (SC, arg);
|
||||
else
|
||||
{
|
||||
not_fixed_width (arg);
|
||||
|
||||
if (arg == START)
|
||||
@ -588,11 +668,15 @@ cm_sc (arg, start_pos, end_pos)
|
||||
}
|
||||
else
|
||||
{
|
||||
int all_upper = 1;
|
||||
int all_upper;
|
||||
|
||||
if (html)
|
||||
start_pos += sizeof (small_tag) + 2 - 1; /* skip <small> */
|
||||
|
||||
/* Avoid the warning below if there's no text inside @sc{}, or
|
||||
when processing menus under --no-headers. */
|
||||
all_upper = start_pos < end_pos;
|
||||
|
||||
while (start_pos < end_pos)
|
||||
{
|
||||
unsigned char c = output_paragraph[start_pos];
|
||||
@ -607,35 +691,111 @@ cm_sc (arg, start_pos, end_pos)
|
||||
if (html)
|
||||
insert_html_tag (arg, small_tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
cm_dfn (arg, position)
|
||||
int arg, position;
|
||||
{
|
||||
if (xml)
|
||||
xml_insert_element (DFN, arg);
|
||||
else
|
||||
{
|
||||
if (html)
|
||||
insert_html_tag (arg, "dfn");
|
||||
else if (arg == START)
|
||||
add_char ('"');
|
||||
else
|
||||
add_meta_char ('"');
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
cm_emph (arg)
|
||||
int arg;
|
||||
{
|
||||
if (html)
|
||||
if (xml)
|
||||
xml_insert_element (EMPH, arg);
|
||||
else if (html)
|
||||
insert_html_tag (arg, "em");
|
||||
else
|
||||
add_char ('_');
|
||||
}
|
||||
|
||||
void
|
||||
cm_verb (arg)
|
||||
int arg;
|
||||
{
|
||||
int character;
|
||||
int delimiter;
|
||||
int seen_end = 0;
|
||||
|
||||
in_fixed_width_font++;
|
||||
/* are these necessary ? */
|
||||
last_char_was_newline = 0;
|
||||
|
||||
if (html)
|
||||
add_word ("<pre>");
|
||||
|
||||
if (input_text_offset < input_text_length)
|
||||
{
|
||||
character = curchar ();
|
||||
if (character == '{')
|
||||
input_text_offset++;
|
||||
else
|
||||
line_error (_("`{' expected, but saw `%c'"), character);
|
||||
}
|
||||
|
||||
if (input_text_offset < input_text_length)
|
||||
{
|
||||
delimiter = curchar ();
|
||||
input_text_offset++;
|
||||
}
|
||||
|
||||
while (input_text_offset < input_text_length)
|
||||
{
|
||||
character = curchar ();
|
||||
|
||||
if (character == '\n')
|
||||
line_number++;
|
||||
/*
|
||||
Assume no newlines in END_VERBATIM
|
||||
*/
|
||||
else if (character == delimiter)
|
||||
{
|
||||
seen_end = 1;
|
||||
input_text_offset++;
|
||||
break;
|
||||
}
|
||||
|
||||
add_char (character);
|
||||
input_text_offset++;
|
||||
}
|
||||
|
||||
if (!seen_end)
|
||||
warning (_("end of file inside verb block"));
|
||||
|
||||
if (input_text_offset < input_text_length)
|
||||
{
|
||||
character = curchar ();
|
||||
if (character == '}')
|
||||
input_text_offset++;
|
||||
else
|
||||
line_error (_("`}' expected, but saw `%c'"), character);
|
||||
}
|
||||
|
||||
if (html)
|
||||
add_word ("</pre>");
|
||||
}
|
||||
|
||||
void
|
||||
cm_strong (arg, position)
|
||||
int arg, position;
|
||||
{
|
||||
if (html)
|
||||
if (xml)
|
||||
xml_insert_element (STRONG, arg);
|
||||
else if (html)
|
||||
insert_html_tag (arg, "strong");
|
||||
else
|
||||
add_char ('*');
|
||||
@ -645,7 +805,9 @@ void
|
||||
cm_cite (arg, position)
|
||||
int arg, position;
|
||||
{
|
||||
if (html)
|
||||
if (xml)
|
||||
xml_insert_element (CITE, arg);
|
||||
else if (html)
|
||||
insert_html_tag (arg, "cite");
|
||||
else
|
||||
{
|
||||
@ -661,6 +823,8 @@ void
|
||||
cm_not_fixed_width (arg, start, end)
|
||||
int arg, start, end;
|
||||
{
|
||||
if (xml)
|
||||
xml_insert_element (NOTFIXEDWIDTH, arg);
|
||||
not_fixed_width (arg);
|
||||
}
|
||||
|
||||
@ -668,7 +832,9 @@ void
|
||||
cm_i (arg)
|
||||
int arg;
|
||||
{
|
||||
if (html)
|
||||
if (xml)
|
||||
xml_insert_element (I, arg);
|
||||
else if (html)
|
||||
insert_html_tag (arg, "i");
|
||||
else
|
||||
not_fixed_width (arg);
|
||||
@ -678,7 +844,9 @@ void
|
||||
cm_b (arg)
|
||||
int arg;
|
||||
{
|
||||
if (html)
|
||||
if (xml)
|
||||
xml_insert_element (B, arg);
|
||||
else if (html)
|
||||
insert_html_tag (arg, "b");
|
||||
else
|
||||
not_fixed_width (arg);
|
||||
@ -688,32 +856,40 @@ void
|
||||
cm_r (arg)
|
||||
int arg;
|
||||
{
|
||||
extern int printing_index;
|
||||
|
||||
/* People use @r{} in index entries like this:
|
||||
|
||||
@findex foo@r{, some text}
|
||||
|
||||
This is supposed to produce output as if the entry were saying
|
||||
"@code{foo}, some text", since the "fn" index is typeset as
|
||||
@code. The following attempts to do the same in HTML. Note that
|
||||
this relies on the fact that only @code bumps up the variable
|
||||
in_fixed_width_font while processing index entries in HTML mode. */
|
||||
if (html && printing_index)
|
||||
if (xml)
|
||||
xml_insert_element (R, arg);
|
||||
else
|
||||
{
|
||||
int level = in_fixed_width_font;
|
||||
extern int printing_index;
|
||||
|
||||
while (level--)
|
||||
insert_html_tag (arg == START ? END : START, "code");
|
||||
/* People use @r{} in index entries like this:
|
||||
|
||||
@findex foo@r{, some text}
|
||||
|
||||
This is supposed to produce output as if the entry were saying
|
||||
"@code{foo}, some text", since the "fn" index is typeset as
|
||||
@code. The following attempts to do the same in HTML. Note that
|
||||
this relies on the fact that only @code bumps up the variable
|
||||
in_fixed_width_font while processing index entries in HTML mode. */
|
||||
if (html && printing_index)
|
||||
{
|
||||
int level = in_fixed_width_font;
|
||||
|
||||
while (level--)
|
||||
insert_html_tag (arg == START ? END : START, "code");
|
||||
}
|
||||
|
||||
not_fixed_width (arg);
|
||||
}
|
||||
|
||||
not_fixed_width (arg);
|
||||
}
|
||||
|
||||
void
|
||||
cm_titlefont (arg)
|
||||
int arg;
|
||||
{
|
||||
if (xml)
|
||||
xml_insert_element (TITLEFONT, arg);
|
||||
else
|
||||
not_fixed_width (arg);
|
||||
}
|
||||
|
||||
@ -776,15 +952,27 @@ cm_setfilename ()
|
||||
char *filename;
|
||||
get_rest_of_line (1, &filename);
|
||||
/* warning ("`@%s %s' encountered and ignored", command, filename); */
|
||||
if (xml)
|
||||
add_word_args ("<setfilename>%s</setfilename>", filename);
|
||||
free (filename);
|
||||
}
|
||||
|
||||
void
|
||||
cm_settitle ()
|
||||
{
|
||||
get_rest_of_line (0, &title);
|
||||
if (xml)
|
||||
{
|
||||
xml_begin_document ();
|
||||
xml_insert_element (SETTITLE, START);
|
||||
get_rest_of_line (0, &title);
|
||||
execute_string ("%s", title);
|
||||
xml_insert_element (SETTITLE, END);
|
||||
}
|
||||
else
|
||||
get_rest_of_line (0, &title);
|
||||
}
|
||||
|
||||
|
||||
/* Ignore argument in braces. */
|
||||
void
|
||||
cm_ignore_arg (arg, start_pos, end_pos)
|
||||
@ -813,7 +1001,16 @@ cm_sp ()
|
||||
if (sscanf (line, "%d", &lines) != 1 || lines <= 0)
|
||||
line_error (_("@sp requires a positive numeric argument, not `%s'"), line);
|
||||
else
|
||||
{ /* Must disable filling since otherwise multiple newlines is like
|
||||
{
|
||||
if (xml)
|
||||
{
|
||||
xml_insert_element_with_attribute (SP, START, "lines=\"%s\"", line);
|
||||
/* insert_string (line);*/
|
||||
xml_insert_element (SP, END);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Must disable filling since otherwise multiple newlines is like
|
||||
multiple spaces. Must close paragraph since that's what the
|
||||
manual says and that's what TeX does. */
|
||||
int save_filling_enabled = filling_enabled;
|
||||
@ -821,6 +1018,9 @@ cm_sp ()
|
||||
|
||||
close_paragraph ();
|
||||
|
||||
if (lines && html && !executing_string)
|
||||
html_output_head ();
|
||||
|
||||
while (lines--)
|
||||
{
|
||||
if (html)
|
||||
@ -831,6 +1031,7 @@ cm_sp ()
|
||||
|
||||
filling_enabled = save_filling_enabled;
|
||||
}
|
||||
}
|
||||
free (line);
|
||||
}
|
||||
|
||||
@ -840,8 +1041,16 @@ cm_dircategory ()
|
||||
{
|
||||
char *line;
|
||||
|
||||
if (html)
|
||||
if (html || docbook)
|
||||
cm_ignore_line ();
|
||||
else if (xml)
|
||||
{
|
||||
xml_insert_element (DIRCATEGORY, START);
|
||||
get_rest_of_line (1, &line);
|
||||
insert_string (line);
|
||||
free (line);
|
||||
xml_insert_element (DIRCATEGORY, END);
|
||||
}
|
||||
else
|
||||
{
|
||||
get_rest_of_line (1, &line);
|
||||
@ -860,23 +1069,33 @@ cm_dircategory ()
|
||||
|
||||
/* Start a new line with just this text on it.
|
||||
Then center the line of text.
|
||||
This always ends the current paragraph. */
|
||||
*/
|
||||
void
|
||||
cm_center ()
|
||||
{
|
||||
if (xml)
|
||||
{
|
||||
unsigned char *line;
|
||||
xml_insert_element (CENTER, START);
|
||||
get_rest_of_line (0, (char **)&line);
|
||||
execute_string ("%s", (char *)line);
|
||||
free (line);
|
||||
xml_insert_element (CENTER, END);
|
||||
}
|
||||
else
|
||||
{
|
||||
int i, start, length;
|
||||
unsigned char *line;
|
||||
int save_indented_fill = indented_fill;
|
||||
int save_filling_enabled = filling_enabled;
|
||||
int fudge_factor = 1;
|
||||
|
||||
close_paragraph ();
|
||||
filling_enabled = indented_fill = 0;
|
||||
cm_noindent ();
|
||||
start = output_paragraph_offset;
|
||||
|
||||
if (html)
|
||||
add_word ("<p align=\"center\">");
|
||||
add_word ("<div align=\"center\">");
|
||||
|
||||
inhibit_output_flushing ();
|
||||
get_rest_of_line (0, (char **)&line);
|
||||
@ -884,7 +1103,7 @@ cm_center ()
|
||||
free (line);
|
||||
uninhibit_output_flushing ();
|
||||
if (html)
|
||||
add_word ("</p>");
|
||||
add_word ("</div>");
|
||||
|
||||
else
|
||||
{
|
||||
@ -914,9 +1133,9 @@ cm_center ()
|
||||
}
|
||||
|
||||
insert ('\n');
|
||||
close_paragraph ();
|
||||
filling_enabled = save_filling_enabled;
|
||||
indented_fill = save_indented_fill;
|
||||
}
|
||||
}
|
||||
|
||||
/* Show what an expression returns. */
|
||||
@ -1012,10 +1231,14 @@ cm_exdent ()
|
||||
in_fixed_width_font = save_in_fixed_width_font;
|
||||
}
|
||||
|
||||
|
||||
/* Remember this file, and move onto the next. */
|
||||
void
|
||||
cm_include ()
|
||||
/*
|
||||
Read include-filename, process the include-file:
|
||||
verbatim_include == 0: process through reader_loop
|
||||
verbatim_include != 0: process through handle_verbatim_environment
|
||||
*/
|
||||
static void
|
||||
handle_include (verbatim_include)
|
||||
int verbatim_include;
|
||||
{
|
||||
char *filename;
|
||||
|
||||
@ -1041,7 +1264,7 @@ cm_include ()
|
||||
i *= 2;
|
||||
|
||||
printf ("%*s", i, "");
|
||||
printf ("%c%s %s\n", COMMAND_PREFIX, command, filename);
|
||||
printf ("%c%s `%s'\n", COMMAND_PREFIX, command, filename);
|
||||
fflush (stdout);
|
||||
}
|
||||
|
||||
@ -1052,8 +1275,8 @@ cm_include ()
|
||||
popfile ();
|
||||
line_number--;
|
||||
|
||||
/* Cannot "@include foo", in line 5 of "/wh/bar". */
|
||||
line_error ("%c%s %s: %s", COMMAND_PREFIX, command, filename,
|
||||
/* /wh/bar:5: @include/@verbatiminclude `foo': No such file or dir */
|
||||
line_error ("%c%s `%s': %s", COMMAND_PREFIX, command, filename,
|
||||
strerror (errno));
|
||||
|
||||
free (filename);
|
||||
@ -1062,14 +1285,34 @@ cm_include ()
|
||||
else
|
||||
{
|
||||
if (macro_expansion_output_stream && !executing_string)
|
||||
remember_itext (input_text, input_text_offset);
|
||||
reader_loop ();
|
||||
remember_itext (input_text, input_text_offset);
|
||||
|
||||
if (!verbatim_include)
|
||||
reader_loop ();
|
||||
else
|
||||
handle_verbatim_environment (0);
|
||||
}
|
||||
free (filename);
|
||||
popfile ();
|
||||
}
|
||||
|
||||
|
||||
/* Include file as if put in @verbatim environment */
|
||||
void
|
||||
cm_verbatiminclude ()
|
||||
{
|
||||
handle_include (1);
|
||||
}
|
||||
|
||||
|
||||
/* Remember this file, and move onto the next. */
|
||||
void
|
||||
cm_include ()
|
||||
{
|
||||
handle_include (0);
|
||||
}
|
||||
|
||||
|
||||
/* @bye: Signals end of processing. Easy to make this happen. */
|
||||
|
||||
void
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* defun.c -- @defun and friends.
|
||||
$Id: defun.c,v 1.11 1999/07/11 16:50:19 karl Exp $
|
||||
$Id: defun.c,v 1.18 2002/01/22 18:01:24 karl Exp $
|
||||
|
||||
Copyright (C) 1998, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 99, 2000, 01, 02 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -19,6 +19,7 @@
|
||||
|
||||
#include "system.h"
|
||||
#include "defun.h"
|
||||
#include "docbook.h"
|
||||
#include "insertion.h"
|
||||
#include "makeinfo.h"
|
||||
|
||||
@ -395,9 +396,9 @@ defun_internal (type, x_p)
|
||||
type_name = next_nonwhite_defun_arg (&scan_args);
|
||||
|
||||
/* The type name for typed languages. */
|
||||
if (base_type == deftypemethod
|
||||
|| base_type == deftypeivar
|
||||
|| base_type == deftypeop
|
||||
if ((base_type == deftypemethod)
|
||||
|| (base_type == deftypeivar)
|
||||
|| (base_type == deftypeop)
|
||||
)
|
||||
type_name2 = next_nonwhite_defun_arg (&scan_args);
|
||||
|
||||
@ -422,6 +423,13 @@ defun_internal (type, x_p)
|
||||
defined_name = tem;
|
||||
}
|
||||
|
||||
/* It's easy to write @defun foo(arg1 arg2), but a following ( is
|
||||
misparsed by texinfo.tex and this is next to impossible to fix.
|
||||
Warn about it. */
|
||||
if (*scan_args && **scan_args && **scan_args == '(')
|
||||
warning ("`%c' follows defined name `%s' instead of whitespace",
|
||||
**scan_args, defined_name);
|
||||
|
||||
if (!x_p)
|
||||
begin_insertion (type);
|
||||
|
||||
@ -430,11 +438,15 @@ defun_internal (type, x_p)
|
||||
current_indent -= default_indentation_increment;
|
||||
start_paragraph ();
|
||||
|
||||
if (html && !x_p)
|
||||
if (!x_p) {
|
||||
/* Start the definition on new paragraph. */
|
||||
add_word ("<p>\n");
|
||||
if (html)
|
||||
add_word ("<p>\n");
|
||||
if (docbook)
|
||||
docbook_begin_paragraph ();
|
||||
}
|
||||
|
||||
if (!html)
|
||||
if (!html && !docbook)
|
||||
switch (base_type)
|
||||
{
|
||||
case deffn:
|
||||
@ -473,13 +485,16 @@ defun_internal (type, x_p)
|
||||
/* If this is not a @def...x version, it could only
|
||||
be a normal version @def.... So start the table here. */
|
||||
if (!x_p)
|
||||
add_word ("<table width=\"100%\">\n");
|
||||
{
|
||||
add_html_elt ("<table width=");
|
||||
add_word ("\"100%\">\n");
|
||||
}
|
||||
|
||||
/* If this is an @def...x there has to be an other @def... before
|
||||
it, so this is only a new row within an existing table. With
|
||||
two complete standalone tables the gap between them is too big. */
|
||||
add_word ("<tr>\n");
|
||||
add_word ("<td align=\"left\">");
|
||||
add_html_elt ("<td align=\"left\">");
|
||||
|
||||
switch (base_type)
|
||||
{
|
||||
@ -487,24 +502,61 @@ defun_internal (type, x_p)
|
||||
case defvr:
|
||||
case deftp:
|
||||
/* <i> is for the following function arguments. */
|
||||
add_word_args ("<b>%s</b><i>", defined_name);
|
||||
add_word ("<b>");
|
||||
execute_string ("%s", defined_name);
|
||||
add_word ("</b><i>");
|
||||
break;
|
||||
case deftypefn:
|
||||
case deftypevr:
|
||||
add_word_args ("%s <b>%s</b><i>", type_name, defined_name);
|
||||
execute_string ("%s ", type_name);
|
||||
add_word ("<b>");
|
||||
execute_string ("%s", defined_name);
|
||||
add_word ("</b><i>");
|
||||
break;
|
||||
case defcv:
|
||||
case defop:
|
||||
add_word_args ("<b>%s</b><i>", defined_name);
|
||||
add_word ("<b>");
|
||||
execute_string ("%s", defined_name);
|
||||
add_word ("</b><i>");
|
||||
break;
|
||||
case deftypemethod:
|
||||
case deftypeop:
|
||||
case deftypeivar:
|
||||
add_word_args ("%s <b>%s</b><i>", type_name2, defined_name);
|
||||
execute_string ("%s ", type_name2);
|
||||
add_word ("<b>");
|
||||
execute_string ("%s", defined_name);
|
||||
add_word ("</b><i>");
|
||||
break;
|
||||
}
|
||||
} /* if (html)... */
|
||||
|
||||
if (docbook)
|
||||
{
|
||||
switch (base_type)
|
||||
{
|
||||
case deffn:
|
||||
case defvr:
|
||||
case deftp:
|
||||
case defcv:
|
||||
case defop:
|
||||
add_word_args ("<%s>%s</%s>", DB_FUNCTION, defined_name,
|
||||
DB_FUNCTION);
|
||||
break;
|
||||
case deftypefn:
|
||||
case deftypevr:
|
||||
add_word_args ("%s <%s>%s</%s>", type_name, DB_FUNCTION,
|
||||
defined_name, DB_FUNCTION);
|
||||
break;
|
||||
case deftypemethod:
|
||||
case deftypeop:
|
||||
case deftypeivar:
|
||||
add_word_args ("%s <%s>%s</%s>", type_name2, DB_FUNCTION,
|
||||
defined_name, DB_FUNCTION);
|
||||
break;
|
||||
}
|
||||
|
||||
} /* if (docbook)... */
|
||||
|
||||
current_indent += default_indentation_increment;
|
||||
|
||||
/* Now process the function arguments, if any. If these carry onto
|
||||
@ -548,32 +600,37 @@ defun_internal (type, x_p)
|
||||
case deftypevr:
|
||||
add_word ("</i>"); /* close italic area for arguments */
|
||||
/* put the rest into the second column */
|
||||
add_word_args ("</td>\n<td align=\"right\">%s", category);
|
||||
add_word ("</td>\n");
|
||||
add_html_elt ("<td align=\"right\">");
|
||||
execute_string ("%s", category);
|
||||
break;
|
||||
|
||||
case defcv:
|
||||
add_word ("</td>\n<td align=\"right\">");
|
||||
add_word_args ("%s %s %s", category, _("of"), type_name);
|
||||
break;
|
||||
|
||||
case defop:
|
||||
case deftypemethod:
|
||||
case deftypeop:
|
||||
add_word ("</i>");
|
||||
add_word ("</td>\n<td align=\"right\">");
|
||||
add_word_args ("%s %s %s", category, _("on"), type_name);
|
||||
break;
|
||||
|
||||
case deftypeivar:
|
||||
add_word ("</i>");
|
||||
add_word ("</td>\n<td align=\"right\">");
|
||||
add_word_args ("%s %s %s", category, _("of"), type_name);
|
||||
break;
|
||||
} /* switch (base_type)... */
|
||||
|
||||
|
||||
case defcv:
|
||||
add_word ("</td>\n");
|
||||
add_html_elt ("<td align=\"right\">");
|
||||
execute_string ("%s %s %s", category, _("of"), type_name);
|
||||
break;
|
||||
|
||||
case defop:
|
||||
case deftypemethod:
|
||||
case deftypeop:
|
||||
add_word ("</i>");
|
||||
add_word ("</td>\n");
|
||||
add_html_elt ("<td align=\"right\">");
|
||||
execute_string ("%s %s %s", category, _("on"), type_name);
|
||||
break;
|
||||
|
||||
case deftypeivar:
|
||||
add_word ("</i>");
|
||||
add_word ("</td>\n");
|
||||
add_html_elt ("<td align=\"right\">");
|
||||
execute_string ("%s %s %s", category, _("of"), type_name);
|
||||
break;
|
||||
} /* switch (base_type)... */
|
||||
|
||||
add_word ("</td>\n"); /* close second column */
|
||||
add_word ("</tr>\n"); /* close row */
|
||||
|
||||
|
||||
/* This is needed because I have to know if the next line is
|
||||
normal text or another @def..x. If text follows, create a new
|
||||
table to get the indentation for the following text.
|
||||
@ -588,10 +645,10 @@ defun_internal (type, x_p)
|
||||
if (!looking_at ("@def"))
|
||||
{
|
||||
add_word ("</table>\n");
|
||||
add_word ("<table width=\"95%\" align=\"center\">\n");
|
||||
add_word ("<tr><td>\n");
|
||||
add_html_elt ("<table width=\"95%\" align=\"center\">");
|
||||
add_word ("\n<tr><td>\n");
|
||||
}
|
||||
|
||||
|
||||
} /* if (html)... */
|
||||
|
||||
/* Make an entry in the appropriate index. */
|
||||
|
492
contrib/texinfo/makeinfo/docbook.c
Normal file
492
contrib/texinfo/makeinfo/docbook.c
Normal file
@ -0,0 +1,492 @@
|
||||
/* docbook.c -- docbook output.
|
||||
$Id: docbook.c,v 1.3 2001/12/31 16:52:17 karl Exp $
|
||||
|
||||
Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "system.h"
|
||||
#include "cmds.h"
|
||||
#include "docbook.h"
|
||||
#include "insertion.h"
|
||||
#include "lang.h"
|
||||
#include "makeinfo.h"
|
||||
#include "macro.h"
|
||||
#include "sectioning.h"
|
||||
|
||||
int docbook_version_inserted = 0;
|
||||
int docbook_first_chapter_found = 0;
|
||||
int docbook_must_insert_node_anchor = 0;
|
||||
int docbook_begin_book_p = 0;
|
||||
int docbook_no_new_paragraph = 0;
|
||||
|
||||
static int section_level = -1;
|
||||
static int in_docbook_paragraph = 0;
|
||||
static int in_list = 0;
|
||||
|
||||
static int in_table = 0;
|
||||
static int in_term = 0;
|
||||
static int in_entry = 0;
|
||||
static int in_varlistitem = 0;
|
||||
|
||||
static int in_example = 0;
|
||||
|
||||
void
|
||||
docbook_begin_section (level, cmd)
|
||||
int level;
|
||||
char *cmd;
|
||||
{
|
||||
int i, old_no_indent;
|
||||
char *temp, *tem;
|
||||
static char *last_chap = NULL;
|
||||
|
||||
close_paragraph ();
|
||||
docbook_first_chapter_found = 1;
|
||||
filling_enabled = indented_fill = 0;
|
||||
old_no_indent = no_indent;
|
||||
no_indent = 1;
|
||||
|
||||
if (!docbook_begin_book_p)
|
||||
docbook_begin_book ();
|
||||
|
||||
if (macro_expansion_output_stream && !executing_string)
|
||||
append_to_expansion_output (input_text_offset + 1);
|
||||
|
||||
get_rest_of_line (0, &temp);
|
||||
|
||||
if (in_docbook_paragraph)
|
||||
{
|
||||
insert_string ("\n</para>\n\n");
|
||||
adjust_braces_following (0, 10);
|
||||
}
|
||||
in_docbook_paragraph = 0;
|
||||
docbook_no_new_paragraph++;
|
||||
|
||||
if (level > section_level + 1)
|
||||
level = section_level + 1;
|
||||
|
||||
for (i = section_level; i >= level ; i--)
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
if (last_chap && strcmp(last_chap, "appendix") == 0)
|
||||
add_word ("</appendix>\n\n");
|
||||
else
|
||||
add_word ("</chapter>\n\n");
|
||||
}
|
||||
else
|
||||
add_word_args ("</sect%d>\n\n", i);
|
||||
}
|
||||
|
||||
section_level = level;
|
||||
|
||||
if (level == 0)
|
||||
{
|
||||
if (strcmp(cmd, "appendix") == 0)
|
||||
add_word ("<appendix");
|
||||
else
|
||||
add_word ("<chapter");
|
||||
last_chap = cmd;
|
||||
}
|
||||
else
|
||||
add_word_args ("<sect%d", level);
|
||||
|
||||
if (docbook_must_insert_node_anchor)
|
||||
{
|
||||
add_word (" id=\"");
|
||||
tem = expansion (current_node, 0);
|
||||
add_escaped_anchor_name (tem, 0);
|
||||
free (tem);
|
||||
add_word ("\"");
|
||||
docbook_must_insert_node_anchor = 0;
|
||||
}
|
||||
add_word (">\n");
|
||||
add_word ("<title>");
|
||||
|
||||
if (macro_expansion_output_stream && !executing_string)
|
||||
{
|
||||
char *temp1 = xmalloc (2 + strlen (temp));
|
||||
sprintf (temp1, "%s", temp);
|
||||
remember_itext (input_text, input_text_offset);
|
||||
me_execute_string (temp1);
|
||||
free (temp1);
|
||||
}
|
||||
else
|
||||
execute_string ("%s", temp);
|
||||
|
||||
free (temp);
|
||||
|
||||
add_word ("</title>\n");
|
||||
|
||||
close_paragraph ();
|
||||
filling_enabled = 1;
|
||||
no_indent = old_no_indent;
|
||||
docbook_no_new_paragraph--;
|
||||
insert_string("\n<para>");
|
||||
in_docbook_paragraph = 1;
|
||||
}
|
||||
|
||||
void
|
||||
docbook_begin_paragraph ()
|
||||
{
|
||||
if (!docbook_first_chapter_found)
|
||||
return;
|
||||
|
||||
if (in_example)
|
||||
return;
|
||||
|
||||
if (in_table && !in_term)
|
||||
{
|
||||
if (!in_varlistitem)
|
||||
insert_string ("\n<listitem><para>\n");
|
||||
else
|
||||
insert_string ("\n</para>\n\n<para>\n");
|
||||
in_varlistitem = 1;
|
||||
|
||||
return;
|
||||
}
|
||||
if (in_list)
|
||||
return;
|
||||
if (in_docbook_paragraph)
|
||||
{
|
||||
insert_string ("\n</para>\n\n");
|
||||
adjust_braces_following (0, 10);
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (docbook_must_insert_node_anchor)
|
||||
{
|
||||
char *tem;
|
||||
insert_string ("<para id=\"");
|
||||
adjust_braces_following (0, 10);
|
||||
tem = expansion (current_node, 0);
|
||||
add_escaped_anchor_name (tem, 0);
|
||||
free (tem);
|
||||
add_word ("\">\n");
|
||||
docbook_must_insert_node_anchor = 0;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
insert_string ("<para>\n");
|
||||
adjust_braces_following (0, 7);
|
||||
}
|
||||
in_docbook_paragraph = 1;
|
||||
}
|
||||
|
||||
void
|
||||
docbook_begin_book ()
|
||||
{
|
||||
if (!docbook_begin_book_p)
|
||||
docbook_begin_book_p = 1;
|
||||
else
|
||||
return;
|
||||
|
||||
++docbook_no_new_paragraph;
|
||||
add_word_args ("<!DOCTYPE book PUBLIC \"-//Davenport//DTD DocBook V3.0//EN\">\n\
|
||||
<book>\n<title>%s</title>\n", title);
|
||||
--docbook_no_new_paragraph;
|
||||
}
|
||||
|
||||
void
|
||||
docbook_end_book ()
|
||||
{
|
||||
int i;
|
||||
if (in_docbook_paragraph)
|
||||
{
|
||||
insert_string ("\n</para>\n\n");
|
||||
}
|
||||
|
||||
for (i = section_level; i >= 0 ; i--)
|
||||
{
|
||||
if (i == 0)
|
||||
add_word ("</chapter>\n");
|
||||
else
|
||||
add_word_args ("</sect%d>\n", i);
|
||||
}
|
||||
|
||||
add_word ("</book>\n");
|
||||
}
|
||||
|
||||
void
|
||||
docbook_insert_tag (start_or_end, tag)
|
||||
int start_or_end;
|
||||
char *tag;
|
||||
{
|
||||
if (!paragraph_is_open && start_or_end == START)
|
||||
docbook_begin_paragraph ();
|
||||
|
||||
add_char ('<');
|
||||
if (start_or_end == START)
|
||||
add_word (tag);
|
||||
else
|
||||
{
|
||||
add_char ('/');
|
||||
for (; *tag && *tag != ' '; tag++)
|
||||
add_char(*tag);
|
||||
}
|
||||
add_meta_char ('>');
|
||||
}
|
||||
|
||||
void
|
||||
docbook_xref1 (node_name)
|
||||
char *node_name;
|
||||
{
|
||||
char *tem;
|
||||
add_word ("<xref linkend=\"");
|
||||
tem = expansion (node_name, 0);
|
||||
add_escaped_anchor_name (tem, 1);
|
||||
free (tem);
|
||||
add_word ("\"/>");
|
||||
}
|
||||
|
||||
void
|
||||
docbook_xref2 (node_name, ref_name)
|
||||
char *node_name;
|
||||
char *ref_name;
|
||||
{
|
||||
char *tem;
|
||||
add_word ("<xref linkend=\"");
|
||||
tem = expansion (node_name, 0);
|
||||
add_escaped_anchor_name (tem, 1);
|
||||
free (tem);
|
||||
add_word ("\"/>");
|
||||
}
|
||||
|
||||
int
|
||||
docbook_quote (character)
|
||||
int character;
|
||||
{
|
||||
switch (language_code)
|
||||
{
|
||||
case fr:
|
||||
if (character == '`')
|
||||
{
|
||||
add_word ("« ");
|
||||
return ';';
|
||||
}
|
||||
else
|
||||
{
|
||||
add_word (" ");
|
||||
return '»';
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
if (character == '`')
|
||||
{
|
||||
add_word ("&ldquo");
|
||||
return ';';
|
||||
}
|
||||
else
|
||||
{
|
||||
add_word ("&rdquo");
|
||||
return ';';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#define IS_BLANK(c) (c == ' ' || c == '\t' || c == '\n')
|
||||
|
||||
int
|
||||
docbook_is_punctuation (character, next)
|
||||
int character;
|
||||
int next;
|
||||
{
|
||||
return ( (character == ';'
|
||||
|| character == ':'
|
||||
|| character == '?'
|
||||
|| character == '!')
|
||||
&& IS_BLANK (next));
|
||||
}
|
||||
|
||||
void
|
||||
docbook_punctuation (character)
|
||||
int character;
|
||||
{
|
||||
switch (language_code)
|
||||
{
|
||||
case fr:
|
||||
while (output_paragraph[output_paragraph_offset-1] == ' ')
|
||||
output_paragraph_offset--;
|
||||
add_word (" ");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int in_item = 0;
|
||||
|
||||
void
|
||||
docbook_begin_itemize ()
|
||||
{
|
||||
if (in_docbook_paragraph)
|
||||
insert_string ("\n</para>\n");
|
||||
|
||||
in_docbook_paragraph = 0;
|
||||
insert_string ("\n<itemizedlist>\n");
|
||||
in_item = 0;
|
||||
in_list = 1;
|
||||
}
|
||||
|
||||
void
|
||||
docbook_end_itemize ()
|
||||
{
|
||||
if (in_item)
|
||||
{
|
||||
insert_string ("\n</para></listitem>\n");
|
||||
in_item = 0;
|
||||
}
|
||||
insert_string ("\n</itemizedlist>\n\n<para>\n");
|
||||
in_docbook_paragraph = 1;
|
||||
in_list = 0;
|
||||
}
|
||||
|
||||
void
|
||||
docbook_begin_enumerate ()
|
||||
{
|
||||
if (in_docbook_paragraph)
|
||||
insert_string ("\n</para>\n");
|
||||
in_docbook_paragraph = 0;
|
||||
insert_string ("\n<orderedlist>\n");
|
||||
in_item = 0;
|
||||
in_list = 1;
|
||||
}
|
||||
|
||||
void
|
||||
docbook_end_enumerate ()
|
||||
{
|
||||
if (in_item)
|
||||
{
|
||||
insert_string ("\n</para></listitem>\n");
|
||||
in_item = 0;
|
||||
}
|
||||
insert_string ("\n</orderedlist>\n\n<para>\n");
|
||||
in_docbook_paragraph = 1;
|
||||
in_list = 0;
|
||||
}
|
||||
|
||||
void
|
||||
docbook_begin_table ()
|
||||
{
|
||||
#if 0
|
||||
if (in_docbook_paragraph)
|
||||
insert_string ("\n</para>\n\n");
|
||||
in_docbook_paragraph = 0;
|
||||
#endif
|
||||
|
||||
add_word ("\n<variablelist>\n");
|
||||
in_table ++;
|
||||
in_varlistitem = 0;
|
||||
in_entry = 0;
|
||||
}
|
||||
|
||||
void
|
||||
docbook_end_table ()
|
||||
{
|
||||
if (!in_varlistitem)
|
||||
docbook_begin_paragraph ();
|
||||
insert_string ("\n</para></listitem>\n</varlistentry>\n\n</variablelist>\n");
|
||||
#if 0
|
||||
if (in_table == 1)
|
||||
{
|
||||
insert_string ("\n</para>\n\n");
|
||||
in_docbook_paragraph = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
insert_string ("\n<para>\n\n");
|
||||
in_docbook_paragraph = 1;
|
||||
}
|
||||
#endif
|
||||
in_table --;
|
||||
in_list = 0;
|
||||
}
|
||||
|
||||
void
|
||||
docbook_add_item ()
|
||||
{
|
||||
if (in_item)
|
||||
insert_string ("\n</para></listitem>\n");
|
||||
insert_string ("\n<listitem><para>\n");
|
||||
in_docbook_paragraph = 1;
|
||||
in_item = 1;
|
||||
}
|
||||
|
||||
void
|
||||
docbook_add_table_item ()
|
||||
{
|
||||
if (in_varlistitem)
|
||||
{
|
||||
insert_string ("\n</para></listitem>\n</varlistentry>\n\n");
|
||||
in_entry = 0;
|
||||
in_varlistitem = 0;
|
||||
}
|
||||
if (!in_entry)
|
||||
{
|
||||
insert_string ("<varlistentry>\n");
|
||||
in_entry = 1;
|
||||
}
|
||||
insert_string ("<term>");
|
||||
in_list = 1;
|
||||
in_term = 1;
|
||||
}
|
||||
|
||||
void
|
||||
docbook_close_table_item ()
|
||||
{
|
||||
insert_string ("</term>");
|
||||
in_list = 1;
|
||||
in_term = 0;
|
||||
}
|
||||
|
||||
void
|
||||
docbook_add_anchor (anchor)
|
||||
char *anchor;
|
||||
{
|
||||
add_word ("<anchor id=\"");
|
||||
add_anchor_name (anchor, 0);
|
||||
add_word ("\">");
|
||||
}
|
||||
|
||||
void
|
||||
docbook_footnote (note)
|
||||
char *note;
|
||||
{
|
||||
/* add_word_args ("<footnote><para>\n%s\n</para></footnote>\n", note); */
|
||||
add_word ("<footnote><para>\n");
|
||||
execute_string("%s", note);
|
||||
add_word("\n</para></footnote>\n");
|
||||
}
|
||||
|
||||
void
|
||||
docbook_begin_index ()
|
||||
{
|
||||
add_word ("<variablelist>\n");
|
||||
}
|
||||
|
||||
void
|
||||
docbook_begin_example ()
|
||||
{
|
||||
add_word ("\n\n<screen>\n");
|
||||
in_example = 1;
|
||||
}
|
||||
|
||||
void
|
||||
docbook_end_example ()
|
||||
{
|
||||
in_example = 0;
|
||||
add_word ("</screen>\n\n");
|
||||
}
|
81
contrib/texinfo/makeinfo/docbook.h
Normal file
81
contrib/texinfo/makeinfo/docbook.h
Normal file
@ -0,0 +1,81 @@
|
||||
/* docbook.h -- docbook declarations.
|
||||
$Id: docbook.h,v 1.2 2001/12/31 16:51:32 karl Exp $
|
||||
|
||||
Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef DOCBOOK_H
|
||||
#define DOCBOOK_H
|
||||
|
||||
#define DB_B "emphasis role=\"bold\""
|
||||
#define DB_CITE "citetitle"
|
||||
#define DB_CODE "literal"
|
||||
#define DB_COMMAND "command"
|
||||
#define DB_DFN "firstterm"
|
||||
#define DB_EMPH "emphasis"
|
||||
#define DB_ENV "envar"
|
||||
#define DB_FILE "filename"
|
||||
#define DB_FUNCTION "function"
|
||||
#define DB_I "emphasis"
|
||||
#define DB_KBD "userinput"
|
||||
#define DB_KEY "keycap"
|
||||
#define DB_OPTION "option"
|
||||
#define DB_STRONG "emphasis role=\"bold\""
|
||||
#define DB_TT "literal"
|
||||
#define DB_URL "systemitem role=\"sitename\""
|
||||
#define DB_VAR "replaceable"
|
||||
|
||||
extern int docbook_version_inserted;
|
||||
extern int docbook_begin_book_p;
|
||||
extern int docbook_first_chapter_found;
|
||||
extern int docbook_must_insert_node_anchor;
|
||||
extern int docbook_no_new_paragraph;
|
||||
|
||||
void docbook_begin_section ();
|
||||
void docbook_begin_paragraph ();
|
||||
void docbook_begin_book ();
|
||||
void docbook_end_book ();
|
||||
|
||||
void docbook_insert_tag ();
|
||||
|
||||
void docbook_xref1 ();
|
||||
void docbook_xref2 ();
|
||||
|
||||
int docbook_quote ();
|
||||
|
||||
int docbook_is_punctuation ();
|
||||
void docbook_punctuation ();
|
||||
|
||||
void docbook_begin_itemize ();
|
||||
void docbook_end_itemize ();
|
||||
void docbook_begin_enumerate ();
|
||||
void docbook_end_enumerate ();
|
||||
|
||||
void docbook_begin_table ();
|
||||
void docbook_end_table ();
|
||||
void docbook_add_item ();
|
||||
void docbook_add_table_item ();
|
||||
void docbook_close_table_item ();
|
||||
void docbook_add_anchor ();
|
||||
|
||||
void docbook_footnote ();
|
||||
|
||||
void docbook_begin_index ();
|
||||
|
||||
void docbook_begin_example ();
|
||||
void docbook_end_example ();
|
||||
|
||||
#endif /* DOCBOOK_H */
|
@ -1,7 +1,7 @@
|
||||
/* files.c -- file-related functions for Texinfo.
|
||||
$Id: files.c,v 1.5 1999/03/23 21:42:44 karl Exp $
|
||||
/* files.c -- file-related functions for makeinfo.
|
||||
$Id: files.c,v 1.10 2002/01/16 15:52:45 karl Exp $
|
||||
|
||||
Copyright (C) 1998, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 99, 2000, 01, 02 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -139,9 +139,7 @@ find_and_load (filename)
|
||||
long file_size;
|
||||
int file = -1, count = 0;
|
||||
char *fullpath, *result;
|
||||
#if O_BINARY || defined (VMS)
|
||||
int n;
|
||||
#endif
|
||||
int n, bytes_to_read;
|
||||
|
||||
result = fullpath = NULL;
|
||||
|
||||
@ -163,28 +161,18 @@ find_and_load (filename)
|
||||
/* VMS stat lies about the st_size value. The actual number of
|
||||
readable bytes is always less than this value. The arcane
|
||||
mysteries of VMS/RMS are too much to probe, so this hack
|
||||
suffices to make things work. */
|
||||
#if O_BINARY || defined (VMS)
|
||||
#ifdef VMS
|
||||
while ((n = read (file, result + count, file_size)) > 0)
|
||||
#else /* !VMS */
|
||||
#ifndef WIN32
|
||||
while ((n = read (file, result + count, file_size)) > 0)
|
||||
#else /* WIN32 */
|
||||
/* Does WIN32 really need reading 1 character at a time?? */
|
||||
while ((n = read (file, result + count, 1)) > 0)
|
||||
#endif /* WIN32 */
|
||||
#endif /* !VMS */
|
||||
count += n;
|
||||
suffices to make things work. It's also needed on Cygwin. And so
|
||||
we might as well use it everywhere. */
|
||||
bytes_to_read = file_size;
|
||||
while ((n = read (file, result + count, bytes_to_read)) > 0)
|
||||
{
|
||||
count += n;
|
||||
bytes_to_read -= n;
|
||||
}
|
||||
if (0 < count && count < file_size)
|
||||
result = xrealloc (result, count + 2); /* why waste the slack? */
|
||||
else if (n == -1)
|
||||
#else /* !VMS && !O_BINARY */
|
||||
count = file_size;
|
||||
if (read (file, result, file_size) != file_size)
|
||||
#endif /* !VMS && !WIN32 */
|
||||
|
||||
error_exit:
|
||||
error_exit:
|
||||
{
|
||||
if (result)
|
||||
free (result);
|
||||
@ -527,3 +515,62 @@ output_name_from_input_name (name)
|
||||
{
|
||||
return expand_filename (NULL, name);
|
||||
}
|
||||
|
||||
|
||||
/* Modify the file name FNAME so that it fits the limitations of the
|
||||
underlying filesystem. In particular, truncate the file name as it
|
||||
would be truncated by the filesystem. We assume the result can
|
||||
never be longer than the original, otherwise we couldn't be sure we
|
||||
have enough space in the original string to modify it in place. */
|
||||
char *
|
||||
normalize_filename (fname)
|
||||
char *fname;
|
||||
{
|
||||
int maxlen;
|
||||
char orig[PATH_MAX + 1];
|
||||
int i;
|
||||
char *lastdot, *p;
|
||||
|
||||
#ifdef _PC_NAME_MAX
|
||||
maxlen = pathconf (fname, _PC_NAME_MAX);
|
||||
if (maxlen < 1)
|
||||
#endif
|
||||
maxlen = PATH_MAX;
|
||||
|
||||
i = skip_directory_part (fname);
|
||||
if (fname[i] == '\0')
|
||||
return fname; /* only a directory name -- don't modify */
|
||||
strcpy (orig, fname + i);
|
||||
|
||||
switch (maxlen)
|
||||
{
|
||||
case 12: /* MS-DOS 8+3 filesystem */
|
||||
if (orig[0] == '.') /* leading dots are not allowed */
|
||||
orig[0] = '_';
|
||||
lastdot = strrchr (orig, '.');
|
||||
if (!lastdot)
|
||||
lastdot = orig + strlen (orig);
|
||||
strncpy (fname + i, orig, lastdot - orig);
|
||||
for (p = fname + i;
|
||||
p < fname + i + (lastdot - orig) && p < fname + i + 8;
|
||||
p++)
|
||||
if (*p == '.')
|
||||
*p = '_';
|
||||
*p = '\0';
|
||||
if (*lastdot == '.')
|
||||
strncat (fname + i, lastdot, 4);
|
||||
break;
|
||||
case 14: /* old Unix systems with 14-char limitation */
|
||||
strcpy (fname + i, orig);
|
||||
if (strlen (fname + i) > 14)
|
||||
fname[i + 14] = '\0';
|
||||
break;
|
||||
default:
|
||||
strcpy (fname + i, orig);
|
||||
if (strlen (fname) > maxlen - 1)
|
||||
fname[maxlen - 1] = '\0';
|
||||
break;
|
||||
}
|
||||
|
||||
return fname;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* files.h -- declarations for files.c.
|
||||
$Id: files.h,v 1.1 1998/10/24 21:37:25 karl Exp $
|
||||
$Id: files.h,v 1.2 2002/01/16 15:52:45 karl Exp $
|
||||
|
||||
Copyright (C) 1998 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 2002 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -41,5 +41,6 @@ extern char *output_name_from_input_name ();
|
||||
extern char *expand_filename ();
|
||||
extern char *filename_part ();
|
||||
extern char *pathname_part ();
|
||||
extern char *normalize_filename ();
|
||||
|
||||
#endif /* !FILES_H */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* footnote.c -- footnotes for Texinfo.
|
||||
$Id: footnote.c,v 1.10 1999/09/20 12:20:52 karl Exp $
|
||||
$Id: footnote.c,v 1.13 2002/03/02 15:05:21 karl Exp $
|
||||
|
||||
Copyright (C) 1998, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 99, 2002 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -21,6 +21,7 @@
|
||||
#include "footnote.h"
|
||||
#include "macro.h"
|
||||
#include "makeinfo.h"
|
||||
#include "xml.h"
|
||||
|
||||
/* Nonzero means that the footnote style for this document was set on
|
||||
the command line, which overrides any other settings. */
|
||||
@ -200,6 +201,18 @@ cm_footnote ()
|
||||
return;
|
||||
}
|
||||
|
||||
/* output_pending_notes is non-reentrant (it uses a global data
|
||||
structure pending_notes, which it frees before it returns), and
|
||||
TeX doesn't grok footnotes inside footnotes anyway. Disallow
|
||||
that. */
|
||||
if (already_outputting_pending_notes)
|
||||
{
|
||||
line_error (_("Footnotes inside footnotes are not allowed"));
|
||||
free (marker);
|
||||
free (note);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!*marker)
|
||||
{
|
||||
free (marker);
|
||||
@ -213,14 +226,21 @@ cm_footnote ()
|
||||
marker = xstrdup ("*");
|
||||
}
|
||||
|
||||
if (xml)
|
||||
xml_insert_footnote (note);
|
||||
else
|
||||
{
|
||||
remember_note (marker, note);
|
||||
|
||||
/* fixme: html: footnote processing needs work; we currently ignore
|
||||
the style requested; we could clash with a node name of the form
|
||||
`fn-<n>', though that's unlikely. */
|
||||
if (html)
|
||||
add_word_args ("<a rel=footnote href=\"#fn-%d\"><sup>%s</sup></a>",
|
||||
current_footnote_number, marker);
|
||||
{
|
||||
add_html_elt ("<a rel=footnote href=");
|
||||
add_word_args ("\"#fn-%d\"><sup>%s</sup></a>",
|
||||
current_footnote_number, marker);
|
||||
}
|
||||
else
|
||||
/* Your method should at least insert MARKER. */
|
||||
switch (footnote_style)
|
||||
@ -255,7 +275,7 @@ cm_footnote ()
|
||||
break;
|
||||
}
|
||||
current_footnote_number++;
|
||||
|
||||
}
|
||||
free (marker);
|
||||
free (note);
|
||||
}
|
||||
@ -328,7 +348,9 @@ output_pending_notes ()
|
||||
/* Make the text of every footnote begin a separate paragraph. */
|
||||
add_word_args ("<li><a name=\"fn-%d\"></a>\n<p>",
|
||||
footnote->number);
|
||||
already_outputting_pending_notes++;
|
||||
execute_string ("%s", footnote->note);
|
||||
already_outputting_pending_notes--;
|
||||
add_word ("</p>\n");
|
||||
}
|
||||
else
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* html.c -- html-related utilities.
|
||||
$Id: html.c,v 1.5 1999/09/18 19:27:41 karl Exp $
|
||||
$Id: html.c,v 1.19 2002/02/23 19:12:15 karl Exp $
|
||||
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2000, 01, 02 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -30,27 +30,40 @@ int html_output_head_p = 0;
|
||||
void
|
||||
html_output_head ()
|
||||
{
|
||||
char *html_title;
|
||||
|
||||
static char *html_title = NULL;
|
||||
static int html_title_written = 0;
|
||||
|
||||
if (html_output_head_p)
|
||||
return;
|
||||
html_output_head_p = 1;
|
||||
|
||||
/* The <title> should not have markup. */
|
||||
html_title = title ? text_expansion (title) : _("Untitled");
|
||||
/* The <title> should not have markup, so use text_expansion. */
|
||||
if (!html_title)
|
||||
html_title = title ? text_expansion (title) : _("Untitled");
|
||||
|
||||
add_word_args ("<html lang=\"%s\"><head>\n<title>%s</title>\n",
|
||||
add_word_args ("<html lang=\"%s\">\n<head>\n<title>%s</title>\n",
|
||||
language_table[language_code].abbrev, html_title);
|
||||
|
||||
add_word ("<meta http-equiv=\"Content-Type\" content=\"text/html");
|
||||
if (document_encoding)
|
||||
add_word_args ("; charset=%s", document_encoding);
|
||||
if (document_encoding_code != no_encoding)
|
||||
add_word_args ("; charset=%s",
|
||||
encoding_table[document_encoding_code].ecname);
|
||||
add_word ("\">\n");
|
||||
|
||||
add_word_args ("<meta name=description content=\"%s\">\n", html_title);
|
||||
|
||||
if (!document_description)
|
||||
document_description = html_title;
|
||||
|
||||
add_word_args ("<meta name=description content=\"%s\">\n",
|
||||
document_description);
|
||||
add_word_args ("<meta name=generator content=\"makeinfo %s\">\n", VERSION);
|
||||
add_word ("<link href=\"http://texinfo.org/\" rel=generator-home>\n");
|
||||
add_word ("</head><body>\n\n");
|
||||
add_word ("</head>\n<body>\n");
|
||||
|
||||
if (title && !html_title_written)
|
||||
{
|
||||
add_word_args ("<h1>%s</h1>\n", html_title);
|
||||
html_title_written = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -78,13 +91,12 @@ escape_string (string)
|
||||
default:
|
||||
newlen++;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
while (string[i]);
|
||||
while (string[i++]);
|
||||
|
||||
if (newlen == i) return string; /* Already OK. */
|
||||
|
||||
newstring = xmalloc (newlen + 2);
|
||||
newstring = xmalloc (newlen);
|
||||
i = 0;
|
||||
do
|
||||
{
|
||||
@ -109,7 +121,7 @@ escape_string (string)
|
||||
}
|
||||
while (string[i++]);
|
||||
free (string);
|
||||
return newstring - newlen -1;
|
||||
return newstring - newlen;
|
||||
}
|
||||
|
||||
/* Open or close TAG according to START_OR_END. */
|
||||
@ -136,14 +148,16 @@ insert_html_tag (start_or_end, tag)
|
||||
/* Output an HTML <link> to the filename for NODE, including the
|
||||
other string as extra attributes. */
|
||||
void
|
||||
add_link (node, attributes)
|
||||
char *node, *attributes;
|
||||
add_link (nodename, attributes)
|
||||
char *nodename, *attributes;
|
||||
{
|
||||
if (node)
|
||||
if (nodename)
|
||||
{
|
||||
add_word_args ("<link %s href=\"", attributes);
|
||||
add_anchor_name (node, 1);
|
||||
add_word ("\">\n");
|
||||
add_html_elt ("<link ");
|
||||
add_word_args ("%s", attributes);
|
||||
add_word_args (" href=\"");
|
||||
add_anchor_name (nodename, 1);
|
||||
add_word ("\"></a>\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,7 +190,170 @@ add_anchor_name (nodename, href)
|
||||
int href;
|
||||
{
|
||||
if (href)
|
||||
add_char ('#');
|
||||
|
||||
add_escaped_anchor_name (nodename);
|
||||
{
|
||||
if (splitting)
|
||||
add_url_name (nodename, href);
|
||||
add_char ('#');
|
||||
}
|
||||
/* Always add NODENAME, so that the reference would pinpoint the
|
||||
exact node on its file. This is so several nodes could share the
|
||||
same file, in case of file-name clashes, but also for more
|
||||
accurate browser positioning. */
|
||||
if (strcasecmp (nodename, "(dir)") == 0)
|
||||
/* Strip the parens, but keep the original letter-case. */
|
||||
add_word_args ("%.3s", nodename + 1);
|
||||
else
|
||||
add_escaped_anchor_name (nodename);
|
||||
}
|
||||
|
||||
/* Insert the text for the name of a reference in an HTML url, aprropriate
|
||||
for NODENAME */
|
||||
void
|
||||
add_url_name (nodename, href)
|
||||
char *nodename;
|
||||
int href;
|
||||
{
|
||||
add_nodename_to_filename (nodename, href);
|
||||
}
|
||||
|
||||
/* Only allow [-0-9a-zA-Z_.] when nodifying filenames. This may
|
||||
result in filename clashes; e.g.,
|
||||
|
||||
@node Foo ],,,
|
||||
@node Foo [,,,
|
||||
|
||||
both map to Foo--.html. If that happens, cm_node will put all
|
||||
the nodes whose file names clash on the same file. */
|
||||
void
|
||||
fix_filename (filename)
|
||||
char *filename;
|
||||
{
|
||||
char *p;
|
||||
for (p = filename; *p; p++)
|
||||
{
|
||||
if (!(isalnum (*p) || strchr ("-._", *p)))
|
||||
*p = '-';
|
||||
}
|
||||
}
|
||||
|
||||
/* As we can't look-up a (forward-referenced) nodes' html filename
|
||||
from the tentry, we take the easy way out. We assume that
|
||||
nodenames are unique, and generate the html filename from the
|
||||
nodename, that's always known. */
|
||||
static char *
|
||||
nodename_to_filename_1 (nodename, href)
|
||||
char *nodename;
|
||||
int href;
|
||||
{
|
||||
char *p;
|
||||
char *filename;
|
||||
char dirname[PATH_MAX];
|
||||
|
||||
if (strcasecmp (nodename, "Top") == 0)
|
||||
{
|
||||
/* We want to convert references to the Top node into
|
||||
"index.html#Top". */
|
||||
if (href)
|
||||
filename = xstrdup ("index.html"); /* "#Top" is added by our callers */
|
||||
else
|
||||
filename = xstrdup ("Top");
|
||||
}
|
||||
else if (strcasecmp (nodename, "(dir)") == 0)
|
||||
/* We want to convert references to the (dir) node into
|
||||
"../index.html". */
|
||||
filename = xstrdup ("../index.html");
|
||||
else
|
||||
{
|
||||
filename = xmalloc (PATH_MAX);
|
||||
dirname[0] = '\0';
|
||||
*filename = '\0';
|
||||
|
||||
/* Check for external reference: ``(info-document)node-name''
|
||||
Assume this node lives at: ``../info-document/node-name.html''
|
||||
|
||||
We need to handle the special case (sigh): ``(info-document)'',
|
||||
ie, an external top-node, which should translate to:
|
||||
``../info-document/info-document.html'' */
|
||||
|
||||
p = nodename;
|
||||
if (*nodename == '(')
|
||||
{
|
||||
int length;
|
||||
|
||||
p = strchr (nodename, ')');
|
||||
if (p == NULL)
|
||||
{
|
||||
line_error (_("Invalid node name: `%s'"), nodename);
|
||||
exit (1);
|
||||
}
|
||||
|
||||
length = p - nodename - 1;
|
||||
if (length > 5 &&
|
||||
FILENAME_CMPN (p - 5, ".info", 5) == 0)
|
||||
length -= 5;
|
||||
/* This is for DOS, and also for Windows and GNU/Linux
|
||||
systems that might have Info files copied from a DOS 8+3
|
||||
filesystem. */
|
||||
if (length > 4 &&
|
||||
FILENAME_CMPN (p - 4, ".inf", 4) == 0)
|
||||
length -= 4;
|
||||
strcpy (filename, "../");
|
||||
strncpy (dirname, nodename + 1, length);
|
||||
*(dirname + length) = '\0';
|
||||
fix_filename (dirname);
|
||||
strcat (filename, dirname);
|
||||
strcat (filename, "/");
|
||||
p++;
|
||||
}
|
||||
|
||||
/* In the case of just (info-document), there will be nothing
|
||||
remaining, and we will refer to ../info-document/, which will
|
||||
work fine. */
|
||||
strcat (filename, p);
|
||||
if (*p)
|
||||
{
|
||||
/* Hmm */
|
||||
fix_filename (filename + strlen (filename) - strlen (p));
|
||||
strcat (filename, ".html");
|
||||
}
|
||||
}
|
||||
|
||||
/* Produce a file name suitable for the underlying filesystem. */
|
||||
normalize_filename (filename);
|
||||
|
||||
#if 0
|
||||
/* We add ``#Nodified-filename'' anchor to external references to be
|
||||
prepared for non-split HTML support. Maybe drop this. */
|
||||
if (href && *dirname)
|
||||
{
|
||||
strcat (filename, "#");
|
||||
strcat (filename, p);
|
||||
/* Hmm, again */
|
||||
fix_filename (filename + strlen (filename) - strlen (p));
|
||||
}
|
||||
#endif
|
||||
|
||||
return filename;
|
||||
}
|
||||
|
||||
/* If necessary, ie, if current filename != filename of node, output
|
||||
the node name. */
|
||||
void
|
||||
add_nodename_to_filename (nodename, href)
|
||||
char *nodename;
|
||||
int href;
|
||||
{
|
||||
/* for now, don't check: always output filename */
|
||||
char *filename = nodename_to_filename_1 (nodename, href);
|
||||
add_word (filename);
|
||||
free (filename);
|
||||
}
|
||||
|
||||
char *
|
||||
nodename_to_filename (nodename)
|
||||
char *nodename;
|
||||
{
|
||||
/* The callers of nodename_to_filename use the result to produce
|
||||
<a href=, so call nodename_to_filename_1 with last arg non-zero. */
|
||||
return nodename_to_filename_1 (nodename, 1);
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* html.h -- declarations for html-related utilities.
|
||||
$Id: html.h,v 1.1 1999/04/25 20:53:33 karl Exp $
|
||||
$Id: html.h,v 1.2 2000/12/19 15:17:52 karl Exp $
|
||||
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2000 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -40,5 +40,8 @@ extern void add_escaped_anchor_name (/* char *name */);
|
||||
|
||||
/* See html.c. */
|
||||
extern void add_anchor_name (/* nodename, href */);
|
||||
extern void add_url_name ( /* nodename, href */ );
|
||||
extern char* nodename_to_filename ( /* nodename */ );
|
||||
extern void add_nodename_to_filename ( /*nodename, href */ );
|
||||
|
||||
#endif /* !HTML_H */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* index.c -- indexing for Texinfo.
|
||||
$Id: index.c,v 1.21 1999/07/18 18:50:02 karl Exp $
|
||||
$Id: index.c,v 1.24 2002/01/22 14:28:07 karl Exp $
|
||||
|
||||
Copyright (C) 1998, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 99, 2002 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -22,6 +22,7 @@
|
||||
#include "lang.h"
|
||||
#include "macro.h"
|
||||
#include "toc.h"
|
||||
#include "xml.h"
|
||||
|
||||
/* An index element... */
|
||||
typedef struct index_elt
|
||||
@ -226,7 +227,13 @@ index_add_arg (name)
|
||||
(see the findexerr test). */
|
||||
new->defining_file = xstrdup (input_filename);
|
||||
the_indices[which] = new;
|
||||
/* The index breaks if there are colons in the entry. */
|
||||
if (strchr (new->entry_text, ':'))
|
||||
warning (_("Info cannot handle `:' in index entry `%s'"),
|
||||
new->entry_text);
|
||||
}
|
||||
if (xml)
|
||||
xml_insert_indexterm (index_entry, name);
|
||||
}
|
||||
|
||||
/* The function which user defined index commands call. */
|
||||
@ -583,7 +590,7 @@ sort_index (index)
|
||||
/* If this particular entry should be printed as a "code" index,
|
||||
then expand it as @code{entry}, i.e. as in fixed-width font. */
|
||||
array[count-1]->entry = expansion (temp->entry_text,
|
||||
array[count-1]->code);
|
||||
array[count-1]->code);
|
||||
|
||||
temp = temp->next;
|
||||
}
|
||||
@ -621,203 +628,225 @@ int printing_index = 0;
|
||||
void
|
||||
cm_printindex ()
|
||||
{
|
||||
int item;
|
||||
INDEX_ELT *index;
|
||||
INDEX_ELT *last_index = 0;
|
||||
INDEX_ELT **array;
|
||||
char *index_name;
|
||||
unsigned line_length;
|
||||
char *line;
|
||||
int saved_inhibit_paragraph_indentation = inhibit_paragraph_indentation;
|
||||
int saved_filling_enabled = filling_enabled;
|
||||
int saved_line_number = line_number;
|
||||
char *saved_input_filename = input_filename;
|
||||
|
||||
close_paragraph ();
|
||||
get_rest_of_line (0, &index_name);
|
||||
|
||||
index = index_list (index_name);
|
||||
if (index == (INDEX_ELT *)-1)
|
||||
if (xml && !docbook)
|
||||
{
|
||||
line_error (_("Unknown index `%s' in @printindex"), index_name);
|
||||
free (index_name);
|
||||
return;
|
||||
char *index_name;
|
||||
get_rest_of_line (0, &index_name);
|
||||
xml_insert_element (PRINTINDEX, START);
|
||||
insert_string (index_name);
|
||||
xml_insert_element (PRINTINDEX, END);
|
||||
}
|
||||
|
||||
/* Do this before sorting, so execute_string in index_element_compare
|
||||
will give the same results as when we actually print. */
|
||||
printing_index = 1;
|
||||
filling_enabled = 0;
|
||||
inhibit_paragraph_indentation = 1;
|
||||
array = sort_index (index);
|
||||
|
||||
close_paragraph ();
|
||||
if (html)
|
||||
add_word ("<ul compact>");
|
||||
else if (!no_headers)
|
||||
add_word ("* Menu:\n\n");
|
||||
|
||||
me_inhibit_expansion++;
|
||||
|
||||
/* This will probably be enough. */
|
||||
line_length = 100;
|
||||
line = xmalloc (line_length);
|
||||
|
||||
for (item = 0; (index = array[item]); item++)
|
||||
else
|
||||
{
|
||||
/* A pathological document might have an index entry outside of any
|
||||
node. Don't crash; try using the section name instead. */
|
||||
char *index_node = index->node;
|
||||
int item;
|
||||
INDEX_ELT *index;
|
||||
INDEX_ELT *last_index = 0;
|
||||
INDEX_ELT **array;
|
||||
char *index_name;
|
||||
unsigned line_length;
|
||||
char *line;
|
||||
int saved_inhibit_paragraph_indentation = inhibit_paragraph_indentation;
|
||||
int saved_filling_enabled = filling_enabled;
|
||||
int saved_line_number = line_number;
|
||||
char *saved_input_filename = input_filename;
|
||||
|
||||
line_number = index->defining_line;
|
||||
input_filename = index->defining_file;
|
||||
close_paragraph ();
|
||||
get_rest_of_line (0, &index_name);
|
||||
|
||||
if ((!index_node || !*index_node) && html)
|
||||
index_node = toc_find_section_of_node (index_node);
|
||||
|
||||
if (!index_node || !*index_node)
|
||||
index = index_list (index_name);
|
||||
if (index == (INDEX_ELT *)-1)
|
||||
{
|
||||
line_error (_("Entry for index `%s' outside of any node"),
|
||||
index_name);
|
||||
if (html || !no_headers)
|
||||
index_node = _("(outside of any node)");
|
||||
line_error (_("Unknown index `%s' in @printindex"), index_name);
|
||||
free (index_name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Do this before sorting, so execute_string is in the good environment */
|
||||
if (xml && docbook)
|
||||
xml_begin_index ();
|
||||
|
||||
/* Do this before sorting, so execute_string in index_element_compare
|
||||
will give the same results as when we actually print. */
|
||||
printing_index = 1;
|
||||
filling_enabled = 0;
|
||||
inhibit_paragraph_indentation = 1;
|
||||
xml_sort_index = 1;
|
||||
array = sort_index (index);
|
||||
xml_sort_index = 0;
|
||||
close_paragraph ();
|
||||
if (html)
|
||||
/* fixme: html: we should use specific index anchors pointing
|
||||
add_word ("<ul compact>");
|
||||
else if (!no_headers && !docbook)
|
||||
add_word ("* Menu:\n\n");
|
||||
|
||||
me_inhibit_expansion++;
|
||||
|
||||
/* This will probably be enough. */
|
||||
line_length = 100;
|
||||
line = xmalloc (line_length);
|
||||
|
||||
for (item = 0; (index = array[item]); item++)
|
||||
{
|
||||
/* A pathological document might have an index entry outside of any
|
||||
node. Don't crash; try using the section name instead. */
|
||||
char *index_node = index->node;
|
||||
|
||||
line_number = index->defining_line;
|
||||
input_filename = index->defining_file;
|
||||
|
||||
if ((!index_node || !*index_node) && html)
|
||||
index_node = toc_find_section_of_node (index_node);
|
||||
|
||||
if (!index_node || !*index_node)
|
||||
{
|
||||
line_error (_("Entry for index `%s' outside of any node"),
|
||||
index_name);
|
||||
if (html || !no_headers)
|
||||
index_node = _("(outside of any node)");
|
||||
}
|
||||
|
||||
if (html)
|
||||
/* fixme: html: we should use specific index anchors pointing
|
||||
to the actual location of the indexed position (but then we
|
||||
have to find something to wrap the anchor around). */
|
||||
{
|
||||
if (last_index
|
||||
&& STREQ (last_index->entry_text, index->entry_text))
|
||||
add_word (", "); /* Don't repeat the previous entry. */
|
||||
else
|
||||
{
|
||||
/* In the HTML case, the expanded index entry is not
|
||||
good for us, since it was expanded for non-HTML mode
|
||||
inside sort_index. So we need to HTML-escape and
|
||||
expand the original entry text here. */
|
||||
char *escaped_entry = xstrdup (index->entry_text);
|
||||
char *expanded_entry;
|
||||
|
||||
/* expansion() doesn't HTML-escape the argument, so need
|
||||
to do it separately. */
|
||||
escaped_entry = escape_string (escaped_entry);
|
||||
expanded_entry = expansion (escaped_entry, index->code);
|
||||
add_word_args ("\n<li>%s: ", expanded_entry);
|
||||
free (escaped_entry);
|
||||
free (expanded_entry);
|
||||
}
|
||||
add_word ("<a href=\"");
|
||||
if (index->node && *index->node)
|
||||
{
|
||||
/* Make sure any non-macros in the node name are expanded. */
|
||||
in_fixed_width_font++;
|
||||
index_node = expansion (index_node, 0);
|
||||
in_fixed_width_font--;
|
||||
add_anchor_name (index_node, 1);
|
||||
add_word_args ("\">%s</a>", index_node);
|
||||
free (index_node);
|
||||
if (last_index
|
||||
&& STREQ (last_index->entry_text, index->entry_text))
|
||||
add_word (", "); /* Don't repeat the previous entry. */
|
||||
else
|
||||
{
|
||||
/* In the HTML case, the expanded index entry is not
|
||||
good for us, since it was expanded for non-HTML mode
|
||||
inside sort_index. So we need to HTML-escape and
|
||||
expand the original entry text here. */
|
||||
char *escaped_entry = xstrdup (index->entry_text);
|
||||
char *expanded_entry;
|
||||
|
||||
/* expansion() doesn't HTML-escape the argument, so need
|
||||
to do it separately. */
|
||||
escaped_entry = escape_string (escaped_entry);
|
||||
expanded_entry = expansion (escaped_entry, index->code);
|
||||
add_word_args ("\n<li>%s: ", expanded_entry);
|
||||
free (escaped_entry);
|
||||
free (expanded_entry);
|
||||
}
|
||||
add_word ("<a href=\"");
|
||||
if (index->node && *index->node)
|
||||
{
|
||||
/* Make sure any non-macros in the node name are expanded. */
|
||||
in_fixed_width_font++;
|
||||
index_node = expansion (index_node, 0);
|
||||
in_fixed_width_font--;
|
||||
add_anchor_name (index_node, 1);
|
||||
add_word_args ("\">%s</a>", index_node);
|
||||
free (index_node);
|
||||
}
|
||||
else if (STREQ (index_node, _("(outside of any node)")))
|
||||
{
|
||||
add_anchor_name (index_node, 1);
|
||||
add_word_args ("\">%s</a>", index_node);
|
||||
}
|
||||
else
|
||||
/* If we use the section instead of the (missing) node, then
|
||||
index_node already includes all we need except the #. */
|
||||
add_word_args ("#%s</a>", index_node);
|
||||
}
|
||||
else if (STREQ (index_node, _("(outside of any node)")))
|
||||
else if (xml && docbook)
|
||||
{
|
||||
add_anchor_name (index_node, 1);
|
||||
add_word_args ("\">%s</a>", index_node);
|
||||
xml_insert_indexentry (index->entry, index_node);
|
||||
}
|
||||
else
|
||||
/* If we use the section instead of the (missing) node, then
|
||||
index_node already includes all we need except the #. */
|
||||
add_word_args ("#%s</a>", index_node);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned new_length = strlen (index->entry);
|
||||
|
||||
if (new_length < 50) /* minimum length used below */
|
||||
new_length = 50;
|
||||
new_length += strlen (index_node) + 7; /* * : .\n\0 */
|
||||
|
||||
if (new_length > line_length)
|
||||
{
|
||||
line_length = new_length;
|
||||
line = xrealloc (line, line_length);
|
||||
}
|
||||
/* Print the entry, nicely formatted. We've already
|
||||
expanded any commands in index->entry, including any
|
||||
implicit @code. Thus, can't call execute_string, since
|
||||
@@ has turned into @. */
|
||||
if (!no_headers)
|
||||
{
|
||||
sprintf (line, "* %-37s ", index->entry);
|
||||
line[2 + strlen (index->entry)] = ':';
|
||||
insert_string (line);
|
||||
/* Make sure any non-macros in the node name are expanded. */
|
||||
in_fixed_width_font++;
|
||||
execute_string ("%s.\n", index_node);
|
||||
in_fixed_width_font--;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* With --no-headers, the @node lines are gone, so
|
||||
there's little sense in referring to them in the
|
||||
index. Instead, output the number or name of the
|
||||
section that corresponds to that node. */
|
||||
char *section_name = toc_find_section_of_node (index_node);
|
||||
|
||||
sprintf (line, "%-*s ", number_sections ? 50 : 1, index->entry);
|
||||
line[strlen (index->entry)] = ':';
|
||||
insert_string (line);
|
||||
if (section_name)
|
||||
{
|
||||
int idx = 0;
|
||||
unsigned ref_len = strlen (section_name) + 30;
|
||||
|
||||
if (ref_len > line_length)
|
||||
{
|
||||
line_length = ref_len;
|
||||
line = xrealloc (line, line_length);
|
||||
}
|
||||
|
||||
if (number_sections)
|
||||
{
|
||||
while (section_name[idx]
|
||||
&& (isdigit (section_name[idx])
|
||||
|| (idx && section_name[idx] == '.')))
|
||||
idx++;
|
||||
}
|
||||
if (idx)
|
||||
sprintf (line, " See %.*s.\n", idx, section_name);
|
||||
else
|
||||
sprintf (line, "\n See ``%s''.\n", section_name);
|
||||
insert_string (line);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned new_length = strlen (index->entry);
|
||||
|
||||
if (new_length < 50) /* minimum length used below */
|
||||
new_length = 50;
|
||||
new_length += strlen (index_node) + 7; /* * : .\n\0 */
|
||||
|
||||
if (new_length > line_length)
|
||||
{
|
||||
insert_string (" "); /* force a blank */
|
||||
execute_string ("See node %s.\n", index_node);
|
||||
line_length = new_length;
|
||||
line = xrealloc (line, line_length);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Print the entry, nicely formatted. We've already
|
||||
expanded any commands in index->entry, including any
|
||||
implicit @code. Thus, can't call execute_string, since
|
||||
@@ has turned into @. */
|
||||
if (!no_headers)
|
||||
{
|
||||
sprintf (line, "* %-37s ", index->entry);
|
||||
line[2 + strlen (index->entry)] = ':';
|
||||
insert_string (line);
|
||||
/* Make sure any non-macros in the node name are expanded. */
|
||||
in_fixed_width_font++;
|
||||
execute_string ("%s.\n", index_node);
|
||||
in_fixed_width_font--;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* With --no-headers, the @node lines are gone, so
|
||||
there's little sense in referring to them in the
|
||||
index. Instead, output the number or name of the
|
||||
section that corresponds to that node. */
|
||||
char *section_name = toc_find_section_of_node (index_node);
|
||||
|
||||
sprintf (line, "%-*s ", number_sections ? 50 : 1, index->entry);
|
||||
line[strlen (index->entry)] = ':';
|
||||
insert_string (line);
|
||||
if (section_name)
|
||||
{
|
||||
int idx = 0;
|
||||
unsigned ref_len = strlen (section_name) + 30;
|
||||
|
||||
if (ref_len > line_length)
|
||||
{
|
||||
line_length = ref_len;
|
||||
line = xrealloc (line, line_length);
|
||||
}
|
||||
|
||||
if (number_sections)
|
||||
{
|
||||
while (section_name[idx]
|
||||
&& (isdigit (section_name[idx])
|
||||
|| (idx && section_name[idx] == '.')))
|
||||
idx++;
|
||||
}
|
||||
if (idx)
|
||||
sprintf (line, " See %.*s.\n", idx, section_name);
|
||||
else
|
||||
sprintf (line, "\n See ``%s''.\n", section_name);
|
||||
insert_string (line);
|
||||
}
|
||||
else
|
||||
{
|
||||
insert_string (" "); /* force a blank */
|
||||
execute_string ("See node %s.\n", index_node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Prevent `output_paragraph' from growing to the size of the
|
||||
whole index. */
|
||||
flush_output ();
|
||||
last_index = index;
|
||||
}
|
||||
|
||||
/* Prevent `output_paragraph' from growing to the size of the
|
||||
whole index. */
|
||||
flush_output ();
|
||||
last_index = index;
|
||||
free (line);
|
||||
free (index_name);
|
||||
|
||||
me_inhibit_expansion--;
|
||||
|
||||
printing_index = 0;
|
||||
free (array);
|
||||
close_single_paragraph ();
|
||||
filling_enabled = saved_filling_enabled;
|
||||
inhibit_paragraph_indentation = saved_inhibit_paragraph_indentation;
|
||||
input_filename = saved_input_filename;
|
||||
line_number = saved_line_number;
|
||||
|
||||
if (html)
|
||||
add_word ("</ul>");
|
||||
else if (xml && docbook)
|
||||
xml_end_index ();
|
||||
}
|
||||
|
||||
free (line);
|
||||
free (index_name);
|
||||
|
||||
me_inhibit_expansion--;
|
||||
|
||||
printing_index = 0;
|
||||
free (array);
|
||||
close_single_paragraph ();
|
||||
filling_enabled = saved_filling_enabled;
|
||||
inhibit_paragraph_indentation = saved_inhibit_paragraph_indentation;
|
||||
input_filename = saved_input_filename;
|
||||
line_number = saved_line_number;
|
||||
|
||||
if (html)
|
||||
add_word ("</ul>");
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* insertion.c -- insertions for Texinfo.
|
||||
$Id: insertion.c,v 1.27 1999/07/06 23:12:53 karl Exp $
|
||||
$Id: insertion.c,v 1.39 2002/03/02 15:05:21 karl Exp $
|
||||
|
||||
Copyright (C) 1998, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 99, 2000, 01, 02 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -23,20 +23,21 @@
|
||||
#include "insertion.h"
|
||||
#include "macro.h"
|
||||
#include "makeinfo.h"
|
||||
#include "xml.h"
|
||||
|
||||
/* Must match list in insertion.h. */
|
||||
static char *insertion_type_names[] =
|
||||
{
|
||||
{
|
||||
"cartouche", "defcv", "deffn", "defivar", "defmac", "defmethod",
|
||||
"defop", "defopt", "defspec", "deftp", "deftypefn", "deftypefun",
|
||||
"deftypeivar", "deftypemethod", "deftypeop", "deftypevar",
|
||||
"deftypevr", "defun", "defvar", "defvr", "detailmenu", "direntry",
|
||||
"display", "enumerate", "example", "flushleft", "flushright",
|
||||
"format", "ftable", "group", "ifclear", "ifhtml", "ifinfo",
|
||||
"ifnothtml", "ifnotinfo", "ifnottex", "ifset", "iftex", "itemize",
|
||||
"lisp", "menu", "multitable", "quotation", "rawhtml", "rawtex",
|
||||
"smalldisplay", "smallexample", "smallformat", "smalllisp", "table",
|
||||
"tex", "vtable", "bad_type"
|
||||
"display", "documentdescription", "enumerate", "example", "flushleft",
|
||||
"flushright", "format", "ftable", "group", "ifclear", "ifhtml",
|
||||
"ifinfo", "ifnothtml", "ifnotinfo", "ifnottex", "ifset", "iftex",
|
||||
"itemize", "lisp", "menu", "multitable", "quotation", "rawhtml",
|
||||
"rawtex", "smalldisplay", "smallexample", "smallformat", "smalllisp",
|
||||
"verbatim", "table", "tex", "vtable", "bad_type"
|
||||
};
|
||||
|
||||
/* All nested environments. */
|
||||
@ -359,7 +360,9 @@ begin_insertion (type)
|
||||
no_discard++;
|
||||
}
|
||||
else
|
||||
push_insertion (type, get_item_function ());
|
||||
{
|
||||
push_insertion (type, get_item_function ());
|
||||
}
|
||||
|
||||
switch (type)
|
||||
{
|
||||
@ -374,9 +377,12 @@ begin_insertion (type)
|
||||
{
|
||||
had_menu_commentary = 1;
|
||||
}
|
||||
else if (!no_headers)
|
||||
else if (!no_headers && !xml)
|
||||
add_word ("* Menu:\n");
|
||||
|
||||
if (xml)
|
||||
xml_insert_element (MENU, START);
|
||||
|
||||
in_menu++;
|
||||
in_fixed_width_font++;
|
||||
no_discard++;
|
||||
@ -399,15 +405,29 @@ begin_insertion (type)
|
||||
break;
|
||||
|
||||
case direntry:
|
||||
if (html)
|
||||
command_name_condition ();
|
||||
else
|
||||
{
|
||||
close_single_paragraph ();
|
||||
filling_enabled = no_indent = 0;
|
||||
inhibit_paragraph_indentation = 1;
|
||||
insert_string ("START-INFO-DIR-ENTRY\n");
|
||||
}
|
||||
close_single_paragraph ();
|
||||
filling_enabled = no_indent = 0;
|
||||
inhibit_paragraph_indentation = 1;
|
||||
insert_string ("START-INFO-DIR-ENTRY\n");
|
||||
break;
|
||||
|
||||
case documentdescription:
|
||||
{
|
||||
char *desc;
|
||||
int start_of_end;
|
||||
int save_fixed_width;
|
||||
|
||||
discard_until ("\n"); /* ignore the @documentdescription line */
|
||||
start_of_end = get_until ("\n@end documentdescription", &desc);
|
||||
save_fixed_width = in_fixed_width_font;
|
||||
|
||||
in_fixed_width_font = 0;
|
||||
document_description = expansion (desc, 0);
|
||||
free (desc);
|
||||
|
||||
in_fixed_width_font = save_fixed_width;
|
||||
input_text_offset = start_of_end; /* go back to the @end to match */
|
||||
}
|
||||
break;
|
||||
|
||||
case quotation:
|
||||
@ -443,7 +463,7 @@ begin_insertion (type)
|
||||
/* Kludge alert: if <pre> is followed by a newline, IE3
|
||||
renders an extra blank line before the pre-formatted block.
|
||||
Other browsers seem to not mind one way or the other. */
|
||||
add_word ("<pre>");
|
||||
add_word ("<br><pre>");
|
||||
|
||||
if (type != format && type != smallformat)
|
||||
current_indent += default_indentation_increment;
|
||||
@ -492,6 +512,8 @@ begin_insertion (type)
|
||||
else
|
||||
add_word (dl_tag);
|
||||
}
|
||||
if (xml)
|
||||
xml_begin_table (type, insertion_stack->item_function);
|
||||
break;
|
||||
|
||||
case enumerate:
|
||||
@ -509,6 +531,9 @@ begin_insertion (type)
|
||||
if (html)
|
||||
enum_html ();
|
||||
|
||||
if (xml)
|
||||
xml_begin_enumerate (enumeration_arg);
|
||||
|
||||
if (isdigit (*enumeration_arg))
|
||||
start_enumerating (atoi (enumeration_arg), ENUM_DIGITS);
|
||||
else
|
||||
@ -519,7 +544,9 @@ begin_insertion (type)
|
||||
case group:
|
||||
/* Only close the paragraph if we are not inside of an
|
||||
@example-like environment. */
|
||||
if (!insertion_stack->next
|
||||
if (xml)
|
||||
xml_insert_element (GROUP, START);
|
||||
else if (!insertion_stack->next
|
||||
|| (insertion_stack->next->insertion != display
|
||||
&& insertion_stack->next->insertion != smalldisplay
|
||||
&& insertion_stack->next->insertion != example
|
||||
@ -581,6 +608,8 @@ begin_insertion (type)
|
||||
close_single_paragraph ();
|
||||
inhibit_paragraph_indentation = 1;
|
||||
filling_enabled = indented_fill = no_indent = 0;
|
||||
if (html)
|
||||
add_word ("<div align=\"left\">");
|
||||
break;
|
||||
|
||||
case flushright:
|
||||
@ -588,6 +617,8 @@ begin_insertion (type)
|
||||
filling_enabled = indented_fill = no_indent = 0;
|
||||
inhibit_paragraph_indentation = 1;
|
||||
force_flush_right++;
|
||||
if (html)
|
||||
add_word ("<div align=\"right\">");
|
||||
break;
|
||||
|
||||
default:
|
||||
@ -627,12 +658,64 @@ end_insertion (type)
|
||||
|
||||
pop_insertion ();
|
||||
|
||||
if (xml)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ifinfo:
|
||||
case documentdescription:
|
||||
break;
|
||||
case quotation:
|
||||
xml_insert_element (QUOTATION, END);
|
||||
break;
|
||||
case example:
|
||||
xml_insert_element (EXAMPLE, END);
|
||||
break;
|
||||
case smallexample:
|
||||
xml_insert_element (SMALLEXAMPLE, END);
|
||||
break;
|
||||
case lisp:
|
||||
xml_insert_element (LISP, END);
|
||||
break;
|
||||
case smalllisp:
|
||||
xml_insert_element (SMALLLISP, END);
|
||||
break;
|
||||
case cartouche:
|
||||
xml_insert_element (CARTOUCHE, END);
|
||||
break;
|
||||
case format:
|
||||
xml_insert_element (FORMAT, END);
|
||||
break;
|
||||
case smallformat:
|
||||
xml_insert_element (SMALLFORMAT, END);
|
||||
break;
|
||||
case display:
|
||||
xml_insert_element (DISPLAY, END);
|
||||
break;
|
||||
case smalldisplay:
|
||||
xml_insert_element (SMALLDISPLAY, END);
|
||||
break;
|
||||
case table:
|
||||
case ftable:
|
||||
case vtable:
|
||||
case itemize:
|
||||
xml_end_table (type);
|
||||
break;
|
||||
case enumerate:
|
||||
xml_end_enumerate (type);
|
||||
break;
|
||||
case group:
|
||||
xml_insert_element (GROUP, END);
|
||||
break;
|
||||
}
|
||||
}
|
||||
switch (type)
|
||||
{
|
||||
/* Insertions which have no effect on paragraph formatting. */
|
||||
case documentdescription:
|
||||
case ifclear:
|
||||
case ifhtml:
|
||||
case ifinfo:
|
||||
case ifhtml:
|
||||
case ifnothtml:
|
||||
case ifnotinfo:
|
||||
case ifnottex:
|
||||
@ -680,6 +763,11 @@ end_insertion (type)
|
||||
break;
|
||||
|
||||
case flushleft:
|
||||
if (html)
|
||||
add_word ("</div>\n");
|
||||
close_insertion_paragraph ();
|
||||
break;
|
||||
|
||||
case group:
|
||||
case cartouche:
|
||||
close_insertion_paragraph ();
|
||||
@ -724,6 +812,8 @@ end_insertion (type)
|
||||
|
||||
case flushright:
|
||||
force_flush_right--;
|
||||
if (html)
|
||||
add_word ("</div>\n");
|
||||
close_insertion_paragraph ();
|
||||
break;
|
||||
|
||||
@ -750,7 +840,7 @@ end_insertion (type)
|
||||
case deftypeivar:
|
||||
if (html)
|
||||
/* close the tables which has been opened in defun.c */
|
||||
add_word ("</TD></TR>\n</TABLE>\n");
|
||||
add_word ("</td></tr>\n</table>\n");
|
||||
break;
|
||||
} /* switch (base_type)... */
|
||||
|
||||
@ -790,12 +880,11 @@ discard_insertions (specials_ok)
|
||||
else
|
||||
{
|
||||
char *offender = insertion_type_pname (insertion_stack->insertion);
|
||||
char *current_filename = input_filename;
|
||||
|
||||
input_filename = insertion_stack->filename;
|
||||
line_number = insertion_stack->line_number;
|
||||
line_error (_("No matching `%cend %s'"), COMMAND_PREFIX, offender);
|
||||
input_filename = current_filename;
|
||||
file_line_error (insertion_stack->filename,
|
||||
insertion_stack->line_number,
|
||||
_("No matching `%cend %s'"), COMMAND_PREFIX,
|
||||
offender);
|
||||
pop_insertion ();
|
||||
}
|
||||
}
|
||||
@ -807,74 +896,102 @@ discard_insertions (specials_ok)
|
||||
void
|
||||
cm_quotation ()
|
||||
{
|
||||
if (xml)
|
||||
xml_insert_element (QUOTATION, START);
|
||||
begin_insertion (quotation);
|
||||
}
|
||||
|
||||
void
|
||||
cm_example ()
|
||||
{
|
||||
if (xml)
|
||||
xml_insert_element (EXAMPLE, START);
|
||||
begin_insertion (example);
|
||||
}
|
||||
|
||||
void
|
||||
cm_smallexample ()
|
||||
{
|
||||
if (xml)
|
||||
xml_insert_element (SMALLEXAMPLE, START);
|
||||
begin_insertion (smallexample);
|
||||
}
|
||||
|
||||
void
|
||||
cm_lisp ()
|
||||
{
|
||||
if (xml)
|
||||
xml_insert_element (LISP, START);
|
||||
begin_insertion (lisp);
|
||||
}
|
||||
|
||||
void
|
||||
cm_smalllisp ()
|
||||
{
|
||||
if (xml)
|
||||
xml_insert_element (SMALLLISP, START);
|
||||
begin_insertion (smalllisp);
|
||||
}
|
||||
|
||||
/* @cartouche/@end cartouche draws box with rounded corners in
|
||||
TeX output. Right now, just a no-op insertion. */
|
||||
void
|
||||
cm_cartouche ()
|
||||
{
|
||||
if (xml)
|
||||
xml_insert_element (CARTOUCHE, START);
|
||||
begin_insertion (cartouche);
|
||||
}
|
||||
|
||||
void
|
||||
cm_format ()
|
||||
{
|
||||
if (xml)
|
||||
xml_insert_element (FORMAT, START);
|
||||
begin_insertion (format);
|
||||
}
|
||||
|
||||
void
|
||||
cm_smallformat ()
|
||||
{
|
||||
if (xml)
|
||||
xml_insert_element (SMALLFORMAT, START);
|
||||
begin_insertion (smallformat);
|
||||
}
|
||||
|
||||
void
|
||||
cm_display ()
|
||||
{
|
||||
if (xml)
|
||||
xml_insert_element (DISPLAY, START);
|
||||
begin_insertion (display);
|
||||
}
|
||||
|
||||
void
|
||||
cm_smalldisplay ()
|
||||
{
|
||||
if (xml)
|
||||
xml_insert_element (SMALLDISPLAY, START);
|
||||
begin_insertion (smalldisplay);
|
||||
}
|
||||
|
||||
void
|
||||
cm_direntry ()
|
||||
{
|
||||
if (no_headers || html)
|
||||
if (html || xml)
|
||||
command_name_condition ();
|
||||
else
|
||||
begin_insertion (direntry);
|
||||
}
|
||||
|
||||
void
|
||||
cm_documentdescription ()
|
||||
{
|
||||
if (html || xml)
|
||||
begin_insertion (documentdescription);
|
||||
else
|
||||
command_name_condition ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
cm_itemize ()
|
||||
{
|
||||
@ -918,6 +1035,77 @@ cm_enumerate ()
|
||||
do_enumeration (enumerate, "1");
|
||||
}
|
||||
|
||||
/* Handle verbatim environment:
|
||||
find_end_verbatim == 0: process until end of file
|
||||
find_end_verbatim != 0: process until 'COMMAND_PREFIXend verbatim'
|
||||
or end of file
|
||||
|
||||
We cannot simply copy input stream onto output stream; as the
|
||||
verbatim environment may be encapsulated in an @example environment,
|
||||
for example. */
|
||||
void
|
||||
handle_verbatim_environment (find_end_verbatim)
|
||||
int find_end_verbatim;
|
||||
{
|
||||
int character;
|
||||
int seen_end = 0;
|
||||
int save_filling_enabled = filling_enabled;
|
||||
int save_inhibit_paragraph_indentation = inhibit_paragraph_indentation;
|
||||
|
||||
close_single_paragraph ();
|
||||
inhibit_paragraph_indentation = 1;
|
||||
filling_enabled = 0;
|
||||
in_fixed_width_font++;
|
||||
last_char_was_newline = 0;
|
||||
|
||||
/* No indentation: this is verbatim after all
|
||||
If you want indent, enclose @verbatim in @example
|
||||
current_indent += default_indentation_increment;
|
||||
*/
|
||||
|
||||
if (html)
|
||||
add_word ("<pre>");
|
||||
|
||||
while (input_text_offset < input_text_length)
|
||||
{
|
||||
character = curchar ();
|
||||
|
||||
if (character == '\n')
|
||||
line_number++;
|
||||
/*
|
||||
Assume no newlines in END_VERBATIM
|
||||
*/
|
||||
else if (find_end_verbatim && (character == COMMAND_PREFIX) /* @ */
|
||||
&& (input_text_length - input_text_offset > sizeof (END_VERBATIM))
|
||||
&& !strncmp (&input_text[input_text_offset+1], END_VERBATIM,
|
||||
sizeof (END_VERBATIM)-1))
|
||||
{
|
||||
input_text_offset += sizeof (END_VERBATIM);
|
||||
seen_end = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
add_char (character);
|
||||
input_text_offset++;
|
||||
}
|
||||
|
||||
if (find_end_verbatim && !seen_end)
|
||||
warning (_("end of file inside verbatim block"));
|
||||
|
||||
if (html)
|
||||
add_word ("</pre>");
|
||||
|
||||
in_fixed_width_font--;
|
||||
filling_enabled = save_filling_enabled;
|
||||
inhibit_paragraph_indentation = save_inhibit_paragraph_indentation;
|
||||
}
|
||||
|
||||
void
|
||||
cm_verbatim ()
|
||||
{
|
||||
handle_verbatim_environment (1);
|
||||
}
|
||||
|
||||
void
|
||||
cm_table ()
|
||||
{
|
||||
@ -1087,6 +1275,10 @@ cm_end ()
|
||||
line_error (_("Bad argument to `%s', `%s', using `%s'"),
|
||||
command, temp, insertion_type_pname (current_insertion_type ()));
|
||||
}
|
||||
if (xml && type == menu) /* fixme */
|
||||
{
|
||||
xml_end_menu ();
|
||||
}
|
||||
end_insertion (type);
|
||||
free (temp);
|
||||
}
|
||||
@ -1096,7 +1288,7 @@ cm_end ()
|
||||
static int itemx_flag = 0;
|
||||
|
||||
/* Return whether CMD takes a brace-delimited {arg}. */
|
||||
static int
|
||||
/*static */int
|
||||
command_needs_braces (cmd)
|
||||
char *cmd;
|
||||
{
|
||||
@ -1195,6 +1387,8 @@ cm_item ()
|
||||
}
|
||||
add_word ("<li>");
|
||||
}
|
||||
else if (xml)
|
||||
xml_begin_item ();
|
||||
else
|
||||
{
|
||||
start_paragraph ();
|
||||
@ -1289,6 +1483,15 @@ cm_item ()
|
||||
last_html_output_position = output_position;
|
||||
add_word ("<dd>");
|
||||
}
|
||||
else if (xml) /* && docbook)*/ /* 05-08 */
|
||||
{
|
||||
xml_begin_table_item ();
|
||||
if (item_func && *item_func)
|
||||
execute_string ("%s{%s}", item_func, rest_of_line);
|
||||
else
|
||||
execute_string ("%s", rest_of_line);
|
||||
xml_continue_table_item ();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We need this to determine if we have two @item's in a row
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* insertion.h -- declarations for insertion.c.
|
||||
$Id: insertion.h,v 1.6 1999/07/06 23:12:58 karl Exp $
|
||||
$Id: insertion.h,v 1.8 2001/06/30 00:29:41 karl Exp $
|
||||
|
||||
Copyright (C) 1998, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 99, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -22,15 +22,15 @@
|
||||
|
||||
/* Must match list in insertion.c. */
|
||||
enum insertion_type
|
||||
{
|
||||
{
|
||||
cartouche, defcv, deffn, defivar, defmac, defmethod, defop, defopt,
|
||||
defspec, deftp, deftypefn, deftypefun, deftypeivar, deftypemethod,
|
||||
deftypeop, deftypevar, deftypevr, defun, defvar, defvr, detailmenu,
|
||||
direntry, display, enumerate, example, flushleft, flushright, format,
|
||||
ftable, group, ifclear, ifhtml, ifinfo, ifnothtml, ifnotinfo,
|
||||
ifnottex, ifset, iftex, itemize, lisp, menu, multitable, quotation,
|
||||
rawhtml, rawtex, smalldisplay, smallexample, smallformat, smalllisp,
|
||||
table, tex, vtable, bad_type
|
||||
direntry, display, documentdescription, enumerate, example, flushleft,
|
||||
flushright, format, ftable, group, ifclear, ifhtml, ifinfo, ifnothtml,
|
||||
ifnotinfo, ifnottex, ifset, iftex, itemize, lisp, menu, multitable,
|
||||
quotation, rawhtml, rawtex, smalldisplay, smallexample, smallformat,
|
||||
smalllisp, verbatim, table, tex, vtable, bad_type
|
||||
};
|
||||
|
||||
typedef struct istack_elt
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* lang.c -- language depend behaviour (startpoint)
|
||||
$Id: lang.c,v 1.11 1999/07/13 21:16:29 karl Exp $
|
||||
/* lang.c -- language-dependent support.
|
||||
$Id: lang.c,v 1.14 2001/09/11 18:04:35 karl Exp $
|
||||
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2000, 01 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -17,20 +17,150 @@
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Written by Karl Heinz Marbaise <kama@hippo.fido.de>. */
|
||||
Originally written by Karl Heinz Marbaise <kama@hippo.fido.de>. */
|
||||
|
||||
#include "system.h"
|
||||
#include "cmds.h"
|
||||
#include "lang.h"
|
||||
#include "makeinfo.h"
|
||||
#include "xml.h"
|
||||
|
||||
/* Current document encoding. */
|
||||
char *document_encoding = NULL;
|
||||
encoding_code_type document_encoding_code = no_encoding;
|
||||
|
||||
/* Current language code; default is English. */
|
||||
language_code_type language_code = en;
|
||||
|
||||
language_struct language_table[] = {
|
||||
/* Translation table between HTML and ISO Codes. The last item is
|
||||
hopefully the Unicode. It might be possible that those Unicodes are
|
||||
not correct, cause I didn't check them. kama */
|
||||
iso_map_type iso8859_1_map [] = {
|
||||
{ "nbsp", 0xA0, 0x00A0 },
|
||||
{ "iexcl", 0xA1, 0x00A1 },
|
||||
{ "cent", 0xA2, 0x00A2 },
|
||||
{ "pound", 0xA3, 0x00A3 },
|
||||
{ "curren", 0xA4, 0x00A4 },
|
||||
{ "yen", 0xA5, 0x00A5 },
|
||||
{ "brkbar", 0xA6, 0x00A6 },
|
||||
{ "sect", 0xA7, 0x00A7 },
|
||||
{ "uml", 0xA8, 0x00A8 },
|
||||
{ "copy", 0xA9, 0x00A9 },
|
||||
{ "ordf", 0xAA, 0x00AA },
|
||||
{ "laquo", 0xAB, 0x00AB },
|
||||
{ "not", 0xAC, 0x00AC },
|
||||
{ "shy", 0xAD, 0x00AD },
|
||||
{ "reg", 0xAE, 0x00AE },
|
||||
{ "hibar", 0xAF, 0x00AF },
|
||||
{ "deg", 0xB0, 0x00B0 },
|
||||
{ "plusmn", 0xB1, 0x00B1 },
|
||||
{ "sup2", 0xB2, 0x00B2 },
|
||||
{ "sup3", 0xB3, 0x00B3 },
|
||||
{ "acute", 0xB4, 0x00B4 },
|
||||
{ "micro", 0xB5, 0x00B5 },
|
||||
{ "para", 0xB6, 0x00B6 },
|
||||
{ "middot", 0xB7, 0x00B7 },
|
||||
{ "cedil", 0xB8, 0x00B8 },
|
||||
{ "sup1", 0xB9, 0x00B9 },
|
||||
{ "ordm", 0xBA, 0x00BA },
|
||||
{ "raquo", 0xBB, 0x00BB },
|
||||
{ "frac14", 0xBC, 0x00BC },
|
||||
{ "frac12", 0xBD, 0x00BD },
|
||||
{ "frac34", 0xBE, 0x00BE },
|
||||
{ "iquest", 0xBF, 0x00BF },
|
||||
{ "Agrave", 0xC0, 0x00C0 },
|
||||
{ "Aacute", 0xC1, 0x00C1 },
|
||||
{ "Acirc", 0xC2, 0x00C2 },
|
||||
{ "Atilde", 0xC3, 0x00C3 },
|
||||
{ "Auml", 0xC4, 0x00C4 },
|
||||
{ "Aring", 0xC5, 0x00C5 },
|
||||
{ "AElig", 0xC6, 0x00C6 },
|
||||
{ "Ccedil", 0xC7, 0x00C7 },
|
||||
{ "Ccedil", 0xC7, 0x00C7 },
|
||||
{ "Egrave", 0xC8, 0x00C8 },
|
||||
{ "Eacute", 0xC9, 0x00C9 },
|
||||
{ "Ecirc", 0xCA, 0x00CA },
|
||||
{ "Euml", 0xCB, 0x00CB },
|
||||
{ "Igrave", 0xCC, 0x00CC },
|
||||
{ "Iacute", 0xCD, 0x00CD },
|
||||
{ "Icirc", 0xCE, 0x00CE },
|
||||
{ "Iuml", 0xCF, 0x00CF },
|
||||
{ "ETH", 0xD0, 0x00D0 }, /* I don't know ;-( */
|
||||
{ "Ntilde", 0xD1, 0x00D1 },
|
||||
{ "Ograve", 0xD2, 0x00D2 },
|
||||
{ "Oacute", 0xD3, 0x00D3 },
|
||||
{ "Ocirc", 0xD4, 0x00D4 },
|
||||
{ "Otilde", 0xD5, 0x00D5 },
|
||||
{ "Ouml", 0xD6, 0x00D6 },
|
||||
{ "times", 0xD7, 0x00D7 },
|
||||
{ "Oslash", 0xD8, 0x00D8 },
|
||||
{ "Ugrave", 0xD9, 0x00D9 },
|
||||
{ "Uacute", 0xDA, 0x00DA },
|
||||
{ "Ucirc", 0xDB, 0x00DB },
|
||||
{ "Uuml", 0xDC, 0x00DC },
|
||||
{ "Yacute", 0xDD, 0x00DD },
|
||||
{ "THORN", 0xDE, 0x00DE },
|
||||
{ "szlig", 0xDF, 0x00DF },
|
||||
{ "agrave", 0xE0, 0x00E0 },
|
||||
{ "aacute", 0xE1, 0x00E1 },
|
||||
{ "acirc", 0xE2, 0x00E2 },
|
||||
{ "atilde", 0xE3, 0x00E3 },
|
||||
{ "auml", 0xE4, 0x00E4 },
|
||||
{ "aring", 0xE5, 0x00E5 },
|
||||
{ "aelig", 0xE6, 0x00E6 },
|
||||
{ "ccedil", 0xE7, 0x00E7 },
|
||||
{ "egrave", 0xE8, 0x00E8 },
|
||||
{ "eacute", 0xE9, 0x00E9 },
|
||||
{ "ecirc", 0xEA, 0x00EA },
|
||||
{ "euml", 0xEB, 0x00EB },
|
||||
{ "igrave", 0xEC, 0x00EC },
|
||||
{ "iacute", 0xED, 0x00ED },
|
||||
{ "icirc", 0xEE, 0x00EE },
|
||||
{ "iuml", 0xEF, 0x00EF },
|
||||
{ "eth", 0xF0, 0x00F0 },
|
||||
{ "ntilde", 0xF1, 0x00F1 },
|
||||
{ "ograve", 0xF2, 0x00F2 },
|
||||
{ "oacute", 0xF3, 0x00F3 },
|
||||
{ "ocirc", 0xF4, 0x00F4 },
|
||||
{ "otilde", 0xF5, 0x00F5 },
|
||||
{ "ouml", 0xF6, 0x00F6 },
|
||||
{ "divide", 0xF7, 0x00F7 },
|
||||
{ "oslash", 0xF8, 0x00F8 },
|
||||
{ "ugrave", 0xF9, 0x00F9 },
|
||||
{ "uacute", 0xFA, 0x00FA },
|
||||
{ "ucirc", 0xFB, 0x00FB },
|
||||
{ "uuml", 0xFC, 0x00FC },
|
||||
{ "yacute", 0xFD, 0x00FD },
|
||||
{ "thorn", 0xFE, 0x00FE },
|
||||
{ "yuml", 0xFF, 0x00FF }
|
||||
};
|
||||
|
||||
/* This might be put into structure below and NOT coded via define,
|
||||
because some translation tables could contain different numbers of
|
||||
characters, but for now it suffices. */
|
||||
#define ISO_MAP_SIZE (sizeof (iso8859_1_map) / sizeof (iso8859_1_map[0]))
|
||||
|
||||
encoding_type encoding_table[] = {
|
||||
{ no_encoding, "(no encoding)", NULL },
|
||||
{ ISO_8859_1, "ISO-8859-1", (iso_map_type *) iso8859_1_map },
|
||||
{ ISO_8859_2, "ISO-8859-2", NULL },
|
||||
{ ISO_8859_3, "ISO-8859-3", NULL },
|
||||
{ ISO_8859_4, "ISO-8859-4", NULL },
|
||||
{ ISO_8859_5, "ISO-8859-5", NULL },
|
||||
{ ISO_8859_6, "ISO-8859-6", NULL },
|
||||
{ ISO_8859_7, "ISO-8859-7", NULL },
|
||||
{ ISO_8859_8, "ISO-8859-8", NULL },
|
||||
{ ISO_8859_9, "ISO-8859-9", NULL },
|
||||
{ ISO_8859_10, "ISO-8859-10", NULL },
|
||||
{ ISO_8859_11, "ISO-8859-11", NULL },
|
||||
{ ISO_8859_12, "ISO-8859-12", NULL },
|
||||
{ ISO_8859_13, "ISO-8859-13", NULL },
|
||||
{ ISO_8859_14, "ISO-8859-14", NULL },
|
||||
{ ISO_8859_15, "ISO-8859-15", NULL },
|
||||
{ last_encoding_code, NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
language_type language_table[] = {
|
||||
{ aa, "aa", "Afar" },
|
||||
{ ab, "ab", "Abkhazian" },
|
||||
{ af, "af", "Afrikaans" },
|
||||
@ -173,16 +303,18 @@ language_struct language_table[] = {
|
||||
{ last_language_code, NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
|
||||
/* @documentlanguage. Maybe we'll do something useful with this in the
|
||||
future. For now, we just recognize it. */
|
||||
void
|
||||
cm_documentlanguage ()
|
||||
{
|
||||
language_code_type c;
|
||||
char *lang_arg;
|
||||
char *lang_arg;
|
||||
|
||||
/* Read the line with the language code on it. */
|
||||
get_rest_of_line (1, &lang_arg);
|
||||
get_rest_of_line (0, &lang_arg);
|
||||
|
||||
/* Linear search is fine these days. */
|
||||
for (c = aa; c != last_language_code; c++)
|
||||
@ -203,11 +335,178 @@ cm_documentlanguage ()
|
||||
|
||||
|
||||
|
||||
/* @documentencoding. Set global. */
|
||||
/* Search through the encoding table for the given character, returning
|
||||
its equivalent. */
|
||||
|
||||
static int
|
||||
cm_search_iso_map (html)
|
||||
char *html;
|
||||
{
|
||||
int i;
|
||||
iso_map_type *iso = encoding_table[document_encoding_code].isotab;
|
||||
|
||||
/* If no conversion table for this encoding, quit. */
|
||||
if (!iso)
|
||||
return -1;
|
||||
|
||||
for (i = 0; i < ISO_MAP_SIZE; i++)
|
||||
{
|
||||
if (strcmp (html, iso[i].html) == 0)
|
||||
return i;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
/* @documentencoding. Set the translation table. */
|
||||
|
||||
void
|
||||
cm_documentencoding ()
|
||||
{
|
||||
get_rest_of_line (1, &document_encoding);
|
||||
encoding_code_type enc;
|
||||
char *enc_arg;
|
||||
|
||||
get_rest_of_line (1, &enc_arg);
|
||||
|
||||
/* See if we have this encoding. */
|
||||
for (enc = ISO_8859_1; enc != last_encoding_code; enc++)
|
||||
{
|
||||
if (strcasecmp (enc_arg, encoding_table[enc].ecname) == 0)
|
||||
{
|
||||
document_encoding_code = enc;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we didn't find this code, complain. */
|
||||
if (enc == last_encoding_code)
|
||||
warning (_("unrecogized encoding name `%s'"), enc_arg);
|
||||
|
||||
else if (encoding_table[document_encoding_code].isotab == NULL)
|
||||
warning (_("sorry, encoding `%s' not supported"), enc_arg);
|
||||
|
||||
free (enc_arg);
|
||||
}
|
||||
|
||||
|
||||
/* If html or xml output, add HTML_STR to the output. If not html and
|
||||
the user requested encoded output, add the real 8-bit character
|
||||
corresponding to HTML_STR from the translation tables. Otherwise,
|
||||
add INFO_STR. */
|
||||
|
||||
void
|
||||
add_encoded_char (html_str, info_str)
|
||||
char *html_str;
|
||||
char *info_str;
|
||||
{
|
||||
if (html || xml)
|
||||
add_word_args ("&%s;", html_str);
|
||||
else if (enable_encoding)
|
||||
{
|
||||
/* Look for HTML_STR in the current translation table. */
|
||||
int rc = cm_search_iso_map (html_str);
|
||||
if (rc >= 0)
|
||||
/* We found it, add the real character. */
|
||||
add_char (encoding_table[document_encoding_code].isotab[rc].bytecode);
|
||||
else
|
||||
{ /* We didn't find it, that seems bad. */
|
||||
warning (_("invalid encoded character `%s'"), html_str);
|
||||
add_word (info_str);
|
||||
}
|
||||
}
|
||||
else
|
||||
add_word (info_str);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Output an accent for HTML or XML. */
|
||||
|
||||
static void
|
||||
cm_accent_generic_html (arg, start, end, html_supported, single,
|
||||
html_solo_standalone, html_solo)
|
||||
int arg, start, end;
|
||||
char *html_supported;
|
||||
int single;
|
||||
int html_solo_standalone;
|
||||
char *html_solo;
|
||||
{
|
||||
static int valid_html_accent; /* yikes */
|
||||
|
||||
if (arg == START)
|
||||
{ /* If HTML has good support for this character, use it. */
|
||||
if (strchr (html_supported, curchar ()))
|
||||
{ /* Yes; start with an ampersand. The character itself
|
||||
will be added later in read_command (makeinfo.c). */
|
||||
valid_html_accent = 1;
|
||||
add_char ('&');
|
||||
}
|
||||
else
|
||||
{
|
||||
valid_html_accent = 0;
|
||||
if (html_solo_standalone)
|
||||
{ /* No special HTML support, so produce standalone char. */
|
||||
add_word_args ("&%s;", html_solo);
|
||||
}
|
||||
else
|
||||
/* If the html_solo does not exist as standalone character
|
||||
(namely ˆ ` ˜), then we use
|
||||
the single character version instead. */
|
||||
add_char (single);
|
||||
}
|
||||
}
|
||||
else if (arg == END)
|
||||
{ /* Only if we saw a valid_html_accent can we use the full
|
||||
HTML accent (umlaut, grave ...). */
|
||||
if (valid_html_accent)
|
||||
{
|
||||
add_word (html_solo);
|
||||
add_char (';');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
cm_accent_generic_no_headers (arg, start, end, single, html_solo)
|
||||
int arg, start, end;
|
||||
int single;
|
||||
char *html_solo;
|
||||
{
|
||||
if (arg == END)
|
||||
{
|
||||
if (no_encoding)
|
||||
add_char (single);
|
||||
else
|
||||
{
|
||||
int rc;
|
||||
char *buffer = xmalloc (1 + strlen (html_solo) + 1);
|
||||
buffer[0] = output_paragraph[end - 1];
|
||||
buffer[1] = 0;
|
||||
strcat (buffer, html_solo);
|
||||
|
||||
rc = cm_search_iso_map (buffer);
|
||||
if (rc >= 0)
|
||||
/* A little bit tricky ;-)
|
||||
Here we replace the character which has
|
||||
been inserted in read_command with
|
||||
the value we have found in converting table
|
||||
Does there exist a better way to do this? kama. */
|
||||
output_paragraph[end - 1]
|
||||
= encoding_table[document_encoding_code].isotab[rc].bytecode;
|
||||
else
|
||||
{ /* If we didn't find a translation for this character,
|
||||
put the single instead. E.g., &Xuml; does not exist so X¨
|
||||
should be produced. */
|
||||
warning (_("%s is an invalid ISO code, using %c"),
|
||||
buffer, single);
|
||||
add_char (single);
|
||||
}
|
||||
|
||||
free (buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -219,6 +518,8 @@ void
|
||||
cm_accent (arg)
|
||||
int arg;
|
||||
{
|
||||
int old_escape_html = escape_html;
|
||||
escape_html = 0;
|
||||
if (arg == START)
|
||||
{
|
||||
/* Must come first to avoid ambiguity with overdot. */
|
||||
@ -228,7 +529,7 @@ cm_accent (arg)
|
||||
else if (arg == END)
|
||||
{
|
||||
if (strcmp (command, "=") == 0) /* macron */
|
||||
add_word (html ? "¯" : "=");
|
||||
add_word ((html || xml) ? "¯" : "=");
|
||||
else if (strcmp (command, "H") == 0) /* Hungarian umlaut */
|
||||
add_word ("''");
|
||||
else if (strcmp (command, "dotaccent") == 0) /* overdot */
|
||||
@ -242,18 +543,19 @@ cm_accent (arg)
|
||||
else if (strcmp (command, "ubaraccent") == 0) /* underbar */
|
||||
add_char ('_');
|
||||
else if (strcmp (command, "v") == 0) /* hacek/check */
|
||||
add_word (html ? "<" : "<");
|
||||
add_word ((html || xml) ? "<" : "<");
|
||||
}
|
||||
escape_html = old_escape_html;
|
||||
}
|
||||
|
||||
/* Common routine for the accent characters that have support in HTML.
|
||||
If the character being accented is in the HTML_SUPPORTED set, then
|
||||
produce &CHTML_SOLO;, for example, Ä for an A-umlaut. If not in
|
||||
HTML_SUPPORTED, just produce &HTML_SOLO;X for the best we can do with
|
||||
at an X-umlaut. Finally, if not producing HTML, just use SINGLE, a
|
||||
at an X-umlaut. If not producing HTML, just use SINGLE, a
|
||||
character such as " which is the best plain text representation we
|
||||
can manage. If HTML_SOLO_STANDALONE is zero the given HTML_SOLO
|
||||
does not exist as valid standalone character in HTML. */
|
||||
can manage. If HTML_SOLO_STANDALONE is nonzero the given HTML_SOLO
|
||||
exists as valid standalone character in HTML, e.g., ¨. */
|
||||
|
||||
static void
|
||||
cm_accent_generic (arg, start, end, html_supported, single,
|
||||
@ -264,47 +566,19 @@ cm_accent_generic (arg, start, end, html_supported, single,
|
||||
int html_solo_standalone;
|
||||
char *html_solo;
|
||||
{
|
||||
if (html)
|
||||
{
|
||||
static int valid_html_accent;
|
||||
|
||||
if (arg == START)
|
||||
{ /* If HTML has good support for this character, use it. */
|
||||
if (strchr (html_supported, curchar ()))
|
||||
{ /* Yes; start with an ampersand. The character itself
|
||||
will be added later in read_command (makeinfo.c). */
|
||||
add_char ('&');
|
||||
valid_html_accent = 1;
|
||||
}
|
||||
else
|
||||
{ /* No special HTML support, so produce standalone char. */
|
||||
valid_html_accent = 0;
|
||||
if (html_solo_standalone)
|
||||
{
|
||||
add_char ('&');
|
||||
add_word (html_solo);
|
||||
add_char (';');
|
||||
}
|
||||
else
|
||||
/* If the html_solo does not exist as standalone character
|
||||
(namely ˆ ` ˜), then we use
|
||||
the single character version instead. */
|
||||
add_char (single);
|
||||
}
|
||||
}
|
||||
else if (arg == END)
|
||||
{ /* Only if we saw a valid_html_accent can we use the full
|
||||
HTML accent (umlaut, grave ...). */
|
||||
if (valid_html_accent)
|
||||
{
|
||||
add_word (html_solo);
|
||||
add_char (';');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (html || xml)
|
||||
cm_accent_generic_html (arg, start, end, html_supported,
|
||||
single, html_solo_standalone, html_solo);
|
||||
else if (no_headers)
|
||||
cm_accent_generic_no_headers (arg, start, end, single, html_solo);
|
||||
else if (arg == END)
|
||||
{ /* Not producing HTML, so just use the normal character. */
|
||||
add_char (single);
|
||||
{
|
||||
if (enable_encoding)
|
||||
/* use 8-bit if available */
|
||||
cm_accent_generic_no_headers (arg, start, end, single, html_solo);
|
||||
else
|
||||
/* use regular character */
|
||||
add_char (single);
|
||||
}
|
||||
}
|
||||
|
||||
@ -347,7 +621,7 @@ void
|
||||
cm_accent_tilde (arg, start, end)
|
||||
int arg, start, end;
|
||||
{
|
||||
cm_accent_generic (arg, start, end, "AOano", '~', 0, "tilde");
|
||||
cm_accent_generic (arg, start, end, "ANOano", '~', 0, "tilde");
|
||||
}
|
||||
|
||||
|
||||
@ -356,6 +630,9 @@ cm_accent_tilde (arg, start, end)
|
||||
void
|
||||
cm_special_char (arg)
|
||||
{
|
||||
int old_escape_html = escape_html;
|
||||
escape_html = 0;
|
||||
|
||||
if (arg == START)
|
||||
{
|
||||
if ((*command == 'L' || *command == 'l'
|
||||
@ -363,34 +640,37 @@ cm_special_char (arg)
|
||||
&& command[1] == 0)
|
||||
{ /* Lslash lslash Oslash oslash.
|
||||
Lslash and lslash aren't supported in HTML. */
|
||||
if (html && (command[0] == 'O' || command[0] == 'o'))
|
||||
add_word_args ("&%cslash;", command[0]);
|
||||
if ((html || xml) && command[0] == 'O')
|
||||
add_encoded_char ("Oslash", "/O");
|
||||
else if ((html || xml) && command[0] == 'o')
|
||||
add_encoded_char ("oslash", "/o");
|
||||
else
|
||||
add_word_args ("/%c", command[0]);
|
||||
}
|
||||
else if (strcmp (command, "exclamdown") == 0)
|
||||
add_word (html ? "¡" : "!");
|
||||
add_encoded_char ("iexcl", "!");
|
||||
else if (strcmp (command, "pounds") == 0)
|
||||
add_word (html ? "£" : "#");
|
||||
add_encoded_char ("pound" , "#");
|
||||
else if (strcmp (command, "questiondown") == 0)
|
||||
add_word (html ? "¿" : "?");
|
||||
add_encoded_char ("iquest", "?");
|
||||
else if (strcmp (command, "AE") == 0)
|
||||
add_word (html ? "Æ" : command);
|
||||
add_encoded_char ("AElig", command);
|
||||
else if (strcmp (command, "ae") == 0)
|
||||
add_word (html ? "æ" : command);
|
||||
add_encoded_char ("aelig", command);
|
||||
else if (strcmp (command, "OE") == 0)
|
||||
add_word (html ? "Œ" : command);
|
||||
add_word ("Œ", command);
|
||||
else if (strcmp (command, "oe") == 0)
|
||||
add_word (html ? "œ" : command);
|
||||
add_word ("œ", command);
|
||||
else if (strcmp (command, "AA") == 0)
|
||||
add_word (html ? "Å" : command);
|
||||
add_encoded_char ("Aring", command);
|
||||
else if (strcmp (command, "aa") == 0)
|
||||
add_word (html ? "å" : command);
|
||||
add_encoded_char ("aring", command);
|
||||
else if (strcmp (command, "ss") == 0)
|
||||
add_word (html ? "ß" : command);
|
||||
add_encoded_char ("szlig", command);
|
||||
else
|
||||
line_error ("cm_special_char internal error: command=@%s", command);
|
||||
}
|
||||
escape_html = old_escape_html;
|
||||
}
|
||||
|
||||
/* Dotless i or j. */
|
||||
@ -400,6 +680,7 @@ cm_dotless (arg, start, end)
|
||||
{
|
||||
if (arg == END)
|
||||
{
|
||||
xml_no_para --;
|
||||
if (output_paragraph[start] != 'i' && output_paragraph[start] != 'j')
|
||||
/* This error message isn't perfect if the argument is multiple
|
||||
characters, but it doesn't seem worth getting right. */
|
||||
@ -412,4 +693,6 @@ cm_dotless (arg, start, end)
|
||||
|
||||
/* We've already inserted the `i' or `j', so nothing to do. */
|
||||
}
|
||||
else
|
||||
xml_no_para ++;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* lang.h -- declarations for language codes etc.
|
||||
$Id: lang.h,v 1.6 1999/03/22 20:07:34 karl Exp $
|
||||
$Id: lang.h,v 1.7 2001/09/11 18:04:29 karl Exp $
|
||||
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2001 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -17,15 +17,14 @@
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Written by Karl Heinz Marbaise <kama@hippo.fido.de>. */
|
||||
Originally written by Karl Heinz Marbaise <kama@hippo.fido.de>. */
|
||||
|
||||
#ifndef LANG_H
|
||||
#define LANG_H
|
||||
|
||||
/* The langauge code which can be changed through @documentlanguage
|
||||
* Actualy Info does not support this (may be in the future) ;-)
|
||||
* Default for language code is en (english!) kama
|
||||
* These code should ISO 639 two letter codes.
|
||||
/* The language code which can be changed through @documentlanguage
|
||||
* Actually we don't currently support this (may be in the future) ;-)
|
||||
* These code are the ISO-639 two letter codes.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
@ -61,19 +60,71 @@ typedef enum
|
||||
/* The current language code. */
|
||||
extern language_code_type language_code;
|
||||
|
||||
/* Information about all valid languages. */
|
||||
|
||||
/* Information for each language. */
|
||||
typedef struct
|
||||
{
|
||||
language_code_type lc; /* language code as enum type */
|
||||
char *abbrev; /* two letter language code */
|
||||
char *desc; /* full name for language code */
|
||||
} language_struct;
|
||||
extern language_struct language_table[];
|
||||
} language_type;
|
||||
|
||||
/* The encoding, or null if not set. */
|
||||
extern char *document_encoding;
|
||||
extern language_type language_table[];
|
||||
|
||||
|
||||
|
||||
/* The document encoding. This is usefull if we working e.g.
|
||||
* with german Texinfo so we can produce correct german umlaut
|
||||
* while creating output (--no-headers ASCII like).
|
||||
*/
|
||||
typedef enum {
|
||||
no_encoding,
|
||||
ISO_8859_1, /* default for en, de, */
|
||||
ISO_8859_2, /* actualy not supported like the rest below */
|
||||
ISO_8859_3,
|
||||
ISO_8859_4,
|
||||
ISO_8859_5,
|
||||
ISO_8859_6,
|
||||
ISO_8859_7,
|
||||
ISO_8859_8,
|
||||
ISO_8859_9,
|
||||
ISO_8859_10,
|
||||
ISO_8859_11,
|
||||
ISO_8859_12,
|
||||
ISO_8859_13,
|
||||
ISO_8859_14,
|
||||
ISO_8859_15,
|
||||
last_encoding_code
|
||||
} encoding_code_type;
|
||||
|
||||
/* The current document encoding, or null if not set. */
|
||||
extern encoding_code_type document_encoding_code;
|
||||
|
||||
|
||||
/* Maps an HTML abbreviation to ISO and Unicode codes for a given code. */
|
||||
|
||||
typedef unsigned short int unicode_t; /* should be 16 bits */
|
||||
typedef unsigned char byte_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char *html; /* HTML equivalent like umlaut auml => ä */
|
||||
byte_t bytecode; /* 8-Bit Code (ISO 8859-1,...) */
|
||||
unicode_t unicode; /* Unicode in U+ convention */
|
||||
} iso_map_type;
|
||||
|
||||
/* Information about the document encoding. */
|
||||
typedef struct
|
||||
{
|
||||
encoding_code_type ec; /* document encoding type (see above enum) */
|
||||
char *ecname; /* encoding name like ISO-8859-1 */
|
||||
iso_map_type *isotab; /* address of ISO translation table */
|
||||
} encoding_type;
|
||||
|
||||
/* Table with all the encoding codes that we recognize. */
|
||||
extern encoding_type encoding_table[];
|
||||
|
||||
|
||||
/* The commands. */
|
||||
extern void cm_documentlanguage (), cm_documentencoding ();
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* macro.c -- user-defined macros for Texinfo.
|
||||
$Id: macro.c,v 1.10 1999/08/17 21:06:35 karl Exp $
|
||||
$Id: macro.c,v 1.12 2002/03/02 15:05:21 karl Exp $
|
||||
|
||||
Copyright (C) 1998, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 99, 2002 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -590,10 +590,8 @@ define_macro (mactype, recursive)
|
||||
{
|
||||
if ((input_text_offset + 9) > input_text_length)
|
||||
{
|
||||
int temp_line = line_number;
|
||||
line_number = defining_line;
|
||||
line_error (_("%cend macro not found"), COMMAND_PREFIX);
|
||||
line_number = temp_line;
|
||||
file_line_error (input_filename, defining_line,
|
||||
_("%cend macro not found"), COMMAND_PREFIX);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1002,6 +1000,8 @@ cm_alias ()
|
||||
|
||||
skip_whitespace ();
|
||||
get_until_in_line (1, "=", &(a->alias));
|
||||
canon_white (a->alias);
|
||||
|
||||
discard_until ("=");
|
||||
skip_whitespace ();
|
||||
get_until_in_line (0, " ", &(a->mapto));
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* makeinfo.h -- declarations for Makeinfo.
|
||||
$Id: makeinfo.h,v 1.25 1999/09/18 18:09:22 karl Exp $
|
||||
$Id: makeinfo.h,v 1.31 2001/09/11 16:37:51 karl Exp $
|
||||
|
||||
Copyright (C) 1996, 97, 98, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996, 97, 98, 99, 2000, 01 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -116,6 +116,15 @@ DECLARE (int, multitable_active, 0);
|
||||
/* Nonzero means that we're generating HTML. */
|
||||
DECLARE (int, html, 0);
|
||||
|
||||
/* Nonzero means that we're generating XML. */
|
||||
DECLARE (int, xml, 0);
|
||||
|
||||
/* Nonzero means that we're generating DocBook. */
|
||||
DECLARE (int, docbook, 0);
|
||||
|
||||
/* Nonzero means true 8-bit output for Info and plain text. */
|
||||
DECLARE (int, enable_encoding, 0);
|
||||
|
||||
/* Nonzero means escape characters in HTML output. */
|
||||
DECLARE (int, escape_html, 1);
|
||||
extern char *escape_string (); /* do HTML escapes */
|
||||
@ -135,6 +144,9 @@ DECLARE (char *, current_node, NULL);
|
||||
/* Command name in the process of being hacked. */
|
||||
DECLARE (char *, command, NULL);
|
||||
|
||||
/* @documentdescription ... @end documentdescription. */
|
||||
DECLARE (char *, document_description, NULL);
|
||||
|
||||
/* Nonzero if the last character inserted has the syntax class of NEWLINE. */
|
||||
DECLARE (int, last_char_was_newline, 1);
|
||||
|
||||
@ -144,6 +156,7 @@ DECLARE (char *, input_text, (char *)NULL);
|
||||
DECLARE (int, input_text_length, 0);
|
||||
DECLARE (int, input_text_offset, 0);
|
||||
DECLARE (int, line_number, 0);
|
||||
DECLARE (char *, toplevel_output_filename, NULL);
|
||||
#define curchar() input_text[input_text_offset]
|
||||
|
||||
/* A colon separated list of directories to search for files included
|
||||
@ -181,6 +194,9 @@ DECLARE (int, verbose_mode, 0);
|
||||
/* Nonzero means prefix each @chapter, ... with a number like 1. (--number-sections) */
|
||||
DECLARE (int, number_sections, 0);
|
||||
|
||||
/* Nonzero means split size. When zero, DEFAULT_SPLIT_SIZE is used. */
|
||||
DECLARE (int, split_size, 0);
|
||||
|
||||
/* Nonzero means expand node names and references while validating.
|
||||
This will avoid errors when the Texinfo document uses features
|
||||
like @@ and @value inconsistently in node names, but will slow
|
||||
@ -225,6 +241,8 @@ DECLARE (int, expensive_validation, 0);
|
||||
|
||||
#define COMMAND_PREFIX '@'
|
||||
|
||||
#define END_VERBATIM "end verbatim"
|
||||
|
||||
/* Stuff for splitting large files. */
|
||||
#define SPLIT_SIZE_THRESHOLD 70000 /* What's good enough for Stallman... */
|
||||
#define DEFAULT_SPLIT_SIZE 50000 /* Is probably good enough for me. */
|
||||
@ -256,5 +274,4 @@ DECLARE (int, splitting, 1); /* Defaults to true for now. */
|
||||
#define looking_at(string) \
|
||||
(strncmp (input_text + input_text_offset, string, strlen (string)) == 0)
|
||||
|
||||
|
||||
#endif /* not MAKEINFO_H */
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* multi.c -- multitable stuff for makeinfo.
|
||||
$Id: multi.c,v 1.18 1999/08/17 21:06:56 karl Exp $
|
||||
$Id: multi.c,v 1.23 2002/01/19 01:09:08 karl Exp $
|
||||
|
||||
Copyright (C) 1996, 97, 98, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996, 97, 98, 99, 2000, 01, 02 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -15,11 +15,14 @@
|
||||
|
||||
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. */
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Written by phr@gnu.org (Paul Rubin). */
|
||||
|
||||
#include "system.h"
|
||||
#include "insertion.h"
|
||||
#include "makeinfo.h"
|
||||
#include "xml.h"
|
||||
|
||||
#define MAXCOLS 100 /* remove this limit later @@ */
|
||||
|
||||
@ -108,6 +111,8 @@ draw_horizontal_separator ()
|
||||
add_word ("<hr>");
|
||||
return;
|
||||
}
|
||||
if (xml)
|
||||
return;
|
||||
|
||||
for (s = 0; s < envs[0].current_indent; s++)
|
||||
out_char (' ');
|
||||
@ -156,6 +161,9 @@ do_multitable ()
|
||||
/* scan the current item function to get the field widths
|
||||
and number of columns, and set up the output environment list
|
||||
accordingly. */
|
||||
/* if (docbook)*/ /* 05-08 */
|
||||
if (xml)
|
||||
xml_no_para = 1;
|
||||
ncolumns = setup_multitable_parameters ();
|
||||
first_row = 1;
|
||||
|
||||
@ -163,6 +171,16 @@ do_multitable ()
|
||||
current paragraph, so this is ok. */
|
||||
if (html)
|
||||
add_word ("<p><table>");
|
||||
/* else if (docbook)*/ /* 05-08 */
|
||||
else if (xml)
|
||||
{
|
||||
int *widths = xmalloc (ncolumns * sizeof (int));
|
||||
int i;
|
||||
for (i=0; i<ncolumns; i++)
|
||||
widths[i] = envs[i+1].fill_column;
|
||||
xml_begin_multitable (ncolumns, widths);
|
||||
free (widths);
|
||||
}
|
||||
|
||||
if (hsep)
|
||||
draw_horizontal_separator ();
|
||||
@ -199,7 +217,7 @@ find_template_width (params)
|
||||
|
||||
do
|
||||
{
|
||||
if (**params == '{' && (*params)[-1] != '@')
|
||||
if (**params == '{' && (*params == start || (*params)[-1] != '@'))
|
||||
brace_level++;
|
||||
else if (**params == '}' && (*params)[-1] != '@')
|
||||
brace_level--;
|
||||
@ -385,10 +403,17 @@ multitable_item ()
|
||||
if (html)
|
||||
{
|
||||
if (!first_row)
|
||||
add_word ("<br></tr>"); /* <br> for non-tables browsers. */
|
||||
add_word ("<tr align=\"left\"><td>");
|
||||
add_word ("<br></td></tr>"); /* <br> for non-tables browsers. */
|
||||
add_word ("<tr align=\"left\"><td valign=\"top\">");
|
||||
first_row = 0;
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
/* else if (docbook)*/ /* 05-08 */
|
||||
else if (xml)
|
||||
{
|
||||
xml_end_multitable_row (first_row);
|
||||
first_row = 0;
|
||||
return 0;
|
||||
}
|
||||
first_row = 0;
|
||||
|
||||
@ -504,7 +529,10 @@ cm_tab ()
|
||||
error (_("ignoring @tab outside of multitable"));
|
||||
|
||||
if (html)
|
||||
add_word ("<td>");
|
||||
add_word ("</td><td valign=\"top\">");
|
||||
/* else if (docbook)*/ /* 05-08 */
|
||||
else if (xml)
|
||||
xml_end_multitable_column ();
|
||||
else
|
||||
nselect_next_environment ();
|
||||
|
||||
@ -516,7 +544,7 @@ cm_tab ()
|
||||
void
|
||||
end_multitable ()
|
||||
{
|
||||
if (!html)
|
||||
if (!html && !docbook)
|
||||
output_multitable_row ();
|
||||
|
||||
/* Multitables cannot be nested. Otherwise, we'd have to save the
|
||||
@ -528,7 +556,10 @@ end_multitable ()
|
||||
close_insertion_paragraph ();
|
||||
|
||||
if (html)
|
||||
add_word ("<br></tr></table>\n");
|
||||
add_word ("<br></td></tr></table>\n");
|
||||
/* else if (docbook)*/ /* 05-08 */
|
||||
else if (xml)
|
||||
xml_end_multitable ();
|
||||
|
||||
#if 0
|
||||
printf (_("** Multicolumn output from last row:\n"));
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* node.c -- nodes for Texinfo.
|
||||
$Id: node.c,v 1.23 1999/09/20 12:31:21 karl Exp $
|
||||
$Id: node.c,v 1.31 2002/02/23 19:12:15 karl Exp $
|
||||
|
||||
Copyright (C) 1998, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 99, 2000, 01, 02 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -24,8 +24,10 @@
|
||||
#include "macro.h"
|
||||
#include "makeinfo.h"
|
||||
#include "node.h"
|
||||
#include "html.h"
|
||||
#include "sectioning.h"
|
||||
#include "insertion.h"
|
||||
#include "xml.h"
|
||||
|
||||
|
||||
/* See comments in node.h. */
|
||||
@ -64,6 +66,12 @@ write_tag_table_internal (indirect_p)
|
||||
TAG_ENTRY *node;
|
||||
int old_indent = no_indent;
|
||||
|
||||
if (xml)
|
||||
{
|
||||
flush_output ();
|
||||
return;
|
||||
}
|
||||
|
||||
no_indent = 1;
|
||||
filling_enabled = 0;
|
||||
must_start_paragraph = 0;
|
||||
@ -211,7 +219,25 @@ find_node (name)
|
||||
return tag;
|
||||
}
|
||||
|
||||
/* Similarly for next etc. references in a @node command, where we
|
||||
/* Look in the tag table for a node whose file name is FNAME, and
|
||||
return the associated tag_entry. If there's no such node in the
|
||||
table, return NULL. */
|
||||
TAG_ENTRY *
|
||||
find_node_by_fname (fname)
|
||||
char *fname;
|
||||
{
|
||||
TAG_ENTRY *tag = tag_table;
|
||||
while (tag)
|
||||
{
|
||||
if (tag->html_fname && FILENAME_CMP (tag->html_fname, fname) == 0)
|
||||
return tag;
|
||||
tag = tag->next_ent;
|
||||
}
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
/* Remember next, prev, etc. references in a @node command, where we
|
||||
don't care about most of the entries. */
|
||||
static void
|
||||
remember_node_node_reference (node)
|
||||
@ -237,8 +263,8 @@ remember_node_node_reference (node)
|
||||
|
||||
/* Remember NODE and associates. */
|
||||
void
|
||||
remember_node (node, prev, next, up, position, line_no, flags)
|
||||
char *node, *prev, *next, *up;
|
||||
remember_node (node, prev, next, up, position, line_no, fname, flags)
|
||||
char *node, *prev, *next, *up, *fname;
|
||||
int position, line_no, flags;
|
||||
{
|
||||
/* Check for existence of this tag already. */
|
||||
@ -280,6 +306,7 @@ remember_node (node, prev, next, up, position, line_no, flags)
|
||||
node_number++;
|
||||
new->number = node_number;
|
||||
}
|
||||
new->html_fname = fname;
|
||||
new->next_ent = tag_table;
|
||||
tag_table = new;
|
||||
}
|
||||
@ -392,7 +419,7 @@ glean_node_from_menu (remember_ref, ref_type)
|
||||
char *nodename;
|
||||
char *line, *expanded_line;
|
||||
char *old_input = input_text;
|
||||
size_t old_size = input_text_length;
|
||||
int old_size = input_text_length;
|
||||
|
||||
if (strncmp (&input_text[input_text_offset + 1],
|
||||
MENU_STARTER,
|
||||
@ -457,9 +484,13 @@ set_current_output_filename (fname)
|
||||
void
|
||||
cm_node ()
|
||||
{
|
||||
static long epilogue_len = 0L;
|
||||
char *node, *prev, *next, *up;
|
||||
int new_node_pos, defaulting, this_section;
|
||||
int no_warn = 0;
|
||||
char *fname_for_this_node = NULL;
|
||||
char *tem;
|
||||
TAG_ENTRY *tag = NULL;
|
||||
|
||||
if (strcmp (command, "nwnode") == 0)
|
||||
no_warn = TAG_FLAG_NO_WARN;
|
||||
@ -473,27 +504,12 @@ cm_node ()
|
||||
|
||||
if (!html && !already_outputting_pending_notes)
|
||||
{
|
||||
if (!xml)
|
||||
close_paragraph ();
|
||||
output_pending_notes ();
|
||||
}
|
||||
|
||||
if (html && splitting && top_node_seen)
|
||||
{
|
||||
/* End the current split output file. */
|
||||
close_paragraph ();
|
||||
output_pending_notes ();
|
||||
start_paragraph ();
|
||||
/* Fixme: html: need a navigation bar here. */
|
||||
add_word ("</body></html>\n");
|
||||
close_paragraph ();
|
||||
fclose (output_stream);
|
||||
output_stream = NULL;
|
||||
}
|
||||
|
||||
filling_enabled = indented_fill = 0;
|
||||
new_node_pos = output_position;
|
||||
if (!html || (html && splitting))
|
||||
current_footnote_number = 1;
|
||||
|
||||
if (macro_expansion_output_stream && !executing_string)
|
||||
append_to_expansion_output (input_text_offset + 1);
|
||||
@ -510,6 +526,70 @@ cm_node ()
|
||||
prev = get_node_token (0);
|
||||
up = get_node_token (0);
|
||||
|
||||
if (html && splitting
|
||||
/* If there is a Top node, it always goes into index.html. So
|
||||
don't start a new HTML file for Top. */
|
||||
&& (top_node_seen || strcasecmp (node, "Top") != 0))
|
||||
{
|
||||
/* We test *node here so that @node without a valid name won't
|
||||
start a new file name with a bogus name such as ".html".
|
||||
This could happen if we run under "--force", where we cannot
|
||||
simply bail out. Continuing to use the same file sounds like
|
||||
the best we can do in such cases. */
|
||||
if (current_output_filename && output_stream && *node)
|
||||
{
|
||||
char *fname_for_prev_node;
|
||||
|
||||
if (current_node)
|
||||
{
|
||||
/* NOTE: current_node at this point still holds the name
|
||||
of the previous node. */
|
||||
tem = expand_node_name (current_node);
|
||||
fname_for_prev_node = nodename_to_filename (tem);
|
||||
free (tem);
|
||||
}
|
||||
else /* could happen if their top node isn't named "Top" */
|
||||
fname_for_prev_node = filename_part (current_output_filename);
|
||||
tem = expand_node_name (node);
|
||||
fname_for_this_node = nodename_to_filename (tem);
|
||||
free (tem);
|
||||
/* Don't close current output file, if next output file is
|
||||
to have the same name. This may happen at top level, or
|
||||
if two nodes produce the same file name under --split. */
|
||||
if (FILENAME_CMP (fname_for_this_node, fname_for_prev_node) != 0)
|
||||
{
|
||||
long pos1 = 0;
|
||||
|
||||
/* End the current split output file. */
|
||||
close_paragraph ();
|
||||
output_pending_notes ();
|
||||
start_paragraph ();
|
||||
/* Compute the length of the HTML file's epilogue. We
|
||||
cannot know the value until run time, due to the
|
||||
text/binary nuisance on DOS/Windows platforms, where
|
||||
2 `\r' characters could be added to the epilogue when
|
||||
it is written in text mode. */
|
||||
if (epilogue_len == 0)
|
||||
{
|
||||
flush_output ();
|
||||
pos1 = ftell (output_stream);
|
||||
}
|
||||
add_word ("</body></html>\n");
|
||||
close_paragraph ();
|
||||
if (epilogue_len == 0)
|
||||
epilogue_len = ftell (output_stream) - pos1;
|
||||
fclose (output_stream);
|
||||
output_stream = NULL;
|
||||
tag = find_node_by_fname (fname_for_this_node);
|
||||
}
|
||||
free (fname_for_prev_node);
|
||||
}
|
||||
}
|
||||
|
||||
filling_enabled = indented_fill = 0;
|
||||
if (!html || (html && splitting))
|
||||
current_footnote_number = 1;
|
||||
|
||||
if (verbose_mode)
|
||||
printf (_("Formatting node %s...\n"), node);
|
||||
|
||||
@ -517,7 +597,23 @@ cm_node ()
|
||||
remember_itext (input_text, input_text_offset);
|
||||
|
||||
no_indent = 1;
|
||||
if (!no_headers && !html)
|
||||
if (xml)
|
||||
{
|
||||
xml_begin_document ();
|
||||
xml_begin_node ();
|
||||
if (!docbook)
|
||||
{
|
||||
xml_insert_element (NODENAME, START);
|
||||
if (macro_expansion_output_stream && !executing_string)
|
||||
me_execute_string (node);
|
||||
else
|
||||
execute_string ("%s", node);
|
||||
xml_insert_element (NODENAME, END);
|
||||
}
|
||||
else
|
||||
xml_node_id = xml_id (node);
|
||||
}
|
||||
else if (!no_headers && !html)
|
||||
{
|
||||
add_word_args ("\037\nFile: %s, Node: ", pretty_output_filename);
|
||||
|
||||
@ -729,33 +825,83 @@ cm_node ()
|
||||
if (!*next) { free (next); next = NULL; }
|
||||
if (!*prev) { free (prev); prev = NULL; }
|
||||
if (!*up) { free (up); up = NULL; }
|
||||
remember_node (node, prev, next, up, new_node_pos, line_number, no_warn);
|
||||
remember_node (node, prev, next, up, new_node_pos, line_number,
|
||||
fname_for_this_node, no_warn);
|
||||
outstanding_node = 1;
|
||||
}
|
||||
|
||||
if (html)
|
||||
{
|
||||
char *tem;
|
||||
if (splitting && *node && output_stream == NULL)
|
||||
{
|
||||
char *dirname;
|
||||
char filename[PATH_MAX];
|
||||
|
||||
if (splitting)
|
||||
{ /* this code not operational, we do not currently split html */
|
||||
char filename[20];
|
||||
dirname = pathname_part (current_output_filename);
|
||||
strcpy (filename, dirname);
|
||||
strcat (filename, fname_for_this_node);
|
||||
free (dirname);
|
||||
|
||||
sprintf (filename, "node%d.html", number_of_node (node));
|
||||
output_stream = fopen (filename, "w");
|
||||
/* See if the node name converted to a file name clashes
|
||||
with other nodes or anchors. If it clashes with an
|
||||
anchor, we complain and nuke that anchor's file. */
|
||||
if (!tag)
|
||||
{
|
||||
output_stream = fopen (filename, "w");
|
||||
html_output_head_p = 0; /* so that we generate HTML preamble */
|
||||
html_output_head ();
|
||||
}
|
||||
else if ((tag->flags & TAG_FLAG_ANCHOR) != 0)
|
||||
{
|
||||
line_error (_("Anchor `%s' and node `%s' map to the same file name"),
|
||||
tag->node, node);
|
||||
file_line_error (tag->filename, tag->line_no,
|
||||
_("This @anchor command ignored; references to it will not work"));
|
||||
file_line_error (tag->filename, tag->line_no,
|
||||
_("Rename this anchor or use the `--no-split' option"));
|
||||
/* Nuke the file name recorded in anchor's tag.
|
||||
Since we are about to nuke the file itself, we
|
||||
don't want find_node_by_fname to consider this
|
||||
anchor anymore. */
|
||||
free (tag->html_fname);
|
||||
tag->html_fname = NULL;
|
||||
output_stream = fopen (filename, "w");
|
||||
html_output_head_p = 0; /* so that we generate HTML preamble */
|
||||
html_output_head ();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* This node's file name clashes with another node.
|
||||
We put them both on the same file. */
|
||||
output_stream = fopen (filename, "r+");
|
||||
if (output_stream)
|
||||
{
|
||||
static char html_end[] = "</body></html>\n";
|
||||
char end_line[sizeof(html_end)];
|
||||
int fpos = fseek (output_stream, -epilogue_len,
|
||||
SEEK_END);
|
||||
|
||||
if (fpos < 0
|
||||
|| fgets (end_line, sizeof (html_end),
|
||||
output_stream) == NULL
|
||||
/* Paranoia: did someone change the way HTML
|
||||
files are finished up? */
|
||||
|| strcasecmp (end_line, html_end) != 0)
|
||||
{
|
||||
line_error (_("Unexpected string at end of split-HTML file `%s'"),
|
||||
fname_for_this_node);
|
||||
fclose (output_stream);
|
||||
xexit (1);
|
||||
}
|
||||
fseek (output_stream, -epilogue_len, SEEK_END);
|
||||
}
|
||||
}
|
||||
if (output_stream == NULL)
|
||||
{
|
||||
fs_error (filename);
|
||||
xexit (1);
|
||||
}
|
||||
set_current_output_filename (filename);
|
||||
/* FIXME: when this code is operational, we will need to
|
||||
expand node, next, prev, and up before output. */
|
||||
add_word_args ("<html><head><title>%s</title>", node);
|
||||
if (next) add_link (next, "rel=next");
|
||||
if (prev) add_link (prev, "rel=previous");
|
||||
if (up) add_link (up, "rel=up");
|
||||
add_word ("</head>\n<body>\n");
|
||||
}
|
||||
|
||||
if (!splitting && no_headers)
|
||||
@ -779,32 +925,32 @@ cm_node ()
|
||||
|
||||
if (next)
|
||||
{
|
||||
add_word (",\n");
|
||||
add_word (_("Next:"));
|
||||
add_word ("<a rel=next href=\"");
|
||||
tem = expansion (next, 0);
|
||||
add_anchor_name (tem, 1);
|
||||
add_word_args ("\">%s</a>", tem);
|
||||
add_word (",\n");
|
||||
add_word (_("Next:"));
|
||||
add_word ("<a rel=next href=\"");
|
||||
add_anchor_name (tem, 1);
|
||||
add_word_args ("\">%s</a>", tem);
|
||||
free (tem);
|
||||
}
|
||||
if (prev)
|
||||
{
|
||||
add_word (",\n");
|
||||
add_word (_("Previous:"));
|
||||
add_word ("<a rel=previous href=\"");
|
||||
tem = expansion (prev, 0);
|
||||
add_anchor_name (tem, 1);
|
||||
add_word_args ("\">%s</a>", tem);
|
||||
add_word (",\n");
|
||||
add_word (_("Previous:"));
|
||||
add_word ("<a rel=previous href=\"");
|
||||
add_anchor_name (tem, 1);
|
||||
add_word_args ("\">%s</a>", tem);
|
||||
free (tem);
|
||||
}
|
||||
if (up)
|
||||
{
|
||||
add_word (",\n");
|
||||
add_word (_("Up:"));
|
||||
add_word ("<a rel=up href=\"");
|
||||
tem = expansion (up, 0);
|
||||
add_anchor_name (tem, 1);
|
||||
add_word_args ("\">%s</a>", tem);
|
||||
add_word (",\n");
|
||||
add_word (_("Up:"));
|
||||
add_word ("<a rel=up href=\"");
|
||||
add_anchor_name (tem, 1);
|
||||
add_word_args ("\">%s</a>", tem);
|
||||
free (tem);
|
||||
}
|
||||
/* html fixxme: we want a `top' or `contents' link here. */
|
||||
@ -812,7 +958,29 @@ cm_node ()
|
||||
add_word_args ("\n%s<br>\n", splitting ? "<hr>" : "");
|
||||
}
|
||||
}
|
||||
|
||||
else if (docbook)
|
||||
;
|
||||
else if (xml)
|
||||
{
|
||||
if (next)
|
||||
{
|
||||
xml_insert_element (NODENEXT, START);
|
||||
execute_string ("%s", next);
|
||||
xml_insert_element (NODENEXT, END);
|
||||
}
|
||||
if (prev)
|
||||
{
|
||||
xml_insert_element (NODEPREV, START);
|
||||
execute_string ("%s", prev);
|
||||
xml_insert_element (NODEPREV, END);
|
||||
}
|
||||
if (up)
|
||||
{
|
||||
xml_insert_element (NODEUP, START);
|
||||
execute_string ("%s", up);
|
||||
xml_insert_element (NODEUP, END);
|
||||
}
|
||||
}
|
||||
else if (!no_headers)
|
||||
{
|
||||
if (macro_expansion_output_stream)
|
||||
@ -858,6 +1026,7 @@ cm_anchor (arg)
|
||||
int arg;
|
||||
{
|
||||
char *anchor;
|
||||
char *fname_for_anchor = NULL;
|
||||
|
||||
if (arg == END)
|
||||
return;
|
||||
@ -872,6 +1041,8 @@ cm_anchor (arg)
|
||||
sure a new paragraph is indeed started. */
|
||||
if (!paragraph_is_open)
|
||||
{
|
||||
if (!executing_string && html)
|
||||
html_output_head ();
|
||||
start_paragraph ();
|
||||
if (!in_fixed_width_font || in_menu || in_detailmenu)
|
||||
{
|
||||
@ -882,11 +1053,104 @@ cm_anchor (arg)
|
||||
add_word ("<a name=\"");
|
||||
add_anchor_name (anchor, 0);
|
||||
add_word ("\"></a>");
|
||||
}
|
||||
if (splitting)
|
||||
{
|
||||
/* If we are splitting, cm_xref will produce a reference to
|
||||
a file whose name is derived from the anchor name. So we
|
||||
must create a file when we see an @anchor, otherwise
|
||||
xref's to anchors won't work. The file we create simply
|
||||
redirects to the file of this anchor's node. */
|
||||
TAG_ENTRY *tag;
|
||||
|
||||
fname_for_anchor = nodename_to_filename (anchor);
|
||||
/* See if the anchor name converted to a file name clashes
|
||||
with other anchors or nodes. */
|
||||
tag = find_node_by_fname (fname_for_anchor);
|
||||
if (tag)
|
||||
{
|
||||
if ((tag->flags & TAG_FLAG_ANCHOR) != 0)
|
||||
line_error (_("Anchors `%s' and `%s' map to the same file name"),
|
||||
anchor, tag->node);
|
||||
else
|
||||
line_error (_("Anchor `%s' and node `%s' map to the same file name"),
|
||||
anchor, tag->node);
|
||||
line_error (_("@anchor command ignored; references to it will not work"));
|
||||
line_error (_("Rename this anchor or use the `--no-split' option"));
|
||||
free (fname_for_anchor);
|
||||
/* We will not be creating a file for this anchor, so
|
||||
set its name to NULL, so that remember_node stores a
|
||||
NULL and find_node_by_fname won't consider this
|
||||
anchor for clashes. */
|
||||
fname_for_anchor = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
char *dirname, *p;
|
||||
char filename[PATH_MAX];
|
||||
FILE *anchor_stream;
|
||||
|
||||
dirname = pathname_part (current_output_filename);
|
||||
strcpy (filename, dirname);
|
||||
strcat (filename, fname_for_anchor);
|
||||
free (dirname);
|
||||
|
||||
anchor_stream = fopen (filename, "w");
|
||||
if (anchor_stream == NULL)
|
||||
{
|
||||
fs_error (filename);
|
||||
xexit (1);
|
||||
}
|
||||
/* The HTML magic below will cause the browser to
|
||||
immediately go to the anchor's node's file. Lynx
|
||||
seems not to support this redirection, but it looks
|
||||
like a bug in Lynx, and they can work around it by
|
||||
clicking on the link once more. */
|
||||
fputs ("<meta http-equiv=\"refresh\" content=\"0; url=",
|
||||
anchor_stream);
|
||||
/* Make the indirect link point to the current node's
|
||||
file and anchor's "<a name" label. If we don't have
|
||||
a valid node name, refer to the current output file
|
||||
instead. */
|
||||
if (current_node && *current_node)
|
||||
{
|
||||
char *fn, *tem;
|
||||
|
||||
tem = expand_node_name (current_node);
|
||||
fn = nodename_to_filename (tem);
|
||||
free (tem);
|
||||
fputs (fn, anchor_stream);
|
||||
free (fn);
|
||||
}
|
||||
else
|
||||
{
|
||||
char *base = filename_part (current_output_filename);
|
||||
|
||||
fputs (base, anchor_stream);
|
||||
free (base);
|
||||
}
|
||||
fputs ("#", anchor_stream);
|
||||
for (p = anchor; *p; p++)
|
||||
{
|
||||
if (*p == '&')
|
||||
fputs ("&", anchor_stream);
|
||||
else if (!URL_SAFE_CHAR (*p))
|
||||
fprintf (anchor_stream, "%%%x", (unsigned char) *p);
|
||||
else
|
||||
fputc (*p, anchor_stream);
|
||||
}
|
||||
fputs ("\">\n", anchor_stream);
|
||||
fclose (anchor_stream);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (xml)
|
||||
{
|
||||
xml_insert_element_with_attribute (ANCHOR, START, "name=\"%s\"", anchor);
|
||||
xml_insert_element (ANCHOR, END);
|
||||
}
|
||||
/* Save it in the tag table. */
|
||||
remember_node (anchor, NULL, NULL, NULL, output_position + output_column,
|
||||
line_number, TAG_FLAG_ANCHOR);
|
||||
line_number, fname_for_anchor, TAG_FLAG_ANCHOR);
|
||||
}
|
||||
|
||||
/* Find NODE in REF_LIST. */
|
||||
@ -1114,12 +1378,9 @@ validate_file (tag_table)
|
||||
{
|
||||
line_error (_("Next field of node `%s' not pointed to"),
|
||||
tags->node);
|
||||
line_number = temp_tag->line_no;
|
||||
input_filename = temp_tag->filename;
|
||||
line_error (_("This node (%s) has the bad Prev"),
|
||||
temp_tag->node);
|
||||
input_filename = tags->filename;
|
||||
line_number = tags->line_no;
|
||||
file_line_error (temp_tag->filename, temp_tag->line_no,
|
||||
_("This node (%s) has the bad Prev"),
|
||||
temp_tag->node);
|
||||
temp_tag->flags |= TAG_FLAG_PREV_ERROR;
|
||||
}
|
||||
}
|
||||
@ -1175,12 +1436,10 @@ validate_file (tag_table)
|
||||
line_error
|
||||
(_("Prev field of node `%s' not pointed to"),
|
||||
tags->node);
|
||||
line_number = temp_tag->line_no;
|
||||
input_filename = temp_tag->filename;
|
||||
line_error (_("This node (%s) has the bad Next"),
|
||||
temp_tag->node);
|
||||
input_filename = tags->filename;
|
||||
line_number = tags->line_no;
|
||||
file_line_error (temp_tag->filename,
|
||||
temp_tag->line_no,
|
||||
_("This node (%s) has the bad Next"),
|
||||
temp_tag->node);
|
||||
temp_tag->flags |= TAG_FLAG_NEXT_ERROR;
|
||||
}
|
||||
}
|
||||
@ -1259,13 +1518,9 @@ validate_file (tag_table)
|
||||
if (!nref && !tref)
|
||||
{
|
||||
temp_tag = find_node (tags->up);
|
||||
line_number = temp_tag->line_no;
|
||||
input_filename = temp_tag->filename;
|
||||
line_error (
|
||||
file_line_error (temp_tag->filename, temp_tag->line_no,
|
||||
_("Node `%s' lacks menu item for `%s' despite being its Up target"),
|
||||
tags->up, tags->node);
|
||||
line_number = tags->line_no;
|
||||
input_filename = tags->filename;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* node.h -- declarations for Node.
|
||||
$Id: node.h,v 1.5 1999/07/11 16:50:19 karl Exp $
|
||||
$Id: node.h,v 1.6 2002/01/16 15:52:45 karl Exp $
|
||||
|
||||
Copyright (C) 1996, 97, 98, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996, 97, 98, 99, 2002 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -39,6 +39,8 @@ typedef struct tentry
|
||||
int number; /* Number for this node, relevant for HTML
|
||||
splitting -- from use+define order, not just
|
||||
define. */
|
||||
char *html_fname; /* The HTML file to which this node is written
|
||||
(non-NULL only for HTML splitting). */
|
||||
} TAG_ENTRY;
|
||||
|
||||
/* If node-a has a "Next" for node-b, but node-b has no "Prev" for node-a,
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* sectioning.c -- all related stuff @chapter, @section... @contents
|
||||
$Id: sectioning.c,v 1.12 1999/08/17 21:06:50 karl Exp $
|
||||
$Id: sectioning.c,v 1.17 2002/02/09 00:54:51 karl Exp $
|
||||
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2001, 02 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -26,6 +26,7 @@
|
||||
#include "node.h"
|
||||
#include "toc.h"
|
||||
#include "sectioning.h"
|
||||
#include "xml.h"
|
||||
|
||||
/* See comment in sectioning.h. */
|
||||
section_alist_type section_alist[] = {
|
||||
@ -210,11 +211,37 @@ what_section (text)
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
sectioning_underscore (cmd)
|
||||
char *cmd;
|
||||
{
|
||||
if (xml)
|
||||
{
|
||||
char *temp;
|
||||
int level;
|
||||
temp = xmalloc (2 + strlen (cmd));
|
||||
temp[0] = COMMAND_PREFIX;
|
||||
strcpy (&temp[1], cmd);
|
||||
level = what_section (temp);
|
||||
level -= 2;
|
||||
free (temp);
|
||||
xml_close_sections (level);
|
||||
/* Mark the beginning of the section
|
||||
If the next command is printindex, we will remove
|
||||
the section and put an Index instead */
|
||||
flush_output ();
|
||||
xml_last_section_output_position = output_paragraph_offset;
|
||||
|
||||
xml_insert_element (xml_element (cmd), START);
|
||||
xml_insert_element (TITLE, START);
|
||||
xml_open_section (level, cmd);
|
||||
get_rest_of_line (0, &temp);
|
||||
execute_string ("%s\n", temp);
|
||||
free (temp);
|
||||
xml_insert_element (TITLE, END);
|
||||
}
|
||||
else
|
||||
{
|
||||
char character;
|
||||
char *temp;
|
||||
int level;
|
||||
@ -235,6 +262,7 @@ sectioning_underscore (cmd)
|
||||
{
|
||||
character = scoring_characters[level];
|
||||
insert_and_underscore (level, character, cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -385,16 +413,22 @@ sectioning_html (level, cmd)
|
||||
old_no_indent = no_indent;
|
||||
no_indent = 1;
|
||||
|
||||
add_word_args ("<h%d>", level + 1); /* level 0 is <h1> */
|
||||
add_word_args ("<h%d>", level + 2); /* level 0 (chapter) is <h2> */
|
||||
|
||||
/* If we are outside of any node, produce an anchor that
|
||||
the TOC could refer to. */
|
||||
if (!current_node || !*current_node)
|
||||
{
|
||||
static const char a_name[] = "<a name=\"";
|
||||
|
||||
starting_pos = output_paragraph + output_paragraph_offset;
|
||||
add_word_args ("<a name=\"TOC%d\">", toc_ref_count++);
|
||||
toc_anchor = substring (starting_pos + 9,
|
||||
add_word_args ("%sTOC%d\">", a_name, toc_ref_count++);
|
||||
toc_anchor = substring (starting_pos + sizeof (a_name) - 1,
|
||||
output_paragraph + output_paragraph_offset);
|
||||
/* This must be added after toc_anchor is extracted, since
|
||||
toc_anchor cannot include the closing </a>. For details,
|
||||
see toc.c:toc_add_entry and toc.c:contents_update_html. */
|
||||
add_word ("</a>");
|
||||
}
|
||||
starting_pos = output_paragraph + output_paragraph_offset;
|
||||
|
||||
@ -431,13 +465,13 @@ sectioning_html (level, cmd)
|
||||
if (section_alist[index].toc == TOC_YES)
|
||||
toc_add_entry (substring (starting_pos, ending_pos),
|
||||
level, current_node, toc_anchor);
|
||||
|
||||
|
||||
free (temp);
|
||||
|
||||
if (outstanding_node)
|
||||
outstanding_node = 0;
|
||||
|
||||
add_word_args ("</h%d>", level+1);
|
||||
add_word_args ("</h%d>", level + 2);
|
||||
close_paragraph();
|
||||
filling_enabled = 1;
|
||||
no_indent = old_no_indent;
|
||||
@ -488,14 +522,8 @@ cm_top ()
|
||||
{
|
||||
if (tag->flags & TAG_FLAG_IS_TOP)
|
||||
{
|
||||
int old_line_number = line_number;
|
||||
char *old_input_filename = input_filename;
|
||||
|
||||
line_number = tag->line_no;
|
||||
input_filename = tag->filename;
|
||||
line_error (_("Here is the %ctop node"), COMMAND_PREFIX);
|
||||
input_filename = old_input_filename;
|
||||
line_number = old_line_number;
|
||||
file_line_error (tag->filename, tag->line_no,
|
||||
_("Here is the %ctop node"), COMMAND_PREFIX);
|
||||
return;
|
||||
}
|
||||
tag = tag->next_ent;
|
||||
@ -506,7 +534,7 @@ cm_top ()
|
||||
TAG_ENTRY *top_node = find_node ("Top");
|
||||
top_node_seen = 1;
|
||||
|
||||
/* It is an error to use @top before you have used @node. */
|
||||
/* It is an error to use @top before using @node. */
|
||||
if (!tag_table)
|
||||
{
|
||||
char *top_name;
|
||||
@ -518,21 +546,6 @@ cm_top ()
|
||||
free (top_name);
|
||||
return;
|
||||
}
|
||||
else if (html && splitting)
|
||||
{
|
||||
char *next = top_node ? top_node->next : NULL;
|
||||
|
||||
add_word ("<p>");
|
||||
if (next)
|
||||
{
|
||||
add_word (_("Next:"));
|
||||
add_word ("<a rel=next href=\"");
|
||||
add_anchor_name (next, 1);
|
||||
add_word ("\">");
|
||||
execute_string (next);
|
||||
add_word ("</a>\n");
|
||||
}
|
||||
}
|
||||
|
||||
cm_unnumbered ();
|
||||
|
||||
|
345
contrib/texinfo/makeinfo/texinfo.dtd
Normal file
345
contrib/texinfo/makeinfo/texinfo.dtd
Normal file
@ -0,0 +1,345 @@
|
||||
<!-- $Id: texinfo.dtd,v 1.1 2001/05/21 17:36:22 karl Exp $
|
||||
Document Type Definition for Texinfo
|
||||
************************************
|
||||
For texinfo-4.0b
|
||||
*******************
|
||||
|
||||
Author: Philippe Martin (feloy@free.fr)
|
||||
Contributors:
|
||||
Karl Eichwalder (keichwa@gmx.net)
|
||||
|
||||
HISTORY
|
||||
*******
|
||||
Version 0.2 - 2001-05-08
|
||||
Version 0.1 - 2001-05-07
|
||||
|
||||
|
||||
|
||||
Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software Foundation,
|
||||
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
||||
-->
|
||||
|
||||
<!-- ENTITIES -->
|
||||
|
||||
<!-- Meta-information -->
|
||||
<!ENTITY % metainformation "setfilename | settitle | titlefont | dircategory">
|
||||
|
||||
<!-- block -->
|
||||
<!-- ***** -->
|
||||
<!ENTITY % block "menu | para | quotation | example | smallexample | lisp
|
||||
| smalllisp | cartouche | format | smallformat | display
|
||||
| smalldisplay | itemize | enumerate | sp | center | group
|
||||
| table | multitable">
|
||||
|
||||
<!-- Sectioning -->
|
||||
<!-- ********** -->
|
||||
<!ENTITY % section.level1 "top | chapter | unnumbered | appendix
|
||||
| majorheading | chapheading">
|
||||
|
||||
<!ENTITY % section.level2 "section | unnumberedsec | appendixsec | heading">
|
||||
|
||||
<!ENTITY % section.level3 "subsection | unnumberedsubsec | appendixsubsec
|
||||
| subheading">
|
||||
|
||||
<!ENTITY % section.level4 "subsubsection | unnumberedsubsubsec
|
||||
| appendixsubsubsec | subsubheading">
|
||||
|
||||
<!ENTITY % section.all "%section.level1; | %section.level2; | %section.level3;
|
||||
| %section.level4;">
|
||||
|
||||
|
||||
<!ENTITY % section.level1.content "(%block;
|
||||
| %section.level2;
|
||||
| %section.level3;
|
||||
| %section.level4;
|
||||
| printindex)*">
|
||||
|
||||
<!ENTITY % section.level2.content "(%block;
|
||||
| %section.level3;
|
||||
| %section.level4;)*">
|
||||
|
||||
<!ENTITY % section.level3.content "(%block;
|
||||
| %section.level4;)*">
|
||||
|
||||
<!ENTITY % section.level4.content "(%block;)*">
|
||||
|
||||
|
||||
<!-- Inline -->
|
||||
<!-- ****** -->
|
||||
<!ENTITY % Inline.emphasize "strong | emph">
|
||||
<!ENTITY % Inline.smallcaps "sc">
|
||||
<!ENTITY % Inline.fonts "i | b | tt | r">
|
||||
<!ENTITY % Inline.markup "code | dfn | cite | key | kbd | var | acronym | url">
|
||||
<!ENTITY % Inline.reference "xref | inforef | indexterm | email | uref">
|
||||
|
||||
<!ENTITY % Inline.phrase
|
||||
"%Inline.emphasize; | %Inline.smallcaps; | %Inline.fonts;
|
||||
| %Inline.markup; | %Inline.reference; ">
|
||||
|
||||
|
||||
<!-- ************ -->
|
||||
<!-- * ELEMENTS * -->
|
||||
<!-- ************ -->
|
||||
|
||||
<!-- TOP Level Element -->
|
||||
<!-- ***************** -->
|
||||
<!ELEMENT texinfo ((%metainformation; | node | %block;)* )>
|
||||
|
||||
<!-- meta-information -->
|
||||
<!ELEMENT setfilename (#PCDATA)>
|
||||
<!ELEMENT settitle (#PCDATA)>
|
||||
<!ELEMENT titlefont (#PCDATA)>
|
||||
<!ELEMENT dircategory (#PCDATA)>
|
||||
|
||||
<!-- NODES -->
|
||||
<!-- ***** -->
|
||||
<!ELEMENT node (nodename, nodenext?, nodeprev?, nodeup?,
|
||||
(para | menu | %section.all;)*) >
|
||||
|
||||
<!ELEMENT nodename (#PCDATA)>
|
||||
<!ELEMENT nodenext (#PCDATA)>
|
||||
<!ELEMENT nodeprev (#PCDATA)>
|
||||
<!ELEMENT nodeup (#PCDATA)>
|
||||
|
||||
<!-- SECTIONING -->
|
||||
<!-- ********** -->
|
||||
|
||||
<!ELEMENT top (title?, %section.level1.content;)>
|
||||
|
||||
<!ELEMENT chapter (title?, %section.level1.content;)>
|
||||
<!ELEMENT section (title?, %section.level2.content;)>
|
||||
<!ELEMENT subsection (title?, %section.level3.content;)>
|
||||
<!ELEMENT subsubsection (title?, %section.level4.content;)>
|
||||
|
||||
<!ELEMENT unnumbered (title?, %section.level1.content;)>
|
||||
<!ELEMENT unnumberedsec (title?, %section.level2.content;)>
|
||||
<!ELEMENT unnumberedsubsec (title?, %section.level3.content;)>
|
||||
<!ELEMENT unnumberedsubsubsec (title?, %section.level4.content;)>
|
||||
|
||||
<!ELEMENT appendix (title?, %section.level1.content;)>
|
||||
<!ELEMENT appendixsec (title?, %section.level2.content;)>
|
||||
<!ELEMENT appendixsubsec (title?, %section.level3.content;)>
|
||||
<!ELEMENT appendixsubsubsec (title?, %section.level4.content;)>
|
||||
|
||||
<!ELEMENT majorheading (title?, %section.level1.content;)>
|
||||
<!ELEMENT chapheading (title?, %section.level1.content;)>
|
||||
<!ELEMENT heading (title?, %section.level2.content;)>
|
||||
<!ELEMENT subheading (title?, %section.level3.content;)>
|
||||
<!ELEMENT subsubheading (title?, %section.level4.content;)>
|
||||
|
||||
<!ELEMENT title (#PCDATA | %Inline.phrase; | footnote)*>
|
||||
|
||||
<!-- BLOCK Elements -->
|
||||
<!-- ************** -->
|
||||
|
||||
<!ELEMENT quotation (#PCDATA | %block; | %Inline.phrase;)*>
|
||||
<!ELEMENT example (#PCDATA | %block; | %Inline.phrase;)*>
|
||||
<!ELEMENT smallexample (#PCDATA | %block; | %Inline.phrase;)*>
|
||||
<!ELEMENT lisp (#PCDATA | %block; | %Inline.phrase;)*>
|
||||
<!ELEMENT smalllisp (#PCDATA | %block; | %Inline.phrase;)*>
|
||||
<!ELEMENT cartouche (#PCDATA | %block; | %Inline.phrase;)*>
|
||||
<!ELEMENT format (#PCDATA | %block; | %Inline.phrase;)*>
|
||||
<!ELEMENT smallformat (#PCDATA | %block; | %Inline.phrase;)*>
|
||||
<!ELEMENT display (#PCDATA | %block; | %Inline.phrase;)*>
|
||||
<!ELEMENT smalldisplay (#PCDATA | %block; | %Inline.phrase;)*>
|
||||
<!ELEMENT center (#PCDATA | %block; | %Inline.phrase;)*>
|
||||
<!ELEMENT group (#PCDATA | %block; | %Inline.phrase;)*>
|
||||
<!ELEMENT image (#PCDATA)>
|
||||
|
||||
<!ELEMENT para (#PCDATA | %Inline.phrase; | footnote)*>
|
||||
|
||||
<!ELEMENT menu ((menuentry | para)*)>
|
||||
<!ELEMENT menuentry (menunode?, menutitle?, menucomment?)>
|
||||
<!ELEMENT menunode (#PCDATA)>
|
||||
<!ELEMENT menutitle (#PCDATA)>
|
||||
<!ELEMENT menucomment (#PCDATA | para)*>
|
||||
|
||||
<!-- Lists -->
|
||||
<!ELEMENT itemize (itemfunction, (item | itemize | enumerate | indexterm)*)>
|
||||
<!ELEMENT enumerate (enumarg?, (item | itemize | enumerate)*)>
|
||||
<!ATTLIST enumerate
|
||||
first CDATA #IMPLIED>
|
||||
|
||||
<!ELEMENT item (%block;)*>
|
||||
<!ELEMENT enumarg (#PCDATA)>
|
||||
|
||||
<!ELEMENT itemfunction (#PCDATA | %Inline.phrase;)*>
|
||||
|
||||
<!-- Tables -->
|
||||
<!ELEMENT table (tableitem | indexterm)+>
|
||||
<!ELEMENT tableitem (tableterm+, item)>
|
||||
<!ELEMENT tableterm (#PCDATA | %Inline.phrase;)*>
|
||||
|
||||
<!ELEMENT multitable (columnfraction*, row*)>
|
||||
<!ELEMENT columnfraction (#PCDATA)>
|
||||
<!ELEMENT row (entry*)>
|
||||
<!ELEMENT entry (#PCDATA | %Inline.phrase;)*>
|
||||
|
||||
<!-- INLINE Elements -->
|
||||
<!-- *************** -->
|
||||
|
||||
<!-- Emphasize -->
|
||||
<!ELEMENT strong (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT emph (#PCDATA | %Inline.phrase;)*>
|
||||
|
||||
<!-- small caps -->
|
||||
<!ELEMENT sc (#PCDATA | %Inline.phrase;)*>
|
||||
|
||||
<!-- fonts -->
|
||||
<!ELEMENT i (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT b (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT tt (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT r (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT notfixedwidth (#PCDATA | %Inline.phrase;)*>
|
||||
|
||||
<!-- markup -->
|
||||
<!ELEMENT code (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT dfn (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT cite (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT key (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT kbd (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT var (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT acronym (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT url (#PCDATA | %Inline.phrase;)*>
|
||||
|
||||
<!-- reference -->
|
||||
<!ELEMENT anchor EMPTY>
|
||||
<!ATTLIST anchor
|
||||
name CDATA #IMPLIED>
|
||||
|
||||
<!ELEMENT xref (xrefnodename | xrefinfoname | xrefinfofile
|
||||
| xrefprintedname | xrefprinteddesc)*>
|
||||
<!ELEMENT xrefnodename (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT xrefinfoname (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT xrefinfofile (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT xrefprintedname (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT xrefprinteddesc (#PCDATA | %Inline.phrase;)*>
|
||||
|
||||
<!ELEMENT inforef (inforefnodename | inforefrefname | inforefinfoname)*>
|
||||
<!ELEMENT inforefnodename (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT inforefrefname (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT inforefinfoname (#PCDATA | %Inline.phrase;)*>
|
||||
|
||||
<!ELEMENT indexterm (#PCDATA | %Inline.phrase;)*>
|
||||
<!ATTLIST indexterm
|
||||
INDEX CDATA #IMPLIED>
|
||||
|
||||
<!ELEMENT email (emailaddress, emailname?)>
|
||||
<!ELEMENT emailaddress (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT emailname (#PCDATA | %Inline.phrase;)*>
|
||||
|
||||
<!ELEMENT uref (urefurl, urefdesc?, urefreplacement?)>
|
||||
<!ELEMENT urefurl (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT urefdesc (#PCDATA | %Inline.phrase;)*>
|
||||
<!ELEMENT urefreplacement (#PCDATA | %Inline.phrase;)*>
|
||||
|
||||
<!ELEMENT footnote (para)>
|
||||
|
||||
|
||||
|
||||
<!ENTITY tex "TeX">
|
||||
<!ENTITY ellipsis "">
|
||||
<!ENTITY lt "">
|
||||
<!ENTITY gt "">
|
||||
<!ENTITY bullet "">
|
||||
<!ENTITY copyright "">
|
||||
<!ENTITY minus "">
|
||||
<!ENTITY linebreak "">
|
||||
<!ENTITY space "">
|
||||
<!ENTITY dots "">
|
||||
<!ENTITY enddots "">
|
||||
<!ENTITY amp "">
|
||||
|
||||
<!ENTITY auml "">
|
||||
<!ENTITY ouml "">
|
||||
<!ENTITY uuml "">
|
||||
<!ENTITY Auml "">
|
||||
<!ENTITY Ouml "">
|
||||
<!ENTITY Uuml "">
|
||||
<!ENTITY Euml "">
|
||||
<!ENTITY euml "">
|
||||
<!ENTITY Iuml "">
|
||||
<!ENTITY iuml "">
|
||||
<!ENTITY yuml "">
|
||||
<!ENTITY uml "">
|
||||
|
||||
<!ENTITY Aacute "">
|
||||
<!ENTITY Eacute "">
|
||||
<!ENTITY Iacute "">
|
||||
<!ENTITY Oacute "">
|
||||
<!ENTITY Uacute "">
|
||||
<!ENTITY Yacute "">
|
||||
<!ENTITY aacute "">
|
||||
<!ENTITY eacute "">
|
||||
<!ENTITY iacute "">
|
||||
<!ENTITY oacute "">
|
||||
<!ENTITY uacute "">
|
||||
<!ENTITY yacute "">
|
||||
|
||||
<!ENTITY ccedil "">
|
||||
<!ENTITY Ccedil "">
|
||||
|
||||
<!ENTITY Acirc "">
|
||||
<!ENTITY Ecirc "">
|
||||
<!ENTITY Icirc "">
|
||||
<!ENTITY Ocirc "">
|
||||
<!ENTITY Ucirc "">
|
||||
<!ENTITY acirc "">
|
||||
<!ENTITY ecirc "">
|
||||
<!ENTITY icirc "">
|
||||
<!ENTITY ocirc "">
|
||||
<!ENTITY ucirc "">
|
||||
|
||||
<!ENTITY Agrave "">
|
||||
<!ENTITY Egrave "">
|
||||
<!ENTITY Igrave "">
|
||||
<!ENTITY Ograve "">
|
||||
<!ENTITY Ugrave "">
|
||||
<!ENTITY agrave "">
|
||||
<!ENTITY egrave "">
|
||||
<!ENTITY igrave "">
|
||||
<!ENTITY ograve "">
|
||||
<!ENTITY ugrave "">
|
||||
|
||||
<!ENTITY Atilde "">
|
||||
<!ENTITY Ntilde "">
|
||||
<!ENTITY Otilde "">
|
||||
<!ENTITY atilde "">
|
||||
<!ENTITY ntilde "">
|
||||
<!ENTITY otilde "">
|
||||
|
||||
<!ENTITY oslash "">
|
||||
<!ENTITY Oslash "">
|
||||
|
||||
<!ENTITY iexcl "">
|
||||
<!ENTITY pound "">
|
||||
<!ENTITY iquest "">
|
||||
<!ENTITY AElig "">
|
||||
<!ENTITY aelig "">
|
||||
<!ENTITY Aring "">
|
||||
<!ENTITY aring "">
|
||||
<!ENTITY szlig "">
|
||||
|
||||
<!ENTITY macr "">
|
||||
|
||||
|
||||
<!-- fixxme: not yet classified -->
|
||||
|
||||
<!ELEMENT sp (#PCDATA)>
|
||||
<!ATTLIST sp
|
||||
lines CDATA #IMPLIED>
|
||||
<!ELEMENT printindex (#PCDATA)>
|
||||
|
242
contrib/texinfo/makeinfo/texinfo.xsl
Normal file
242
contrib/texinfo/makeinfo/texinfo.xsl
Normal file
@ -0,0 +1,242 @@
|
||||
<?xml version='1.0'?>
|
||||
<!-- $Id: texinfo.xsl,v 1.1 2001/06/07 18:35:23 karl Exp $ -->
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
version="1.0">
|
||||
|
||||
<xsl:output method="html" indent="yes"/>
|
||||
|
||||
<!-- root rule -->
|
||||
<xsl:template match="/">
|
||||
<HTML>
|
||||
<HEAD><TITLE>
|
||||
<xsl:apply-templates select="TEXINFO/SETTITLE" mode="head"/>
|
||||
</TITLE></HEAD>
|
||||
<BODY BGCOLOR="#FFFFFF"><xsl:apply-templates/>
|
||||
</BODY></HTML>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="TEXINFO">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="TEXINFO/SETFILENAME">
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="TEXINFO/SETTITLE" mode="head">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="TEXINFO/SETTITLE">
|
||||
<h1><xsl:apply-templates/></h1>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="TEXINFO/DIRCATEGORY">
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//PARA">
|
||||
<p><xsl:apply-templates/></p>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//EMPH">
|
||||
<i><xsl:apply-templates/></i>
|
||||
</xsl:template>
|
||||
|
||||
<!-- The node -->
|
||||
<xsl:template match="TEXINFO/NODE">
|
||||
<hr><p>
|
||||
<xsl:apply-templates select="NODENAME" mode="select"/>
|
||||
<xsl:apply-templates select="NODEPREV" mode="select"/>
|
||||
<xsl:apply-templates select="NODEUP" mode="select"/>
|
||||
<xsl:apply-templates select="NODENEXT" mode="select"/>
|
||||
<xsl:apply-templates/>
|
||||
<h2>Footnotes</h2>
|
||||
<ol>
|
||||
<xsl:apply-templates select=".//FOOTNOTE" mode="footnote"/>
|
||||
</ol>
|
||||
</p></hr>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="TEXINFO/NODE/NODENAME" mode="select">
|
||||
<h2>
|
||||
<a>
|
||||
<xsl:attribute name="name">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:attribute>
|
||||
<xsl:apply-templates/>
|
||||
</a>
|
||||
</h2>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="TEXINFO/NODE/NODENAME"/>
|
||||
|
||||
|
||||
<xsl:template match="TEXINFO/NODE/NODEPREV" mode="select">
|
||||
[ <b>Previous: </b>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:text>#</xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:attribute>
|
||||
<xsl:apply-templates/>
|
||||
</a> ]
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="TEXINFO/NODE/NODEPREV"/>
|
||||
|
||||
<xsl:template match="TEXINFO/NODE/NODEUP" mode="select">
|
||||
[ <b>Up: </b>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:text>#</xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:attribute>
|
||||
<xsl:apply-templates/>
|
||||
</a> ]
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="TEXINFO/NODE/NODEUP"/>
|
||||
|
||||
<xsl:template match="TEXINFO/NODE/NODENEXT" mode="select">
|
||||
[ <b>Next: </b>
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:text>#</xsl:text>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:attribute>
|
||||
<xsl:apply-templates/>
|
||||
</a> ]
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="TEXINFO/NODE/NODENEXT"/>
|
||||
|
||||
<!-- Menu -->
|
||||
<xsl:template match="//MENU">
|
||||
<h3>Menu</h3>
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//MENU/MENUENTRY">
|
||||
<a>
|
||||
<xsl:attribute name="href">
|
||||
<xsl:text>#</xsl:text>
|
||||
<xsl:apply-templates select="MENUNODE"/>
|
||||
</xsl:attribute>
|
||||
<xsl:apply-templates select="MENUTITLE"/>
|
||||
</a>:
|
||||
<xsl:apply-templates select="MENUCOMMENT"/>
|
||||
<br></br>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//MENU/MENUENTRY/MENUNODE">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//MENU/MENUENTRY/MENUTITLE">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//MENU/MENUENTRY/MENUCOMMENT">
|
||||
<xsl:apply-templates mode="menucomment"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="PARA" mode="menucomment">
|
||||
<xsl:apply-templates/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//PARA">
|
||||
<p><xsl:apply-templates/></p>
|
||||
</xsl:template>
|
||||
|
||||
<!-- LISTS -->
|
||||
<xsl:template match="//ITEMIZE">
|
||||
<ul>
|
||||
<xsl:apply-templates/>
|
||||
</ul>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//ITEMIZE/ITEM">
|
||||
<li>
|
||||
<xsl:apply-templates/>
|
||||
</li>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//ENUMERATE">
|
||||
<ol>
|
||||
<xsl:apply-templates/>
|
||||
</ol>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//ENUMERATE/ITEM">
|
||||
<li>
|
||||
<xsl:apply-templates/>
|
||||
</li>
|
||||
</xsl:template>
|
||||
|
||||
<!-- INLINE -->
|
||||
<xsl:template match="//CODE">
|
||||
<tt>
|
||||
<xsl:apply-templates/>
|
||||
</tt>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//DFN">
|
||||
<i><b>
|
||||
<xsl:apply-templates/>
|
||||
</b></i>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//STRONG">
|
||||
<b>
|
||||
<xsl:apply-templates/>
|
||||
</b>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//CENTER">
|
||||
<center>
|
||||
<xsl:apply-templates/>
|
||||
</center>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//VAR">
|
||||
<i>
|
||||
<xsl:apply-templates/>
|
||||
</i>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//KBD">
|
||||
<tt>
|
||||
<xsl:apply-templates/>
|
||||
</tt>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//KEY">
|
||||
<b>
|
||||
<xsl:apply-templates/>
|
||||
</b>
|
||||
</xsl:template>
|
||||
|
||||
<!-- BLOCKS -->
|
||||
<xsl:template match="//DISPLAY">
|
||||
<pre>
|
||||
<xsl:apply-templates/>
|
||||
</pre>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- INDEX -->
|
||||
<xsl:template match="//INDEXTERM">
|
||||
</xsl:template>
|
||||
|
||||
<!-- FOOTNOTE -->
|
||||
<xsl:template match="//FOOTNOTE">
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="//FOOTNOTE" mode="footnote">
|
||||
<li><xsl:apply-templates/></li>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* toc.c -- table of contents handling.
|
||||
$Id: toc.c,v 1.14 1999/08/09 20:28:18 karl Exp $
|
||||
$Id: toc.c,v 1.21 2002/02/23 19:12:15 karl Exp $
|
||||
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
Copyright (C) 1999, 2000, 01, 02 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -25,6 +25,7 @@
|
||||
#include "files.h"
|
||||
#include "macro.h"
|
||||
#include "node.h"
|
||||
#include "html.h"
|
||||
#include "lang.h"
|
||||
#include "makeinfo.h"
|
||||
#include "sectioning.h"
|
||||
@ -32,7 +33,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
/* array of toc entries */
|
||||
static TOC_ENTRY_ELT **toc_entry_alist = NULL;
|
||||
|
||||
@ -60,6 +60,7 @@ toc_add_entry (tocname, level, node_name, anchor)
|
||||
char *anchor;
|
||||
{
|
||||
char *tocname_and_node, *expanded_node, *s, *d;
|
||||
char *filename = NULL;
|
||||
|
||||
if (!node_name)
|
||||
node_name = "";
|
||||
@ -74,52 +75,59 @@ toc_add_entry (tocname, level, node_name, anchor)
|
||||
if (html)
|
||||
{
|
||||
/* We need to insert the expanded node name into the TOC, so
|
||||
that when we eventually output the TOC, its <A REF= link will
|
||||
point to the <A NAME= tag created by cm_node in the navigation
|
||||
bar. We cannot expand the containing_node member, for the
|
||||
reasons explained in the WARNING below. We also cannot wait
|
||||
with the node name expansion until the TOC is actually output,
|
||||
since by that time the macro definitions may have been changed.
|
||||
So instead we store in the tocname member the expanded node
|
||||
name and the TOC name concatenated together (with the necessary
|
||||
HTML markup), since that's how they are output. */
|
||||
that when we eventually output the TOC, its <A REF= link will
|
||||
point to the <A NAME= tag created by cm_node in the navigation
|
||||
bar. We cannot expand the containing_node member, for the
|
||||
reasons explained in the WARNING below. We also cannot wait
|
||||
with the node name expansion until the TOC is actually output,
|
||||
since by that time the macro definitions may have been changed.
|
||||
So instead we store in the tocname member the expanded node
|
||||
name and the TOC name concatenated together (with the necessary
|
||||
HTML markup), since that's how they are output. */
|
||||
if (!anchor)
|
||||
s = expanded_node = expand_node_name (node_name);
|
||||
s = expanded_node = expand_node_name (node_name);
|
||||
else
|
||||
expanded_node = anchor;
|
||||
/* Sigh... Need to HTML-escape the expanded node name like
|
||||
add_anchor_name does, except that we are not writing this to
|
||||
the output, so can't use add_anchor_name... */
|
||||
/* The factor 5 in the next allocation is because the maximum
|
||||
expansion of HTML-escaping is for the & character, which is
|
||||
output as "&". 2 is for "> that separates node from tocname. */
|
||||
d = tocname_and_node = (char *)xmalloc (2 + 5 * strlen (expanded_node)
|
||||
+ strlen (tocname) + 1);
|
||||
if (!anchor)
|
||||
expanded_node = anchor;
|
||||
if (splitting)
|
||||
{
|
||||
for (; *s; s++)
|
||||
{
|
||||
if (*s == '&')
|
||||
{
|
||||
strcpy (d, "&");
|
||||
d += 5;
|
||||
}
|
||||
else if (! URL_SAFE_CHAR (*s))
|
||||
{
|
||||
sprintf (d, "%%%x", (unsigned char) *s);
|
||||
/* do this manually since sprintf returns char * on
|
||||
SunOS 4 and other old systems. */
|
||||
while (*d)
|
||||
d++;
|
||||
}
|
||||
else
|
||||
*d++ = *s;
|
||||
}
|
||||
strcpy (d, "\">");
|
||||
if (!anchor)
|
||||
filename = nodename_to_filename (expanded_node);
|
||||
else
|
||||
filename = filename_part (current_output_filename);
|
||||
}
|
||||
/* Sigh... Need to HTML-escape the expanded node name like
|
||||
add_anchor_name does, except that we are not writing this to
|
||||
the output, so can't use add_anchor_name... */
|
||||
/* The factor 5 in the next allocation is because the maximum
|
||||
expansion of HTML-escaping is for the & character, which is
|
||||
output as "&". 2 is for "> that separates node from tocname. */
|
||||
d = tocname_and_node = (char *)xmalloc (2 + 5 * strlen (expanded_node)
|
||||
+ strlen (tocname) + 1);
|
||||
if (!anchor)
|
||||
{
|
||||
for (; *s; s++)
|
||||
{
|
||||
if (*s == '&')
|
||||
{
|
||||
strcpy (d, "&");
|
||||
d += 5;
|
||||
}
|
||||
else if (! URL_SAFE_CHAR (*s))
|
||||
{
|
||||
sprintf (d, "%%%x", (unsigned char) *s);
|
||||
/* do this manually since sprintf returns char * on
|
||||
SunOS 4 and other old systems. */
|
||||
while (*d)
|
||||
d++;
|
||||
}
|
||||
else
|
||||
*d++ = *s;
|
||||
}
|
||||
strcpy (d, "\">");
|
||||
}
|
||||
else
|
||||
/* Section outside any node, they provided explicit anchor. */
|
||||
strcpy (d, anchor);
|
||||
/* Section outside any node, they provided explicit anchor. */
|
||||
strcpy (d, anchor);
|
||||
strcat (d, tocname);
|
||||
free (tocname); /* it was malloc'ed by substring() */
|
||||
free (expanded_node);
|
||||
@ -137,6 +145,7 @@ toc_add_entry (tocname, level, node_name, anchor)
|
||||
toc_entry_alist[toc_counter]->containing_node = xstrdup (node_name);
|
||||
toc_entry_alist[toc_counter]->level = level;
|
||||
toc_entry_alist[toc_counter]->number = toc_counter;
|
||||
toc_entry_alist[toc_counter]->html_file = filename;
|
||||
|
||||
/* have to be done at least */
|
||||
return toc_counter++;
|
||||
@ -192,8 +201,8 @@ toc_free ()
|
||||
}
|
||||
|
||||
|
||||
/* print table of contents in HTML, may be we can produce a standalone
|
||||
HTML file? */
|
||||
/* Print table of contents in HTML. */
|
||||
|
||||
static void
|
||||
contents_update_html (fp)
|
||||
FILE *fp;
|
||||
@ -209,10 +218,10 @@ contents_update_html (fp)
|
||||
|
||||
flush_output (); /* in case we are writing stdout */
|
||||
|
||||
fprintf (fp, "\n<h1>%s</h1>\n<ul>\n", _("Table of Contents"));
|
||||
fprintf (fp, "\n<h2>%s</h2>\n<ul>\n", _("Table of Contents"));
|
||||
|
||||
last_level = toc_entry_alist[0]->level;
|
||||
|
||||
|
||||
for (i = 0; i < toc_counter; i++)
|
||||
{
|
||||
if (toc_entry_alist[i]->level > last_level)
|
||||
@ -231,7 +240,35 @@ contents_update_html (fp)
|
||||
fputs ("</ul>\n", fp);
|
||||
}
|
||||
|
||||
fprintf (fp, "<li><a href=\"#%s</a>\n", toc_entry_alist[i]->name);
|
||||
/* No double entries in TOC. */
|
||||
if (!(i && strcmp (toc_entry_alist[i]->name,
|
||||
toc_entry_alist[i-1]->name) == 0))
|
||||
{
|
||||
/* each toc entry is a list item. */
|
||||
fputs ("<li>", fp);
|
||||
|
||||
/* For chapters (only), insert an anchor that the short contents
|
||||
will link to. */
|
||||
if (toc_entry_alist[i]->level == 0)
|
||||
{
|
||||
char *p = toc_entry_alist[i]->name;
|
||||
|
||||
/* toc_entry_alist[i]->name has the form `foo">bar',
|
||||
that is, it includes both the node name and anchor
|
||||
text. We need to find where `foo', the node name,
|
||||
ends, and use that in toc_FOO. */
|
||||
while (*p && *p != '"')
|
||||
p++;
|
||||
fprintf (fp, "<a name=\"toc_%.*s\"></a>\n ",
|
||||
p - toc_entry_alist[i]->name, toc_entry_alist[i]->name);
|
||||
}
|
||||
|
||||
/* Insert link -- to an external file if splitting, or
|
||||
within the current document if not splitting. */
|
||||
fprintf (fp, "<a href=\"%s#%s</a>\n",
|
||||
splitting ? toc_entry_alist[i]->html_file : "",
|
||||
toc_entry_alist[i]->name);
|
||||
}
|
||||
|
||||
last_level = toc_entry_alist[i]->level;
|
||||
}
|
||||
@ -282,29 +319,39 @@ shortcontents_update_html (fp)
|
||||
FILE *fp;
|
||||
{
|
||||
int i;
|
||||
char *toc_file;
|
||||
|
||||
/* does exist any toc? */
|
||||
if (!toc_counter)
|
||||
return;
|
||||
|
||||
|
||||
flush_output (); /* in case we are writing stdout */
|
||||
|
||||
fprintf (fp, "\n<h1>%s</h1>\n<ul>\n", _("Short Contents"));
|
||||
fprintf (fp, "\n<h2>%s</h2>\n<ul>\n", _("Short Contents"));
|
||||
|
||||
if (contents_filename)
|
||||
toc_file = filename_part (contents_filename);
|
||||
|
||||
for (i = 0; i < toc_counter; i++)
|
||||
{
|
||||
if ((toc_entry_alist[i])->level == 0)
|
||||
{
|
||||
fputs ("<li>", fp);
|
||||
fprintf (fp, "<a href=\"#%s\n", toc_entry_alist[i]->name);
|
||||
}
|
||||
}
|
||||
char *name = toc_entry_alist[i]->name;
|
||||
|
||||
if (toc_entry_alist[i]->level == 0)
|
||||
{
|
||||
if (contents_filename)
|
||||
fprintf (fp, "<li><a href=\"%s#toc_%s</a>\n",
|
||||
splitting ? toc_file : "", name);
|
||||
else
|
||||
fprintf (fp, "<a href=\"%s#%s</a>\n",
|
||||
splitting ? toc_entry_alist[i]->html_file : "", name);
|
||||
}
|
||||
}
|
||||
fputs ("</ul>\n\n", fp);
|
||||
if (contents_filename)
|
||||
free (toc_file);
|
||||
}
|
||||
|
||||
/* short contents in ASCII (--no-headers).
|
||||
May be we should create a new command line switch --ascii ? */
|
||||
/* short contents in ASCII (--no-headers). */
|
||||
static void
|
||||
shortcontents_update_info (fp)
|
||||
FILE *fp;
|
||||
@ -321,7 +368,7 @@ shortcontents_update_info (fp)
|
||||
|
||||
for (i = 0; i < toc_counter; i++)
|
||||
{
|
||||
if ((toc_entry_alist[i])->level == 0)
|
||||
if (toc_entry_alist[i]->level == 0)
|
||||
fprintf (fp, "%s\n", toc_entry_alist[i]->name);
|
||||
}
|
||||
fputs ("\n\n", fp);
|
||||
@ -337,13 +384,18 @@ rewrite_top (fname, placebo)
|
||||
{
|
||||
int idx;
|
||||
|
||||
/* Can't rewrite standard output or the null device. No point in
|
||||
complaining. */
|
||||
if (STREQ (fname, "-")
|
||||
|| FILENAME_CMP (fname, NULL_DEVICE) == 0
|
||||
|| FILENAME_CMP (fname, ALSO_NULL_DEVICE) == 0)
|
||||
return -1;
|
||||
|
||||
toc_buf = find_and_load (fname);
|
||||
|
||||
if (!toc_buf)
|
||||
{
|
||||
/* Can't rewrite standard output. No point in complaining. */
|
||||
if (!STREQ (fname, "-"))
|
||||
fs_error (fname);
|
||||
fs_error (fname);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -442,6 +494,8 @@ cm_contents (arg)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!executing_string && html)
|
||||
html_output_head ();
|
||||
contents_filename = xstrdup (current_output_filename);
|
||||
insert_string (contents_placebo); /* just mark it, for now */
|
||||
}
|
||||
@ -469,6 +523,8 @@ cm_shortcontents (arg)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!executing_string && html)
|
||||
html_output_head ();
|
||||
shortcontents_filename = xstrdup (current_output_filename);
|
||||
insert_string (shortcontents_placebo); /* just mark it, for now */
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* toc.h -- table of contents handling.
|
||||
$Id: toc.h,v 1.4 1999/04/25 19:49:22 karl Exp $
|
||||
$Id: toc.h,v 1.5 2002/02/09 00:54:51 karl Exp $
|
||||
|
||||
Copyright (C) 1999 Free Software Foundation, Inc.
|
||||
|
||||
@ -32,6 +32,7 @@ extern char *shortcontents_filename;
|
||||
typedef struct toc_entry_elt {
|
||||
char *name;
|
||||
char *containing_node; /* Name of node containing this section. */
|
||||
char *html_file; /* Name of HTML node-file in split-HTML mode */
|
||||
int number; /* counting number from 0...n independent from
|
||||
chapter/section can be used for anchors or
|
||||
references to it. */
|
||||
|
1428
contrib/texinfo/makeinfo/xml.c
Normal file
1428
contrib/texinfo/makeinfo/xml.c
Normal file
File diff suppressed because it is too large
Load Diff
76
contrib/texinfo/makeinfo/xml.h
Normal file
76
contrib/texinfo/makeinfo/xml.h
Normal file
@ -0,0 +1,76 @@
|
||||
/* xml.h -- xml output declarations.
|
||||
$Id: xml.h,v 1.3 2001/05/01 16:29:29 karl Exp $
|
||||
|
||||
Copyright (C) 2001 Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
Written by Philippe Martin <feloy@free.fr>. */
|
||||
|
||||
#ifndef XML_H
|
||||
#define XML_H
|
||||
|
||||
/* Options. */
|
||||
|
||||
/* Separate index entries into divisions for each letters. */
|
||||
extern int xml_index_divisions;
|
||||
extern int xml_sort_index;
|
||||
|
||||
extern int xml_node_open;
|
||||
extern int xml_no_para;
|
||||
extern char *xml_node_id;
|
||||
extern int xml_last_section_output_position;
|
||||
|
||||
enum xml_element
|
||||
{
|
||||
TEXINFO=0, SETFILENAME, TITLEFONT, SETTITLE,
|
||||
/* Node */
|
||||
NODE /* 4 */, NODENEXT, NODEPREV, NODEUP,
|
||||
/* Structuring */
|
||||
CHAPTER /* 8 */, SECTION, SUBSECTION, SUBSUBSECTION,
|
||||
TOP /* 12 */, UNNUMBERED, UNNUMBEREDSEC, UNNUMBEREDSUBSEC, UNNUMBEREDSUBSUBSEC,
|
||||
APPENDIX /* 17 */, APPENDIXSEC, APPENDIXSUBSEC, APPENDIXSUBSUBSEC,
|
||||
MAJORHEADING /* 21 */, CHAPHEADING, HEADING, SUBHEADING, SUBSUBHEADING,
|
||||
/* Menu */
|
||||
MENU /* 26 */, MENUENTRY, MENUTITLE, MENUCOMMENT, MENUNODE, NODENAME,
|
||||
/* -- */
|
||||
ACRONYM/* 32 */, TT, CODE, KBD, URL, KEY, VAR, SC, DFN, EMPH, STRONG, CITE, NOTFIXEDWIDTH, I, B, R,
|
||||
TITLE,
|
||||
IFINFO,
|
||||
SP, CENTER,
|
||||
DIRCATEGORY,
|
||||
QUOTATION, EXAMPLE, SMALLEXAMPLE, LISP, SMALLLISP, CARTOUCHE, FORMAT, SMALLFORMAT, DISPLAY, SMALLDISPLAY,
|
||||
FOOTNOTE,
|
||||
ITEMIZE, ITEMFUNCTION, ITEM, ENUMERATE, TABLE, TABLEITEM, TABLETERM,
|
||||
INDEXTERM,
|
||||
XREF, XREFNODENAME, XREFINFONAME, XREFPRINTEDDESC, XREFINFOFILE, XREFPRINTEDNAME,
|
||||
INFOREF, INFOREFNODENAME, INFOREFREFNAME, INFOREFINFONAME,
|
||||
UREF, UREFURL, UREFDESC, UREFREPLACEMENT,
|
||||
EMAIL, EMAILADDRESS, EMAILNAME,
|
||||
GROUP,
|
||||
PRINTINDEX,
|
||||
ANCHOR,
|
||||
IMAGE,
|
||||
PRIMARY, SECONDARY, INFORMALFIGURE, MEDIAOBJECT, IMAGEOBJECT, IMAGEDATA, TEXTOBJECT,
|
||||
INDEXENTRY, PRIMARYIE, SECONDARYIE, INDEXDIV,
|
||||
MULTITABLE, TGROUP, COLSPEC, TBODY, ENTRY, ROW,
|
||||
BOOKINFO, ABSTRACT, REPLACEABLE,
|
||||
PARA
|
||||
};
|
||||
|
||||
extern void xml_insert_element (/* int name, int arg */);
|
||||
extern char *xml_id (/* char *id */);
|
||||
|
||||
#endif /* XML_H */
|
@ -1,7 +1,8 @@
|
||||
/* Process TeX index dribble output into an actual index.
|
||||
$Id: texindex.c,v 1.34 1999/08/06 17:03:14 karl Exp $
|
||||
$Id: texindex.c,v 1.37 2002/01/19 01:12:54 karl Exp $
|
||||
|
||||
Copyright (C) 1987, 91, 92, 96, 97, 98, 99 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987, 91, 92, 96, 97, 98, 99, 2000, 01, 02
|
||||
Free Software Foundation, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@ -337,7 +338,7 @@ decode_command (argc, argv)
|
||||
There is NO warranty. You may redistribute this software\n\
|
||||
under the terms of the GNU General Public License.\n\
|
||||
For more information about these matters, see the files named COPYING.\n"),
|
||||
"1999");
|
||||
"2002");
|
||||
xexit (0);
|
||||
}
|
||||
else if ((strcmp (arg, "--keep") == 0) ||
|
||||
|
Loading…
Reference in New Issue
Block a user