aboutsummaryrefslogtreecommitdiff
path: root/texinfo/util
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1998-03-22 13:43:15 -0700
committerJeff Law <law@gcc.gnu.org>1998-03-22 13:43:15 -0700
commit8491377bd19a528b1249b3a6ad67277d813720fc (patch)
tree4ef3666114905be6c619e972c6a78cc06a2f2d12 /texinfo/util
parent7e98cc1669aa89f173041d8be8156db0f7bcdaec (diff)
downloadgcc-8491377bd19a528b1249b3a6ad67277d813720fc.zip
gcc-8491377bd19a528b1249b3a6ad67277d813720fc.tar.gz
gcc-8491377bd19a528b1249b3a6ad67277d813720fc.tar.bz2
This commit was generated by cvs2svn to compensate for changes in r18765,
which included commits to RCS files with non-trunk default branches. From-SVN: r18766
Diffstat (limited to 'texinfo/util')
-rw-r--r--texinfo/util/Makefile.in354
-rwxr-xr-xtexinfo/util/gen-dir-node11
-rwxr-xr-xtexinfo/util/texi2dvi37
-rw-r--r--texinfo/util/texindex.c693
4 files changed, 631 insertions, 464 deletions
diff --git a/texinfo/util/Makefile.in b/texinfo/util/Makefile.in
index 9108632..a848e61 100644
--- a/texinfo/util/Makefile.in
+++ b/texinfo/util/Makefile.in
@@ -1,105 +1,323 @@
-# Makefile for GNU Texindex and other utilities.
-# $Id: Makefile.in,v 1.1 1997/08/21 22:58:12 jason Exp $
-#
-# Copyright (C) 1990, 91, 92, 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.
+SHELL = /bin/sh
-# 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.
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
-#### Start of system configuration section. ####
+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
-srcdir = @srcdir@
-VPATH = $(srcdir):$(common)
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
-common = $(srcdir)/../libtxi
+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@
-LN = ln
-RM = rm -f
-MKDIR = mkdir
+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@
-DEFS = @DEFS@
-LIBS = -L../libtxi -ltxi @LIBS@
-LOADLIBES = $(LIBS)
+bin_PROGRAMS = texindex
+bin_SCRIPTS = texi2dvi
-SHELL = /bin/sh
+noinst_PROGRAMS = install-inf
+install_inf_SOURCES = install-info.c
-CFLAGS = @CFLAGS@
+localedir = $(datadir)/locale
+INCLUDES = -I$(top_srcdir)/lib -I../intl -DLOCALEDIR=\"$(localedir)\"
+LDADD = ../lib/libtxi.a @INTLLIBS@
+
+EXTRA_DIST = README deref.c fixfonts gen-dir-node tex3patch texi2dvi \
+ update-info
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES =
+bin_PROGRAMS = texindex$(EXEEXT)
+noinst_PROGRAMS = install-inf$(EXEEXT)
+PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I..
+CPPFLAGS = @CPPFLAGS@
LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+texindex_SOURCES = texindex.c
+texindex_OBJECTS = texindex.o
+texindex_LDADD = $(LDADD)
+texindex_DEPENDENCIES = ../lib/libtxi.a
+texindex_LDFLAGS =
+install_inf_OBJECTS = install-info.o
+install_inf_LDADD = $(LDADD)
+install_inf_DEPENDENCIES = ../lib/libtxi.a
+install_inf_LDFLAGS =
+SCRIPTS = $(bin_SCRIPTS)
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-bindir = @bindir@
-# Prefix for each installed program, normally empty or `g'.
-binprefix =
-# Prefix for each installed man page, normally empty or `g'.
-manprefix =
-mandir = @mandir@/man1
-manext = 1
-infodir = @infodir@
+CFLAGS = @CFLAGS@
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
+LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON = README Makefile.am Makefile.in
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP = --best
+SOURCES = texindex.c $(install_inf_SOURCES)
+OBJECTS = texindex.o $(install_inf_OBJECTS)
+
+default: all
+
+.SUFFIXES:
+.SUFFIXES: .c .o
+$(srcdir)/Makefile.in: @MAINT@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --cygnus util/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)
-all: texindex$(EXEEXT) install-info$(EXEEXT)
-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
+
+mostlyclean-noinstPROGRAMS:
+
+clean-noinstPROGRAMS:
+ test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+
+distclean-noinstPROGRAMS:
+
+maintainer-clean-noinstPROGRAMS:
.c.o:
- $(CC) -c $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) -I$(common) $(CFLAGS) $<
+ $(COMPILE) -c $<
+mostlyclean-compile:
+ rm -f *.o core
-install: all
- $(INSTALL_PROGRAM) texindex$(EXEEXT) $(bindir)/texindex$(EXEEXT)
- $(INSTALL_PROGRAM) $(srcdir)/texi2dvi $(bindir)/texi2dvi
- $(INSTALL_PROGRAM) install-info$(EXEEXT) $(bindir)/install-info$(EXEEXT)
+clean-compile:
-install-info:
+distclean-compile:
+ rm -f *.tab.c
+
+maintainer-clean-compile:
+
+texindex$(EXEEXT): $(texindex_OBJECTS) $(texindex_DEPENDENCIES)
+ @rm -f texindex$(EXEEXT)
+ $(LINK) $(texindex_LDFLAGS) $(texindex_OBJECTS) $(texindex_LDADD) $(LIBS)
+
+install-inf$(EXEEXT): $(install_inf_OBJECTS) $(install_inf_DEPENDENCIES)
+ @rm -f install-inf$(EXEEXT)
+ $(LINK) $(install_inf_LDFLAGS) $(install_inf_OBJECTS) $(install_inf_LDADD) $(LIBS)
+
+install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(bindir)
+ @list='$(bin_SCRIPTS)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo " $(INSTALL_SCRIPT) $$p $(bindir)/`echo $$p|sed '$(transform)'`$(EXEEXT)"; \
+ $(INSTALL_SCRIPT) $$p $(bindir)/`echo $$p|sed '$(transform)'`$(EXEEXT); \
+ else if test -f $(srcdir)/$$p; then \
+ echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(bindir)/`echo $$p|sed '$(transform)'`$(EXEEXT)"; \
+ $(INSTALL_SCRIPT) $(srcdir)/$$p $(bindir)/`echo $$p|sed '$(transform)'`$(EXEEXT); \
+ else :; fi; fi; \
+ done
+
+uninstall-binSCRIPTS:
+ $(NORMAL_UNINSTALL)
+ list='$(bin_SCRIPTS)'; for p in $$list; do \
+ rm -f $(bindir)/`echo $$p|sed '$(transform)'`; \
+ done
+
+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 = util
+
+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 install-binSCRIPTS install-exec-local
+ @$(NORMAL_INSTALL)
+
+install-data:
+ @$(NORMAL_INSTALL)
+
+install: install-exec install-data all
+ @:
+
+uninstall: uninstall-binPROGRAMS uninstall-binSCRIPTS
+
+all: Makefile $(PROGRAMS) $(SCRIPTS)
+
+install-strip:
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install
+installdirs:
+ $(mkinstalldirs) $(bindir) $(bindir)
-uninstall:
- rm -f $(bindir)/texindex$(EXEEXT) $(bindir)/texi2dvi $(bindir)/install-info$(EXEEXT)
-Makefile: Makefile.in ../config.status
- cd ..; $(SHELL) config.status
+mostlyclean-generic:
+ test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
-TAGS:
- etags *.c *.h $(common)/getopt*.c $(common)/getopt.h
+clean-generic:
+ test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
-clean:
- rm -f *.o a.out core core.* texindex install-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)
-mostlyclean: clean
+maintainer-clean-generic:
+ test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+ test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+mostlyclean: mostlyclean-binPROGRAMS mostlyclean-noinstPROGRAMS \
+ mostlyclean-compile mostlyclean-tags \
+ mostlyclean-generic
-distclean: clean
- rm -f Makefile config.status
+clean: clean-binPROGRAMS clean-noinstPROGRAMS clean-compile clean-tags \
+ clean-generic mostlyclean
-realclean: distclean
- rm -f TAGS
+distclean: distclean-binPROGRAMS distclean-noinstPROGRAMS \
+ distclean-compile distclean-tags distclean-generic \
+ clean
+ rm -f config.status
-texindex: texindex.o ../libtxi/libtxi.a
- $(CC) $(LDFLAGS) -o texindex texindex.o $(LOADLIBES)
+maintainer-clean: maintainer-clean-binPROGRAMS \
+ maintainer-clean-noinstPROGRAMS \
+ 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."
-texindex.o: texindex.c $(common)/getopt.h
+.PHONY: default mostlyclean-binPROGRAMS distclean-binPROGRAMS \
+clean-binPROGRAMS maintainer-clean-binPROGRAMS uninstall-binPROGRAMS \
+install-binPROGRAMS mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \
+clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile uninstall-binSCRIPTS install-binSCRIPTS 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
-install-info: install-info.o
- $(CC) $(LDFLAGS) -o install-info install-info.o $(LOADLIBES)
-install-info.o: install-info.c $(common)/getopt.h
+install-exec-local: $(noinst_PROGRAMS)
+ $(mkinstalldirs) $(bindir)
+ $(INSTALL_PROGRAM) install-inf$(EXEEXT) $(bindir)/`echo install-info$(EXEEXT)|sed '$(transform)'`; \
-# 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/util/gen-dir-node b/texinfo/util/gen-dir-node
index ed82504..c7ef670 100755
--- a/texinfo/util/gen-dir-node
+++ b/texinfo/util/gen-dir-node
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: gen-dir-node,v 1.1 1997/08/21 22:58:12 jason Exp $
+# $Id: gen-dir-node,v 1.1 1997/05/22 22:02:43 karl Exp $
# Generate the top-level Info node, given a directory of Info files
# and (optionally) a skeleton file. The output will be suitable for a
# top-level dir file. The skeleton file contains info topic names in the
@@ -164,9 +164,14 @@ else
fi
for file in ${infofiles}; do
+ case $file in
+ *.gz) zcat=zcat; file=`echo $file|sed 's/\.gz$//'`; gz=.gz;;
+ *) zcat=cat; gz=;;
+ esac
infoname=`echo $file | sed 's/\.info$//'`
- entry=`sed -e '1,/START-INFO-DIR-ENTRY/d' \
- -e '/END-INFO-DIR-ENTRY/,$d' ${INFODIR}/${file}`
+ entry=`$zcat ${INFODIR}/${file}$gz \
+ |sed -e '1,/START-INFO-DIR-ENTRY/d' \
+ -e '/END-INFO-DIR-ENTRY/,$d'`
if [ ! -z "${entry}" ] ; then
echo "${entry}"
diff --git a/texinfo/util/texi2dvi b/texinfo/util/texi2dvi
index d9f1b3e..67a9512 100755
--- a/texinfo/util/texi2dvi
+++ b/texinfo/util/texi2dvi
@@ -3,7 +3,7 @@
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
-# $Id: texi2dvi,v 1.1 1997/08/21 22:58:13 jason Exp $
+# $Id: texi2dvi,v 0.6 1997/07/14 19:23:18 karl Exp $
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -47,7 +47,7 @@
progname=`echo "$0" | sed -e 's/[^\/]*\///g'`
# This string is expanded by rcs automatically when this file is checked out.
-rcs_revision='$Revision: 1.1 $'
+rcs_revision='$Revision: 0.6 $'
version=`set - $rcs_revision; echo $2`
# To prevent hairy quoting and escaping later.
@@ -329,39 +329,6 @@ done
$verbose "$0 done."
true # exit successfully.
-
-# texi2dvi ends here
-# $Log: texi2dvi,v $
-# Revision 1.1 1997/08/21 22:58:13 jason
-# Initial revision
-#
-# Revision 1.10 1996/10/04 18:21:55 karl
-# Include only the current year in the copyright message.
-#
-# Revision 1.9 1996/10/04 11:49:48 karl
-# Exit successfully. From arnold.
-#
-# Revision 1.8 1996/10/03 23:14:26 karl
-# Only show diff if verbose.
-# Update version number.
-#
-# Revision 1.7 1996/09/29 22:56:08 karl
-# Use $progname instead of $0 for --version.
-#
-# Revision 1.6 1996/09/28 21:01:23 karl
-# Recompute original index files each time through loop.
-# Make indentation uniform.
-# Use same basename for the temp input files.
-# Standardize --version output.
-#
-# Revision 1.5 1996/09/26 14:46:34 karl
-# (texi2dvi): Run TeX until the aux/index files stabilize, instead of just
-# twice. From: David Shaw <daves@gsms01.alcatel.com.au>.
-#
-# Revision 1.4 1996/08/27 18:59:26 karl
-# Include bug reporting address.
-#
-# Revision 1.3 1996/07/26 18:20:56 karl
# Do macro expansion with makeinfo before running TeX.
# Various expansion safety measures added for test; avoid use of -o.
#
diff --git a/texinfo/util/texindex.c b/texinfo/util/texindex.c
index 306aa1f..2b3bd20 100644
--- a/texinfo/util/texindex.c
+++ b/texinfo/util/texindex.c
@@ -1,7 +1,7 @@
/* Prepare TeX index dribble output into an actual index.
- $Id: texindex.c,v 1.1 1997/08/21 22:58:13 jason Exp $
+ $Id: texindex.c,v 1.17 1997/07/24 23:34:45 karl Exp $
- Copyright (C) 1987, 91, 92, 96 Free Software Foundation, Inc.
+ Copyright (C) 1987, 91, 92, 96, 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,12 +17,8 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307. */
-#include <stdio.h>
-#include <ctype.h>
-#include <errno.h>
-#include "getopt.h"
-
-#define TEXINDEX_VERSION_STRING "GNU Texindex (Texinfo 3.9) 2.1"
+#include "system.h"
+#include <getopt.h>
#if defined (emacs)
# include "../src/config.h"
@@ -33,26 +29,6 @@
# undef open
#endif
-#if defined (HAVE_STRING_H)
-# include <string.h>
-#endif /* HAVE_STRING_H */
-
-#if !defined (HAVE_STRCHR)
-char *strrchr ();
-#endif /* !HAVE_STRCHR */
-
-#if defined (STDC_HEADERS)
-# include <stdlib.h>
-#else /* !STDC_HEADERS */
-char *getenv (), *malloc (), *realloc ();
-#endif /* !STDC_HEADERS */
-
-#if defined (HAVE_UNISTD_H)
-# include <unistd.h>
-#else /* !HAVE_UNISTD_H */
-off_t lseek ();
-#endif /* !HAVE_UNISTD_H */
-
#if !defined (HAVE_MEMSET)
#undef memset
#define memset(ptr, ignore, count) bzero (ptr, count)
@@ -89,38 +65,31 @@ char *mktemp ();
# define SEEK_END 2
#endif /* !SEEK_SET */
-#ifndef errno
-extern int errno;
-#endif
-#ifndef strerror
-extern char *strerror ();
-#endif
-
/* When sorting in core, this structure describes one line
and the position and length of its first keyfield. */
struct lineinfo
{
- char *text; /* The actual text of the line. */
+ char *text; /* The actual text of the line. */
union {
- char *text; /* The start of the key (for textual comparison). */
- long number; /* The numeric value (for numeric comparison). */
+ char *text; /* The start of the key (for textual comparison). */
+ long number; /* The numeric value (for numeric comparison). */
} key;
- long keylen; /* Length of KEY field. */
+ long keylen; /* Length of KEY field. */
};
/* This structure describes a field to use as a sort key. */
struct keyfield
{
- int startwords; /* Number of words to skip. */
- int startchars; /* Number of additional chars to skip. */
- int endwords; /* Number of words to ignore at end. */
- int endchars; /* Ditto for characters of last word. */
- char ignore_blanks; /* Non-zero means ignore spaces and tabs. */
- char fold_case; /* Non-zero means case doesn't matter. */
- char reverse; /* Non-zero means compare in reverse order. */
- char numeric; /* Non-zeros means field is ASCII numeric. */
- char positional; /* Sort according to file position. */
- char braced; /* Count balanced-braced groupings as fields. */
+ int startwords; /* Number of words to skip. */
+ int startchars; /* Number of additional chars to skip. */
+ int endwords; /* Number of words to ignore at end. */
+ int endchars; /* Ditto for characters of last word. */
+ char ignore_blanks; /* Non-zero means ignore spaces and tabs. */
+ char fold_case; /* Non-zero means case doesn't matter. */
+ char reverse; /* Non-zero means compare in reverse order. */
+ char numeric; /* Non-zeros means field is ASCII numeric. */
+ char positional; /* Sort according to file position. */
+ char braced; /* Count balanced-braced groupings as fields. */
};
/* Vector of keyfields to use. */
@@ -214,6 +183,15 @@ main (argc, argv)
else
program_name = argv[0];
+#ifdef HAVE_SETLOCALE
+ /* Set locale via LC_ALL. */
+ setlocale (LC_ALL, "");
+#endif
+
+ /* Set the text message domain. */
+ bindtextdomain (PACKAGE, LOCALEDIR);
+ textdomain (PACKAGE);
+
/* Describe the kind of sorting to do. */
/* The first keyfield uses the first braced field and folds case. */
keyfields[0].braced = 1;
@@ -247,7 +225,7 @@ main (argc, argv)
desc = open (infiles[i], O_RDONLY, 0);
if (desc < 0)
- pfatal_with_name (infiles[i]);
+ pfatal_with_name (infiles[i]);
lseek (desc, (off_t) 0, SEEK_END);
ptr = (long) lseek (desc, (off_t) 0, SEEK_CUR);
@@ -255,15 +233,15 @@ main (argc, argv)
outfile = outfiles[i];
if (!outfile)
- {
- outfile = concat (infiles[i], "s", "");
- }
+ {
+ outfile = concat (infiles[i], "s", "");
+ }
if (ptr < MAX_IN_CORE_SORT)
- /* Sort a small amount of data. */
- sort_in_core (infiles[i], ptr, outfile);
+ /* Sort a small amount of data. */
+ sort_in_core (infiles[i], ptr, outfile);
else
- sort_offline (infiles[i], ptr, outfile);
+ sort_offline (infiles[i], ptr, outfile);
}
flush_tempfiles (tempcount);
@@ -282,15 +260,15 @@ typedef struct
TEXINDEX_OPTION texindex_options[] = {
{ "--keep", "-k", &keep_tempfiles, 1, (char *)NULL,
- "keep temporary files around after processing" },
+ N_("keep temporary files around after processing") },
{ "--no-keep", 0, &keep_tempfiles, 0, (char *)NULL,
- "do not keep temporary files around after processing (default)" },
+ N_("do not keep temporary files around after processing (default)") },
{ "--output", "-o", (int *)NULL, 0, "FILE",
- "send output to FILE" },
+ N_("send output to FILE") },
{ "--version", (char *)NULL, (int *)NULL, 0, (char *)NULL,
- "display version information and exit" },
+ N_("display version information and exit") },
{ "--help", "-h", (int *)NULL, 0, (char *)NULL,
- "display this help and exit" },
+ N_("display this help and exit") },
{ (char *)NULL, (char *)NULL, (int *)NULL, 0, (char *)NULL }
};
@@ -301,25 +279,25 @@ usage (result_value)
register int i;
FILE *f = result_value ? stderr : stdout;
- fprintf (f, "Usage: %s [OPTION]... FILE...\n", program_name);
- fprintf (f, "Generate a sorted index for each TeX output FILE.\n");
+ fprintf (f, _("Usage: %s [OPTION]... FILE...\n"), program_name);
+ fprintf (f, _("Generate a sorted index for each TeX output FILE.\n"));
/* Avoid trigraph nonsense. */
- fprintf (f, "Usually FILE... is `foo.??\' for a document `foo.texi'.\n");
- fprintf (f, "\nOptions:\n");
+ fprintf (f, _("Usually FILE... is `foo.??\' for a document `foo.texi'.\n"));
+ fprintf (f, _("\nOptions:\n"));
for (i = 0; texindex_options[i].long_name; i++)
{
if (texindex_options[i].short_name)
- fprintf (f, "%s, ", texindex_options[i].short_name);
+ fprintf (f, "%s, ", texindex_options[i].short_name);
fprintf (f, "%s %s",
- texindex_options[i].long_name,
- texindex_options[i].arg_name
+ texindex_options[i].long_name,
+ texindex_options[i].arg_name
? texindex_options[i].arg_name : "");
- fprintf (f, "\t%s\n", texindex_options[i].doc_string);
+ fprintf (f, "\t%s\n", _(texindex_options[i].doc_string));
}
- puts ("\nEmail bug reports to bug-texinfo@prep.ai.mit.edu.");
+ puts (_("\nEmail bug reports to bug-texinfo@prep.ai.mit.edu."));
exit (result_value);
}
@@ -333,7 +311,6 @@ decode_command (argc, argv)
char **argv;
{
int arg_index = 1;
- int optc;
char **ip;
char **op;
@@ -364,46 +341,46 @@ decode_command (argc, argv)
char *arg = argv[arg_index++];
if (*arg == '-')
- {
- if (strcmp (arg, "--version") == 0)
- {
- puts (TEXINDEX_VERSION_STRING);
-puts ("Copyright (C) 1996 Free Software Foundation, Inc.\n\
+ {
+ if (strcmp (arg, "--version") == 0)
+ {
+ printf (_("texindex (GNU %s %s) 2.1\n"), PACKAGE, VERSION);
+puts (_("Copyright (C) 1996 Free Software Foundation, Inc.\n\
There is NO warranty. You may redistribute this software\n\
under the terms of the GNU General Public License.\n\
-For more information about these matters, see the files named COPYING.");
- exit (0);
- }
- else if ((strcmp (arg, "--keep") == 0) ||
- (strcmp (arg, "-k") == 0))
- {
- keep_tempfiles = 1;
- }
- else if ((strcmp (arg, "--help") == 0) ||
- (strcmp (arg, "-h") == 0))
- {
- usage (0);
- }
- else if ((strcmp (arg, "--output") == 0) ||
- (strcmp (arg, "-o") == 0))
- {
- if (argv[arg_index] != (char *)NULL)
- {
- arg_index++;
- if (op > outfiles)
- *(op - 1) = argv[arg_index];
- }
- else
- usage (1);
- }
- else
- usage (1);
- }
+For more information about these matters, see the files named COPYING."));
+ exit (0);
+ }
+ else if ((strcmp (arg, "--keep") == 0) ||
+ (strcmp (arg, "-k") == 0))
+ {
+ keep_tempfiles = 1;
+ }
+ else if ((strcmp (arg, "--help") == 0) ||
+ (strcmp (arg, "-h") == 0))
+ {
+ usage (0);
+ }
+ else if ((strcmp (arg, "--output") == 0) ||
+ (strcmp (arg, "-o") == 0))
+ {
+ if (argv[arg_index] != (char *)NULL)
+ {
+ arg_index++;
+ if (op > outfiles)
+ *(op - 1) = argv[arg_index];
+ }
+ else
+ usage (1);
+ }
+ else
+ usage (1);
+ }
else
- {
- *ip++ = arg;
- *op++ = (char *)NULL;
- }
+ {
+ *ip++ = arg;
+ *op++ = (char *)NULL;
+ }
}
/* Record number of keyfields and terminate list of filenames. */
@@ -459,7 +436,7 @@ tempcopy (idesc)
int nread = read (idesc, buffer, BUFSIZE);
write (odesc, buffer, nread);
if (!nread)
- break;
+ break;
}
close (odesc);
@@ -485,16 +462,16 @@ compare_full (line1, line2)
char *start1 = find_field (&keyfields[i], *line1, &length1);
char *start2 = find_field (&keyfields[i], *line2, &length2);
int tem = compare_field (&keyfields[i], start1, length1, *line1 - text_base,
- start2, length2, *line2 - text_base);
+ start2, length2, *line2 - text_base);
if (tem)
- {
- if (keyfields[i].reverse)
- return -tem;
- return tem;
- }
+ {
+ if (keyfields[i].reverse)
+ return -tem;
+ return tem;
+ }
}
- return 0; /* Lines match exactly. */
+ return 0; /* Lines match exactly. */
}
/* Compare LINE1 and LINE2, described by structures
@@ -514,19 +491,19 @@ compare_prepared (line1, line2)
if (keyfields->positional)
{
if (line1->text - text_base > line2->text - text_base)
- tem = 1;
+ tem = 1;
else
- tem = -1;
+ tem = -1;
}
else if (keyfields->numeric)
tem = line1->key.number - line2->key.number;
else
tem = compare_field (keyfields, line1->key.text, line1->keylen, 0,
- line2->key.text, line2->keylen, 0);
+ line2->key.text, line2->keylen, 0);
if (tem)
{
if (keyfields->reverse)
- return -tem;
+ return -tem;
return tem;
}
@@ -543,16 +520,16 @@ compare_prepared (line1, line2)
char *start1 = find_field (&keyfields[i], text1, &length1);
char *start2 = find_field (&keyfields[i], text2, &length2);
int tem = compare_field (&keyfields[i], start1, length1, text1 - text_base,
- start2, length2, text2 - text_base);
+ start2, length2, text2 - text_base);
if (tem)
- {
- if (keyfields[i].reverse)
- return -tem;
- return tem;
- }
+ {
+ if (keyfields[i].reverse)
+ return -tem;
+ return tem;
+ }
}
- return 0; /* Lines match exactly. */
+ return 0; /* Lines match exactly. */
}
/* Like compare_full but more general.
@@ -578,16 +555,16 @@ compare_general (str1, str2, pos1, pos2, use_keyfields)
char *start1 = find_field (&keyfields[i], str1, &length1);
char *start2 = find_field (&keyfields[i], str2, &length2);
int tem = compare_field (&keyfields[i], start1, length1, pos1,
- start2, length2, pos2);
+ start2, length2, pos2);
if (tem)
- {
- if (keyfields[i].reverse)
- return -tem;
- return tem;
- }
+ {
+ if (keyfields[i].reverse)
+ return -tem;
+ return tem;
+ }
}
- return 0; /* Lines match exactly. */
+ return 0; /* Lines match exactly. */
}
/* Find the start and length of a field in STR according to KEYFIELD.
@@ -610,23 +587,23 @@ find_field (keyfield, str, lengthptr)
fun = find_pos;
start = (*fun) (str, keyfield->startwords, keyfield->startchars,
- keyfield->ignore_blanks);
+ keyfield->ignore_blanks);
if (keyfield->endwords < 0)
{
if (keyfield->braced)
- end = find_braced_end (start);
+ end = find_braced_end (start);
else
- {
- end = start;
- while (*end && *end != '\n')
- end++;
- }
+ {
+ end = start;
+ while (*end && *end != '\n')
+ end++;
+ }
}
else
{
end = (*fun) (str, keyfield->endwords, keyfield->endchars, 0);
if (end - str < start - str)
- end = start;
+ end = start;
}
*lengthptr = end - start;
return start;
@@ -651,11 +628,11 @@ find_pos (str, words, chars, ignore_blanks)
char c;
/* Find next bunch of nonblanks and skip them. */
while ((c = *p) == ' ' || c == '\t')
- p++;
+ p++;
while ((c = *p) && c != '\n' && !(c == ' ' || c == '\t'))
- p++;
+ p++;
if (!*p || *p == '\n')
- return p;
+ return p;
}
while (*p == ' ' || *p == '\t')
@@ -664,7 +641,7 @@ find_pos (str, words, chars, ignore_blanks)
for (i = 0; i < chars; i++)
{
if (!*p || *p == '\n')
- break;
+ break;
p++;
}
return p;
@@ -688,19 +665,19 @@ find_braced_pos (str, words, chars, ignore_blanks)
{
bracelevel = 1;
while ((c = *p++) != '{' && c != '\n' && c)
- /* Do nothing. */ ;
+ /* Do nothing. */ ;
if (c != '{')
- return p - 1;
+ return p - 1;
while (bracelevel)
- {
- c = *p++;
- if (c == '{')
- bracelevel++;
- if (c == '}')
- bracelevel--;
- if (c == 0 || c == '\n')
- return p - 1;
- }
+ {
+ c = *p++;
+ if (c == '{')
+ bracelevel++;
+ if (c == '}')
+ bracelevel--;
+ if (c == 0 || c == '\n')
+ return p - 1;
+ }
}
while ((c = *p++) != '{' && c != '\n' && c)
@@ -716,7 +693,7 @@ find_braced_pos (str, words, chars, ignore_blanks)
for (i = 0; i < chars; i++)
{
if (!*p || *p == '\n')
- break;
+ break;
p++;
}
return p;
@@ -738,11 +715,11 @@ find_braced_end (str)
{
c = *p++;
if (c == '{')
- bracelevel++;
+ bracelevel++;
if (c == '}')
- bracelevel--;
+ bracelevel--;
if (c == 0 || c == '\n')
- return p - 1;
+ return p - 1;
}
return p - 1;
}
@@ -755,7 +732,7 @@ find_value (start, length)
while (length != 0L)
{
if (isdigit (*start))
- return atol (start);
+ return atol (start);
length--;
start++;
}
@@ -801,17 +778,17 @@ compare_field (keyfield, start1, length1, pos1, start2, length2, pos2)
if (keyfields->positional)
{
if (pos1 > pos2)
- return 1;
+ return 1;
else
- return -1;
+ return -1;
}
if (keyfield->numeric)
{
long value = find_value (start1, length1) - find_value (start2, length2);
if (value > 0)
- return 1;
+ return 1;
if (value < 0)
- return -1;
+ return -1;
return 0;
}
else
@@ -822,46 +799,46 @@ compare_field (keyfield, start1, length1, pos1, start2, length2, pos2)
char *e2 = start2 + length2;
while (1)
- {
- int c1, c2;
-
- if (p1 == e1)
- c1 = 0;
- else
- c1 = *p1++;
- if (p2 == e2)
- c2 = 0;
- else
- c2 = *p2++;
-
- if (char_order[c1] != char_order[c2])
- return char_order[c1] - char_order[c2];
- if (!c1)
- break;
- }
+ {
+ int c1, c2;
+
+ if (p1 == e1)
+ c1 = 0;
+ else
+ c1 = *p1++;
+ if (p2 == e2)
+ c2 = 0;
+ else
+ c2 = *p2++;
+
+ if (char_order[c1] != char_order[c2])
+ return char_order[c1] - char_order[c2];
+ if (!c1)
+ break;
+ }
/* Strings are equal except possibly for case. */
p1 = start1;
p2 = start2;
while (1)
- {
- int c1, c2;
-
- if (p1 == e1)
- c1 = 0;
- else
- c1 = *p1++;
- if (p2 == e2)
- c2 = 0;
- else
- c2 = *p2++;
-
- if (c1 != c2)
- /* Reverse sign here so upper case comes out last. */
- return c2 - c1;
- if (!c1)
- break;
- }
+ {
+ int c1, c2;
+
+ if (p1 == e1)
+ c1 = 0;
+ else
+ c1 = *p1++;
+ if (p2 == e2)
+ c2 = 0;
+ else
+ c2 = *p2++;
+
+ if (c1 != c2)
+ /* Reverse sign here so upper case comes out last. */
+ return c2 - c1;
+ if (!c1)
+ break;
+ }
return 0;
}
@@ -903,17 +880,17 @@ readline (linebuffer, stream)
{
int c = getc (stream);
if (p == end)
- {
- buffer = (char *) xrealloc (buffer, linebuffer->size *= 2);
- p += buffer - linebuffer->buffer;
- end += buffer - linebuffer->buffer;
- linebuffer->buffer = buffer;
- }
+ {
+ buffer = (char *) xrealloc (buffer, linebuffer->size *= 2);
+ p += buffer - linebuffer->buffer;
+ end += buffer - linebuffer->buffer;
+ linebuffer->buffer = buffer;
+ }
if (c < 0 || c == '\n')
- {
- *p = 0;
- break;
- }
+ {
+ *p = 0;
+ break;
+ }
*p++ = c;
}
@@ -946,7 +923,7 @@ sort_offline (infile, nfiles, total, outfile)
if (lb.buffer[0] != '\\' && lb.buffer[0] != '@')
{
- error ("%s: not a texinfo index file", infile);
+ error (_("%s: not a texinfo index file"), infile);
return;
}
@@ -960,34 +937,34 @@ sort_offline (infile, nfiles, total, outfile)
long tempsize = 0;
if (!ostream)
- pfatal_with_name (outname);
+ pfatal_with_name (outname);
tempfiles[i] = outname;
/* Copy lines into this temp file as long as it does not make file
- "too big" or until there are no more lines. */
+ "too big" or until there are no more lines. */
while (tempsize + linelength + 1 <= MAX_IN_CORE_SORT)
- {
- tempsize += linelength + 1;
- fputs (lb.buffer, ostream);
- putc ('\n', ostream);
-
- /* Read another line of input data. */
-
- linelength = readline (&lb, istream);
- if (!linelength && feof (istream))
- break;
-
- if (lb.buffer[0] != '\\' && lb.buffer[0] != '@')
- {
- error ("%s: not a texinfo index file", infile);
- failure = 1;
- goto fail;
- }
- }
+ {
+ tempsize += linelength + 1;
+ fputs (lb.buffer, ostream);
+ putc ('\n', ostream);
+
+ /* Read another line of input data. */
+
+ linelength = readline (&lb, istream);
+ if (!linelength && feof (istream))
+ break;
+
+ if (lb.buffer[0] != '\\' && lb.buffer[0] != '@')
+ {
+ error (_("%s: not a texinfo index file"), infile);
+ failure = 1;
+ goto fail;
+ }
+ }
fclose (ostream);
if (feof (istream))
- break;
+ break;
}
free (lb.buffer);
@@ -1006,7 +983,7 @@ fail:
char *newtemp = maketempname (++tempcount);
sort_in_core (&tempfiles[i], MAX_IN_CORE_SORT, newtemp);
if (!keep_tempfiles)
- unlink (tempfiles[i]);
+ unlink (tempfiles[i]);
tempfiles[i] = newtemp;
}
@@ -1041,12 +1018,12 @@ sort_in_core (infile, total, outfile)
int desc = open (infile, O_RDONLY, 0);
if (desc < 0)
- fatal ("failure reopening %s", infile);
+ fatal (_("failure reopening %s"), infile);
for (file_size = 0;;)
{
i = read (desc, data + file_size, total - file_size);
if (i <= 0)
- break;
+ break;
file_size += i;
}
file_data = data;
@@ -1056,7 +1033,7 @@ sort_in_core (infile, total, outfile)
if (file_size > 0 && data[0] != '\\' && data[0] != '@')
{
- error ("%s: not a texinfo index file", infile);
+ error (_("%s: not a texinfo index file"), infile);
return;
}
@@ -1084,7 +1061,7 @@ sort_in_core (infile, total, outfile)
nextline = parsefile (infile, nextline, file_data, file_size);
if (nextline == 0)
{
- error ("%s: not a texinfo index file", infile);
+ error (_("%s: not a texinfo index file"), infile);
return;
}
@@ -1102,18 +1079,18 @@ sort_in_core (infile, total, outfile)
char **p;
for (lp = lineinfo, p = linearray; p != nextline; lp++, p++)
- {
- lp->text = *p;
- lp->key.text = find_field (keyfields, *p, &lp->keylen);
- if (keyfields->numeric)
- lp->key.number = find_value (lp->key.text, lp->keylen);
- }
+ {
+ lp->text = *p;
+ lp->key.text = find_field (keyfields, *p, &lp->keylen);
+ if (keyfields->numeric)
+ lp->key.number = find_value (lp->key.text, lp->keylen);
+ }
qsort (lineinfo, nextline - linearray, sizeof (struct lineinfo),
compare_prepared);
for (lp = lineinfo, p = linearray; p != nextline; lp++, p++)
- *p = lp->text;
+ *p = lp->text;
free (lineinfo);
}
@@ -1126,7 +1103,7 @@ sort_in_core (infile, total, outfile)
{
ostream = fopen (outfile, "w");
if (!ostream)
- pfatal_with_name (outfile);
+ pfatal_with_name (outfile);
}
writelines (linearray, nextline - linearray, ostream);
@@ -1160,21 +1137,21 @@ parsefile (filename, nextline, data, size)
while (p != end)
{
if (p[0] != '\\' && p[0] != '@')
- return 0;
+ return 0;
*line = p;
while (*p && *p != '\n')
- p++;
+ p++;
if (p != end)
- p++;
+ p++;
line++;
if (line == linearray + nlines)
- {
- char **old = linearray;
- linearray = (char **) xrealloc (linearray, sizeof (char *) * (nlines *= 4));
- line += linearray - old;
- }
+ {
+ char **old = linearray;
+ linearray = (char **) xrealloc (linearray, sizeof (char *) * (nlines *= 4));
+ line += linearray - old;
+ }
}
return line;
@@ -1266,7 +1243,7 @@ indexify (line, ostream)
{
initial = p;
/* Get length of inner pair of braces starting at `p',
- including that inner pair of braces. */
+ including that inner pair of braces. */
initiallength = find_braced_end (p + 1) + 1 - p;
}
else
@@ -1277,7 +1254,7 @@ indexify (line, ostream)
initiallength = 1;
if (initial1[0] >= 'a' && initial1[0] <= 'z')
- initial1[0] -= 040;
+ initial1[0] -= 040;
}
pagenumber = find_braced_pos (line, 1, 0, 0);
@@ -1298,52 +1275,52 @@ indexify (line, ostream)
{
/* Close off current secondary entry first, if one is open. */
if (pending)
- {
- fputs ("}\n", ostream);
- pending = 0;
- }
+ {
+ fputs ("}\n", ostream);
+ pending = 0;
+ }
/* If this primary has a different initial, include an entry for
- the initial. */
+ the initial. */
if (initiallength != lastinitiallength ||
- strncmp (initial, lastinitial, initiallength))
- {
- fprintf (ostream, "\\initial {");
- fwrite (initial, 1, initiallength, ostream);
- fprintf (ostream, "}\n", initial);
- if (initial == initial1)
- {
- lastinitial = lastinitial1;
- *lastinitial1 = *initial1;
- }
- else
- {
- lastinitial = initial;
- }
- lastinitiallength = initiallength;
- }
+ strncmp (initial, lastinitial, initiallength))
+ {
+ fprintf (ostream, "\\initial {");
+ fwrite (initial, 1, initiallength, ostream);
+ fputs ("}\n", ostream);
+ if (initial == initial1)
+ {
+ lastinitial = lastinitial1;
+ *lastinitial1 = *initial1;
+ }
+ else
+ {
+ lastinitial = initial;
+ }
+ lastinitiallength = initiallength;
+ }
/* Make the entry for the primary. */
if (nosecondary)
- fputs ("\\entry {", ostream);
+ fputs ("\\entry {", ostream);
else
- fputs ("\\primary {", ostream);
+ fputs ("\\primary {", ostream);
fwrite (primary, primarylength, 1, ostream);
if (nosecondary)
- {
- fputs ("}{", ostream);
- pending = 1;
- }
+ {
+ fputs ("}{", ostream);
+ pending = 1;
+ }
else
- fputs ("}\n", ostream);
+ fputs ("}\n", ostream);
/* Record name of most recent primary. */
if (lastprimarylength < primarylength)
- {
- lastprimarylength = primarylength + 100;
- lastprimary = (char *) xrealloc (lastprimary,
- 1 + lastprimarylength);
- }
+ {
+ lastprimarylength = primarylength + 100;
+ lastprimary = (char *) xrealloc (lastprimary,
+ 1 + lastprimarylength);
+ }
strncpy (lastprimary, primary, primarylength);
lastprimary[primarylength] = 0;
@@ -1354,16 +1331,16 @@ indexify (line, ostream)
/* Should not have an entry with no subtopic following one with a subtopic. */
if (nosecondary && *lastsecondary)
- error ("entry %s follows an entry with a secondary name", line);
+ error (_("entry %s follows an entry with a secondary name"), line);
/* Start a new secondary entry if necessary. */
if (!nosecondary && strncmp (secondary, lastsecondary, secondarylength))
{
if (pending)
- {
- fputs ("}\n", ostream);
- pending = 0;
- }
+ {
+ fputs ("}\n", ostream);
+ pending = 0;
+ }
/* Write the entry for the secondary. */
fputs ("\\secondary {", ostream);
@@ -1373,18 +1350,18 @@ indexify (line, ostream)
/* Record name of most recent secondary. */
if (lastsecondarylength < secondarylength)
- {
- lastsecondarylength = secondarylength + 100;
- lastsecondary = (char *) xrealloc (lastsecondary,
- 1 + lastsecondarylength);
- }
+ {
+ lastsecondarylength = secondarylength + 100;
+ lastsecondary = (char *) xrealloc (lastsecondary,
+ 1 + lastsecondarylength);
+ }
strncpy (lastsecondary, secondary, secondarylength);
lastsecondary[secondarylength] = 0;
}
/* Here to add one more page number to the current entry. */
if (pending++ != 1)
- fputs (", ", ostream); /* Punctuate first, if this is not the first. */
+ fputs (", ", ostream); /* Punctuate first, if this is not the first. */
fwrite (pagenumber, pagelength, 1, ostream);
}
@@ -1422,16 +1399,16 @@ writelines (linearray, nlines, ostream)
if (next_line == linearray
/* Compare previous line with this one, using only the
explicitly specd keyfields. */
- || compare_general (*(next_line - 1), *next_line, 0L, 0L, num_keyfields - 1))
- {
- char *p = *next_line;
- char c;
-
- while ((c = *p++) && c != '\n')
- /* Do nothing. */ ;
- *(p - 1) = 0;
- indexify (*next_line, ostream);
- }
+ || compare_general (*(next_line - 1), *next_line, 0L, 0L, num_keyfields - 1))
+ {
+ char *p = *next_line;
+ char c;
+
+ while ((c = *p++) && c != '\n')
+ /* Do nothing. */ ;
+ *(p - 1) = 0;
+ indexify (*next_line, ostream);
+ }
}
finish_index (ostream);
@@ -1470,7 +1447,7 @@ merge_files (infiles, nfiles, outfile)
{
int nf = MAX_DIRECT_MERGE;
if (i + 1 == ntemps)
- nf = nfiles - i * MAX_DIRECT_MERGE;
+ nf = nfiles - i * MAX_DIRECT_MERGE;
tempfiles[i] = maketempname (++tempcount);
value |= merge_direct (&infiles[i * MAX_DIRECT_MERGE], nf, tempfiles[i]);
}
@@ -1525,7 +1502,7 @@ merge_direct (infiles, nfiles, outfile)
if (nfiles == 0)
{
if (outfile)
- fclose (ostream);
+ fclose (ostream);
return 0;
}
@@ -1567,7 +1544,7 @@ merge_direct (infiles, nfiles, outfile)
file_lossage[i] = 0;
streams[i] = fopen (infiles[i], "r");
if (!streams[i])
- pfatal_with_name (infiles[i]);
+ pfatal_with_name (infiles[i]);
readline (thisline[i], streams[i]);
}
@@ -1585,48 +1562,48 @@ merge_direct (infiles, nfiles, outfile)
/* Look at the next avail line of each file; choose the least one. */
for (i = 0; i < nfiles; i++)
- {
- if (thisline[i] &&
- (!best ||
- 0 < compare_general (best->buffer, thisline[i]->buffer,
- (long) bestfile, (long) i, num_keyfields)))
- {
- best = thisline[i];
- bestfile = i;
- }
- }
+ {
+ if (thisline[i] &&
+ (!best ||
+ 0 < compare_general (best->buffer, thisline[i]->buffer,
+ (long) bestfile, (long) i, num_keyfields)))
+ {
+ best = thisline[i];
+ bestfile = i;
+ }
+ }
/* Output that line, unless it matches the previous one and we
- don't want duplicates. */
+ don't want duplicates. */
if (!(prev_out &&
- !compare_general (prev_out->buffer,
- best->buffer, 0L, 1L, num_keyfields - 1)))
- indexify (best->buffer, ostream);
+ !compare_general (prev_out->buffer,
+ best->buffer, 0L, 1L, num_keyfields - 1)))
+ indexify (best->buffer, ostream);
prev_out = best;
/* Now make the line the previous of its file, and fetch a new
- line from that file. */
+ line from that file. */
exch = prevline[bestfile];
prevline[bestfile] = thisline[bestfile];
thisline[bestfile] = exch;
while (1)
- {
- /* If the file has no more, mark it empty. */
-
- if (feof (streams[bestfile]))
- {
- thisline[bestfile] = 0;
- /* Update the number of files still not empty. */
- nleft--;
- break;
- }
- readline (thisline[bestfile], streams[bestfile]);
- if (thisline[bestfile]->buffer[0] || !feof (streams[bestfile]))
- break;
- }
+ {
+ /* If the file has no more, mark it empty. */
+
+ if (feof (streams[bestfile]))
+ {
+ thisline[bestfile] = 0;
+ /* Update the number of files still not empty. */
+ nleft--;
+ break;
+ }
+ readline (thisline[bestfile], streams[bestfile]);
+ if (thisline[bestfile]->buffer[0] || !feof (streams[bestfile]))
+ break;
+ }
}
finish_index (ostream);
@@ -1692,7 +1669,7 @@ pfatal_with_name (name)
s = strerror (errno);
printf ("%s: ", program_name);
- printf ("%s; for file `%s'.\n", s, name);
+ printf (_("%s; for file `%s'.\n"), s, name);
exit (TI_FATAL_ERROR);
}
@@ -1745,6 +1722,21 @@ strrchr (string, character)
}
#endif /* HAVE_STRCHR */
+void
+memory_error (callers_name, bytes_wanted)
+ char *callers_name;
+ int bytes_wanted;
+{
+ char printable_string[80];
+
+ sprintf (printable_string,
+ _("Virtual memory exhausted in %s ()! Needed %d bytes."),
+ callers_name, bytes_wanted);
+
+ error (printable_string);
+ abort ();
+}
+
/* Just like malloc, but kills the program in case of fatal error. */
void *
xmalloc (nbytes)
@@ -1776,18 +1768,3 @@ xrealloc (pointer, nbytes)
return (temp);
}
-
-memory_error (callers_name, bytes_wanted)
- char *callers_name;
- int bytes_wanted;
-{
- char printable_string[80];
-
- sprintf (printable_string,
- "Virtual memory exhausted in %s ()! Needed %d bytes.",
- callers_name, bytes_wanted);
-
- error (printable_string);
- abort ();
-}
-