summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/texinfo/makeinfo
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2002-06-10 13:51:05 +0000
committerMarc Espie <espie@cvs.openbsd.org>2002-06-10 13:51:05 +0000
commite1bc7714b7945713f4c443c444b4abf17b1d7877 (patch)
treee7485506af2dcb5e2e4d5f71f01a3a652049aafc /gnu/usr.bin/texinfo/makeinfo
parent0766fc34a2525ed5b1d084ea33b198382d10e7d5 (diff)
brain-dead cvs conflict merge
Diffstat (limited to 'gnu/usr.bin/texinfo/makeinfo')
-rw-r--r--gnu/usr.bin/texinfo/makeinfo/Makefile.am25
-rw-r--r--gnu/usr.bin/texinfo/makeinfo/Makefile.in494
-rw-r--r--gnu/usr.bin/texinfo/makeinfo/macro.texi177
-rw-r--r--gnu/usr.bin/texinfo/makeinfo/makeinfo.c1002
-rw-r--r--gnu/usr.bin/texinfo/makeinfo/makeinfo.h44
-rw-r--r--gnu/usr.bin/texinfo/makeinfo/makeinfo.texi303
-rw-r--r--gnu/usr.bin/texinfo/makeinfo/multi.c51
-rw-r--r--gnu/usr.bin/texinfo/makeinfo/multiformat.texi40
8 files changed, 1640 insertions, 496 deletions
diff --git a/gnu/usr.bin/texinfo/makeinfo/Makefile.am b/gnu/usr.bin/texinfo/makeinfo/Makefile.am
index 676e7b3022f..fac3d3074a1 100644
--- a/gnu/usr.bin/texinfo/makeinfo/Makefile.am
+++ b/gnu/usr.bin/texinfo/makeinfo/Makefile.am
@@ -1,19 +1,30 @@
-## Makefile.am for texinfo/makeinfo.
-## $Id: Makefile.am,v 1.3 2000/02/09 02:18:41 espie Exp $
-## Run automake in .. to produce Makefile.in from this.
+# $Id: Makefile.am,v 1.4 2002/06/10 13:51:03 espie Exp $
+# Makefile.am for texinfo/makeinfo.
+# Run automake in .. to produce Makefile.in from this.
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
bin_PROGRAMS = makeinfo
localedir = $(datadir)/locale
INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
-LDADD = ../lib/libtxi.a @INTLLIBS@
+LDADD = ../lib/libtxi.a @LIBINTL@
makeinfo_SOURCES = \
- cmds.c cmds.h defun.c defun.h files.c files.h footnote.c footnote.h \
+ cmds.c cmds.h defun.c defun.h docbook.c docbook.h \
+ files.c files.h footnote.c footnote.h \
html.c html.h index.c index.h insertion.c insertion.h lang.c lang.h \
macro.c macro.h makeinfo.c makeinfo.h multi.c node.c node.h \
- sectioning.c sectioning.h toc.c toc.h
+ sectioning.c sectioning.h toc.c toc.h xml.c xml.h
-EXTRA_DIST = README
+pkgdata_DATA = texinfo.dtd texinfo.xsl
+
+EXTRA_DIST = README $(pkgdata_DATA)
SUBDIRS = tests
diff --git a/gnu/usr.bin/texinfo/makeinfo/Makefile.in b/gnu/usr.bin/texinfo/makeinfo/Makefile.in
index 1d63112f007..fc3ba2a219e 100644
--- a/gnu/usr.bin/texinfo/makeinfo/Makefile.in
+++ b/gnu/usr.bin/texinfo/makeinfo/Makefile.in
@@ -1,6 +1,8 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated by automake 1.6 from Makefile.am.
+# @configure_input@
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -10,7 +12,19 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
+@SET_MAKE@
+# $Id: Makefile.in,v 1.4 2002/06/10 13:51:03 espie Exp $
+# Makefile.am for texinfo/makeinfo.
+# Run automake in .. to produce Makefile.in from this.
+#
+# This file is free software; as a special exception the author gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
SHELL = @SHELL@
srcdir = @srcdir@
@@ -31,13 +45,9 @@ infodir = @infodir@
mandir = @mandir@
includedir = @includedir@
oldincludedir = /usr/include
-
-DESTDIR?=
-
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
-
top_builddir = ..
ACLOCAL = @ACLOCAL@
@@ -45,144 +55,229 @@ AUTOCONF = @AUTOCONF@
AUTOMAKE = @AUTOMAKE@
AUTOHEADER = @AUTOHEADER@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_HEADER = $(INSTALL_DATA)
transform = @program_transform_name@
-
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-CATALOGS = @CATALOGS@
+host_alias = @host_alias@
+host_triplet = @host@
+
+EXEEXT = @EXEEXT@
+OBJEXT = @OBJEXT@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+AMTAR = @AMTAR@
+AWK = @AWK@
+BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@
CATOBJEXT = @CATOBJEXT@
CC = @CC@
DATADIRNAME = @DATADIRNAME@
+DEPDIR = @DEPDIR@
GENCAT = @GENCAT@
-GMOFILES = @GMOFILES@
+GLIBC21 = @GLIBC21@
GMSGFMT = @GMSGFMT@
-GT_NO = @GT_NO@
-GT_YES = @GT_YES@
-INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
+HAVE_LIB = @HAVE_LIB@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INSTOBJEXT = @INSTOBJEXT@
-INTLDEPS = @INTLDEPS@
+INTLBISON = @INTLBISON@
INTLLIBS = @INTLLIBS@
INTLOBJS = @INTLOBJS@
-MAKEINFO = @MAKEINFO@
+INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@
+LIB = @LIB@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LTLIB = @LTLIB@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
MKINSTALLDIRS = @MKINSTALLDIRS@
-MSGFMT = @MSGFMT@
PACKAGE = @PACKAGE@
-POFILES = @POFILES@
POSUB = @POSUB@
RANLIB = @RANLIB@
+STRIP = @STRIP@
TERMLIBS = @TERMLIBS@
USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
USE_NLS = @USE_NLS@
VERSION = @VERSION@
-l = @l@
+am__include = @am__include@
+am__quote = @am__quote@
+install_sh = @install_sh@
bin_PROGRAMS = makeinfo
localedir = $(datadir)/locale
INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
-LDADD = ../lib/libtxi.a @INTLLIBS@
+LDADD = ../lib/libtxi.a @LIBINTL@
+
+makeinfo_SOURCES = \
+ cmds.c cmds.h defun.c defun.h docbook.c docbook.h \
+ files.c files.h footnote.c footnote.h \
+ html.c html.h index.c index.h insertion.c insertion.h lang.c lang.h \
+ macro.c macro.h makeinfo.c makeinfo.h multi.c node.c node.h \
+ sectioning.c sectioning.h toc.c toc.h xml.c xml.h
-makeinfo_SOURCES = cmds.c cmds.h defun.c defun.h files.c files.h footnote.c footnote.h html.c html.h index.c index.h insertion.c insertion.h lang.c lang.h macro.c macro.h makeinfo.c makeinfo.h multi.c node.c node.h sectioning.c sectioning.h toc.c toc.h
+pkgdata_DATA = texinfo.dtd texinfo.xsl
-EXTRA_DIST = README
+EXTRA_DIST = README $(pkgdata_DATA)
SUBDIRS = tests
+subdir = makeinfo
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = ../config.h
-CONFIG_CLEAN_FILES =
-PROGRAMS = $(bin_PROGRAMS)
-
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+bin_PROGRAMS = makeinfo$(EXEEXT)
+PROGRAMS = $(bin_PROGRAMS)
+
+am_makeinfo_OBJECTS = cmds.$(OBJEXT) defun.$(OBJEXT) docbook.$(OBJEXT) \
+ files.$(OBJEXT) footnote.$(OBJEXT) html.$(OBJEXT) \
+ index.$(OBJEXT) insertion.$(OBJEXT) lang.$(OBJEXT) \
+ macro.$(OBJEXT) makeinfo.$(OBJEXT) multi.$(OBJEXT) \
+ node.$(OBJEXT) sectioning.$(OBJEXT) toc.$(OBJEXT) xml.$(OBJEXT)
+makeinfo_OBJECTS = $(am_makeinfo_OBJECTS)
+makeinfo_LDADD = $(LDADD)
+makeinfo_DEPENDENCIES = ../lib/libtxi.a
+makeinfo_LDFLAGS =
-DEFS = @DEFS@ -I. -I$(srcdir) -I..
+DEFS = @DEFS@
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
-makeinfo_OBJECTS = cmds.o defun.o files.o footnote.o html.o index.o \
-insertion.o lang.o macro.o makeinfo.o multi.o node.o sectioning.o toc.o
-makeinfo_LDADD = $(LDADD)
-makeinfo_DEPENDENCIES = ../lib/libtxi.a
-makeinfo_LDFLAGS =
-CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/cmds.Po ./$(DEPDIR)/defun.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/docbook.Po ./$(DEPDIR)/files.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/footnote.Po ./$(DEPDIR)/html.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/index.Po ./$(DEPDIR)/insertion.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/lang.Po ./$(DEPDIR)/macro.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/makeinfo.Po ./$(DEPDIR)/multi.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/node.Po ./$(DEPDIR)/sectioning.Po \
+@AMDEP_TRUE@ ./$(DEPDIR)/toc.Po ./$(DEPDIR)/xml.Po
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-DIST_COMMON = README Makefile.am Makefile.in
-
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+CFLAGS = @CFLAGS@
+DIST_SOURCES = $(makeinfo_SOURCES)
+DATA = $(pkgdata_DATA)
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
-GZIP_ENV = --best
+RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \
+ uninstall-info-recursive all-recursive install-data-recursive \
+ install-exec-recursive installdirs-recursive install-recursive \
+ uninstall-recursive check-recursive installcheck-recursive
+DIST_COMMON = README Makefile.am Makefile.in
+DIST_SUBDIRS = $(SUBDIRS)
SOURCES = $(makeinfo_SOURCES)
-OBJECTS = $(makeinfo_OBJECTS)
-
-all: all-redirect
-.SUFFIXES:
-.SUFFIXES: .S .c .o .s
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps makeinfo/Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-
-mostlyclean-binPROGRAMS:
-clean-binPROGRAMS:
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-
-distclean-binPROGRAMS:
-
-maintainer-clean-binPROGRAMS:
+all: all-recursive
+.SUFFIXES:
+.SUFFIXES: .c .o .obj
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu makeinfo/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
- if test -f $$p; then \
- echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
- $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ ; then \
+ p1=`echo "$$p1" | sed -e 's,^.*/,,'`; \
+ f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
+ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
- list='$(bin_PROGRAMS)'; for p in $$list; do \
- rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ f=`echo "$$f" | sed -e 's,^.*/,,'`; \
+ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
+ rm -f $(DESTDIR)$(bindir)/$$f; \
done
-.c.o:
- $(COMPILE) -c $<
-
-.s.o:
- $(COMPILE) -c $<
-
-.S.o:
- $(COMPILE) -c $<
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+makeinfo$(EXEEXT): $(makeinfo_OBJECTS) $(makeinfo_DEPENDENCIES)
+ @rm -f makeinfo$(EXEEXT)
+ $(LINK) $(makeinfo_LDFLAGS) $(makeinfo_OBJECTS) $(makeinfo_LDADD) $(LIBS)
mostlyclean-compile:
- -rm -f *.o core *.core
-
-clean-compile:
+ -rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
-maintainer-clean-compile:
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmds.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/defun.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/docbook.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/files.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/footnote.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/html.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/index.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/insertion.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lang.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/macro.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/makeinfo.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multi.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/node.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sectioning.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toc.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xml.Po@am__quote@
+
+distclean-depend:
+ -rm -rf ./$(DEPDIR)
-makeinfo: $(makeinfo_OBJECTS) $(makeinfo_DEPENDENCIES)
- @rm -f makeinfo
- $(LINK) $(makeinfo_LDFLAGS) $(makeinfo_OBJECTS) $(makeinfo_LDADD) $(LIBS)
+.c.o:
+@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$<
+
+.c.obj:
+@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
+@AMDEP_TRUE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ $(COMPILE) -c `cygpath -w $<`
+CCDEPMODE = @CCDEPMODE@
+.PHONY install-info: install-info-recursive
+install-info-am:
+uninstall-info-am:
+pkgdataDATA_INSTALL = $(INSTALL_DATA)
+install-pkgdataDATA: $(pkgdata_DATA)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)
+ @list='$(pkgdata_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(pkgdataDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f"; \
+ $(pkgdataDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f; \
+ done
+
+uninstall-pkgdataDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(pkgdata_DATA)'; for p in $$list; do \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " rm -f $(DESTDIR)$(pkgdatadir)/$$f"; \
+ rm -f $(DESTDIR)$(pkgdatadir)/$$f; \
+ done
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
@@ -190,12 +285,7 @@ makeinfo: $(makeinfo_OBJECTS) $(makeinfo_DEPENDENCIES)
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
-
-@SET_MAKE@
-
-all-recursive install-data-recursive install-exec-recursive \
-installdirs-recursive install-recursive uninstall-recursive \
-check-recursive installcheck-recursive info-recursive dvi-recursive:
+$(RECURSIVE_TARGETS):
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
@@ -218,11 +308,16 @@ mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $(MAKEFLAGS); amf=$$2; \
dot_seen=no; \
- rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
- rev="$$subdir $$rev"; \
- if test "$$subdir" = "."; then dot_seen=yes; fi; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
done; \
- test "$$dot_seen" = "no" && rev=". $$rev"; \
+ rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
@@ -239,173 +334,168 @@ tags-recursive:
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
+ETAGS = etags
+ETAGSFLAGS =
+
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -fID $$unique
-TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" = .; then :; else \
+ if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
- fi; \
+ fi; \
done; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
-mostlyclean-tags:
-
-clean-tags:
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
- -rm -f TAGS ID
-
-maintainer-clean-tags:
-
-distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-subdir = makeinfo
+top_distdir = ..
+distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
distdir: $(DISTFILES)
@for file in $(DISTFILES); do \
- d=$(srcdir); \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkinstalldirs) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
if test -d $$d/$$file; then \
- cp -pr $$d/$$file $(distdir)/$$file; \
+ cp -pR $$d/$$file $(distdir)$$dir \
+ || exit 1; \
else \
test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file || :; \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
fi; \
done
- for subdir in $(SUBDIRS); do \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
- chmod 777 $(distdir)/$$subdir; \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" \
+ distdir=../$(distdir)/$$subdir \
+ distdir) \
|| exit 1; \
fi; \
done
-cmds.o: cmds.c ../lib/system.h ../config.h ../lib/getopt.h cmds.h \
- defun.h insertion.h files.h footnote.h lang.h macro.h \
- makeinfo.h node.h sectioning.h toc.h
-defun.o: defun.c ../lib/system.h ../config.h ../lib/getopt.h defun.h \
- insertion.h makeinfo.h
-files.o: files.c ../lib/system.h ../config.h ../lib/getopt.h files.h \
- macro.h makeinfo.h
-footnote.o: footnote.c ../lib/system.h ../config.h ../lib/getopt.h \
- footnote.h macro.h makeinfo.h
-html.o: html.c ../lib/system.h ../config.h ../lib/getopt.h cmds.h html.h \
- lang.h makeinfo.h sectioning.h
-index.o: index.c ../lib/system.h ../config.h ../lib/getopt.h index.h \
- makeinfo.h cmds.h lang.h macro.h toc.h
-insertion.o: insertion.c ../lib/system.h ../config.h ../lib/getopt.h \
- cmds.h defun.h insertion.h macro.h makeinfo.h
-lang.o: lang.c ../lib/system.h ../config.h ../lib/getopt.h cmds.h lang.h \
- makeinfo.h
-macro.o: macro.c ../lib/system.h ../config.h ../lib/getopt.h cmds.h \
- macro.h makeinfo.h insertion.h
-makeinfo.o: makeinfo.c ../lib/system.h ../config.h ../lib/getopt.h \
- makeinfo.h cmds.h files.h footnote.h html.h index.h insertion.h \
- macro.h node.h toc.h
-multi.o: multi.c ../lib/system.h ../config.h ../lib/getopt.h insertion.h \
- makeinfo.h
-node.o: node.c ../lib/system.h ../config.h ../lib/getopt.h cmds.h \
- files.h footnote.h macro.h makeinfo.h node.h sectioning.h \
- insertion.h
-sectioning.o: sectioning.c ../lib/system.h ../config.h ../lib/getopt.h \
- cmds.h macro.h makeinfo.h node.h toc.h sectioning.h
-toc.o: toc.c ../lib/system.h ../config.h ../lib/getopt.h makeinfo.h \
- cmds.h files.h macro.h node.h lang.h sectioning.h toc.h
-
-info-am:
-info: info-recursive
-dvi-am:
-dvi: dvi-recursive
check-am: all-am
check: check-recursive
-installcheck-am:
-installcheck: installcheck-recursive
-install-exec-am: install-binPROGRAMS
-install-exec: install-exec-recursive
+all-am: Makefile $(PROGRAMS) $(DATA)
+installdirs: installdirs-recursive
+installdirs-am:
+ $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(pkgdatadir)
-install-data-am:
+install: install-recursive
+install-exec: install-exec-recursive
install-data: install-data-recursive
+uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install: install-recursive
-uninstall-am: uninstall-binPROGRAMS
-uninstall: uninstall-recursive
-all-am: Makefile $(PROGRAMS)
-all-redirect: all-recursive
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs: installdirs-recursive
-installdirs-am:
- $(mkinstalldirs) $(DESTDIR)$(bindir)
-
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
- -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
maintainer-clean-generic:
-mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
- mostlyclean-tags mostlyclean-generic
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
-mostlyclean: mostlyclean-recursive
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
-clean-am: clean-binPROGRAMS clean-compile clean-tags clean-generic \
- mostlyclean-am
+distclean: distclean-recursive
-clean: clean-recursive
+distclean-am: clean-am distclean-compile distclean-depend \
+ distclean-generic distclean-tags
-distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \
- distclean-generic clean-am
+dvi: dvi-recursive
-distclean: distclean-recursive
+dvi-am:
-maintainer-clean-am: maintainer-clean-binPROGRAMS \
- maintainer-clean-compile maintainer-clean-tags \
- maintainer-clean-generic distclean-am
- @echo "This command is intended for maintainers to use;"
- @echo "it deletes files that may require special tools to rebuild."
+info: info-recursive
+
+info-am:
+
+install-data-am: install-pkgdataDATA
+
+install-exec-am: install-binPROGRAMS
+
+install-man:
+
+installcheck-am:
maintainer-clean: maintainer-clean-recursive
-.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
-maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
-mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile install-data-recursive \
-uninstall-data-recursive install-exec-recursive \
-uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
-all-recursive check-recursive installcheck-recursive info-recursive \
-dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
-maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
-distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
-dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
-install-exec install-data-am install-data install-am install \
-uninstall-am uninstall all-redirect all-am all installdirs-am \
-installdirs mostlyclean-generic distclean-generic clean-generic \
-maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+mostlyclean-am: mostlyclean-compile mostlyclean-generic
+
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am \
+ uninstall-pkgdataDATA
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \
+ clean-binPROGRAMS clean-generic clean-recursive distclean \
+ distclean-compile distclean-depend distclean-generic \
+ distclean-recursive distclean-tags distdir dvi dvi-am \
+ dvi-recursive info info-am info-recursive install install-am \
+ install-binPROGRAMS install-data install-data-am \
+ install-data-recursive install-exec install-exec-am \
+ install-exec-recursive install-info-am install-info-recursive \
+ install-man install-pkgdataDATA install-recursive install-strip \
+ installcheck installcheck-am installdirs installdirs-am \
+ installdirs-recursive maintainer-clean maintainer-clean-generic \
+ maintainer-clean-recursive mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-recursive tags tags-recursive \
+ uninstall uninstall-am uninstall-binPROGRAMS uninstall-info-am \
+ uninstall-info-recursive uninstall-pkgdataDATA \
+ uninstall-recursive
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/gnu/usr.bin/texinfo/makeinfo/macro.texi b/gnu/usr.bin/texinfo/makeinfo/macro.texi
new file mode 100644
index 00000000000..8a3fe802392
--- /dev/null
+++ b/gnu/usr.bin/texinfo/makeinfo/macro.texi
@@ -0,0 +1,177 @@
+@c This file is included in makeinfo.texi.
+@c
+@ifinfo
+@comment Here are some useful examples of the macro facility.
+
+@c Simply insert the right version of the texinfo name.
+@macro texinfo{}
+TeXinfo
+@end macro
+
+@macro dfn{text}
+@dfn{\text\}
+@cpindex \text\
+@end macro
+
+@c Define a macro which expands to a pretty version of the name of the
+@c Makeinfo program.
+@macro makeinfo{}
+@code{Makeinfo}
+@end macro
+
+@c Define a macro which is used to define other macros. This one makes
+@c a macro which creates a node and gives it a sectioning command. Note
+@c that the created macro uses the original definition within the
+@c expansion text. This takes advantage of the non-recursion feature of
+@c macro execution.
+@macro node_define{orig-name}
+@macro \orig-name\{title}
+@node \title\
+@\orig-name\ \title\
+@end macro
+@end macro
+
+@c Now actually define a new set of sectioning commands.
+@node_define {chapter}
+@node_define {section}
+@node_define {subsection}
+@end ifinfo
+
+@chapter The Macro Facility
+
+This chapter describes the new macro facility.
+
+A @dfn{macro} is a command that you define in terms of other commands.
+It doesn't exist as a @texinfo{} command until you define it as part of
+the input file to @makeinfo{}. Once the command exists, it behaves much
+as any other @texinfo{} command. Macros are a useful way to ease the
+details and tedium of writing a `correct' info file. The following
+sections explain how to write and invoke macros.
+
+@menu
+* How to Use Macros in @texinfo{}::
+ How to use the macro facility.
+
+* Using Macros Recursively::
+ How to write a macro which does (or doesn't) recurse.
+
+* Using @texinfo{} Macros As Arguments::
+ Passing a macro as an argument.
+@end menu
+
+@section How to Use Macros in @texinfo{}
+
+Using macros in @texinfo{} is easy. First you define the macro. After
+that, the macro command is available as a normal @texinfo{} command.
+Here is what a definition looks like:
+
+@example
+@@macro @var{name}@{@var{arg1}, @var{@dots{}} @var{argn}@}
+@var{@texinfo{} commands@dots{}}
+@@end macro
+@end example
+
+The arguments that you specify that the macro takes are expanded with
+the actual parameters used when calling the macro if they are seen
+surrounded by backslashes. For example, here is a definition of
+@code{@@codeitem}, a macro which can be used wherever @code{@@item} can
+be used, but which surrounds its argument with @code{@@code@{@dots{}@}}.
+
+@example
+@@macro codeitem@{item@}
+@@item @@code@{\item\@}
+@@end macro
+@end example
+
+When the macro is expanded, all of the text between the @code{@@macro}
+and @code{@@end macro} is inserted into the document at the expansion
+point, with the actual parameters substituted for the named parameters.
+So, a call to the above macro might look like:
+
+@example
+@@codeitem@{Foo@}
+@end example
+
+and @makeinfo{} would execute the following code:
+
+@example
+@@item @@code@{Foo@}
+@end example
+
+A special case is made for macros which only take a single argument, and
+which are invoked without any brace characters (i.e.,
+@samp{@{}@dots{}@samp{@}}) surrounding an argument; the rest of the line
+is supplied as is as the sole argument to the macro. This special case
+allows one to redefine some standard @texinfo{} commands without
+modifying the input file. Along with the non-recursive action of macro
+invocation, one can easily redefine the sectioning commands to also
+provide index entries:
+
+@example
+@@macro chapter@{name@}
+@@chapter \name\
+@@findex \name\
+@@end macro
+@end example
+
+Thus, the text:
+
+@example
+@@chapter strlen
+@end example
+
+will expand to:
+
+@example
+@@chapter strlen
+@@findex strlen
+@end example
+
+@section Using Macros Recursively
+
+Normally, while a particular macro is executing, any call to that macro
+will be seen as a call to a builtin @texinfo{} command. This allows one
+to redefine a builtin @texinfo{} command as a macro, and then use that
+command within the definition of the macro itself. For example, one
+might wish to make sure that whereever a term was defined with
+@code{@@dfn@{@dots{}@}}, the location of the definition would appear
+in the concept index for the manual. Here is a macro which redefines
+@code{@@dfn} to do just that:
+
+@example
+@@macro dfn@{text@}
+@@dfn@{\text\@}
+@@cpindex \text\
+@@end macro
+@end example
+
+Note that we used the builtin @texinfo{} command @code{@@dfn} within our
+overriding macro definition.
+
+This behaviour itself can be overridden for macro execution by writing a
+special @dfn{macro control command} in the definition of the macro. The
+command is considered special because it doesn't affect the output text
+directly, rather, it affects the way in which the macro is defined. One
+such special command is @code{@@allow-recursion}.
+
+@example
+@@macro silly@{arg@}
+@@allow-recursion
+\arg\
+@@end macro
+@end example
+
+Now @code{@@silly} is a macro that can be used within a call to itself:
+
+@example
+This text @@silly@{@@silly@{some text@}@} is ``some text''.
+@end example
+
+@section Using @texinfo{} Macros As Arguments
+
+@printindex cp
+How to use @texinfo{} macros as arguments to other @texinfo{} macros.
+
+@bye
+
+
diff --git a/gnu/usr.bin/texinfo/makeinfo/makeinfo.c b/gnu/usr.bin/texinfo/makeinfo/makeinfo.c
index 44ad466c51c..d0aab040ddb 100644
--- a/gnu/usr.bin/texinfo/makeinfo/makeinfo.c
+++ b/gnu/usr.bin/texinfo/makeinfo/makeinfo.c
@@ -1,7 +1,7 @@
/* makeinfo -- convert Texinfo source into other formats.
- $Id: makeinfo.c,v 1.6 2000/02/09 02:18:41 espie Exp $
+ $Id: makeinfo.c,v 1.7 2002/06/10 13:51:03 espie Exp $
- Copyright (C) 1987, 92, 93, 94, 95, 96, 97, 98, 99
+ Copyright (C) 1987, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 01, 02
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -34,34 +34,7 @@
#include "macro.h"
#include "node.h"
#include "toc.h"
-
-/* We'd like to take advantage of _doprnt if it's around, a la error.c,
- but then we'd have no VA_SPRINTF. */
-#if HAVE_VPRINTF
-# if __STDC__
-# include <stdarg.h>
-# define VA_START(args, lastarg) va_start(args, lastarg)
-# else
-# include <varargs.h>
-# define VA_START(args, lastarg) va_start(args)
-# endif
-# define VA_FPRINTF(file, fmt, ap) vfprintf (file, fmt, ap)
-# define VA_SPRINTF(str, fmt, ap) vsprintf (str, fmt, ap)
-#else /* not HAVE_VPRINTF */
-# define VA_START(args, lastarg)
-# define va_alist a1, a2, a3, a4, a5, a6, a7, a8
-# define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
-# define va_end(args)
-#endif
-
-/* DJGPP supports /dev/null, which is okay for Unix aficionados,
- shell scripts and Makefiles, but interactive DOS die-hards
- would probably want to have NUL as well. */
-#ifdef __DJGPP__
-# define ALSO_NULL_DEVICE "NUL"
-#else
-# define ALSO_NULL_DEVICE ""
-#endif
+#include "xml.h"
/* You can change some of the behavior of Makeinfo by changing the
following defines: */
@@ -93,6 +66,7 @@ char *output_filename = NULL;
/* Name of the output file that the user elected to pass on the command line.
Such a name overrides any name found with the @setfilename command. */
char *command_output_filename = NULL;
+static char *save_command_output_filename = NULL;
/* Flags which control initial output string for xrefs. */
int px_ref_flag = 0;
@@ -157,6 +131,9 @@ int insertion_paragraph_closed = 0;
/* Nonzero means attempt to make all of the lines have fill_column width. */
int do_justification = 0;
+/* Nonzero means don't replace whitespace with &nbsp; in HTML mode. */
+int in_html_elt = 0;
+
typedef struct brace_element
{
struct brace_element *next;
@@ -262,7 +239,38 @@ error (format, va_alist)
putc ('\n', stderr);
}
-/* Just like error (), but print the line number as well. */
+/* Just like error (), but print the input file and line number as well. */
+void
+#if defined (VA_FPRINTF) && __STDC__
+file_line_error (char *infile, int lno, char *format, ...)
+#else
+file_line_error (infile, lno, format, va_alist)
+ char *infile;
+ int lno;
+ char *format;
+ va_dcl
+#endif
+{
+#ifdef VA_FPRINTF
+ va_list ap;
+#endif
+
+ remember_error ();
+ fprintf (stderr, "%s:%d: ", infile, lno);
+
+ VA_START (ap, format);
+#ifdef VA_FPRINTF
+ VA_FPRINTF (stderr, format, ap);
+#else
+ fprintf (stderr, format, a1, a2, a3, a4, a5, a6, a7, a8);
+#endif /* not VA_FPRINTF */
+ va_end (ap);
+
+ fprintf (stderr, ".\n");
+}
+
+/* Just like file_line_error (), but take the input file and the line
+ number from global variables. */
void
#if defined (VA_FPRINTF) && __STDC__
line_error (char *format, ...)
@@ -362,76 +370,120 @@ usage (exit_value)
fprintf (stderr, _("Try `%s --help' for more information.\n"), progname);
else
{
- printf (_("Usage: %s [OPTION]... TEXINFO-FILE...\n\
-\n\
-Translate Texinfo source documentation to various other formats:\n\
-Info files suitable for reading online with Emacs or standalone GNU Info\n\
-(by default); plain text (with --no-headers); or HTML (with --html).\n\
-\n\
-Options:\n\
- --commands-in-node-names allow @ commands in node names.\n\
- -D VAR define a variable, as with @set.\n\
- -E, --macro-expand FILE output macro-expanded source to FILE.\n\
- --error-limit=NUM quit after NUM errors (default %d).\n\
- --fill-column=NUM break Info lines at NUM characters (default %d).\n\
- --footnote-style=STYLE output footnotes according to STYLE:\n\
- `separate' to place footnotes in their own node,\n\
- `end' to place the footnotes at the end of the\n\
- node in which they are defined (the default).\n\
- --force preserve output even if errors.\n\
- --help display this help and exit.\n\
- --html output HTML rather than Info format;\n\
- -I DIR append DIR to the @include search path.\n\
- --ifhtml process @ifhtml and @html text even when not\n\
- generating HTML.\n\
- --ifinfo process @ifinfo text even when generating HTML.\n\
- --iftex process @iftex and @tex text.\n\
- implies --no-split.\n"),
- progname, max_error_level, fill_column);
+ printf (_("Usage: %s [OPTION]... TEXINFO-FILE...\n"), progname);
+ printf ("\n");
+
+ puts (_("\
+Translate Texinfo source documentation to various other formats, by default\n\
+Info files suitable for reading online with Emacs or standalone GNU Info.\n"));
+
printf (_("\
- --no-headers suppress Info node separators and Node: lines and\n\
- write to standard output without --output.\n\
- --no-ifhtml do not process @ifhtml and @html text.\n\
- --no-ifinfo do not process @ifinfo text.\n\
- --no-iftex do not process @iftex and @tex text.\n\
- --no-split suppress splitting of large Info output files or\n\
- generation of one HTML file per node.\n\
- --no-validate suppress node cross-reference validation.\n\
- --no-warn suppress warnings (but not errors).\n\
- --number-sections include chapter, section, etc. numbers in output.\n\
- -o, --output=FILE output to FILE, ignoring any @setfilename.\n\
- -P DIR prepend DIR to the @include search path.\n\
- --paragraph-indent=VAL indent Info paragraphs by VAL spaces (default %d).\n\
- if VAL is `none', do not indent;\n\
- if VAL is `asis', preserve existing indentation.\n\
- --reference-limit=NUM warn about at most NUM references (default %d).\n\
- -U VAR undefine a variable, as with @clear.\n\
- -v, --verbose explain what is being done.\n\
- --version display version information and exit.\n\
-"),
- paragraph_start_indent, reference_warning_limit);
+General options:\n\
+ --error-limit=NUM quit after NUM errors (default %d).\n\
+ --force preserve output even if errors.\n\
+ --help display this help and exit.\n\
+ --no-validate suppress node cross-reference validation.\n\
+ --no-warn suppress warnings (but not errors).\n\
+ --reference-limit=NUM warn about at most NUM references (default %d).\n\
+ -v, --verbose explain what is being done.\n\
+ --version display version information and exit.\n"),
+ max_error_level, reference_warning_limit);
+ printf ("\n");
+
+ /* xgettext: no-wrap */
+ puts (_("\
+Output format selection (default is to produce Info):\n\
+ --docbook output DocBook rather than Info.\n\
+ --html output HTML rather than Info.\n\
+ --xml output XML (TexinfoML) rather than Info.\n\
+"));
+
+ puts (_("\
+General output options:\n\
+ -E, --macro-expand FILE output macro-expanded source to FILE.\n\
+ ignoring any @setfilename.\n\
+ --no-headers suppress node separators, Node: lines, and menus\n\
+ from Info output (thus producing plain text)\n\
+ or from HTML (thus producing shorter output);\n\
+ also, write to standard output by default.\n\
+ --no-split suppress splitting of Info or HTML output,\n\
+ generate only one output file.\n\
+ --number-sections output chapter and sectioning numbers.\n\
+ -o, --output=FILE output to FILE (directory if split HTML),\n\
+"));
+
+ printf (_("\
+Options for Info and plain text:\n\
+ --enable-encoding output accented and special characters in\n\
+ Info output based on @documentencoding.\n\
+ --fill-column=NUM break Info lines at NUM characters (default %d).\n\
+ --footnote-style=STYLE output footnotes in Info according to STYLE:\n\
+ `separate' to put them in their own node;\n\
+ `end' to put them at the end of the node\n\
+ in which they are defined (default).\n\
+ --paragraph-indent=VAL indent Info paragraphs by VAL spaces (default %d).\n\
+ If VAL is `none', do not indent; if VAL is\n\
+ `asis', preserve existing indentation.\n\
+ --split-size=NUM split Info files at size NUM (default %d).\n"),
+ fill_column, paragraph_start_indent,
+ DEFAULT_SPLIT_SIZE);
}
-
- puts (_("\n\
-The defaults for the @if... conditionals depend on the output format:\n\
-if generating HTML, --ifhtml is on and the others are off;\n\
-if generating Info or plain text, --ifinfo is on and the others are off.\n\
-\n\
+ printf ("\n");
+
+ puts (_("\
+Input file options:\n\
+ --commands-in-node-names allow @ commands in node names.\n\
+ -D VAR define the variable VAR, as with @set.\n\
+ -I DIR append DIR to the @include search path.\n\
+ -P DIR prepend DIR to the @include search path.\n\
+ -U VAR undefine the variable VAR, as with @clear.\n\
+"));
+
+ puts (_("\
+Conditional processing in input:\n\
+ --ifhtml process @ifhtml and @html even if not generating HTML.\n\
+ --ifinfo process @ifinfo even if not generating Info.\n\
+ --ifplaintext process @ifplaintext even if not generating plain text.\n\
+ --iftex process @iftex and @tex; implies --no-split.\n\
+ --no-ifhtml do not process @ifhtml and @html text.\n\
+ --no-ifinfo do not process @ifinfo text.\n\
+ --no-ifplaintext do not process @ifplaintext text.\n\
+ --no-iftex do not process @iftex and @tex text.\n\
+"));
+
+ puts (_("\
+ The defaults for the @if... conditionals depend on the output format:\n\
+ if generating HTML, --ifhtml is on and the others are off;\n\
+ if generating Info, --ifinfo is on and the others are off;\n\
+ if generating plain text, --ifplaintext is on and the others are off;\n\
+"));
+
+ fputs (_("\
Examples:\n\
- makeinfo foo.texi write Info to foo's @setfilename\n\
- makeinfo --html foo.texi write HTML to foo's @setfilename\n\
- makeinfo --no-headers -o - foo.texi write plain text to standard output\n\
- makeinfo --number-sections foo.texi write Info with numbered sections\n\
- makeinfo --no-split foo.texi write one Info file however big\n\
+ makeinfo foo.texi write Info to foo's @setfilename\n\
+ makeinfo --html foo.texi write HTML to @setfilename\n\
+ makeinfo --xml foo.texi write XML to @setfilename\n\
+ makeinfo --docbook foo.texi write DocBook XML to @setfilename\n\
+ makeinfo --no-headers foo.texi write plain text to standard output\n\
\n\
+ makeinfo --html --no-headers foo.texi write html without node lines, menus\n\
+ makeinfo --number-sections foo.texi write Info with numbered sections\n\
+ makeinfo --no-split foo.texi write one Info file however big\n\
+"), stdout);
+
+ puts (_("\n\
Email bug reports to bug-texinfo@gnu.org,\n\
-general questions and discussion to help-texinfo@gnu.org."));
+general questions and discussion to help-texinfo@gnu.org.\n\
+Texinfo home page: http://www.gnu.org/software/texinfo/"));
+
xexit (exit_value);
}
struct option long_options[] =
{
{ "commands-in-node-names", 0, &expensive_validation, 1 },
+ { "docbook", 0, 0, 'd' },
+ { "enable-encoding", 0, &enable_encoding, 1 },
{ "error-limit", 1, 0, 'e' },
{ "fill-column", 1, 0, 'f' },
{ "footnote-style", 1, 0, 's' },
@@ -440,11 +492,13 @@ struct option long_options[] =
{ "html", 0, 0, 'w' },
{ "ifhtml", 0, &process_html, 1 },
{ "ifinfo", 0, &process_info, 1 },
+ { "ifplaintext", 0, &process_plaintext, 1 },
{ "iftex", 0, &process_tex, 1 },
{ "macro-expand", 1, 0, 'E' },
{ "no-headers", 0, &no_headers, 1 },
{ "no-ifhtml", 0, &process_html, 0 },
{ "no-ifinfo", 0, &process_info, 0 },
+ { "no-ifplaintext", 0, &process_plaintext, 0 },
{ "no-iftex", 0, &process_tex, 0 },
{ "no-number-footnotes", 0, &number_footnotes, 0 },
{ "no-number-sections", 0, &number_sections, 0 },
@@ -457,8 +511,10 @@ struct option long_options[] =
{ "output", 1, 0, 'o' },
{ "paragraph-indent", 1, 0, 'p' },
{ "reference-limit", 1, 0, 'r' },
+ { "split-size", 1, 0, 'S'},
{ "verbose", 0, &verbose_mode, 1 },
{ "version", 0, 0, 'V' },
+ { "xml", 0, 0, 'x' },
{NULL, 0, NULL, 0}
};
@@ -487,7 +543,7 @@ main (argc, argv)
textdomain (PACKAGE);
/* Parse argument flags from the input line. */
- while ((c = getopt_long (argc, argv, "D:e:E:f:hI:o:p:P:r:s:U:vV:w",
+ while ((c = getopt_long (argc, argv, "D:de:E:f:hI:o:p:P:r:s:U:vV:wx",
long_options, &ind)) != EOF)
{
if (c == 0 && long_options[ind].flag == 0)
@@ -501,13 +557,19 @@ main (argc, argv)
handle_variable_internal ((c == 'D') ? SET : CLEAR, optarg);
break;
+ case 'd': /* --docbook */
+ splitting = 0;
+ xml = 1;
+ docbook = 1;
+ break;
+
case 'e': /* --error-limit */
if (sscanf (optarg, "%d", &max_error_level) != 1)
{
fprintf (stderr,
_("%s: %s arg must be numeric, not `%s'.\n"),
"--error-limit", progname, optarg);
- usage (stderr, 1);
+ usage (1);
}
break;
@@ -552,6 +614,7 @@ main (argc, argv)
case 'o': /* --output */
command_output_filename = xstrdup (optarg);
+ save_command_output_filename = command_output_filename;
break;
case 'p': /* --paragraph-indent */
@@ -606,6 +669,16 @@ main (argc, argv)
footnote_style_preset = 1;
break;
+ case 'S': /* --split-size */
+ if (sscanf (optarg, "%d", &split_size) != 1)
+ {
+ fprintf (stderr,
+ _("%s: %s arg must be numeric, not `%s'.\n"),
+ "--split-size", progname, optarg);
+ usage (1);
+ }
+ break;
+
case 'v':
verbose_mode++;
break;
@@ -617,17 +690,20 @@ main (argc, argv)
There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\
For more information about these matters, see the files named COPYING.\n"),
- "1999");
+ "2002");
exit (0);
break;
case 'w': /* --html */
html = 1;
process_html = 1;
- process_info = 0;
- splitting = 0; /* too complicated for now */
break;
+ case 'x': /* --xml */
+ splitting = 0;
+ xml = 1;
+ break;
+
case '?':
usage (1);
break;
@@ -666,7 +742,19 @@ For more information about these matters, see the files named COPYING.\n"),
if (!command_output_filename)
command_output_filename = xstrdup ("-");
}
+
+ if (process_info == -1)
+ { /* no explicit --[no-]ifinfo option, so we'll do @ifinfo
+ if we're generating info or (for compatibility) plain text. */
+ process_info = !html && !xml;
+ }
+ if (process_plaintext == -1)
+ { /* no explicit --[no-]ifplaintext option, so we'll do @ifplaintext
+ if we're generating plain text. */
+ process_plaintext = no_headers && !html && !xml;
+ }
+
if (verbose_mode)
print_version_info ();
@@ -971,6 +1059,7 @@ get_rest_of_line (expand, string)
int expand;
char **string;
{
+ xml_no_para ++;
if (expand)
{
char *tem;
@@ -993,6 +1082,7 @@ get_rest_of_line (expand, string)
line_number++;
input_text_offset++;
}
+ xml_no_para --;
}
/* Backup the input pointer to the previous character, keeping track
@@ -1020,10 +1110,21 @@ get_until_in_braces (match, string)
for (i = input_text_offset; i < input_text_length; i++)
{
- if (input_text[i] == '{')
+ if (i < input_text_length - 1 && input_text[i] == '@')
+ {
+ i++; /* skip commands like @, and @{ */
+ continue;
+ }
+ else if (input_text[i] == '{')
brace++;
else if (input_text[i] == '}')
- brace--;
+ {
+ brace--;
+ /* If looking for a brace, don't stop at the interior brace,
+ like after "baz" in "@foo{something @bar{baz} more}". */
+ if (brace == 0)
+ continue;
+ }
else if (input_text[i] == '\n')
line_number++;
@@ -1191,6 +1292,90 @@ convert_from_file (name)
convert_from_loaded_file (name);
}
+/* Given OUTPUT_FILENAME == ``/foo/bar/baz.html'', return
+ "/foo/bar/baz/baz.html". This routine is called only if html && splitting.
+
+ Split html output goes into the subdirectory of the toplevel
+ filename, without extension. For example:
+ @setfilename foo.info
+ produces output in files foo/index.html, foo/second-node.html, ...
+
+ But if the user said -o foo.whatever on the cmd line, then use
+ foo.whatever unchanged. */
+
+static char *
+insert_toplevel_subdirectory (output_filename)
+ char *output_filename;
+{
+ char *dir, *subdir, *base, *basename, *p;
+ char buf[PATH_MAX];
+ struct stat st;
+ static const char index_name[] = "index.html";
+ const int index_len = sizeof (index_name) - 1;
+
+ strcpy (buf, output_filename);
+ dir = pathname_part (buf);
+ base = filename_part (buf);
+ basename = xstrdup (base); /* remember real @setfilename name */
+ p = dir + strlen (dir) - 1;
+ if (p > dir && IS_SLASH (*p))
+ *p = 0;
+ p = strrchr (base, '.');
+ if (p)
+ *p = 0;
+
+ /* Split html output goes into subdirectory of toplevel name. */
+ subdir = "";
+ if (FILENAME_CMP (base, filename_part (dir)) != 0)
+ {
+ if (save_command_output_filename
+ && STREQ (output_filename, save_command_output_filename))
+ subdir = basename; /* from user, use unchanged */
+ else
+ subdir = base; /* implicit, omit suffix */
+ }
+
+ free (output_filename);
+ output_filename = xmalloc (strlen (dir) + 1
+ + strlen (basename) + 1
+ + index_len
+ + 1);
+ strcpy (output_filename, dir);
+ if (strlen (dir))
+ strcat (output_filename, "/");
+ strcat (output_filename, subdir);
+ if (mkdir (output_filename, 0777) == -1 && errno != EEXIST
+ /* output_filename might exist, but be a non-directory. */
+ || (stat (output_filename, &st) == 0 && !S_ISDIR (st.st_mode)))
+ { /* that failed, try subdir name with .html */
+ strcpy (output_filename, dir);
+ if (strlen (dir))
+ strcat (output_filename, "/");
+ strcat (output_filename, basename);
+ if (mkdir (output_filename, 0777) == -1)
+ {
+ char *errmsg = strerror (errno);
+
+ if ((errno == EEXIST
+#ifdef __MSDOS__
+ || errno == EACCES
+#endif
+ )
+ && (stat (output_filename, &st) == 0 && !S_ISDIR (st.st_mode)))
+ errmsg = _("File exists, but is not a directory");
+ line_error (_("Can't create directory `%s': %s"),
+ output_filename, errmsg);
+ exit (1);
+ }
+ strcat (output_filename, "/");
+ }
+ else if (strlen (subdir))
+ strcat (output_filename, "/");
+ strcat (output_filename, index_name);
+ return output_filename;
+}
+
+/* FIXME: this is way too hairy */
void
convert_from_loaded_file (name)
char *name;
@@ -1260,12 +1445,15 @@ convert_from_loaded_file (name)
if (!command_output_filename)
{
get_until ("\n", &output_filename); /* read rest of line */
- if (html)
- { /* Change any extension to .html. */
+ if (xml && !docbook)
+ xml_begin_document (output_filename);
+ if (html || xml)
+ { /* Change any extension to .html or .xml. */
char *html_name, *directory_part, *basename_part, *temp;
canon_white (output_filename);
directory_part = pathname_part (output_filename);
+
basename_part = filename_part (output_filename);
/* Zap any existing extension. */
@@ -1278,7 +1466,7 @@ convert_from_loaded_file (name)
+ strlen (basename_part) + 6);
strcpy (html_name, directory_part);
strcat (html_name, basename_part);
- strcat (html_name, ".html");
+ strcat (html_name, html ? ".html" : ".xml");
/* Replace name from @setfilename with the html name. */
free (output_filename);
@@ -1293,17 +1481,19 @@ convert_from_loaded_file (name)
input_text_offset = 0;
real_output_filename = output_filename = command_output_filename;
- command_output_filename = NULL;
+ command_output_filename = NULL; /* for included files or whatever */
}
canon_white (output_filename);
+ toplevel_output_filename = xstrdup (output_filename);
if (real_output_filename && strcmp (real_output_filename, "-") == 0)
{
if (macro_expansion_filename
&& strcmp (macro_expansion_filename, "-") == 0)
{
- fprintf (stderr, _("%s: Skipping macro expansion to stdout as Info output is going there.\n"),
+ fprintf (stderr,
+ _("%s: Skipping macro expansion to stdout as Info output is going there.\n"),
progname);
macro_expansion_output_stream = NULL;
}
@@ -1313,7 +1503,16 @@ convert_from_loaded_file (name)
}
else
{
- if (!real_output_filename)
+ if (html && splitting)
+ {
+ if (FILENAME_CMP (output_filename, NULL_DEVICE) == 0
+ || FILENAME_CMP (output_filename, ALSO_NULL_DEVICE) == 0)
+ splitting = 0;
+ else
+ output_filename = insert_toplevel_subdirectory (output_filename);
+ real_output_filename = xstrdup (output_filename);
+ }
+ else if (!real_output_filename)
real_output_filename = expand_filename (output_filename, name);
else
real_output_filename = xstrdup (real_output_filename);
@@ -1325,7 +1524,10 @@ convert_from_loaded_file (name)
if (verbose_mode)
printf (_("Making %s file `%s' from `%s'.\n"),
- no_headers ? "text" : (html ? "HTML" : "info"),
+ no_headers ? "text"
+ : html ? "HTML"
+ : xml ? "XML"
+ : "info",
output_filename, input_filename);
if (output_stream == NULL)
@@ -1336,6 +1538,7 @@ convert_from_loaded_file (name)
/* Make the displayable filename from output_filename. Only the base
portion of the filename need be displayed. */
+ flush_output (); /* in case there was no @bye */
if (output_stream != stdout)
pretty_output_filename = filename_part (output_filename);
else
@@ -1354,12 +1557,15 @@ convert_from_loaded_file (name)
}
/* html fixxme: should output this as trailer on first page. */
- if (!no_headers && !html)
+ if (!no_headers && !html && !xml)
add_word_args (_("This is %s, produced by makeinfo version %s from %s.\n"),
output_filename, VERSION, input_filename);
close_paragraph ();
reader_loop ();
+ if (xml)
+ xml_end_document ();
+
finished:
discard_insertions (0);
@@ -1398,6 +1604,7 @@ finished:
close_paragraph ();
}
+ flush_output (); /* in case there was no @bye */
if (output_stream != stdout)
fclose (output_stream);
@@ -1410,7 +1617,7 @@ finished:
toc_update ();
if (splitting && !html && (!errors_printed || force))
- split_file (real_output_filename, 0);
+ split_file (real_output_filename, split_size);
else if (errors_printed
&& !force
&& strcmp (real_output_filename, "-") != 0
@@ -1517,7 +1724,14 @@ handle_menu_entry ()
in_paragraph = 0;
}
- add_word ("<li><a href=\"");
+ add_word ("<li><a");
+ if (next_menu_item_number <= 9)
+ {
+ add_word(" accesskey=");
+ add_word_args("%d", next_menu_item_number);
+ next_menu_item_number++;
+ }
+ add_word (" href=\"");
string = expansion (tem, 0);
add_anchor_name (string, 1);
add_word ("\">");
@@ -1542,6 +1756,10 @@ handle_menu_entry ()
input_text_offset++; /* discard the second colon or the period */
add_word (": ");
}
+ else if (xml && tem)
+ {
+ xml_start_menu_entry (tem);
+ }
else if (tem)
{ /* For Info output, we can just use the input and the main case in
reader_loop where we output what comes in. Just move off the *
@@ -1774,6 +1992,8 @@ reader_loop ()
case '<':
if (html && escape_html)
add_word ("&lt;");
+ else if (xml)
+ xml_insert_entity ("lt");
else
add_char (character);
input_text_offset++;
@@ -1782,6 +2002,8 @@ reader_loop ()
case '>':
if (html && escape_html)
add_word ("&gt;");
+ else if (xml)
+ xml_insert_entity ("gt");
else
add_char (character);
input_text_offset++;
@@ -1799,8 +2021,16 @@ reader_loop ()
we can ignore its partner. */
if (!only_macro_expansion)
{
- line_error (_("Misplaced %c"), '{');
- remember_brace (misplaced_brace);
+ if (!STREQ (command, "math"))
+ {
+ line_error (_("Misplaced %c"), '{');
+ remember_brace (misplaced_brace);
+ }
+ else
+ { /* We don't mind `extra' braces inside @math. */
+ extern void cm_no_op ();
+ remember_brace (cm_no_op);
+ }
/* remember_brace advances input_text_offset. */
break;
}
@@ -1851,7 +2081,7 @@ remember_brace_1 (proc, position)
BRACE_ELEMENT *new = xmalloc (sizeof (BRACE_ELEMENT));
new->next = brace_stack;
new->proc = proc;
- new->command = xstrdup (command);
+ new->command = command ? xstrdup (command) : "";
new->pos = position;
new->line = line_number;
new->in_fixed_width_font = in_fixed_width_font;
@@ -1933,12 +2163,11 @@ discard_braces ()
if (brace_stack->proc != misplaced_brace)
{
char *proc_name;
- int temp_line_number = line_number;
- line_number = brace_stack->line;
proc_name = find_proc_name (brace_stack->proc);
- line_error (_("%c%s missing close brace"), COMMAND_PREFIX, proc_name);
- line_number = temp_line_number;
+ file_line_error (input_filename, brace_stack->line,
+ _("%c%s missing close brace"), COMMAND_PREFIX,
+ proc_name);
pop_and_call_brace ();
}
else
@@ -2018,12 +2247,30 @@ add_word (string)
add_char (*string++);
}
+/* Like add_word, but inhibits conversion of whitespace into &nbsp;.
+ Use this to output HTML directives with embedded blanks, to make
+ them @w-safe. */
+void
+add_html_elt (string)
+ char *string;
+{
+ in_html_elt++;
+ add_word (string);
+ in_html_elt--;
+}
+
/* Add the character to the current paragraph. If filling_enabled is
nonzero, then do filling as well. */
void
add_char (character)
int character;
{
+ if (xml)
+ {
+ xml_add_char (character);
+ return;
+ }
+
/* If we are avoiding outputting headers, and we are currently
in a menu, then simply return. But if we're only expanding macros,
then we're being called from glean_node_from_menu to try to
@@ -2044,9 +2291,11 @@ add_char (character)
}
}
- if (non_splitting_words && strchr (" \t\n", character))
+ if (non_splitting_words
+ && !(html && in_html_elt)
+ && strchr (" \t\n", character))
{
- if (html)
+ if (html || docbook)
{ /* Seems cleaner to use &nbsp; than an 8-bit char. */
add_word ("&nbsp");
character = ';';
@@ -2117,6 +2366,14 @@ add_char (character)
}
}
+ /* This is sad, but it seems desirable to not force any
+ particular order on the front matter commands. This way,
+ the document can do @settitle, @documentlanguage, etc, in
+ any order and with any omissions, and we'll still output
+ the html <head> `just in time'. */
+ if (!executing_string && html && !html_output_head_p)
+ html_output_head ();
+
if (!paragraph_is_open)
{
start_paragraph ();
@@ -2263,13 +2520,6 @@ void
insert (character)
int character;
{
- /* This is sad, but it seems desirable to not force any particular
- order on the front matter commands. This way, the document can do
- @settitle, @documentlanguage, etc, in any order and with any
- omissions, and we'll still output the html <head> `just in time'. */
- if (!executing_string && html && !html_output_head_p)
- html_output_head ();
-
output_paragraph[output_paragraph_offset++] = character;
if (output_paragraph_offset == paragraph_buffer_len)
{
@@ -2701,7 +2951,68 @@ cm_xref (arg)
char *arg5 = get_xref_token (0);
char *tem;
- if (html)
+ /* "@xref{,Foo,, Bar, Baz} is not valid usage of @xref. The
+ first argument must never be blank." --rms.
+ We hereby comply by disallowing such constructs. */
+ if (!*arg1)
+ line_error (_("First argument to cross-reference may not be empty"));
+
+ if (xml && docbook)
+ {
+ if (!*arg4 && !*arg5)
+ {
+ char *arg1_id = xml_id (arg1);
+ if (*arg2)
+ {
+ xml_insert_element_with_attribute (XREFNODENAME, START,
+ "linkend=\"%s\"", arg1_id);
+ free (arg1_id);
+ if (*arg2)
+ execute_string (arg2);
+ xml_insert_element (XREFNODENAME, END);
+ }
+ else
+ {
+ xml_insert_element_with_attribute (XREF, START,
+ "linkend=\"%s\"", arg1_id);
+ free (arg1_id);
+ xml_pop_current_element ();
+ }
+ }
+ }
+ else if (xml)
+ {
+ xml_insert_element (XREF, START);
+ xml_insert_element (XREFNODENAME, START);
+ execute_string (arg1);
+ xml_insert_element (XREFNODENAME, END);
+ if (*arg2)
+ {
+ xml_insert_element (XREFINFONAME, START);
+ execute_string (arg2);
+ xml_insert_element (XREFINFONAME, END);
+ }
+ if (*arg3)
+ {
+ xml_insert_element (XREFPRINTEDDESC, START);
+ execute_string (arg3);
+ xml_insert_element (XREFPRINTEDDESC, END);
+ }
+ if (*arg4)
+ {
+ xml_insert_element (XREFINFOFILE, START);
+ execute_string (arg4);
+ xml_insert_element (XREFINFOFILE, END);
+ }
+ if (*arg5)
+ {
+ xml_insert_element (XREFPRINTEDNAME, START);
+ execute_string (arg5);
+ xml_insert_element (XREFPRINTEDNAME, END);
+ }
+ xml_insert_element (XREF, END);
+ }
+ else if (html)
{
if (!ref_flag)
add_word_args ("%s", px_ref_flag ? _("see ") : _("See "));
@@ -2709,109 +3020,126 @@ cm_xref (arg)
else
add_word_args ("%s", px_ref_flag ? "*note " : "*Note ");
- if (*arg5 || *arg4)
- {
- char *node_name;
-
- if (!*arg2)
- {
- if (*arg3)
- node_name = arg3;
- else
- node_name = arg1;
- }
- else
- node_name = arg2;
-
- if (html)
- {
- /* html fixxme: revisit this; external node name not
- much use to us with numbered nodes. */
- add_word ("<a href=");
- execute_string ("\"%s.html#", arg4);
- /* Do not collapse -- to -, etc., in references. */
- in_fixed_width_font++;
- tem = expansion (node_name, 0);
- in_fixed_width_font--;
- add_escaped_anchor_name (tem);
- free (tem);
- add_word ("\">");
- execute_string ("%s", arg1);
- add_word ("</a>");
- }
- else
- {
- execute_string ("%s:", node_name);
- in_fixed_width_font++;
- execute_string (" (%s)%s%s", arg4, arg1, px_ref_flag ? "." : "");
- in_fixed_width_font--;
- }
-
- /* Free all of the arguments found. */
- if (arg1) free (arg1);
- if (arg2) free (arg2);
- if (arg3) free (arg3);
- if (arg4) free (arg4);
- if (arg5) free (arg5);
- return;
- }
- else
- remember_node_reference (arg1, line_number, followed_reference);
-
- if (*arg3)
- {
- if (html)
- {
- add_word ("<a href=\"");
- in_fixed_width_font++;
- tem = expansion (arg1, 0);
- in_fixed_width_font--;
- add_anchor_name (tem, 1);
- free (tem);
- add_word ("\">");
- execute_string ("%s", *arg2 ? arg2 : arg3);
- add_word ("</a>");
- }
- else
- {
- execute_string ("%s:", *arg2 ? arg2 : arg3);
- in_fixed_width_font++;
- execute_string (" %s%s", arg1, px_ref_flag ? "." : "");
- in_fixed_width_font--;
- }
- }
- else
- {
- if (html)
- {
- add_word ("<a href=\"");
- in_fixed_width_font++;
- tem = expansion (arg1, 0);
- in_fixed_width_font--;
- add_anchor_name (tem, 1);
- free (tem);
- add_word ("\">");
- execute_string ("%s", *arg2 ? arg2 : arg1);
- add_word ("</a>");
- }
- else
- {
- if (*arg2)
- {
- execute_string ("%s:", arg2);
- in_fixed_width_font++;
- execute_string (" %s%s", arg1, px_ref_flag ? "." : "");
- in_fixed_width_font--;
- }
- else
- {
- in_fixed_width_font++;
- execute_string ("%s::", arg1);
- in_fixed_width_font--;
- }
- }
- }
-
+ if (!xml)
+ {
+ if (*arg5 || *arg4)
+ {
+ /* arg1 - node name
+ arg2 - reference name
+ arg3 - title or topic (and reference name if arg2 is NULL)
+ arg4 - info file name
+ arg5 - printed manual title */
+ char *ref_name;
+
+ if (!*arg2)
+ {
+ if (*arg3)
+ ref_name = arg3;
+ else
+ ref_name = arg1;
+ }
+ else
+ ref_name = arg2;
+
+ if (html)
+ {
+ /* html fixxme: revisit this; external node name not
+ much use to us with numbered nodes. */
+ add_html_elt ("<a href=");
+ /* Note that if we are splitting, and the referenced
+ tag is an anchor rather than a node, we will
+ produce a reference to a file whose name is
+ derived from the anchor name. However, only
+ nodes create files, so we are referencing a
+ non-existent file. cm_anchor, which see, deals
+ with that problem. */
+ if (splitting)
+ execute_string ("\"../%s/", arg4);
+ else
+ execute_string ("\"%s.html", arg4);
+ /* Do not collapse -- to -, etc., in references. */
+ in_fixed_width_font++;
+ tem = expansion (arg1, 0); /* expand @-commands in node */
+ in_fixed_width_font--;
+ add_anchor_name (tem, 1);
+ free (tem);
+ add_word ("\">");
+ execute_string ("%s", ref_name);
+ add_word ("</a>");
+ }
+ else
+ {
+ execute_string ("%s:", ref_name);
+ in_fixed_width_font++;
+ execute_string (" (%s)%s%s", arg4, arg1, px_ref_flag ? "." : "");
+ in_fixed_width_font--;
+ }
+
+ /* Free all of the arguments found. */
+ if (arg1) free (arg1);
+ if (arg2) free (arg2);
+ if (arg3) free (arg3);
+ if (arg4) free (arg4);
+ if (arg5) free (arg5);
+ return;
+ }
+ else
+ remember_node_reference (arg1, line_number, followed_reference);
+
+ if (*arg3)
+ {
+ if (html)
+ {
+ add_html_elt ("<a href=\"");
+ in_fixed_width_font++;
+ tem = expansion (arg1, 0);
+ in_fixed_width_font--;
+ add_anchor_name (tem, 1);
+ free (tem);
+ add_word ("\">");
+ execute_string ("%s", *arg2 ? arg2 : arg3);
+ add_word ("</a>");
+ }
+ else
+ {
+ execute_string ("%s:", *arg2 ? arg2 : arg3);
+ in_fixed_width_font++;
+ execute_string (" %s%s", arg1, px_ref_flag ? "." : "");
+ in_fixed_width_font--;
+ }
+ }
+ else
+ {
+ if (html)
+ {
+ add_html_elt ("<a href=\"");
+ in_fixed_width_font++;
+ tem = expansion (arg1, 0);
+ in_fixed_width_font--;
+ add_anchor_name (tem, 1);
+ free (tem);
+ add_word ("\">");
+ execute_string ("%s", *arg2 ? arg2 : arg1);
+ add_word ("</a>");
+ }
+ else
+ {
+ if (*arg2)
+ {
+ execute_string ("%s:", arg2);
+ in_fixed_width_font++;
+ execute_string (" %s%s", arg1, px_ref_flag ? "." : "");
+ in_fixed_width_font--;
+ }
+ else
+ {
+ in_fixed_width_font++;
+ execute_string ("%s::", arg1);
+ in_fixed_width_font--;
+ }
+ }
+ }
+ }
/* Free all of the arguments found. */
if (arg1) free (arg1);
if (arg2) free (arg2);
@@ -2879,15 +3207,45 @@ cm_inforef (arg)
char *pname = get_xref_token (0);
char *file = get_xref_token (0);
- if (html)
+ /* (see comments at cm_xref). */
+ if (!*node)
+ line_error (_("First argument to @inforef may not be empty"));
+
+ if (xml && !docbook)
+ {
+ xml_insert_element (INFOREF, START);
+ xml_insert_element (INFOREFNODENAME, START);
+ execute_string (node);
+ xml_insert_element (INFOREFNODENAME, END);
+ if (*pname)
+ {
+ xml_insert_element (INFOREFREFNAME, START);
+ execute_string (pname);
+ xml_insert_element (INFOREFREFNAME, END);
+ }
+ xml_insert_element (INFOREFINFONAME, START);
+ execute_string (file);
+ xml_insert_element (INFOREFINFONAME, END);
+
+ xml_insert_element (INFOREF, END);
+ }
+ else if (html)
{
+ char *tem;
+
add_word (_("see "));
/* html fixxme: revisit this */
- add_word ("<a href=");
- execute_string ("\"%s.html\"", file);
- add_word (">");
- execute_string ("%s", pname);
+ add_html_elt ("<a href=");
+ if (splitting)
+ execute_string ("\"../%s/", file);
+ else
+ execute_string ("\"%s.html", file);
+ tem = expansion (node, 0);
+ add_anchor_name (tem, 1);
+ add_word ("\">");
+ execute_string ("%s", *pname ? pname : tem);
add_word ("</a>");
+ free (tem);
}
else
{
@@ -2915,9 +3273,29 @@ cm_uref (arg)
char *desc = get_xref_token (0);
char *replacement = get_xref_token (0);
- if (html)
+ if (xml)
+ {
+ xml_insert_element (UREF, START);
+ xml_insert_element (UREFURL, START);
+ execute_string (url);
+ xml_insert_element (UREFURL, END);
+ if (*desc)
+ {
+ xml_insert_element (UREFDESC, START);
+ execute_string (desc);
+ xml_insert_element (UREFDESC, END);
+ }
+ if (*replacement)
+ {
+ xml_insert_element (UREFREPLACEMENT, START);
+ execute_string (replacement);
+ xml_insert_element (UREFREPLACEMENT, END);
+ }
+ xml_insert_element (UREF, END);
+ }
+ else if (html)
{ /* never need to show the url */
- add_word ("<a href=");
+ add_html_elt ("<a href=");
/* don't collapse `--' etc. in the url */
in_fixed_width_font++;
execute_string ("\"%s\"", url);
@@ -2964,9 +3342,30 @@ cm_email (arg)
char *addr = get_xref_token (1); /* expands all macros in email */
char *name = get_xref_token (0);
- if (html)
+ if (xml && docbook)
+ {
+ xml_insert_element_with_attribute (EMAIL, START, "url=\"mailto:%s\"", addr);
+ if (*name)
+ execute_string (name);
+ xml_insert_element (EMAIL, END);
+ }
+ else if (xml)
+ {
+ xml_insert_element (EMAIL, START);
+ xml_insert_element (EMAILADDRESS, START);
+ execute_string (addr);
+ xml_insert_element (EMAILADDRESS, END);
+ if (*name)
+ {
+ xml_insert_element (EMAILNAME, START);
+ execute_string (name);
+ xml_insert_element (EMAILNAME, END);
+ }
+ xml_insert_element (EMAIL, END);
+ }
+ else if (html)
{
- add_word ("<a href=");
+ add_html_elt ("<a href=");
/* don't collapse `--' etc. in the address */
in_fixed_width_font++;
execute_string ("\"mailto:%s\"", addr);
@@ -2996,13 +3395,13 @@ void
cm_image (arg)
int arg;
{
- char *name_arg, *rest;
+ char *name_arg, *rest, *alt_arg, *ext_arg;
if (arg == END)
return;
name_arg = get_xref_token (1); /* expands all macros in image */
- /* We don't (yet) care about any other args, but read them so they
+ /* We don't (yet) care about the next two args, but read them so they
don't end up in the text. */
rest = get_xref_token (0);
if (rest)
@@ -3010,26 +3409,54 @@ cm_image (arg)
rest = get_xref_token (0);
if (rest)
free (rest);
+ alt_arg = get_xref_token (1); /* expands all macros in alt text */
+ ext_arg = get_xref_token (0);
if (*name_arg)
{
- char *fullname = xmalloc (strlen (name_arg) + 4 + 1);
+ char *fullname = xmalloc (strlen (name_arg)
+ + (ext_arg && *ext_arg ? strlen (ext_arg) + 1 : 4) + 1);
if (html)
- { /* fixxme It would be nice to insert more useful alt text. */
+ {
+ if (ext_arg && *ext_arg)
+ {
+ sprintf (fullname, "%s.%s", name_arg, ext_arg);
+ if (access (fullname, R_OK) != 0)
+ {
+ line_error(_("@image file `%s' (for HTML) not readable: %s"),
+ fullname, strerror (errno));
+ return;
+ }
+ }
+ else
+ {
sprintf (fullname, "%s.png", name_arg);
if (access (fullname, R_OK) != 0)
{
sprintf (fullname, "%s.jpg", name_arg);
if (access (fullname, R_OK) != 0)
{
- line_error (_("No .png or .jpg for `%s'"), name_arg);
+ line_error (_("No `%s.png' or `.jpg', and no extension supplied"),
+ name_arg);
return;
}
}
+ }
- add_word_args ("<img src=\"%s\" alt=\"%s\">", fullname, fullname);
+ add_html_elt ("<img src=");
+ add_word_args ("\"%s\"", fullname);
+ add_html_elt (" alt=");
+ add_word_args ("\"%s\">", (*alt_arg) ? alt_arg : fullname);
}
+ else if (xml && docbook)
+ xml_insert_docbook_image (name_arg);
+ else if (xml)
+ {
+ xml_insert_element (IMAGE, START);
+ add_word (name_arg);
+ xml_insert_element (IMAGE, END);
+ }
else
{ /* Try to open foo.txt. */
FILE *image_file;
@@ -3060,8 +3487,8 @@ cm_image (arg)
perror (fullname);
}
else
- warning (_("@image file `%s' unreadable: %s"), fullname,
- strerror (errno));
+ line_error (_("@image file `%s' (for text) unreadable: %s"),
+ fullname, strerror (errno));
}
free (fullname);
@@ -3071,6 +3498,10 @@ cm_image (arg)
if (name_arg)
free (name_arg);
+ if (alt_arg)
+ free (alt_arg);
+ if (ext_arg)
+ free (ext_arg);
}
/* Conditionals. */
@@ -3415,13 +3846,9 @@ handle_variable_internal (action, name)
}
if (!done)
- {
- int save = line_number;
- line_number = orig_line_number;
- line_error (_("Reached eof before matching @end %s"),
- condition);
- line_number = save;
- }
+ file_line_error (input_filename, orig_line_number,
+ _("Reached eof before matching @end %s"),
+ condition);
/* We found the end of a false @ifset/ifclear. If we are
in a menu, back up over the newline that ends the ifset,
@@ -3534,6 +3961,9 @@ maybe_update_execution_strings (text, new_len)
abort ();
}
+/* FIXME: this is an arbitrary limit. */
+#define EXECUTE_STRING_MAX 16*1024
+
/* Execute the string produced by formatting the ARGs with FORMAT. This
is like submitting a new file with @include. */
void
@@ -3551,7 +3981,7 @@ execute_string (format, va_alist)
va_list ap;
#endif
- es = get_execution_string (4000);
+ es = get_execution_string (EXECUTE_STRING_MAX);
temp_string = es->string;
es->in_use = 1;
@@ -3580,21 +4010,17 @@ execute_string (format, va_alist)
/* Return what would be output for STR (in newly-malloced memory), i.e.,
- expand Texinfo commands. If IMPLICIT_CODE is set, expand @code{STR}. */
+ expand Texinfo commands. If IMPLICIT_CODE is set, expand @code{STR}.
+ This is generally used for short texts; filling, indentation, and
+ html escapes are disabled. */
char *
expansion (str, implicit_code)
char *str;
int implicit_code;
{
- int length;
char *result;
-
- /* Inhibit any real output. */
- int start = output_paragraph_offset;
- int saved_paragraph_is_open = paragraph_is_open;
- int saved_output_column = output_column;
-
+
/* Inhibit indentation and filling, so that extra newlines
are not added to the expansion. (This is undesirable if
we write the expanded text to macro_expansion_output_stream.) */
@@ -3602,6 +4028,41 @@ expansion (str, implicit_code)
int saved_indented_fill = indented_fill;
int saved_no_indent = no_indent;
int saved_escape_html = escape_html;
+
+ filling_enabled = 0;
+ indented_fill = 0;
+ no_indent = 1;
+ escape_html = 0;
+
+ result = full_expansion (str, implicit_code);
+
+ filling_enabled = saved_filling_enabled;
+ indented_fill = saved_indented_fill;
+ no_indent = saved_no_indent;
+ escape_html = saved_escape_html;
+
+ return result;
+}
+
+
+/* Expand STR (or @code{STR} if IMPLICIT_CODE is nonzero). No change to
+ any formatting parameters -- filling, indentation, html escapes,
+ etc., are not reset. */
+
+char *
+full_expansion (str, implicit_code)
+ char *str;
+ int implicit_code;
+{
+ int length;
+ char *result;
+
+ /* Inhibit any real output. */
+ int start = output_paragraph_offset;
+ int saved_paragraph_is_open = paragraph_is_open;
+ int saved_output_column = output_column;
+
+ /* More output state to save. */
int saved_meta_pos = meta_char_pos;
int saved_last_char = last_inserted_character;
int saved_last_nl = last_char_was_newline;
@@ -3612,14 +4073,14 @@ expansion (str, implicit_code)
it from under our feet if it finds any macros in STR. */
char *saved_command = command ? xstrdup (command) : NULL;
- filling_enabled = 0;
- indented_fill = 0;
- no_indent = 1;
- escape_html = 0;
-
inhibit_output_flushing ();
paragraph_is_open = 1;
- execute_string (implicit_code ? "@code{%s}" : "%s", str);
+ if (strlen (str) > (implicit_code
+ ? EXECUTE_STRING_MAX - 1 - sizeof("@code{}")
+ : EXECUTE_STRING_MAX - 1))
+ line_error (_("`%.40s...' is too long for expansion; not expanded"), str);
+ else
+ execute_string (implicit_code ? "@code{%s}" : "%s", str);
uninhibit_output_flushing ();
/* Copy the expansion from the buffer. */
@@ -3631,13 +4092,11 @@ expansion (str, implicit_code)
/* Pretend it never happened. */
free_and_clear (&command);
command = saved_command;
+
output_paragraph_offset = start;
paragraph_is_open = saved_paragraph_is_open;
output_column = saved_output_column;
- filling_enabled = saved_filling_enabled;
- indented_fill = saved_indented_fill;
- no_indent = saved_no_indent;
- escape_html = saved_escape_html;
+
meta_char_pos = saved_meta_pos;
last_inserted_character = saved_last_char;
last_char_was_newline = saved_last_nl;
@@ -3655,10 +4114,13 @@ text_expansion (str)
{
char *ret;
int save_html = html;
+ int save_xml = xml;
html = 0;
+ xml = 0;
ret = expansion (str, 0);
html = save_html;
+ xml = save_xml;
return ret;
}
diff --git a/gnu/usr.bin/texinfo/makeinfo/makeinfo.h b/gnu/usr.bin/texinfo/makeinfo/makeinfo.h
index b1c7b608065..caff24d2e1f 100644
--- a/gnu/usr.bin/texinfo/makeinfo/makeinfo.h
+++ b/gnu/usr.bin/texinfo/makeinfo/makeinfo.h
@@ -1,7 +1,7 @@
/* makeinfo.h -- declarations for Makeinfo.
- $Id: makeinfo.h,v 1.3 2000/02/09 02:18:42 espie Exp $
+ $Id: makeinfo.h,v 1.4 2002/06/10 13:51:03 espie Exp $
- Copyright (C) 1996, 97, 98, 99 Free Software Foundation, Inc.
+ Copyright (C) 1996, 97, 98, 99, 2000, 01, 02 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -45,7 +45,7 @@ DECLARE (int, executing_string, 0);
stream, because it has already been written. */
DECLARE (int, me_inhibit_expansion, 0);
-extern char *expansion (), *text_expansion ();
+extern char *expansion (), *text_expansion (), *full_expansion ();
/* Current output stream. */
DECLARE (FILE *, output_stream, NULL);
@@ -116,10 +116,23 @@ DECLARE (int, multitable_active, 0);
/* Nonzero means that we're generating HTML. */
DECLARE (int, html, 0);
+/* Nonzero means that we're generating XML. */
+DECLARE (int, xml, 0);
+
+/* Nonzero means that we're generating DocBook. */
+DECLARE (int, docbook, 0);
+
+/* Nonzero means true 8-bit output for Info and plain text. */
+DECLARE (int, enable_encoding, 0);
+
/* Nonzero means escape characters in HTML output. */
DECLARE (int, escape_html, 1);
extern char *escape_string (); /* do HTML escapes */
+/* Access key number for next menu entry to be generated (1 to 9, or 10 to
+ mean no access key) */
+DECLARE (int, next_menu_item_number, 1);
+
/* Nonzero means that the use of paragraph_start_indent is inhibited.
@example uses this to line up the left columns of the example text.
A negative value for this variable is incremented each time it is used.
@@ -135,6 +148,12 @@ DECLARE (char *, current_node, NULL);
/* Command name in the process of being hacked. */
DECLARE (char *, command, NULL);
+/* @copying ... @end copying. */
+DECLARE (char *, copying_text, NULL);
+
+/* @documentdescription ... @end documentdescription. */
+DECLARE (char *, document_description, NULL);
+
/* Nonzero if the last character inserted has the syntax class of NEWLINE. */
DECLARE (int, last_char_was_newline, 1);
@@ -144,6 +163,7 @@ DECLARE (char *, input_text, (char *)NULL);
DECLARE (int, input_text_length, 0);
DECLARE (int, input_text_offset, 0);
DECLARE (int, line_number, 0);
+DECLARE (char *, toplevel_output_filename, NULL);
#define curchar() input_text[input_text_offset]
/* A colon separated list of directories to search for files included
@@ -161,9 +181,15 @@ DECLARE (int, no_headers, 0);
generating HTML. (--ifhtml) */
DECLARE (int, process_html, 0);
-/* Nonzero means that we process @ifinfo even when generating HTML.
- (--ifinfo) */
-DECLARE (int, process_info, 1);
+/* Positive means process @ifinfo (even if not generating Info);
+ zero means don't process @ifinfo (even if we are);
+ -1 means we don't know yet. (--ifinfo) */
+DECLARE (int, process_info, -1);
+
+/* Positive means process @ifplaintext (even if not generating plain text);
+ zero means we don't process @ifplaintext (even if we are);
+ -1 means we don't know yet. (--ifplaintext) */
+DECLARE (int, process_plaintext, -1);
/* Nonzero means that we process @tex and @iftex. (--iftex) */
DECLARE (int, process_tex, 0);
@@ -181,6 +207,9 @@ DECLARE (int, verbose_mode, 0);
/* Nonzero means prefix each @chapter, ... with a number like 1. (--number-sections) */
DECLARE (int, number_sections, 0);
+/* Nonzero means split size. When zero, DEFAULT_SPLIT_SIZE is used. */
+DECLARE (int, split_size, 0);
+
/* Nonzero means expand node names and references while validating.
This will avoid errors when the Texinfo document uses features
like @@ and @value inconsistently in node names, but will slow
@@ -225,6 +254,8 @@ DECLARE (int, expensive_validation, 0);
#define COMMAND_PREFIX '@'
+#define END_VERBATIM "end verbatim"
+
/* Stuff for splitting large files. */
#define SPLIT_SIZE_THRESHOLD 70000 /* What's good enough for Stallman... */
#define DEFAULT_SPLIT_SIZE 50000 /* Is probably good enough for me. */
@@ -256,5 +287,4 @@ DECLARE (int, splitting, 1); /* Defaults to true for now. */
#define looking_at(string) \
(strncmp (input_text + input_text_offset, string, strlen (string)) == 0)
-
#endif /* not MAKEINFO_H */
diff --git a/gnu/usr.bin/texinfo/makeinfo/makeinfo.texi b/gnu/usr.bin/texinfo/makeinfo/makeinfo.texi
new file mode 100644
index 00000000000..db9c10f3013
--- /dev/null
+++ b/gnu/usr.bin/texinfo/makeinfo/makeinfo.texi
@@ -0,0 +1,303 @@
+\input texinfo @c -*-texinfo-*-
+@comment %**start of header
+@setfilename makeinfo.info
+@set VERSION 1.61
+@paragraphindent none
+@comment %**start of header
+@comment $Id: makeinfo.texi,v 1.3 2002/06/10 13:51:03 espie Exp $
+
+@dircategory Texinfo documentation system
+@direntry
+* makeinfo: (makeinfo). Convert Texinfo source to Info or plain ASCII.
+@end direntry
+
+@ifinfo
+This file is an extract from the @cite{Texinfo} manual.@*
+It documents Makeinfo, a program that converts Texinfo
+files into Info files.
+
+Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+
+Permission is granted to make and distribute verbatim copies of
+this manual provided the copyright notice and this permission notice
+are preserved on all copies.
+
+@ignore
+Permission is granted to process this file through TeX and print the
+results, provided the printed document carries copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual).
+
+@end ignore
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided that the entire
+resulting derived work is distributed under the terms of a permission
+notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that this permission notice may be stated in a translation approved
+by the Free Software Foundation.
+@end ifinfo
+
+@titlepage
+@title GNU Makeinfo
+@author Brian J. Fox and Robert J. Chassell
+
+@page
+@vskip 0pt plus 1filll
+Copyright @copyright{} 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+
+Permission is granted to make and distribute verbatim copies of
+this manual provided the copyright notice and this permission notice
+are preserved on all copies.
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided that the entire
+resulting derived work is distributed under the terms of a permission
+notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that this permission notice may be stated in a translation approved
+by the Free Software Foundation.
+@end titlepage
+
+@node Top
+@chapter What is @code{makeinfo}?
+
+@iftex
+This file documents the use of the @code{makeinfo} program, versions
+@value{VERSION} and later. It is an extract from the @cite{Texinfo} manual.
+@end iftex
+
+@code{makeinfo} is a program for converting @dfn{Texinfo} files into @dfn{Info}
+files. Texinfo is a documentation system that uses a single source file to
+produce both on-line information and printed output.
+
+You can read the on-line information using Info; type @code{info} to
+learn about Info.
+@ifinfo
+@xref{Top, Texinfo, Overview of Texinfo, Texinfo, Texinfo},
+@end ifinfo
+@iftex
+See the @cite{Texinfo} manual,
+@end iftex
+to learn about the Texinfo documentation system.
+
+@menu
+* Formatting Control:: Controlling the width of lines, paragraph
+ indentation, and other similar formatting.
+
+* Options:: Command line options which control the
+ behaviour of Makeinfo.
+
+* Pointer Validation:: How Makeinfo can help you to track node
+ references through complex Texinfo files.
+
+* Index:: Index of Concepts.
+@end menu
+
+@c Removed this for 3.8 until it's time to rewrite it.
+@c * The Macro Facility:: Makeinfo allows the use of @dfn{macros}.
+
+@node Formatting Control
+@section Controlling Paragraph Formats
+
+Without any special options, @code{makeinfo} @dfn{fills} the paragraphs that
+it outputs to an Info file. Filling is the process of breaking and connecting
+lines so that lines are the same length as or shorter than the number
+specified as the fill column. Lines are broken between words. With
+@code{makeinfo}, you can control:
+
+@itemize @bullet
+@item
+The width of each paragraph (the @dfn{fill-column}).
+@item
+The amount of indentation that the first line of
+each paragraph receives (the @dfn{paragraph-indentation}).
+@end itemize
+
+@node Options
+@section Command Line Options
+
+The following command line options are available for @code{makeinfo}.
+
+@need 100
+@table @code
+@item -D @var{var}
+Cause @var{var} to be defined. This is equivalent to
+@code{@@set @var{var}} in the Texinfo file.
+
+@need 150
+@item --error-limit @var{limit}
+Set the maximum number of errors that @code{makeinfo} will report
+before exiting (on the assumption that continuing would be useless).
+The default number of errors that can be reported before
+@code{makeinfo} gives up is 100.@refill
+
+@need 150
+@item --fill-column @var{width}
+Specify the maximum number of columns in a line; this is the right-hand
+edge of a line. Paragraphs that are filled will be filled to this
+width. The default value for @code{fill-column} is 72.
+@refill
+
+@item --footnote-style @var{style}
+Set the footnote style to @var{style}, either @samp{end} for the end
+node style or @samp{separate} for the separate node style. The value
+set by this option overrides the value set in a Texinfo file by an
+@code{@@footnotestyle} command. When the footnote style is
+@samp{separate}, @code{makeinfo} makes a new node containing the
+footnotes found in the current node. When the footnote style is
+@samp{end}, @code{makeinfo} places the footnote references at the end
+of the current node.@refill
+
+@need 150
+@item -I @var{dir}
+Add @code{dir} to the directory search list for finding files that are
+included using the @code{@@include} command. By default,
+@code{makeinfo} searches only the current directory.
+
+@need 150
+@item --no-headers
+Do not include menus or node lines in the output. This results in an
+@sc{ascii} file that you cannot read in Info since it does not contain
+the requisite nodes or menus; but you can print such a file in a
+single, typewriter-like font and produce acceptable output.
+
+@need 150
+@item --no-split
+Suppress the splitting stage of @code{makeinfo}. Normally, large
+output files (where the size is greater than 70k bytes) are split into
+smaller subfiles, each one approximately 50k bytes. If you specify
+@samp{--no-split}, @code{makeinfo} will not split up the output
+file.@refill
+
+@need 100
+@item --no-pointer-validate
+@item --no-validate
+Suppress the pointer-validation phase of @code{makeinfo}. Normally,
+after a Texinfo file is processed, some consistency checks are made to
+ensure that cross references can be resolved, etc.
+@xref{Pointer Validation}.@refill
+
+@need 150
+@item --no-warn
+Suppress the output of warning messages. This does @emph{not}
+suppress the output of error messages, only warnings. You might
+want this if the file you are creating has examples of Texinfo cross
+references within it, and the nodes that are referenced do not actually
+exist.@refill
+
+@item --no-number-footnotes
+Supress automatic footnote numbering. By default, @code{makeinfo}
+numbers each footnote sequentially in a single node, resetting the
+current footnote number to 1 at the start of each node.
+
+@need 150
+@item --output @var{file}
+@itemx -o @var{file}
+Specify that the output should be directed to @var{file} and not to the
+file name specified in the @code{@@setfilename} command found in the Texinfo
+source. @var{file} can be the special token @samp{-}, which specifies
+standard output.
+
+@need 150
+@item --paragraph-indent @var{indent}
+Set the paragraph indentation style to @var{indent}. The value set by
+this option overrides the value set in a Texinfo file by an
+@code{@@paragraphindent} command. The value of @var{indent} is
+interpreted as follows:@refill
+
+@itemize @bullet
+@item
+If the value of @var{indent} is @samp{asis}, do not change the
+existing indentation at the starts of paragraphs.@refill
+
+@item
+If the value of @var{indent} is zero, delete any existing
+indentation.@refill
+
+@item
+If the value of @var{indent} is greater than zero, indent each
+paragraph by that number of spaces.@refill
+@end itemize
+
+@need 100
+@item --reference-limit @var{limit}
+Set the value of the number of references to a node that
+@code{makeinfo} will make without reporting a warning. If a node has more
+than this number of references in it, @code{makeinfo} will make the
+references but also report a warning.@refill
+
+@need 150
+@item -U @var{var}
+Cause @var{var} to be undefined. This is equivalent to
+@code{@@clear @var{var}} in the Texinfo file.
+
+@need 100
+@item --verbose
+Cause @code{makeinfo} to display messages saying what it is doing.
+Normally, @code{makeinfo} only outputs messages if there are errors or
+warnings.@refill
+
+@need 100
+@item --version
+Report the version number of this copy of @code{makeinfo}.@refill
+
+@item --help
+Show a summary of the commend line arguments to @code{makeinfo}.
+@end table
+
+@node Pointer Validation
+@section Pointer Validation
+@cindex Pointer validation with @code{makeinfo}
+@cindex Validation of pointers
+
+If you do not suppress pointer-validation (by using the
+@samp{--no-pointer-validation} option), @code{makeinfo}
+will check the validity of the final Info file. Mostly,
+this means ensuring that nodes you have referenced
+really exist. Here is a complete list of what is
+checked:@refill
+
+@enumerate
+@item
+If a `Next', `Previous', or `Up' node reference is a reference to a
+node in the current file and is not an external reference such as to
+@file{(dir)}, then the referenced node must exist.@refill
+
+@item
+In every node, if the `Previous' node is different from the `Up' node,
+then the `Previous' node must also be pointed to by a `Next' node.@refill
+
+@item
+Every node except the `Top' node must have an `Up' pointer.@refill
+
+@item
+The node referenced by an `Up' pointer must contain a reference to the
+current node in some manner other than through a `Next' reference.
+This includes menu entries and cross references.@refill
+
+@item
+If the `Next' reference of a node is not the same as the `Next' reference
+of the `Up' reference, then the node referenced by the `Next' pointer
+must have a `Previous' pointer that points back to the current node.
+This rule allows the last node in a section to point to the first node
+of the next chapter.@refill
+@end enumerate
+
+@c We don't want to advertise redefining commands.
+@c lowersections
+@c include macro.texi
+@c raisesections
+
+@lowersections
+@node Index
+@appendix Index
+@printindex cp
+@raisesections
+
+@contents
+@bye
diff --git a/gnu/usr.bin/texinfo/makeinfo/multi.c b/gnu/usr.bin/texinfo/makeinfo/multi.c
index 7302b3ec587..6b96933bb42 100644
--- a/gnu/usr.bin/texinfo/makeinfo/multi.c
+++ b/gnu/usr.bin/texinfo/makeinfo/multi.c
@@ -1,7 +1,7 @@
/* multi.c -- multitable stuff for makeinfo.
- $Id: multi.c,v 1.3 2000/02/09 02:18:42 espie Exp $
+ $Id: multi.c,v 1.4 2002/06/10 13:51:03 espie Exp $
- Copyright (C) 1996, 97, 98, 99 Free Software Foundation, Inc.
+ Copyright (C) 1996, 97, 98, 99, 2000, 01, 02 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,11 +15,14 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
- Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+ Written by phr@gnu.org (Paul Rubin). */
#include "system.h"
#include "insertion.h"
#include "makeinfo.h"
+#include "xml.h"
#define MAXCOLS 100 /* remove this limit later @@ */
@@ -108,6 +111,8 @@ draw_horizontal_separator ()
add_word ("<hr>");
return;
}
+ if (xml)
+ return;
for (s = 0; s < envs[0].current_indent; s++)
out_char (' ');
@@ -156,6 +161,9 @@ do_multitable ()
/* scan the current item function to get the field widths
and number of columns, and set up the output environment list
accordingly. */
+ /* if (docbook)*/ /* 05-08 */
+ if (xml)
+ xml_no_para = 1;
ncolumns = setup_multitable_parameters ();
first_row = 1;
@@ -163,6 +171,16 @@ do_multitable ()
current paragraph, so this is ok. */
if (html)
add_word ("<p><table>");
+ /* else if (docbook)*/ /* 05-08 */
+ else if (xml)
+ {
+ int *widths = xmalloc (ncolumns * sizeof (int));
+ int i;
+ for (i=0; i<ncolumns; i++)
+ widths[i] = envs[i+1].fill_column;
+ xml_begin_multitable (ncolumns, widths);
+ free (widths);
+ }
if (hsep)
draw_horizontal_separator ();
@@ -199,7 +217,7 @@ find_template_width (params)
do
{
- if (**params == '{' && (*params)[-1] != '@')
+ if (**params == '{' && (*params == start || (*params)[-1] != '@'))
brace_level++;
else if (**params == '}' && (*params)[-1] != '@')
brace_level--;
@@ -385,10 +403,17 @@ multitable_item ()
if (html)
{
if (!first_row)
- add_word ("<br></tr>"); /* <br> for non-tables browsers. */
- add_word ("<tr align=\"left\"><td>");
+ add_word ("<br></td></tr>"); /* <br> for non-tables browsers. */
+ add_word ("<tr align=\"left\"><td valign=\"top\">");
first_row = 0;
- return;
+ return 0;
+ }
+ /* else if (docbook)*/ /* 05-08 */
+ else if (xml)
+ {
+ xml_end_multitable_row (first_row);
+ first_row = 0;
+ return 0;
}
first_row = 0;
@@ -504,7 +529,10 @@ cm_tab ()
error (_("ignoring @tab outside of multitable"));
if (html)
- add_word ("<td>");
+ add_word ("</td><td valign=\"top\">");
+ /* else if (docbook)*/ /* 05-08 */
+ else if (xml)
+ xml_end_multitable_column ();
else
nselect_next_environment ();
@@ -516,7 +544,7 @@ cm_tab ()
void
end_multitable ()
{
- if (!html)
+ if (!html && !docbook)
output_multitable_row ();
/* Multitables cannot be nested. Otherwise, we'd have to save the
@@ -528,7 +556,10 @@ end_multitable ()
close_insertion_paragraph ();
if (html)
- add_word ("<br></tr></table>\n");
+ add_word ("<br></td></tr></table>\n");
+ /* else if (docbook)*/ /* 05-08 */
+ else if (xml)
+ xml_end_multitable ();
#if 0
printf (_("** Multicolumn output from last row:\n"));
diff --git a/gnu/usr.bin/texinfo/makeinfo/multiformat.texi b/gnu/usr.bin/texinfo/makeinfo/multiformat.texi
new file mode 100644
index 00000000000..0c6c467dc0d
--- /dev/null
+++ b/gnu/usr.bin/texinfo/makeinfo/multiformat.texi
@@ -0,0 +1,40 @@
+@c multiformat.texi: -*- Texinfo -*- \input texinfo.tex
+
+@c Copyright (c) 1995 Universal Access, Inc
+@c Author: Brian J. Fox (bfox@ua.com) Sun Apr 2 07:56:23 1995.
+@setfilename multiformat.info
+
+@include html.texi
+
+@ifset html
+@html
+@end ifset
+
+@node First Node, First Section, (dir), (dir)
+@chapter First Chapter
+Here is some text that belongs in the first chapter. Nothing very
+exciting happens here, but this is enough text to span a couple of
+lines, and we feel that is important.
+@paragraph
+
+This is the second paragraph of the first chapter. Note that the
+formatting commands in @code{HTML} seem to do the right thing, as do the
+commands when invoked in @code{Texinfo} mode and in @TeX{}.
+
+@node First Section, , First Node, First Node
+@isection First Section
+
+Here is some text in the first section of the first chapter. We are
+trying very hard to examine the output here to see exactly how proper it
+is. If I wasn't so tired, we could probably see it already.
+@paragraph
+
+Here is a list of items:
+@paragraph
+
+@itemize @bullet
+@item Here is the first item.
+@item Here is the second item.
+@end itemize
+
+@bye