diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-03-22 20:43:15 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-03-22 20:43:15 +0000 |
commit | 4416273ff4381b941f0b80be5469fc42801ecdd2 (patch) | |
tree | 4ef3666114905be6c619e972c6a78cc06a2f2d12 /texinfo/makeinfo | |
parent | c4694df23695134e4bf060cecf84db6f35eec06b (diff) | |
download | gcc-4416273ff4381b941f0b80be5469fc42801ecdd2.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r18765,
which included commits to RCS files with non-trunk default branches.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@18766 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'texinfo/makeinfo')
-rw-r--r-- | texinfo/makeinfo/Makefile.in | 309 | ||||
-rw-r--r-- | texinfo/makeinfo/makeinfo.h | 62 | ||||
-rw-r--r-- | texinfo/makeinfo/multi.c | 192 |
3 files changed, 368 insertions, 195 deletions
diff --git a/texinfo/makeinfo/Makefile.in b/texinfo/makeinfo/Makefile.in index fe81fcdff5e..842b26e19d2 100644 --- a/texinfo/makeinfo/Makefile.in +++ b/texinfo/makeinfo/Makefile.in @@ -1,116 +1,271 @@ -# Makefile for GNU makeinfo. -# $Id: Makefile.in,v 1.1 1997/08/21 22:58:07 jason Exp $ -# -# Copyright (C) 1993, 96 Free Software Foundation, Inc. +# Makefile.in generated automatically by automake 1.2 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 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -#### 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@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include -common = $(srcdir)/../libtxi +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ -EXEEXT = @EXEEXT@ -CC = @CC@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = true +PRE_INSTALL = true +POST_INSTALL = true +NORMAL_UNINSTALL = true +PRE_UNINSTALL = true +POST_UNINSTALL = true +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +DATADIRNAME = @DATADIRNAME@ +EXEEXT = @EXEEXT@ +GENCAT = @GENCAT@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GT_NO = @GT_NO@ +GT_YES = @GT_YES@ +INSTOBJEXT = @INSTOBJEXT@ +INTLDEPS = @INTLDEPS@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +PACKAGE = @PACKAGE@ +POFILES = @POFILES@ +POSUB = @POSUB@ +RANLIB = @RANLIB@ +TERMLIBS = @TERMLIBS@ +TEXCONFIG = @TEXCONFIG@ +TEXMF = @TEXMF@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +l = @l@ + +bin_PROGRAMS = makeinfo + +localedir = $(datadir)/locale +INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\" +LDADD = ../lib/libtxi.a @INTLLIBS@ + +makeinfo_SOURCES = makeinfo.c makeinfo.h multi.c + +EXTRA_DIST = README +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +bin_PROGRAMS = makeinfo$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I.. +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +makeinfo_OBJECTS = makeinfo.o multi.o +makeinfo_LDADD = $(LDADD) +makeinfo_DEPENDENCIES = ../lib/libtxi.a +makeinfo_LDFLAGS = +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = README Makefile.am Makefile.in -LN = ln -RM = rm -f -MKDIR = mkdir -DEFS = @DEFS@ -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 = @bindir@ -# Prefix for each installed program, normally empty or `g'. -binprefix = -infodir = @infodir@ +.SUFFIXES: +.SUFFIXES: .c .o +$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --cygnus makeinfo/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-binPROGRAMS: -#### End of system configuration section. #### +clean-binPROGRAMS: + test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) -SRCS = makeinfo.c multi.c -OBJS = makeinfo.o multi.o +distclean-binPROGRAMS: -PROGS = makeinfo$(EXEEXT) +maintainer-clean-binPROGRAMS: -all: $(PROGS) makeinfo.info -sub-all: all +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 $< + +mostlyclean-compile: + rm -f *.o core + +clean-compile: + +distclean-compile: + rm -f *.tab.c + +maintainer-clean-compile: + +makeinfo$(EXEEXT): $(makeinfo_OBJECTS) $(makeinfo_DEPENDENCIES) + @rm -f makeinfo$(EXEEXT) + $(LINK) $(makeinfo_LDFLAGS) $(makeinfo_OBJECTS) $(makeinfo_LDADD) $(LIBS) + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) + here=`pwd` && cd $(srcdir) && mkid -f$$here/ID $(SOURCES) $(HEADERS) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) + tags=; \ + here=`pwd`; \ + test -z "$(ETAGS_ARGS)$(SOURCES)$(HEADERS)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $(SOURCES) $(HEADERS) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = makeinfo -makeinfo$(EXEEXT): $(OBJS) ../libtxi/libtxi.a - $(CC) $(LDFLAGS) -o makeinfo $(OBJS) $(LOADLIBES) +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file; \ + done +info: +dvi: +check: all + $(MAKE) +installcheck: +install-info: +install-exec: install-binPROGRAMS + @$(NORMAL_INSTALL) -../libtxi/libtxi.a: - (cd ../libtxi && $(MAKE) $(MFLAGS) libtxi.a) +install-data: + @$(NORMAL_INSTALL) -makeinfo.o: makeinfo.c $(common)/getopt.h +install: install-exec install-data all + @: -$(OBJS): makeinfo.h +uninstall: uninstall-binPROGRAMS -info makeinfo.info: ./makeinfo makeinfo.texi #macro.texi - ./makeinfo --no-split -I$(srcdir) makeinfo.texi +all: Makefile $(PROGRAMS) -# makeinfo.texi: ./makeinfo makeinfo.mki -# ./makeinfo -E makeinfo.texi -I$(srcdir) makeinfo.mki +install-strip: + $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install +installdirs: + $(mkinstalldirs) $(bindir) -dvi makeinfo.dvi: ./makeinfo makeinfo.texi #macro.texi - $(srcdir)/../util/texi2dvi makeinfo.txi -install: all - $(INSTALL_PROGRAM) makeinfo$(EXEEXT) $(bindir)/$(binprefix)makeinfo$(EXEEXT) - -d=$(srcdir); test -f ./makeinfo.info && d=.; $(INSTALL_DATA) $$d/makeinfo.info $(infodir)/makeinfo.info - $(POST_INSTALL) +mostlyclean-generic: + test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) -install-info: - -d=$(srcdir); test -f ./makeinfo.info && d=.; $(INSTALL_DATA) $$d/makeinfo.info $(infodir)/makeinfo.info - ../util/install-info --info-dir=$(infodir) $(infodir)/makeinfo.info +clean-generic: + test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) -uninstall: - for f in $(PROGS); do rm -f $(bindir)/$(binprefix)$$f; done - rm -f $(infodir)/makeinfo.info +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) -TAGS: $(SRCS) - etags $(SRCS) +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 -clean: - rm -f *.o a.out core core.* $(PROGS) +clean: clean-binPROGRAMS clean-compile clean-tags clean-generic \ + mostlyclean -mostlyclean: clean +distclean: distclean-binPROGRAMS distclean-compile distclean-tags \ + distclean-generic clean + rm -f config.status -distclean: clean - rm -f TAGS Makefile config.status *.info */*.info +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." -realclean: distclean -maintainer-clean: distclean +.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-info install-exec install-data install uninstall all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean -Makefile: Makefile.in ../config.status - cd .. && sh config.status -# Prevent GNU make v3 from overflowing arg limit on SysV. +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/texinfo/makeinfo/makeinfo.h b/texinfo/makeinfo/makeinfo.h index 399764eb88b..205a3bdf041 100644 --- a/texinfo/makeinfo/makeinfo.h +++ b/texinfo/makeinfo/makeinfo.h @@ -1,7 +1,7 @@ /* makeinfo.h -- Declarations for Makeinfo. - $Id: makeinfo.h,v 1.1 1997/08/21 22:58:08 jason Exp $ + $Id: makeinfo.h,v 1.3 1997/07/15 18:28:38 karl Exp $ - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 97 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify 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/texinfo/makeinfo/multi.c b/texinfo/makeinfo/multi.c index 5d4bb70b28e..99c380d3dd9 100644 --- a/texinfo/makeinfo/multi.c +++ b/texinfo/makeinfo/multi.c @@ -1,7 +1,7 @@ -/* multi.c -- Multitable stuff for makeinfo. - $Id: multi.c,v 1.1 1997/08/21 22:58:08 jason 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 } |