summaryrefslogtreecommitdiffstats
path: root/contrib/texinfo/makeinfo
diff options
context:
space:
mode:
authormarkm <markm@FreeBSD.org>1999-01-14 19:35:19 +0000
committermarkm <markm@FreeBSD.org>1999-01-14 19:35:19 +0000
commite6130fbf2cdd5ee167faddb966821f5ce40d5be4 (patch)
treec671a302f149f45a055c773225987032650567ed /contrib/texinfo/makeinfo
parent1e3b3745267d8cd068c795618e31da1fbe5ca510 (diff)
parent15da023077f02380356169c9b5f4a62a6dc51f63 (diff)
downloadFreeBSD-src-e6130fbf2cdd5ee167faddb966821f5ce40d5be4.zip
FreeBSD-src-e6130fbf2cdd5ee167faddb966821f5ce40d5be4.tar.gz
This commit was generated by cvs2svn to compensate for changes in r42660,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/texinfo/makeinfo')
-rw-r--r--contrib/texinfo/makeinfo/Makefile.am13
-rw-r--r--contrib/texinfo/makeinfo/Makefile.in323
-rw-r--r--contrib/texinfo/makeinfo/README8
-rw-r--r--contrib/texinfo/makeinfo/makeinfo.h62
-rw-r--r--contrib/texinfo/makeinfo/multi.c192
5 files changed, 407 insertions, 191 deletions
diff --git a/contrib/texinfo/makeinfo/Makefile.am b/contrib/texinfo/makeinfo/Makefile.am
new file mode 100644
index 0000000..f2137fa
--- /dev/null
+++ b/contrib/texinfo/makeinfo/Makefile.am
@@ -0,0 +1,13 @@
+## Makefile.am for texinfo/makeinfo.
+## $Id: Makefile.am,v 1.4 1997/07/04 20:58:00 karl Exp $
+## Run automake in .. to produce Makefile.in from this.
+
+bin_PROGRAMS = makeinfo
+
+localedir = $(datadir)/locale
+INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
+LDADD = ../lib/libtxi.a @INTLLIBS@
+
+makeinfo_SOURCES = makeinfo.c makeinfo.h multi.c
+
+EXTRA_DIST = README
diff --git a/contrib/texinfo/makeinfo/Makefile.in b/contrib/texinfo/makeinfo/Makefile.in
index d08ee36..d1d76ab 100644
--- a/contrib/texinfo/makeinfo/Makefile.in
+++ b/contrib/texinfo/makeinfo/Makefile.in
@@ -1,112 +1,289 @@
-# Makefile for GNU makeinfo.
-# $Id: Makefile.in,v 1.9 1996/10/01 21:45:00 karl Exp $
-#
-# Copyright (C) 1993, 96 Free Software Foundation, Inc.
+# Makefile.in generated automatically by automake 1.2f from Makefile.am
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998 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.
# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#### Start of system configuration section. ####
+SHELL = /bin/sh
srcdir = @srcdir@
-VPATH = $(srcdir):$(common)
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
-common = $(srcdir)/../libtxi
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
-CC = @CC@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+CATALOGS = @CATALOGS@
+CATOBJEXT = @CATOBJEXT@
+CC = @CC@
+DATADIRNAME = @DATADIRNAME@
+GENCAT = @GENCAT@
+GMOFILES = @GMOFILES@
+GMSGFMT = @GMSGFMT@
+GT_NO = @GT_NO@
+GT_YES = @GT_YES@
+INCLUDE_LOCALE_H = @INCLUDE_LOCALE_H@
+INSTOBJEXT = @INSTOBJEXT@
+INTLDEPS = @INTLDEPS@
+INTLLIBS = @INTLLIBS@
+INTLOBJS = @INTLOBJS@
+MAKEINFO = @MAKEINFO@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+PACKAGE = @PACKAGE@
+POFILES = @POFILES@
+POSUB = @POSUB@
+RANLIB = @RANLIB@
+TERMLIBS = @TERMLIBS@
+TEXCONFIG = @TEXCONFIG@
+TEXMF = @TEXMF@
+USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+l = @l@
+
+bin_PROGRAMS = makeinfo
+
+localedir = $(datadir)/locale
+INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
+LDADD = ../lib/libtxi.a @INTLLIBS@
+
+makeinfo_SOURCES = makeinfo.c makeinfo.h multi.c
+
+EXTRA_DIST = README
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(bin_PROGRAMS)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I..
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+makeinfo_OBJECTS = makeinfo.o multi.o
+makeinfo_LDADD = $(LDADD)
+makeinfo_DEPENDENCIES = ../lib/libtxi.a
+makeinfo_LDFLAGS =
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON = README Makefile.am Makefile.in
-LN = ln
-RM = rm -f
-MKDIR = mkdir
-DEFS = @DEFS@
-LIBS = -L../libtxi -ltxi @LIBS@
-LOADLIBES = $(LIBS)
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-SHELL = /bin/sh
+TAR = tar
+GZIP = --best
+SOURCES = $(makeinfo_SOURCES)
+OBJECTS = $(makeinfo_OBJECTS)
-CFLAGS = @CFLAGS@
-LDFLAGS = @LDFLAGS@
+default: all
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-bindir = $(exec_prefix)/bin
-# Prefix for each installed program, normally empty or `g'.
-binprefix =
-infodir = $(prefix)/info
+.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
-#### End of system configuration section. ####
-SRCS = makeinfo.c multi.c
-OBJS = makeinfo.o multi.o
+mostlyclean-binPROGRAMS:
-PROGS = makeinfo
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-all: $(PROGS) makeinfo.info
-sub-all: all
+distclean-binPROGRAMS:
+
+maintainer-clean-binPROGRAMS:
+
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(bindir)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo " $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`"; \
+ $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed '$(transform)'`; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ list='$(bin_PROGRAMS)'; for p in $$list; do \
+ rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
+ done
.c.o:
- $(CC) -c $(CPPFLAGS) -I. -I$(srcdir) -I$(common) $(DEFS) $(CFLAGS) $<
+ $(COMPILE) -c $<
+
+.s.o:
+ $(COMPILE) -c $<
+
+.S.o:
+ $(COMPILE) -c $<
+
+mostlyclean-compile:
+ -rm -f *.o core *.core
+
+clean-compile:
+
+distclean-compile:
+ -rm -f *.tab.c
+
+maintainer-clean-compile:
+
+makeinfo: $(makeinfo_OBJECTS) $(makeinfo_DEPENDENCIES)
+ @rm -f makeinfo
+ $(LINK) $(makeinfo_LDFLAGS) $(makeinfo_OBJECTS) $(makeinfo_LDADD) $(LIBS)
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $(SOURCES) $(HEADERS) $(LISP)
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; 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)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = makeinfo
+
+distdir: $(DISTFILES)
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file; \
+ done
+makeinfo.o: makeinfo.c ../lib/system.h ../config.h ../lib/getopt.h \
+ makeinfo.h
+multi.o: multi.c ../lib/system.h ../config.h makeinfo.h
+
+info:
+dvi:
+check: all
+ $(MAKE)
+installcheck:
+install-exec: install-binPROGRAMS
+ @$(NORMAL_INSTALL)
-makeinfo: $(OBJS) ../libtxi/libtxi.a
- $(CC) $(LDFLAGS) -o makeinfo $(OBJS) $(LOADLIBES)
+install-data:
+ @$(NORMAL_INSTALL)
-../libtxi/libtxi.a:
- (cd ../libtxi && $(MAKE) $(MFLAGS) libtxi.a)
+install: install-exec install-data all
+ @:
-makeinfo.o: makeinfo.c $(common)/getopt.h
+uninstall: uninstall-binPROGRAMS
-$(OBJS): makeinfo.h
+all: Makefile $(PROGRAMS)
-info makeinfo.info: ./makeinfo makeinfo.texi #macro.texi
- ./makeinfo --no-split -I$(srcdir) makeinfo.texi
+install-strip:
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+installdirs:
+ $(mkinstalldirs) $(bindir)
-# makeinfo.texi: ./makeinfo makeinfo.mki
-# ./makeinfo -E makeinfo.texi -I$(srcdir) makeinfo.mki
-dvi makeinfo.dvi: ./makeinfo makeinfo.texi #macro.texi
- $(srcdir)/../util/texi2dvi makeinfo.txi
+mostlyclean-generic:
+ -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
-install: all
- $(INSTALL_PROGRAM) makeinfo $(bindir)/$(binprefix)makeinfo
- -d=$(srcdir); test -f ./makeinfo.info && d=.; $(INSTALL_DATA) $$d/makeinfo.info $(infodir)/makeinfo.info
- $(POST_INSTALL)
- ../util/install-info --info-dir=$(infodir) $(infodir)/makeinfo.info
-
-uninstall:
- for f in $(PROGS); do rm -f $(bindir)/$(binprefix)$$f; done
- rm -f $(infodir)/makeinfo.info
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-TAGS: $(SRCS)
- etags $(SRCS)
+distclean-generic:
+ -rm -f Makefile $(DISTCLEANFILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-clean:
- rm -f *.o a.out core core.* $(PROGS)
+maintainer-clean-generic:
+ -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+ -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+mostlyclean: mostlyclean-binPROGRAMS mostlyclean-compile \
+ mostlyclean-tags mostlyclean-generic
-mostlyclean: clean
+clean: clean-binPROGRAMS clean-compile clean-tags clean-generic \
+ mostlyclean
-distclean: clean
- rm -f TAGS Makefile config.status *.info */*.info
+distclean: distclean-binPROGRAMS distclean-compile distclean-tags \
+ distclean-generic clean
+ -rm -f config.status
-realclean: distclean
-maintainer-clean: distclean
+maintainer-clean: maintainer-clean-binPROGRAMS maintainer-clean-compile \
+ maintainer-clean-tags maintainer-clean-generic \
+ distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+.PHONY: default mostlyclean-binPROGRAMS distclean-binPROGRAMS \
+clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
+install-binPROGRAMS mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile tags mostlyclean-tags distclean-tags \
+clean-tags maintainer-clean-tags distdir info dvi installcheck \
+install-exec install-data install uninstall all installdirs \
+mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
-Makefile: Makefile.in ../config.status
- cd .. && sh config.status
-# Prevent GNU make v3 from overflowing arg limit on SysV.
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/contrib/texinfo/makeinfo/README b/contrib/texinfo/makeinfo/README
new file mode 100644
index 0000000..2bfe6e1
--- /dev/null
+++ b/contrib/texinfo/makeinfo/README
@@ -0,0 +1,8 @@
+makeinfo is a standalone program to convert Texinfo source into Info
+files readable with standalone info or M-x info in Emacs.
+
+makeinfo can also output plain ASCII. Work to support HTML and Troff
+output is almost complete.
+
+The Emacs function M-x texinfo-format-buffer does more or less the same
+job, but makeinfo is faster and gives better error messages.
diff --git a/contrib/texinfo/makeinfo/makeinfo.h b/contrib/texinfo/makeinfo/makeinfo.h
index 610d39b..205a3bd 100644
--- a/contrib/texinfo/makeinfo/makeinfo.h
+++ b/contrib/texinfo/makeinfo/makeinfo.h
@@ -1,7 +1,7 @@
/* makeinfo.h -- Declarations for Makeinfo.
- $Id: makeinfo.h,v 1.2 1996/07/21 11:21:45 karl Exp $
+ $Id: makeinfo.h,v 1.3 1997/07/15 18:28:38 karl Exp $
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright (C) 1996, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -35,12 +35,14 @@
enum insertion_type
{
- menu, detailmenu, quotation, lisp, smalllisp, example, smallexample,
- display, itemize, format, enumerate, cartouche, multitable, table,
- ftable, vtable, group, ifinfo, flushleft, flushright, ifset,
- ifclear, deffn, defun, defmac, defspec, defvr, defvar, defopt,
- deftypefn, deftypefun, deftypevr, deftypevar, defcv, defivar, defop,
- defmethod, deftypemethod, deftp, direntry, bad_type
+ cartouche, defcv, deffn, defivar, defmac, defmethod,
+ defop, defopt, defspec, deftp, deftypefn, deftypefun,
+ deftypemethod, deftypevar, deftypevr, defun, defvar,
+ defvr, detailmenu, direntry, display, enumerate, example,
+ flushleft, flushright, format, ftable, group, ifclear,
+ ifinfo, ifnothtml, ifnottex, ifset, itemize, lisp, menu,
+ multitable, quotation, smallexample, smalllisp, table, vtable,
+ bad_type
};
DECLARE (int, insertion_level, 0);
@@ -48,13 +50,13 @@ DECLARE (int, insertion_level, 0);
#if defined (COMPILING_MAKEINFO)
char *insertion_type_names[] =
{
- "menu", "detailmenu", "quotation", "lisp", "smalllisp", "example",
- "smallexample", "display", "itemize", "format", "enumerate",
- "cartouche", "multitable", "table", "ftable", "vtable", "group",
- "ifinfo", "flushleft", "flushright", "ifset", "ifclear", "deffn",
- "defun", "defmac", "defspec", "defvr", "defvar", "defopt",
- "deftypefn", "deftypefun", "deftypevr", "deftypevar", "defcv",
- "defivar", "defop", "defmethod", "deftypemethod", "deftp", "direntry",
+ "cartouche", "defcv", "deffn", "defivar", "defmac", "defmethod",
+ "defop", "defopt", "defspec", "deftp", "deftypefn", "deftypefun",
+ "deftypemethod", "deftypevar", "deftypevr", "defun", "defvar",
+ "defvr", "detailmenu", "direntry", "display", "enumerate", "example",
+ "flushleft", "flushright", "format", "ftable", "group", "ifclear",
+ "ifinfo", "ifnothtml", "ifnottex", "ifset", "itemize", "lisp", "menu",
+ "multitable", "quotation", "smallexample", "smalllisp", "table", "vtable",
"bad_type"
};
#endif
@@ -107,15 +109,15 @@ DECLARE (int, line_number, 0);
#define curchar() input_text[input_text_offset]
/* **************************************************************** */
-/* */
-/* Global Defines */
-/* */
+/* */
+/* Global Defines */
+/* */
/* **************************************************************** */
/* Error levels */
#define NO_ERROR 0
-#define SYNTAX 2
-#define FATAL 4
+#define SYNTAX 2
+#define FATAL 4
/* C's standard macros don't check to make sure that the characters being
changed are within range. So I have to check explicitly. */
@@ -164,29 +166,29 @@ DECLARE (int, line_number, 0);
#define SPLIT_SIZE_THRESHOLD 70000 /* What's good enough for Stallman... */
#define DEFAULT_SPLIT_SIZE 50000 /* Is probably good enough for me. */
-DECLARE (int, splitting, 1); /* Defaults to true for now. */
+DECLARE (int, splitting, 1); /* Defaults to true for now. */
typedef void COMMAND_FUNCTION (); /* So I can say COMMAND_FUNCTION *foo; */
#define command_char(c) ((!whitespace(c)) && \
- ((c) != '\n') && \
- ((c) != '{') && \
- ((c) != '}') && \
- ((c) != '='))
+ ((c) != '\n') && \
+ ((c) != '{') && \
+ ((c) != '}') && \
+ ((c) != '='))
#define skip_whitespace() \
while ((input_text_offset != size_of_input_text) && \
- whitespace (curchar())) \
+ whitespace (curchar())) \
input_text_offset++
#define skip_whitespace_and_newlines() \
do { \
while ((input_text_offset != size_of_input_text) && \
- (whitespace (curchar ()) || (curchar () == '\n'))) \
+ (whitespace (curchar ()) || (curchar () == '\n'))) \
{ \
- if (curchar () == '\n') \
- line_number++; \
- input_text_offset++; \
+ if (curchar () == '\n') \
+ line_number++; \
+ input_text_offset++; \
} \
} while (0)
diff --git a/contrib/texinfo/makeinfo/multi.c b/contrib/texinfo/makeinfo/multi.c
index 0276ddc..99c380d 100644
--- a/contrib/texinfo/makeinfo/multi.c
+++ b/contrib/texinfo/makeinfo/multi.c
@@ -1,7 +1,7 @@
-/* multi.c -- Multitable stuff for makeinfo.
- $Id: multi.c,v 1.7 1996/10/01 21:42:20 karl Exp $
+/* multi.c -- multitable stuff for makeinfo.
+ $Id: multi.c,v 1.9 1997/07/24 22:01:00 karl Exp $
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright (C) 1996, 97 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -17,10 +17,10 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
-#include <stdio.h>
+#include "system.h"
#include "makeinfo.h"
-#define MAXCOLS 100 /* remove this limit later @@ */
+#define MAXCOLS 100 /* remove this limit later @@ */
/*
@@ -38,7 +38,7 @@
* `select_output_environment' function switches from one output
* environment to another.
*
- * Environment #0 (i.e. element #0 of the table) is the regular
+ * Environment #0 (i.e., element #0 of the table) is the regular
* environment that is used when we're not formatting a multitable.
*
* Environment #N (where N = 1,2,3,...) is the env. for column #N of
@@ -55,7 +55,7 @@ struct env
int paragraph_is_open;
int current_indent;
int fill_column;
-} envs[MAXCOLS]; /* the environment table */
+} envs[MAXCOLS]; /* the environment table */
/* index in environment table of currently selected environment */
static int current_env_no;
@@ -67,6 +67,40 @@ static int last_column;
to be drawn, separating rows and columns in the current multitable. */
static int hsep, vsep;
+/* Output a row. Have to keep `output_position' up-to-date for each
+ character we output, or the tags table will be off, leading to
+ chopped-off output files and undefined nodes (because they're in the
+ wrong file, etc.). Perhaps it would be better to accumulate this
+ value somewhere and add it once at the end of the table, or return it
+ as the value, but this seems simplest. */
+static void
+out_char (ch)
+ int ch;
+{
+ extern int output_position;
+ putc (ch, output_stream);
+ output_position++;
+}
+
+
+void
+draw_horizontal_separator ()
+{
+ int i, j, s;
+
+ for (s = 0; s < envs[0].current_indent; s++)
+ out_char (' ');
+ if (vsep)
+ out_char ('+');
+ for (i = 1; i <= last_column; i++) {
+ for (j = 0; j <= envs[i].fill_column; j++)
+ out_char ('-');
+ if (vsep)
+ out_char ('+');
+ }
+ out_char ('\n');
+}
+
void
do_multitable ()
{
@@ -116,7 +150,7 @@ setup_multitable_parameters ()
char *params = insertion_stack->item_function;
int nchars;
float columnfrac;
- char command[200];
+ char command[200]; /* naughty, should be no fixed limits */
int i = 1;
/* We implement @hsep and @vsep even though TeX doesn't.
@@ -129,22 +163,32 @@ setup_multitable_parameters ()
params++;
if (*params == '@') {
- sscanf (params, "%s%n", command, &nchars);
+ sscanf (params, "%200s", command);
+ nchars = strlen (command);
params += nchars;
if (strcmp (command, "@hsep") == 0)
- hsep++;
+ hsep++;
else if (strcmp (command, "@vsep") == 0)
- vsep++;
+ vsep++;
else if (strcmp (command, "@columnfractions") == 0) {
- /* Clobber old environments and create new ones,
- starting at #1. Environment #0 is the normal standard output,
- so we don't mess with it. */
- for ( ; i <= MAXCOLS; i++) {
- if (sscanf (params, "%f%n", &columnfrac, &nchars) < 1)
- goto done;
- params += nchars;
- setup_output_environment (i, (int) (columnfrac * fill_column + .5));
- }
+ /* Clobber old environments and create new ones, starting at #1.
+ Environment #0 is the normal output, so don't mess with it. */
+ for ( ; i <= MAXCOLS; i++) {
+ if (sscanf (params, "%f", &columnfrac) < 1)
+ goto done;
+ /* Unfortunately, can't use %n since some m68k-hp-bsd libc
+ doesn't support it. So skip whitespace (preceding the
+ number) and then non-whitespace (the number). */
+ while (*params && (*params == ' ' || *params == '\t'))
+ params++;
+ /* Hmm, but what what @columnfractions 3foo. Well, I suppose
+ it's invalid input anyway. */
+ while (*params && *params != ' ' && *params != '\t'
+ && *params != '\n' && *params != '@')
+ params++;
+ setup_output_environment (i,
+ (int) (columnfrac * (fill_column - current_indent) + .5));
+ }
}
} else if (*params == '{') {
@@ -154,18 +198,17 @@ setup_multitable_parameters ()
}
/* This gives us two spaces between columns. Seems reasonable.
Really should expand the text, though, so a template of
- `@code{foo}' has a width of three, not ten. Also have to match
- braces, then. */
+ `@code{foo}' has a width of five, not ten. Also have to match
+ braces, then. How to take into account current_indent here? */
setup_output_environment (i++, params++ - start);
} else {
- warning ("ignoring stray text `%s' after @multitable", params);
+ warning (_("ignoring stray text `%s' after @multitable"), params);
break;
}
}
done:
-
flush_output ();
inhibit_output_flushing ();
@@ -227,12 +270,12 @@ select_output_environment (n)
}
/* advance to the next environment number */
-int
+void
nselect_next_environment ()
{
if (current_env_no >= last_column) {
- line_error ("Too many columns in multitable item (max %d)", last_column);
- return 1;
+ line_error (_("Too many columns in multitable item (max %d)"), last_column);
+ return;
}
select_output_environment (current_env_no + 1);
}
@@ -240,12 +283,25 @@ nselect_next_environment ()
static void output_multitable_row ();
+/* do anything needed at the beginning of processing a
+ multitable column. */
+void
+init_column ()
+{
+ /* don't indent 1st paragraph in the item */
+ cm_noindent ();
+
+ /* throw away possible whitespace after @item or @tab command */
+ skip_whitespace ();
+}
+
/* start a new item (row) of a multitable */
+int
multitable_item ()
{
if (!multitable_active) {
/* impossible, I think. */
- error ("multitable item not in active multitable");
+ error (_("multitable item not in active multitable"));
exit (1);
}
if (current_env_no > 0) {
@@ -254,7 +310,7 @@ multitable_item ()
/* start at column 1 */
select_output_environment (1);
if (!output_paragraph) {
- line_error ("Cannot select column #%d in multitable", current_env_no);
+ line_error (_("Cannot select column #%d in multitable"), current_env_no);
exit (FATAL);
}
@@ -263,38 +319,10 @@ multitable_item ()
return 0;
}
-/* do anything needed at the beginning of processing a
- multitable column. */
-init_column ()
-{
- /* don't indent 1st paragraph in the item */
- cm_noindent ();
-
- /* throw away possible whitespace after @item or @tab command */
- skip_whitespace ();
-}
-
-/* Output a row. Have to keep `output_position' up-to-date for each
- character we output, or the tags table will be off, leading to
- chopped-off output files and undefined nodes (because they're in the
- wrong file, etc.). Perhaps it would be better to accumulate this
- value somewhere and add it once at the end of the table, or return it
- as the value, but this seems simplest. */
-
-static void
-out_char (ch)
- int ch;
-{
- extern int output_position;
- putc (ch, output_stream);
- output_position++;
-}
-
-
static void
output_multitable_row ()
{
- int i, j, remaining;
+ int i, j, s, remaining;
/* offset in the output paragraph of the next char needing
to be output for that column. */
@@ -325,29 +353,34 @@ output_multitable_row ()
/* first, see if there is any work to do */
for (i = 1; i <= last_column; i++) {
if (CHAR_ADDR (0) < envs[i].output_paragraph_offset) {
- remaining = 1;
- break;
+ remaining = 1;
+ break;
}
}
if (!remaining)
break;
-
+
+ for (s = 0; s < envs[0].current_indent; s++)
+ out_char (' ');
+
if (vsep)
out_char ('|');
for (i = 1; i <= last_column; i++) {
+ for (s = 0; i < envs[i].current_indent; s++)
+ out_char (' ');
for (j = 0; CHAR_ADDR (j) < envs[i].output_paragraph_offset; j++) {
- if (CHAR_AT (j) == '\n')
- break;
- out_char (CHAR_AT (j));
+ if (CHAR_AT (j) == '\n')
+ break;
+ out_char (CHAR_AT (j));
}
- offset[i] += j + 1; /* skip last text plus skip the newline */
+ offset[i] += j + 1; /* skip last text plus skip the newline */
for (; j <= envs[i].fill_column; j++)
- out_char (' ');
+ out_char (' ');
if (vsep)
- out_char ('|'); /* draw column separator */
+ out_char ('|'); /* draw column separator */
}
- out_char ('\n'); /* end of line */
+ out_char ('\n'); /* end of line */
}
if (hsep)
@@ -363,27 +396,12 @@ output_multitable_row ()
#undef CHAR_AT
#undef CHAR_ADDR
-int
-draw_horizontal_separator ()
-{
- int i, j;
- if (vsep)
- out_char ('+');
- for (i = 1; i <= last_column; i++) {
- for (j = 0; j <= envs[i].fill_column; j++)
- out_char ('-');
- if (vsep)
- out_char ('+');
- }
- out_char ('\n');
-}
-
/* select a new column in current row of multitable */
void
cm_tab ()
{
if (!multitable_active)
- error ("ignoring @tab outside of multitable");
+ error (_("ignoring @tab outside of multitable"));
nselect_next_environment ();
init_column ();
@@ -394,8 +412,6 @@ cm_tab ()
void
end_multitable ()
{
- int i;
-
output_multitable_row ();
/* Multitables cannot be nested. Otherwise, we'd have to save the
@@ -409,10 +425,10 @@ end_multitable ()
uninhibit_output_flushing ();
#if 0
- printf ("** Multicolumn output from last row:\n");
+ printf (_("** Multicolumn output from last row:\n"));
for (i = 1; i <= last_column; i++) {
select_output_environment (i);
- printf ("* column #%d: output = %s\n", i, output_paragraph);
+ printf (_("* column #%d: output = %s\n"), i, output_paragraph);
}
#endif
}
OpenPOWER on IntegriCloud