DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: R T

⟦3db508263⟧ TextFile

    Length: 2947 (0xb83)
    Types: TextFile
    Names: »README«

Derivation

└─⟦060c9c824⟧ Bits:30007080 DKUUG TeX 2/12/89
    └─⟦this⟧ »./tex82/fmtdump/README« 

TextFile

This directory contains the sources for an *EXPERIMENTAL* new program
fmtdump, which was inspired by the program fmt2init.  Fmt2init,
described in the xxx issue of TUGboat, is part of the TurboTeX
distribution.  Fmtdump provides an attractive alternative to using
undump to create a version of TeX with a preloaded format file.  It
reads a format file and writes a file which contains C initialization
statements which, when linked into virtex, have the same effect as
undump'ing virtex after reading in that format file.  The advantages
of this approach are:

1.  Portability.  Both undump and fmtdump contain system dependencies,
    but I believe that fmtdump is more portable than undump.
2.  Size: a plain TeX built from fmtdump's output is smaller than an
    undump'ed one.
3.  Startup speed: Since it's smaller, it starts up faster.

To build fmtdump, just type "make".  Note that, although it will copy
tex.h and texd.h from ../ctex, the file "memory.h" in this directory
is NOT the same as that in ../ctex.  So you MUST compile plain.c (or
whatever) in the CURRENT directory, then move the .o file as in the
example below.

Once you have fmtdump, run initex to create a .fmt file.  For example,
let's say you want to make plain TeX:

	initex plain \\dump		[creates plain.fmt]
	fmtdump plain.fmt plain.c	[creates plain.c]
	cc -c plain.c			[creates plain.o]
	mv plain.o ../ctex
	cd ../ctex
	make xtex			[creates tex with plain.fmt preloaded]
	mv -f xtex tex			[give it an appropriate name]

Caveats:

Compared with undump, the fmtdump approach to creating a preloaded TeX
is fairly portable.  However, fmtdump contains two glaring system
dependencies, as well as some hidden dependencies on TeX.  First, in C
it is impossible to write an initialization statement for unions, or
structures containing unions.  The two data structures which fall into
this category are memoryword's and twohalves's.  A memoryword is a
union of four different data types, all of which will be the size of
an integer (i.e., a long) on most systems.  To initialize this data,
fmtdump pretends that variables and arrays of type memoryword are
actually of type long.  Similarly, data of type twohalves are written
as an unsigned long containing the RH and LH fields of the structure.
Depending on your C compiler and your machine's architecture, this
approach may not work.

Naturally, fmtdump depends on its knowing the names and types of all
the global variables it writes out.  If TeX were changed, fmtdump
would also have to be changed.  When TeX is ready_already, it doesn't
execute its initialization routine.  This routine gives non-zero
values to many variables, so those statements have been copied into
fmtdump, and they would have to be modified if TeX's initialization
routine changed.

Fmtdump contains a copy of TeX's load_fmt_file routine.  Again, if
this routine were changed, then the new C code would have to be
substituted for that in fmtdump.