diff options
author | Jason Downs <downsj@cvs.openbsd.org> | 1996-12-15 21:39:33 +0000 |
---|---|---|
committer | Jason Downs <downsj@cvs.openbsd.org> | 1996-12-15 21:39:33 +0000 |
commit | f4e11623bbd2183bfcdce4dec50d5009872cacf6 (patch) | |
tree | 68a6248b98e4c2af45363b70809a84bcd338b5bf | |
parent | 5d9f4d722a52b44e1542da07a937f82c88e34cb1 (diff) |
Import of texinfo-3.9.
-rw-r--r-- | gnu/usr.bin/texinfo/COPYING | 4 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/ChangeLog | 622 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/NEWS | 414 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/README | 36 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/TODO | 37 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/dir | 16 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/dir-example | 309 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/emacs/new-useful-setqs | 180 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/info/terminal.h | 5 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/install-sh | 250 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/libtxi/memcpy.c | 20 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/libtxi/memmove.c | 24 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/libtxi/strdup.c | 43 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/makeinfo/makeinfo.h | 193 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/makeinfo/multi.c | 418 | ||||
-rw-r--r-- | gnu/usr.bin/texinfo/util/install-info.c | 1111 |
16 files changed, 3334 insertions, 348 deletions
diff --git a/gnu/usr.bin/texinfo/COPYING b/gnu/usr.bin/texinfo/COPYING index a43ea2126fb..916d1f0f284 100644 --- a/gnu/usr.bin/texinfo/COPYING +++ b/gnu/usr.bin/texinfo/COPYING @@ -2,7 +2,7 @@ Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 675 Mass Ave, Cambridge, MA 02139, USA + 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. @@ -305,7 +305,7 @@ the "copyright" line and a pointer to where the full notice is found. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Also add information on how to contact you by electronic and paper mail. diff --git a/gnu/usr.bin/texinfo/ChangeLog b/gnu/usr.bin/texinfo/ChangeLog index 48e217611db..06d0464a688 100644 --- a/gnu/usr.bin/texinfo/ChangeLog +++ b/gnu/usr.bin/texinfo/ChangeLog @@ -1,3 +1,625 @@ +Fri Oct 4 07:49:49 1996 Karl Berry <karl@cs.umb.edu> + + * Version 3.9. + + * Makefile.in (install): Say to install texinfo.tex manually. + + * util/texi2dvi, + * util/texindex.c, + * makeinfo/makeinfo.c, + * info/info.c: Include only the current year in the copyright message. + + * util/texi2dvi: Exit successfully. + From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>. + +Thu Oct 3 12:58:32 1996 Karl Berry <karl@cs.umb.edu> + + * Rename install.sh to the preferred install-sh. + + * Makefile.in (VERSION), + * util/texi2dvi, + * util/texindex.c, + * util/install-info.c, + * makeinfo/makeinfo.c (minor_version, print_version_info), + * info/info.c: Update version number. + + * util/texi2dvi: Only show diff if verbose. + + * util/install-info.c (main): Check for a missing dir file as well + as a missing info files. + (main): At start of a node, completely initialize the newly-malloced + node structure. + + * texinfo.texi: Fix incorrect uses of @key, + insert missing newline in Installing Dir Entries' @menu item, + document install-info invocation. + + * Makefile.in (DISTFILES): Do not put .gdbinit's in distribution. + (dist): Use || instead of && (and invert sense) so make doesn't think + the command failed. + (dist): Exclude more junk. + + * makeinfo/makeinfo.c (cm_xref): Back out patch from Tom T., since + we generate a good-enough error message that is suppressible + without it. + + * util/gen-dir-node: The recommended name for the top-level info + file is dir, not dir.info. + + * util/install-info.c (main): At `Mark the end of the Top node', + make sure the node name is non-NULL before comparing it. From + lvirden@cas.org. + + * configure.in (AC_REPLACE_FUNCS): Use this for memcpy, memmove, + and strdup. + (AC_CHECK_FUNCS): Instead of this. + Because both bcopy and memmove are missing on the 3b2, as reported by + Gaylen Miller <gaylen@proaxis.com>, hence we must provide our own. + * libtxi/Makefile.in (LIBOBJS): New variable. + (OBJS): Include it. + * libtxi/memcpy.c, libtxi/memmove.c, libtxi/strdup.c: New files, + taken from fileutils 3.13. + * makeinfo/makeinfo.c, + * info/clib.c (strdup): Move to libtxi. + +Wed Oct 2 18:23:30 1996 Karl Berry <karl@cs.umb.edu> + + * info/info-utils.h (memcpy) [!HAVE_MEMCPY], + * info/termdep.h (memcpy) [!HAVE_MEMCPY], + * makeinfo/makeinfo.c (memmove) [!HAVE_MEMMOVE]: Remove this + #ifdef, as we now include it in libtxi if missing. + +Tue Oct 1 17:41:52 1996 Karl Berry <karl@cs.umb.edu> + + * makeinfo/Makefile.in (install), + * info/Makefile.in (install), + * Makefile.in (install): Use new option name --info-dir instead of + --infodir. + + * makeinfo/multi.c (out_char): New fn. Replace all calls to + putc/fprintf with calls to this. + + * util/install-info.c: Rename --infodir to info-dir. + +Mon Sep 30 10:07:21 1996 Karl Berry <karl@cs.umb.edu> + + * Version 3.8. + + * texinfo.tex: Untabify. + + * texinfo.tex (\ptexl, \ptexL): Do not save, we have our own + commands now. + (\onepageout): Reformat for readability, and call \indexdummies + to avoid expansion of Texinfo commands (e.g., accents) in \write's. + (\,, \dotaccent, \ringaccent, \tieaccent, \ubaraccent, udotaccent, + \questiondown, \exclamdown, \dotless): New macros. + (\l): Let plain TeX definition remain, instead of switching + to ``lisp'' font. + (\multitable): Ensure space between the columns, + insert struts to make interline spacing constant, + use real strut instead of a box containing `Xy'. + (\indexdummies): Do not define \rm, \char, but + do define \@, \{, \}, \dotless, and \,. And \t should generate + \t, not \r. + (\indexnofonts): Define \, and \dotless as \indexdummyfont, + and let \@ be @. + (\doind): Reformat for readability, and use temp control sequence + names that actually make sense. + (\doublecolumnout, \pagesofar, \enddoublecolumns): Restore + Knuth's original code to avoid spurious overfull vbox messages. + (No boxes are actually overfull). + (\shortcontents): Do not allow hyphenations. + (\dochapentry, \tocentry): Make glue above and below flexible, to allow + better page breaks. + (\tex): Reset \, to its plain TeX meaning, + and do not reset \l. + + * COPYING: Update for new FSF address (from gcc dist). + + * libtxi/Makefile.in: Various simplifications. + +Sun Sep 29 12:58:44 1996 Karl Berry <karl@cs.umb.edu> + + * util/texi2dvi: Use $progname instead of $0 for --version. + + * util/install-info.c (xmalloc, xrealloc): Declare malloc and + realloc as returning void *, + to avoid ptr/int problems on Digital Unix. + + * info/tilde.c (tilde_expand_word): Declare getenv as returning char *, + to avoid warning on Digital Unix. + + * makeinfo/multi.c (multitable_active): Declare extern here to + avoid ld warning on rs6000. + + * util/texindex.c (usage): Avoid ??' trigraph. + + * util/install-info.c: Include <sys/fcntl.h> or <fnctl.h>, + according to HAVE_SYS_FCNTL_H, + and only include <sys/file.h> if HAVE_SYS_FILE_H. + (readlines): Oops, had NULL's and 0's reversed for ptr/int members. + + * info/terminal.c (terminal_goto_xy): Remove spurious extra ;. + + * util/install-info.c: Untabify. (input_sections): Initialize. + (find_lines): Initialize the terminating element of the array. + (print_help): Document --infodir. + (main): Compare the basename of infile sans .info to the dir entry, + not infile itself. + * util/Makefile.in (clean): Remove the install-info binary. + + * info/Makefile.in (distclean): Remove *.info* files. + + * Makefile.in (install), + * info/Makefile.in (install), + * makeinfo/Makefile.in (install): Use --infodir instead of --info-file. + + * info/info.c, + * makeinfo/makeinfo.c: Avoid newlines in string constants for the + sake of SunOS cc. + + * makeinfo/multi.c: Do not assume ANSI C. + + * info/info.texi: Oops, need @end vtable for a @vtable. + +Sat Sep 28 16:31:28 1996 Karl Berry <karl@cs.umb.edu> + + * Makefile.in (texinfo): Do not depend on sub-all, as then + makeinfo is always run. Instead, depend on texinfo.texi. + + * makeinfo/Makefile.in (info, dvi): New targets. + makeinfo.info, makeinfo.dvi: Do not depend on macro.texi for now. + + * info/Makefile.in (install): Must call install-info twice. + + * info/info-stnd.texi, + * info/info.texi, + * makeinfo/makeinfo.texi: Include direntry. + + * emacs/Makefile.in: Use && after cd, etc. + + * texinfo.texi: Kludges so makeinfo -E will not create spurious + differences. Add new direntries. + + * util/install-info.c, + * util/texindex.c, + * makeinfo/makeinfo.c, + * info/info.c: Standardize --version output. + + * makeinfo/makeinfo.c (defun_internal): Don't insert index command + if expanding macros. + (cm_footnotestyle): Don't change the footnote style if it was set + on the command line. + + * util/texi2dvi: Recompute original index files each time through loop. + Make indentation uniform. + Use same basename for the temp input files. + Standardize --version output. + + * info/Makefile.in (install), + * makeinfo/Makefile.in (install): Insert $(POST_INSTALL). + +Fri Sep 27 13:27:30 1996 Karl Berry <karl@cs.umb.edu> + + * texinfo.texi (Format with texi2dvi): Rewrite now that the script + runs in a loop. + + * info/Makefile.in (MAKEINFO): Simplify to ../makeinfo/makeinfo. + +Fri Sep 27 00:26:03 1996 Miles Bader <miles@gnu.ai.mit.edu> + + * info/terminal.c [HAVE_TERMIOS_H] (terminal_prep_terminal, + terminal_unprep_terminal): Add code for termios. + [HAVE_TERMIOS_H] (original_termios, ttybuff): New variables. + * info/termdep.h: [HAVE_TERMIOS_H]: Add include of <termios.h>. + * configure.in: Add check for <termios.h>. + +Thu Sep 26 10:46:34 1996 Karl Berry <karl@cs.umb.edu> + + * emacs/texnfo-upd.el, + * emacs/texinfo.el, + * emacs/texinfmt.el: Update from bob for new Texinfo commands, etc. + + * emacs/info.el, emacs/informat.el, emacs/makeinfo.el, + emacs/texnfo-tex.el: Update from Emacs 19.34 dist. + + * emacs/elisp-comp: Use TMPDIR if set. + + * util/Makefile.in (libdir): Remove. + + * makeinfo/Makefile.in (install), + * Makefile.in (install), + * info/Makefile.in (install): Run install-info. + (libdir): Remove. + + * texinfo.texi: Various fixes as I make this go through TeX. + + * util/install-info.c: Quote newlines in help message. + + * util/texi2dvi (texi2dvi): Run TeX until the aux/index files + stabilize, instead of just twice. From: David Shaw + <daves@gsms01.alcatel.com.au>. + +Tue Sep 24 14:43:03 1996 Karl Berry <karl@cs.umb.edu> + + * dir: Blank dir file for installation on new systems. + +Mon Sep 23 12:18:43 1996 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (args_from_string): Do not back up at a }; + that leads to an infinite loop. + +Sat Sep 21 17:48:04 1996 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (cm_xref): Do not seg fault if outside of + any node. From: Tom Tromey <tromey@creche.cygnus.com>. + (cm_ctrl): Make obsolete. + +Tue Sep 17 13:30:08 1996 Karl Berry <karl@cs.umb.edu> + + * texinfo.tex (\inforef): Move to more appropriate place. + (\pounds): Remove spurious extra $. + (\email): Typeset argument in angle brackets. + (\macro): Use \doignore for robustness, instead of just letting TeX + parse the argument. + (\unmacro): Define. + +Sat Sep 14 16:17:35 1996 Karl Berry <karl@cs.umb.edu> + + * texinfo.texi: Document multitables, new ISBN number. + +Wed Sep 11 18:01:24 1996 Karl Berry <karl@cs.umb.edu> + + * makeinfo/multi.c (struct env): Remove unused output_position + field; this needs to be global. + (setup_multitable_parameters): Implement template-defined multitables. + (output_multitable_row): Remove trailing whitespace. + + * makeinfo/makeinfo.c (_READ_BUFFER_GROWTH, struct _defines): + Remove leading underscore for POSIX/ANSI pedants. + (init_conversion): Initialize output_position here. + (init_paragraph): Instead of here, where it loses with the + multitable calls, eventually resulting in negative counts to the + write call when the output file is split. + + * texinfo.texi: First cut at macro documentation. + Change accent doc to use tables. + Remove whitespace experiments, they are now the default. + +Mon Sep 9 14:16:24 1996 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c: Use putc instead of fprintf where possible. + (cm_accent): Put _ from @ubaraccent after argument. + + * util/texindex.c (strerror) [!strerror]: Conditionalize + declaration. + +Sat Sep 7 14:13:24 1996 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (commandTable): Obsolete @setchapterstyle. + +Thu Sep 5 15:45:11 1996 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (convert_from_loaded_file): Oops, fix + wording of initial output comment. + + * makeinfo/makeinfo.c (cm_angle_brackets): Rename from cm_key. + (commandTable): @email should produce angle brackets. + @key: Change name. + +Tue Sep 3 14:52:17 1996 Karl Berry <karl@cs.umb.edu> + + * texinfo.tex (\hsize): Decrease. + (\hoffset): Increase. + (\setleading): Decrease dramatically. + This change affects 8.5x11 format only. + + * texinfo.texi: Document accent commands. + +Mon Sep 2 11:10:49 1996 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (commandTable): Deprecate @ichapter and + @titlespec. + Move all the deprecated @i<section> commands to the end of the list. + + * texinfo.texi: Document @pounds{} and @centerchap{}. + + * texinfo.tex (\centerchfplain): Rewrite to use \chfplain, and to + actually center. + (\unnchfplain): Just call \chfplain. + (\chfplain): Rewrite to be generally callable. + (\centerparametersmaybe): Hook, a no-op except with @centerchap. + +Sun Sep 1 15:01:49 1996 Karl Berry <karl@cs.umb.edu> + + * texinfo.texi: Document @<whitespace>, rearrange spacing section. + + * makeinfo.c (commandTable): Make @. @? @! insert themselves, + not be sentence-non-enders. They are sentence *enders*. Also, + make @\t and @\n insert a normal space character, not themselves. + Also, define @hyphenation. + (insert_space): New function. + (cm_ignore_sentence_ender): Remove this. + (flush_output): Check only for META-SPC, not META-<sentence-ender>. + +Fri Aug 30 18:55:30 1996 Karl Berry <karl@cs.umb.edu> + + * texinfo.texi: Document @- and @hyphenation{}. + Miscellanous fixes. + + * makeinfo/makeinfo.c (commandTable): Define @- as cm_no_op, since + makeinfo doesn't do hyphenation. + +Thu Aug 29 13:05:38 1996 Karl Berry <karl@cs.umb.edu> + + * texinfo.tex (\key): Do not uppercase the argument; key names + can be mixed case, e.g., `Control'. + + * makeinfo/makeinfo.c: @infotop, @infounnumbered, + @infounnumberedsec, @infounnumberedsubsec, + @infounnumberedsubsubsec, @infoappendix, @infoappendixsec, + @infoappendixsubsec, @infoappendixsubsubsec, @infochapter, + @infosection, @infosubsection, @infosubsubsection: + Remove these long-since obsolete commands. + @iappendix, @iappendixsection, @iappendixsec, @iappendixsubsec, + @iappendixsubsubsec, @ichapter, @isection, @isubsection, + @isubsubsection, @iunnumbered, @iunnumberedsec, @iunnumberedsubsec, + @iunnumberedsubsubsec: + Deprecate these. + @infoinclude: + Obsolete this. + @,: Have to take an argument, since have to do @,{c} not c@,; can't + feasibly implement the latter in TeX. + + * makeinfo/makeinfo.c: Rename @d to @udotaccent, since this is + relatively infrequently used. + +Tue Aug 27 14:58:56 1996 Karl Berry <karl@cs.umb.edu> + + * info/info.c (print_short_help), + * util/install-info.c (print_help), + * util/texi2dvi, + * makeinfo/makeinfo.c (usage) Include bug reporting address. + +Mon Aug 26 15:27:17 1996 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (commandTable): Remove @input, @medbreak, + @smallbreak, @overfullrule, @br. + +Sun Aug 25 17:25:48 1996 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (commandTable): Unify commands that perform + the same operation, such as cm_file, cm_samp, cm_email, + etc., which all do cm_code. + + * texinfo.texi: Document @ifhtml ... @end ifhtml. Change + `PlainTeX' to `plain TeX'. + +Fri Aug 23 16:03:16 1996 Karl Berry <karl@cs.umb.edu> + + * texinfo.tex (\pounds): New Texinfo command @pounds{}. + (\parskip): New smaller value. + (\chapheadingskip, \secheadingskip, \subsecheadingskip): New smaller + values, both for 8.5x11 and @smallbook formats. From Bob. + + * makeinfo/makeinfo.c (cm_special_char): @pounds{} prints a #. + (commandTable): Add new command @pounds. + +Tue Aug 20 13:47:20 1996 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (CommandTable): Restore "!", accidentally + removed previously. + + * texinfo.tex (\key): Typeset a lozenge around the argument (from + gildea@intouchsys.com). + * makeinfo/makeinfo.c (cm_key): Surround arg with <...> to match + new lozenge style in TeX. + +Wed Aug 14 16:59:23 1996 Karl Berry <karl@cs.umb.edu> + + * texinfo.texi: Propagate change from rms. + +Tue Aug 13 11:33:27 1996 Karl Berry <karl@cs.umb.edu> + + * texinfo.texi: Propagate change from rms. + + * texinfo.texi: Document other @headings options. + +Sun Aug 11 13:19:42 1996 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (cm_accent, cm_special_char, cm_dotless): + New functions. + (CommandTable): Add new commands for all of plain.tex's + accents and non-English characters. + +Fri Aug 9 14:12:07 1996 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (convert_from_loaded_file): Say we're making + ``text'' file if no_headers. Also, use `input_filename' instead + of just `name' for clarity. + (suffixes): Check for no suffix last, i.e., prefer `foo.texi' as an + input file to `foo'. (The latter is probably a binary.) + +Mon Aug 5 13:52:39 1996 Karl Berry <karl@cs.umb.edu> + + * texinfo.tex (\heading, \subheading, \subsubheading): Can no + longer call the nonexistent \*secheadingi series. Instead, call + \plain*secheading. + (\plainsubsecheading, \plainsubsubsecheading): New macros, by analogy + with \plainsecheading. + (\unnumberedsubseczzz, \unnumberedsubsubseczzz): Call them. + +Sun Aug 4 16:46:10 1996 Karl Berry <karl@cs.umb.edu> + + * makeinfo/makeinfo.c (flush_output): Mask out eighth bit, that we + turned on in non-sentence enders. + +Sat Aug 3 14:03:10 1996 Karl Berry <karl@cs.umb.edu> + + * texinfo.tex (\HEADINGSdouble, \HEADINGSsingle, + HEADINGSdoubleafter, \HEADINGSsingleafter, \CHAPPAGoff, + \CHAPPAGon, \CHAPPAGodd): Set \contentsalignmacro, analogous to + \pagealignmacro. + (\startcontents): Call \contentsalignmacro instead of \pagealignmacro. + +Mon Jul 29 14:44:33 1996 Karl Berry <karl@cs.umb.edu> + + * texinfo.tex (\indexfonts): Make leading be 12pt. Otherwise, it's + too crammed. + (\smalllispx): Remove \setleading{10pt}. That was too small. + (\doprintindex): Do not call \tex ... \Etex. Index files are Texinfo + source, not TeX source, except for using \ instead of @ as the + escape character (for now). + +Sun Jul 28 13:37:05 1996 Karl Berry <karl@cs.umb.edu> + + * texinfo.tex (paragraphindent): Move to more reasonable place in + the source file. + (chapfonts, secfonts, subsecfonts, indexfonts): Call \setleading. + (\chfplain, \secheading, \plainsecheading, \subsecheading, + \subsubheading): Rewrite to properly \hangindent the title. + (\sectionheading): New generic macro to print section titles. + + * texinfo.texi: Update the `Obtaining TeX' node. + +Fri Jul 26 14:11:48 1996 Karl Berry <karl@cs.umb.edu> + + * util/texi2dvi: Do macro expansion with makeinfo before running TeX. + Various expansion safety measures added for test; avoid use of -o. + + * makeinfo/makeinfo.c (usage): More usage message tweaks. + +Fri Jul 26 11:55:37 1996 Karl Berry <karl@laurie> + + * util/texi2dvi: Format usage message to conform to the other *utils. + +Thu Jul 25 17:05:47 1996 Karl Berry <karl@cs.umb.edu> + + * emacs/Makefile.in: Do not compile the Elisp by default. We + don't install it, so it confuses people to compile it. + +Sun Jul 21 07:20:09 1996 Karl Berry <karl@cs.umb.edu> + + * util/Makefile.in (install-info): Dependency should be + install-info.o, not install-info. Also, update copyright years. + + * makeinfo/makeinfo.c (cm_printindex): Don't call execute_string + to print index entries, we've already done the expansion now. + + * makeinfo/makeinfo.h: Add copyright. Finish merge of rms changes. + * makeinfo/makeinfo.c: Finish merge, add my expansion changes again. + * makeinfo/multi.c: Add copyright message. + +Fri Jul 19 10:35:22 1996 Karl Berry <karl@cs.umb.edu> + + * info/info.c: Update copyright date. + + * info/info.texi, + * util/install-info.c, + * emacs/Makefile.in, + * emacs/texnfo-tex.el, + * emacs/Makefile.in: Change FSF address. + + * Merged changes from bfox -- below, plus multitable changes, plus + lots more. + + Sun Apr 14 08:49:50 1996 Brian J. Fox <bfox@nirvana.samsara.com> + + * makeinfo/makeinfo.c (remember_node_reference): Numerous commands + call remember_node_reference. If a node has not yet been defined, + use the empty string as the current node for those cases. + + Mon Feb 12 17:35:38 1996 Brian J. Fox <bfox@nirvana.samsara.com> + + * makeinfo/makeinfo.c (push_node_filename): Clean up calls to + xmalloc and xrealloc. Only have to call xrealloc. + + Fri Jan 26 08:00:38 1996 Brian J. Fox <bfox@nirvana.samsara.com> + + * info/session.c (info_input_buffer_space_available): Fix typo + which forced the limitation of the sizeof (int) instead of sizeof + (buffer). + + * Makefile.in (PACKVER): now at 3.8. Add TERMIOS support to + Info. Minor bugs fixed in Makeinfo. + +Sat Jul 13 11:58:57 1996 Karl Berry <karl@cs.umb.edu> + + * texinfo.texi (ftable vtable): Mention example. + +Sun Jun 30 14:59:51 1996 Karl Berry <karl@goldman.gnu.ai.mit.edu> + + * makeinfo/makeinfo.c (cm_email): New function for new @email command. + * texinfo.texi (email): New node documenting it. + +Wed Apr 17 18:07:34 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu> + + * makeinfo/makeinfo.c (cm_kbd): Do nothing if in @example or @code. + (struct brace_element): New field in_fixed_with_font. + (remember_brace_1): Save in_fixed_with_font. + (pop_and_call_brace): Restore in_fixed_with_font. + (cm_code): Don't decrement in_fixed_with_font at end of construct. + (struct istack_elt): New field in_fixed_with_font. + (push_insertion, pop_insertion): Save and restore in_fixed_with_font. + (end_insertion): Don't decrement in_fixed_with_font here. + (not_fixed_width): New function. + (cm_sc, cm_var, cm_italic, cm_roman, cm_titlefont): + Use not_fixed_width. + +Sat Apr 13 23:22:05 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu> + + * util/install-info.c (main): Fatal error if no input file spec'd. + Look for START-INFO-DIR-ENTRY, not BEGIN-INFO-DIR-ENTRY. + +Thu Apr 11 18:21:50 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu> + + * makeinfo/makeinfo.c (cm_enddots): New function. + (self_delimiting): Accept -, ^ and ". + (CommandTable): Add commands -, ^, ", enddots, centerchap. + +Sun Mar 24 12:18:32 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu> + + * makeinfo/makeinfo.c (enum insertion_type): Add `direntry'. + (insertion_type_names): Add "direntry". + (cm_dircategory): New function. + (cm_direntry): New function. + (CommandTable): Add "dircategory" and "direntry". + (insert_string): New function. + (end_insertion): Handle direntry. + (begin_insertion): Handle direntry. + +Sun Mar 24 11:10:05 1996 Karl Berry <karl@spiff.gnu.ai.mit.edu> + + * makeinfo/makeinfo.c (cm_url): New function for new @url command. + +Fri Feb 23 21:14:40 1996 Richard Stallman <rms@mole.gnu.ai.mit.edu> + + * info/Makefile.in (install, uninstall): Use manprefix. + +Fri Feb 23 19:50:18 1996 Richard Stallman <rms@whiz-bang.gnu.ai.mit.edu> + + * util/Makefile.in (install-info, install-info.o): New targets. + (all): Depend on install-info. + (install, uninstall): Operate on install-info. + + * install-info.c: New file. + +Wed Jan 3 10:01:45 1996 Brian J. Fox <bfox@nirvana.datawave.net> + + * makeinfo/makeinfo.c (make_index_entries_unique): Be a little bit + stricter about what makes two index entries identical. + +Fri Dec 29 13:00:24 1995 Brian J. Fox <bfox@wizard.datawave.net> + + * makeinfo/makeinfo.c (Whole File): Add @detailmenu for allowing + detailed menu listings to appear while still defaulting nodes. + +Wed Dec 27 13:54:30 1995 Brian Fox <bfox@albert.gnu.ai.mit.edu> + + * makeinfo/makeinfo.c (cm_code): Always notice that we are in + fixed_width_font, even if other formatting changes are not to take + place. + Sat Dec 23 11:48:43 1995 Brian J. Fox <bfox@wizard.datawave.net> * info/man.c: (clean_manpage) Remove ^L's from page. diff --git a/gnu/usr.bin/texinfo/NEWS b/gnu/usr.bin/texinfo/NEWS index 5b643060003..ffc70933396 100644 --- a/gnu/usr.bin/texinfo/NEWS +++ b/gnu/usr.bin/texinfo/NEWS @@ -1,325 +1,93 @@ -Please report bugs you find to bug-texinfo@prep.ai.mit.edu - -Changes between Texinfo 3.0 and 3.2: - -Many bug fixes, and a few functional additions. Note that standalone -Info can now read Un*x man pages. - -Changes between Texinfo 3.0 and 3.1: - +This file records noteworthy changes. + +3.9 (4 October 1996) +* makeinfo: + - Give a suppressible (with --no-validate) error for references + outside of any node. + - Keep track of multitable output correctly for split files; this + caused nodes after the first multitable to be ``undefined''. +* install-info: + - Rename --infodir option to --info-dir. + - More robust error checking to avoid various crashes. +* configure: Include replacements for memcpy and memmove functions in + the distribution, in case they are missing. + +3.8 (30 September 1996) +* Define and/or document new and/or previously existing commands: + Accents: @" @' @, @" @= @^ @` @~ @H @d @dotaccent @dotless @ringaccent + @tieaccent @u @ubaraccent @v + Special characters: @AA @AE @L @O @OE @aa @ae @exclamdown @l @o @oe + @pounds @questiondown @ss + Special punctuation: @! @? @enddots + dir file maintenance: @dircategory @direntry; also new program, install-info + HTML support: @email @url @ifhtml...@end ifhtml + Macros: @macro @unmacro + Tables: @multitable @tab + Hyphenation: @- @hyphenation + Spacing: @ @<TAB> @<NEWLINE> + Sectioning: + @headings singleafter/doubleafter (change heading style after current page) + @centerchap + @setchapterstyle + Other: + @shorttitlepage (simple title pages) + @detailmenu...@end detailmenu (help makeinfo parse master menus) +* Makeinfo prefers an input file named `foo.texinfo' or `foo.texi' or + `foo.txinfo' to just `foo' (the latter most likely being an executable). +* Makeinfo implements @. @! @? correctly, as end-of-sentence punctuation. +* @key marks its argument with a lozenge in TeX and <...> in Info. +* TeX output has substantially decreased interline spacing and other + formatting changes. +* Remove these obsolete and never-documented commands: + @infotop + @infoappendix @infoappendixsec @infoappendixsubsec @infoappendixsubsubsec + @infochapter @infosection @infosubsection @infosubsubsection + @infounnumbered @infounnumberedsec @infounnumberedsubsec + @infounnumberedsubsubsec + @input + @smallbreak @medbreak + @overfullrule + @br +* Deprecate these obsolete commands, to be removed in the next release: + @ctrl + @infoinclude + @iappendix @iappendixsection @iappendixsec @iappendixsubsec + @iappendixsubsubsec + @ichapter @isection @isubsection @isubsubsection + @iunnumbered @iunnumberedsec @iunnumberedsubsec @iunnumberedsubsubsec + @setchapterstyle + @titlespec + +3.7 (24 December 1995) +* Have --version print texinfo release number as well as the individual + program version. +* Better man page cleaning. +* Update Elisp files from current Emacs release. + +3.6 (21 June 1995) +* Unmatched brace error reporting improved. +* Missing comment terminator prevented compilation. + +3.5 (20 June 1995) +* Autoconf update. +* Support for parallel makes. +* make install does not install Elisp files. + +3.4 (19 June 1995) +* Handle @ifhtml in Elisp. +* Update FSF address. + +3.3 (15 June 1995) +* Portability changes. +* Compile Elisp files. +* Don't distribute .info* files. + +3.2 (9 June 1995) +* Standalone Info can read Unix man pages. +* New commands: @! @? @^ @" @enddots. +* makeinfo -E does macro expansion (and nothing else). + +3.1 (23 May 1993) Just bug fixes, see ChangeLog for full details. - - -Texinfo 2 -********* - -The second edition of the Texinfo manual is now released in a package -with the second version of the various Texinfo support files, -including `texinfo.el', `texnfo-upd.el', and `makeinfo.c'. The new -manual is considerably larger than the previous one. - -Here is a brief description of the new Texinfo mode commands -and the newly described @-commands: - -New Texinfo Mode Commands -========================= - -Texinfo mode provides commands and features especially designed for -working with Texinfo files. More than 20 new commands have been -added, including commands for automatically creating and updating both -nodes and menus. This is a tedious task when done by hand. - -The keybindings are intended to be somewhat mnemonic. - -Update everything ------------------ - -The `texinfo-master-menu' command is the primary command: - - C-c C-u m Create or update a master menu. - With an argument, first create or - update all nodes and regular menus. - -Update Pointers ---------------- - -Create or update `Next', `Previous', and `Up' node pointers. - - C-c C-u C-n Update a node. - C-c C-u C-e Update every node in the buffer. - -Update Menus ------------- - -Create or update menus. - - C-c C-u C-m Make or update a menu. - - C-c C-u C-a Make or update all the menus - in a buffer; with an argument, - first update all the nodes. - -Insert Title as Description ---------------------------- - -Insert a node's chapter or section title in the space for the -description in a menu entry line; position point so you can edit the -insert. (This command works somewhat differently than the other -insertion commands, which insert only a predefined string.) - - C-c C-c C-d Insert title. - -Format for Info ---------------- - -Provide keybindings both for the Info formatting commands that are -written in Emacs Lisp and for `makeinfo' which is written in C. - -Use the Emacs lisp `texinfo-format...' commands: - - C-c C-e C-r Format the region. - C-c C-e C-b Format the buffer. - -Use `makeinfo': - - C-c C-m C-r Format the region. - C-c C-m C-b Format the buffer. - C-c C-m C-l Recenter the `makeinfo' output buffer. - C-c C-m C-k Kill the `makeinfo' formatting job. - -Typeset and Print ------------------ - -Typeset and print Texinfo documents from within Emacs. - - C-c C-t C-r Run TeX on the region. - C-c C-t C-b Run TeX on the buffer. - C-c C-t C-i Run `texindex'. - C-c C-t C-p Print the DVI file. - C-c C-t C-q Show the print queue. - C-c C-t C-d Delete a job from the print queue. - C-c C-t C-k Kill the current TeX formatting job. - C-c C-t C-x Quit a currently stopped TeX formatting job. - C-c C-t C-l Recenter the output buffer. - -Other Updating Commands ------------------------ - -The `other updating commands' do not have standard keybindings because -they are less frequently used. - - M-x texinfo-insert-node-lines - Insert missing node lines using - section titles as node names. - - M-x texinfo-multiple-files-update - Update a multi-file document. - - M-x texinfo-indent-menu-description - Indent descriptions in menus. - - M-x texinfo-sequential-update-node - Insert node pointers in strict sequence. - -Newly Described Texinfo @-Commands -================================== - -The second edition of the Texinfo manual describes more than 50 -commands that were not described in the first edition. A third or so -of these commands existed in Texinfo but were not documented in the -manual; the others are new. Here is a listing, with brief -descriptions of them: - - -Commands for creating your own index and for merging two indices: - -`@defindex INDEX-NAME' - Define a new index and its indexing command. Print entries in a - roman font. Also, the `@defcodeindex' command, which prints - entries in an `@code' font. - -`@synindex FROM-INDEX INTO-INDEX' - Merge the index named in the first argument into the index named - in the second argument. Sets FROM-INDEX in the same (roman) font - as INTO-INDEX. Also, the `@syncodeindex' command, which prints - the entries from the first index in `@code' font. - - -Many commands to help you describe functions, variables, macros, -commands, user options, special forms and other such artifacts in a -uniform format. - -`@deffn CATEGORY NAME ARGUMENTS...' - Format a description for functions, interactive commands, and - similar entities that may take arguments. Takes as arguments the - category of entity being described, the name of this particular - entity, and its arguments, if any. - -`@defvr, @defop, ...' - 15 other related commands. - - -Special symbols to indicate the results of evaluation or an expansion, -printed output, an error message, equivalence of expressions, and the -location of point. - -`@equiv{}' - Indicate the exact equivalence of two forms; special glyph: `=='. - -`@error{}' - Indicate that the following text is an error message: `error-->'. - -`@expansion{}' - Indicate the result of a macro expansion; special glyph: `==>'. - -`@point{}' - Indicate the position of point; special glyph: `-!-'. - -`@print{}' - Indicate printed output; special glyph: `-|'. - -`@result{}' - Indicate the result of an expression; special glyph: `=>'. - - -Commands to customize headings: - -`@headings ON-OFF-SINGLE-DOUBLE' - Turn headings on or off, or specify single-sided or double-sided - headings for printing. - -`@evenfooting [LEFT] @| [CENTER] @| [RIGHT]' - Specify footings for even-numbered (left-hand) pages. Not - relevant to Info. - -`@evenheading, @everyheading, @oddheading, ...' - Five other related commands. - -`@thischapter' - In a heading or footing, stands for the number and name of the - current chapter, in the format `Chapter 1: First Chapter'. - -`@thischaptername, @thisfile, @thistitle, @thispage' - Related commands. - - -Commands for formatting text: - -`@cartouche' - Draw rounded box surrounding text (not in Info). - -`@enumerate OPTIONAL-ARG' - Enumerate a list with letters or numbers. - -`@exdent LINE-OF-TEXT' - Remove any indentation a line might have. - -`@flushleft' - Left justify every line but leave the right end ragged. Leave - font as is. - -`@flushright' - Right justify every line but leave the left end ragged. Leave - font as is. - -`@format' - Like `@example' or `@display', but do not narrow the margins or - select the fixed-width font. - -`@ftable FORMATTING-COMMAND' -`@vtable FORMATTING-COMMAND' - Begin a two-column table, using `@item' for each entry. - `@ftable' automatically enters each of the items in the - first column into the index of functions and `@vtable' - enters them into the index of variables. The commands - are the same as `@table', except for indexing. - -`@lisp' - Indent text, do not fill, select fixed-width font. - -`@smallexample' - Indent text, do not fill, select fixed-width font. In - `@smallbook' format, print text in a smaller font than with the - `@example' environment. Also, the `@smalllisp' command. - -Commands for formatting if a flag is set or cleared: - -`@set FLAG [STRING]' - Set FLAG, causing the Texinfo formatting commands to format text - between subsequent pairs of `@ifset FLAG' and `@end ifset' - commands. Optionally, set value of FLAG to STRING. - -`@value{FLAG}' - Replace with value to which FLAG is set. - -`@ifset FLAG ... @end ifset' - If FLAG is set, the Texinfo formatting commands format text - between `@ifset FLAG' and the following `@end ifset' command. - -`@clear FLAG' - Unset FLAG, preventing the Texinfo formatting commands from - formatting text between subsequent pairs of `@ifset FLAG' and - `@end ifset' commands. - -`@ifclear FLAG ... @end ifclear' - If FLAG is unset, the Texinfo formatting commands format text - between `@ifclear FLAG' and the following `@end ifclear' command. - -Produce unnumbered headings that do not appear in a table of contents: - -`@heading TITLE' - Print an unnumbered section-like heading in the text, but not in - the table of contents of a printed manual. - -`@chapheading, @majorheading' -`@subheading, @subsubheading' - Related commands. - - -Font commands: - -`@r{TEXT}' - Print TEXT in roman font. No effect in Info. - -`@sc{TEXT}' - Set TEXT in the printed output in THE SMALL CAPS FONT and set - text in the Info file in uppercase letters. - - -Miscellaneous: - -`@author AUTHOR' - Typeset author's name flushleft and underline it. - -`@finalout' - Prevent TeX from printing large black warning rectangles beside - over-wide lines. - -`@footnotestyle STYLE' - Specify footnote style, end or separate. - -`@dmn{DIMENSION}' - Format a dimension. - -`@minus{}' - Generate a minus sign. - -`@paragraphindent INDENT' - Specify paragraph indentation, asis or a number. - -`@ref{NODE-NAME, [ENTRY], [TOPIC], [INFO-FILE], [MANUAL]}' - Make a reference. In the printed manual, the reference does not - start with a `See'. - -`@title TITLE' - Alternative format for a title page. In the printed manual, set - a title flush to the left-hand side of the page in a larger than - normal font and underline it with a black rule. Also, - `@subtitle' command. - -`@subtitle SUBTITLE' - Subtitle in the alternative title page format. - -`@today{}' - Insert the current date. +texinfo-3.0: first release of Texinfo version 2, with many new commands. diff --git a/gnu/usr.bin/texinfo/README b/gnu/usr.bin/texinfo/README index d1c2a60e08c..357a98fb555 100644 --- a/gnu/usr.bin/texinfo/README +++ b/gnu/usr.bin/texinfo/README @@ -3,12 +3,11 @@ Texinfo, Version 3 This is the README file for version 3 of the Texinfo distribution. Files within this distribution have their own version and edition -numbers. When you refer to a file, please mention its own number. +numbers. When you refer to a file, please mention its own number, as +well as the version number of the Texinfo distribution. PLEASE REPORT BUGS TO: bug-texinfo@prep.ai.mit.edu -23 March 1993 - Texinfo is a documentation system that uses a single source file to produce both on-line information and printed output. This means that instead of writing two different documents, one for the on-line help @@ -18,18 +17,21 @@ is revised, you need revise only one document. You can read the on-line information, known as an "Info file", with an Info documentation-reading program. By convention, Texinfo source file names end with a `.texi' or `.texinfo' extension. Texinfo is -described in the Texinfo Manual. - -You can write and format Texinfo files into Info files within GNU -Emacs, and read them using the Emacs Info reader. If you do not have -Emacs, you can format Texinfo files into Info files using `makeinfo' -and read them using `info'. Use TeX, which is not included in this -package, to typeset Texinfo files for printing. - -For instructions on installing info, makeinfo, texi2dvi, and texindex, -please read the file `INSTALL'. The Emacs Lisp files are not -installed by default; to install them, use `make install' in the -`emacs' subdirectory. +described in the Texinfo manual (the file ./texinfo.texi). + +You can write and format Texinfo files into Info files within GNU Emacs, +and read them using the Emacs Info reader. If you do not have Emacs, +you can format Texinfo files into Info files using `makeinfo' and read +them using `info'. Use TeX, which is not included in this package (see +`How to Obtain TeX' in the Texinfo manual for information), to typeset +Texinfo files for printing. + +For instructions on compiling and installing info, makeinfo, texi2dvi, +and texindex, please read the file `INSTALL'. The Emacs Lisp files are +not installed by default; to install them, use `make install' in the +`emacs' subdirectory. The Info tree uses a file `dir' as its root node; +a sample `dir' file is included in the distribution, but not installed +anywhere. Use it or not as you like. This distribution includes (but is not limited to) the following files: @@ -83,7 +85,8 @@ Printing related files: texi2dvi This is a shell script for producing an indexed DVI file using - TeX and texindex. + TeX and texindex. Must be used if the + source document uses Texinfo @macros. GNU Emacs related files: @@ -158,4 +161,3 @@ Other files: tex3patch This handles a bug for version 3.0 of TeX that does not occur in more recent versions. - diff --git a/gnu/usr.bin/texinfo/TODO b/gnu/usr.bin/texinfo/TODO index 96083b755ae..de5b571722f 100644 --- a/gnu/usr.bin/texinfo/TODO +++ b/gnu/usr.bin/texinfo/TODO @@ -1,8 +1,35 @@ -* Implement 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. +If you are interested in working on any of these, +email bug-texinfo@prep.ai.mit.edu. - An option would be to NOT strip comments out. +* Use Automake. - makeinfo --noheaders come close. +* Use a config header file instead of @DEFS@. +* A detexinfo program, like detex or delatex. This command would + strip all the texinfo commands out, and would be used as a filter on + the way to a speller. An option would be to NOT strip comments out. + makeinfo --no-headers come close. + +* Change bars. This is difficult or impossible in TeX, + unfortunately. To do it right requires device driver support. + +* The dark corner symbol for the gawk manual. + +* Better i18n support, including support for 8-bit input + characters. Requires fonts, and the DC fonts are not (as of this + writing) free. + +* @exercise/@answer command for, e.g., gawk. + +* @figure. + +* HTML output in makeinfo. + +* Include a complete functional summary, a la a reference card, in the manual. + +* Use @ as the escape character, and Texinfo syntax generally, in the + table of contents, aux, and index files. Eliminate all the crazy + redefinitions of every Texinfo command (which lists always seem to be + incomplete). + +* Improve the manuals for makeinfo, standalone info, etc. diff --git a/gnu/usr.bin/texinfo/dir b/gnu/usr.bin/texinfo/dir new file mode 100644 index 00000000000..b690556131f --- /dev/null +++ b/gnu/usr.bin/texinfo/dir @@ -0,0 +1,16 @@ +$Id: dir,v 1.1 1996/12/15 21:37:56 downsj Exp $ +This is the file .../info/dir, which contains the topmost node of the +Info hierarchy. The first time you invoke Info you start off +looking at that node, which is (dir)Top. + +File: dir Node: Top This is the top of the INFO tree + + This (the Directory node) gives a menu of major topics. + Typing "q" exits, "?" lists all Info commands, "d" returns here, + "h" gives a primer for first-timers, + "mEmacs<Return>" visits the Emacs topic, etc. + + In Emacs, you can click mouse button 2 on a menu item or cross reference + to select it. + +* Menu: diff --git a/gnu/usr.bin/texinfo/dir-example b/gnu/usr.bin/texinfo/dir-example new file mode 100644 index 00000000000..c789d0a56b3 --- /dev/null +++ b/gnu/usr.bin/texinfo/dir-example @@ -0,0 +1,309 @@ +This is the directory file `dir' a.k.a. `DIR', which contains the +topmost node of the Info hierarchy. This file is merely made available +for your hacking pleasure, not official or standard in any way. +If it doesn't make sense to you, or you don't like it, ignore it. + +$Id: dir-example,v 1.1 1996/12/15 21:37:56 downsj Exp $ + +File: dir Node: Top This is the top of the INFO tree. + +This node gives a menu of the major topics accessible through Info. + + `q' quits; + `?' lists all Info commands; + `h' starts the Info tutorial; + `mTexinfo RET' visits the Texinfo manual, etc. + +* Menu: + +GNU packages +* Bash: (bash). Bourne again shell. +* Cpio: (cpio). Cpio archiver. +* DC: (dc). Postfix arbitrary expression calculator. +* Diff: (diff). Comparing and merging programs. +* Ed: (ed). Line editor. +* Emacs: (emacs). Extensible self-documenting text editor. +* File utilities: (fileutils). GNU file utilities. +* Finding files: (find). Operating on files matching certain criteria. +* Font utilities: (fontu). Programs for font manipulation. +* Gawk: (gawk). A text processing and scanning language. +* Gzip: (gzip). General (de)compression. +* Identifier DB: (id-utils). Identifier database utilities. +* Ispell: (ispell). Interactive spelling corrector. +* M4: (m4). Macro processor. +* Make: (make). Remake files automatically. +* Ptx: (ptx). Permuted index generator. +* Shar: (sharutils). Shell archiver, uudecode/uuencode. +* Shell utilities: (sh-utils). GNU shell utilities. +* Tar: (tar). ``Tape'' archiver. +* Text utilities: (textutils). GNU text utilities. +* Time: (time). Measuring program resource usage. +* UUCP: (uucp). Copying between machines, offline. +* Wdiff: (wdiff). Word-by-word comparison. + +GNU programming tools +* As: (as). Assembler. +* Binutils: (binutils). ar/copy/objdump/nm/size/strip/ranlib. +* Bison: (bison). LALR(1) parser generator. +* CPP: (cpp). C preprocessor. +* CVS: (cvs). Concurrent versions system for source control. +* DejaGnu: (dejagnu). Testing framework. +* Flex: (flex). A fast scanner generator. +* Gasp: (gasp). GNU Assembler preprocessor. +* Libtool: (libtool). Generic library support script. +* GCC: (gcc). C compiler. +* GDB: (gdb). Source-level debugger for C and C++. +* Gperf: (gperf). Perfect hash function generator. +* Gprof: (gprof). Profiler. +* Indent: (indent). Prettyprinter for programs. +* Ld: (ld). Linker. + +Texinfo documentation system +* Info: (info). Documentation browsing system. +* Texinfo: (texinfo). The GNU documentation format. +* install-info: (texinfo)Invoking install-info. Updating info/dir entries. +* texi2dvi: (texinfo)Format with texi2dvi. Printing Texinfo documentation. +* texindex: (texinfo)Format with tex/texindex. Sorting Texinfo index files. +* info program: (info-stnd). Standalone Info-reading program. +* makeinfo: (makeinfo). Convert Texinfo source to Info or plain ASCII. + +GNU Emacs Lisp +* Elisp: (elisp). GNU Emacs Lisp reference manual. +* Intro Elisp: (emacs-lisp-intro). Introduction to Elisp programming. + +* Calc: (calc). Calculator and more. +* CC-mode: (ccmode). Editing C, C++, and Objective C. +* Common Lisp: (cl). Partial Common Lisp support for Emacs Lisp. +* Dired-x: (dired-x). Extra directory editor features. +* Edebug: (edebug). Source-level debugger for Emacs Lisp. +* Ediff: (ediff). Comprehensive visual interface to diff & patch. +* EDB: (edb). Database for Emacs. +* Forms: (forms). Fill-in-the-form data entry. +* Gmhist: (gmhist). Generic minibuffer history. +* GNUS: (gnus). Netnews reading and posting. +* Mailcrypt: (mailcrypt). Use PGP in Emacs. +* MH-E: (mh-e). Emacs interface to the MH mail system. +* PCL-CVS: (pcl-cvs). Emacs front end to CVS. +* Supercite: (sc). Supercite for including other people's words. +* VIP: (vip). vi emulation. +* VIPER: (viper). The new VI-emulation mode in Emacs-19.29. +* VM: (vm). Mail reader. +* W3: (w3). WWW browser. + +GNU admin +* Autoconf: (autoconf). Automatic generation of package configuration. +* Automake: (automake). Making Makefile.in's. +* Configure: (configure). Cygnus configure. +* Gettext: (gettext). Internationalization. +* Gnats: (gnats). Cygnus bug tracking system. +* Maintaining: (maintain). Maintaining GNU software. +* Remsync: (remsync). Remote synchronization of directory trees. +* Send PR: (send-pr). Cygnus bug reporting for Gnats. +* Source config: (cfg-paper). Some theory on configuring source packages. +* Standards: (standards). GNU coding standards. + +GNU libraries +* Annotate: (annotate). High-level GDB to GUI's. +* BFD: (bfd). Binary file descriptors for object file IO. +* GDB library: (libgdb). Application programming interface to GDB. +* GDBM: (gdbm). Hashed databases. +* History: (history). Recall previous lines of input. +* Iostream: (iostream). C++ input/output. +* Libc: (libc). C library. +* Libg++: (libg++). C++ classes. +* Mmalloc: (mmalloc). Memory-mapped malloc. +* Readline: (readline). General command-line interface. +* Regex: (regex). Regular expressions. +* Termcap: (termcap). All about /etc/termcap. + +GNU programming documentation +* GDB internals: (gdbint). Debugger internals. +* Ld internals: (ldint). GNU linker internals. +* Stabs: (stabs). Symbol table debugging information format. + +DOS +* Demacs: (demacs). GNU Emacs for DOS. +* GNUish: (gnuish). GNU utilities for DOS. + +TeX things +* Afm2tfm: (dvips)Invoking afm2tfm. Making Type 1 fonts available to TeX. +* Dvips: (dvips). DVI-to-PostScript translator. +* Eplain: (eplain). Expanding on plain TeX. +* Kpathsearch: (kpathsea). File lookup along search paths. +* LaTeX: (latex). LaTeX. +* MakeIndex: (makeindex). Index creation for TeX. +* Naming fonts: (fontname). Filenames for TeX fonts. +* TeXDraw: (texdraw). Drawing PostScript diagrams within TeX. +* Web2c: (web2c). TeX, Metafont, and their companion programs. + +Other things +* Amd: (amdref). Filesystem automounter. +* CMUCL: (cmu-user). CMU Common Lisp. +* File headers: (filehdr). Bibliographic information for computer files. +* HTML: (snafu). Hypertext Markup Language 2.0 specification. +* Jargon: (jargon). The jargon file. +* Perl: (perl). Practical extraction and report language. +* PRCS: (prcs). Project revision control system. +* Screen: (screen). Virtual screen manager. +* UMB C.S. Dept.: (csinfo). UMass/Boston Computer Science Dept. info. + +Individual utilities +* aid: (id-utils)aid invocation. Matching strings. +* ar: (binutils)ar. Create/modify/extract archives. +* at-pr: (gnats)at-pr. Bug report timely reminders. +* autoreconf: (autoconf)Invoking autoreconf. Remake multiple configure's. +* autoscan: (autoconf)Invoking autoscan. Automate initial configure.in. +* awk: (Gawk)Invoking gawk. Text processing and scanning. +* basename: (sh-utils)basename invocation. Strip directory and suffix. +* bibtex: (web2c)BibTeX invocation. Maintaining bibliographies. +* c++filt: (binutils)c++filt. Demangle C++ symbols. +* cat: (textutils)cat invocation. Concatenate and write files. +* chgrp: (fileutils)chgrp invocation. Change file groups. +* chmod: (fileutils)chmod invocation. Change file permissions. +* chown: (fileutils)chown invocation. Change file owners/groups. +* chroot: (sh-utils)chroot invocation. Specify the root directory. +* cksum: (textutils)cksum invocation. Print POSIX CRC checksum. +* cmp: (diff)Invoking cmp. Character-by-character diff. +* comm: (textutils)comm invocation. Compare sorted files by line. +* cp: (fileutils)cp invocation. Copy files. +* csplit: (textutils)csplit invocation. Split by context. +* cut: (textutils)cut invocation. Print selected parts of lines. +* date: (sh-utils)date invocation. Print/set system date and time. +* dd: (fileutils)dd invocation. Copy and convert a file. +* df: (fileutils)df invocation. Report filesystems' disk usage. +* diff3: (diff)Invoking diff3. Three-way diff. +* dir: (fileutils)dir invocation. List directories briefly. +* dirname: (sh-utils)dirname invocation. Strip non-directory suffix. +* dmp: (web2c)Dmp invocation. Troff->MPX (MetaPost pictures). +* du: (fileutils)du invocation. Report on disk usage. +* dvicopy: (web2c)DVIcopy invocation. Virtual font expansion +* dvitomp: (web2c)DVItoMP invocation. DVI to MPX (MetaPost pictures). +* dvitype: (web2c)DVItype invocation. DVI to human-readable text. +* echo: (sh-utils)echo invocation. Print a line of text. +* edit-pr: (gnats)Invoking edit-pr. Changing bugs. +* eid: (id-utils)eid invocation. Invoking an editor on matches. +* emacsclient: (emacs)Emacs Server. Connecting to a running Emacs. +* emacsserver: (emacs)Emacs Server. Connecting to a running Emacs. +* env: (sh-utils)env invocation. Modify the environment. +* etags: (emacs)Create Tags Table. Creating a TAGS table. +* expand: (textutils)expand invocation. Convert tabs to spaces. +* expr: (sh-utils)expr invocation. Evaluate expressions. +* false: (sh-utils)false invocation. Do nothing, unsuccessfully. +* fid: (id-utils)fid invocation. Listing a file's identifiers. +* file-pr: (gnats)file-pr. Processing incoming traffic. +* find: (find)Invoking find. Finding and acting on files. +* fmt: (textutils)fmt invocation. Reformat paragraph text. +* fold: (textutils)fold invocation. Wrap long input lines. +* g++: (gcc)Invoking G++. The GNU C++ compiler. +* gftodvi: (web2c)GFtoDVI invocation. Generic font proofsheets. +* gftopk: (web2c)GFtoPK invocation. Generic to packed fonts. +* gftype: (web2c)GFtype invocation. GF to human-readable text. +* gid: (id-utils)gid invocation. Listing all matching lines. +* groups: (sh-utils)groups invocation. Print group names a user is in. +* gunzip: (gzip)Overview. Decompression. +* head: (textutils)head invocation. Output the first part of files. +* hostname: (sh-utils)hostname invocation. Print or set system name. +* id: (sh-utils)id invocation. Print real/effective uid/gid. +* idx: (id-utils)idx invocation. Testing mkid scanners. +* ifnames: (autoconf)Invoking ifnames. List conditionals in source. +* iid: (id-utils)iid invocation. Interactive complex queries. +* inimf: (web2c)inimf invocation. Initial Metafont. +* inimp: (web2c)inimp invocation. Initial MetaPost. +* initex: (web2c)initex invocation. Initial TeX. +* install: (fileutils)install invocation. Copy and change attributes. +* join: (textutils)join invocation. Join lines on a common field. +* kpsewhich: (kpathsea)Invoking kpsewhich. TeX file searching. +* lid: (id-utils)lid invocation. Matching identifier patterns. +* ln: (fileutils)ln invocation. Make links between files. +* locate: (find)Invoking locate. Finding files in a database. +* logname: (sh-utils)logname invocation. Print current login name. +* ls: (fileutils)ls invocation. List directory contents. +* makempx: (web2c)MakeMPX invocation. MetaPost label typesetting. +* maketexmf: (kpathsea)MakeTeX scripts. MF source generation. +* maketexpk: (kpathsea)MakeTeX scripts. PK bitmap generation. +* maketextex: (kpathsea)MakeTeX scripts. TeX source generation. +* maketextfm: (kpathsea)MakeTeX scripts. TeX font metric generation. +* mf: (web2c)mf invocation. Creating typeface families. +* mft: (web2c)MFT invocation. Prettyprinting Metafont source. +* mkdir: (fileutils)mkdir invocation. Create directories. +* mkfifo: (fileutils)mkfifo invocation. Create FIFOs: (named pipes). +* mkid: (id-utils)mkid invocation. Creating an ID database. +* mknod: (fileutils)mknod invocation. Create special files. +* mp: (web2c)mp invocation. Creating technical diagrams. +* mpto: (web2c)MPto invocation. MetaPost label extraction. +* mv: (fileutils)mv invocation. Rename files. +* newer: (web2c)Newer invocation. Compare modification times. +* nice: (sh-utils)nice invocation. Modify scheduling priority. +* nl: (textutils)nl invocation. Number lines and write files. +* nlmconv: (binutils)nlmconv. Convert object to NetWare LM. +* nm: (binutils)nm. List symbols in object files. +* nohup: (sh-utils)nohup invocation. Immunize to hangups. +* objcopy: (binutils)objcopy. Copy/translate object files. +* objdump: (binutils)objdump. Display info from object files. +* od: (textutils)od invocation. Dump files in octal, etc. +* paste: (textutils)paste invocation. Merge lines of files. +* patch: (diff)Invoking patch. Automatically applying diffs. +* patgen: (web2c)Patgen invocation. Creating hyphenation patterns. +* pathchk: (sh-utils)pathchk invocation. Check file name portability. +* pid: (id-utils)pid invocation. Looking up filenames. +* pktogf: (web2c)PKtoGF invocation. Packed to generic fonts. +* pktype: (web2c)PKtype invocation. PK to human-readable text. +* pltotf: (web2c)PLtoTF invocation. Property list to TFM. +* pooltype: (web2c)Pooltype invocation. Display WEB pool files. +* pr-addr: (gnats)pr-addr. Bug report address retrieval. +* pr-edit: (gnats)pr-edit. The edit-pr driver. +* pr: (textutils)pr invocation. Paginate or columnate files. +* printenv: (sh-utils)printenv invocation. Print environment variables. +* printf: (sh-utils)printf invocation. Format and print data. +* pwd: (sh-utils)pwd invocation. Print working directory. +* query-pr: (gnats)Invoking query-pr. Bug searching/reporting. +* queue-pr: (gnats)queue-pr. Handling incoming traffic. +* ranlib: (binutils)ranlib. Index archive file contents. +* rm: (fileutils)rm invocation. Remove files. +* rmdir: (fileutils)rmdir invocation. Remove empty directories. +* sdiff: (diff)Invoking sdiff. Interactively merge files. +* send-pr: (gnats)Invoking send-pr. Submitting bugs. +* shar: (sharutils)shar invocation. Create shell archive. +* size: (binutils)size. List object file section sizes. +* sleep: (sh-utils)sleep invocation. Delay for a specified time. +* sort: (textutils)sort invocation. Sort text files. +* split: (textutils)split invocation. Split into fixed-size pieces. +* strings: (binutils)strings. List printable strings. +* strip: (binutils)strip. Discard symbols. +* stty: (sh-utils)stty invocation. Print/change terminal settings. +* su: (sh-utils)su invocation. Modify user and group id. +* sum: (textutils)sum invocation. Print traditional checksum. +* sync: (fileutils)sync invocation. Synchronize memory and disk. +* tabs: (tput)Invoking tabs. Tab settings. +* tac: (textutils)tac invocation. Reverse files. +* tail: (textutils)tail invocation. Output the last part of files. +* tangle: (web2c)Tangle invocation. WEB to Pascal. +* tee: (sh-utils)tee invocation. Redirect to multiple files. +* test: (sh-utils)test invocation. File/string tests. +* tex: (web2c)tex invocation. Typesetting. +* tftopl: (web2c)TFtoPL invocation. TFM -> property list. +* touch: (fileutils)touch invocation. Change file timestamps. +* tput: (tput)Invoking tput. Termcap in shell scripts. +* tr: (textutils)tr invocation. Translate characters. +* true: (sh-utils)true invocation. Do nothing, successfully. +* tty: (sh-utils)tty invocation. Print terminal name. +* uname: (sh-utils)uname invocation. Print system information. +* unexpand: (textutils)unexpand invocation. Convert spaces to tabs. +* uniq: (textutils)uniq invocation. Uniqify files. +* unshar: (sharutils)unshar invocation. Extract from shell archive. +* updatedb: (find)Invoking updatedb. Building the locate database. +* users: (sh-utils)users invocation. Print current user names. +* vdir: (fileutils)vdir invocation. List directories verbosely. +* vftovp: (web2c)VFtoVP invocation. Virtual font -> virtual pl. +* view-pr: (gnats)Invoking view-pr. Showing bug reports. +* virmf: (web2c)virmf invocation. Virgin Metafont. +* virmp: (web2c)virmp invocation. Virgin MetaPost. +* virtex: (web2c)virtex invocation. Virgin TeX. +* vptovf: (web2c)VPtoVF invocation. Virtual pl -> virtual font. +* wc: (textutils)wc invocation. Byte, word, and line counts. +* weave: (web2c)Weave invocation. WEB to TeX. +* who: (sh-utils)who invocation. Print who is logged in. +* whoami: (sh-utils)whoami invocation. Print effective user id. +* xargs: (find)Invoking xargs. Operating on many files. +* yes: (sh-utils)yes invocation. Print a string indefinitely. +* zcat: (gzip)Overview. Decompression to stdout. diff --git a/gnu/usr.bin/texinfo/emacs/new-useful-setqs b/gnu/usr.bin/texinfo/emacs/new-useful-setqs new file mode 100644 index 00000000000..4241ae429ef --- /dev/null +++ b/gnu/usr.bin/texinfo/emacs/new-useful-setqs @@ -0,0 +1,180 @@ +;; -*- Mode: Emacs-Lisp -*- + +;; This is the `new-useful-setqs' file +;; This overrides old defvars since they were revised. + +(setq texinfmt-version "2.35 of 10 September 1996") + +(setq texinfo-master-menu-header + "\n@detailmenu\n --- The Detailed Node Listing ---\n") + +(setq texinfo-environment-regexp + (concat + "^@" + "\\(" + "cartouche\\|" + "display\\|" + "end\\|" + "enumerate\\|" + "example\\|" + "f?table\\|" + "flushleft\\|" + "flushright\\|" + "format\\|" + "group\\|" + "ifhtml\\|" + "ifinfo\\|" + "iftex\\|" + "ignore\\|" + "itemize\\|" + "lisp\\|" + "macro\\|" + "multitable\\|" + "quotation\\|" + "smallexample\\|" + "smalllisp\\|" + "tex" + "\\)") +) + +(setq texinfo-no-refill-regexp + (concat + "^@" + "\\(" + "example\\|" + "smallexample\\|" + "lisp\\|" + "smalllisp\\|" + "display\\|" + "format\\|" + "flushleft\\|" + "flushright\\|" + "menu\\|" + "multitable\\|" + "titlepage\\|" + "iftex\\|" + "ifhtml\\|" + "tex\\|" + "html" + "\\)")) + + +(setq texinfo-accent-commands + (concat + "@OE\\|" + "@oe\\|" + "@AA\\|" + "@aa\\|" + "@AE\\|" + "@ae\\|" + "@ss\\|" + "@^\\|" + "@`\\|" + "@'\\|" + "@\"\\|" + "@,\\|" + "@=\\|" + "@~\\|" + "@questiondown{\\|" + "@exclamdown{\\|" + "@L{\\|" + "@l{\\|" + "@O{\\|" + "@o{\\|" + "@dotaccent{\\|" + "@ubaraccent{\\|" + "@d{\\|" + "@H{\\|" + "@ringaccent{\\|" + "@tieaccent{\\|" + "@u{\\|" + "@v{\\|" + "@dotless{" + )) + +(setq texinfo-part-of-para-regexp + (concat + "^@" + "\\(" + "b{\\|" + "bullet{\\|" + "cite{\\|" + "code{\\|" + "emph{\\|" + "equiv{\\|" + "error{\\|" + "expansion{\\|" + "file{\\|" + "i{\\|" + "inforef{\\|" + "kbd{\\|" + "key{\\|" + "lisp{\\|" + "email{\\|" + "minus{\\|" + "point{\\|" + "print{\\|" + "pxref{\\|" + "r{\\|" + "ref{\\|" + "result{\\|" + "samp{\\|" + "sc{\\|" + "t{\\|" + "TeX{\\|" + "today{\\|" + "url{\\|" + "var{\\|" + "w{\\|" + "xref{\\|" + "@-\\|" ; @- is a descretionary hyphen (not an accent) (a noop). + texinfo-accent-commands + "\\)" + )) + +(setq texinfo-raisesections-alist + '((@chapter . @chapter) ; Cannot go higher + (@unnumbered . @unnumbered) + (@centerchap . @unnumbered) + + (@majorheading . @majorheading) + (@chapheading . @chapheading) + (@appendix . @appendix) + + (@section . @chapter) + (@unnumberedsec . @unnumbered) + (@heading . @chapheading) + (@appendixsec . @appendix) + + (@subsection . @section) + (@unnumberedsubsec . @unnumberedsec) + (@subheading . @heading) + (@appendixsubsec . @appendixsec) + + (@subsubsection . @subsection) + (@unnumberedsubsubsec . @unnumberedsubsec) + (@subsubheading . @subheading) + (@appendixsubsubsec . @appendixsubsec))) + +(setq texinfo-lowersections-alist + '((@chapter . @section) + (@unnumbered . @unnumberedsec) + (@centerchap . @unnumberedsec) + (@majorheading . @heading) + (@chapheading . @heading) + (@appendix . @appendixsec) + + (@section . @subsection) + (@unnumberedsec . @unnumberedsubsec) + (@heading . @subheading) + (@appendixsec . @appendixsubsec) + + (@subsection . @subsubsection) + (@unnumberedsubsec . @unnumberedsubsubsec) + (@subheading . @subsubheading) + (@appendixsubsec . @appendixsubsubsec) + + (@subsubsection . @subsubsection) ; Cannot go lower. + (@unnumberedsubsubsec . @unnumberedsubsubsec) + (@subsubheading . @subsubheading) + (@appendixsubsubsec . @appendixsubsubsec))) diff --git a/gnu/usr.bin/texinfo/info/terminal.h b/gnu/usr.bin/texinfo/info/terminal.h index f60574f31c8..7cb115835c6 100644 --- a/gnu/usr.bin/texinfo/info/terminal.h +++ b/gnu/usr.bin/texinfo/info/terminal.h @@ -3,7 +3,7 @@ /* This file is part of GNU Info, a program for reading online documentation stored in Info format. - Copyright (C) 1993 Free Software Foundation, Inc. + Copyright (C) 1993, 96 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -123,4 +123,7 @@ 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. */ +extern char *term_ku, *term_kd, *term_kr, *term_kl; + #endif /* !_TERMINAL_H_ */ diff --git a/gnu/usr.bin/texinfo/install-sh b/gnu/usr.bin/texinfo/install-sh new file mode 100644 index 00000000000..2c212ccf4ae --- /dev/null +++ b/gnu/usr.bin/texinfo/install-sh @@ -0,0 +1,250 @@ +#! /bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. +# + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0 diff --git a/gnu/usr.bin/texinfo/libtxi/memcpy.c b/gnu/usr.bin/texinfo/libtxi/memcpy.c new file mode 100644 index 00000000000..521625464cd --- /dev/null +++ b/gnu/usr.bin/texinfo/libtxi/memcpy.c @@ -0,0 +1,20 @@ +/* Copy LEN bytes starting at SRCADDR to DESTADDR. Result undefined + if the source overlaps with the destination. + Return DESTADDR. */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +char * +memcpy (destaddr, srcaddr, len) + char *destaddr; + const char *srcaddr; + int len; +{ + char *dest = destaddr; + + while (len-- > 0) + *destaddr++ = *srcaddr++; + return dest; +} diff --git a/gnu/usr.bin/texinfo/libtxi/memmove.c b/gnu/usr.bin/texinfo/libtxi/memmove.c new file mode 100644 index 00000000000..d7bdd7cd995 --- /dev/null +++ b/gnu/usr.bin/texinfo/libtxi/memmove.c @@ -0,0 +1,24 @@ +/* memmove.c -- copy memory. + Copy LENGTH bytes from SOURCE to DEST. Does not null-terminate. + In the public domain. + By David MacKenzie <djm@gnu.ai.mit.edu>. */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +void +memmove (dest, source, length) + char *dest; + const char *source; + unsigned length; +{ + if (source < dest) + /* Moving from low mem to hi mem; start at end. */ + for (source += length, dest += length; length; --length) + *--dest = *--source; + else if (source != dest) + /* Moving from hi mem to low mem; start at beginning. */ + for (; length; --length) + *dest++ = *source++; +} diff --git a/gnu/usr.bin/texinfo/libtxi/strdup.c b/gnu/usr.bin/texinfo/libtxi/strdup.c new file mode 100644 index 00000000000..1d60f13948a --- /dev/null +++ b/gnu/usr.bin/texinfo/libtxi/strdup.c @@ -0,0 +1,43 @@ +/* strdup.c -- return a newly allocated copy of a string + Copyright (C) 1990 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifdef HAVE_CONFIG_H +#include <config.h> +#endif + +#ifdef STDC_HEADERS +#include <string.h> +#include <stdlib.h> +#else +char *malloc (); +char *strcpy (); +#endif + +/* Return a newly allocated copy of STR, + or 0 if out of memory. */ + +char * +strdup (str) + const char *str; +{ + char *newstr; + + newstr = (char *) malloc (strlen (str) + 1); + if (newstr) + strcpy (newstr, str); + return newstr; +} diff --git a/gnu/usr.bin/texinfo/makeinfo/makeinfo.h b/gnu/usr.bin/texinfo/makeinfo/makeinfo.h new file mode 100644 index 00000000000..78fda8c4492 --- /dev/null +++ b/gnu/usr.bin/texinfo/makeinfo/makeinfo.h @@ -0,0 +1,193 @@ +/* makeinfo.h -- Declarations for Makeinfo. + $Id: makeinfo.h,v 1.1 1996/12/15 21:39:27 downsj Exp $ + + Copyright (C) 1996 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 Brian Fox (bfox@ai.mit.edu). */ + +/* Why, oh why, did I ever listen to rms when he said: + "Don't make lots of small files, just make one big one!" I've + regretted it ever since with this program, and with readline. + bfox@ai.mit.edu Thu Jul 11 07:54:32 1996 */ + +#if !defined (MAKEINFO_H) +#define MAKEINFO_H + +#if defined (COMPILING_MAKEINFO) +# define DECLARE(type, var, init) type var = init +#else +# define DECLARE(type, var, init) extern type var +#endif + +enum insertion_type +{ + menu, detailmenu, quotation, lisp, smalllisp, example, smallexample, + display, itemize, format, enumerate, cartouche, multitable, table, + ftable, vtable, group, ifinfo, flushleft, flushright, ifset, + ifclear, deffn, defun, defmac, defspec, defvr, defvar, defopt, + deftypefn, deftypefun, deftypevr, deftypevar, defcv, defivar, defop, + defmethod, deftypemethod, deftp, direntry, bad_type +}; + +DECLARE (int, insertion_level, 0); + +#if defined (COMPILING_MAKEINFO) +char *insertion_type_names[] = +{ + "menu", "detailmenu", "quotation", "lisp", "smalllisp", "example", + "smallexample", "display", "itemize", "format", "enumerate", + "cartouche", "multitable", "table", "ftable", "vtable", "group", + "ifinfo", "flushleft", "flushright", "ifset", "ifclear", "deffn", + "defun", "defmac", "defspec", "defvr", "defvar", "defopt", + "deftypefn", "deftypefun", "deftypevr", "deftypevar", "defcv", + "defivar", "defop", "defmethod", "deftypemethod", "deftp", "direntry", + "bad_type" +}; +#endif + +typedef struct istack_elt +{ + struct istack_elt *next; + char *item_function; + char *filename; + int line_number; + int filling_enabled; + int indented_fill; + enum insertion_type insertion; + int inhibited; + int in_fixed_width_font; +} INSERTION_ELT; + +DECLARE (INSERTION_ELT *, insertion_stack, (INSERTION_ELT *)NULL); + +/* Current output stream. */ +DECLARE (FILE *, output_stream, (FILE *)NULL); + +/* Output paragraph buffer. */ +DECLARE (unsigned char *, output_paragraph, (unsigned char *)NULL); + +/* Offset into OUTPUT_PARAGRAPH. */ +DECLARE (int, output_paragraph_offset, 0); + +/* The output paragraph "cursor" horizontal position. */ +DECLARE (int, output_column, 0); + +/* Non-zero means output_paragraph contains text. */ +DECLARE (int, paragraph_is_open, 0); + +/* The amount of indentation to apply at the start of each line. */ +DECLARE (int, current_indent, 0); + +/* nonzero if we are currently processing a multitable command */ +DECLARE (int, multitable_active, 0); + +/* The column at which long lines are broken. */ +DECLARE (int, fill_column, 72); + +/* The current input file state. */ +DECLARE (char *, input_filename, (char *)NULL); +DECLARE (char *, input_text, (char *)NULL); +DECLARE (int, size_of_input_text, 0); +DECLARE (int, input_text_offset, 0); +DECLARE (int, line_number, 0); + +#define curchar() input_text[input_text_offset] +/* **************************************************************** */ +/* */ +/* Global Defines */ +/* */ +/* **************************************************************** */ + +/* Error levels */ +#define NO_ERROR 0 +#define SYNTAX 2 +#define FATAL 4 + +/* C's standard macros don't check to make sure that the characters being + changed are within range. So I have to check explicitly. */ + +/* GNU Library doesn't have toupper(). Until GNU gets this fixed, I will + have to do it. */ +#ifndef toupper +#define toupper(c) ((c) - 32) +#endif + +#define coerce_to_upper(c) ((islower(c) ? toupper(c) : (c))) +#define coerce_to_lower(c) ((isupper(c) ? tolower(c) : (c))) + +#define control_character_bit 0x40 /* %01000000, must be off. */ +#define meta_character_bit 0x080/* %10000000, must be on. */ +#define CTL(c) ((c) & (~control_character_bit)) +#define UNCTL(c) coerce_to_upper(((c)|control_character_bit)) +#define META(c) ((c) | (meta_character_bit)) +#define UNMETA(c) ((c) & (~meta_character_bit)) + +#define whitespace(c) (((c) == '\t') || ((c) == ' ')) +#define sentence_ender(c) ((c) == '.' || (c) == '?' || (c) == '!') +#define cr_or_whitespace(c) (((c) == '\t') || ((c) == ' ') || ((c) == '\n')) + +#ifndef isletter +#define isletter(c) (((c) >= 'A' && (c) <= 'Z') || ((c) >= 'a' && (c) <= 'z')) +#endif + +#ifndef isupper +#define isupper(c) ((c) >= 'A' && (c) <= 'Z') +#endif + +#ifndef isdigit +#define isdigit(c) ((c) >= '0' && (c) <= '9') +#endif + +#ifndef digit_value +#define digit_value(c) ((c) - '0') +#endif + +#define member(c, s) (strchr (s, c) != NULL) + +#define COMMAND_PREFIX '@' + +/* 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. */ + +DECLARE (int, splitting, 1); /* Defaults to true for now. */ + +typedef void COMMAND_FUNCTION (); /* So I can say COMMAND_FUNCTION *foo; */ + +#define command_char(c) ((!whitespace(c)) && \ + ((c) != '\n') && \ + ((c) != '{') && \ + ((c) != '}') && \ + ((c) != '=')) + +#define skip_whitespace() \ + while ((input_text_offset != size_of_input_text) && \ + whitespace (curchar())) \ + input_text_offset++ + +#define skip_whitespace_and_newlines() \ + do { \ + while ((input_text_offset != size_of_input_text) && \ + (whitespace (curchar ()) || (curchar () == '\n'))) \ + { \ + if (curchar () == '\n') \ + line_number++; \ + input_text_offset++; \ + } \ + } while (0) + +#endif /* !MAKEINFO_H */ diff --git a/gnu/usr.bin/texinfo/makeinfo/multi.c b/gnu/usr.bin/texinfo/makeinfo/multi.c new file mode 100644 index 00000000000..273f1461013 --- /dev/null +++ b/gnu/usr.bin/texinfo/makeinfo/multi.c @@ -0,0 +1,418 @@ +/* multi.c -- Multitable stuff for makeinfo. + $Id: multi.c,v 1.1 1996/12/15 21:39:29 downsj Exp $ + + Copyright (C) 1996 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 <stdio.h> +#include "makeinfo.h" + +#define MAXCOLS 100 /* remove this limit later @@ */ + + +/* + * Output environments. This is a hack grafted onto existing + * structure. The "output environment" used to consist of the + * global variables `output_paragraph', `fill_column', etc. + * Routines like add_char would manipulate these variables. + * + * Now, when formatting a multitable, we maintain separate environments + * for each column. That way we can build up the columns separately + * and write them all out at once. The "current" output environment" + * is still kept in those global variables, so that the old output + * routines don't have to change. But we provide routines to save + * and restore these variables in an "environment table". The + * `select_output_environment' function switches from one output + * environment to another. + * + * Environment #0 (i.e. element #0 of the table) is the regular + * environment that is used when we're not formatting a multitable. + * + * Environment #N (where N = 1,2,3,...) is the env. for column #N of + * the table, when a multitable is active. + */ + +/* contents of an output environment */ +/* some more vars may end up being needed here later @@ */ +struct env +{ + unsigned char *output_paragraph; + int output_paragraph_offset; + int output_column; + int paragraph_is_open; + int current_indent; + int fill_column; +} envs[MAXCOLS]; /* the environment table */ + +/* index in environment table of currently selected environment */ +static int current_env_no; + +/* column number of last column in current multitable */ +static int last_column; + +/* flags indicating whether horizontal and vertical separators need + to be drawn, separating rows and columns in the current multitable. */ +static int hsep, vsep; + +void +do_multitable () +{ + int ncolumns; + + /* + * multitable strategy: + * for each item { + * for each column in an item { + * initialize a new paragraph + * do ordinary formatting into the new paragraph + * save the paragraph away + * repeat if there are more paragraphs in the column + * } + * dump out the saved paragraphs and free the storage + * } + */ + + if (multitable_active) + { + line_error ("Multitables cannot be nested"); + return; + } + + /* scan the current item function to get the field widths + and number of columns, and set up the output environment list + accordingly. */ + ncolumns = setup_multitable_parameters (); + if (hsep) + draw_horizontal_separator (); + + /* The next @item command will direct stdout into the first column + and start processing. @tab will then switch to the next column, + and @item will flush out the saved output and return to the first + column. Environment #1 is the first column. (Environment #0 is + the normal output) */ + + ++multitable_active; +} + +/* Read the parameters for a multitable from the current command + line, save the parameters away, and return the + number of columns. */ +int +setup_multitable_parameters () +{ + char *params = insertion_stack->item_function; + int nchars; + float columnfrac; + char command[200]; + int i = 1; + + /* We implement @hsep and @vsep even though TeX doesn't. + We don't get mixing of @columnfractions and templates right, + but TeX doesn't either. */ + hsep = vsep = 0; + + while (*params) { + while (whitespace (*params)) + params++; + + if (*params == '@') { + sscanf (params, "%s%n", command, &nchars); + params += nchars; + if (strcmp (command, "@hsep") == 0) + hsep++; + else if (strcmp (command, "@vsep") == 0) + vsep++; + else if (strcmp (command, "@columnfractions") == 0) { + /* Clobber old environments and create new ones, + starting at #1. Environment #0 is the normal standard output, + so we don't mess with it. */ + for ( ; i <= MAXCOLS; i++) { + if (sscanf (params, "%f%n", &columnfrac, &nchars) < 1) + goto done; + params += nchars; + setup_output_environment (i, (int) (columnfrac * fill_column + .5)); + } + } + + } else if (*params == '{') { + char *start = params; + while ((*params != '}' || params[-1] == '@') && *params) { + params++; + } + /* This gives us two spaces between columns. Seems reasonable. + Really should expand the text, though, so a template of + `@code{foo}' has a width of three, not ten. Also have to match + braces, then. */ + setup_output_environment (i++, params++ - start); + + } else { + warning ("ignoring stray text `%s' after @multitable", params); + break; + } + } + +done: + + flush_output (); + inhibit_output_flushing (); + + last_column = i - 1; + return last_column; +} + +/* Initialize environment number ENV_NO, of width WIDTH. + The idea is that we're going to use one environment for each column of + a multitable, so we can build them up separately and print them + all out at the end. */ +int +setup_output_environment (env_no, width) + int env_no; + int width; +{ + int old_env = select_output_environment (env_no); + + /* clobber old environment and set width of new one */ + init_paragraph (); + + /* make our change */ + fill_column = width; + + /* Save new environment and restore previous one. */ + select_output_environment (old_env); + + return env_no; +} + +/* Direct current output to environment number N. Used when + switching work from one column of a multitable to the next. + Returns previous environment number. */ +int +select_output_environment (n) + int n; +{ + struct env *e = &envs[current_env_no]; + int old_env_no = current_env_no; + + /* stash current env info from global vars into the old environment */ + e->output_paragraph = output_paragraph; + e->output_paragraph_offset = output_paragraph_offset; + e->output_column = output_column; + e->paragraph_is_open = paragraph_is_open; + e->current_indent = current_indent; + e->fill_column = fill_column; + + /* now copy new environment into global vars */ + current_env_no = n; + e = &envs[current_env_no]; + output_paragraph = e->output_paragraph; + output_paragraph_offset = e->output_paragraph_offset; + output_column = e->output_column; + paragraph_is_open = e->paragraph_is_open; + current_indent = e->current_indent; + fill_column = e->fill_column; + return old_env_no; +} + +/* advance to the next environment number */ +int +nselect_next_environment () +{ + if (current_env_no >= last_column) { + line_error ("Too many columns in multitable item (max %d)", last_column); + return 1; + } + select_output_environment (current_env_no + 1); +} + + +static void output_multitable_row (); + +/* start a new item (row) of a multitable */ +multitable_item () +{ + if (!multitable_active) { + /* impossible, I think. */ + error ("multitable item not in active multitable"); + exit (1); + } + if (current_env_no > 0) { + output_multitable_row (); + } + /* start at column 1 */ + select_output_environment (1); + if (!output_paragraph) { + line_error ("Cannot select column #%d in multitable", current_env_no); + exit (FATAL); + } + + init_column (); + + return 0; +} + +/* do anything needed at the beginning of processing a + multitable column. */ +init_column () +{ + /* don't indent 1st paragraph in the item */ + cm_noindent (); + + /* throw away possible whitespace after @item or @tab command */ + skip_whitespace (); +} + +/* Output a row. Have to keep `output_position' up-to-date for each + character we output, or the tags table will be off, leading to + chopped-off output files and undefined nodes (because they're in the + wrong file, etc.). Perhaps it would be better to accumulate this + value somewhere and add it once at the end of the table, or return it + as the value, but this seems simplest. */ + +static void +out_char (ch) + int ch; +{ + extern int output_position; + putc (ch, output_stream); + output_position++; +} + + +static void +output_multitable_row () +{ + int i, j, remaining; + + /* offset in the output paragraph of the next char needing + to be output for that column. */ + int offset[MAXCOLS]; + + for (i = 0; i <= last_column; i++) + offset[i] = 0; + + /* select the current environment, to make sure the env variables + get updated */ + select_output_environment (current_env_no); + +#define CHAR_ADDR(n) (offset[i] + (n)) +#define CHAR_AT(n) (envs[i].output_paragraph[CHAR_ADDR(n)]) + + /* remove trailing whitespace from each column */ + for (i = 1; i <= last_column; i++) { + while (cr_or_whitespace (CHAR_AT (envs[i].output_paragraph_offset - 1))) { + envs[i].output_paragraph_offset--; + } + } + + /* read the current line from each column, outputting them all + pasted together. Do this til all lines are output from all + columns. */ + for (;;) { + remaining = 0; + /* first, see if there is any work to do */ + for (i = 1; i <= last_column; i++) { + if (CHAR_ADDR (0) < envs[i].output_paragraph_offset) { + remaining = 1; + break; + } + } + if (!remaining) + break; + + if (vsep) + out_char ('|'); + + for (i = 1; i <= last_column; i++) { + for (j = 0; CHAR_ADDR (j) < envs[i].output_paragraph_offset; j++) { + if (CHAR_AT (j) == '\n') + break; + out_char (CHAR_AT (j)); + } + offset[i] += j + 1; /* skip last text plus skip the newline */ + for (; j <= envs[i].fill_column; j++) + out_char (' '); + if (vsep) + out_char ('|'); /* draw column separator */ + } + out_char ('\n'); /* end of line */ + } + + if (hsep) + draw_horizontal_separator (); + + /* Now dispose of the buffered output. */ + for (i = 1; i <= last_column; i++) { + select_output_environment (i); + init_paragraph (); + } +} + +#undef CHAR_AT +#undef CHAR_ADDR + +int +draw_horizontal_separator () +{ + int i, j; + if (vsep) + out_char ('+'); + for (i = 1; i <= last_column; i++) { + for (j = 0; j <= envs[i].fill_column; j++) + out_char ('-'); + if (vsep) + out_char ('+'); + } + out_char ('\n'); +} + +/* select a new column in current row of multitable */ +void +cm_tab () +{ + if (!multitable_active) + error ("ignoring @tab outside of multitable"); + + nselect_next_environment (); + init_column (); +} + +/* close a multitable, flushing its output and resetting + whatever needs resetting */ +void +end_multitable () +{ + int i; + + output_multitable_row (); + + /* Multitables cannot be nested. Otherwise, we'd have to save the + previous output environment number on a stack somewhere, and then + restore to that environment. */ + select_output_environment (0); + close_paragraph (); + insert ('\n'); /* we swallow newlines, so insert one of our own */ + + multitable_active = 0; + uninhibit_output_flushing (); + +#if 0 + printf ("** Multicolumn output from last row:\n"); + for (i = 1; i <= last_column; i++) { + select_output_environment (i); + printf ("* column #%d: output = %s\n", i, output_paragraph); + } +#endif +} diff --git a/gnu/usr.bin/texinfo/util/install-info.c b/gnu/usr.bin/texinfo/util/install-info.c new file mode 100644 index 00000000000..95c3d95ffc2 --- /dev/null +++ b/gnu/usr.bin/texinfo/util/install-info.c @@ -0,0 +1,1111 @@ +/* install-info -- create Info directory entry(ies) for an Info file. + Copyright (C) 1996 Free Software Foundation, Inc. + +$Id: install-info.c,v 1.1 1996/12/15 21:39:32 downsj Exp $ + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#define INSTALL_INFO_VERSION_STRING "GNU install-info (Texinfo 3.9) 1.2" + +#include <stdio.h> +#include <errno.h> +#include <getopt.h> +#include <sys/types.h> + +/* Get O_RDONLY. */ +#ifdef HAVE_SYS_FCNTL_H +#include <sys/fcntl.h> +#else +#include <fcntl.h> +#endif /* !HAVE_SYS_FCNTL_H */ +#ifdef HAVE_SYS_FILE_H +#include <sys/file.h> +#endif + +/* Name this program was invoked with. */ +char *progname; + +char *readfile (); +struct line_data *findlines (); +char *my_strerror (); +void fatal (); +void insert_entry_here (); +int compare_section_names (); + +struct spec_entry; + +/* Data structures. */ + +/* Record info about a single line from a file + as read into core. */ + +struct line_data +{ + /* The start of the line. */ + char *start; + /* The number of characters in the line, + excluding the terminating newline. */ + int size; + /* Vector containing pointers to the entries to add before this line. + The vector is null-terminated. */ + struct spec_entry **add_entries_before; + /* 1 means output any needed new sections before this line. */ + int add_sections_before; + /* 1 means don't output this line. */ + int delete; +}; + +/* This is used for a list of the specified menu section names + in which entries should be added. */ + +struct spec_section +{ + struct spec_section *next; + char *name; + /* 1 means we have not yet found an existing section with this name + in the dir file--so we will need to add a new section. */ + int missing; +}; + +/* This is used for a list of the entries specified to be added. */ + +struct spec_entry +{ + struct spec_entry *next; + char *text; +}; + +/* This is used for a list of nodes found by parsing the dir file. */ + +struct node +{ + struct node *next; + /* The node name. */ + char *name; + /* The line number of the line where the node starts. + This is the line that contains control-underscore. */ + int start_line; + /* The line number of the line where the node ends, + which is the end of the file or where the next line starts. */ + int end_line; + /* Start of first line in this node's menu + (the line after the * Menu: line). */ + char *menu_start; + /* The start of the chain of sections in this node's menu. */ + struct menu_section *sections; + /* The last menu section in the chain. */ + struct menu_section *last_section; +}; + +/* This is used for a list of sections found in a node's menu. + Each struct node has such a list in the sections field. */ + +struct menu_section +{ + struct menu_section *next; + char *name; + /* Line number of start of section. */ + int start_line; + /* Line number of end of section. */ + int end_line; +}; + +/* Memory allocation and string operations. */ + +/* Like malloc but get fatal error if memory is exhausted. */ + +void * +xmalloc (size) + unsigned int size; +{ + extern void *malloc (); + void *result = malloc (size); + if (result == NULL) + fatal ("virtual memory exhausted", 0); + return result; +} + +/* Like malloc but get fatal error if memory is exhausted. */ + +void * +xrealloc (obj, size) + void *obj; + unsigned int size; +{ + extern void *realloc (); + void *result = realloc (obj, size); + if (result == NULL) + fatal ("virtual memory exhausted", 0); + return result; +} + +/* Return a newly-allocated string whose contents concatenate those of s1, s2, s3. */ + +char * +concat (s1, s2, s3) + char *s1, *s2, *s3; +{ + int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3); + char *result = (char *) xmalloc (len1 + len2 + len3 + 1); + + strcpy (result, s1); + strcpy (result + len1, s2); + strcpy (result + len1 + len2, s3); + *(result + len1 + len2 + len3) = 0; + + return result; +} + +/* Return a string containing SIZE characters + copied from starting at STRING. */ + +char * +copy_string (string, size) + char *string; + int size; +{ + int i; + char *copy = (char *) xmalloc (size + 1); + for (i = 0; i < size; i++) + copy[i] = string[i]; + copy[size] = 0; + return copy; +} + +/* Error message functions. */ + +/* Print error message. `s1' is printf control string, `s2' is arg for it. */ + +/* VARARGS1 */ +void +error (s1, s2, s3) + char *s1, *s2, *s3; +{ + fprintf (stderr, "%s: ", progname); + fprintf (stderr, s1, s2, s3); + fprintf (stderr, "\n"); +} + +/* VARARGS1 */ +void +warning (s1, s2, s3) + char *s1, *s2, *s3; +{ + fprintf (stderr, "%s: Warning: ", progname); + fprintf (stderr, s1, s2, s3); + fprintf (stderr, "\n"); +} + +/* Print error message and exit. */ + +void +fatal (s1, s2, s3) + char *s1, *s2, *s3; +{ + error (s1, s2, s3); + exit (1); +} + +/* Print fatal error message based on errno, with file name NAME. */ + +void +pfatal_with_name (name) + char *name; +{ + char *s = concat ("", my_strerror (errno), " for %s"); + fatal (s, name); +} + +/* Given the full text of a menu entry, null terminated, + return just the menu item name (copied). */ + +char * +extract_menu_item_name (item_text) + char *item_text; +{ + char *p; + + if (*item_text == '*') + item_text++; + while (*item_text == ' ') + item_text++; + + p = item_text; + while (*p && *p != ':') p++; + return copy_string (item_text, p - item_text); +} + +/* Given the full text of a menu entry, terminated by null or newline, + return just the menu item file (copied). */ + +char * +extract_menu_file_name (item_text) + char *item_text; +{ + char *p = item_text; + + /* If we have text that looks like * ITEM: (FILE)NODE..., + extract just FILE. Otherwise return "(none)". */ + + if (*p == '*') + p++; + while (*p == ' ') + p++; + + /* Skip to and past the colon. */ + while (*p && *p != '\n' && *p != ':') p++; + if (*p == ':') p++; + + /* Skip past the open-paren. */ + while (1) + { + if (*p == '(') + break; + else if (*p == ' ' || *p == '\t') + p++; + else + return "(none)"; + } + p++; + + item_text = p; + + /* File name ends just before the close-paren. */ + while (*p && *p != '\n' && *p != ')') p++; + if (*p != ')') + return "(none)"; + + return copy_string (item_text, p - item_text); +} + +void +suggest_asking_for_help () +{ + fprintf (stderr, "\tTry `%s --help' for a complete list of options.\n", + progname); + exit (1); +} + +void +print_help () +{ + printf ("%s [OPTION]... [INFO-FILE [DIR-FILE]]\n\ + Install INFO-FILE in the Info directory file DIR-FILE.\n\ +\n\ +Options:\n\ +--delete Delete existing entries in INFO-FILE;\n\ + don't insert any new entries.\n\ +--dir-file=NAME Specify file name of Info directory file.\n\ + This is equivalent to using the DIR-FILE argument.\n\ +--entry=TEXT Insert TEXT as an Info directory entry.\n\ + TEXT should have the form of an Info menu item line\n\ + plus zero or more extra lines starting with whitespace.\n\ + If you specify more than one entry, they are all added.\n\ + If you don't specify any entries, they are determined\n\ + from information in the Info file itself.\n\ +--help Display this help and exit.\n\ +--info-file=FILE Specify Info file to install in the directory.\n\ + This is equivalent to using the INFO-FILE argument.\n\ +--info-dir=DIR Same as --dir-file=DIR/dir.\n\ +--item=TEXT Same as --entry TEXT.\n\ + An Info directory entry is actually a menu item.\n\ +--quiet Suppress warnings.\n\ +--remove Same as --delete.\n\ +--section=SEC Put this file's entries in section SEC of the directory.\n\ + If you specify more than one section, all the entries\n\ + are added in each of the sections.\n\ + If you don't specify any sections, they are determined\n\ + from information in the Info file itself.\n\ +--version Display version information and exit.\n\ +\n\ +Email bug reports to bug-texinfo@prep.ai.mit.edu.\n\ +", progname); +} + +/* Convert an errno value into a string describing the error. + We define this function here rather than using strerror + because not all systems have strerror. */ + +char * +my_strerror (errnum) + int errnum; +{ + extern char *sys_errlist[]; + extern int sys_nerr; + + if (errnum >= 0 && errnum < sys_nerr) + return sys_errlist[errnum]; + return (char *) "Unknown error"; +} + +/* This table defines all the long-named options, says whether they + use an argument, and maps them into equivalent single-letter options. */ + +struct option longopts[] = +{ + { "delete", no_argument, NULL, 'r' }, + { "dir-file", required_argument, NULL, 'd' }, + { "entry", required_argument, NULL, 'e' }, + { "help", no_argument, NULL, 'h' }, + { "info-dir", required_argument, NULL, 'D' }, + { "info-file", required_argument, NULL, 'i' }, + { "item", required_argument, NULL, 'e' }, + { "quiet", no_argument, NULL, 'q' }, + { "remove", no_argument, NULL, 'r' }, + { "section", required_argument, NULL, 's' }, + { "version", no_argument, NULL, 'V' }, + { 0 } +}; + +main (argc, argv) + int argc; + char **argv; +{ + char *infile = 0, *dirfile = 0; + char *infile_sans_info; + unsigned infilelen_sans_info; + FILE *output; + + /* Record the text of the Info file, as a sequence of characters + and as a sequence of lines. */ + char *input_data; + int input_size; + struct line_data *input_lines; + int input_nlines; + + /* Record here the specified section names and directory entries. */ + struct spec_section *input_sections = NULL; + struct spec_entry *entries_to_add = NULL; + int n_entries_to_add = 0; + + /* Record the old text of the dir file, as plain characters, + as lines, and as nodes. */ + char *dir_data; + int dir_size; + int dir_nlines; + struct line_data *dir_lines; + struct node *dir_nodes; + + /* Nonzero means --delete was specified (just delete existing entries). */ + int delete_flag = 0; + int something_deleted = 0; + /* Nonzero means -q was specified. */ + int quiet_flag = 0; + + int node_header_flag; + int prefix_length; + int i; + + progname = argv[0]; + + while (1) + { + int opt = getopt_long (argc, argv, "i:d:e:s:hHr", longopts, 0); + + if (opt == EOF) + break; + + switch (opt) + { + case 0: + /* If getopt returns 0, then it has already processed a + long-named option. We should do nothing. */ + break; + + case 1: + abort (); + + case 'd': + if (dirfile) + { + fprintf (stderr, "%s: Specify the Info directory only once.\n", + progname); + suggest_asking_for_help (); + } + dirfile = optarg; + break; + + case 'D': + if (dirfile) + { + fprintf (stderr, "%s: Specify the Info directory only once.\n", + progname); + suggest_asking_for_help (); + } + dirfile = concat (optarg, "", "/dir"); + break; + + case 'e': + { + struct spec_entry *next + = (struct spec_entry *) xmalloc (sizeof (struct spec_entry)); + if (! (*optarg != 0 && optarg[strlen (optarg) - 1] == '\n')) + optarg = concat (optarg, "\n", ""); + next->text = optarg; + next->next = entries_to_add; + entries_to_add = next; + n_entries_to_add++; + } + break; + + case 'h': + case 'H': + print_help (); + exit (0); + + case 'i': + if (infile) + { + fprintf (stderr, "%s: Specify the Info file only once.\n", + progname); + suggest_asking_for_help (); + } + infile = optarg; + break; + + case 'q': + quiet_flag = 1; + break; + + case 'r': + delete_flag = 1; + break; + + case 's': + { + struct spec_section *next + = (struct spec_section *) xmalloc (sizeof (struct spec_section)); + next->name = optarg; + next->next = input_sections; + next->missing = 1; + input_sections = next; + } + break; + + case 'V': + puts (INSTALL_INFO_VERSION_STRING); +puts ("Copyright (C) 1996 Free Software Foundation, Inc.\n\ +There is NO warranty. You may redistribute this software\n\ +under the terms of the GNU General Public License.\n\ +For more information about these matters, see the files named COPYING."); + exit (0); + + default: + suggest_asking_for_help (); + } + } + + /* Interpret the non-option arguments as file names. */ + for (; optind < argc; ++optind) + { + if (infile == 0) + infile = argv[optind]; + else if (dirfile == 0) + dirfile = argv[optind]; + else + error ("excess command line argument `%s'", argv[optind]); + } + + if (!infile) + fatal ("No input file specified"); + if (!dirfile) + fatal ("No dir file specified"); + + /* Read the Info file and parse it into lines. */ + + input_data = readfile (infile, &input_size); + input_lines = findlines (input_data, input_size, &input_nlines); + + /* Parse the input file to find the section names it specifies. */ + + if (input_sections == 0) + { + prefix_length = strlen ("INFO-DIR-SECTION "); + for (i = 0; i < input_nlines; i++) + { + if (!strncmp ("INFO-DIR-SECTION ", input_lines[i].start, + prefix_length)) + { + struct spec_section *next + = (struct spec_section *) xmalloc (sizeof (struct spec_section)); + next->name = copy_string (input_lines[i].start + prefix_length, + input_lines[i].size - prefix_length); + next->next = input_sections; + next->missing = 1; + input_sections = next; + } + } + } + + /* Default to section "Miscellaneous" if no sections specified. */ + if (input_sections == 0) + { + input_sections + = (struct spec_section *) xmalloc (sizeof (struct spec_section)); + input_sections->name = "Miscellaneous"; + input_sections->next = 0; + input_sections->missing = 1; + } + + /* Now find the directory entries specified in the file + and put them on entries_to_add. But not if entries + were specified explicitly with command options. */ + + if (entries_to_add == 0) + { + char *start_of_this_entry = 0; + for (i = 0; i < input_nlines; i++) + { + if (!strncmp ("START-INFO-DIR-ENTRY", input_lines[i].start, + input_lines[i].size) + && sizeof ("START-INFO-DIR-ENTRY") - 1 == input_lines[i].size) + { + if (start_of_this_entry != 0) + fatal ("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY"); + start_of_this_entry = input_lines[i + 1].start; + } + if (!strncmp ("END-INFO-DIR-ENTRY", input_lines[i].start, + input_lines[i].size) + && sizeof ("END-INFO-DIR-ENTRY") - 1 == input_lines[i].size) + { + if (start_of_this_entry != 0) + { + struct spec_entry *next + = (struct spec_entry *) xmalloc (sizeof (struct spec_entry)); + next->text = copy_string (start_of_this_entry, + input_lines[i].start - start_of_this_entry); + next->next = entries_to_add; + entries_to_add = next; + n_entries_to_add++; + start_of_this_entry = 0; + } + else + fatal ("END-INFO-DIR-ENTRY without matching START-INFO-DIR-ENTRY"); + } + } + if (start_of_this_entry != 0) + fatal ("START-INFO-DIR-ENTRY without matching END-INFO-DIR-ENTRY"); + } + + if (!delete_flag) + if (entries_to_add == 0) + fatal ("no info dir entry in `%s'", infile); + + /* Now read in the Info dir file. */ + dir_data = readfile (dirfile, &dir_size); + dir_lines = findlines (dir_data, dir_size, &dir_nlines); + + /* We will be comparing the entries in the dir file against the + current filename, so need to strip off any directory prefix and any + .info suffix. */ + { + unsigned basename_len; + extern char *strrchr (); + char *infile_basename = strrchr (infile, '/'); + if (infile_basename) + infile_basename++; + else + infile_basename = infile; + + basename_len = strlen (infile_basename); + infile_sans_info + = (strlen (infile_basename) > 5 + && strcmp (infile_basename + basename_len - 5, ".info") == 0) + ? copy_string (infile_basename, basename_len - 5) + : infile_basename; + + infilelen_sans_info = strlen (infile_sans_info); + } + + /* Parse the dir file. Find all the nodes, and their menus, + and the sections of their menus. */ + + dir_nodes = 0; + node_header_flag = 0; + for (i = 0; i < dir_nlines; i++) + { + /* Parse node header lines. */ + if (node_header_flag) + { + int j, end; + for (j = 0; j < dir_lines[i].size; j++) + /* Find the node name and store it in the `struct node'. */ + if (!strncmp ("Node:", dir_lines[i].start + j, 5)) + { + char *line = dir_lines[i].start; + /* Find the start of the node name. */ + j += 5; + while (line[j] == ' ' || line[j] == '\t') + j++; + /* Find the end of the node name. */ + end = j; + while (line[end] != 0 && line[end] != ',' && line[end] != '\n' + && line[end] != '\t') + end++; + dir_nodes->name = copy_string (line + j, end - j); + } + node_header_flag = 0; + } + + /* Notice the start of a node. */ + if (*dir_lines[i].start == 037) + { + struct node *next + = (struct node *) xmalloc (sizeof (struct node)); + next->next = dir_nodes; + next->name = NULL; + next->start_line = i; + next->end_line = 0; + next->menu_start = NULL; + next->sections = NULL; + next->last_section = NULL; + + if (dir_nodes != 0) + dir_nodes->end_line = i; + /* Fill in the end of the last menu section + of the previous node. */ + if (dir_nodes != 0 && dir_nodes->last_section != 0) + dir_nodes->last_section->end_line = i; + + dir_nodes = next; + + /* The following line is the header of this node; + parse it. */ + node_header_flag = 1; + } + + /* Notice the lines that start menus. */ + if (dir_nodes != 0 + && !strncmp ("* Menu:", dir_lines[i].start, 7)) + dir_nodes->menu_start = dir_lines[i + 1].start; + + /* Notice sections in menus. */ + if (dir_nodes != 0 + && dir_nodes->menu_start != 0 + && *dir_lines[i].start != '\n' + && *dir_lines[i].start != '*' + && *dir_lines[i].start != ' ' + && *dir_lines[i].start != '\t') + { + /* Add this menu section to the node's list. + This list grows in forward order. */ + struct menu_section *next + = (struct menu_section *) xmalloc (sizeof (struct menu_section)); + next->start_line = i + 1; + next->next = 0; + next->end_line = 0; + next->name = copy_string (dir_lines[i].start, dir_lines[i].size); + if (dir_nodes->sections) + { + dir_nodes->last_section->next = next; + dir_nodes->last_section->end_line = i; + } + else + dir_nodes->sections = next; + dir_nodes->last_section = next; + } + + /* Check for an existing entry that should be deleted. + Delete all entries which specify this file name. */ + if (*dir_lines[i].start == '*') + { + char *p = dir_lines[i].start; + + while (*p != 0 && *p != ':') + p++; + p++; + while (*p == ' ') p++; + if (*p == '(') + { + p++; + if ((dir_lines[i].size + > (p - dir_lines[i].start + infilelen_sans_info)) + && !strncmp (p, infile_sans_info, infilelen_sans_info) + && p[infilelen_sans_info] == ')') + dir_lines[i].delete = 1; + } + } + /* Treat lines that start with whitespace + as continuations; if we are deleting an entry, + delete all its continuations as well. */ + else if (i > 0 + && (*dir_lines[i].start == ' ' + || *dir_lines[i].start == '\t')) + { + dir_lines[i].delete = dir_lines[i - 1].delete; + something_deleted = 1; + } + } + + /* Finish the info about the end of the last node. */ + if (dir_nodes != 0) + { + dir_nodes->end_line = dir_nlines; + if (dir_nodes->last_section != 0) + dir_nodes->last_section->end_line = dir_nlines; + } + + /* Decide where to add the new entries (unless --delete was used). + Find the menu sections to add them in. + In each section, find the proper alphabetical place to add + each of the entries. */ + + if (!delete_flag) + { + struct node *node; + struct menu_section *section; + struct spec_section *spec; + + for (node = dir_nodes; node; node = node->next) + for (section = node->sections; section; section = section->next) + { + for (i = section->end_line; i > section->start_line; i--) + if (dir_lines[i - 1].size != 0) + break; + section->end_line = i; + + for (spec = input_sections; spec; spec = spec->next) + if (!strcmp (spec->name, section->name)) + break; + if (spec) + { + int add_at_line = section->end_line; + struct spec_entry *entry; + /* Say we have found at least one section with this name, + so we need not add such a section. */ + spec->missing = 0; + /* For each entry, find the right place in this section + to add it. */ + for (entry = entries_to_add; entry; entry = entry->next) + { + int textlen = strlen (entry->text); + /* Subtract one because dir_lines is zero-based, + but the `end_line' and `start_line' members are + one-based. */ + for (i = section->end_line - 1; + i >= section->start_line - 1; i--) + { + /* If an entry exists with the same name, + and was not marked for deletion + (which means it is for some other file), + we are in trouble. */ + if (dir_lines[i].start[0] == '*' + && menu_line_equal (entry->text, textlen, + dir_lines[i].start, + dir_lines[i].size) + && !dir_lines[i].delete) + fatal ("menu item `%s' already exists, for file `%s'", + extract_menu_item_name (entry->text), + extract_menu_file_name (dir_lines[i].start)); + if (dir_lines[i].start[0] == '*' + && menu_line_lessp (entry->text, textlen, + dir_lines[i].start, + dir_lines[i].size)) + add_at_line = i; + } + insert_entry_here (entry, add_at_line, + dir_lines, n_entries_to_add); + } + } + } + + /* Mark the end of the Top node as the place to add any + new sections that are needed. */ + for (node = dir_nodes; node; node = node->next) + if (node->name && strcmp (node->name, "Top") == 0) + dir_lines[node->end_line].add_sections_before = 1; + } + + if (delete_flag && !something_deleted && !quiet_flag) + warning ("no entries found for `%s'; nothing deleted", infile); + + /* Output the old dir file, interpolating the new sections + and/or new entries where appropriate. */ + + output = fopen (dirfile, "w"); + if (!output) + { + perror (dirfile); + exit (1); + } + + for (i = 0; i <= dir_nlines; i++) + { + int j; + + /* If we decided to output some new entries before this line, + output them now. */ + if (dir_lines[i].add_entries_before) + for (j = 0; j < n_entries_to_add; j++) + { + struct spec_entry *this = dir_lines[i].add_entries_before[j]; + if (this == 0) + break; + fputs (this->text, output); + } + /* If we decided to add some sections here + because there are no such sections in the file, + output them now. */ + if (dir_lines[i].add_sections_before) + { + struct spec_section *spec; + struct spec_section **sections; + int n_sections = 0; + + /* Count the sections and allocate a vector for all of them. */ + for (spec = input_sections; spec; spec = spec->next) + n_sections++; + sections = ((struct spec_section **) + xmalloc (n_sections * sizeof (struct spec_section *))); + + /* Fill the vector SECTIONS with pointers to all the sections, + and sort them. */ + j = 0; + for (spec = input_sections; spec; spec = spec->next) + sections[j++] = spec; + qsort (sections, n_sections, sizeof (struct spec_section *), + compare_section_names); + + /* Generate the new sections in alphabetical order. + In each new section, output all of our entries. */ + for (j = 0; j < n_sections; j++) + { + spec = sections[j]; + if (spec->missing) + { + struct spec_entry *entry; + + putc ('\n', output); + fputs (spec->name, output); + putc ('\n', output); + for (entry = entries_to_add; entry; entry = entry->next) + fputs (entry->text, output); + } + } + + free (sections); + } + + /* Output the original dir lines unless marked for deletion. */ + if (i < dir_nlines && !dir_lines[i].delete) + { + fwrite (dir_lines[i].start, 1, dir_lines[i].size, output); + putc ('\n', output); + } + } + + fclose (output); + + exit (0); +} + +/* Read all of file FILNAME into memory + and return the address of the data. + Store the size into SIZEP. + If there is trouble, do a fatal error. */ + +char * +readfile (filename, sizep) + char *filename; + int *sizep; +{ + int data_size = 1024; + char *data = (char *) xmalloc (data_size); + int filled = 0; + int nread = 0; + + int desc = open (filename, O_RDONLY); + + if (desc < 0) + pfatal_with_name (filename); + + while (1) + { + nread = read (desc, data + filled, data_size - filled); + if (nread < 0) + pfatal_with_name (filename); + if (nread == 0) + break; + + filled += nread; + if (filled == data_size) + { + data_size *= 2; + data = (char *) xrealloc (data, data_size); + } + } + + *sizep = filled; + return data; +} + +/* Divide the text at DATA (of SIZE bytes) into lines. + Return a vector of struct line_data describing the lines. + Store the length of that vector into *NLINESP. */ + +struct line_data * +findlines (data, size, nlinesp) + char *data; + int size; + int *nlinesp; +{ + struct line_data *lines; + int lines_allocated = 512; + int filled = 0; + int i = 0; + int lineflag; + + lines = (struct line_data *) xmalloc (lines_allocated * sizeof (struct line_data)); + + lineflag = 1; + for (i = 0; i < size; i++) + { + if (lineflag) + { + if (filled == lines_allocated) + { + lines_allocated *= 2; + lines = (struct line_data *) xrealloc (lines, lines_allocated * sizeof (struct line_data)); + } + lines[filled].start = &data[i]; + lines[filled].add_entries_before = 0; + lines[filled].add_sections_before = 0; + lines[filled].delete = 0; + if (filled > 0) + lines[filled - 1].size + = lines[filled].start - lines[filled - 1].start - 1; + filled++; + } + lineflag = (data[i] == '\n'); + } + if (filled > 0) + lines[filled - 1].size = &data[i] - lines[filled - 1].start - lineflag; + + /* Do not leave garbage in the last element. */ + lines[filled].start = NULL; + lines[filled].add_entries_before = NULL; + lines[filled].add_sections_before = 0; + lines[filled].delete = 0; + lines[filled].size = 0; + + *nlinesp = filled; + return lines; +} + +/* Compare the menu item names in LINE1 (line length LEN1) + and LINE2 (line length LEN2). Return 1 if the item name + in LINE1 is less, 0 otherwise. */ + +int +menu_line_lessp (line1, len1, line2, len2) + char *line1; + int len1; + char *line2; + int len2; +{ + int minlen = (len1 < len2 ? len1 : len2); + int i; + + for (i = 0; i < minlen; i++) + { + /* If one item name is a prefix of the other, + the former one is less. */ + if (line1[i] == ':' && line2[i] != ':') + return 1; + if (line2[i] == ':' && line1[i] != ':') + return 0; + /* If they both continue and differ, one is less. */ + if (line1[i] < line2[i]) + return 1; + if (line1[i] > line2[i]) + return 0; + } + /* With a properly formatted dir file, + we can only get here if the item names are equal. */ + return 0; +} + +/* Compare the menu item names in LINE1 (line length LEN1) + and LINE2 (line length LEN2). Return 1 if the item names are equal, + 0 otherwise. */ + +int +menu_line_equal (line1, len1, line2, len2) + char *line1; + int len1; + char *line2; + int len2; +{ + int minlen = (len1 < len2 ? len1 : len2); + int i; + + for (i = 0; i < minlen; i++) + { + /* If both item names end here, they are equal. */ + if (line1[i] == ':' && line2[i] == ':') + return 1; + /* If they both continue and differ, one is less. */ + if (line1[i] != line2[i]) + return 0; + } + /* With a properly formatted dir file, + we can only get here if the item names are equal. */ + return 1; +} + +/* This is the comparison function for qsort + for a vector of pointers to struct spec_section. + Compare the section names. */ + +int +compare_section_names (sec1, sec2) + struct spec_section **sec1, **sec2; +{ + char *name1 = (*sec1)->name; + char *name2 = (*sec2)->name; + return strcmp (name1, name2); +} + +/* Insert ENTRY into the add_entries_before vector + for line number LINE_NUMBER of the dir file. + DIR_LINES and N_ENTRIES carry information from like-named variables + in main. */ + +void +insert_entry_here (entry, line_number, dir_lines, n_entries) + struct spec_entry *entry; + int line_number; + struct line_data *dir_lines; + int n_entries; +{ + int i; + + if (dir_lines[line_number].add_entries_before == 0) + { + dir_lines[line_number].add_entries_before + = (struct spec_entry **) xmalloc (n_entries * sizeof (struct spec_entry *)); + for (i = 0; i < n_entries; i++) + dir_lines[line_number].add_entries_before[i] = 0; + } + + for (i = 0; i < n_entries; i++) + if (dir_lines[line_number].add_entries_before[i] == 0) + break; + + if (i == n_entries) + abort (); + + dir_lines[line_number].add_entries_before[i] = entry; +} |