% e-TeX is copyright (C) 1994-1996 by the NTS team; all rights are reserved.

This is file `w2c70etex11.diff', a patch to integrate
       e-TeX v1.1 (Oct 16, 1996) into
       Web2c v7.0

The file `README.w2c70etex11' describes how to apply this patch,
the file `w2c70etex11.tar.gz' contains additional files necessary to
complete the patch.


diff -c web2c-7.0/web2c/Makefile.in-ORG web2c-7.0/web2c/Makefile.in
*** web2c-7.0/web2c/Makefile.in-ORG     Fri Feb  7 00:30:07 1997
--- web2c-7.0/web2c/Makefile.in Sun Feb  9 21:54:28 1997
***************
*** 82,87 ****
--- 82,89 ----
 mp_o = mpini.o mp0.o mp1.o mp2.o mpextra.o
 tex_c = texini.c tex0.c tex1.c tex2.c
 tex_o = texini.o tex0.o tex1.o tex2.o texextra.o
+ etex_c = etexini.c etex0.c etex1.c etex2.c
+ etex_o = etexini.o etex0.o etex1.o etex2.o etexextra.o

 other_c = bibtex.c dvicopy.c dvitomp.c dvitype.c gftodvi.c gftopk.c gftype.c \
   mft.c patgen.c pktogf.c pktype.c pltotf.c pooltype.c tangle.c \
***************
*** 93,99 ****

 programs = bibtex dvicopy dvitomp dvitype gftodvi gftopk gftype mf \
 mft mpost patgen pktogf pktype pltotf pooltype tangle tex tftopl vftovp \
! vptovf weave

 mpware = mpware/dmp mpware/makempx mpware/mpto mpware/newer
 mpware_sources = mpware/dmp.c mpware/makempx.in mpware/mpto.c mpware/newer.c
--- 95,101 ----

 programs = bibtex dvicopy dvitomp dvitype gftodvi gftopk gftype mf \
 mft mpost patgen pktogf pktype pltotf pooltype tangle tex tftopl vftovp \
! vptovf weave etex

 mpware = mpware/dmp mpware/makempx mpware/mpto mpware/newer
 mpware_sources = mpware/dmp.c mpware/makempx.in mpware/mpto.c mpware/newer.c
***************
*** 137,142 ****
--- 139,146 ----
       $(kpathsea_link) pooltype.o $(LOADLIBES)
 tex: $(tex_o)
       $(kpathsea_link) $(tex_o) $(socketlibs) $(LOADLIBES)
+ etex: $(etex_o)
+       $(kpathsea_link) $(etex_o) $(socketlibs) $(LOADLIBES)
 tftopl: tftopl.o
       $(kpathsea_link) tftopl.o $(LOADLIBES)
 vftovp: vftovp.o
***************
*** 154,160 ****
 bibtex.p dvicopy.p dvitomp.p dvitype.p gftopk.p gftodvi.p gftype.p \
   mf.p mft.p mp.p patgen.p \
   pktogf.p pktype.p pltotf.p pooltype.p \
!   tex.p tftopl.p vftovp.p vptovf.p weave.p: tangle
 bibtex.p: bibtex.web bibtex.ch
 dvicopy.p: dvicopy.web dvicopy.ch
 dvitomp.p: dvitomp.web dvitomp.ch
--- 158,164 ----
 bibtex.p dvicopy.p dvitomp.p dvitype.p gftopk.p gftodvi.p gftype.p \
   mf.p mft.p mp.p patgen.p \
   pktogf.p pktype.p pltotf.p pooltype.p \
!   tex.p etex.p tftopl.p vftovp.p vptovf.p weave.p: tangle
 bibtex.p: bibtex.web bibtex.ch
 dvicopy.p: dvicopy.web dvicopy.ch
 dvitomp.p: dvitomp.web dvitomp.ch
***************
*** 171,176 ****
--- 175,183 ----
 pltotf.p: pltotf.web pltotf.ch
 pooltype.p: pooltype.web pooltype.ch
 tex.p tex.pool: tex.web tex.ch
+ etex.p etex.pool: tex.web  $(srcdir)/e-tex-1.1/etex-w2c.ch
+       rm -f $(srcdir)/etex.web; $(LN) $(srcdir)/tex.web $(srcdir)/etex.web
+       $(shared_env) ./tangle $(srcdir)/etex.web $(srcdir)/e-tex-1.1/etex-w2c.ch
 tftopl.p: tftopl.web tftopl.ch
 vftovp.p: vftovp.web vftovp.ch
 vptovf.p: vptovf.web vptovf.ch
***************
*** 189,194 ****
--- 196,203 ----
       $(web2c) mp
 $(tex_c) texcoerce.h texd.h: tex.p $(web2c_texmf)
       $(web2c) tex
+ $(etex_c) etexcoerce.h etexd.h: etex.p $(web2c_texmf)
+       $(web2c) etex

 # As long as we have to have separate rules to create these, might as well do
 # a little work to avoid separate compilation rules, too.
***************
*** 198,203 ****
--- 207,214 ----
       sed s/TEX-OR-MF-OR-MP/mp/ $(srcdir)/lib/texmfmp.c >$@
 texextra.c: lib/texmfmp.c
       sed s/TEX-OR-MF-OR-MP/tex/ $(srcdir)/lib/texmfmp.c >$@
+ etexextra.c: lib/texmfmp.c
+       sed s/TEX-OR-MF-OR-MP/etex/ $(srcdir)/lib/texmfmp.c >$@

 # Additional dependencies for recompiling the C code are generated
 # automatically, included at the end.
***************
*** 371,376 ****
--- 382,388 ----
 install-data::
       $(SHELL) $(top_srcdir)/../mkdirchain $(texpooldir) $(mfpooldir) $(mppoldir) $(web2cdir) $(fontnamedir)
       $(INSTALL_DATA) tex.pool $(texpooldir)/tex.pool
+       $(INSTALL_DATA) etex.pool $(texpooldir)/etex.pool
       $(INSTALL_DATA) mf.pool $(mfpooldir)/mf.pool
       $(INSTALL_DATA) mp.pool $(mppooldir)/mp.pool
 # tcx files are a bad idea
***************
*** 486,491 ****
--- 498,505 ----
 triptrap: trip trap mptrap
 testdir = $(srcdir)/triptrap
 testenv = TEXMFCNF=$(testdir)
+ etestdir = $(srcdir)/etriptest
+ etestenv = TEXMFCNF=$(etestdir)
 dvitype_args = -output-level=2 -dpi=72.27 -page-start='*.*.*.*.*.*.*.*.*.*'
 trip: pltotf tftopl tex dvitype
       @echo ">>> See $(testdir)/trip.diffs for example of acceptable diffs." >&2
***************
*** 505,510 ****
--- 519,566 ----
       $(SHELL) -c '$(testenv) ./dvitype $(dvitype_args) trip.dvi >trip.typ'
       -$(DIFF) $(DIFFFLAGS) $(testdir)/trip.typ trip.typ

+ etrip: etripc etripe eetrip
+
+ etripc: pltotf etex dvitype
+       @echo ">>> See $(etestdir)/etripc.diffs for example of acceptable diffs." >&2
+       ./pltotf $(testdir)/trip.pl trip.tfm
+ # Run TRIP test with e-TeX in compatibility mode
+       rm -f trip.tex; $(LN) $(testdir)/trip.tex . # get same filename in log
+       -$(SHELL) -c '$(etestenv) ./etex -ini <$(testdir)/trip1.in >tripin.fot'
+       mv trip.log tripin.log
+       -diff $(testdir)/tripin.log tripin.log
+       -$(SHELL) -c '$(etestenv) ./etex <$(testdir)/trip2.in >trip.fot'
+       -diff $(testdir)/trip.fot trip.fot
+       -$(DIFF) $(DIFFFLAGS) $(testdir)/trip.log trip.log
+       $(SHELL) -c '$(etestenv) ./dvitype $(dvitype_args) trip.dvi >trip.typ'
+       -$(DIFF) $(DIFFFLAGS) $(testdir)/trip.typ trip.typ
+
+ etripe: pltotf etex dvitype
+       @echo ">>> See $(etestdir)/etripe.diffs for example of acceptable diffs." >&2
+       ./pltotf $(testdir)/trip.pl trip.tfm
+ # Run TRIP test with e-TeX in extended mode
+       rm -f trip.tex; $(LN) $(testdir)/trip.tex . # get same filename in log
+       -$(SHELL) -c '$(etestenv) ./etex -ini <$(etestdir)/trip1.in >tripin.fot'
+       mv trip.log tripin.log
+       -diff $(testdir)/tripin.log tripin.log
+       -$(SHELL) -c '$(etestenv) ./etex <$(testdir)/trip2.in >trip.fot'
+       -diff $(testdir)/trip.fot trip.fot
+       -$(DIFF) $(DIFFFLAGS) $(testdir)/trip.log trip.log
+       $(SHELL) -c '$(etestenv) ./dvitype $(dvitype_args) trip.dvi >trip.typ'
+       -$(DIFF) $(DIFFFLAGS) $(testdir)/trip.typ trip.typ
+
+ eetrip: pltotf etex
+       @echo ">>> See $(etestdir)/eetrip.diffs for example of acceptable diffs." >&2
+       ./pltotf $(etestdir)/etrip.pl etrip.tfm
+ # Run e-TRIP test with e-TeX in extended mode
+       rm -f etrip.tex; $(LN) $(etestdir)/etrip.tex . # get same filename in log
+       -$(SHELL) -c '$(etestenv) ./etex -ini <$(etestdir)/etrip1.in >etripin.fot'
+       mv etrip.log etripin.log
+       -diff $(etestdir)/etripin.log etripin.log
+       -$(SHELL) -c '$(etestenv) ./etex <$(etestdir)/etrip2.in >etrip.fot'
+       -diff $(etestdir)/etrip.fot etrip.fot
+       -$(DIFF) $(DIFFFLAGS) $(etestdir)/etrip.log etrip.log
+
 # Can't run trap and mptrap in parallel, because both write trap.{log,tfm}.
 trap: mf tftopl gftype
       @echo ">>> See $(testdir)/mftrap.diffs for example of acceptable diffs." >&2
***************
*** 682,687 ****
--- 738,746 ----
       rm -f trip.* tripin.* tripos.tex 8terminal.tex
       rm -f trap.* mftrap.* mftrapin.* mptrap.* mptrapin.*
       rm -f trapf.* mtrap.* writeo* missfont.log
+ # Cleanup from etrip.
+       rm -f etrip.tex
+       rm -f etrip.* etripin.*
 distclean::
       test ! -r lib/Makefile \
         || for d in $(all_subdirs); do (cd $$d && $(MAKE) $@); done
***************
*** 699,704 ****
--- 758,766 ----
       rm -f trip.* tripin.* tripos.tex 8terminal.tex
       rm -f trap.* mftrap.* mftrapin.* mptrap.* mptrapin.*
       rm -f trapf.* mtrap.* writeo* missfont.log
+ # Remove etrip junk here too.
+       rm -f etrip.tex
+       rm -f etrip.* etripin.*
 maintainer-clean::
       test ! -r lib/Makefile \
         || for d in $(all_subdirs); do (cd $$d && $(MAKE) $@); done
***************
*** 1056,1061 ****
--- 1118,1184 ----
  ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
  help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
  ../kpathsea/tex-make.h texmfmem.h texcoerce.h
+ etex0.o: etex0.c etexd.h texmfmp.h cpascal.h config.h \
+  ../kpathsea/config.h c-auto.h ../kpathsea/c-std.h \
+  ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
+  ../kpathsea/c-memstr.h \
+  ../kpathsea/c-errno.h \
+  ../kpathsea/c-minmax.h \
+  ../kpathsea/c-limits.h \
+  ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
+  ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
+  ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
+  help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
+  ../kpathsea/tex-make.h texmfmem.h etexcoerce.h
+ etex1.o: etex1.c etexd.h texmfmp.h cpascal.h config.h \
+  ../kpathsea/config.h c-auto.h ../kpathsea/c-std.h \
+  ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
+  ../kpathsea/c-memstr.h \
+  ../kpathsea/c-errno.h \
+  ../kpathsea/c-minmax.h \
+  ../kpathsea/c-limits.h \
+  ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
+  ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
+  ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
+  help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
+  ../kpathsea/tex-make.h texmfmem.h etexcoerce.h
+ etex2.o: etex2.c etexd.h texmfmp.h cpascal.h config.h \
+  ../kpathsea/config.h c-auto.h ../kpathsea/c-std.h \
+  ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
+  ../kpathsea/c-memstr.h \
+  ../kpathsea/c-errno.h \
+  ../kpathsea/c-minmax.h \
+  ../kpathsea/c-limits.h \
+  ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
+  ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
+  ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
+  help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
+  ../kpathsea/tex-make.h texmfmem.h etexcoerce.h
+ etexextra.o: etexextra.c etexd.h texmfmp.h cpascal.h config.h \
+  ../kpathsea/config.h c-auto.h ../kpathsea/c-std.h \
+  ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
+  ../kpathsea/c-memstr.h \
+  ../kpathsea/c-errno.h \
+  ../kpathsea/c-minmax.h \
+  ../kpathsea/c-limits.h \
+  ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
+  ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
+  ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
+  help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
+  ../kpathsea/tex-make.h texmfmem.h etexcoerce.h ../kpathsea/line.h \
+  ../kpathsea/readable.h ../kpathsea/variable.h
+ etexini.o: etexini.c etexd.h texmfmp.h cpascal.h config.h \
+  ../kpathsea/config.h c-auto.h ../kpathsea/c-std.h \
+  ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
+  ../kpathsea/c-memstr.h \
+  ../kpathsea/c-errno.h \
+  ../kpathsea/c-minmax.h \
+  ../kpathsea/c-limits.h \
+  ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
+  ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
+  ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
+  help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
+  ../kpathsea/tex-make.h texmfmem.h etexcoerce.h
 tftopl.o: tftopl.c cpascal.h config.h ../kpathsea/config.h c-auto.h \
  ../kpathsea/c-std.h \
  ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
diff -c web2c-7.0/web2c/web2c/convert-ORIG  web2c-7.0/web2c/web2c/convert
*** web2c-7.0/web2c/web2c/convert-ORIG  Sun Dec 29 23:29:48 1996
--- web2c-7.0/web2c/web2c/convert       Sun Feb  9 20:07:50 1997
***************
*** 59,74 ****
     output_files="$basefile[0-9]*.c ${basefile}ini.c ${basefile}d.h \
 ${basefile}coerce.h"
     ;;
!   tex)
     more_defines=$srcdir/web2c/texmf.defines
     precmd="| sed -f $srcdir/web2c/cvttex.sed"
!     web2c_options="-t -ctexcoerce"
     hfile=texmfmp.h
     fixwrites_options=-t
!     postcmd="| ./web2c/splitup tex"
!     cfile=tex2.c # last output file, or thereabouts
     output=
!     output_files="tex[0-9]*.c texini.c texd.h texcoerce.h"
     ;;
 esac

--- 59,75 ----
     output_files="$basefile[0-9]*.c ${basefile}ini.c ${basefile}d.h \
 ${basefile}coerce.h"
     ;;
!   tex|etex) # TeX and e-TeX are almost the same.
     more_defines=$srcdir/web2c/texmf.defines
     precmd="| sed -f $srcdir/web2c/cvttex.sed"
!     web2c_options="-t -c${basefile}coerce"
     hfile=texmfmp.h
     fixwrites_options=-t
!     postcmd="| ./web2c/splitup ${basefile}"
!     cfile=${basefile}2.c # last output file, or thereabouts
     output=
!     output_files="${basefile}[0-9]*.c ${basefile}ini.c ${basefile}d.h \
! ${basefile}coerce.h"
     ;;
 esac

***************
*** 106,116 ****
     mv x${basefile}coerce.h ${basefile}coerce.h
     touch ${basefile}d.h
     ;;
!   tex)
     sleep 2
!     cat texcoerce.h $srcdir/web2c/coerce.tex >xtexcoerce.h
!     mv xtexcoerce.h texcoerce.h
!     touch texd.h
     ;;
 esac

--- 107,117 ----
     mv x${basefile}coerce.h ${basefile}coerce.h
     touch ${basefile}d.h
     ;;
!   tex|etex)
     sleep 2
!     cat ${basefile}coerce.h $srcdir/web2c/coerce.tex >x${basefile}coerce.h
!     mv x${basefile}coerce.h ${basefile}coerce.h
!     touch ${basefile}d.h
     ;;
 esac

diff -c web2c-7.0/web2c/web2c/splitup.c-ORIG  web2c-7.0/web2c/web2c/splitup.c
*** web2c-7.0/web2c/web2c/splitup.c-ORIG        Mon Oct 14 23:38:22 1996
--- web2c-7.0/web2c/web2c/splitup.c     Sun Feb  9 20:10:17 1997
***************
*** 74,84 ****
   } else if (STREQ (output_name, "tex")) {
     fputs ("#define INITEX\n#define TeX\n", out);
     coerce = "texcoerce.h";
   } else if (STREQ (output_name, "mp")) {
     fputs ("#define INIMP\n#define MP\n", out);
     coerce = "mpcoerce.h";
   } else
!     FATAL1 ("Can only split mf, mp, or tex, not %s", output_name);

   coerce_len = strlen (coerce);

--- 74,87 ----
   } else if (STREQ (output_name, "tex")) {
     fputs ("#define INITEX\n#define TeX\n", out);
     coerce = "texcoerce.h";
+   } else if (STREQ (output_name, "etex")) {
+     fputs ("#define INITEX\n#define TeX\n", out);
+     coerce = "etexcoerce.h";
   } else if (STREQ (output_name, "mp")) {
     fputs ("#define INIMP\n#define MP\n", out);
     coerce = "mpcoerce.h";
   } else
!     FATAL1 ("Can only split mf, mp, tex or etex, not %s", output_name);

   coerce_len = strlen (coerce);