summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorMasayuki Hatta (mhatta) <mhatta@debian.org>2008-01-03 09:38:51 -0500
committerMasayuki Hatta (mhatta) <mhatta@debian.org>2008-01-03 09:38:51 -0500
commit95b1e9489b8bed332041631a1545b43f26a1503b (patch)
tree48c16557869e78ef16a5d9ed080c53cc14f8059a /contrib
Import a2ps_4.14.orig.tar.gz
[dgit import orig a2ps_4.14.orig.tar.gz]
Diffstat (limited to 'contrib')
-rw-r--r--contrib/Makefile.am43
-rw-r--r--contrib/Makefile.in739
-rw-r--r--contrib/README17
-rw-r--r--contrib/card.in282
-rw-r--r--contrib/card.m4206
-rw-r--r--contrib/emacs/Makefile.am3
-rw-r--r--contrib/emacs/Makefile.in489
-rw-r--r--contrib/emacs/a2ps-print.el102
-rw-r--r--contrib/emacs/a2ps.el225
-rw-r--r--contrib/fixbb.m4157
-rw-r--r--contrib/fixnt.c2472
-rw-r--r--contrib/fixnt.l329
-rw-r--r--contrib/fixps.in397
-rw-r--r--contrib/fixps.m4315
-rw-r--r--contrib/pdiff.in194
-rw-r--r--contrib/pdiff.m4112
-rw-r--r--contrib/psmandup.in269
-rw-r--r--contrib/psmandup.m4191
-rw-r--r--contrib/psset.in279
-rw-r--r--contrib/psset.m4199
-rw-r--r--contrib/sample/Makefile.am38
-rw-r--r--contrib/sample/Makefile.in561
-rw-r--r--contrib/sample/main.c73
-rw-r--r--contrib/shell.m4100
-rwxr-xr-xcontrib/texi2dvi4a2ps602
25 files changed, 8394 insertions, 0 deletions
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
new file mode 100644
index 0000000..5fe3e96
--- /dev/null
+++ b/contrib/Makefile.am
@@ -0,0 +1,43 @@
+# Makefile for a2ps/contrib.
+# Copyright (c) 1995-2000 Akim Demaille, Miguel Santana
+#
+
+#
+# This file is part of a2ps.
+#
+# 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 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING. If not, write to
+# the Free Software Foundation, 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+#
+
+## Process this file with automake to produce Makefile.in
+
+SUBDIRS = sample emacs
+
+bin_SCRIPTS = card fixps pdiff psmandup psset texi2dvi4a2ps
+bin_PROGRAMS = fixnt
+
+fixnt_SOURCES = fixnt.l
+
+EXTRA_DIST = \
+card.in fixps.in pdiff.in psmandup.in psset.in texi2dvi4a2ps \
+card.m4 fixps.m4 pdiff.m4 psmandup.m4 psset.m4 shell.m4
+
+M4 = @M4@
+SUFFIXES = .m4 .in
+
+.m4.in: shell.m4
+ $(M4) $*.m4 | \
+ sed -e 's/@BKL@/[/g;s/@BKR@/]/g;s/@DLR@/$$/g;s/@PND@/#/g'>$@-tmp
+ mv $@-tmp $@
diff --git a/contrib/Makefile.in b/contrib/Makefile.in
new file mode 100644
index 0000000..2950d69
--- /dev/null
+++ b/contrib/Makefile.in
@@ -0,0 +1,739 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 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, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Makefile for a2ps/contrib.
+# Copyright (c) 1995-2000 Akim Demaille, Miguel Santana
+#
+
+#
+# This file is part of a2ps.
+#
+# 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 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING. If not, write to
+# the Free Software Foundation, 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+#
+
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = fixnt$(EXEEXT)
+subdir = contrib
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(srcdir)/card.in $(srcdir)/fixps.in $(srcdir)/pdiff.in \
+ $(srcdir)/psmandup.in $(srcdir)/psset.in fixnt.c
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/a2_psutils.m4 \
+ $(top_srcdir)/m4/atexit.m4 $(top_srcdir)/m4/file.m4 \
+ $(top_srcdir)/m4/fp_echo.m4 $(top_srcdir)/m4/fullpath.m4 \
+ $(top_srcdir)/m4/gccwarn.m4 $(top_srcdir)/m4/gettext.m4 \
+ $(top_srcdir)/m4/gperf-check.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/isc-posix.m4 \
+ $(top_srcdir)/m4/lex.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+ $(top_srcdir)/m4/libpaper.m4 $(top_srcdir)/m4/lpr.m4 \
+ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/malloc.m4 \
+ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \
+ $(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/prereq.m4 \
+ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/protos.m4 \
+ $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/rename.m4 \
+ $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strcasecmp.m4 \
+ $(top_srcdir)/m4/strftim.m4 $(top_srcdir)/m4/termios.m4 \
+ $(top_srcdir)/m4/tterm.m4 $(top_srcdir)/m4/uintmax_t.m4 \
+ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/winsz.m4 \
+ $(top_srcdir)/m4/xstrtoumax.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/auxdir/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES = card fixps pdiff psmandup psset
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
+PROGRAMS = $(bin_PROGRAMS)
+am_fixnt_OBJECTS = fixnt.$(OBJEXT)
+fixnt_OBJECTS = $(am_fixnt_OBJECTS)
+fixnt_LDADD = $(LDADD)
+binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
+SCRIPTS = $(bin_SCRIPTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/auxdir/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAGS)
+LTLEXCOMPILE = $(LIBTOOL) --mode=compile $(LEX) $(LFLAGS) $(AM_LFLAGS)
+SOURCES = $(fixnt_SOURCES)
+DIST_SOURCES = $(fixnt_SOURCES)
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+ html-recursive info-recursive install-data-recursive \
+ install-exec-recursive install-info-recursive \
+ install-recursive installcheck-recursive installdirs-recursive \
+ pdf-recursive ps-recursive uninstall-info-recursive \
+ uninstall-recursive
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+COM_DISPLAY = @COM_DISPLAY@
+COM_LATEX = @COM_LATEX@
+COM_PS2PDF = @COM_PS2PDF@
+COM_PSUTILS = @COM_PSUTILS@
+COM_TEXI = @COM_TEXI@
+COM_acroread = @COM_acroread@
+COM_acroread4 = @COM_acroread4@
+COM_bzip = @COM_bzip@
+COM_bzip2 = @COM_bzip2@
+COM_convert = @COM_convert@
+COM_distill = @COM_distill@
+COM_dvips = @COM_dvips@
+COM_ghostview = @COM_ghostview@
+COM_grog = @COM_grog@
+COM_gv = @COM_gv@
+COM_gzip = @COM_gzip@
+COM_html2ps = @COM_html2ps@
+COM_latex = @COM_latex@
+COM_makeinfo = @COM_makeinfo@
+COM_netscape = @COM_netscape@
+COM_pdf2ps = @COM_pdf2ps@
+COM_ps2pdf = @COM_ps2pdf@
+COM_psnup = @COM_psnup@
+COM_psselect = @COM_psselect@
+COM_tex = @COM_tex@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EMACS = @EMACS@
+EMACSLOADPATH = @EMACSLOADPATH@
+ENCODING = @ENCODING@
+EXEEXT = @EXEEXT@
+EXTENSIONS_FALSE = @EXTENSIONS_FALSE@
+EXTENSIONS_TRUE = @EXTENSIONS_TRUE@
+EXTRA_CFLAGS = @EXTRA_CFLAGS@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FILE_LINK = @FILE_LINK@
+GMSGFMT = @GMSGFMT@
+GNU_PACKAGE = @GNU_PACKAGE@
+GPERF = @GPERF@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBVERSION = @LIBVERSION@
+LN_S = @LN_S@
+LPR = @LPR@
+LPR_QUEUE_OPTION = @LPR_QUEUE_OPTION@
+LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+M4 = @M4@
+MAKEINFO = @MAKEINFO@
+MEDIUM = @MEDIUM@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+POSUB = @POSUB@
+PSFONT_PATH = @PSFONT_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+U = @U@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+acroread = @acroread@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+bzip = @bzip@
+bzip2 = @bzip2@
+convert = @convert@
+datadir = @datadir@
+datarootdir = @datarootdir@
+distill = @distill@
+docdir = @docdir@
+dvidir = @dvidir@
+dvips = @dvips@
+exec_prefix = @exec_prefix@
+file_prog = @file_prog@
+ghostview = @ghostview@
+grog = @grog@
+gv = @gv@
+gzip = @gzip@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+html2ps = @html2ps@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+latex = @latex@
+libdir = @libdir@
+libexecdir = @libexecdir@
+lispdir = @lispdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+makeinfo = @makeinfo@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+netscape = @netscape@
+oldincludedir = @oldincludedir@
+pdf2ps = @pdf2ps@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+ps2pdf = @ps2pdf@
+psdir = @psdir@
+psnup = @psnup@
+psselect = @psselect@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+tex = @tex@
+SUBDIRS = sample emacs
+bin_SCRIPTS = card fixps pdiff psmandup psset texi2dvi4a2ps
+fixnt_SOURCES = fixnt.l
+EXTRA_DIST = \
+card.in fixps.in pdiff.in psmandup.in psset.in texi2dvi4a2ps \
+card.m4 fixps.m4 pdiff.m4 psmandup.m4 psset.m4 shell.m4
+
+SUFFIXES = .m4 .in
+all: all-recursive
+
+.SUFFIXES:
+.SUFFIXES: .m4 .in .c .l .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu contrib/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu contrib/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+card: $(top_builddir)/config.status $(srcdir)/card.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+fixps: $(top_builddir)/config.status $(srcdir)/fixps.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+pdiff: $(top_builddir)/config.status $(srcdir)/pdiff.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+psmandup: $(top_builddir)/config.status $(srcdir)/psmandup.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+psset: $(top_builddir)/config.status $(srcdir)/psset.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ || test -f $$p1 \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+clean-binPROGRAMS:
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+fixnt$(EXEEXT): $(fixnt_OBJECTS) $(fixnt_DEPENDENCIES)
+ @rm -f fixnt$(EXEEXT)
+ $(LINK) $(fixnt_LDFLAGS) $(fixnt_OBJECTS) $(fixnt_LDADD) $(LIBS)
+install-binSCRIPTS: $(bin_SCRIPTS)
+ @$(NORMAL_INSTALL)
+ test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
+ @list='$(bin_SCRIPTS)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ if test -f $$d$$p; then \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
+ else :; fi; \
+ done
+
+uninstall-binSCRIPTS:
+ @$(NORMAL_UNINSTALL)
+ @list='$(bin_SCRIPTS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
+ done
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fixnt.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+.l.c:
+ $(LEXCOMPILE) $<
+ sed '/^#/ s|$(LEX_OUTPUT_ROOT)\.c|$@|' $(LEX_OUTPUT_ROOT).c >$@
+ rm -f $(LEX_OUTPUT_ROOT).c
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
+ dot_seen=no; \
+ case "$@" in \
+ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+ *) list='$(SUBDIRS)' ;; \
+ esac; \
+ rev=''; for subdir in $$list; do \
+ if test "$$subdir" = "."; then :; else \
+ rev="$$subdir $$rev"; \
+ fi; \
+ done; \
+ rev="$$rev ."; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || eval $$failcom; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+ctags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+ done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+ include_option=--etags-include; \
+ empty_fix=.; \
+ else \
+ include_option=--include; \
+ empty_fix=; \
+ fi; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test ! -f $$subdir/TAGS || \
+ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -d "$(distdir)/$$subdir" \
+ || $(mkdir_p) "$(distdir)/$$subdir" \
+ || exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
+ (cd $$subdir && \
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ distdir) \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(PROGRAMS) $(SCRIPTS)
+installdirs: installdirs-recursive
+installdirs-am:
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+ -rm -f fixnt.c
+clean: clean-recursive
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am: install-binPROGRAMS install-binSCRIPTS
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
+ uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
+ clean clean-binPROGRAMS clean-generic clean-libtool \
+ clean-recursive ctags ctags-recursive distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-recursive distclean-tags distdir dvi dvi-am html \
+ html-am info info-am install install-am install-binPROGRAMS \
+ install-binSCRIPTS install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ installdirs-am maintainer-clean maintainer-clean-generic \
+ maintainer-clean-recursive mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
+ pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+ uninstall-binPROGRAMS uninstall-binSCRIPTS uninstall-info-am
+
+
+.m4.in: shell.m4
+ $(M4) $*.m4 | \
+ sed -e 's/@BKL@/[/g;s/@BKR@/]/g;s/@DLR@/$$/g;s/@PND@/#/g'>$@-tmp
+ mv $@-tmp $@
+# 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/README b/contrib/README
new file mode 100644
index 0000000..988af59
--- /dev/null
+++ b/contrib/README
@@ -0,0 +1,17 @@
+
+ a2ps' Contrib Directory
+
+
+* emacs/
+ An emacs mode for style sheet files, and a useful package for
+ generating regexps.
+
+* sample/
+ A example on how to program with the a2ps library.
+
+* texi2dvi4a2ps
+ A recent version of texi2dvi (corresponding to Texinfo 4.0)
+ It makes texi2dvi usuable as a delegation for Texinfo and LaTeX files.
+
+* texi2dvi.patch
+ A patch from texi2dvi to add the features above.
diff --git a/contrib/card.in b/contrib/card.in
new file mode 100644
index 0000000..2561d46
--- /dev/null
+++ b/contrib/card.in
@@ -0,0 +1,282 @@
+#! /bin/sh
+# -*- ksh -*-
+# card --- smartly produce a printed reference card of a program
+
+# Copyright (c) 1998-2000 Akim Demaille, Miguel Santana
+
+# 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 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, you can either send email to this
+# program's maintainer or write to: The Free Software Foundation,
+# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
+
+# Author: Akim Demaille <Akim.Demaille@freefriends.org>
+
+# Name by which this script was invoked.
+program=`echo "$0" | sed -e 's/[^\/]*\///g'`
+card_version='1.3'
+
+# Initialize variables.
+# Don't use `unset' since old bourne shells don't have this command.
+# Instead, assign them an empty value.
+# Some of these, like A2PS, may be inherited from the environment.
+a2ps=${A2PS-a2ps}
+a2ps_options=-Ecard
+commands=
+debug=
+form_feed=
+help="Try \`$program --help' for more information."
+LC_ALL="${LC_ALL-C}" export LC_ALL
+print_form_feeds=:
+RM="/bin/rm -rf"
+tmp_dir=`mktemp -d -t card.XXXXXX` || { echo "$program: Cannot create temporary dir!" >&2 ; exit 1; }
+tmp_file=$tmp_dir/card
+success=false
+verbose=:
+version_short="card $card_version (@GNU_PACKAGE@ @VERSION@)"
+
+usage="Usage: $program [OPTION]... PROGRAM...
+Print a reference card of the PROGRAMs thanks to their inline help.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version display version information and exit
+ -o, --output=FILE save the output in FILE
+ -l, --language=LL print the help in the language LL (default: English)
+ --command=CMD perform pretty-printing on the output of CMD
+ (e.g. --command='netscape -help')
+
+Options for a2ps are given after \`--', for instance
+
+ $ card -lfr a2ps -- -Pdisplay -4
+
+News, updates and documentation: http://www.inf.enst.fr/~demaille/a2ps/
+Report bugs to <bug-a2ps@gnu.org>."
+
+version="$version_short
+Written by Akim Demaille.
+
+Copyright (c) 1997-99 Akim Demaille, Miguel Santana
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+# List of the possible ways to get the on line help.
+# -flags is used with Solaris' CC.
+possible_options="--help -h -help -\? -flags"
+
+# Parse command line arguments.
+option_without_arguments='vhsqDf'
+
+# As a first step, fetch all the options meant for a2ps, i.e.
+# everything after `--'.
+jam="$$card$$"
+set dummy "${1+"$@"}" "$jam"
+shift
+while test "x$1" != "x$jam" && test "x$1" != "x--"; do
+ set dummy "${1+"$@"}" "$1"
+ shift
+ shift
+done
+
+# If $[1] is `--', then from here to the JAM are a2ps arguments.
+if test "x$1" = x--; then
+ shift
+ while test "x$1" != "x$jam"
+ do
+ a2ps_options="$a2ps_options $1"
+ shift
+ done
+fi
+
+# The current $1 is JAM. Pop up the JAM, pop it up, pop it out.
+shift
+
+# Proceed to card's options parsing.
+# Push a token among the arguments that will be used to notice when
+# we ended options/arguments parsing.
+arg_sep="$$--$$"
+set dummy ${1+"$@"} "$arg_sep"
+shift
+while test "x$1" != "x$arg_sep"; do
+
+ # Handle --option=value by splitting apart and putting back on argv.
+ case "$1" in
+ --*=*)
+ opt=`echo "$1" | sed -e 's/=.*//'`
+ val=`echo "$1" | sed -e 's/[^=]*=//'`
+ shift
+ set dummy "$opt" "$val" ${1+"$@"}
+ shift
+ ;;
+
+ -[$option_without_arguments]?*)
+ # Prefix $1 with x to avoid running `echo -na' for instance.
+ opt=`echo "x$1" | sed -e 's/x-\(.\).*/-\1/'`
+ rest=`echo "x$1" | sed -e 's/x-.\(.*\)/-\1/'`
+ shift
+ set dummy "$opt" "$rest" ${1+"$@"}
+ shift
+ ;;
+
+ # This case needs to be protected so that the case `-??*' does
+ # not split long options without arguments
+ --*)
+ ;;
+
+ # This is an option with argument. Split apart and put back on argv.
+ -??*)
+ opt=`echo "x$1" | sed -e 's/x-\(.\).*/-\1/'`
+ arg=`echo "x$1" | sed -e 's/x-.\(.*\)/\1/'`
+ shift
+ set dummy "$opt" "$arg" ${1+"$@"}
+ shift
+ ;;
+ esac
+
+ # Now, handle the options. $1 is the option *only*. If it has an
+ # argument, it is now necessarily in $2 etc. Remember to shift
+ # when fetching an argument.
+ case "$1" in
+ -v | --v*) echo "$version"; exit 0;;
+ -h | --h*) echo "$usage"; exit 0;;
+ -s|-q|--q*|--s*) verbose=: ;;
+ -D | --debug) debug=: ;;
+ -o|--output) shift
+ a2ps_options="$a2ps_options --output=$1" ;;
+ --lan*|-l) shift; LC_ALL=$1 ;;
+ --com*|-c) shift; commands="$commands $optarg" ;;
+ --no-*|-f) print_form_feeds= ;;
+
+ --) # What remains are not options.
+ shift
+ while test "x$1" != "x$arg_sep"; do
+ set dummy ${1+"$@"} "$1"
+ shift
+ shift
+ done
+ break;;
+
+ -*)
+ echo "$program: Unknown or ambiguous option \`$1'." >&2
+ echo "$program: Try \`--help' for more information." >&2
+ exit 1;;
+ *) set dummy ${1+"$@"} "$1"
+ shift
+ ;;
+ esac
+ shift
+done
+# Pop the token
+shift
+
+
+# ARG now contains both options for a2ps and the true arguments.
+
+if test $# = 0 && test "X$commands" = X; then
+ exec 1>&2
+ echo "$program: no program given"
+ echo "$help"
+ exit 1
+fi
+
+# Create a tmp dir and be ready to clean up
+trap "$RM $tmp_dir" 0 1 2 15
+
+case $LC_ALL in
+ fr) footer="Engendré par $version_short" ;;
+ *) footer="Generated by $version_short" ;;
+esac
+
+# Set -x now if debugging
+test -n "$debug" && set -x
+
+# The files to process are in "$@"
+for file
+do
+ success=false
+ filename=`echo "$file" | sed -e 's/[^\/]*\///g'`
+ $verbose "Working on \`$filename'"
+ case $LC_ALL in
+ fr) title="Carte de référence pour $filename" ;;
+ *) title="Reference card of $filename" ;;
+ esac
+
+ # Try to find the help message
+ for opt in $possible_options
+ do
+ $verbose "Trying \`$file $opt'"
+ ($file $opt >$tmp_dir/foo 2>&1) >/dev/null 2>&1 && success=: && break
+ # Netscape for example is stupid enough to `exit 255' when properly fed
+ # with -help, as recommanded by -help itself... If there are really
+ # many lines, consider it is still a success.
+ if test "$success" = false; then
+ if test `wc -l <$tmp_dir/foo` -gt 10; then
+ success=: && break
+ fi
+ fi
+ done
+
+ # If the help message has been found, process it with a2ps
+ if $success; then
+ $verbose "Success"
+ if test -n "$form_feed"; then
+ echo " " >>$tmp_file
+ fi
+ cat <<EOF >>$tmp_file
+ card_label($title)
+card_title($title)
+EOF
+ cat $tmp_dir/foo >>$tmp_file
+ # Be ready to insert a page break before next argument-program
+ form_feed=$print_form_feeds
+ else
+ echo "$program: could not find help message for $file"
+ exit 1
+ fi
+done
+
+SAVED_IFS="$IFS"
+IFS=" "
+for command in $commands
+do
+ IFS="$SAVED_IFS"
+ success=false
+ case $LC_ALL in
+ fr) title="Résultat de \`$command'" ;;
+ *) title="Result of \`$command'" ;;
+ esac
+
+ (eval $command >$tmp_dir/foo 2>&1) >/dev/null 2>&1 && success=:
+ # If the help message has been found, process it with a2ps
+ if $success; then
+ $verbose "Success"
+ if test -n "$form_feed"; then
+ echo " " >>$tmp_file
+ fi
+ cat <<EOF >>$tmp_file
+ card_label($title)
+card_title($title)
+EOF
+ cat $tmp_dir/foo >>$tmp_file
+ # Be ready to insert a page break before next argument-program
+ form_feed=$print_form_feeds
+ else
+ echo "$program: command \"$command\" failed"
+ exit 1
+ fi
+done
+IFS="$SAVED_IFS"
+
+# All the programs have been treated. Call a2ps on the produced file
+$a2ps $a2ps_options --footer="$footer" $tmp_file || exit 1
+
+exit 0
diff --git a/contrib/card.m4 b/contrib/card.m4
new file mode 100644
index 0000000..54aa717
--- /dev/null
+++ b/contrib/card.m4
@@ -0,0 +1,206 @@
+include(shell.m4)dnl -*- shell-script -*-
+#! /bin/sh
+# -*- ksh -*-
+# card --- smartly produce a printed reference card of a program
+
+GPL([Copyright (c) 1998-2000 Akim Demaille, Miguel Santana])
+
+# Author: Akim Demaille <Akim.Demaille@freefriends.org>
+
+# Name by which this script was invoked.
+changequote(, )dnl
+program=`echo "$0" | sed -e 's/[^\/]*\///g'`
+changequote([, ])dnl
+card_version='1.3'
+
+# Initialize variables.
+# Don't use `unset' since old bourne shells don't have this command.
+# Instead, assign them an empty value.
+# Some of these, like A2PS, may be inherited from the environment.
+a2ps=${A2PS-a2ps}
+a2ps_options=-Ecard
+commands=
+debug=
+form_feed=
+help="Try \`$program --help' for more information."
+LC_ALL="${LC_ALL-C}" export LC_ALL
+print_form_feeds=:
+RM="/bin/rm -rf"
+tmp_dir=`mktemp -d -t card.XXXXXX` || { echo "$program: Cannot create temporary dir!" >&2 ; exit 1; }
+tmp_file=$tmp_dir/card
+success=false
+verbose=:
+version_short="card $card_version (@GNU_PACKAGE@ @VERSION@)"
+
+changequote(, )dnl
+usage="Usage: $program [OPTION]... PROGRAM...
+Print a reference card of the PROGRAMs thanks to their inline help.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version display version information and exit
+ -o, --output=FILE save the output in FILE
+ -l, --language=LL print the help in the language LL (default: English)
+ --command=CMD perform pretty-printing on the output of CMD
+ (e.g. --command='netscape -help')
+
+Options for a2ps are given after \`--', for instance
+
+ $ card -lfr a2ps -- -Pdisplay -4
+
+News, updates and documentation: http://www.inf.enst.fr/~demaille/a2ps/
+Report bugs to <bug-a2ps@gnu.org>."
+changequote([, ])dnl
+
+version="$version_short
+Written by Akim Demaille.
+
+Copyright (c) 1997-99 Akim Demaille, Miguel Santana
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+# List of the possible ways to get the on line help.
+# -flags is used with Solaris' CC.
+possible_options="--help -h -help -\? -flags"
+
+# Parse command line arguments.
+option_without_arguments='vhsqDf'
+
+# As a first step, fetch all the options meant for a2ps, i.e.
+# everything after `--'.
+jam="$$card$$"
+set dummy "${1+"$@"}" "$jam"
+shift
+while test "x$1" != "x$jam" && test "x$1" != "x--"; do
+ set dummy "${1+"$@"}" "$1"
+ shift
+ shift
+done
+
+# If $[1] is `--', then from here to the JAM are a2ps arguments.
+if test "x$1" = x--; then
+ shift
+ while test "x$1" != "x$jam"
+ do
+ a2ps_options="$a2ps_options $1"
+ shift
+ done
+fi
+
+# The current $1 is JAM. Pop up the JAM, pop it up, pop it out.
+shift
+
+# Proceed to card's options parsing.
+GETOPT([ -v | --v*) echo "$version"; exit 0;;
+ -h | --h*) echo "$usage"; exit 0;;
+ -s|-q|--q*|--s*) verbose=: ;;
+ -D | --debug) debug=: ;;
+ -o|--output) shift
+ a2ps_options="$a2ps_options --output=$1" ;;
+ --lan*|-l) shift; LC_ALL=$1 ;;
+ --com*|-c) shift; commands="$commands $optarg" ;;
+ --no-*|-f) print_form_feeds= ;;])
+
+# ARG now contains both options for a2ps and the true arguments.
+
+if test $# = 0 && test "X$commands" = X; then
+ exec 1>&2
+ echo "$program: no program given"
+ echo "$help"
+ exit 1
+fi
+
+# Create a tmp dir and be ready to clean up
+trap "$RM $tmp_dir" 0 1 2 15
+
+case $LC_ALL in
+ fr) footer="Engendré par $version_short" ;;
+ *) footer="Generated by $version_short" ;;
+esac
+
+# Set -x now if debugging
+test -n "$debug" && set -x
+
+# The files to process are in "$@"
+for file
+do
+ success=false
+changequote(, )dnl
+ filename=`echo "$file" | sed -e 's/[^\/]*\///g'`
+changequote([, ])dnl
+ $verbose "Working on \`$filename'"
+ case $LC_ALL in
+ fr) title="Carte de référence pour $filename" ;;
+ *) title="Reference card of $filename" ;;
+ esac
+
+ # Try to find the help message
+ for opt in $possible_options
+ do
+ $verbose "Trying \`$file $opt'"
+ ($file $opt >$tmp_dir/foo 2>&1) >/dev/null 2>&1 && success=: && break
+ # Netscape for example is stupid enough to `exit 255' when properly fed
+ # with -help, as recommanded by -help itself... If there are really
+ # many lines, consider it is still a success.
+ if test "$success" = false; then
+ if test `wc -l <$tmp_dir/foo` -gt 10; then
+ success=: && break
+ fi
+ fi
+ done
+
+ # If the help message has been found, process it with a2ps
+ if $success; then
+ $verbose "Success"
+ if test -n "$form_feed"; then
+ echo " " >>$tmp_file
+ fi
+ cat <<EOF >>$tmp_file
+ card_label($title)
+card_title($title)
+EOF
+ cat $tmp_dir/foo >>$tmp_file
+ # Be ready to insert a page break before next argument-program
+ form_feed=$print_form_feeds
+ else
+ echo "$program: could not find help message for $file"
+ exit 1
+ fi
+done
+
+SAVED_IFS="$IFS"
+IFS=" "
+for command in $commands
+do
+ IFS="$SAVED_IFS"
+ success=false
+ case $LC_ALL in
+ fr) title="Résultat de \`$command'" ;;
+ *) title="Result of \`$command'" ;;
+ esac
+
+ (eval $command >$tmp_dir/foo 2>&1) >/dev/null 2>&1 && success=:
+ # If the help message has been found, process it with a2ps
+ if $success; then
+ $verbose "Success"
+ if test -n "$form_feed"; then
+ echo " " >>$tmp_file
+ fi
+ cat <<EOF >>$tmp_file
+ card_label($title)
+card_title($title)
+EOF
+ cat $tmp_dir/foo >>$tmp_file
+ # Be ready to insert a page break before next argument-program
+ form_feed=$print_form_feeds
+ else
+ echo "$program: command \"$command\" failed"
+ exit 1
+ fi
+done
+IFS="$SAVED_IFS"
+
+# All the programs have been treated. Call a2ps on the produced file
+$a2ps $a2ps_options --footer="$footer" $tmp_file || exit 1
+
+exit 0
diff --git a/contrib/emacs/Makefile.am b/contrib/emacs/Makefile.am
new file mode 100644
index 0000000..ce4437f
--- /dev/null
+++ b/contrib/emacs/Makefile.am
@@ -0,0 +1,3 @@
+## Process this file with automake to produce Makefile.in
+
+dist_lisp_LISP = a2ps.el a2ps-print.el
diff --git a/contrib/emacs/Makefile.in b/contrib/emacs/Makefile.in
new file mode 100644
index 0000000..71dbb7f
--- /dev/null
+++ b/contrib/emacs/Makefile.in
@@ -0,0 +1,489 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 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, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = contrib/emacs
+DIST_COMMON = $(dist_lisp_LISP) $(srcdir)/Makefile.am \
+ $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/a2_psutils.m4 \
+ $(top_srcdir)/m4/atexit.m4 $(top_srcdir)/m4/file.m4 \
+ $(top_srcdir)/m4/fp_echo.m4 $(top_srcdir)/m4/fullpath.m4 \
+ $(top_srcdir)/m4/gccwarn.m4 $(top_srcdir)/m4/gettext.m4 \
+ $(top_srcdir)/m4/gperf-check.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/isc-posix.m4 \
+ $(top_srcdir)/m4/lex.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+ $(top_srcdir)/m4/libpaper.m4 $(top_srcdir)/m4/lpr.m4 \
+ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/malloc.m4 \
+ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \
+ $(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/prereq.m4 \
+ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/protos.m4 \
+ $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/rename.m4 \
+ $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strcasecmp.m4 \
+ $(top_srcdir)/m4/strftim.m4 $(top_srcdir)/m4/termios.m4 \
+ $(top_srcdir)/m4/tterm.m4 $(top_srcdir)/m4/uintmax_t.m4 \
+ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/winsz.m4 \
+ $(top_srcdir)/m4/xstrtoumax.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/auxdir/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+SOURCES =
+DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(lispdir)"
+dist_lispLISP_INSTALL = $(INSTALL_DATA)
+LISP = $(dist_lisp_LISP)
+am__ELFILES = a2ps-print.el a2ps.el
+am__ELCFILES = $(am__ELFILES:.el=.elc)
+ELCFILES = $(LISP:.el=.elc)
+elisp_comp = $(top_srcdir)/auxdir/elisp-comp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+COM_DISPLAY = @COM_DISPLAY@
+COM_LATEX = @COM_LATEX@
+COM_PS2PDF = @COM_PS2PDF@
+COM_PSUTILS = @COM_PSUTILS@
+COM_TEXI = @COM_TEXI@
+COM_acroread = @COM_acroread@
+COM_acroread4 = @COM_acroread4@
+COM_bzip = @COM_bzip@
+COM_bzip2 = @COM_bzip2@
+COM_convert = @COM_convert@
+COM_distill = @COM_distill@
+COM_dvips = @COM_dvips@
+COM_ghostview = @COM_ghostview@
+COM_grog = @COM_grog@
+COM_gv = @COM_gv@
+COM_gzip = @COM_gzip@
+COM_html2ps = @COM_html2ps@
+COM_latex = @COM_latex@
+COM_makeinfo = @COM_makeinfo@
+COM_netscape = @COM_netscape@
+COM_pdf2ps = @COM_pdf2ps@
+COM_ps2pdf = @COM_ps2pdf@
+COM_psnup = @COM_psnup@
+COM_psselect = @COM_psselect@
+COM_tex = @COM_tex@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EMACS = @EMACS@
+EMACSLOADPATH = @EMACSLOADPATH@
+ENCODING = @ENCODING@
+EXEEXT = @EXEEXT@
+EXTENSIONS_FALSE = @EXTENSIONS_FALSE@
+EXTENSIONS_TRUE = @EXTENSIONS_TRUE@
+EXTRA_CFLAGS = @EXTRA_CFLAGS@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FILE_LINK = @FILE_LINK@
+GMSGFMT = @GMSGFMT@
+GNU_PACKAGE = @GNU_PACKAGE@
+GPERF = @GPERF@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBVERSION = @LIBVERSION@
+LN_S = @LN_S@
+LPR = @LPR@
+LPR_QUEUE_OPTION = @LPR_QUEUE_OPTION@
+LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+M4 = @M4@
+MAKEINFO = @MAKEINFO@
+MEDIUM = @MEDIUM@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+POSUB = @POSUB@
+PSFONT_PATH = @PSFONT_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+U = @U@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+acroread = @acroread@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+bzip = @bzip@
+bzip2 = @bzip2@
+convert = @convert@
+datadir = @datadir@
+datarootdir = @datarootdir@
+distill = @distill@
+docdir = @docdir@
+dvidir = @dvidir@
+dvips = @dvips@
+exec_prefix = @exec_prefix@
+file_prog = @file_prog@
+ghostview = @ghostview@
+grog = @grog@
+gv = @gv@
+gzip = @gzip@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+html2ps = @html2ps@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+latex = @latex@
+libdir = @libdir@
+libexecdir = @libexecdir@
+lispdir = @lispdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+makeinfo = @makeinfo@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+netscape = @netscape@
+oldincludedir = @oldincludedir@
+pdf2ps = @pdf2ps@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+ps2pdf = @ps2pdf@
+psdir = @psdir@
+psnup = @psnup@
+psselect = @psselect@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+tex = @tex@
+dist_lisp_LISP = a2ps.el a2ps-print.el
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu contrib/emacs/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu contrib/emacs/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+elc-stamp: $(LISP)
+ @echo 'WARNING: Warnings can be ignored. :-)'
+ @rm -f elc-temp && touch elc-temp
+ if test "$(EMACS)" != no; then \
+ set x; \
+ list='$(LISP)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ set x "$$@" "$$d$$p"; shift; \
+ done; \
+ shift; \
+ EMACS="$(EMACS)" $(SHELL) $(elisp_comp) "$$@" || exit 1; \
+ else : ; fi
+ @mv -f elc-temp $@
+$(am__ELCFILES): elc-stamp
+ @if test "$(EMACS)" != no && test ! -f $@; then \
+ trap 'rm -rf elc-lock elc-stamp' 1 2 13 15; \
+ if mkdir elc-lock 2>/dev/null; then \
+ rm -f elc-stamp; \
+ $(MAKE) $(AM_MAKEFLAGS) elc-stamp; \
+ rmdir elc-lock; \
+ else \
+ while test -d elc-lock; do sleep 1; done; \
+ test -f elc-stamp; exit $$?; \
+ fi; \
+ else : ; fi
+install-dist_lispLISP: $(dist_lisp_LISP) $(ELCFILES)
+ @$(NORMAL_INSTALL)
+ @if test "$(EMACS)" != no; then \
+ test -z "$(lispdir)" || $(mkdir_p) "$(DESTDIR)$(lispdir)"; \
+ list='$(dist_lisp_LISP)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(dist_lispLISP_INSTALL) '$$d$$p' '$(DESTDIR)$(lispdir)/$$f'"; \
+ $(dist_lispLISP_INSTALL) "$$d$$p" "$(DESTDIR)$(lispdir)/$$f"; \
+ if test -f $${p}c; then \
+ echo " $(dist_lispLISP_INSTALL) '$${p}c' '$(DESTDIR)$(lispdir)/$${f}c'"; \
+ $(dist_lispLISP_INSTALL) "$${p}c" "$(DESTDIR)$(lispdir)/$${f}c"; \
+ else : ; fi; \
+ done; \
+ else : ; fi
+
+uninstall-dist_lispLISP:
+ @$(NORMAL_UNINSTALL)
+ @if test "$(EMACS)" != no; then \
+ list='$(dist_lisp_LISP)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(lispdir)/$$f' '$(DESTDIR)$(lispdir)/$${f}c'"; \
+ rm -f "$(DESTDIR)$(lispdir)/$$f" "$(DESTDIR)$(lispdir)/$${f}c"; \
+ done; \
+ else : ; fi
+
+clean-lisp:
+ -rm -f elc-stamp $(ELCFILES)
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LISP) $(ELCFILES)
+installdirs:
+ for dir in "$(DESTDIR)$(lispdir)"; do \
+ test -z "$$dir" || $(mkdir_p) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-lisp mostlyclean-am
+
+distclean: distclean-am
+ -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am: install-dist_lispLISP
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-dist_lispLISP uninstall-info-am
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+ clean-lisp distclean distclean-generic distclean-libtool \
+ distdir dvi dvi-am html html-am info info-am install \
+ install-am install-data install-data-am install-dist_lispLISP \
+ install-exec install-exec-am install-info install-info-am \
+ install-man install-strip installcheck installcheck-am \
+ installdirs maintainer-clean maintainer-clean-generic \
+ mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+ ps ps-am uninstall uninstall-am uninstall-dist_lispLISP \
+ uninstall-info-am
+
+# 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/emacs/a2ps-print.el b/contrib/emacs/a2ps-print.el
new file mode 100644
index 0000000..4b5177a
--- /dev/null
+++ b/contrib/emacs/a2ps-print.el
@@ -0,0 +1,102 @@
+;;a2ps-print.el: Postscript printing hook for a2ps.
+;;This file is available at ftp://ftp.cppsig.org/pub/tools/emacs/a2ps-print.el
+;;This requires a2ps to be installed in your PATH
+;;a2ps is available at ftp://ftp.enst.fr/pub/unix/a2ps/ and others
+
+;; Keywords: languages, faces, a2ps
+;;Modified for enscript from lpr.el by Jim Robinson robinson@wdg.mot.com
+;;Modified for a2ps by phanes@icon.com and docs by bingalls@panix.com
+;;Tested on a2ps v4.10 on emacs & xemacs 20.2 on solaris
+
+;;; This file is part of a2ps.
+;;;
+;;; 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 3, or (at your option)
+;;; any later version.
+;;;
+;;; This program is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with this program; see the file COPYING. If not, write to
+;;; the Free Software Foundation, 59 Temple Place - Suite 330,
+;;; Boston, MA 02111-1307, USA.
+;;;
+
+;; This file is (not yet) part of GNU Emacs.
+;; $Id: a2ps-print.el,v 1.1.1.1.2.1 2007/12/29 01:58:11 mhatta Exp $
+
+;;Put the following into your .emacs:
+;(load "a2ps-print")
+;(global-set-key 'f22 'a2ps-buffer) ;f22 is Print Screen
+;(global-set-key '(shift f22) 'a2ps-region-1) ;print selected text
+;(add-menu-button '("File") ["a2ps-print" a2ps-buffer "--"]) ;on file menu
+ ;;Someday I'll get menu to show PrtScr instead of f22...
+
+;you can pass up to 4 command line switches to a2ps.
+;Here's a recommended sample for your .emacs:
+;(setq a2ps-switches `("-C" "--line-numbers=1"))
+
+(defvar a2ps-switches nil
+;You can replace nil above with up to 4 hard coded switches:
+;`("-C" "--line-numbers=1")
+ "*List of strings to pass as extra switch args to a2ps when it is invo\
+ked.")
+
+(defvar a2ps-command "a2ps"
+ "Shell command for printing a file")
+
+(defun a2ps-buffer (argp)
+ "Print buffer contents as with Unix command `a2ps'.
+`a2ps-switches' is a list of extra switches (strings) to pass to a2ps."
+ (interactive "P")
+ (a2ps-region (point-min) (point-max) argp))
+
+(defun a2ps-region (start end argp)
+ "Print region contents as with Unix command `a2ps'.
+`a2ps-switches' is a list of extra switches (strings) to pass to a2ps."
+ (interactive "r\nP")
+ (let ((switches a2ps-switches)
+ (lpr-command a2ps-command))
+ (if argp
+ (setq switches (append switches (list (read-string "switches: ")))))
+ (a2ps-region-1 start end switches)))
+
+(defun a2ps-region-1 (start end switches)
+ (let (
+ (name (buffer-name))
+ (filetype (substring (buffer-name)
+ (string-match "[^.]*$" (buffer-name))))
+ (width tab-width))
+; this line doesn't work if switches actually contains anything
+; (message (concat "Sending '" name "' to " lpr-command " switches: "
+; switches " filetype: " filetype))
+ (save-excursion
+ (message "Spooling...")
+ (if (/= tab-width 8)
+ (let ((oldbuf (current-buffer)))
+ (set-buffer (get-buffer-create " *spool temp*"))
+ (widen) (erase-buffer)
+ (insert-buffer-substring oldbuf)
+ (setq tab-width width)
+ (untabify (point-min) (point-max))
+ (setq start (point-min) end (point-max))))
+ (apply 'call-process-region
+ (nconc (list start end lpr-command
+ nil nil nil
+;above can be replaced with this debug line:
+; nil '(nil "/tmp/EEE") nil
+; (concat "--header=" name)
+ (concat "--center-title=" name)
+ (concat "--footer=" (concat name " Emacs buffer"))
+ (concat "--pretty-print=" filetype)
+;Uncommenting the following gives a print preview (only):
+; (concat "--output=/tmp/foo.ps")
+ )
+ switches))
+ (message "Spooling...done")
+ )))
+
diff --git a/contrib/emacs/a2ps.el b/contrib/emacs/a2ps.el
new file mode 100644
index 0000000..7182dc7
--- /dev/null
+++ b/contrib/emacs/a2ps.el
@@ -0,0 +1,225 @@
+;;; a2ps.el --- Major mode for a2ps style sheets
+
+;; Author: Akim Demaille (demaille@inf.enst.fr)
+;; Maintainer: Akim Demaille (demaille@inf.enst.fr)
+;; Keywords: languages, faces, a2ps
+
+;;; Copyright (c) 1988, 89, 90, 91, 92, 93 Miguel Santana
+;;; Copyright (c) 1995, 96, 97, 98 Akim Demaille, Miguel Santana
+
+;;;
+;;; This file is part of a2ps.
+;;;
+;;; 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 3, or (at your option)
+;;; any later version.
+;;;
+;;; This program is distributed in the hope that it will be useful,
+;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with this program; see the file COPYING. If not, write to
+;;; the Free Software Foundation, 59 Temple Place - Suite 330,
+;;; Boston, MA 02111-1307, USA.
+;;;
+
+;; This file is (not yet) part of GNU Emacs.
+
+;; $Id: a2ps.el,v 1.1.1.1.2.2 2007/12/29 01:58:11 mhatta Exp $
+
+;; to autoload a2ps lisp code:
+;; (autoload 'a2ps-mode "a2ps-mode" nil t)
+;;
+;; or can use (load "a2ps-mode") or (require 'a2ps-mode) to just load it
+;;
+;; to try to "auto-detect" a2ps files:
+;; (setq auto-mode-alist
+;; (cons '(".*\\.a2ps$" . a2ps-mode)
+;; auto-mode-alist))
+
+;; Thanks to Didier Verna <verna@inf.enst.fr> for
+;; a2ps-compile-regexp
+
+;;path to the a2ps program
+(defvar a2ps-program "/usr/local/bin/a2ps")
+
+;;thank god for make-regexp.el!
+(defvar a2ps-font-lock-keywords
+ `(
+ ("^\\\#.*" . font-lock-comment-face)
+; ("\\\$\\\*" . font-lock-variable-name-face)
+; ("\\\$[0-9]" . font-lock-variable-name-face)
+; ("\\\$\\\#" . font-lock-variable-name-face)
+ ;; Keywords related to the LaTeX symbols
+ ("\\b\\(---\\|\\\\\\(Alpha\\|Beta\\|Chi\\|D\\(elta\\|ownarrow\\)\\|E\\(psilon\\|ta\\)\\|Gamma\\|I\\(m\\|ota\\)\\|Kappa\\|L\\(ambda\\|eft\\(arrow\\|rightarrow\\)\\)\\|Mu\\|Nu\\|Om\\(ega\\|icron\\)\\|P\\(hi\\|i\\|si\\)\\|R\\(e\\|ho\\|ightarrow\\)\\|Sigma\\|T\\(au\\|heta\\)\\|Up\\(arrow\\|silon\\)\\|Xi\\|Zeta\\|a\\(l\\(eph\\|pha\\)\\|ngle\\|pp\\(le\\|rox\\)\\)\\|b\\(eta\\|ullet\\)\\|c\\(a\\(p\\|rriagereturn\\)\\|dot\\|hi\\|irc\\|lubsuit\\|o\\(ng\\|pyright\\)\\|up\\)\\|d\\(elta\\|i\\(amondsuit\\|v\\)\\|ownarrow\\)\\|e\\(mptyset\\|psilon\\|quiv\\|ta\\|xists\\)\\|f\\(lorin\\|orall\\)\\|g\\(amma\\|eq\\)\\|heartsuit\\|i\\(n\\(\\|fty\\|t\\)\\|ota\\)\\|kappa\\|l\\(a\\(mbda\\|ngle\\)\\|ceil\\|dots\\|e\\(ft\\(arrow\\|rightarrow\\)\\|q\\)\\|floor\\)\\|mu\\|n\\(abla\\|eq\\|ot\\(\\|\\\\\\(in\\|subset\\)\\)\\|u\\)\\|o\\(m\\(ega\\|icron\\)\\|plus\\|times\\)\\|p\\([im]\\|artial\\|erp\\|hi\\|r\\(ime\\|o\\(d\\|pto\\)\\)\\|si\\)\\|r\\(a\\(dicalex\\|ngle\\)\\|ceil\\|egister\\|floor\\|ho\\|ightarrow\\)\\|s\\(i\\(gma\\|m\\)\\|padesuit\\|u\\(bset\\(\\|eq\\)\\|chthat\\|m\\|pset\\(\\|eq\\)\\|rd\\)\\)\\|t\\(au\\|he\\(refore\\|ta\\)\\|imes\\|rademark\\)\\|up\\(arrow\\|silon\\)\\|v\\(ar\\(Upsilon\\|copyright\\|diamondsuit\\|p\\(hi\\|i\\)\\|register\\|sigma\\|t\\(heta\\|rademark\\)\\)\\|ee\\)\\|w\\(edge\\|p\\)\\|xi\\|zeta\\)\\)\\b" . font-lock-type-face)
+ ;; Keywords related to the struture
+ ("\\b\\(a\\(2ps\\|lphabets?\\|ncestors\\|re\\)\\|by\\|c\\(ase\\|losers\\)\\|documentation\\|e\\(nd\\|xceptions\\)\\|first\\|i\\([ns]\\|nsensitive\\)\\|keywords\\|op\\(erators\\|tional\\)\\|requires\\|s\\(e\\(cond\\|nsitive\\|quences\\)\\|tyle\\)\\|version\\|written\\)\\b" . font-lock-keyword-face)
+ ;; Keywords related to the faces or special sequences
+ ("\\b\\(C\\(-\\(char\\|string\\)\\|omment\\(\\|_strong\\)\\)\\|E\\(ncoding\\|rror\\)\\|In\\(dex[1234]\\|visible\\)\\|Keyword\\(\\|_strong\\)\\|Label\\(\\|_strong\\)\\|Plain\\|S\\(tring\\|ymbol\\)\\|Tag[1234]\\)\\b" . font-lock-type-face)
+ "default font-lock-keywords")
+)
+
+;; this may still need some work
+(defvar a2ps-mode-syntax-table nil
+ "syntax table used in a2ps mode")
+(setq a2ps-mode-syntax-table (make-syntax-table))
+;(modify-syntax-entry ?` "('" a2ps-mode-syntax-table)
+;(modify-syntax-entry ?' ")`" a2ps-mode-syntax-table)
+(modify-syntax-entry ?# "<\n" a2ps-mode-syntax-table)
+(modify-syntax-entry ?\n ">#" a2ps-mode-syntax-table)
+(modify-syntax-entry ?/ "\"" a2ps-mode-syntax-table)
+;(modify-syntax-entry ?{ "_" a2ps-mode-syntax-table)
+;(modify-syntax-entry ?} "_" a2ps-mode-syntax-table)
+(modify-syntax-entry ?\\ "_" a2ps-mode-syntax-table)
+(modify-syntax-entry ?@ "w" a2ps-mode-syntax-table)
+(modify-syntax-entry ?_ "w" a2ps-mode-syntax-table)
+(modify-syntax-entry ?* "w" a2ps-mode-syntax-table)
+
+;;; a2ps-compile-regexp
+
+;;; Author: Didier Verna on metheny <verna@inf.enst.fr>
+;;; Maintainer: Verna@inf.enst.fr
+;;; Created: Wed Aug 6 08:54:37 1997 under emacs
+;;; Last revision: Wed Aug 6 10:32:40 1997
+;;;
+;;; Removed this now the syntax is completely different.
+;;; (defun a2ps-compile-regexp (start end)
+;;; "Compile a list of keywords or operators to the optimized regexp.
+;;; - Select the region of keywords and type M-x a2ps-compile-regexp."
+;;; (interactive "r")
+;;; (let (thelist lines)
+;;; (setq lines (count-lines start end))
+;;; (goto-char start)
+;;; (save-excursion
+;;; (while (< (point) end)
+;;; (re-search-forward "[^ #,\"\t\n]+")
+;;; (setq thelist (cons (match-string 0) thelist))
+;;; (goto-char (+ (match-end 0) 1))))
+;;; (let ((i 1))
+;;; (beginning-of-line)
+;;; (while (<= i lines)
+;;; (if (not (string= (char-to-string (following-char)) "#"))
+;;; (insert "#"))
+;;; (forward-line)
+;;; (setq i (+ i 1))))
+;;; (insert "/")
+;;; (save-excursion
+;;; (insert (prin1-to-string (make-regexp thelist)))
+;;; (delete-char -1)
+;;; (insert "/\n"))
+;;; (delete-char 1)))
+
+(defvar a2ps-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "\C-c\C-b" 'a2ps-a2ps-buffer)
+;;; (define-key map "\C-c\C-r" 'a2ps-a2ps-region)
+ (define-key map "\C-c\C-c" 'comment-region)
+ map))
+
+(defun a2ps-check-buffer ()
+ "Check that the current style sheet is correct"
+ (interactive)
+ ;; This `let' is for protecting the previous value of compile-command.
+ (let ((compile-command (concat a2ps-program
+ " -q < /dev/null -o - > /dev/null -E"
+ buffer-file-name)))
+ (compile compile-command))
+)
+
+(defun a2ps-a2ps-region ()
+ "send contents of the current region to a2ps"
+ (interactive)
+ (start-process "a2psprocess" "*a2ps output*" a2ps-program "-e")
+ (process-send-region "a2psprocess" (point) (mark))
+ (process-send-eof "a2psprocess")
+ (switch-to-buffer "*a2ps output*")
+)
+
+(easy-menu-define a2ps-mode-menu
+ a2ps-mode-map
+ "Menu used in a2ps mode."
+ (list "a2ps"
+ ["Compile region" a2ps-compile-regexp t]
+ ["Documentation" a2ps-goto-info-page t]
+; ["Complete" TeX-complete-symbol t]
+; ["Save Document" TeX-save-document t]
+; ["Next Error" TeX-next-error t]
+; ["Kill Job" TeX-kill-job t]
+; ["Debug Bad Boxes" TeX-toggle-debug-boxes
+; :style toggle :selected TeX-debug-bad-boxes ]
+; ["Switch to Original File" TeX-home-buffer t]
+; ["Recenter Output Buffer" TeX-recenter-output-buffer t]
+; ;; ["Uncomment" TeX-un-comment t]
+; ["Uncomment Region" TeX-un-comment-region t]
+; ;; ["Comment Paragraph" TeX-comment-paragraph t]
+; ["Comment Region" TeX-comment-region t]
+; ["Switch to Master file" TeX-home-buffer t]
+; ["Submit bug report" TeX-submit-bug-report t]
+; ["Reset Buffer" TeX-normal-mode t]
+; ["Reset AUC TeX" (TeX-normal-mode t) :keys "C-u C-c C-n"]
+ ))
+
+;; Open info on the page on How to write a style sheet
+(defun a2ps-goto-info-page ()
+ "Read documentation for a2ps style sheets in the info system."
+ (interactive)
+ (require 'info)
+ (Info-goto-node "(a2ps)Style sheets implementation"))
+
+(defun a2ps-mode ()
+ "A major-mode to edit a2ps style sheet files
+\\{a2ps-mode-map}
+"
+ (interactive)
+ (kill-all-local-variables)
+ (use-local-map a2ps-mode-map)
+
+ (make-local-variable 'comment-start)
+ (setq comment-start "#")
+ (make-local-variable 'parse-sexp-ignore-comments)
+ (setq parse-sexp-ignore-comments t)
+
+ ; Used to have a cooler environment
+ (require 'filladapt)
+ (filladapt-mode)
+
+ ; Used to compile regexps
+; (load "make-regexp")
+
+ ; Used for the menus
+ (require 'easymenu)
+
+ ; Install the menus
+ (easy-menu-add a2ps-mode-menu a2ps-mode-map)
+
+ ; The \ is used both as an escape in strings, and
+ ; as a symbol constituent in LaTeX like symbols
+ (setq words-include-escapes t)
+
+ (make-local-variable 'font-lock-defaults)
+ (setq major-mode 'a2ps-mode
+ mode-name "a2ps"
+ font-lock-defaults `(a2ps-font-lock-keywords nil)
+ )
+ (set-syntax-table a2ps-mode-syntax-table)
+ (run-hooks 'a2ps-mode-hook))
+
+(provide 'a2ps-mode)
+
+;;stuff to play with for debugging
+;(char-to-string (char-syntax ?`))
+
+;;; (setq foo (make-regexp '("a2ps" "alphabet" "alphabets" "ancestors" "are" "by" "case" "closers" "documentation" "end" "exceptions" "first" "in" "insensitive" "is" "keywords" "requires" "second" "sensitive" "operators" "optional" "sequences" "style" "version" "written") t))
+
+;;; (setq bar (make-regexp '("\\\\forall" "\\\\exists" "\\\\suchthat" "\\\\cong" "\\\\Alpha" "\\\\Beta" "\\\\Chi" "\\\\Delta" "\\\\Epsilon" "\\\\Phi" "\\\\Gamma" "\\\\Eta" "\\\\Iota" "\\\\vartheta" "\\\\Kappa" "\\\\Lambda" "\\\\Mu" "\\\\Nu" "\\\\Omicron" "\\\\Pi" "\\\\Theta" "\\\\Rho" "\\\\Sigma" "\\\\Tau" "\\\\Upsilon" "\\\\varsigma" "\\\\Omega" "\\\\Xi" "\\\\Psi" "\\\\Zeta" "\\\\therefore" "\\\\perp" "\\\\radicalex" "\\\\alpha" "\\\\beta" "\\\\chi" "\\\\delta" "\\\\epsilon" "\\\\phi" "\\\\gamma" "\\\\eta" "\\\\iota" "\\\\varphi" "\\\\kappa" "\\\\lambda" "\\\\mu" "\\\\nu" "\\\\omicron" "\\\\pi" "\\\\theta" "\\\\rho" "\\\\sigma" "\\\\tau" "\\\\upsilon" "\\\\varpi" "\\\\omega" "\\\\xi" "\\\\psi" "\\\\zeta" "\\\\sim" "\\\\varUpsilon" "\\\\prime" "\\\\leq" "\\\\infty" "\\\\florin" "\\\\clubsuit" "\\\\diamondsuit" "\\\\heartsuit" "\\\\spadesuit" "\\\\leftrightarrow" "\\\\leftarrow" "\\\\uparrow" "\\\\rightarrow" "\\\\downarrow" "\\\\circ" "\\\\pm" "\\\\geq" "\\\\times" "\\\\propto" "\\\\partial" "\\\\bullet" "\\\\div" "\\\\neq" "\\\\equiv" "\\\\approx" "\\\\ldots" "---" "\\\\carriagereturn" "\\\\aleph" "\\\\Im" "\\\\Re" "\\\\wp" "\\\\otimes" "\\\\oplus" "\\\\emptyset" "\\\\cap" "\\\\cup" "\\\\supset" "\\\\supseteq" "\\\\not\\\\subset" "\\\\subset" "\\\\subseteq" "\\\\in" "\\\\not\\\\in" "\\\\angle" "\\\\nabla" "\\\\varregister" "\\\\varcopyright" "\\\\vartrademark" "\\\\prod" "\\\\surd" "\\\\cdot" "\\\\not" "\\\\wedge" "\\\\vee" "\\\\Leftrightarrow" "\\\\Leftarrow" "\\\\Uparrow" "\\\\Rightarrow" "\\\\Downarrow" "\\\\vardiamondsuit" "\\\\langle" "\\\\register" "\\\\copyright" "\\\\trademark" "\\\\sum" "\\\\lceil" "\\\\lfloor" "\\\\apple" "\\\\rangle" "\\\\int" "\\\\rceil" "\\\\rfloor")))
+
+
+;;; (defvar foobar (make-regexp '("Plain" "Keyword" "Keyword_strong" "Comment" "Comment_strong" "Label" "Label_strong" "String" "Symbol" "Tag1" "Tag2" "Tag3" "Tag4" "Index1" "Index2" "Index3" "Index4" "Error" "Encoding" "Invisible" "C-string" "C-char")))
+
+
+;;; (setq forall (make-regexp '("\\\\forall" "\\\\bullet")))
+
+;;; a2ps.el ends here
diff --git a/contrib/fixbb.m4 b/contrib/fixbb.m4
new file mode 100644
index 0000000..4e5ea73
--- /dev/null
+++ b/contrib/fixbb.m4
@@ -0,0 +1,157 @@
+include(shell.m4)
+#! /bin/sh -e
+# -*- ksh -*-
+
+# Get the name of the program
+program=`echo $0 | sed 's#.*/##g'`
+
+# Look for a running ghostscript
+gs=${GHOSTSCRIPT:-${GS:-gs}}
+tmpdir=`mktemp -d -t fixbb.XXXXXX` || { echo "$program: Cannot create temporary dir!" >&2 ; exit 1; }
+
+# fixbb -- Fix bounding box info in postscript files.
+# Written 2/92 by ggh@cs.brown.edu,
+# using an idea of Doug Crabill (dgc@cs.purdue.edu).
+# Revised 9/30/92: Use GNU utilities, make backup copy of input.
+# Revised 3/18/93: Set PATH explicitly.
+# Revised 4/23/93: Hack FrameMaker header so that it doesn't set paper size.
+# 04/21/99: Changed by hf@nike.phys.chemie.uni-muenchen.de to run with gs5.x
+# and some sort of eps-files.
+#------------------------------------------------------------------------------
+
+help="Try \`$program --help' for more information."
+
+# Parse command line arguments.
+option_without_arguments='vhsqDf'
+
+GETOPT([[ -v | --v*) echo "$version"; exit 0;;
+ -h | --h*) echo "$usage"; exit 0;;
+ -q | -s | --s* | --q*) verbose=:;;
+ # Delay debugging so that options parsing does not appear
+ -D | --debug) debug=: ;;
+ -o | --output) shift ; output=$1 ;;
+ -f | --force)
+ # Refuse if gs does not seem to work
+ if test "x$gs" = x; then
+ echo "$program: error: ghostscript does not work." >&2
+ exit 1
+ else
+ run_gs=1
+ fi
+ ;;
+ -) # We are working with stdin ;;
+ set dummy "$@" "$1"; shift;;]])
+
+# Check the number of arguments.
+case $# in
+ 0) file=-;;
+ 1) file=$1;;
+ *) echo "$program: too many arguments" 1>&2
+ echo "$help" 1>&2
+ exit 1;;
+esac
+
+if test -n "$debug"; then
+ # Set -x now if debugging
+ set -x
+else
+ # Temp dir. Get ready not to leave junk (if not debugging)
+ trap "/bin/rm -rf $tmpdir" 0 1 2 3 13 15
+fi
+
+#------------------------------------------------------------------------------
+# Render image using GhostScript.
+#------------------------------------------------------------------------------
+
+# Does ghostscript run?
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+if ($gs -v) >/dev/null 2>&1; then :; else
+ echo "Cannot not run $gs" >&2
+ exit 1
+fi
+
+echo "Computing bounding box: ."
+
+# If gs support the bbox device, then cool!
+if ($gs -h | grep bbox) >/dev/null 2>&1; then
+ bbox_awk='
+/^%%BoundingBox:/ {
+ if (bbox_llx < $1)
+ bbox_llx = $1 ;
+ if (bbox_lly < $2)
+ bbox_lly = $2;
+ if (bbox_urx > $3)
+ bbox_urx = $3;
+ if (bbox_ury > $4)
+ bbox_urx = $4;
+}
+
+/^%%HiResBoundingBox:/ {
+ if (hrbbox_llx < $1)
+ hrbbox_llx = $1 ;
+ if (hrbbox_lly < $2)
+ hrbbox_lly = $2;
+ if (hrbbox_urx > $3)
+ hrbbox_urx = $3;
+ if (hrbbox_ury > $4)
+ hrbbox_urx = $4;
+}
+
+END {
+ print "%%BoundingBox:" bbox_llx bbox_lly bbox_urx bbox_ury;
+ print "%%HiResBoundingBox:" hrbbox_llx hrbbox_lly hrbbox_urx hrbbox_ury;
+}
+'
+ # I don't know why, but the result is sent onto stderr.
+ bbox=`$gs -dNOPAUSE -sDEVICE=bbox $file 2>&1 >/dev/null | awk "$bbox_awk"`
+ echo $bbox
+ exit 0
+else
+ echo "Cannot not run $gs -sDEVICE=bbox" >&2
+ exit 1
+fi
+
+BBOX=`$GS -dNOPAUSE -dQUIET -dBATCH -sDEVICE=epswrite -sOutputFile=- $1 | \
+grep "^%%BoundingBox: *[0-9]" | cut -d" " -f2- `
+
+echo -n "."
+
+if [ $? -ne 0 ]; then echo; echo "fixbb: Could not find bbox" >&2; exit 1; fi
+
+echo "$BBOX"
+
+echo -n "Editing $1: ."
+
+#------------------------------------------------------------------------------
+# Backup original file and replace with updated version.
+#------------------------------------------------------------------------------
+
+cp $1 $1.orig
+
+if [ $? -ne 0 ]; then echo; echo "fixbb: Could not save original file" >&2; exit 1; fi
+
+#------------------------------------------------------------------------------
+# Update %%BoundingBox comment in source file, nuke /papersize in Frame output.
+#------------------------------------------------------------------------------
+
+awk '\
+ /^%%BoundingBox/ {if (!done) print "%%BoundingBox: '"$BBOX"'"; done=1; next}\
+ /FrameDict/ {frame=1}\
+ /%%EndProlog/ {if (frame) print "FrameDict begin /papersize {false} def end"}\
+ /.*/ {print}\
+ END {if (!done) print "%%BoundingBox: '"$BBOX"'"}' \
+ $1.orig > $1
+
+if [ $? -ne 0 ]; then
+ echo; echo "fixbb: Edit of $1 failed" >&2;
+ cp $1.orig $1;
+ if [ $? -ne 0 ]; then
+ echo;
+ echo "fixbb: Could not write back original file saved in $1.orig" >&2;
+ exit 1;
+ fi
+ exit 1;
+fi
+
+echo ".done"
diff --git a/contrib/fixnt.c b/contrib/fixnt.c
new file mode 100644
index 0000000..451f037
--- /dev/null
+++ b/contrib/fixnt.c
@@ -0,0 +1,2472 @@
+
+#line 3 "fixnt.c"
+
+#define YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 33
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types.
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t;
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
+#endif
+
+#endif /* ! FLEXINT_H */
+
+#ifdef __cplusplus
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else /* ! __cplusplus */
+
+#if __STDC__
+
+#define YY_USE_CONST
+
+#endif /* __STDC__ */
+#endif /* ! __cplusplus */
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index. If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition. This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN (yy_start) = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state. The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START (((yy_start) - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart(yyin )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#define YY_BUF_SIZE 16384
+#endif
+
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+extern int yyleng;
+
+extern FILE *yyin, *yyout;
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+ #define YY_LESS_LINENO(n)
+
+/* Return all but the first "n" matched characters back to the input stream. */
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ *yy_cp = (yy_hold_char); \
+ YY_RESTORE_YY_MORE_OFFSET \
+ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ } \
+ while ( 0 )
+
+#define unput(c) yyunput( c, (yytext_ptr) )
+
+/* The following is because we cannot portably get our hands on size_t
+ * (without autoconf's help, which isn't available because we want
+ * flex-generated scanners to compile on their own).
+ */
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef unsigned int yy_size_t;
+#endif
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
+
+ int yy_bs_lineno; /**< The line count. */
+ int yy_bs_column; /**< The column count. */
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via yyrestart()), so that the user can continue scanning by
+ * just pointing yyin at a new input file.
+ */
+#define YY_BUFFER_EOF_PENDING 2
+
+ };
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+/* Stack of input buffers. */
+static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */
+static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */
+static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
+ */
+#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \
+ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \
+ : NULL)
+
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)]
+
+/* yy_hold_char holds the character lost when yytext is formed. */
+static char yy_hold_char;
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
+int yyleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 0; /* whether we need to initialize */
+static int yy_start = 0; /* start state number */
+
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin. A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+void yyrestart (FILE *input_file );
+void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer );
+YY_BUFFER_STATE yy_create_buffer (FILE *file,int size );
+void yy_delete_buffer (YY_BUFFER_STATE b );
+void yy_flush_buffer (YY_BUFFER_STATE b );
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer );
+void yypop_buffer_state (void );
+
+static void yyensure_buffer_stack (void );
+static void yy_load_buffer_state (void );
+static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file );
+
+#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER )
+
+YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size );
+YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str );
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len );
+
+void *yyalloc (yy_size_t );
+void *yyrealloc (void *,yy_size_t );
+void yyfree (void * );
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){ \
+ yyensure_buffer_stack (); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ yy_create_buffer(yyin,YY_BUF_SIZE ); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+ }
+
+#define yy_set_bol(at_bol) \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){\
+ yyensure_buffer_stack (); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ yy_create_buffer(yyin,YY_BUF_SIZE ); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+ }
+
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+/* Begin user sect3 */
+
+typedef unsigned char YY_CHAR;
+
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+
+typedef int yy_state_type;
+
+extern int yylineno;
+
+int yylineno = 1;
+
+extern char *yytext;
+#define yytext_ptr yytext
+
+static yy_state_type yy_get_previous_state (void );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state );
+static int yy_get_next_buffer (void );
+static void yy_fatal_error (yyconst char msg[] );
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+ (yytext_ptr) = yy_bp; \
+ yyleng = (size_t) (yy_cp - yy_bp); \
+ (yy_hold_char) = *yy_cp; \
+ *yy_cp = '\0'; \
+ (yy_c_buf_p) = yy_cp;
+
+#define YY_NUM_RULES 25
+#define YY_END_OF_BUFFER 26
+/* This struct is not used in this scanner,
+ but its presence is necessary. */
+struct yy_trans_info
+ {
+ flex_int32_t yy_verify;
+ flex_int32_t yy_nxt;
+ };
+static yyconst flex_int16_t yy_accept[477] =
+ { 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 26, 25, 25, 25, 2, 25, 25, 6,
+ 25, 25, 24, 25, 25, 25, 25, 25, 25, 25,
+ 25, 9, 25, 25, 16, 25, 0, 0, 2, 0,
+ 0, 6, 0, 0, 24, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 9, 0, 0, 16, 0,
+ 0, 1, 0, 1, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 23, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 5, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 13,
+
+ 0, 0, 6, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 12, 0, 0, 0,
+ 0, 0, 0, 0, 0, 10, 0, 0, 12, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 15, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 24, 0, 22, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 11, 0, 17,
+
+ 0, 0, 0, 0, 8, 0, 0, 0, 3, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 14, 0, 0, 0, 0, 0, 14,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 20, 0,
+ 0, 0, 0, 0, 0, 4, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 19, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 21,
+ 0, 0, 0, 0, 0, 7, 0, 0, 0, 0,
+ 0, 24, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 18, 0
+ } ;
+
+static yyconst flex_int32_t yy_ec[256] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 3, 4, 1, 1, 1, 5, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 6, 1, 7, 1,
+ 1, 1, 8, 1, 9, 1, 10, 11, 1, 1,
+ 1, 1, 1, 12, 13, 14, 15, 16, 17, 18,
+ 19, 1, 1, 1, 1, 1, 1, 20, 21, 22,
+ 1, 23, 24, 25, 1, 26, 27, 1, 1, 1,
+ 1, 1, 1, 1, 28, 1, 29, 30, 31, 32,
+
+ 33, 34, 35, 1, 36, 1, 1, 37, 38, 39,
+ 40, 41, 1, 42, 43, 44, 45, 46, 1, 47,
+ 1, 48, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1
+ } ;
+
+static yyconst flex_int32_t yy_meta[49] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1
+ } ;
+
+static yyconst flex_int16_t yy_base[516] =
+ { 0,
+ 0, 0, 809, 0, 1, 2, 6, 27, 8, 11,
+ 12, 13, 813, 815, 808, 809, 815, 18, 808, 815,
+ 29, 807, 815, 33, 35, 7, 14, 21, 23, 48,
+ 806, 815, 19, 805, 815, 54, 804, 803, 815, 802,
+ 801, 815, 49, 800, 815, 53, 40, 25, 34, 41,
+ 59, 60, 62, 66, 799, 815, 67, 798, 815, 71,
+ 797, 815, 796, 815, 73, 74, 75, 76, 81, 77,
+ 82, 78, 84, 85, 91, 87, 88, 89, 92, 93,
+ 94, 98, 102, 103, 104, 105, 106, 108, 114, 116,
+ 121, 125, 134, 117, 122, 126, 128, 132, 137, 141,
+
+ 795, 142, 143, 146, 151, 152, 149, 158, 153, 154,
+ 159, 167, 160, 161, 164, 162, 794, 815, 166, 174,
+ 179, 171, 180, 169, 186, 184, 190, 189, 197, 200,
+ 201, 793, 204, 206, 205, 207, 209, 202, 212, 217,
+ 214, 215, 216, 218, 219, 220, 221, 792, 815, 228,
+ 229, 232, 237, 233, 238, 240, 242, 244, 245, 246,
+ 249, 251, 255, 257, 258, 259, 262, 265, 260, 266,
+ 268, 281, 282, 269, 270, 284, 272, 280, 288, 291,
+ 292, 791, 293, 790, 301, 295, 294, 300, 302, 304,
+ 306, 310, 312, 315, 317, 319, 320, 321, 789, 815,
+
+ 323, 788, 769, 325, 322, 324, 326, 327, 334, 335,
+ 339, 344, 340, 342, 343, 345, 347, 351, 763, 366,
+ 785, 355, 368, 371, 373, 369, 375, 376, 784, 384,
+ 783, 381, 386, 762, 385, 781, 815, 389, 388, 392,
+ 393, 387, 397, 403, 780, 815, 391, 779, 815, 400,
+ 778, 755, 420, 404, 396, 406, 405, 407, 408, 409,
+ 776, 775, 410, 411, 774, 815, 754, 413, 430, 412,
+ 440, 444, 445, 447, 414, 772, 751, 770, 766, 449,
+ 450, 739, 453, 454, 452, 767, 766, 457, 738, 761,
+ 763, 460, 720, 462, 463, 467, 761, 815, 760, 815,
+
+ 464, 726, 735, 757, 815, 465, 748, 468, 815, 469,
+ 470, 471, 473, 724, 714, 474, 747, 479, 476, 483,
+ 484, 730, 724, 485, 749, 487, 490, 493, 491, 725,
+ 714, 494, 501, 503, 747, 505, 506, 745, 710, 744,
+ 712, 514, 742, 815, 515, 520, 701, 709, 739, 815,
+ 705, 526, 524, 531, 706, 696, 701, 530, 535, 533,
+ 693, 733, 695, 542, 545, 517, 689, 730, 815, 729,
+ 544, 548, 549, 690, 727, 815, 558, 562, 686, 534,
+ 546, 694, 553, 563, 724, 568, 565, 723, 719, 569,
+ 570, 718, 571, 573, 697, 574, 575, 679, 577, 581,
+
+ 691, 578, 579, 683, 582, 584, 681, 585, 589, 684,
+ 591, 586, 674, 592, 593, 713, 580, 595, 712, 815,
+ 596, 598, 711, 600, 710, 815, 601, 603, 609, 709,
+ 708, 691, 668, 668, 662, 681, 678, 700, 660, 668,
+ 657, 655, 658, 655, 663, 693, 692, 671, 663, 656,
+ 657, 665, 662, 684, 644, 652, 641, 639, 642, 639,
+ 647, 677, 676, 672, 671, 650, 632, 644, 636, 634,
+ 637, 627, 666, 665, 815, 815, 665, 664, 663, 662,
+ 661, 660, 659, 658, 657, 656, 655, 654, 653, 652,
+ 651, 650, 649, 648, 646, 645, 644, 643, 642, 641,
+
+ 640, 637, 636, 633, 631, 630, 629, 628, 627, 624,
+ 619, 617, 611, 603, 0
+ } ;
+
+static yyconst flex_int16_t yy_def[516] =
+ { 0,
+ 477, 477, 477, 478, 479, 479, 480, 480, 481, 481,
+ 482, 482, 476, 476, 476, 483, 476, 483, 484, 476,
+ 484, 485, 476, 485, 485, 485, 485, 485, 485, 485,
+ 486, 476, 486, 487, 476, 487, 488, 483, 476, 489,
+ 484, 476, 484, 485, 476, 485, 485, 485, 485, 485,
+ 485, 485, 485, 485, 486, 476, 486, 487, 476, 487,
+ 488, 476, 489, 476, 484, 484, 484, 485, 485, 485,
+ 485, 485, 485, 485, 485, 485, 485, 486, 487, 487,
+ 484, 484, 484, 485, 485, 485, 485, 485, 485, 485,
+ 485, 485, 485, 486, 487, 487, 484, 484, 484, 485,
+
+ 490, 485, 485, 485, 485, 485, 485, 485, 485, 486,
+ 487, 487, 484, 484, 484, 485, 490, 476, 485, 485,
+ 485, 485, 485, 485, 485, 485, 486, 487, 487, 487,
+ 484, 491, 484, 485, 485, 485, 485, 485, 485, 485,
+ 485, 485, 486, 487, 487, 487, 484, 491, 476, 492,
+ 485, 485, 485, 485, 485, 485, 485, 485, 485, 485,
+ 486, 487, 487, 487, 487, 484, 492, 492, 485, 485,
+ 485, 485, 485, 485, 485, 485, 485, 485, 486, 487,
+ 487, 493, 487, 494, 492, 485, 485, 485, 485, 485,
+ 485, 485, 485, 485, 485, 486, 487, 487, 493, 476,
+
+ 487, 494, 476, 492, 485, 485, 485, 485, 485, 485,
+ 485, 485, 485, 485, 486, 487, 487, 487, 476, 492,
+ 495, 485, 485, 485, 485, 485, 485, 485, 496, 486,
+ 497, 487, 487, 476, 492, 495, 476, 485, 485, 485,
+ 485, 485, 485, 485, 496, 476, 486, 497, 476, 487,
+ 498, 476, 492, 485, 485, 485, 485, 485, 485, 485,
+ 499, 500, 486, 487, 498, 476, 476, 492, 485, 485,
+ 485, 485, 485, 485, 485, 499, 476, 500, 476, 486,
+ 487, 476, 492, 485, 485, 501, 502, 485, 476, 476,
+ 503, 487, 476, 504, 485, 485, 501, 476, 502, 476,
+
+ 485, 476, 476, 503, 476, 487, 476, 504, 476, 504,
+ 485, 485, 485, 476, 476, 487, 476, 504, 485, 485,
+ 485, 476, 476, 487, 476, 504, 485, 485, 485, 476,
+ 476, 487, 476, 504, 505, 485, 485, 476, 476, 506,
+ 476, 504, 505, 476, 485, 485, 476, 476, 506, 476,
+ 476, 504, 485, 485, 476, 476, 476, 504, 485, 485,
+ 476, 507, 476, 504, 485, 485, 476, 507, 476, 508,
+ 504, 485, 485, 476, 508, 476, 485, 485, 476, 485,
+ 485, 476, 485, 485, 509, 485, 485, 509, 476, 485,
+ 485, 476, 485, 485, 476, 485, 485, 476, 485, 485,
+
+ 476, 485, 485, 476, 485, 485, 476, 485, 485, 476,
+ 485, 485, 476, 485, 485, 510, 485, 485, 510, 476,
+ 485, 485, 511, 485, 511, 476, 485, 485, 485, 512,
+ 512, 476, 476, 476, 476, 476, 476, 476, 476, 476,
+ 476, 476, 476, 476, 476, 513, 513, 476, 476, 476,
+ 476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
+ 476, 514, 514, 476, 476, 476, 476, 476, 476, 476,
+ 476, 476, 515, 515, 476, 0, 476, 476, 476, 476,
+ 476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
+ 476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
+
+ 476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
+ 476, 476, 476, 476, 476
+ } ;
+
+static yyconst flex_int16_t yy_nxt[864] =
+ { 0,
+ 474, 17, 20, 20, 18, 21, 21, 23, 45, 32,
+ 24, 25, 32, 35, 35, 45, 36, 36, 26, 39,
+ 56, 40, 45, 27, 45, 28, 45, 29, 23, 30,
+ 42, 24, 25, 43, 45, 45, 45, 46, 50, 26,
+ 33, 45, 45, 33, 27, 52, 28, 47, 29, 45,
+ 42, 53, 48, 51, 45, 59, 49, 57, 60, 54,
+ 45, 45, 72, 45, 71, 65, 68, 45, 56, 69,
+ 66, 70, 59, 67, 42, 42, 42, 45, 45, 45,
+ 73, 75, 45, 45, 79, 45, 45, 80, 45, 45,
+ 56, 94, 45, 59, 59, 42, 76, 74, 78, 42,
+
+ 77, 85, 82, 42, 45, 45, 45, 45, 84, 45,
+ 83, 81, 88, 89, 91, 45, 86, 45, 56, 92,
+ 87, 101, 45, 59, 95, 97, 45, 59, 90, 42,
+ 93, 96, 98, 42, 102, 45, 109, 100, 42, 106,
+ 104, 107, 45, 45, 45, 99, 105, 45, 108, 103,
+ 45, 113, 45, 45, 45, 56, 111, 112, 110, 45,
+ 59, 42, 42, 45, 114, 42, 120, 45, 59, 121,
+ 45, 132, 45, 115, 119, 45, 116, 123, 122, 124,
+ 45, 45, 139, 125, 129, 45, 127, 45, 141, 130,
+ 59, 56, 131, 135, 128, 126, 133, 138, 59, 136,
+
+ 134, 59, 42, 45, 137, 42, 45, 45, 45, 154,
+ 45, 155, 140, 45, 150, 45, 45, 56, 45, 59,
+ 59, 59, 42, 151, 142, 143, 158, 144, 152, 42,
+ 45, 153, 146, 45, 45, 162, 145, 156, 45, 45,
+ 163, 45, 168, 45, 147, 45, 45, 45, 178, 160,
+ 56, 176, 59, 157, 161, 159, 59, 164, 59, 59,
+ 42, 45, 165, 42, 170, 166, 42, 45, 169, 45,
+ 45, 45, 171, 45, 175, 172, 168, 177, 174, 168,
+ 173, 45, 45, 45, 179, 45, 193, 181, 191, 56,
+ 180, 195, 59, 59, 59, 45, 45, 183, 186, 184,
+
+ 182, 45, 42, 45, 185, 45, 188, 45, 187, 189,
+ 190, 45, 192, 45, 194, 168, 45, 212, 45, 207,
+ 56, 59, 59, 45, 59, 45, 42, 45, 45, 197,
+ 210, 196, 221, 206, 198, 45, 45, 201, 205, 168,
+ 45, 45, 204, 45, 56, 45, 59, 208, 59, 209,
+ 223, 214, 59, 211, 215, 231, 45, 220, 213, 224,
+ 217, 48, 226, 216, 218, 49, 225, 42, 222, 45,
+ 45, 230, 45, 240, 45, 241, 45, 45, 227, 228,
+ 168, 233, 59, 229, 242, 56, 42, 59, 45, 45,
+ 45, 232, 56, 45, 45, 239, 238, 45, 45, 168,
+
+ 253, 59, 235, 255, 45, 45, 45, 45, 45, 45,
+ 45, 56, 59, 45, 42, 45, 243, 244, 251, 254,
+ 247, 42, 250, 256, 258, 283, 263, 168, 260, 261,
+ 264, 45, 257, 259, 168, 262, 269, 270, 271, 273,
+ 284, 45, 268, 281, 275, 45, 45, 285, 45, 272,
+ 56, 59, 274, 45, 42, 45, 295, 280, 45, 288,
+ 292, 59, 306, 309, 45, 45, 59, 168, 45, 309,
+ 309, 45, 45, 286, 45, 59, 310, 45, 287, 294,
+ 309, 291, 310, 310, 45, 45, 59, 286, 309, 301,
+ 287, 45, 45, 310, 45, 59, 311, 296, 316, 312,
+
+ 321, 310, 329, 333, 309, 313, 45, 45, 318, 319,
+ 328, 336, 320, 324, 327, 309, 45, 310, 45, 334,
+ 326, 45, 354, 332, 337, 45, 359, 309, 310, 352,
+ 341, 309, 45, 335, 45, 45, 45, 340, 345, 342,
+ 310, 365, 364, 309, 310, 309, 45, 45, 358, 45,
+ 45, 378, 346, 372, 45, 377, 310, 373, 310, 45,
+ 380, 353, 360, 45, 45, 383, 45, 381, 371, 45,
+ 45, 45, 45, 396, 45, 45, 45, 366, 45, 45,
+ 45, 45, 45, 45, 408, 45, 45, 45, 386, 384,
+ 45, 412, 45, 45, 45, 387, 45, 45, 390, 45,
+
+ 424, 45, 45, 463, 45, 399, 391, 394, 397, 403,
+ 45, 447, 393, 400, 411, 421, 409, 431, 405, 425,
+ 415, 402, 406, 414, 419, 418, 417, 388, 375, 368,
+ 349, 343, 427, 308, 423, 429, 304, 299, 422, 430,
+ 297, 278, 276, 265, 248, 245, 236, 428, 202, 199,
+ 167, 148, 117, 63, 61, 58, 55, 44, 41, 38,
+ 34, 31, 22, 19, 16, 14, 475, 475, 473, 472,
+ 471, 470, 469, 468, 467, 466, 465, 464, 464, 462,
+ 461, 460, 459, 458, 457, 456, 455, 454, 453, 452,
+ 451, 450, 449, 448, 448, 446, 445, 444, 443, 442,
+
+ 441, 440, 439, 438, 437, 436, 435, 434, 433, 432,
+ 432, 426, 426, 420, 420, 416, 413, 410, 407, 404,
+ 401, 398, 395, 392, 389, 389, 385, 382, 376, 379,
+ 376, 369, 374, 370, 369, 367, 363, 362, 361, 357,
+ 350, 356, 355, 344, 351, 350, 348, 347, 344, 339,
+ 338, 333, 331, 330, 325, 323, 322, 317, 305, 315,
+ 314, 300, 298, 307, 305, 303, 302, 300, 298, 293,
+ 290, 279, 289, 277, 282, 266, 279, 277, 267, 266,
+ 249, 246, 237, 252, 249, 246, 237, 234, 219, 203,
+ 200, 203, 200, 149, 149, 118, 118, 64, 62, 59,
+
+ 56, 45, 42, 64, 39, 62, 59, 56, 45, 42,
+ 39, 37, 476, 15, 13, 476, 476, 476, 476, 476,
+ 476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
+ 476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
+ 476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
+ 476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
+ 476, 476, 476
+ } ;
+
+static yyconst flex_int16_t yy_chk[864] =
+ { 0,
+ 515, 4, 5, 6, 4, 5, 6, 7, 26, 9,
+ 7, 7, 10, 11, 12, 27, 11, 12, 7, 18,
+ 33, 18, 28, 7, 29, 7, 48, 7, 8, 8,
+ 21, 8, 8, 21, 24, 49, 25, 24, 26, 8,
+ 9, 47, 50, 10, 8, 28, 8, 25, 8, 30,
+ 43, 29, 25, 27, 46, 36, 25, 33, 36, 30,
+ 51, 52, 49, 53, 48, 43, 46, 54, 57, 46,
+ 43, 47, 60, 43, 65, 66, 67, 68, 70, 72,
+ 50, 52, 69, 71, 60, 73, 74, 60, 76, 77,
+ 78, 78, 75, 79, 80, 81, 53, 51, 57, 82,
+
+ 54, 69, 66, 83, 84, 85, 86, 87, 68, 88,
+ 67, 65, 72, 73, 75, 89, 70, 90, 94, 76,
+ 71, 85, 91, 95, 79, 81, 92, 96, 74, 97,
+ 77, 80, 82, 98, 86, 93, 93, 84, 99, 90,
+ 88, 91, 100, 102, 103, 83, 89, 104, 92, 87,
+ 107, 97, 105, 106, 109, 110, 95, 96, 94, 108,
+ 111, 113, 114, 116, 98, 115, 103, 119, 112, 104,
+ 124, 114, 122, 99, 102, 120, 100, 106, 105, 107,
+ 121, 123, 123, 108, 112, 126, 110, 125, 125, 112,
+ 128, 127, 113, 119, 111, 109, 115, 122, 129, 120,
+
+ 116, 130, 131, 138, 121, 133, 135, 134, 136, 136,
+ 137, 137, 124, 139, 133, 141, 142, 143, 140, 144,
+ 145, 146, 147, 134, 126, 127, 140, 128, 134, 150,
+ 151, 135, 130, 152, 154, 144, 129, 138, 153, 155,
+ 144, 156, 150, 157, 131, 158, 159, 160, 160, 142,
+ 161, 158, 162, 139, 143, 141, 163, 145, 164, 165,
+ 166, 169, 146, 167, 152, 147, 168, 170, 151, 171,
+ 174, 175, 153, 177, 157, 154, 167, 159, 156, 168,
+ 155, 178, 172, 173, 161, 176, 176, 163, 174, 179,
+ 162, 178, 180, 181, 183, 187, 186, 165, 169, 166,
+
+ 164, 188, 185, 189, 168, 190, 171, 191, 170, 172,
+ 173, 192, 175, 193, 177, 185, 194, 193, 195, 188,
+ 196, 197, 198, 205, 201, 206, 204, 207, 208, 180,
+ 191, 179, 205, 187, 181, 209, 210, 183, 186, 204,
+ 211, 213, 185, 214, 215, 212, 216, 189, 217, 190,
+ 207, 195, 218, 192, 196, 216, 222, 204, 194, 208,
+ 198, 212, 210, 197, 201, 212, 209, 220, 206, 223,
+ 226, 215, 224, 224, 225, 225, 227, 228, 211, 213,
+ 220, 218, 232, 214, 226, 230, 235, 233, 242, 239,
+ 238, 217, 247, 240, 241, 223, 222, 255, 243, 235,
+
+ 235, 250, 220, 239, 244, 254, 257, 256, 258, 259,
+ 260, 263, 264, 270, 268, 275, 227, 228, 233, 238,
+ 230, 253, 232, 240, 241, 268, 247, 268, 242, 243,
+ 250, 269, 240, 241, 253, 244, 254, 255, 256, 258,
+ 269, 271, 253, 264, 260, 272, 273, 270, 274, 257,
+ 280, 281, 259, 285, 283, 284, 284, 263, 288, 275,
+ 281, 292, 292, 294, 295, 301, 306, 283, 296, 308,
+ 310, 311, 312, 271, 313, 316, 294, 319, 273, 283,
+ 318, 280, 308, 310, 320, 321, 324, 272, 326, 288,
+ 274, 327, 329, 318, 328, 332, 295, 285, 306, 296,
+
+ 313, 326, 321, 333, 334, 301, 336, 337, 310, 311,
+ 320, 328, 312, 316, 319, 342, 345, 334, 366, 326,
+ 318, 346, 346, 324, 329, 353, 353, 352, 342, 342,
+ 333, 358, 354, 327, 360, 380, 359, 332, 336, 334,
+ 352, 359, 358, 364, 358, 371, 365, 381, 352, 372,
+ 373, 373, 337, 365, 383, 372, 364, 366, 371, 377,
+ 377, 345, 354, 378, 384, 380, 387, 378, 364, 386,
+ 390, 391, 393, 393, 394, 396, 397, 360, 399, 402,
+ 403, 417, 400, 405, 405, 406, 408, 412, 383, 381,
+ 409, 409, 411, 414, 415, 384, 418, 421, 386, 422,
+
+ 422, 424, 427, 514, 428, 396, 387, 391, 394, 400,
+ 429, 513, 390, 397, 408, 417, 406, 512, 402, 511,
+ 412, 399, 403, 411, 510, 415, 414, 509, 508, 507,
+ 506, 505, 424, 504, 421, 428, 503, 502, 418, 429,
+ 501, 500, 499, 498, 497, 496, 495, 427, 494, 493,
+ 492, 491, 490, 489, 488, 487, 486, 485, 484, 483,
+ 482, 481, 480, 479, 478, 477, 474, 473, 472, 471,
+ 470, 469, 468, 467, 466, 465, 464, 463, 462, 461,
+ 460, 459, 458, 457, 456, 455, 454, 453, 452, 451,
+ 450, 449, 448, 447, 446, 445, 444, 443, 442, 441,
+
+ 440, 439, 438, 437, 436, 435, 434, 433, 432, 431,
+ 430, 425, 423, 419, 416, 413, 410, 407, 404, 401,
+ 398, 395, 392, 389, 388, 385, 382, 379, 375, 374,
+ 370, 368, 367, 363, 362, 361, 357, 356, 355, 351,
+ 349, 348, 347, 343, 341, 340, 339, 338, 335, 331,
+ 330, 325, 323, 322, 317, 315, 314, 307, 304, 303,
+ 302, 299, 297, 293, 291, 290, 289, 287, 286, 282,
+ 279, 278, 277, 276, 267, 265, 262, 261, 252, 251,
+ 248, 245, 236, 234, 231, 229, 221, 219, 203, 202,
+ 199, 184, 182, 148, 132, 117, 101, 63, 61, 58,
+
+ 55, 44, 41, 40, 38, 37, 34, 31, 22, 19,
+ 16, 15, 13, 3, 476, 476, 476, 476, 476, 476,
+ 476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
+ 476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
+ 476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
+ 476, 476, 476, 476, 476, 476, 476, 476, 476, 476,
+ 476, 476, 476
+ } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+
+extern int yy_flex_debug;
+int yy_flex_debug = 0;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+char *yytext;
+#line 1 "fixnt.l"
+#line 3 "fixnt.l"
+ /* Time-stamp: "99/06/29 14:48:25 bauer" */
+
+ /* Filter for Windows NT 4.0 postscript printer driver. Enables
+ * the use of psnup from Angus Duggan's psutils package
+ * ( http://www.dcs.ed.ac.uk/home/ajcd/psutils/ )
+ * Copyright: GNU General Public License (GPL)
+ * Authors:
+ * Holger Bauer 1998, 1999 bauer@itsm.uni-stuttgart.de
+ * Michael Rath 1998, 1999 rath@itsm.uni-stuttgart.de
+ * Akim Demaille 1999 demaille@inf.enst.fr
+ * Version: 0.1c
+ * Release Date: 1999/02/04
+ *
+ * Compilation:
+ *
+ * flex fixnt.l
+ * cc -O -o fixnt lex.yy.c
+ *
+ * Usage:
+ * csh-prompt> cat BAD_NT_Postscript_FILE.ps | fixnt | psnup -4 | gs -
+ * or:
+ * csh-prompt> cat BAD_NT_Postscript_FILE.ps | fixnt | psnup -4 >GOOD.ps
+ *
+ * Windows NT 3.5 users may be happy with:
+ * csh-prompt> cat BAD_NT_Postscript_FILE.ps | \
+ * sed 's/NTPSOct94/NTPSOct95/g' | fixnt | psnup -4 >GOOD.ps
+ *
+ * TODO-List:
+ * - check for NTPSOct94 (in the meantime use the sed command above)
+ *
+ *
+ * BUG-Reports: to Authors (above) (please, no 20MB postscript files !!!!!!)
+ * Patches (welcome) to code maintainer: bauer@itsm.uni-stuttgart.de
+ *
+ */
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+# include <stdio.h>
+# if defined STDC_HEADERS || defined _LIBC || defined HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+# if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+# endif
+# if HAVE_UNISTD_H
+# include <unistd.h>
+# endif
+#else /* !HAVE_CONFIG_H */
+# include <stdio.h>
+# ifdef _WIN32
+# include <stdlib.h>
+# include <process.h>
+# include <wtypes.h>
+# include <winbase.h>
+# else /* !_WIN32 */
+# include <unistd.h>
+# endif
+# include <sys/types.h>
+char *getenv ();
+#endif /* !HAVE_CONFIG_H */
+
+/* Support of prototyping when possible */
+#ifndef PARAMS
+# if PROTOTYPES
+# define PARAMS(protos) protos
+# else /* no PROTOTYPES */
+# define PARAMS(protos) ()
+# endif /* no PROTOTYPES */
+#endif
+
+/* Do not allow redefinition of malloc and realloc. */
+#undef malloc
+#undef realloc
+
+#if defined (YYLMAX)
+# undef YYLMAX
+# define YYLMAX 1024
+#endif
+
+void reassemble PARAMS ((FILE*,FILE*,FILE*,char*,char*,char*));
+static int first_time = 1;
+FILE *font;
+FILE *adobe;
+FILE *body;
+int ifpagesv = 0;
+int ifcorel = 0;
+int ifendsetup = 0;
+int pid;
+char fontfname[255];
+char adobefname[255];
+char bodyfname[255];
+#ifdef _WIN32
+char tmpdir[_MAX_PATH];
+#else
+const char *tmpdir;
+#endif
+
+#line 908 "fixnt.c"
+
+#define INITIAL 0
+#define DUMMY 1
+#define NORMAL 2
+#define BODY 3
+#define ADOBE 4
+#define FONT 5
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+static int yy_init_globals (void );
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap (void );
+#else
+extern int yywrap (void );
+#endif
+#endif
+
+ static void yyunput (int c,char *buf_ptr );
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char *,yyconst char *,int );
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * );
+#endif
+
+#ifndef YY_NO_INPUT
+
+#ifdef __cplusplus
+static int yyinput (void );
+#else
+static int input (void );
+#endif
+
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#endif
+
+/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+ { \
+ int c = '*'; \
+ size_t n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else \
+ { \
+ errno=0; \
+ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+ { \
+ if( errno != EINTR) \
+ { \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ break; \
+ } \
+ errno=0; \
+ clearerr(yyin); \
+ } \
+ }\
+\
+
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* end tables serialization structures and prototypes */
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+
+extern int yylex (void);
+
+#define YY_DECL int yylex (void)
+#endif /* !YY_DECL */
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+ if ( yyleng > 0 ) \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
+ (yytext[yyleng - 1] == '\n'); \
+ YY_USER_ACTION
+
+/** The main scanner function which does all the work.
+ */
+YY_DECL
+{
+ register yy_state_type yy_current_state;
+ register char *yy_cp, *yy_bp;
+ register int yy_act;
+
+#line 105 "fixnt.l"
+
+
+
+ if(first_time){
+ BEGIN DUMMY;
+ first_time = 0;
+ }
+
+
+#line 1079 "fixnt.c"
+
+ if ( !(yy_init) )
+ {
+ (yy_init) = 1;
+
+#ifdef YY_USER_INIT
+ YY_USER_INIT;
+#endif
+
+ if ( ! (yy_start) )
+ (yy_start) = 1; /* first start state */
+
+ if ( ! yyin )
+ yyin = stdin;
+
+ if ( ! yyout )
+ yyout = stdout;
+
+ if ( ! YY_CURRENT_BUFFER ) {
+ yyensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ yy_create_buffer(yyin,YY_BUF_SIZE );
+ }
+
+ yy_load_buffer_state( );
+ }
+
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = (yy_c_buf_p);
+
+ /* Support of yytext. */
+ *yy_cp = (yy_hold_char);
+
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
+
+ yy_current_state = (yy_start);
+ yy_current_state += YY_AT_BOL();
+yy_match:
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 477 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ ++yy_cp;
+ }
+ while ( yy_base[yy_current_state] != 815 );
+
+yy_find_action:
+ yy_act = yy_accept[yy_current_state];
+ if ( yy_act == 0 )
+ { /* have to back up */
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ yy_act = yy_accept[yy_current_state];
+ }
+
+ YY_DO_BEFORE_ACTION;
+
+do_action: /* This label is used only to access EOF actions. */
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = (yy_hold_char);
+ yy_cp = (yy_last_accepting_cpos);
+ yy_current_state = (yy_last_accepting_state);
+ goto yy_find_action;
+
+case 1:
+/* rule 1 can match eol */
+YY_RULE_SETUP
+#line 114 "fixnt.l"
+{ /* regular Postscript starts here ... */
+ ECHO;
+ BEGIN NORMAL;
+}
+ YY_BREAK
+case 2:
+/* rule 2 can match eol */
+YY_RULE_SETUP
+#line 119 "fixnt.l"
+{ /* nothing to do */
+}
+ YY_BREAK
+case 3:
+/* rule 3 can match eol */
+YY_RULE_SETUP
+#line 122 "fixnt.l"
+{ /* Corel Draw modus recognized */
+ ifcorel = 1;
+ ECHO;
+}
+ YY_BREAK
+case 4:
+/* rule 4 can match eol */
+YY_RULE_SETUP
+#line 127 "fixnt.l"
+{ /* suppress EndSetup */
+ fprintf(yyout,"NTPSOct95 begin\n");
+ ifendsetup = 1;
+}
+ YY_BREAK
+case 5:
+/* rule 5 can match eol */
+YY_RULE_SETUP
+#line 132 "fixnt.l"
+{ /* read up to first page and just output everyting */
+ sprintf(bodyfname, "%s/fixnt_Body_%d", tmpdir, pid);
+ body = fopen(bodyfname,"w+");
+ fprintf(body,"%s",yytext);
+ BEGIN BODY;
+}
+ YY_BREAK
+case 6:
+/* rule 6 can match eol */
+YY_RULE_SETUP
+#line 139 "fixnt.l"
+{ /* o.k. */
+ fprintf(yyout,"%s",yytext);
+}
+ YY_BREAK
+case 7:
+/* rule 7 can match eol */
+YY_RULE_SETUP
+#line 143 "fixnt.l"
+{ /* Adobe Stuff */
+ sprintf(adobefname, "%s/fixnt_Adobe_%d", tmpdir, pid);
+ adobe = fopen(adobefname,"w+");
+ fprintf(adobe,"%s",yytext);
+ BEGIN ADOBE;
+}
+ YY_BREAK
+case 8:
+/* rule 8 can match eol */
+YY_RULE_SETUP
+#line 150 "fixnt.l"
+{ /* End of Adobe definition stuff */
+ fprintf(adobe,"%s",yytext);
+ BEGIN BODY;
+}
+ YY_BREAK
+case 9:
+/* rule 9 can match eol */
+YY_RULE_SETUP
+#line 155 "fixnt.l"
+{ /* print just everything ... */
+ fprintf(adobe,"%s",yytext);
+}
+ YY_BREAK
+case 10:
+/* rule 10 can match eol */
+YY_RULE_SETUP
+#line 160 "fixnt.l"
+{ ;
+ /* remove showpage definition of CorelDraw defintions */
+ if( ifcorel == 1 ){
+ fprintf(body," @gs @gr\n"); /* Corel draw defines spg as showpage */
+ } else {
+ fprintf(body,"%s",yytext); /* Somebody else defined spg, leave it in */
+ }
+}
+ YY_BREAK
+case 11:
+/* rule 11 can match eol */
+YY_RULE_SETUP
+#line 169 "fixnt.l"
+{ ;
+ /* font definitions from here on */
+ sprintf(fontfname, "%s/fixnt_Font_%d", tmpdir, pid);
+ font = fopen(fontfname,"w+");
+ fprintf(font,"%s",yytext);
+ BEGIN FONT;
+}
+ YY_BREAK
+case 12:
+/* rule 12 can match eol */
+YY_RULE_SETUP
+#line 177 "fixnt.l"
+{ /* Font definitions go to FILE* font */
+ fprintf(font,"%s",yytext);
+ BEGIN FONT;
+}
+ YY_BREAK
+case 13:
+/* rule 13 can match eol */
+YY_RULE_SETUP
+#line 182 "fixnt.l"
+{ /* End of Font Definition */
+ fprintf(font,"%s",yytext);
+ BEGIN BODY;
+}
+ YY_BREAK
+case 14:
+/* rule 14 can match eol */
+YY_RULE_SETUP
+#line 187 "fixnt.l"
+{ ;
+/* NT 3.5 Postscript Files have different FontDefinitions */
+ fprintf(font,"%s",yytext);
+ BEGIN FONT;
+}
+ YY_BREAK
+case 15:
+/* rule 15 can match eol */
+YY_RULE_SETUP
+#line 193 "fixnt.l"
+{ ;
+/* NT 3.5 Postscript Files have different FontDefinitions */
+ fprintf(font,"%s",yytext);
+ BEGIN BODY;
+}
+ YY_BREAK
+case 16:
+/* rule 16 can match eol */
+YY_RULE_SETUP
+#line 199 "fixnt.l"
+{ /* goes all to FILE *font ... */
+ fprintf(font,"%s",yytext);
+}
+ YY_BREAK
+case 17:
+/* rule 17 can match eol */
+YY_RULE_SETUP
+#line 203 "fixnt.l"
+{ ;
+ ifpagesv = 1;
+}
+ YY_BREAK
+case 18:
+/* rule 18 can match eol */
+YY_RULE_SETUP
+#line 207 "fixnt.l"
+{
+ fprintf(body,"%%%%Trailer\nAdobe_WinNT_Driver_Gfx dup /terminate get exec\nPageSV restore\nFontSV restore\n");
+}
+ YY_BREAK
+case 19:
+/* rule 19 can match eol */
+YY_RULE_SETUP
+#line 211 "fixnt.l"
+{ ;
+ /* switch FontSV/PageSV */
+ fprintf(body,"PageSV restore\nFontSV restore\n");
+}
+ YY_BREAK
+case 20:
+/* rule 20 can match eol */
+YY_RULE_SETUP
+#line 216 "fixnt.l"
+{ ;
+/* put PageSV after Trailer */
+ fprintf(body,"%%%%Trailer\nPageSV restore\n");
+}
+ YY_BREAK
+case 21:
+/* rule 21 can match eol */
+YY_RULE_SETUP
+#line 222 "fixnt.l"
+{ ;
+/* put PageSV/FontSV after Trailer */
+ fprintf(body,"%%%%Trailer\nPageSV restore\nFontSV restore\n");
+}
+ YY_BREAK
+case 22:
+/* rule 22 can match eol */
+YY_RULE_SETUP
+#line 228 "fixnt.l"
+{ ;
+/* do not allow any PageSV's to appear within the actual body */
+}
+ YY_BREAK
+case 23:
+/* rule 23 can match eol */
+YY_RULE_SETUP
+#line 233 "fixnt.l"
+{ ;
+/* What to do at the end of the file (either recognized by %%EOF or
+ reg. end of file */
+ fprintf(body,"%s",yytext);
+ return 0;
+}
+ YY_BREAK
+case YY_STATE_EOF(BODY):
+#line 240 "fixnt.l"
+{ ;
+/* This section is obsolete, could be removed ..., assume there is no
+ string <<EOF>> in a Postscript file ... */
+
+/* Only flex knows about the <<EOF>> symbol therefore put the
+ reassembling process into the main program. Plain lex does return 0
+ for regular end of file marks. */
+ return 0;
+}
+ YY_BREAK
+case 24:
+/* rule 24 can match eol */
+YY_RULE_SETUP
+#line 250 "fixnt.l"
+{ /* put pages in FILE *body */
+ fprintf(body,"%s",yytext);
+}
+ YY_BREAK
+case 25:
+YY_RULE_SETUP
+#line 254 "fixnt.l"
+ECHO;
+ YY_BREAK
+#line 1402 "fixnt.c"
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(DUMMY):
+case YY_STATE_EOF(NORMAL):
+case YY_STATE_EOF(ADOBE):
+case YY_STATE_EOF(FONT):
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = (yy_hold_char);
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed yyin at a new source and called
+ * yylex(). If so, then we have to assure
+ * consistency between YY_CURRENT_BUFFER and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++(yy_c_buf_p);
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = (yy_c_buf_p);
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ (yy_did_buffer_switch_on_eof) = 0;
+
+ if ( yywrap( ) )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * yytext, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) =
+ (yytext_ptr) + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ (yy_c_buf_p) =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)];
+
+ yy_current_state = yy_get_previous_state( );
+
+ yy_cp = (yy_c_buf_p);
+ yy_bp = (yytext_ptr) + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
+} /* end of yylex */
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
+ */
+static int yy_get_next_buffer (void)
+{
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ register char *source = (yytext_ptr);
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a single character, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0;
+
+ else
+ {
+ int num_to_read =
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+ int yy_c_buf_p_offset =
+ (int) ((yy_c_buf_p) - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+ number_to_move - 1;
+
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+ (yy_n_chars), (size_t) num_to_read );
+
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ if ( (yy_n_chars) == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ yyrestart(yyin );
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ (yy_n_chars) += number_to_move;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR;
+
+ (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+ return ret_val;
+}
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+ static yy_state_type yy_get_previous_state (void)
+{
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
+
+ yy_current_state = (yy_start);
+ yy_current_state += YY_AT_BOL();
+
+ for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 477 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
+}
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ * next_state = yy_try_NUL_trans( current_state );
+ */
+ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state )
+{
+ register int yy_is_jam;
+ register char *yy_cp = (yy_c_buf_p);
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ (yy_last_accepting_state) = yy_current_state;
+ (yy_last_accepting_cpos) = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 477 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_is_jam = (yy_current_state == 476);
+
+ return yy_is_jam ? 0 : yy_current_state;
+}
+
+ static void yyunput (int c, register char * yy_bp )
+{
+ register char *yy_cp;
+
+ yy_cp = (yy_c_buf_p);
+
+ /* undo effects of setting up yytext */
+ *yy_cp = (yy_hold_char);
+
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+ { /* need to shift things up to make room */
+ /* +2 for EOB chars. */
+ register int number_to_move = (yy_n_chars) + 2;
+ register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
+ register char *source =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move];
+
+ while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ *--dest = *--source;
+
+ yy_cp += (int) (dest - source);
+ yy_bp += (int) (dest - source);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+
+ if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
+ YY_FATAL_ERROR( "flex scanner push-back overflow" );
+ }
+
+ *--yy_cp = (char) c;
+
+ (yytext_ptr) = yy_bp;
+ (yy_hold_char) = *yy_cp;
+ (yy_c_buf_p) = yy_cp;
+}
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+ static int yyinput (void)
+#else
+ static int input (void)
+#endif
+
+{
+ int c;
+
+ *(yy_c_buf_p) = (yy_hold_char);
+
+ if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] )
+ /* This was really a NUL. */
+ *(yy_c_buf_p) = '\0';
+
+ else
+ { /* need more input */
+ int offset = (yy_c_buf_p) - (yytext_ptr);
+ ++(yy_c_buf_p);
+
+ switch ( yy_get_next_buffer( ) )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because yy_g_n_b()
+ * sees that we've accumulated a
+ * token and flags that we need to
+ * try matching the token before
+ * proceeding. But for input(),
+ * there's no matching to consider.
+ * So convert the EOB_ACT_LAST_MATCH
+ * to EOB_ACT_END_OF_FILE.
+ */
+
+ /* Reset buffer status. */
+ yyrestart(yyin );
+
+ /*FALLTHROUGH*/
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( yywrap( ) )
+ return EOF;
+
+ if ( ! (yy_did_buffer_switch_on_eof) )
+ YY_NEW_FILE;
+#ifdef __cplusplus
+ return yyinput();
+#else
+ return input();
+#endif
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ (yy_c_buf_p) = (yytext_ptr) + offset;
+ break;
+ }
+ }
+ }
+
+ c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */
+ *(yy_c_buf_p) = '\0'; /* preserve yytext */
+ (yy_hold_char) = *++(yy_c_buf_p);
+
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
+
+ return c;
+}
+#endif /* ifndef YY_NO_INPUT */
+
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ *
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+ void yyrestart (FILE * input_file )
+{
+
+ if ( ! YY_CURRENT_BUFFER ){
+ yyensure_buffer_stack ();
+ YY_CURRENT_BUFFER_LVALUE =
+ yy_create_buffer(yyin,YY_BUF_SIZE );
+ }
+
+ yy_init_buffer(YY_CURRENT_BUFFER,input_file );
+ yy_load_buffer_state( );
+}
+
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ *
+ */
+ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer )
+{
+
+ /* TODO. We should be able to replace this entire function body
+ * with
+ * yypop_buffer_state();
+ * yypush_buffer_state(new_buffer);
+ */
+ yyensure_buffer_stack ();
+ if ( YY_CURRENT_BUFFER == new_buffer )
+ return;
+
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ yy_load_buffer_state( );
+
+ /* We don't actually know whether we did this switch during
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ (yy_did_buffer_switch_on_eof) = 1;
+}
+
+static void yy_load_buffer_state (void)
+{
+ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+ (yy_hold_char) = *(yy_c_buf_p);
+}
+
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ *
+ * @return the allocated buffer state.
+ */
+ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size )
+{
+ YY_BUFFER_STATE b;
+
+ b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_buf_size = size;
+
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_is_our_buffer = 1;
+
+ yy_init_buffer(b,file );
+
+ return b;
+}
+
+/** Destroy the buffer.
+ * @param b a buffer created with yy_create_buffer()
+ *
+ */
+ void yy_delete_buffer (YY_BUFFER_STATE b )
+{
+
+ if ( ! b )
+ return;
+
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+
+ if ( b->yy_is_our_buffer )
+ yyfree((void *) b->yy_ch_buf );
+
+ yyfree((void *) b );
+}
+
+#ifndef __cplusplus
+extern int isatty (int );
+#endif /* __cplusplus */
+
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a yyrestart() or at EOF.
+ */
+ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file )
+
+{
+ int oerrno = errno;
+
+ yy_flush_buffer(b );
+
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
+
+ /* If b is the current buffer, then yy_init_buffer was _probably_
+ * called from yyrestart() or through yy_get_next_buffer.
+ * In that case, we don't want to reset the lineno or column.
+ */
+ if (b != YY_CURRENT_BUFFER){
+ b->yy_bs_lineno = 1;
+ b->yy_bs_column = 0;
+ }
+
+ b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+
+ errno = oerrno;
+}
+
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ *
+ */
+ void yy_flush_buffer (YY_BUFFER_STATE b )
+{
+ if ( ! b )
+ return;
+
+ b->yy_n_chars = 0;
+
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+ b->yy_buf_pos = &b->yy_ch_buf[0];
+
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ if ( b == YY_CURRENT_BUFFER )
+ yy_load_buffer_state( );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ * the current state. This function will allocate the stack
+ * if necessary.
+ * @param new_buffer The new state.
+ *
+ */
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer )
+{
+ if (new_buffer == NULL)
+ return;
+
+ yyensure_buffer_stack();
+
+ /* This block is copied from yy_switch_to_buffer. */
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *(yy_c_buf_p) = (yy_hold_char);
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p);
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars);
+ }
+
+ /* Only push if top exists. Otherwise, replace top. */
+ if (YY_CURRENT_BUFFER)
+ (yy_buffer_stack_top)++;
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+ /* copied from yy_switch_to_buffer. */
+ yy_load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ * The next element becomes the new top.
+ *
+ */
+void yypop_buffer_state (void)
+{
+ if (!YY_CURRENT_BUFFER)
+ return;
+
+ yy_delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ if ((yy_buffer_stack_top) > 0)
+ --(yy_buffer_stack_top);
+
+ if (YY_CURRENT_BUFFER) {
+ yy_load_buffer_state( );
+ (yy_did_buffer_switch_on_eof) = 1;
+ }
+}
+
+/* Allocates the stack if it does not exist.
+ * Guarantees space for at least one push.
+ */
+static void yyensure_buffer_stack (void)
+{
+ int num_to_alloc;
+
+ if (!(yy_buffer_stack)) {
+
+ /* First allocation is just for 2 elements, since we don't know if this
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
+ * immediate realloc on the next call.
+ */
+ num_to_alloc = 1;
+ (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+
+ memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+ (yy_buffer_stack_max) = num_to_alloc;
+ (yy_buffer_stack_top) = 0;
+ return;
+ }
+
+ if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){
+
+ /* Increase the buffer to prepare for a possible push. */
+ int grow_size = 8 /* arbitrary grow size */;
+
+ num_to_alloc = (yy_buffer_stack_max) + grow_size;
+ (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc
+ ((yy_buffer_stack),
+ num_to_alloc * sizeof(struct yy_buffer_state*)
+ );
+
+ /* zero only the new slots.*/
+ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*));
+ (yy_buffer_stack_max) = num_to_alloc;
+ }
+}
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ *
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size )
+{
+ YY_BUFFER_STATE b;
+
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ yy_switch_to_buffer(b );
+
+ return b;
+}
+
+/** Setup the input buffer state to scan a string. The next call to yylex() will
+ * scan from a @e copy of @a str.
+ * @param yystr a NUL-terminated string to scan
+ *
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ * yy_scan_bytes() instead.
+ */
+YY_BUFFER_STATE yy_scan_string (yyconst char * yystr )
+{
+
+ return yy_scan_bytes(yystr,strlen(yystr) );
+}
+
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
+ * scan from a @e copy of @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
+ *
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len )
+{
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
+
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = _yybytes_len + 2;
+ buf = (char *) yyalloc(n );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+ for ( i = 0; i < _yybytes_len; ++i )
+ buf[i] = yybytes[i];
+
+ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+
+ b = yy_scan_buffer(buf,n );
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
+
+ return b;
+}
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+static void yy_fatal_error (yyconst char* msg )
+{
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
+}
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ yytext[yyleng] = (yy_hold_char); \
+ (yy_c_buf_p) = yytext + yyless_macro_arg; \
+ (yy_hold_char) = *(yy_c_buf_p); \
+ *(yy_c_buf_p) = '\0'; \
+ yyleng = yyless_macro_arg; \
+ } \
+ while ( 0 )
+
+/* Accessor methods (get/set functions) to struct members. */
+
+/** Get the current line number.
+ *
+ */
+int yyget_lineno (void)
+{
+
+ return yylineno;
+}
+
+/** Get the input stream.
+ *
+ */
+FILE *yyget_in (void)
+{
+ return yyin;
+}
+
+/** Get the output stream.
+ *
+ */
+FILE *yyget_out (void)
+{
+ return yyout;
+}
+
+/** Get the length of the current token.
+ *
+ */
+int yyget_leng (void)
+{
+ return yyleng;
+}
+
+/** Get the current token.
+ *
+ */
+
+char *yyget_text (void)
+{
+ return yytext;
+}
+
+/** Set the current line number.
+ * @param line_number
+ *
+ */
+void yyset_lineno (int line_number )
+{
+
+ yylineno = line_number;
+}
+
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ *
+ * @see yy_switch_to_buffer
+ */
+void yyset_in (FILE * in_str )
+{
+ yyin = in_str ;
+}
+
+void yyset_out (FILE * out_str )
+{
+ yyout = out_str ;
+}
+
+int yyget_debug (void)
+{
+ return yy_flex_debug;
+}
+
+void yyset_debug (int bdebug )
+{
+ yy_flex_debug = bdebug ;
+}
+
+static int yy_init_globals (void)
+{
+ /* Initialization is the same as for the non-reentrant scanner.
+ * This function is called from yylex_destroy(), so don't allocate here.
+ */
+
+ (yy_buffer_stack) = 0;
+ (yy_buffer_stack_top) = 0;
+ (yy_buffer_stack_max) = 0;
+ (yy_c_buf_p) = (char *) 0;
+ (yy_init) = 0;
+ (yy_start) = 0;
+
+/* Defined in main.c */
+#ifdef YY_STDINIT
+ yyin = stdin;
+ yyout = stdout;
+#else
+ yyin = (FILE *) 0;
+ yyout = (FILE *) 0;
+#endif
+
+ /* For future reference: Set errno on error, since we are called by
+ * yylex_init()
+ */
+ return 0;
+}
+
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy (void)
+{
+
+ /* Pop the buffer stack, destroying each element. */
+ while(YY_CURRENT_BUFFER){
+ yy_delete_buffer(YY_CURRENT_BUFFER );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ yypop_buffer_state();
+ }
+
+ /* Destroy the stack itself. */
+ yyfree((yy_buffer_stack) );
+ (yy_buffer_stack) = NULL;
+
+ /* Reset the globals. This is important in a non-reentrant scanner so the next time
+ * yylex() is called, initialization will occur. */
+ yy_init_globals( );
+
+ return 0;
+}
+
+/*
+ * Internal utility routines.
+ */
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n )
+{
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
+}
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * s )
+{
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
+
+ return n;
+}
+#endif
+
+void *yyalloc (yy_size_t size )
+{
+ return (void *) malloc( size );
+}
+
+void *yyrealloc (void * ptr, yy_size_t size )
+{
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
+}
+
+void yyfree (void * ptr )
+{
+ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
+}
+
+#define YYTABLES_NAME "yytables"
+
+#line 254 "fixnt.l"
+
+
+int
+yywrap ()
+{
+ return 1;
+}
+
+int
+main ()
+{
+#ifdef _WIN32
+ GetTempPath(_MAX_PATH, tmpdir);
+#else
+ if (!(tmpdir = getenv("TMPDIR")))
+ tmpdir = "/tmp";
+#endif
+ pid = (int) getpid ();
+ yylex();
+ /* at the end always reassemble the file and clean up ... */
+ reassemble(adobe, font, body, adobefname, fontfname, bodyfname);
+
+ return 0;
+}
+
+void
+reassemble (adobe, font, body, adobefname, fontfname, bodyfname)
+ FILE* adobe;
+ FILE* font;
+ FILE* body;
+ char *adobefname;
+ char *fontfname;
+ char *bodyfname;
+{
+ int xx;
+
+ /* put everything in right order ... */
+ if( adobe != NULL ){
+ rewind(adobe);
+ while( (xx = getc( adobe )) != EOF ){
+ putc(xx,yyout);
+ }
+ fclose(adobe);
+ remove(adobefname);
+ }
+
+ if( font != NULL){
+ rewind(font);
+ while( (xx = getc( font )) != EOF ){
+ putc(xx,yyout);
+ }
+ fclose(font);
+ remove(fontfname);
+ }
+
+ if( ifendsetup == 1){
+ fprintf(yyout,"%%%%EndSetup:\n");
+ }
+
+ if( body != NULL){
+ rewind(body);
+ if(ifpagesv == 1)
+ fprintf(yyout,"NTPSOct95 /PageSV save put\n");
+ while( (xx = getc( body )) != EOF ){
+ putc(xx,yyout);
+ }
+ fclose(body);
+ remove(bodyfname);
+ }
+ return;
+}
+
+/*
+ Local Variables:
+ Mode: C
+ End:
+*/
+
diff --git a/contrib/fixnt.l b/contrib/fixnt.l
new file mode 100644
index 0000000..3625464
--- /dev/null
+++ b/contrib/fixnt.l
@@ -0,0 +1,329 @@
+%p 3000
+%{ /* -*- c -*- */ /* <--- EMACS knows now about what mode to use ... */
+ /* Time-stamp: "99/06/29 14:48:25 bauer" */
+
+ /* Filter for Windows NT 4.0 postscript printer driver. Enables
+ * the use of psnup from Angus Duggan's psutils package
+ * ( http://www.dcs.ed.ac.uk/home/ajcd/psutils/ )
+ * Copyright: GNU General Public License (GPL)
+ * Authors:
+ * Holger Bauer 1998, 1999 bauer@itsm.uni-stuttgart.de
+ * Michael Rath 1998, 1999 rath@itsm.uni-stuttgart.de
+ * Akim Demaille 1999 demaille@inf.enst.fr
+ * Version: 0.1c
+ * Release Date: 1999/02/04
+ *
+ * Compilation:
+ *
+ * flex fixnt.l
+ * cc -O -o fixnt lex.yy.c
+ *
+ * Usage:
+ * csh-prompt> cat BAD_NT_Postscript_FILE.ps | fixnt | psnup -4 | gs -
+ * or:
+ * csh-prompt> cat BAD_NT_Postscript_FILE.ps | fixnt | psnup -4 >GOOD.ps
+ *
+ * Windows NT 3.5 users may be happy with:
+ * csh-prompt> cat BAD_NT_Postscript_FILE.ps | \
+ * sed 's/NTPSOct94/NTPSOct95/g' | fixnt | psnup -4 >GOOD.ps
+ *
+ * TODO-List:
+ * - check for NTPSOct94 (in the meantime use the sed command above)
+ *
+ *
+ * BUG-Reports: to Authors (above) (please, no 20MB postscript files !!!!!!)
+ * Patches (welcome) to code maintainer: bauer@itsm.uni-stuttgart.de
+ *
+ */
+
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+# include <stdio.h>
+# if defined STDC_HEADERS || defined _LIBC || defined HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+# if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+# endif
+# if HAVE_UNISTD_H
+# include <unistd.h>
+# endif
+#else /* !HAVE_CONFIG_H */
+# include <stdio.h>
+# ifdef _WIN32
+# include <stdlib.h>
+# include <process.h>
+# include <wtypes.h>
+# include <winbase.h>
+# else /* !_WIN32 */
+# include <unistd.h>
+# endif
+# include <sys/types.h>
+char *getenv ();
+#endif /* !HAVE_CONFIG_H */
+
+/* Support of prototyping when possible */
+#ifndef PARAMS
+# if PROTOTYPES
+# define PARAMS(protos) protos
+# else /* no PROTOTYPES */
+# define PARAMS(protos) ()
+# endif /* no PROTOTYPES */
+#endif
+
+/* Do not allow redefinition of malloc and realloc. */
+#undef malloc
+#undef realloc
+
+#if defined (YYLMAX)
+# undef YYLMAX
+# define YYLMAX 1024
+#endif
+
+void reassemble PARAMS ((FILE*,FILE*,FILE*,char*,char*,char*));
+static int first_time = 1;
+FILE *font;
+FILE *adobe;
+FILE *body;
+int ifpagesv = 0;
+int ifcorel = 0;
+int ifendsetup = 0;
+int pid;
+char fontfname[255];
+char adobefname[255];
+char bodyfname[255];
+#ifdef _WIN32
+char tmpdir[_MAX_PATH];
+#else
+const char *tmpdir;
+#endif
+%}
+
+%Start DUMMY NORMAL BODY ADOBE FONT
+
+%%
+
+%{
+ if(first_time){
+ BEGIN DUMMY;
+ first_time = 0;
+ }
+%}
+
+<DUMMY>%!.*\n { /* regular Postscript starts here ... */
+ ECHO;
+ BEGIN NORMAL;
+}
+
+<DUMMY>^.*\n { /* nothing to do */
+}
+
+<NORMAL>%%Title:.*CorelDRAW.*\n { /* Corel Draw modus recognized */
+ ifcorel = 1;
+ ECHO;
+}
+
+<NORMAL>%%EndSetup.*\nNTPSOct95[ ]+begin.*\n { /* suppress EndSetup */
+ fprintf(yyout,"NTPSOct95 begin\n");
+ ifendsetup = 1;
+}
+
+<NORMAL>%%Page:.*\n { /* read up to first page and just output everyting */
+ sprintf(bodyfname, "%s/fixnt_Body_%d", tmpdir, pid);
+ body = fopen(bodyfname,"w+");
+ fprintf(body,"%s",yytext);
+ BEGIN BODY;
+}
+
+<NORMAL>.*\n { /* o.k. */
+ fprintf(yyout,"%s",yytext);
+}
+
+<BODY>[/]Adobe_WinNT_Driver_Gfx[ ]175[ ]dict[ ]dup[ ]begin.*\n { /* Adobe Stuff */
+ sprintf(adobefname, "%s/fixnt_Adobe_%d", tmpdir, pid);
+ adobe = fopen(adobefname,"w+");
+ fprintf(adobe,"%s",yytext);
+ BEGIN ADOBE;
+}
+
+<ADOBE>end[ ]reinitialize.*\n { /* End of Adobe definition stuff */
+ fprintf(adobe,"%s",yytext);
+ BEGIN BODY;
+}
+
+<ADOBE>.*\n { /* print just everything ... */
+ fprintf(adobe,"%s",yytext);
+}
+
+
+<BODY>^[ ]@gs[ ]spg[ ]@gr.*\n { ;
+ /* remove showpage definition of CorelDraw defintions */
+ if( ifcorel == 1 ){
+ fprintf(body," @gs @gr\n"); /* Corel draw defines spg as showpage */
+ } else {
+ fprintf(body,"%s",yytext); /* Somebody else defined spg, leave it in */
+ }
+}
+
+<BODY>(NTPSOct95[ ]){0,1}[/]FontSV[ ]save[ ](put|def).*\n { ;
+ /* font definitions from here on */
+ sprintf(fontfname, "%s/fixnt_Font_%d", tmpdir, pid);
+ font = fopen(fontfname,"w+");
+ fprintf(font,"%s",yytext);
+ BEGIN FONT;
+}
+
+<FONT,BODY>%%BeginFont:.*\n { /* Font definitions go to FILE* font */
+ fprintf(font,"%s",yytext);
+ BEGIN FONT;
+}
+
+<FONT>%%EndFont.*\n { /* End of Font Definition */
+ fprintf(font,"%s",yytext);
+ BEGIN BODY;
+}
+
+<FONT,BODY>%%BeginResource:[ ]font.*\n { ;
+/* NT 3.5 Postscript Files have different FontDefinitions */
+ fprintf(font,"%s",yytext);
+ BEGIN FONT;
+}
+
+<FONT>%%EndResource.*\n { ;
+/* NT 3.5 Postscript Files have different FontDefinitions */
+ fprintf(font,"%s",yytext);
+ BEGIN BODY;
+}
+
+<FONT>.*\n { /* goes all to FILE *font ... */
+ fprintf(font,"%s",yytext);
+}
+
+<BODY>(NTPSOct95[ ]){0,1}[/]PageSV[ ]save[ ](put|def).*\n { ;
+ ifpagesv = 1;
+}
+
+<BODY>Adobe_WinNT_Driver_Gfx[ ]dup[ ][/]terminate[ ]get[ ]exec.*\nFontSV[ ]restore.*\nPageSV[ ]restore.*\n%%Trailer.*\n {
+ fprintf(body,"%%%%Trailer\nAdobe_WinNT_Driver_Gfx dup /terminate get exec\nPageSV restore\nFontSV restore\n");
+}
+
+<BODY>FontSV[ ]restore.*\nPageSV[ ]restore.*\n { ;
+ /* switch FontSV/PageSV */
+ fprintf(body,"PageSV restore\nFontSV restore\n");
+}
+
+<BODY>PageSV[ ]restore.*\n%%Trailer.*\n { ;
+/* put PageSV after Trailer */
+ fprintf(body,"%%%%Trailer\nPageSV restore\n");
+}
+
+
+<BODY>FontSV[ ]restore.*\nPageSV[ ]restore.*\n%%Trailer.*\n { ;
+/* put PageSV/FontSV after Trailer */
+ fprintf(body,"%%%%Trailer\nPageSV restore\nFontSV restore\n");
+}
+
+
+<BODY>PageSV[ ]restore.*\n { ;
+/* do not allow any PageSV's to appear within the actual body */
+}
+
+
+<BODY>%%EOF.*\n { ;
+/* What to do at the end of the file (either recognized by %%EOF or
+ reg. end of file */
+ fprintf(body,"%s",yytext);
+ return 0;
+}
+
+<BODY><<EOF>> { ;
+/* This section is obsolete, could be removed ..., assume there is no
+ string <<EOF>> in a Postscript file ... */
+
+/* Only flex knows about the <<EOF>> symbol therefore put the
+ reassembling process into the main program. Plain lex does return 0
+ for regular end of file marks. */
+ return 0;
+}
+
+<BODY>.*\n { /* put pages in FILE *body */
+ fprintf(body,"%s",yytext);
+}
+
+%%
+int
+yywrap ()
+{
+ return 1;
+}
+
+int
+main ()
+{
+#ifdef _WIN32
+ GetTempPath(_MAX_PATH, tmpdir);
+#else
+ if (!(tmpdir = getenv("TMPDIR")))
+ tmpdir = "/tmp";
+#endif
+ pid = (int) getpid ();
+ yylex();
+ /* at the end always reassemble the file and clean up ... */
+ reassemble(adobe, font, body, adobefname, fontfname, bodyfname);
+
+ return 0;
+}
+
+void
+reassemble (adobe, font, body, adobefname, fontfname, bodyfname)
+ FILE* adobe;
+ FILE* font;
+ FILE* body;
+ char *adobefname;
+ char *fontfname;
+ char *bodyfname;
+{
+ int xx;
+
+ /* put everything in right order ... */
+ if( adobe != NULL ){
+ rewind(adobe);
+ while( (xx = getc( adobe )) != EOF ){
+ putc(xx,yyout);
+ }
+ fclose(adobe);
+ remove(adobefname);
+ }
+
+ if( font != NULL){
+ rewind(font);
+ while( (xx = getc( font )) != EOF ){
+ putc(xx,yyout);
+ }
+ fclose(font);
+ remove(fontfname);
+ }
+
+ if( ifendsetup == 1){
+ fprintf(yyout,"%%%%EndSetup:\n");
+ }
+
+ if( body != NULL){
+ rewind(body);
+ if(ifpagesv == 1)
+ fprintf(yyout,"NTPSOct95 /PageSV save put\n");
+ while( (xx = getc( body )) != EOF ){
+ putc(xx,yyout);
+ }
+ fclose(body);
+ remove(bodyfname);
+ }
+ return;
+}
+
+/*
+ Local Variables:
+ Mode: C
+ End:
+*/
diff --git a/contrib/fixps.in b/contrib/fixps.in
new file mode 100644
index 0000000..af424a3
--- /dev/null
+++ b/contrib/fixps.in
@@ -0,0 +1,397 @@
+#! /bin/sh -e
+
+# fixps --- fix as much as possible PS errors that break the psutils
+
+# Copyright (c) 1998-2000 Akim Demaille, Miguel Santana
+
+# 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 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, you can either send email to this
+# program's maintainer or write to: The Free Software Foundation,
+# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
+
+# Author: Akim Demaille <Akim.Demaille@freefriends.org>
+
+# Get the name of the program
+program=`echo $0 | sed 's#.*/##g'`
+
+# Local vars
+debug=
+file=
+# Look for a running ghostscript
+gs=${GHOSTSCRIPT:-${GS:-gs}}
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+if ($gs -v) >/dev/null 2>&1; then :; else
+ gs=
+fi
+output=- # Default is stdout
+run_gs=0
+# What action to perform: fixps, cat, check, and gs
+task=fixps
+tmpdir=`mktemp -d -t fixps.XXXXXX` || { echo "$program: Cannot create temporary dir!" >&2 ; exit 1; }
+verbose=echo
+
+# The version/usage strings
+version="fixps 1.5 (@GNU_PACKAGE@ @VERSION@)
+Written by Akim Demaille.
+
+Copyright (c) 1998-2000 Akim Demaille, Miguel Santana
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+usage="\
+Usage: $program [OPTIONS] FILE
+Try to fix common PostScript problems that break postprocessing.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version display version information and exit
+ -q, --quiet don't print informational messages
+ -o, --output=FILE save result in FILE. If FILE is \`-', send to stdout
+ -f, --force force full rewrite by ghostscript
+ -n, --no-fix don't fix the FILE, but still honor \`-o'
+ -c, --check, --dry-run don't perform any action
+
+Fixes:
+ - Remove junk before and after PostScript content
+ - Use only Unix end of lines (\\n)
+ - Remove empty lines
+ - Fix Apple prologue (fixmacps)
+ - Fix FrameMaker prologue (fixfmps)
+ - Fix CorelDraw prologue (fixnt)
+ - Fix Windows NT 3.5/4.0 prologue (fixnt)
+ - Fix Windows 95 prologue
+ - Ensure there is a \`%%BeginSetup/%%EndSetup' section
+ - Removes Canvas' extraneaous \`%%EndDocument:' comments
+ - Split too long lines
+
+If the FILE seems really in a bad state, ghostscript may be used to perform
+a full rewrite. The output might then be significantly bigger, but much
+safer.
+
+Report bugs to <bug-a2ps@gnu.org>"
+
+help="Try \`$program --help' for more information."
+
+# Parse command line arguments.
+option_without_arguments='vhsqDfn'
+
+# Push a token among the arguments that will be used to notice when
+# we ended options/arguments parsing.
+arg_sep="$$--$$"
+set dummy ${1+"$@"} "$arg_sep"
+shift
+while test "x$1" != "x$arg_sep"; do
+
+ # Handle --option=value by splitting apart and putting back on argv.
+ case "$1" in
+ --*=*)
+ opt=`echo "$1" | sed -e 's/=.*//'`
+ val=`echo "$1" | sed -e 's/[^=]*=//'`
+ shift
+ set dummy "$opt" "$val" ${1+"$@"}
+ shift
+ ;;
+
+ -[$option_without_arguments]?*)
+ # Prefix $1 with x to avoid running `echo -na' for instance.
+ opt=`echo "x$1" | sed -e 's/x-\(.\).*/-\1/'`
+ rest=`echo "x$1" | sed -e 's/x-.\(.*\)/-\1/'`
+ shift
+ set dummy "$opt" "$rest" ${1+"$@"}
+ shift
+ ;;
+
+ # This case needs to be protected so that the case `-??*' does
+ # not split long options without arguments
+ --*)
+ ;;
+
+ # This is an option with argument. Split apart and put back on argv.
+ -??*)
+ opt=`echo "x$1" | sed -e 's/x-\(.\).*/-\1/'`
+ arg=`echo "x$1" | sed -e 's/x-.\(.*\)/\1/'`
+ shift
+ set dummy "$opt" "$arg" ${1+"$@"}
+ shift
+ ;;
+ esac
+
+ # Now, handle the options. $1 is the option *only*. If it has an
+ # argument, it is now necessarily in $2 etc. Remember to shift
+ # when fetching an argument.
+ case "$1" in
+ -v | --v*) echo "$version"; exit 0;;
+ -h | --h*) echo "$usage"; exit 0;;
+ -q | -s | --s* | --q*) verbose=:;;
+ # Delay debugging so that options parsing does not appear
+ -D | --debug) debug=: ;;
+ -o | --output) shift ; output=$1 ;;
+ -c | --check | --dry-run) task=check ;;
+ -n | --no-fix) task=cat ;;
+ -f | --force)
+ # Refuse if gs does not seem to work
+ if test "x$gs" = x; then
+ echo "$program: error: ghostscript does not work." >&2
+ exit 1
+ else
+ run_gs=1
+ fi
+ ;;
+ -) # We are working with stdin ;;
+ set dummy "$@" "$1"; shift;;
+
+ --) # What remains are not options.
+ shift
+ while test "x$1" != "x$arg_sep"; do
+ set dummy ${1+"$@"} "$1"
+ shift
+ shift
+ done
+ break;;
+
+ -*)
+ echo "$program: Unknown or ambiguous option \`$1'." >&2
+ echo "$program: Try \`--help' for more information." >&2
+ exit 1;;
+ *) set dummy ${1+"$@"} "$1"
+ shift
+ ;;
+ esac
+ shift
+done
+# Pop the token
+shift
+
+
+# Check the number of arguments.
+case $# in
+ 0) file=-;;
+ 1) file=$1;;
+ *) echo "$program: too many arguments" 1>&2
+ echo "$help" 1>&2
+ exit 1;;
+esac
+
+if test -n "$debug"; then
+ # Set -x now if debugging
+ set -x
+else
+ # Temp dir. Get ready not to leave junk (if not debugging)
+ trap "/bin/rm -rf $tmpdir" 0 1 2 3 13 15
+fi
+
+fixps_sed=$tmpdir/fixps.sed
+
+# If printing from stdin, save into a tmp file
+if test $file = '-'; then
+ file=$tmpdir/stdin.ps
+ cat >$file
+fi
+
+## -------------- ##
+## Global fixes. ##
+## -------------- ##
+
+# 1. Extract what looks like a real PS file, i.e. something between
+# a "%!" and a "%%EOF". If the latter is not present, go until
+# the end of the file.
+# It typically remove JCL junk, but also permits to print the PS content
+# of a mail without having to remove by hand what is not part of the PS.
+# Beware of the non Unix end of lines.
+if sed 1q $file | grep '^%!' >/dev/null; then :; else
+ fix=1
+ $verbose "$program: removing junk around PostScript content." >&2
+ $verbose "$program: fixing broken magic number." >&2
+ # At the same time, make sure the first line does start by
+ # a valid magic number. Use only '\n'.
+ tr '\015' '\012' < $file | sed -n -e '/%!/,/^%%EOF$/{
+ s/^.*%!/%!/
+ s/^%!$/%!PS/
+ p
+}' > $tmpdir/fixed-$fix.ps
+ file=$tmpdir/fixed-$fix.ps
+fi
+
+# If at this point the file does not start with a real PostScript
+# magic number, fail
+if sed 1q $file | grep '^%!' >/dev/null; then :; else
+ echo "$program: error: the file seems not to be PostScript." >&2
+ exit 1
+fi
+
+
+
+
+
+## ------------------------------------------------------- ##
+## After this comment everything can be done with a pipe. ##
+## ------------------------------------------------------- ##
+
+
+: >$fixps_sed
+
+# For a start, use only '\n'. Don't try to remove multiple end of
+# line, since you may break valid PostScript code (think of binary
+# sections).
+command="tr '\015' '\012' < $file | sed -f $fixps_sed"
+
+# 1. Broken end-of-line (Mac?)
+if sed 20q $file | grep ' %%' > /dev/null; then
+ $verbose "$program: fixing Macintosh broken end of line." >&2
+fi
+
+# 2. Remove the ^M$, because they prevent some parsers to work normally
+if sed 20q $file | grep ' $' > /dev/null; then #'
+ $verbose "$program: fixing PC broken end of line." >&2
+fi
+
+
+## ------------------------------ ##
+## Fixes on prologues/structure. ##
+## ------------------------------ ##
+
+
+# Put in $COMMENT everything we will need to find out the nature
+# of the file. (This is to speed up the processind)
+# Fetch all the lines with ``%%'' at the beginning, but
+# also words `FMDEFINE'
+comments=`eval "$command" | sed -ne '1p;/^%%/p;/FMDEFINEFONT/p;/FMBEGINPAGE/p'`
+
+# If the file does not appear to have enough of the DSC features, just
+# let it be rewritten by gs.
+if echo "$comments" | grep "EPSF" >/dev/null 2>&1; then
+ # EPS files need at least the BBox
+ patterns="^%%BoundingBox:";
+else
+ # PS files really need page separation information
+ patterns="^%%Pages: ^%%Page:"
+fi
+
+# If some required DSC comments are not present, ask for a full rewrite.
+for pattern in $patterns
+do
+ if echo "$comments" | grep "$pattern" >/dev/null; then :; else
+ $verbose "$program: DSC broken. $gs will be asked a full rewrite of the file." >&2
+ run_gs=1
+ break;
+ fi
+done
+
+if test $run_gs = 1 && test "x$gs" = x; then
+ echo "$program: warning: cannot run gs, except failures downstream." >&2
+ run_gs=0
+fi
+
+# The cleanup is to be made by hand.
+if test $run_gs = 0; then
+ # If there are lines too long, split them.
+ maxlen_awk=$tmpdir/maxlen.awk
+ cat >$maxlen_awk <<EOF
+length > max { max = length ; }
+END { print max ; }
+EOF
+ # Compute the max line length.
+ maxlen=`eval "$command" | awk -f $maxlen_awk`
+ if test "$maxlen" -ge "128"; then
+ cutline_sed=$tmpdir/cut.sed
+ # A script that split in piece hexa lines longer than 81 chars.
+ cat >$cutline_sed <<'EOF'
+/^[A-Fa-f0-9]\{81,\}$/b big
+ p
+ b
+:big
+ h
+ s/^\([A-Fa-f0-9]\{72\}\).*/\1/
+ p
+ g
+ s/^[A-Fa-f0-9]\{72\}\(.*\)/\1/
+t big
+EOF
+ $verbose "$program: splitting lines too long." >&2
+ command="$command | sed -n -f $cutline_sed"
+ fi
+
+ # 7. Broken AppleDict procset
+ if echo $comments | fgrep 'AppleDict' > /dev/null; then
+ $verbose "$program: fixing Macintosh broken prologue." >&2
+ command="$command | fixmacps"
+ fi
+
+ # 8. Broken Frame Maker procset
+ if echo $comments | fgrep 'Frame' > /dev/null; then
+ $verbose "$program: fixing Frame Maker broken prologue." >&2
+ command="$command | fixfmps"
+ fi
+
+ # 9. Broken CorelDRAW ps, with fixnt
+ if echo "$comments" | grep '^%%Title:.*CorelDRAW' > /dev/null; then
+ $verbose "$program: fixing CorelDRAW broken prologue." >&2
+ command="$command | fixnt"
+ # 10. Broken Windows NT 4.0 ps, still fixnt
+ elif echo "$comments" | grep 'NTPSOct95' > /dev/null; then
+ $verbose "$program: fixing Windows NT 4.0 broken PostScript." >&2
+ command="$command | fixnt"
+ # 11. Broken Windows NT 3.5 ps, yet another fixnt
+ elif echo "$comments" | grep 'NTPSOct94' > /dev/null; then
+ $verbose "$program: fixing Windows NT 3.5 broken PostScript." >&2
+ echo 's/NTPSOct94/NTPSOct95/g' >>$fixps_sed
+ command="$command | fixnt"
+ fi
+
+ # 12. Broken Windows 95 PS driver v4.0
+ if echo "$comments" | grep 'Pscript_Win_Utils' > /dev/null; then
+ $verbose "$program: fixing Broken Windows 95 PS driver v4.0 prologue." >&2
+ echo 's!|/LH/showpage ,!|/LH {showpage}!' >>$fixps_sed
+ fi
+
+ # 14. Canvas' superfluous `EndDocument:'
+ if echo "$comments" | grep 'CanvasDict' >/dev/null; then
+ $verbose "$program: removing Canvas' extraneous \`%%EndDocument:' comment." >&2
+ echo '/^%%EndDocument:/d' >>$fixps_sed
+ fi
+
+ # This should be the last one.
+ # 13. Missing BeginSetup/EndSetup
+ if echo "$comments" | grep '^%%BeginSetup' >/dev/null; then :; else
+ $verbose "$program: adding a %%BeginSetup/%%EndSetup section." >&2
+ # Because the command will be `eval'ed, it is hard to keep the eol.
+ # Making a script is much easier.
+ cat >>$fixps_sed <<EOF
+/^%%EndProlog/a\\
+%%BeginSetup\\
+%%EndSetup
+EOF
+ fi
+fi
+
+test $run_gs = 1 && task=gs
+
+# For dry runs, the output should not even be redirected
+if test $task != check; then
+ (
+ test "$output" != "-" && exec >"$output"
+ case $task in
+ cat)
+ cat "$file" ;;
+ fixps)
+ # FIXME: We should fail when the program fails
+ eval "$command" ;;
+ gs)
+ $verbose "$program: making a full rewrite of the file ($gs)." >&2
+ $gs -q -dNOPAUSE -dBATCH -sDEVICE=pswrite -sOutputFile=- -c save pop -f $file ;;
+ esac
+ )
+fi
+
+exit 0
diff --git a/contrib/fixps.m4 b/contrib/fixps.m4
new file mode 100644
index 0000000..002449e
--- /dev/null
+++ b/contrib/fixps.m4
@@ -0,0 +1,315 @@
+include(shell.m4)dnl -*- shell-script -*-
+#! /bin/sh -e
+
+# fixps --- fix as much as possible PS errors that break the psutils
+
+GPL([Copyright (c) 1998-2000 Akim Demaille, Miguel Santana])
+
+# Author: Akim Demaille <Akim.Demaille@freefriends.org>
+
+# Get the name of the program
+program=`echo $0 | sed 's#.*/##g'`
+
+# Local vars
+debug=
+file=
+# Look for a running ghostscript
+gs=${GHOSTSCRIPT:-${GS:-gs}}
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+if ($gs -v) >/dev/null 2>&1; then :; else
+ gs=
+fi
+output=- # Default is stdout
+run_gs=0
+# What action to perform: fixps, cat, check, and gs
+task=fixps
+tmpdir=`mktemp -d -t fixps.XXXXXX` || { echo "$program: Cannot create temporary dir!" >&2 ; exit 1; }
+verbose=echo
+
+# The version/usage strings
+version="fixps 1.5 (@GNU_PACKAGE@ @VERSION@)
+Written by Akim Demaille.
+
+Copyright (c) 1998-2000 Akim Demaille, Miguel Santana
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+usage=["\
+Usage: $program [OPTIONS] FILE
+Try to fix common PostScript problems that break postprocessing.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version display version information and exit
+ -q, --quiet don't print informational messages
+ -o, --output=FILE save result in FILE. If FILE is \`-', send to stdout
+ -f, --force force full rewrite by ghostscript
+ -n, --no-fix don't fix the FILE, but still honor \`-o'
+ -c, --check, --dry-run don't perform any action
+
+Fixes:
+ - Remove junk before and after PostScript content
+ - Use only Unix end of lines (\\n)
+ - Remove empty lines
+ - Fix Apple prologue (fixmacps)
+ - Fix FrameMaker prologue (fixfmps)
+ - Fix CorelDraw prologue (fixnt)
+ - Fix Windows NT 3.5/4.0 prologue (fixnt)
+ - Fix Windows 95 prologue
+ - Ensure there is a \`%%BeginSetup/%%EndSetup' section
+ - Removes Canvas' extraneaous \`%%EndDocument:' comments
+ - Split too long lines
+
+If the FILE seems really in a bad state, ghostscript may be used to perform
+a full rewrite. The output might then be significantly bigger, but much
+safer.
+
+Report bugs to <bug-a2ps@gnu.org>"]
+
+help="Try \`$program --help' for more information."
+
+# Parse command line arguments.
+option_without_arguments='vhsqDfn'
+
+GETOPT([ -v | --v*) echo "$version"; exit 0;;
+ -h | --h*) echo "$usage"; exit 0;;
+ -q | -s | --s* | --q*) verbose=:;;
+ # Delay debugging so that options parsing does not appear
+ -D | --debug) debug=: ;;
+ -o | --output) shift ; output=$1 ;;
+ -c | --check | --dry-run) task=check ;;
+ -n | --no-fix) task=cat ;;
+ -f | --force)
+ # Refuse if gs does not seem to work
+ if test "x$gs" = x; then
+ echo "$program: error: ghostscript does not work." >&2
+ exit 1
+ else
+ run_gs=1
+ fi
+ ;;
+ -) # We are working with stdin ;;
+ set dummy "$@" "$1"; shift;;])
+
+# Check the number of arguments.
+case $# in
+ 0) file=-;;
+ 1) file=$1;;
+ *) echo "$program: too many arguments" 1>&2
+ echo "$help" 1>&2
+ exit 1;;
+esac
+
+if test -n "$debug"; then
+ # Set -x now if debugging
+ set -x
+else
+ # Temp dir. Get ready not to leave junk (if not debugging)
+ trap "/bin/rm -rf $tmpdir" 0 1 2 3 13 15
+fi
+
+fixps_sed=$tmpdir/fixps.sed
+
+# If printing from stdin, save into a tmp file
+if test $file = '-'; then
+ file=$tmpdir/stdin.ps
+ cat >$file
+fi
+
+## -------------- ##
+## Global fixes. ##
+## -------------- ##
+
+# 1. Extract what looks like a real PS file, i.e. something between
+# a "%!" and a "%%EOF". If the latter is not present, go until
+# the end of the file.
+# It typically remove JCL junk, but also permits to print the PS content
+# of a mail without having to remove by hand what is not part of the PS.
+# Beware of the non Unix end of lines.
+if sed 1q $file | grep '^%!' >/dev/null; then :; else
+ fix=1
+ $verbose "$program: removing junk around PostScript content." >&2
+ $verbose "$program: fixing broken magic number." >&2
+ # At the same time, make sure the first line does start by
+ # a valid magic number. Use only '\n'.
+ tr '\015' '\012' < $file | sed -n -e '/%!/,/^%%EOF$/{
+ s/^.*%!/%!/
+ s/^%!$/%!PS/
+ p
+}' > $tmpdir/fixed-$fix.ps
+ file=$tmpdir/fixed-$fix.ps
+fi
+
+# If at this point the file does not start with a real PostScript
+# magic number, fail
+if sed 1q $file | grep '^%!' >/dev/null; then :; else
+ echo "$program: error: the file seems not to be PostScript." >&2
+ exit 1
+fi
+
+
+
+
+
+## ------------------------------------------------------- ##
+## After this comment everything can be done with a pipe. ##
+## ------------------------------------------------------- ##
+
+
+: >$fixps_sed
+
+# For a start, use only '\n'. Don't try to remove multiple end of
+# line, since you may break valid PostScript code (think of binary
+# sections).
+command="tr '\015' '\012' < $file | sed -f $fixps_sed"
+
+# 1. Broken end-of-line (Mac?)
+if sed 20q $file | grep ' %%' > /dev/null; then
+ $verbose "$program: fixing Macintosh broken end of line." >&2
+fi
+
+# 2. Remove the ^M$, because they prevent some parsers to work normally
+if sed 20q $file | grep ' $' > /dev/null; then #'
+ $verbose "$program: fixing PC broken end of line." >&2
+fi
+
+
+## ------------------------------ ##
+## Fixes on prologues/structure. ##
+## ------------------------------ ##
+
+
+# Put in $COMMENT everything we will need to find out the nature
+# of the file. (This is to speed up the processind)
+# Fetch all the lines with ``%%'' at the beginning, but
+# also words `FMDEFINE'
+comments=`eval "$command" | sed -ne '1p;/^%%/p;/FMDEFINEFONT/p;/FMBEGINPAGE/p'`
+
+# If the file does not appear to have enough of the DSC features, just
+# let it be rewritten by gs.
+if echo "$comments" | grep "EPSF" >/dev/null 2>&1; then
+ # EPS files need at least the BBox
+ patterns="^%%BoundingBox:";
+else
+ # PS files really need page separation information
+ patterns="^%%Pages: ^%%Page:"
+fi
+
+# If some required DSC comments are not present, ask for a full rewrite.
+for pattern in $patterns
+do
+ if echo "$comments" | grep "$pattern" >/dev/null; then :; else
+ $verbose "$program: DSC broken. $gs will be asked a full rewrite of the file." >&2
+ run_gs=1
+ break;
+ fi
+done
+
+if test $run_gs = 1 && test "x$gs" = x; then
+ echo "$program: warning: cannot run gs, except failures downstream." >&2
+ run_gs=0
+fi
+
+# The cleanup is to be made by hand.
+if test $run_gs = 0; then
+ # If there are lines too long, split them.
+ maxlen_awk=$tmpdir/maxlen.awk
+ cat >$maxlen_awk <<EOF
+length > max { max = length ; }
+END { print max ; }
+EOF
+ # Compute the max line length.
+ maxlen=`eval "$command" | awk -f $maxlen_awk`
+ if test "$maxlen" -ge "128"; then
+ cutline_sed=$tmpdir/cut.sed
+ # A script that split in piece hexa lines longer than 81 chars.
+ cat >$cutline_sed <<'EOF'
+[/^[A-Fa-f0-9]\{81,\}$/b big
+ p
+ b
+:big
+ h
+ s/^\([A-Fa-f0-9]\{72\}\).*/\1/
+ p
+ g
+ s/^[A-Fa-f0-9]\{72\}\(.*\)/\1/
+t big]
+EOF
+ $verbose "$program: splitting lines too long." >&2
+ command="$command | sed -n -f $cutline_sed"
+ fi
+
+ # 7. Broken AppleDict procset
+ if echo $comments | fgrep 'AppleDict' > /dev/null; then
+ $verbose "$program: fixing Macintosh broken prologue." >&2
+ command="$command | fixmacps"
+ fi
+
+ # 8. Broken Frame Maker procset
+ if echo $comments | fgrep 'Frame' > /dev/null; then
+ $verbose "$program: fixing Frame Maker broken prologue." >&2
+ command="$command | fixfmps"
+ fi
+
+ # 9. Broken CorelDRAW ps, with fixnt
+ if echo "$comments" | grep '^%%Title:.*CorelDRAW' > /dev/null; then
+ $verbose "$program: fixing CorelDRAW broken prologue." >&2
+ command="$command | fixnt"
+ # 10. Broken Windows NT 4.0 ps, still fixnt
+ elif echo "$comments" | grep 'NTPSOct95' > /dev/null; then
+ $verbose "$program: fixing Windows NT 4.0 broken PostScript." >&2
+ command="$command | fixnt"
+ # 11. Broken Windows NT 3.5 ps, yet another fixnt
+ elif echo "$comments" | grep 'NTPSOct94' > /dev/null; then
+ $verbose "$program: fixing Windows NT 3.5 broken PostScript." >&2
+ echo 's/NTPSOct94/NTPSOct95/g' >>$fixps_sed
+ command="$command | fixnt"
+ fi
+
+ # 12. Broken Windows 95 PS driver v4.0
+ if echo "$comments" | grep 'Pscript_Win_Utils' > /dev/null; then
+ $verbose "$program: fixing Broken Windows 95 PS driver v4.0 prologue." >&2
+ echo 's!|/LH/showpage ,!|/LH {showpage}!' >>$fixps_sed
+ fi
+
+ # 14. Canvas' superfluous `EndDocument:'
+ if echo "$comments" | grep 'CanvasDict' >/dev/null; then
+ $verbose "$program: removing Canvas' extraneous \`%%EndDocument:' comment." >&2
+ echo '/^%%EndDocument:/d' >>$fixps_sed
+ fi
+
+ # This should be the last one.
+ # 13. Missing BeginSetup/EndSetup
+ if echo "$comments" | grep '^%%BeginSetup' >/dev/null; then :; else
+ $verbose "$program: adding a %%BeginSetup/%%EndSetup section." >&2
+ # Because the command will be `eval'ed, it is hard to keep the eol.
+ # Making a script is much easier.
+ cat >>$fixps_sed <<EOF
+/^%%EndProlog/a\\
+%%BeginSetup\\
+%%EndSetup
+EOF
+ fi
+fi
+
+test $run_gs = 1 && task=gs
+
+# For dry runs, the output should not even be redirected
+if test $task != check; then
+ (
+ test "$output" != "-" && exec >"$output"
+ case $task in
+ cat)
+ cat "$file" ;;
+ fixps)
+ # FIXME: We should fail when the program fails
+ eval "$command" ;;
+ gs)
+ $verbose "$program: making a full rewrite of the file ($gs)." >&2
+ $gs -q -dNOPAUSE -dBATCH -sDEVICE=pswrite -sOutputFile=- -c save pop -f $file ;;
+ esac
+ )
+fi
+
+exit 0
diff --git a/contrib/pdiff.in b/contrib/pdiff.in
new file mode 100644
index 0000000..914e96f
--- /dev/null
+++ b/contrib/pdiff.in
@@ -0,0 +1,194 @@
+#! /bin/sh
+# -*- sh -*-
+# pdiff --- Print diff in a nice way
+
+# Copyright (c) 1998, 1999 Akim Demaille, Miguel Santana
+
+# 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 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, you can either send email to this
+# program's maintainer or write to: The Free Software Foundation,
+# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
+
+# Author: Akim Demaille <demaille@inf.enst.fr>
+
+# Get the name of the program
+program=`echo $0 | sed 's#.*/##g'`
+
+
+# Local vars
+a2ps=${A2PS:-a2ps}
+a2ps_options=
+debug=
+diff_on=words
+diff_prog=${DIFF:-diff}
+diff_options='-u'
+file=
+output=
+tmpdir=`mktemp -d -t pdiff.XXXXXX` || { echo "$program: Cannot create temporary dir!" >&2 ; exit 1; }
+verbose=echo
+wdiff_prog=${WDIFF:-wdiff}
+wdiff_options='-w[wd- -x-wd] -y{wd+ -z+wd}'
+# The version/usage strings
+version="pdiff 0.4 (@GNU_PACKAGE@ @VERSION@)
+Written by Akim Demaille.
+
+Copyright (c) 1997-1999 Akim Demaille, Miguel Santana
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+usage="\
+Usage: $program FILE1 FILE2 [-- A2PS-OPTIONS...]
+Pretty print the differences between FILE1 and FILE2.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version display version information and exit
+ -q, --quiet don't print informational messages
+ -l, --lines search for line differences (\`diff')
+ -w, --words search for word differences (\`wdiff')
+ -o, --output=FILE save the output in FILE
+
+Options for a2ps are given after \`--', for instance
+
+ $ pdiff COPYING COPYING.LIB -- -Pdisplay
+
+News, updates and documentation: http://www.inf.enst.fr/~demaille/a2ps/.
+Report bugs to <bug-a2ps@gnu.org>."
+
+help="Try \`$program --help' for more information."
+
+
+# Parse command line arguments.
+option_without_arguments='vhsqDlw'
+# Push a token among the arguments that will be used to notice when
+# we ended options/arguments parsing.
+arg_sep="$$--$$"
+set dummy ${1+"$@"} "$arg_sep"
+shift
+while test "x$1" != "x$arg_sep"; do
+
+ # Handle --option=value by splitting apart and putting back on argv.
+ case "$1" in
+ --*=*)
+ opt=`echo "$1" | sed -e 's/=.*//'`
+ val=`echo "$1" | sed -e 's/[^=]*=//'`
+ shift
+ set dummy "$opt" "$val" ${1+"$@"}
+ shift
+ ;;
+
+ -[$option_without_arguments]?*)
+ # Prefix $1 with x to avoid running `echo -na' for instance.
+ opt=`echo "x$1" | sed -e 's/x-\(.\).*/-\1/'`
+ rest=`echo "x$1" | sed -e 's/x-.\(.*\)/-\1/'`
+ shift
+ set dummy "$opt" "$rest" ${1+"$@"}
+ shift
+ ;;
+
+ # This case needs to be protected so that the case `-??*' does
+ # not split long options without arguments
+ --*)
+ ;;
+
+ # This is an option with argument. Split apart and put back on argv.
+ -??*)
+ opt=`echo "x$1" | sed -e 's/x-\(.\).*/-\1/'`
+ arg=`echo "x$1" | sed -e 's/x-.\(.*\)/\1/'`
+ shift
+ set dummy "$opt" "$arg" ${1+"$@"}
+ shift
+ ;;
+ esac
+
+ # Now, handle the options. $1 is the option *only*. If it has an
+ # argument, it is now necessarily in $2 etc. Remember to shift
+ # when fetching an argument.
+ case "$1" in
+ -v | --v*) echo "$version"; exit 0;;
+ -h | --h*) echo "$usage"; exit 0;;
+ -s|-q|--q*|--s*) verbose=: ;;
+ -D | --debug) debug=: ;;
+ -o|--output) shift
+ a2ps_options="$a2ps_options --output=$1" ;;
+ -l|--lines) diff_on=lines;;
+ -w|--words) diff_on=words;;
+ -) # We are working with stdin
+ set dummy "${1+"$@"}" "$1"; shift;;
+
+ --) # What remains are not options.
+ shift
+ while test "x$1" != "x$arg_sep"; do
+ set dummy ${1+"$@"} "$1"
+ shift
+ shift
+ done
+ break;;
+
+ -*)
+ echo "$program: Unknown or ambiguous option \`$1'." >&2
+ echo "$program: Try \`--help' for more information." >&2
+ exit 1;;
+ *) set dummy ${1+"$@"} "$1"
+ shift
+ ;;
+ esac
+ shift
+done
+# Pop the token
+shift
+
+
+# What remains is ORIG NEW [A2PS_OPTIONS...]
+if test $# -lt 2; then
+ exec 1>&2
+ echo "$program: not enough arguments"
+ echo "$help"
+ exit 1
+fi
+
+file1="$1"
+shift
+file2="$1"
+shift
+
+# Set the titles
+a2ps_options="--left-title=$file1 --right-title=$file2 $a2ps_options"
+a2ps_options="--center-title $a2ps_options"
+
+# Use the right prologue
+a2ps_options="--prolog=diff $a2ps_options"
+
+# Give the additional arguments given by the user
+a2ps_options="$@ $a2ps_options"
+
+# Set -x now if debugging
+test $debug && set -x
+
+# Call the correct diffing program, and pipe into a2ps
+case $diff_on in
+ words) # Word differences
+ $wdiff_prog $wdiff_options $file1 $file2 \
+ | $a2ps -Ewdiff $a2ps_options || exit 1
+ ;;
+
+ lines) # Line differences
+ # We need the total number of lines
+ lines=`wc -l $file1 $file2 | sed -n 3p`
+ lines=`set -- $lines && echo $1`
+ $diff_prog $diff_options -$lines $file1 $file2 \
+ | $a2ps -gEudiff $a2ps_options || exit 1
+ ;;
+esac
+
+exit 0
diff --git a/contrib/pdiff.m4 b/contrib/pdiff.m4
new file mode 100644
index 0000000..49a02f3
--- /dev/null
+++ b/contrib/pdiff.m4
@@ -0,0 +1,112 @@
+include(shell.m4)dnl -*- shell-script -*-
+#! /bin/sh
+# -*- sh -*-
+# pdiff --- Print diff in a nice way
+
+GPL([Copyright (c) 1998, 1999 Akim Demaille, Miguel Santana])
+
+# Author: Akim Demaille <demaille@inf.enst.fr>
+
+# Get the name of the program
+program=`echo $0 | sed 's#.*/##g'`
+
+changequote(, )
+# Local vars
+a2ps=${A2PS:-a2ps}
+a2ps_options=
+debug=
+diff_on=words
+diff_prog=${DIFF:-diff}
+diff_options='-u'
+file=
+output=
+tmpdir=`mktemp -d -t pdiff.XXXXXX` || { echo "$program: Cannot create temporary dir!" >&2 ; exit 1; }
+verbose=echo
+wdiff_prog=${WDIFF:-wdiff}
+wdiff_options='-w[wd- -x-wd] -y{wd+ -z+wd}'
+# The version/usage strings
+version="pdiff 0.4 (@GNU_PACKAGE@ @VERSION@)
+Written by Akim Demaille.
+
+Copyright (c) 1997-1999 Akim Demaille, Miguel Santana
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+usage="\
+Usage: $program FILE1 FILE2 [-- A2PS-OPTIONS...]
+Pretty print the differences between FILE1 and FILE2.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version display version information and exit
+ -q, --quiet don't print informational messages
+ -l, --lines search for line differences (\`diff')
+ -w, --words search for word differences (\`wdiff')
+ -o, --output=FILE save the output in FILE
+
+Options for a2ps are given after \`--', for instance
+
+ $ pdiff COPYING COPYING.LIB -- -Pdisplay
+
+News, updates and documentation: http://www.inf.enst.fr/~demaille/a2ps/.
+Report bugs to <bug-a2ps@gnu.org>."
+
+help="Try \`$program --help' for more information."
+changequote([, ])
+
+# Parse command line arguments.
+option_without_arguments='vhsqDlw'
+GETOPT([ -v | --v*) echo "$version"; exit 0;;
+ -h | --h*) echo "$usage"; exit 0;;
+ -s|-q|--q*|--s*) verbose=: ;;
+ -D | --debug) debug=: ;;
+ -o|--output) shift
+ a2ps_options="$a2ps_options --output=$1" ;;
+ -l|--lines) diff_on=lines;;
+ -w|--words) diff_on=words;;
+ -) # We are working with stdin
+ set dummy "${1+"$@"}" "$1"; shift;;])
+
+# What remains is ORIG NEW [A2PS_OPTIONS...]
+if test $# -lt 2; then
+ exec 1>&2
+ echo "$program: not enough arguments"
+ echo "$help"
+ exit 1
+fi
+
+file1="$1"
+shift
+file2="$1"
+shift
+
+# Set the titles
+a2ps_options="--left-title=$file1 --right-title=$file2 $a2ps_options"
+a2ps_options="--center-title $a2ps_options"
+
+# Use the right prologue
+a2ps_options="--prolog=diff $a2ps_options"
+
+# Give the additional arguments given by the user
+a2ps_options="$@ $a2ps_options"
+
+# Set -x now if debugging
+test $debug && set -x
+
+# Call the correct diffing program, and pipe into a2ps
+case $diff_on in
+ words) # Word differences
+ $wdiff_prog $wdiff_options $file1 $file2 \
+ | $a2ps -Ewdiff $a2ps_options || exit 1
+ ;;
+
+ lines) # Line differences
+ # We need the total number of lines
+ lines=`wc -l $file1 $file2 | sed -n 3p`
+ lines=`set -- $lines && echo $1`
+ $diff_prog $diff_options -$lines $file1 $file2 \
+ | $a2ps -gEudiff $a2ps_options || exit 1
+ ;;
+esac
+
+exit 0
diff --git a/contrib/psmandup.in b/contrib/psmandup.in
new file mode 100644
index 0000000..b0e8f32
--- /dev/null
+++ b/contrib/psmandup.in
@@ -0,0 +1,269 @@
+#! /bin/sh -e
+# -*- ksh -*-
+
+# psmandup --- produce a version of a PS file to print in manual Duplex.
+
+# Copyright (c) 1998, 1999 Akim Demaille, Miguel Santana
+
+# 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 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, you can either send email to this
+# program's maintainer or write to: The Free Software Foundation,
+# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
+
+# Author: Akim Demaille <Akim.Demaille@freefriends.org>
+
+# Get the name of the program
+program=`echo $0 | sed 's#.*/##g'`
+
+# Local vars
+address=0 # Where to put the manual feed feature
+back=: # Print the back side pages.
+debug=
+file=
+front=: # Print the front side pages.
+output=- # Default is stdout
+fixps=${FIXPS:-fixps}
+message=
+psselect=${PSSELECT:-psselect}
+psset=${PSSET:-psset}
+tmpdir=`mktemp -d -t psmandup.XXXXXX` || { echo "$program: Cannot create temporary dir!" >&2 ; exit 1; }
+
+# These two must be kept in synch. They are opposed.
+verbose=echo
+quiet=:
+
+# The version/usage strings
+version="psmandup 2.1 (@GNU_PACKAGE@ @VERSION@)
+Written by Akim Demaille.
+
+Copyright (c) 1998-1999 Akim Demaille, Miguel Santana
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+usage="\
+Usage: $program FILE
+Tries to produce a version of the PostScript FILE to print in manual
+Duplex.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version display version information and exit
+ -q, --quiet don't print informational messages
+ -o, --output=FILE save result in FILE. If FILE is \`-', send to stdout
+ -n, --no-fix don't call fixps to fix PS problems in FILE
+ -f, --front output only the front pages (recto) on the regular
+ tray
+ -b, --back output only the back pages (verso) on the manual
+ feed tray
+
+Produced output is meant for PS level 2 printers which don't support
+Duplex printing, but support Manual Feed. Once the first set of pages
+is printed (odd pages), manual feed is asked: introduce the odd pages
+to print the even pages on the other side.
+
+Because there is usually a short time out for manually fed jobs, you
+should really be next to the printer. If ever the time out expired,
+use the option -b to send only the missing part.
+
+Environment variables FIXPS, PSSELECT and PSSET, if defined, are used
+to find the tools.
+
+News, updates and documentation: http://www.inf.enst.fr/~demaille/a2ps/
+Report bugs to <bug-a2ps@gnu.org>"
+
+help="Try \`$program --help' for more information."
+
+# Parse command line arguments.
+option_without_arguments='vhsqnDbf'
+
+# Push a token among the arguments that will be used to notice when
+# we ended options/arguments parsing.
+arg_sep="$$--$$"
+set dummy ${1+"$@"} "$arg_sep"
+shift
+while test "x$1" != "x$arg_sep"; do
+
+ # Handle --option=value by splitting apart and putting back on argv.
+ case "$1" in
+ --*=*)
+ opt=`echo "$1" | sed -e 's/=.*//'`
+ val=`echo "$1" | sed -e 's/[^=]*=//'`
+ shift
+ set dummy "$opt" "$val" ${1+"$@"}
+ shift
+ ;;
+
+ -[$option_without_arguments]?*)
+ # Prefix $1 with x to avoid running `echo -na' for instance.
+ opt=`echo "x$1" | sed -e 's/x-\(.\).*/-\1/'`
+ rest=`echo "x$1" | sed -e 's/x-.\(.*\)/-\1/'`
+ shift
+ set dummy "$opt" "$rest" ${1+"$@"}
+ shift
+ ;;
+
+ # This case needs to be protected so that the case `-??*' does
+ # not split long options without arguments
+ --*)
+ ;;
+
+ # This is an option with argument. Split apart and put back on argv.
+ -??*)
+ opt=`echo "x$1" | sed -e 's/x-\(.\).*/-\1/'`
+ arg=`echo "x$1" | sed -e 's/x-.\(.*\)/\1/'`
+ shift
+ set dummy "$opt" "$arg" ${1+"$@"}
+ shift
+ ;;
+ esac
+
+ # Now, handle the options. $1 is the option *only*. If it has an
+ # argument, it is now necessarily in $2 etc. Remember to shift
+ # when fetching an argument.
+ case "$1" in
+ -v | --v*) echo "$version"; exit 0;;
+ -h | --h*) echo "$usage"; exit 0;;
+ -q | -s | --s* | --q*) verbose=:; quiet=echo;;
+ # Delay debugging so that options parsing does not appear
+ -D | --deb*) debug=-D ;;
+ -o | --out*) shift ; output=$1 ;;
+ -b | --bac*) front= ; back=: ;;
+ -f | --fro*) front=: ; back= ;;
+ -) # We are working with stdin ;;
+ set dummy "$@" "$1"
+ shift
+ ;;
+ -n | --no*) fixps= ;;
+
+ --) # What remains are not options.
+ shift
+ while test "x$1" != "x$arg_sep"; do
+ set dummy ${1+"$@"} "$1"
+ shift
+ shift
+ done
+ break;;
+
+ -*)
+ echo "$program: Unknown or ambiguous option \`$1'." >&2
+ echo "$program: Try \`--help' for more information." >&2
+ exit 1;;
+ *) set dummy ${1+"$@"} "$1"
+ shift
+ ;;
+ esac
+ shift
+done
+# Pop the token
+shift
+
+
+# Check the number of arguments.
+case $# in
+ 0) file=-;;
+ 1) file=$1;;
+ *) echo "$program: too many arguments" 1>&2
+ echo "$help" 1>&2
+ exit 1;;
+esac
+
+if test -n "$debug"; then
+ # Set -x now if debugging
+ set -x
+else
+ # Temp dir. Get ready not to leave junk (if not debugging)
+ trap "/bin/rm -rf $tmpdir" 0 1 2 3 13 15
+fi
+
+# If printing from stdin, save into a tmp file
+if test $file = '-'; then
+ file=$tmpdir/stdin.ps
+ cat > $file
+fi
+
+# Fix the file beforehand, so that we can really expect to find the
+# page numbers.
+if test -n "$fixps"; then
+ $fixps $file -o $tmpdir/fixed.ps `$quiet -q`
+ file=$tmpdir/fixed.ps
+fi
+
+# Get the number of pages of the document
+pagenum=`sed -ne '/^%%Pages:/{
+s/%%Pages: \\([0-9]*\\).*$/\\1/p
+q
+}' $file`
+
+# Make the string to get the front pages (even, increasing) if needed
+if test -n "$front"; then
+ evens="1"
+ i=3
+ # Build the string to give to psselect
+ while test $i -le $pagenum;
+ do
+ evens="$evens,$i"
+ i=`expr $i + 2`
+ done
+fi
+
+# Make the string to get the back pages (odd, decreasing) if needed
+if test -n "$back"; then
+ # If the number of pages is odd, we need to insert a blank sheet
+ case "$pagenum" in
+ *[13579])
+ odds="_"
+ i=`expr $pagenum - 1 || exit 0`
+ ;;
+ *) # Odd, and not 0, so at least >= 2
+ odds=$pagenum
+ i=`expr $pagenum - 2 || exit 0`
+ ;;
+ esac
+
+ # Make the string to get the second half (odd, decreasing)
+ while test $i != 0;
+ do
+ odds="$odds,$i"
+ i=`expr $i - 2 || exit 0`
+ done
+fi
+
+# If there are both odds and evens to print, the separator is `,'
+test -n "$odds" && test -n "$evens" && separator=,
+
+# Reorder the pages
+$psselect -q $evens$separator$odds $file > $tmpdir/ordered.ps
+
+# If needed, insert the manual feed request
+if test -n "$back"; then
+ # The option of psset to ask the manual feed. If not set,
+ # psset just does nothing.
+ pssetmanfeed=-m
+ # Compute the address, depending on front pages are printed or not.
+ if test -n "$front"; then
+ address=`expr '(' $pagenum + 1 ')' / 2 + 1`
+ message="\
+Once the first half of the file printed, insert the sheets stack into
+the manual feed tray to print the second half. Be aware the time out
+if usually short. If it expired, use option -b to proceed."
+ else
+ address=0
+ message="Insert the front pages stack into the manual feed tray."
+ fi
+fi
+
+# Insert the manual feed request if needed
+$psset -n $pssetmanfeed -a $address -o$output $tmpdir/ordered.ps $debug
+
+test -n "$message" && $verbose "$message" 1>&2
+exit 0
diff --git a/contrib/psmandup.m4 b/contrib/psmandup.m4
new file mode 100644
index 0000000..ddc0623
--- /dev/null
+++ b/contrib/psmandup.m4
@@ -0,0 +1,191 @@
+include(shell.m4)dnl -*- shell-script-*-
+#! /bin/sh -e
+# -*- ksh -*-
+
+# psmandup --- produce a version of a PS file to print in manual Duplex.
+
+GPL([Copyright (c) 1998, 1999 Akim Demaille, Miguel Santana])
+
+# Author: Akim Demaille <Akim.Demaille@freefriends.org>
+
+# Get the name of the program
+program=`echo $0 | sed 's#.*/##g'`
+
+# Local vars
+address=0 # Where to put the manual feed feature
+back=: # Print the back side pages.
+debug=
+file=
+front=: # Print the front side pages.
+output=- # Default is stdout
+fixps=${FIXPS:-fixps}
+message=
+psselect=${PSSELECT:-psselect}
+psset=${PSSET:-psset}
+tmpdir=`mktemp -d -t psmandup.XXXXXX` || { echo "$program: Cannot create temporary dir!" >&2 ; exit 1; }
+
+# These two must be kept in synch. They are opposed.
+verbose=echo
+quiet=:
+
+# The version/usage strings
+version="psmandup 2.1 (@GNU_PACKAGE@ @VERSION@)
+Written by Akim Demaille.
+
+Copyright (c) 1998-1999 Akim Demaille, Miguel Santana
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+usage="\
+Usage: $program FILE
+Tries to produce a version of the PostScript FILE to print in manual
+Duplex.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version display version information and exit
+ -q, --quiet don't print informational messages
+ -o, --output=FILE save result in FILE. If FILE is \`-', send to stdout
+ -n, --no-fix don't call fixps to fix PS problems in FILE
+ -f, --front output only the front pages (recto) on the regular
+ tray
+ -b, --back output only the back pages (verso) on the manual
+ feed tray
+
+Produced output is meant for PS level 2 printers which don't support
+Duplex printing, but support Manual Feed. Once the first set of pages
+is printed (odd pages), manual feed is asked: introduce the odd pages
+to print the even pages on the other side.
+
+Because there is usually a short time out for manually fed jobs, you
+should really be next to the printer. If ever the time out expired,
+use the option -b to send only the missing part.
+
+Environment variables FIXPS, PSSELECT and PSSET, if defined, are used
+to find the tools.
+
+News, updates and documentation: http://www.inf.enst.fr/~demaille/a2ps/
+Report bugs to <bug-a2ps@gnu.org>"
+
+help="Try \`$program --help' for more information."
+
+# Parse command line arguments.
+option_without_arguments='vhsqnDbf'
+
+GETOPT([ -v | --v*) echo "$version"; exit 0;;
+ -h | --h*) echo "$usage"; exit 0;;
+ -q | -s | --s* | --q*) verbose=:; quiet=echo;;
+ # Delay debugging so that options parsing does not appear
+ -D | --deb*) debug=-D ;;
+ -o | --out*) shift ; output=$1 ;;
+ -b | --bac*) front= ; back=: ;;
+ -f | --fro*) front=: ; back= ;;
+ -) # We are working with stdin ;;
+ set dummy "$@" "$1"
+ shift
+ ;;
+ -n | --no*) fixps= ;;])
+
+# Check the number of arguments.
+case $# in
+ 0) file=-;;
+ 1) file=$1;;
+ *) echo "$program: too many arguments" 1>&2
+ echo "$help" 1>&2
+ exit 1;;
+esac
+
+if test -n "$debug"; then
+ # Set -x now if debugging
+ set -x
+else
+ # Temp dir. Get ready not to leave junk (if not debugging)
+ trap "/bin/rm -rf $tmpdir" 0 1 2 3 13 15
+fi
+
+# If printing from stdin, save into a tmp file
+if test $file = '-'; then
+ file=$tmpdir/stdin.ps
+ cat > $file
+fi
+
+# Fix the file beforehand, so that we can really expect to find the
+# page numbers.
+if test -n "$fixps"; then
+ $fixps $file -o $tmpdir/fixed.ps `$quiet -q`
+ file=$tmpdir/fixed.ps
+fi
+
+# Get the number of pages of the document
+changequote(, )dnl
+pagenum=`sed -ne '/^%%Pages:/{
+s/%%Pages: \\([0-9]*\\).*$/\\1/p
+q
+}' $file`
+changequote([, ])dnl
+
+# Make the string to get the front pages (even, increasing) if needed
+if test -n "$front"; then
+ evens="1"
+ i=3
+ # Build the string to give to psselect
+ while test $i -le $pagenum;
+ do
+ evens="$evens,$i"
+ i=`expr $i + 2`
+ done
+fi
+
+# Make the string to get the back pages (odd, decreasing) if needed
+if test -n "$back"; then
+ # If the number of pages is odd, we need to insert a blank sheet
+ case "$pagenum" in
+changequote(, )dnl
+ *[13579])
+changequote([, ])dnl
+ odds="_"
+ i=`expr $pagenum - 1 || exit 0`
+ ;;
+ *) # Odd, and not 0, so at least >= 2
+ odds=$pagenum
+ i=`expr $pagenum - 2 || exit 0`
+ ;;
+ esac
+
+ # Make the string to get the second half (odd, decreasing)
+ while test $i != 0;
+ do
+ odds="$odds,$i"
+ i=`expr $i - 2 || exit 0`
+ done
+fi
+
+# If there are both odds and evens to print, the separator is `,'
+test -n "$odds" && test -n "$evens" && separator=,
+
+# Reorder the pages
+$psselect -q $evens$separator$odds $file > $tmpdir/ordered.ps
+
+# If needed, insert the manual feed request
+if test -n "$back"; then
+ # The option of psset to ask the manual feed. If not set,
+ # psset just does nothing.
+ pssetmanfeed=-m
+ # Compute the address, depending on front pages are printed or not.
+ if test -n "$front"; then
+ address=`expr '(' $pagenum + 1 ')' / 2 + 1`
+ message="\
+Once the first half of the file printed, insert the sheets stack into
+the manual feed tray to print the second half. Be aware the time out
+if usually short. If it expired, use option -b to proceed."
+ else
+ address=0
+ message="Insert the front pages stack into the manual feed tray."
+ fi
+fi
+
+# Insert the manual feed request if needed
+$psset -n $pssetmanfeed -a $address -o$output $tmpdir/ordered.ps $debug
+
+test -n "$message" && $verbose "$message" 1>&2
+exit 0
diff --git a/contrib/psset.in b/contrib/psset.in
new file mode 100644
index 0000000..3da6292
--- /dev/null
+++ b/contrib/psset.in
@@ -0,0 +1,279 @@
+#! /bin/sh -e
+# -*- ksh -*-
+
+# psset --- Put page device definition somewhere in a PS document.
+
+# Copyright (c) 1999 Akim Demaille, Miguel Santana
+
+# 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 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, you can either send email to this
+# program's maintainer or write to: The Free Software Foundation,
+# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
+
+# Author: Akim Demaille <Akim.Demaille@freefriends.org>
+
+# Get the name of the program
+program=`echo $0 | sed 's#.*/##g'`
+
+# Local vars
+at=0 # Insert call in the document's Setup section.
+debug=
+file=
+fixps=${FIXPS:-fixps}
+output=-
+pagedevices= # `;' separated list of `key:value'
+quiet=: # i.e., verbose
+tmpdir=`mktemp -d -t psset.XXXXXX` || { echo "$program: Cannot create temporary dir!" >&2 ; exit 1; }
+sedscript=$tmpdir/psset.sed
+
+# The version/usage strings
+version="$program 1.3 (@GNU_PACKAGE@ @VERSION@)
+Written by Akim Demaille.
+
+Copyright (c) 1998-1999 Akim Demaille, Miguel Santana
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+usage="\
+Usage: $program FILE
+
+Produce a version of the PostScript FILE with a protected call to the
+PostScript operator \`setpagedevice'. Typical use is making FILE
+print duplex, or on the manual tray etc.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version display version information and exit
+ -q, --quiet don't print informational messages
+ -o, --output=FILE save result in FILE. If FILE is \`-', send to stdout
+ -n, --no-fix don't run \`fixps' to fix PS problems in FILE
+ -S, --setpagedevice=KEY[:VALUE] pass a page device definition to output.
+ Multiple values accumulate
+ -a, --at=PAGE insert the page device definitions at PAGE. Default
+ is PAGE=0, standing for the Document's Setup section
+
+Shortcuts:
+ -m, --manualfeed alias for -SManualFeed:true
+ -s, --simplex alias for -SDuplex:false
+ -d, --duplex alias for -SDuplex:true -STumble:false
+ corresponds to Duplex, binding along the long edge
+ -t, --tumble alias for -SDuplex:true -STumble:true
+ corresponds to Duplex, binding along the short edge
+
+Produced output is meant for PS level 2 printers.
+
+News, updates and documentation: visit http://www.inf.enst.fr/~demaille/a2ps/
+Report bugs to <bug-a2ps@gnu.org>"
+
+help="Try \`$program --help' for more information."
+
+# Parse command line arguments.
+option_without_arguments='vhqnDmdts'
+
+# Push a token among the arguments that will be used to notice when
+# we ended options/arguments parsing.
+arg_sep="$$--$$"
+set dummy ${1+"$@"} "$arg_sep"
+shift
+while test "x$1" != "x$arg_sep"; do
+
+ # Handle --option=value by splitting apart and putting back on argv.
+ case "$1" in
+ --*=*)
+ opt=`echo "$1" | sed -e 's/=.*//'`
+ val=`echo "$1" | sed -e 's/[^=]*=//'`
+ shift
+ set dummy "$opt" "$val" ${1+"$@"}
+ shift
+ ;;
+
+ -[$option_without_arguments]?*)
+ # Prefix $1 with x to avoid running `echo -na' for instance.
+ opt=`echo "x$1" | sed -e 's/x-\(.\).*/-\1/'`
+ rest=`echo "x$1" | sed -e 's/x-.\(.*\)/-\1/'`
+ shift
+ set dummy "$opt" "$rest" ${1+"$@"}
+ shift
+ ;;
+
+ # This case needs to be protected so that the case `-??*' does
+ # not split long options without arguments
+ --*)
+ ;;
+
+ # This is an option with argument. Split apart and put back on argv.
+ -??*)
+ opt=`echo "x$1" | sed -e 's/x-\(.\).*/-\1/'`
+ arg=`echo "x$1" | sed -e 's/x-.\(.*\)/\1/'`
+ shift
+ set dummy "$opt" "$arg" ${1+"$@"}
+ shift
+ ;;
+ esac
+
+ # Now, handle the options. $1 is the option *only*. If it has an
+ # argument, it is now necessarily in $2 etc. Remember to shift
+ # when fetching an argument.
+ case "$1" in
+ -v | --v*) echo "$version"; exit 0;;
+ -h | --h*) echo "$usage"; exit 0;;
+ -q | --sil* | --q*) quiet=echo;;
+ # Delay debugging so that options parsing does not appear
+ -D | --debug) debug=: ;;
+ -o | --output) shift ; output=$1 ;;
+ -a | --at) shift ; at=$1 ;;
+ -S | --set*) shift
+ case $1 in
+ *:*) pagedevices="${pagedevices}$1;" ;;
+ *) echo "$program: invalid argument for -S: $1" 1>&2
+ exit 1 ;;
+ esac
+ ;;
+ -m | --man* ) pagedevices="${pagedevices}ManualFeed:true;" ;;
+ -d | --dup* ) pagedevices="${pagedevices}Duplex:true;Tumble:false;" ;;
+ -t | --tum* ) pagedevices="${pagedevices}Duplex:true;Tumble:true;" ;;
+ -s | --sim* ) pagedevices="${pagedevices}Duplex:false;" ;;
+ -) # We are working with stdin ;;
+ set dummy "$@" "$1"
+ shift ;;
+ -n|--no-fix) fixps="$fixps -n" ;;
+
+ --) # What remains are not options.
+ shift
+ while test "x$1" != "x$arg_sep"; do
+ set dummy ${1+"$@"} "$1"
+ shift
+ shift
+ done
+ break;;
+
+ -*)
+ echo "$program: Unknown or ambiguous option \`$1'." >&2
+ echo "$program: Try \`--help' for more information." >&2
+ exit 1;;
+ *) set dummy ${1+"$@"} "$1"
+ shift
+ ;;
+ esac
+ shift
+done
+# Pop the token
+shift
+
+
+# Check the number of arguments.
+case $# in
+ 0) file=;;
+ 1) # We want $file to be empty to mean stdin
+ if test "x$file" = "x-"; then
+ file=
+ else
+ file=$1
+ fi
+ ;;
+ *) echo "$program: too many arguments" 1>&2
+ echo "$help" 1>&2
+ exit 1;;
+esac
+
+if test -n "$debug"; then
+ # Set -x now if debugging
+ set -x
+else
+ # Temp dir. Get ready not to leave junk (if not debugging)
+ trap "/bin/rm -rf $tmpdir" 0 1 2 3 13 15
+fi
+
+# Well, if there is nothing to do, just do nothing.
+if test -z "$pagedevices"; then
+ exec $fixps `$quiet -q` $file -o "$output"
+fi
+
+# Prepare the PostScript snippet we plan to insert if needed
+pspagedevice=
+saved_IFS=$IFS
+IFS=";"
+for pagedevice in $pagedevices
+do
+ IFS=$saved_IFS
+ key=`echo $pagedevice | sed -e 's/:.*//g'`
+ value=`echo $pagedevice | sed -e 's/.*://g'`
+ # I use `cvx exec' in order to let the stopped environment catch the
+ # errors. This way, the user can do -SDuplex:fuubar and have a
+ # PS file that behaves well.
+ pspagedevice="$pspagedevice
+%%BeginFeature: *$key $value
+ (<<) cvx exec /$key ($value) cvx exec (>>) cvx exec
+ systemdict /setpagedevice get exec
+%%EndFeature"
+done
+
+pspagedevice="% Pagedevice definitions:
+countdictstack
+% Push our own mark, since there can be several PS marks pushed depending
+% where the failure really occured.
+/psset_mark
+{$pspagedevice
+} stopped
+% My cleartomark
+{ /psset_mark eq { exit } if } loop
+countdictstack exch sub dup 0 gt
+{
+ { end } repeat
+}{
+ pop
+} ifelse"
+
+# Prepare the sed command we want to run.
+# End of lines must be protected by `\' but the last one, and leading
+# spaces with a `\' too...
+pspagedevicelen=`echo "$pspagedevice" | wc -l`
+pspagedevice=`echo "$pspagedevice" | \
+ sed -e "$pspagedevicelen!s/\$/\\\\\\/;s/^ /\\\\\\ /"`
+
+case $at in
+ 0) # Insert last in the Setup, so that we win over other requests.
+ address="^%%EndSetup$"
+ insert="i"
+ ;;
+ *) # Insert right after the beginning of the page. Trying to find a
+ # better place than right after %%Page: is an overkill.
+ address="^%%Page: .*$at$"
+ insert="a"
+ ;;
+esac
+
+# The script is complicated by the fact that we don't want to issue
+# twice the setpagedevice. And it is correct for an included document
+# to have a Setup section.
+cat >$sedscript <<EOF
+:start
+/$address/{
+ $insert\\
+$pspagedevice
+ b end
+}
+n
+b start
+:end
+n
+b end
+EOF
+
+# OK, I'm tired of preparing plenty and doing nothing. Let's go now!
+# Insert the page device definition right after the Prolog.
+test "$output" != '-' && exec >$output
+$fixps `$quiet -q` $file | sed -f $sedscript
+
+# We don't remove the tmp directory: trap does it.
+exit 0
diff --git a/contrib/psset.m4 b/contrib/psset.m4
new file mode 100644
index 0000000..eb5056d
--- /dev/null
+++ b/contrib/psset.m4
@@ -0,0 +1,199 @@
+include(shell.m4)dnl -*- shell-script -*-
+#! /bin/sh -e
+# -*- ksh -*-
+
+# psset --- Put page device definition somewhere in a PS document.
+
+GPL([Copyright (c) 1999 Akim Demaille, Miguel Santana])
+
+# Author: Akim Demaille <Akim.Demaille@freefriends.org>
+
+# Get the name of the program
+program=`echo $0 | sed 's#.*/##g'`
+
+# Local vars
+at=0 # Insert call in the document's Setup section.
+debug=
+file=
+fixps=${FIXPS:-fixps}
+output=-
+pagedevices= # `;' separated list of `key:value'
+quiet=: # i.e., verbose
+tmpdir=`mktemp -d -t psset.XXXXXX` || { echo "$program: Cannot create temporary dir!" >&2 ; exit 1; }
+sedscript=$tmpdir/psset.sed
+
+# The version/usage strings
+version="$program 1.3 (@GNU_PACKAGE@ @VERSION@)
+Written by Akim Demaille.
+
+Copyright (c) 1998-1999 Akim Demaille, Miguel Santana
+This is free software; see the source for copying conditions. There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+usage="\
+Usage: $program FILE
+
+Produce a version of the PostScript FILE with a protected call to the
+PostScript operator \`setpagedevice'. Typical use is making FILE
+print duplex, or on the manual tray etc.
+
+Options:
+ -h, --help display this help and exit
+ -v, --version display version information and exit
+ -q, --quiet don't print informational messages
+ -o, --output=FILE save result in FILE. If FILE is \`-', send to stdout
+ -n, --no-fix don't run \`fixps' to fix PS problems in FILE
+changequote(, )dnl
+ -S, --setpagedevice=KEY[:VALUE] pass a page device definition to output.
+changequote([, ])dnl
+ Multiple values accumulate
+ -a, --at=PAGE insert the page device definitions at PAGE. Default
+ is PAGE=0, standing for the Document's Setup section
+
+Shortcuts:
+ -m, --manualfeed alias for -SManualFeed:true
+ -s, --simplex alias for -SDuplex:false
+ -d, --duplex alias for -SDuplex:true -STumble:false
+ corresponds to Duplex, binding along the long edge
+ -t, --tumble alias for -SDuplex:true -STumble:true
+ corresponds to Duplex, binding along the short edge
+
+Produced output is meant for PS level 2 printers.
+
+News, updates and documentation: visit http://www.inf.enst.fr/~demaille/a2ps/
+Report bugs to <bug-a2ps@gnu.org>"
+
+help="Try \`$program --help' for more information."
+
+# Parse command line arguments.
+option_without_arguments='vhqnDmdts'
+
+GETOPT([ -v | --v*) echo "$version"; exit 0;;
+ -h | --h*) echo "$usage"; exit 0;;
+ -q | --sil* | --q*) quiet=echo;;
+ # Delay debugging so that options parsing does not appear
+ -D | --debug) debug=: ;;
+ -o | --output) shift ; output=$1 ;;
+ -a | --at) shift ; at=$1 ;;
+ -S | --set*) shift
+ case $1 in
+ *:*) pagedevices="${pagedevices}$1;" ;;
+ *) echo "$program: invalid argument for -S: $1" 1>&2
+ exit 1 ;;
+ esac
+ ;;
+ -m | --man* ) pagedevices="${pagedevices}ManualFeed:true;" ;;
+ -d | --dup* ) pagedevices="${pagedevices}Duplex:true;Tumble:false;" ;;
+ -t | --tum* ) pagedevices="${pagedevices}Duplex:true;Tumble:true;" ;;
+ -s | --sim* ) pagedevices="${pagedevices}Duplex:false;" ;;
+ -) # We are working with stdin ;;
+ set dummy "$@" "$1"
+ shift ;;
+ -n|--no-fix) fixps="$fixps -n" ;;])
+
+# Check the number of arguments.
+case $# in
+ 0) file=;;
+ 1) # We want $file to be empty to mean stdin
+ if test "x$file" = "x-"; then
+ file=
+ else
+ file=$1
+ fi
+ ;;
+ *) echo "$program: too many arguments" 1>&2
+ echo "$help" 1>&2
+ exit 1;;
+esac
+
+if test -n "$debug"; then
+ # Set -x now if debugging
+ set -x
+else
+ # Temp dir. Get ready not to leave junk (if not debugging)
+ trap "/bin/rm -rf $tmpdir" 0 1 2 3 13 15
+fi
+
+# Well, if there is nothing to do, just do nothing.
+if test -z "$pagedevices"; then
+ exec $fixps `$quiet -q` $file -o "$output"
+fi
+
+# Prepare the PostScript snippet we plan to insert if needed
+pspagedevice=
+saved_IFS=$IFS
+IFS=";"
+for pagedevice in $pagedevices
+do
+ IFS=$saved_IFS
+ key=`echo $pagedevice | sed -e 's/:.*//g'`
+ value=`echo $pagedevice | sed -e 's/.*://g'`
+ # I use `cvx exec' in order to let the stopped environment catch the
+ # errors. This way, the user can do -SDuplex:fuubar and have a
+ # PS file that behaves well.
+ pspagedevice="$pspagedevice
+%%BeginFeature: *$key $value
+ (<<) cvx exec /$key ($value) cvx exec (>>) cvx exec
+ systemdict /setpagedevice get exec
+%%EndFeature"
+done
+
+pspagedevice="% Pagedevice definitions:
+countdictstack
+% Push our own mark, since there can be several PS marks pushed depending
+% where the failure really occured.
+/psset_mark
+{$pspagedevice
+} stopped
+% My cleartomark
+{ /psset_mark eq { exit } if } loop
+countdictstack exch sub dup 0 gt
+{
+ { end } repeat
+}{
+ pop
+} ifelse"
+
+# Prepare the sed command we want to run.
+# End of lines must be protected by `\' but the last one, and leading
+# spaces with a `\' too...
+pspagedevicelen=`echo "$pspagedevice" | wc -l`
+pspagedevice=`echo "$pspagedevice" | \
+ sed -e "$pspagedevicelen!s/\$/\\\\\\/;s/^ /\\\\\\ /"`
+
+case $at in
+ 0) # Insert last in the Setup, so that we win over other requests.
+ address="^%%EndSetup$"
+ insert="i"
+ ;;
+ *) # Insert right after the beginning of the page. Trying to find a
+ # better place than right after %%Page: is an overkill.
+ address="^%%Page: .*$at$"
+ insert="a"
+ ;;
+esac
+
+# The script is complicated by the fact that we don't want to issue
+# twice the setpagedevice. And it is correct for an included document
+# to have a Setup section.
+cat >$sedscript <<EOF
+:start
+/$address/{
+ $insert\\
+$pspagedevice
+ b end
+}
+n
+b start
+:end
+n
+b end
+EOF
+
+# OK, I'm tired of preparing plenty and doing nothing. Let's go now!
+# Insert the page device definition right after the Prolog.
+test "$output" != '-' && exec >$output
+$fixps `$quiet -q` $file | sed -f $sedscript
+
+# We don't remove the tmp directory: trap does it.
+exit 0
diff --git a/contrib/sample/Makefile.am b/contrib/sample/Makefile.am
new file mode 100644
index 0000000..dd58438
--- /dev/null
+++ b/contrib/sample/Makefile.am
@@ -0,0 +1,38 @@
+# -*- Makefile -*-
+# Makefile for a2ps' sources.
+# Copyright (c) 1988, 89, 90, 91, 92, 93 Miguel Santana
+# Copyright (c) 1995, 96, 97, 98 Akim Demaille, Miguel Santana
+#
+
+#
+# This file is part of a2ps.
+#
+# 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 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING. If not, write to
+# the Free Software Foundation, 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+#
+
+## Process this file with automake to produce Makefile.in
+
+## Since this package is written in ansi, be ready to un-ansify
+AUTOMAKE_OPTIONS = $(top_builddir)/lib/ansi2knr
+localedir = $(datadir)/locale
+
+noinst_PROGRAMS = sample
+
+sample_SOURCES = main.c
+
+INCLUDES = -I. -I.. -I$(top_builddir) -I$(top_srcdir)/intl -I$(top_srcdir)/lib
+sample_LDADD = $(top_builddir)/lib/liba2ps.la @LIBINTL@ -lm
+DEFS = @DEFS@ -DLOCALEDIR=\"$(localedir)\"
diff --git a/contrib/sample/Makefile.in b/contrib/sample/Makefile.in
new file mode 100644
index 0000000..788dabc
--- /dev/null
+++ b/contrib/sample/Makefile.in
@@ -0,0 +1,561 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005 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, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# -*- Makefile -*-
+# Makefile for a2ps' sources.
+# Copyright (c) 1988, 89, 90, 91, 92, 93 Miguel Santana
+# Copyright (c) 1995, 96, 97, 98 Akim Demaille, Miguel Santana
+#
+
+#
+# This file is part of a2ps.
+#
+# 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 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; see the file COPYING. If not, write to
+# the Free Software Foundation, 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+#
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ../..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+ANSI2KNR = $(top_builddir)/lib/ansi2knr
+noinst_PROGRAMS = sample$(EXEEXT)
+subdir = contrib/sample
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/a2_psutils.m4 \
+ $(top_srcdir)/m4/atexit.m4 $(top_srcdir)/m4/file.m4 \
+ $(top_srcdir)/m4/fp_echo.m4 $(top_srcdir)/m4/fullpath.m4 \
+ $(top_srcdir)/m4/gccwarn.m4 $(top_srcdir)/m4/gettext.m4 \
+ $(top_srcdir)/m4/gperf-check.m4 $(top_srcdir)/m4/iconv.m4 \
+ $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/isc-posix.m4 \
+ $(top_srcdir)/m4/lex.m4 $(top_srcdir)/m4/lib-ld.m4 \
+ $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \
+ $(top_srcdir)/m4/libpaper.m4 $(top_srcdir)/m4/lpr.m4 \
+ $(top_srcdir)/m4/m4.m4 $(top_srcdir)/m4/malloc.m4 \
+ $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbstate_t.m4 \
+ $(top_srcdir)/m4/perl.m4 $(top_srcdir)/m4/prereq.m4 \
+ $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/protos.m4 \
+ $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/rename.m4 \
+ $(top_srcdir)/m4/stdint_h.m4 $(top_srcdir)/m4/strcasecmp.m4 \
+ $(top_srcdir)/m4/strftim.m4 $(top_srcdir)/m4/termios.m4 \
+ $(top_srcdir)/m4/tterm.m4 $(top_srcdir)/m4/uintmax_t.m4 \
+ $(top_srcdir)/m4/ulonglong.m4 $(top_srcdir)/m4/winsz.m4 \
+ $(top_srcdir)/m4/xstrtoumax.m4 $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/auxdir/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config.h
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(noinst_PROGRAMS)
+am_sample_OBJECTS = main$U.$(OBJEXT)
+sample_OBJECTS = $(am_sample_OBJECTS)
+sample_DEPENDENCIES = $(top_builddir)/lib/liba2ps.la
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
+depcomp = $(SHELL) $(top_srcdir)/auxdir/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(sample_SOURCES)
+DIST_SOURCES = $(sample_SOURCES)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+COM_DISPLAY = @COM_DISPLAY@
+COM_LATEX = @COM_LATEX@
+COM_PS2PDF = @COM_PS2PDF@
+COM_PSUTILS = @COM_PSUTILS@
+COM_TEXI = @COM_TEXI@
+COM_acroread = @COM_acroread@
+COM_acroread4 = @COM_acroread4@
+COM_bzip = @COM_bzip@
+COM_bzip2 = @COM_bzip2@
+COM_convert = @COM_convert@
+COM_distill = @COM_distill@
+COM_dvips = @COM_dvips@
+COM_ghostview = @COM_ghostview@
+COM_grog = @COM_grog@
+COM_gv = @COM_gv@
+COM_gzip = @COM_gzip@
+COM_html2ps = @COM_html2ps@
+COM_latex = @COM_latex@
+COM_makeinfo = @COM_makeinfo@
+COM_netscape = @COM_netscape@
+COM_pdf2ps = @COM_pdf2ps@
+COM_ps2pdf = @COM_ps2pdf@
+COM_psnup = @COM_psnup@
+COM_psselect = @COM_psselect@
+COM_tex = @COM_tex@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@ -DLOCALEDIR=\"$(localedir)\"
+DEPDIR = @DEPDIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EMACS = @EMACS@
+EMACSLOADPATH = @EMACSLOADPATH@
+ENCODING = @ENCODING@
+EXEEXT = @EXEEXT@
+EXTENSIONS_FALSE = @EXTENSIONS_FALSE@
+EXTENSIONS_TRUE = @EXTENSIONS_TRUE@
+EXTRA_CFLAGS = @EXTRA_CFLAGS@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+FILE_LINK = @FILE_LINK@
+GMSGFMT = @GMSGFMT@
+GNU_PACKAGE = @GNU_PACKAGE@
+GPERF = @GPERF@
+GREP = @GREP@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+INTLLIBS = @INTLLIBS@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBICONV = @LIBICONV@
+LIBINTL = @LIBINTL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBVERSION = @LIBVERSION@
+LN_S = @LN_S@
+LPR = @LPR@
+LPR_QUEUE_OPTION = @LPR_QUEUE_OPTION@
+LTALLOCA = @LTALLOCA@
+LTLIBICONV = @LTLIBICONV@
+LTLIBINTL = @LTLIBINTL@
+LTLIBOBJS = @LTLIBOBJS@
+M4 = @M4@
+MAKEINFO = @MAKEINFO@
+MEDIUM = @MEDIUM@
+MKINSTALLDIRS = @MKINSTALLDIRS@
+MSGFMT = @MSGFMT@
+MSGMERGE = @MSGMERGE@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PERL = @PERL@
+POSUB = @POSUB@
+PSFONT_PATH = @PSFONT_PATH@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+U = @U@
+USE_NLS = @USE_NLS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+YACC = @YACC@
+YFLAGS = @YFLAGS@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+acroread = @acroread@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+bzip = @bzip@
+bzip2 = @bzip2@
+convert = @convert@
+datadir = @datadir@
+datarootdir = @datarootdir@
+distill = @distill@
+docdir = @docdir@
+dvidir = @dvidir@
+dvips = @dvips@
+exec_prefix = @exec_prefix@
+file_prog = @file_prog@
+ghostview = @ghostview@
+grog = @grog@
+gv = @gv@
+gzip = @gzip@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+html2ps = @html2ps@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+latex = @latex@
+libdir = @libdir@
+libexecdir = @libexecdir@
+lispdir = @lispdir@
+localedir = $(datadir)/locale
+localstatedir = @localstatedir@
+makeinfo = @makeinfo@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+netscape = @netscape@
+oldincludedir = @oldincludedir@
+pdf2ps = @pdf2ps@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+ps2pdf = @ps2pdf@
+psdir = @psdir@
+psnup = @psnup@
+psselect = @psselect@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+tex = @tex@
+AUTOMAKE_OPTIONS = $(top_builddir)/lib/ansi2knr
+sample_SOURCES = main.c
+INCLUDES = -I. -I.. -I$(top_builddir) -I$(top_srcdir)/intl -I$(top_srcdir)/lib
+sample_LDADD = $(top_builddir)/lib/liba2ps.la @LIBINTL@ -lm
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+ && exit 0; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu contrib/sample/Makefile'; \
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu contrib/sample/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; for p in $$list; do \
+ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f $$p $$f"; \
+ rm -f $$p $$f ; \
+ done
+sample$(EXEEXT): $(sample_OBJECTS) $(sample_DEPENDENCIES)
+ @rm -f sample$(EXEEXT)
+ $(LINK) $(sample_LDFLAGS) $(sample_OBJECTS) $(sample_LDADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+$(top_builddir)/lib/ansi2knr:
+ cd $(top_builddir)/lib && $(MAKE) $(AM_MAKEFLAGS) ansi2knr
+
+mostlyclean-kr:
+ -test "$U" = "" || rm -f *_.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main$U.Po@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+main_.c: main.c $(ANSI2KNR)
+ $(CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) `if test -f $(srcdir)/main.c; then echo $(srcdir)/main.c; else echo main.c; fi` | sed 's/^# \([0-9]\)/#line \1/' | $(ANSI2KNR) > $@ || rm -f $@
+main_.$(OBJEXT) main_.lo : $(ANSI2KNR)
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+distclean-libtool:
+ -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkdir_p) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic mostlyclean-kr \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libtool clean-noinstPROGRAMS ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-exec \
+ install-exec-am install-info install-info-am install-man \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-kr \
+ mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+ uninstall-am uninstall-info-am
+
+# 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/sample/main.c b/contrib/sample/main.c
new file mode 100644
index 0000000..45c156f
--- /dev/null
+++ b/contrib/sample/main.c
@@ -0,0 +1,73 @@
+/* This is just to know if your system support stdlib.h */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+#if HAVE_STDBOOL_H
+# include <stdbool.h>
+#else
+typedef enum {false = 0, true = 1} bool;
+#endif
+
+#include "liba2ps.h"
+
+#define _(V) sprintf(buf, "%.4d",V),a2ps_print_string(job,buf, String)
+int a=10000, b, c=8400, d, e, f[8401], g; char buf[10];
+void
+foo (struct a2ps_job * job)
+{ for (;b-c;) f[b++]=a/5; for (;d=0,g=c*2;c-=14,_(e+d/a), e=d%a) for
+(b=c;d+=f[b]*a,f[b]=d%--g, d/=g--,--b;d*=b); }
+
+
+/* It is mandatory to declare and set the value of this variable.
+ * It is used when printing error messages. */
+char *program_name = "Sample";
+char *program_invocation_name = "Sample";
+
+int
+main (void)
+{
+ enum face_e i;
+ int j;
+ struct a2ps_job * job;
+
+ /* Create the structure, and fill it according the master
+ * system configuration file (typically /etc/a2ps.cfg) */
+ job = a2ps_job_new ();
+ a2_read_sys_config (job);
+
+ /* Once the configuration files are read, finalize the structure */
+ a2ps_job_finalize (job);
+
+ /* Open an output session */
+ a2ps_open_output_session (job);
+
+ /* We open a new input session, which title is Sample Input */
+ a2ps_open_input_session (job, "Sample Input");
+
+ for (j = 0 ; j < 5 ; j++)
+ for (i = First_face ; i <= Last_face ; i++)
+ a2ps_print_string (job, "Hello world\n", i);
+
+ a2ps_print_string (job, "This is an Error", Error);
+ a2ps_close_input_session (job);
+
+ /* Just another page, with nothing really important in it */
+ a2ps_open_input_session (job, "Surprise!");
+ a2ps_print_char (job, '\160', Symbol);
+ a2ps_print_string (job, " = ", Plain);
+ foo (job);
+ a2ps_close_input_session (job);
+
+ /* This send the output to the current default printer */
+ a2ps_close_output_session (job);
+
+ /* Release the memory used */
+ a2ps_job_free (job);
+
+ exit (0);
+}
diff --git a/contrib/shell.m4 b/contrib/shell.m4
new file mode 100644
index 0000000..ca74abf
--- /dev/null
+++ b/contrib/shell.m4
@@ -0,0 +1,100 @@
+dnl This file inplements common sh idioms.
+divert(-1)
+changequote([, ])
+undefine([shift])
+
+dnl GETOPT(CASE-STATEMENT)
+dnl Implement a portable getopt
+define([GETOPT],
+[# Push a token among the arguments that will be used to notice when
+# we ended options/arguments parsing.
+arg_sep="$$--$$"
+set dummy ${1+"[$]@"} "$arg_sep"
+shift
+while test "x[$]1" != "x$arg_sep"; do
+
+ # Handle --option=value by splitting apart and putting back on argv.
+ case "[$]1" in
+ --*=*)
+ opt=`echo "[$]1" | sed -e 's/=.*//'`
+ val=`echo "[$]1" | sed -e 's/@BKL@^=@BKR@*=//'`
+ shift
+ set dummy "$opt" "$val" ${1+"[$]@"}
+ shift
+ ;;
+
+changequote(, )dnl
+ -[$option_without_arguments]?*)
+changequote([, ])dnl
+ [#] Prefix [$]1 with x to avoid running `echo -na' for instance.
+ opt=`echo "x[$]1" | sed -e 's/x-\(.\).*/-\1/'`
+ rest=`echo "x[$]1" | sed -e 's/x-.\(.*\)/-\1/'`
+ shift
+ set dummy "$opt" "$rest" ${1+"[$]@"}
+ shift
+ ;;
+
+ # This case needs to be protected so that the case `-??*' does
+ # not split long options without arguments
+ --*)
+ ;;
+
+ # This is an option with argument. Split apart and put back on argv.
+ -??*)
+ opt=`echo "x[$]1" | sed -e 's/x-\(.\).*/-\1/'`
+ arg=`echo "x[$]1" | sed -e 's/x-.\(.*\)/\1/'`
+ shift
+ set dummy "$opt" "$arg" ${1+"[$]@"}
+ shift
+ ;;
+ esac
+
+ [#] Now, handle the options. [$]1 is the option *only*. If it has an
+ [#] argument, it is now necessarily in [$]2 etc. Remember to shift
+ [#] when fetching an argument.
+ case "[$]1" in
+[$1]
+
+ --) # What remains are not options.
+ shift
+ while test "x[$]1" != "x$arg_sep"; do
+ set dummy ${1+"[$]@"} "[$]1"
+ shift
+ shift
+ done
+ break;;
+
+ -*)
+ echo "$program: Unknown or ambiguous option \`[$]1'." >&2
+ echo "$program: Try \`--help' for more information." >&2
+ exit 1;;
+ *) set dummy ${1+"[$]@"} "[$]1"
+ shift
+ ;;
+ esac
+ shift
+done
+# Pop the token
+shift
+])
+
+dnl A short GPL
+define([GPL],
+[ifelse([$1],,,[# $1
+])
+# 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 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, you can either send email to this
+# program's maintainer or write to: The Free Software Foundation,
+# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.])
+
+divert(0)dnl
diff --git a/contrib/texi2dvi4a2ps b/contrib/texi2dvi4a2ps
new file mode 100755
index 0000000..77b27ab
--- /dev/null
+++ b/contrib/texi2dvi4a2ps
@@ -0,0 +1,602 @@
+#! /bin/sh
+# texi2dvi --- produce DVI (or PDF) files from Texinfo (or LaTeX) sources.
+# $Id: texi2dvi4a2ps,v 1.1.1.1.2.3 2007/12/29 01:58:11 mhatta Exp $
+#
+# Copyright (C) 1992, 93, 94, 95, 96, 97, 98, 99, 2001, 02
+# Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, you can either send email to this
+# program's maintainer or write to: The Free Software Foundation,
+# Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
+#
+# Original author: Noah Friedman <friedman@gnu.org>.
+#
+# Please send bug reports, etc. to bug-texinfo@gnu.org.
+# If possible, please send a copy of the output of the script called with
+# the `--debug' option when making a bug report.
+
+# This string is expanded by rcs automatically when this file is checked out.
+rcs_revision='$Revision: 1.1.1.1.2.3 $'
+rcs_version=`set - $rcs_revision; echo $2`
+program=`echo $0 | sed -e 's!.*/!!'`
+version="texi2dvi (GNU Texinfo 4.1) $rcs_version
+
+Copyright (C) 2002 Free Software Foundation, Inc.
+There is NO warranty. You may redistribute this software
+under the terms of the GNU General Public License.
+For more information about these matters, see the files named COPYING."
+
+usage="Usage: $program [OPTION]... FILE...
+
+Run each Texinfo or LaTeX FILE through TeX in turn until all
+cross-references are resolved, building all indices. The directory
+containing each FILE is searched for included files. The suffix of FILE
+is used to determine its language (LaTeX or Texinfo).
+
+Makeinfo is used to perform Texinfo macro expansion before running TeX
+when needed.
+
+Operation modes:
+ -b, --batch no interaction
+ -c, --clean remove all auxiliary files
+ -D, --debug turn on shell debugging (set -x)
+ -h, --help display this help and exit successfully
+ -o, --output=OFILE leave output in OFILE (implies --clean);
+ Only one input FILE may be specified in this case
+ -q, --quiet no output unless errors (implies --batch)
+ -s, --silent same as --quiet
+ -v, --version display version information and exit successfully
+ -V, --verbose report on what is done
+
+TeX tuning:
+ -@ use @input instead of \input; for preloaded Texinfo
+ -e, --expand force macro expansion using makeinfo
+ -I DIR search DIR for Texinfo files
+ -l, --language=LANG specify the LANG of FILE (LaTeX or Texinfo)
+ -p, --pdf use pdftex or pdflatex for processing
+ -t, --texinfo=CMD insert CMD after @setfilename in copy of input file
+ multiple values accumulate
+
+The values of the BIBTEX, LATEX (or PDFLATEX), MAKEINDEX, MAKEINFO,
+TEX (or PDFTEX), and TEXINDEX environment variables are used to run
+those commands, if they are set.
+
+Email bug reports to <bug-texinfo@gnu.org>,
+general questions and discussion to <help-texinfo@gnu.org>.
+Texinfo home page: http://www.gnu.org/software/texinfo/"
+
+# Initialize variables for option overriding and otherwise.
+# Don't use `unset' since old bourne shells don't have this command.
+# Instead, assign them an empty value.
+batch=false # eval for batch mode
+clean=
+debug=
+escape='\'
+expand= # t for expansion via makeinfo
+miincludes= # makeinfo include path
+oformat=dvi
+oname= # --output
+quiet= # by default let the tools' message be displayed
+set_language=
+textra=
+tmpdir=`mktemp -d -t texi2dvi4a2ps.XXXXXX` || { echo "$program: Cannot create temporary dir!" >&2 ; exit 1; }
+txincludes= # TEXINPUTS extensions
+txiprereq=19990129 # minimum texinfo.tex version to have macro expansion
+verbose=false # echo for verbose mode
+
+orig_pwd=`pwd`
+
+# Systems which define $COMSPEC or $ComSpec use semicolons to separate
+# directories in TEXINPUTS.
+if test -n "$COMSPEC$ComSpec"; then
+ path_sep=";"
+else
+ path_sep=":"
+fi
+
+# Save this so we can construct a new TEXINPUTS path for each file.
+TEXINPUTS_orig="$TEXINPUTS"
+# Unfortunately makeindex does not read TEXINPUTS.
+INDEXSTYLE_orig="$INDEXSTYLE"
+export TEXINPUTS INDEXSTYLE
+
+# Push a token among the arguments that will be used to notice when we
+# ended options/arguments parsing.
+# Use "set dummy ...; shift" rather than 'set - ..." because on
+# Solaris set - turns off set -x (but keeps set -e).
+# Use ${1+"$@"} rather than "$@" because Digital Unix and Ultrix 4.3
+# still expand "$@" to a single argument (the empty string) rather
+# than nothing at all.
+arg_sep="$$--$$"
+set dummy ${1+"$@"} "$arg_sep"; shift
+
+#
+# Parse command line arguments.
+while test x"$1" != x"$arg_sep"; do
+
+ # Handle --option=value by splitting apart and putting back on argv.
+ case "$1" in
+ --*=*)
+ opt=`echo "$1" | sed -e 's/=.*//'`
+ val=`echo "$1" | sed -e 's/[^=]*=//'`
+ shift
+ set dummy "$opt" "$val" ${1+"$@"}; shift
+ ;;
+ esac
+
+ # This recognizes --quark as --quiet. So what.
+ case "$1" in
+ -@ ) escape=@;;
+ # Silently and without documentation accept -b and --b[atch] as synonyms.
+ -b | --b*) batch=eval;;
+ -q | -s | --q* | --s*) quiet=t; batch=eval;;
+ -c | --c*) clean=t;;
+ -D | --d*) debug=t;;
+ -e | --e*) expand=t;;
+ -h | --h*) echo "$usage"; exit 0;;
+ -I | --I*)
+ shift
+ miincludes="$miincludes -I $1"
+ txincludes="$txincludes$path_sep$1"
+ ;;
+ -l | --l*) shift; set_language=$1;;
+ -o | --o*)
+ shift
+ clean=t
+ case "$1" in
+ /* | ?:/*) oname=$1;;
+ *) oname="$orig_pwd/$1";;
+ esac;;
+ -p | --p*) oformat=pdf;;
+ -t | --t*) shift; textra="$textra\\
+$1";;
+ -v | --vers*) echo "$version"; exit 0;;
+ -V | --verb*) verbose=echo;;
+ --) # What remains are not options.
+ shift
+ while test x"$1" != x"$arg_sep"; do
+ set dummy ${1+"$@"} "$1"; shift
+ shift
+ done
+ break;;
+ -*)
+ echo "$0: Unknown or ambiguous option \`$1'." >&2
+ echo "$0: Try \`--help' for more information." >&2
+ exit 1;;
+ *) set dummy ${1+"$@"} "$1"; shift;;
+ esac
+ shift
+done
+# Pop the token
+shift
+
+# Interpret remaining command line args as filenames.
+case $# in
+ 0)
+ echo "$0: Missing file arguments." >&2
+ echo "$0: Try \`--help' for more information." >&2
+ exit 2
+ ;;
+ 1) ;;
+ *)
+ if test -n "$oname"; then
+ echo "$0: Can't use option \`--output' with more than one argument." >&2
+ exit 2
+ fi
+ ;;
+esac
+
+# Prepare the temporary directory. Remove it at exit, unless debugging.
+if test -z "$debug"; then
+ trap "cd / && rm -rf $tmpdir" 0 1 2 15
+fi
+
+# Prepare the tools we might need. This may be extra work in some
+# cases, but improves the readibility of the script.
+utildir=$tmpdir/utils
+mkdir $utildir || exit 1
+
+# A sed script that preprocesses Texinfo sources in order to keep the
+# iftex sections only. We want to remove non TeX sections, and
+# comment (with `@c texi2dvi') TeX sections so that makeinfo does not
+# try to parse them. Nevertheless, while commenting TeX sections,
+# don't comment @macro/@end macro so that makeinfo does propagate
+# them. Unfortunately makeinfo --iftex --no-ifhtml --no-ifinfo
+# doesn't work well enough (yet) to use that, so work around with sed.
+comment_iftex_sed=$utildir/comment.sed
+cat <<EOF >$comment_iftex_sed
+/^@tex/,/^@end tex/{
+ s/^/@c texi2dvi/
+}
+/^@iftex/,/^@end iftex/{
+ s/^/@c texi2dvi/
+ /^@c texi2dvi@macro/,/^@c texi2dvi@end macro/{
+ s/^@c texi2dvi//
+ }
+}
+/^@html/,/^@end html/{
+ s/^/@c (texi2dvi)/
+}
+/^@ifhtml/,/^@end ifhtml/{
+ s/^/@c (texi2dvi)/
+}
+/^@ifnottex/,/^@end ifnottex/{
+ s/^/@c (texi2dvi)/
+}
+/^@ifinfo/,/^@end ifinfo/{
+ /^@node/p
+ /^@menu/,/^@end menu/p
+ t
+ s/^/@c (texi2dvi)/
+}
+s/^@ifnotinfo/@c texi2dvi@ifnotinfo/
+s/^@end ifnotinfo/@c texi2dvi@end ifnotinfo/
+EOF
+# Uncommenting is simple: Remove any leading `@c texi2dvi'.
+uncomment_iftex_sed=$utildir/uncomment.sed
+cat <<EOF >$uncomment_iftex_sed
+s/^@c texi2dvi//
+EOF
+
+# A shell script that computes the list of xref files.
+# Takes the filename (without extension) of which we look for xref
+# files as argument. The index files must be reported last.
+get_xref_files=$utildir/get_xref.sh
+cat <<\EOF >$get_xref_files
+#! /bin/sh
+
+# Get list of xref files (indexes, tables and lists).
+# Find all files having root filename with a two-letter extension,
+# saves the ones that are really Texinfo-related files. .?o? catches
+# LaTeX tables and lists.
+for this_file in "$1".?o? "$1".aux "$1".?? "$1".idx; do
+ # If file is empty, skip it.
+ test -s "$this_file" || continue
+ # If the file is not suitable to be an index or xref file, don't
+ # process it. The file can't be if its first character is not a
+ # backslash or single quote.
+ first_character=`sed -n '1s/^\(.\).*$/\1/p;q' $this_file`
+ if test "x$first_character" = "x\\" \
+ || test "x$first_character" = "x'"; then
+ xref_files="$xref_files ./$this_file"
+ fi
+done
+echo "$xref_files"
+EOF
+chmod 500 $get_xref_files
+
+# File descriptor usage:
+# 0 standard input
+# 1 standard output (--verbose messages)
+# 2 standard error
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 5 tools output (turned off by --quiet)
+
+# Tools' output. If quiet, discard, else redirect to the message flow.
+if test "$quiet" = t; then
+ exec 5>/dev/null
+else
+ exec 5>&1
+fi
+
+# Enable tracing
+test "$debug" = t && set -x
+
+#
+# TeXify files.
+
+for command_line_filename in ${1+"$@"}; do
+ $verbose "Processing $command_line_filename ..."
+
+ # If the COMMAND_LINE_FILENAME is not absolute (e.g., --debug.tex),
+ # prepend `./' in order to avoid that the tools take it as an option.
+ echo "$command_line_filename" | egrep '^(/|[A-z]:/)' >/dev/null \
+ || command_line_filename="./$command_line_filename"
+
+ # See if the file exists. If it doesn't we're in trouble since, even
+ # though the user may be able to reenter a valid filename at the tex
+ # prompt (assuming they're attending the terminal), this script won't
+ # be able to find the right xref files and so forth.
+ if test ! -r "$command_line_filename"; then
+ echo "$0: Could not read $command_line_filename, skipping." >&2
+ continue
+ fi
+
+ # Get the name of the current directory. We want the full path
+ # because in clean mode we are in tmp, in which case a relative
+ # path has no meaning.
+ filename_dir=`echo $command_line_filename | sed 's!/[^/]*$!!;s!^$!.!'`
+ filename_dir=`cd "$filename_dir" >/dev/null && pwd`
+
+ # Strip directory part but leave extension.
+ filename_ext=`basename "$command_line_filename"`
+ # Strip extension.
+ filename_noext=`echo "$filename_ext" | sed 's/\.[^.]*$//'`
+ ext=`echo "$filename_ext" | sed 's/^.*\.//'`
+
+ # _src. Use same basename since we want to generate aux files with
+ # the same basename as the manual. If --expand, then output the
+ # macro-expanded file to here, else copy the original file.
+ tmpdir_src=$tmpdir/src
+ filename_src=$tmpdir_src/$filename_noext.$ext
+
+ # _xtr. The file with the user's extra commands.
+ tmpdir_xtr=$tmpdir/xtr
+ filename_xtr=$tmpdir_xtr/$filename_noext.$ext
+
+ # _bak. Copies of the previous xref files (another round is run if
+ # they differ from the new one).
+ tmpdir_bak=$tmpdir/bak
+
+ # Make all those directories and give up if we can't succeed.
+ mkdir $tmpdir_src $tmpdir_xtr $tmpdir_bak || exit 1
+
+ # Source file might include additional sources. Put `.' and
+ # directory where source file(s) reside in TEXINPUTS before anything
+ # else. `.' goes first to ensure that any old .aux, .cps,
+ # etc. files in ${directory} don't get used in preference to fresher
+ # files in `.'. Include orig_pwd in case we are in clean mode, where
+ # we've cd'd to a temp directory.
+ common=".$path_sep$orig_pwd$path_sep$filename_dir$path_sep$txincludes$path_sep"
+ TEXINPUTS="$common$TEXINPUTS_orig"
+ INDEXSTYLE="$common$INDEXSTYLE_orig"
+
+ # If the user explicitly specified the language, use that.
+ # Otherwise, if the first line is \input texinfo, assume it's texinfo.
+ # Otherwise, guess from the file extension.
+ if test -n "$set_language"; then
+ language=$set_language
+ elif sed 1q "$command_line_filename" | fgrep 'input texinfo' >/dev/null; then
+ language=texinfo
+ else
+ language=
+ fi
+
+ # Get the type of the file (latex or texinfo) from the given language
+ # we just guessed, or from the file extension if not set yet.
+ case ${language:-$filename_ext} in
+ [lL]a[tT]e[xX] | *.ltx | *.tex)
+ # Assume a LaTeX file. LaTeX needs bibtex and uses latex for
+ # compilation. No makeinfo.
+ bibtex=${BIBTEX:-bibtex}
+ makeinfo= # no point in running makeinfo on latex source.
+ texindex=${MAKEINDEX:-makeindex}
+ if test $oformat = dvi; then
+ tex=${LATEX:-latex}
+ else
+ tex=${PDFLATEX:-pdflatex}
+ fi
+ ;;
+
+ *)
+ # Assume a Texinfo file. Texinfo files need makeinfo, texindex and tex.
+ bibtex=
+ texindex=${TEXINDEX:-texindex}
+ if test $oformat = dvi; then
+ tex=${TEX:-tex}
+ else
+ tex=${PDFTEX:-pdftex}
+ fi
+ # Unless required by the user, makeinfo expansion is wanted only
+ # if texinfo.tex is too old.
+ if test "$expand" = t; then
+ makeinfo=${MAKEINFO:-makeinfo}
+ else
+ # Check if texinfo.tex performs macro expansion by looking for
+ # its version. The version is a date of the form YEAR-MO-DA.
+ # We don't need to use [0-9] to match the digits since anyway
+ # the comparison with $txiprereq, a number, will fail with non
+ # digits.
+ txiversion_tex=txiversion.tex
+ echo '\input texinfo.tex @bye' >$tmpdir/$txiversion_tex
+ # Run in the tmpdir to avoid leaving files.
+ eval `cd $tmpdir >/dev/null &&
+ $tex $txiversion_tex 2>/dev/null |
+ sed -n 's/^.*\[\(.*\)version \(....\)-\(..\)-\(..\).*$/txiformat=\1 txiversion="\2\3\4"/p'`
+ $verbose "texinfo.tex preloaded as \`$txiformat', version is \`$txiversion' ..."
+ if test "$txiprereq" -le "$txiversion" >/dev/null 2>&1; then
+ makeinfo=
+ else
+ makeinfo=${MAKEINFO:-makeinfo}
+ fi
+ # As long as we had to run TeX, offer the user this convenience
+ if test "$txiformat" = Texinfo; then
+ escape=@
+ fi
+ fi
+ ;;
+ esac
+
+ # Expand macro commands in the original source file using Makeinfo.
+ # Always use `end' footnote style, since the `separate' style
+ # generates different output (arguably this is a bug in -E).
+ # Discard main info output, the user asked to run TeX, not makeinfo.
+ if test -n "$makeinfo"; then
+ $verbose "Macro-expanding $command_line_filename to $filename_src ..."
+ sed -f $comment_iftex_sed "$command_line_filename" \
+ | $makeinfo --footnote-style=end -I "$filename_dir" $miincludes \
+ -o /dev/null --macro-expand=- \
+ | sed -f $uncomment_iftex_sed >"$filename_src"
+ filename_input=$filename_src
+ fi
+
+ # If makeinfo failed (or was not even run), use the original file as input.
+ if test $? -ne 0 \
+ || test ! -r "$filename_src"; then
+ $verbose "Reverting to $command_line_filename ..."
+ filename_input=$filename_dir/$filename_ext
+ fi
+
+ # Used most commonly for @finalout, @smallbook, etc.
+ if test -n "$textra"; then
+ $verbose "Inserting extra commands: $textra"
+ sed '/^@setfilename/a\
+'"$textra" "$filename_input" >$filename_xtr
+ filename_input=$filename_xtr
+ fi
+
+ # If clean mode was specified, then move to the temporary directory.
+ if test "$clean" = t; then
+ $verbose "cd $tmpdir_src"
+ cd "$tmpdir_src" || exit 1
+ fi
+
+ while :; do # will break out of loop below
+ orig_xref_files=`$get_xref_files "$filename_noext"`
+
+ # Save copies of originals for later comparison.
+ if test -n "$orig_xref_files"; then
+ $verbose "Backing up xref files: `echo $orig_xref_files | sed 's|\./||g'`"
+ cp $orig_xref_files $tmpdir_bak
+ fi
+
+ # Run bibtex on current file.
+ # - If its input (AUX) exists.
+ # - If AUX contains both `\bibdata' and `\bibstyle'.
+ # - If some citations are missing (LOG contains `Citation').
+ # or the LOG complains of a missing .bbl
+ #
+ # We run bibtex first, because I can see reasons for the indexes
+ # to change after bibtex is run, but I see no reason for the
+ # converse.
+ #
+ # Don't try to be too smart. Running bibtex only if the bbl file
+ # exists and is older than the LaTeX file is wrong, since the
+ # document might include files that have changed. Because there
+ # can be several AUX (if there are \include's), but a single LOG,
+ # looking for missing citations in LOG is easier, though we take
+ # the risk to match false messages.
+ if test -n "$bibtex" \
+ && test -r "$filename_noext.aux" \
+ && test -r "$filename_noext.log" \
+ && (grep '^\\bibdata[{]' "$filename_noext.aux" \
+ && grep '^\\bibstyle[{]' "$filename_noext.aux" \
+ && (grep 'Warning:.*Citation.*undefined' "$filename_noext.log" \
+ || grep 'No file .*\.bbl\.' "$filename_noext.log")) \
+ >/dev/null 2>&1; \
+ then
+ $verbose "Running $bibtex $filename_noext ..."
+ if $bibtex "$filename_noext" >&5; then :; else
+ echo "$0: $bibtex exited with bad status, quitting." >&2
+ exit 1
+ fi
+ fi
+
+ # What we'll run texindex on -- exclude non-index files.
+ # Since we know index files are last, it is correct to remove everything
+ # before .aux and .?o?.
+ index_files=`echo "$orig_xref_files" \
+ | sed "s!.*\.aux!!g;
+ s!./$filename_noext\..o.!!g;
+ s/^[ ]*//;s/[ ]*$//"`
+ # Run texindex (or makeindex) on current index files. If they
+ # already exist, and after running TeX a first time the index
+ # files don't change, then there's no reason to run TeX again.
+ # But we won't know that if the index files are out of date or
+ # nonexistent.
+ if test -n "$texindex" && test -n "$index_files"; then
+ $verbose "Running $texindex $index_files ..."
+ if $texindex $index_files 2>&5 1>&2; then :; else
+ echo "$0: $texindex exited with bad status, quitting." >&2
+ exit 1
+ fi
+ fi
+
+ # Finally, run TeX.
+ # Prevent $ESCAPE from being interpreted by the shell if it happens
+ # to be `/'.
+ $batch tex_args="\\${escape}nonstopmode\ \\${escape}input"
+ cmd="$tex $tex_args $filename_input"
+ $verbose "Running $cmd ..."
+ if $cmd >&5; then :; else
+ echo "$0: $tex exited with bad status, quitting." >&2
+ echo "$0: see $filename_noext.log for errors." >&2
+ test "$clean" = t \
+ && cp "$filename_noext.log" "$orig_pwd"
+ exit 1
+ fi
+
+
+ # Decide if looping again is needed.
+ finished=t
+
+ # LaTeX (and the package changebar) report in the LOG file if it
+ # should be rerun. This is needed for files included from
+ # subdirs, since texi2dvi does not try to compare xref files in
+ # subdirs. Performing xref files test is still good since LaTeX
+ # does not report changes in xref files.
+ if fgrep "Rerun to get" "$filename_noext.log" >/dev/null 2>&1; then
+ finished=
+ fi
+
+ # Check if xref files changed.
+ new_xref_files=`$get_xref_files "$filename_noext"`
+ $verbose "Original xref files = `echo $orig_xref_files | sed 's|\./||g'`"
+ $verbose "New xref files = `echo $new_xref_files | sed 's|\./||g'`"
+
+ # If old and new lists don't at least have the same file list,
+ # then one file or another has definitely changed.
+ test "x$orig_xref_files" != "x$new_xref_files" && finished=
+
+ # File list is the same. We must compare each file until we find
+ # a difference.
+ if test -n "$finished"; then
+ for this_file in $new_xref_files; do
+ $verbose "Comparing xref file `echo $this_file | sed 's|\./||g'` ..."
+ # cmp -s returns nonzero exit status if files differ.
+ if cmp -s "$this_file" "$tmpdir_bak/$this_file"; then :; else
+ # We only need to keep comparing until we find one that
+ # differs, because we'll have to run texindex & tex again no
+ # matter how many more there might be.
+ finished=
+ $verbose "xref file `echo $this_file | sed 's|\./||g'` differed ..."
+ test "$debug" = t && diff -c "$tmpdir_bak/$this_file" "$this_file"
+ break
+ fi
+ done
+ fi
+
+ # If finished, exit the loop, else rerun the loop.
+ test -n "$finished" && break
+ done
+
+ # If we were in clean mode, compilation was in a tmp directory.
+ # Copy the DVI (or PDF) file into the directory where the compilation
+ # has been done. (The temp dir is about to get removed anyway.)
+ # We also return to the original directory so that
+ # - the next file is processed in correct conditions
+ # - the temporary file can be removed
+ if test -n "$clean"; then
+ if test -n "$oname"; then
+ dest=$oname
+ else
+ dest=$orig_pwd
+ fi
+ $verbose "Copying $oformat file from `pwd` to $dest"
+ cp -p "./$filename_noext.$oformat" "$dest"
+ cd / # in case $orig_pwd is on a different drive (for DOS)
+ cd $orig_pwd || exit 1
+ fi
+
+ # Remove temporary files.
+ if test "x$debug" = "x"; then
+ $verbose "Removing $tmpdir_src $tmpdir_xtr $tmpdir_bak ..."
+ cd /
+ rm -rf $tmpdir_src $tmpdir_xtr $tmpdir_bak
+ fi
+done
+
+$verbose "$0 done."
+exit 0 # exit successfully, not however we ended the loop.