summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/etexdir
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-03-25 16:51:09 +0000
committerKarl Berry <karl@freefriends.org>2008-03-25 16:51:09 +0000
commitbe2fb287d5b6b777928f0ee68ad319ccc24227e7 (patch)
treea9d82c7efdd72e37a596a27d9943321aa47ac3a6 /Build/source/texk/web2c/etexdir
parent5daff30ff2064c85bad88beb411b247bd0ef17f3 (diff)
integrate pool into tex/mf/etex binaries; from akira
git-svn-id: svn://tug.org/texlive/trunk@7153 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/etexdir')
-rw-r--r--Build/source/texk/web2c/etexdir/etex-binpool.ch75
-rw-r--r--Build/source/texk/web2c/etexdir/etex.mk12
2 files changed, 82 insertions, 5 deletions
diff --git a/Build/source/texk/web2c/etexdir/etex-binpool.ch b/Build/source/texk/web2c/etexdir/etex-binpool.ch
new file mode 100644
index 00000000000..ac959c7b3fb
--- /dev/null
+++ b/Build/source/texk/web2c/etexdir/etex-binpool.ch
@@ -0,0 +1,75 @@
+%
+% pool in binary
+%
+@x
+@ @d bad_pool(#)==begin wake_up_terminal; write_ln(term_out,#);
+ a_close(pool_file); get_strings_started:=false; return;
+ end
+@<Read the other strings...@>=
+name_length := strlen (pool_name);
+name_of_file := xmalloc_array (ASCII_code, name_length + 1);
+strcpy (stringcast(name_of_file+1), pool_name); {copy the string}
+if a_open_in (pool_file, kpse_texpool_format) then
+ begin c:=false;
+ repeat @<Read one string, but return |false| if the
+ string memory space is getting too tight for comfort@>;
+ until c;
+ a_close(pool_file); get_strings_started:=true;
+ end
+else bad_pool('! I can''t read ', pool_name, '; bad path?')
+@.I can't read TEX.POOL@>
+
+@ @<Read one string...@>=
+begin if eof(pool_file) then bad_pool('! ', pool_name, ' has no check sum.');
+@.TEX.POOL has no check sum@>
+read(pool_file,m); read(pool_file,n); {read two digits of string length}
+if m='*' then @<Check the pool check sum@>
+else begin if (xord[m]<"0")or(xord[m]>"9")or@|
+ (xord[n]<"0")or(xord[n]>"9") then
+ bad_pool('! ', pool_name, ' line doesn''t begin with two digits.');
+@.TEX.POOL line doesn't...@>
+ l:=xord[m]*10+xord[n]-"0"*11; {compute the length}
+ if pool_ptr+l+string_vacancies>pool_size then
+ bad_pool('! You have to increase POOLSIZE.');
+@.You have to increase POOLSIZE@>
+ for k:=1 to l do
+ begin if eoln(pool_file) then m:=' '@+else read(pool_file,m);
+ append_char(xord[m]);
+ end;
+ read_ln(pool_file); g:=make_string;
+ end;
+end
+
+@ The \.{WEB} operation \.{@@\$} denotes the value that should be at the
+end of this \.{TEX.POOL} file; any other value means that the wrong pool
+file has been loaded.
+@^check sum@>
+
+@<Check the pool check sum@>=
+begin a:=0; k:=1;
+loop@+ begin if (xord[n]<"0")or(xord[n]>"9") then
+ bad_pool('! ', pool_name, ' check sum doesn''t have nine digits.');
+@.TEX.POOL check sum...@>
+ a:=10*a+xord[n]-"0";
+ if k=9 then goto done;
+ incr(k); read(pool_file,n);
+ end;
+done: if a<>@$ then
+ bad_pool('! ', pool_name, ' doesn''t match; tangle me again (or fix the path).');
+@.TEX.POOL doesn't match@>
+c:=true;
+end
+@y
+@ @<Read the other strings...@>=
+ g := loadpoolstrings((pool_size-string_vacancies));
+ if g=0 then begin
+ wake_up_terminal; write_ln(term_out,'! You have to increase POOLSIZE.');
+ get_strings_started:=false;
+ return;
+ end;
+ get_strings_started:=true;
+
+@ Empty module
+
+@ Empty module
+@z
diff --git a/Build/source/texk/web2c/etexdir/etex.mk b/Build/source/texk/web2c/etexdir/etex.mk
index 592094f7ff8..b9115935be6 100644
--- a/Build/source/texk/web2c/etexdir/etex.mk
+++ b/Build/source/texk/web2c/etexdir/etex.mk
@@ -14,7 +14,7 @@ etexdir/etex.version: etexdir/etex.ch
# The C sources.
etex_c = etexini.c etex0.c etex1.c etex2.c
-etex_o = etexini.o etex0.o etex1.o etex2.o etexextra.o
+etex_o = etexini.o etex0.o etex1.o etex2.o etex-pool.o etexextra.o
# Making etex.
etex: $(etex_o)
@@ -44,13 +44,17 @@ etex_ch_srcs = etex.web \
$(srcdir)/etexdir/tex.ch0 \
$(srcdir)/tex.ch \
$(srcdir)/etexdir/tex.ch1 \
- $(srcdir)/etexdir/tex.ech
+ $(srcdir)/etexdir/tex.ech \
+ $(srcdir)/etexdir/etex-binpool.ch
# Rules:
etex.web: tie etexdir/etex.mk $(etex_web_srcs)
$(TIE) -m etex.web $(etex_web_srcs)
etex.ch: $(etex_ch_srcs)
$(TIE) -c etex.ch $(etex_ch_srcs)
+etex-pool.c: etex.pool tex-mkcpool tmf-pool.h
+ ./tex-mkcpool etex.pool tmf-pool.h >etex-pool.c
+
# Tests...
check: @ETEX@ etex-check
etex-check: etrip etex.fmt
@@ -186,7 +190,7 @@ latex.fmt: etex
# Install
install-etex: install-etex-exec install-etex-data
install-etex-exec: install-etex-programs install-etex-links
-install-etex-data: install-etex-pool @FMU@ install-etex-dumps
+install-etex-data: @FMU@ install-etex-dumps
install-etex-dumps: install-etex-fmts
install-programs: @ETEX@ install-etex-programs
@@ -207,7 +211,5 @@ install-etex-fmts: efmts $(efmtdir)
(cd $(bindir) && (rm -f $$base; $(LN) etex $$base)); done
install-data:: @ETEX@ install-etex-data
-install-etex-pool: etex.pool $(texpooldir)
- $(INSTALL_DATA) etex.pool $(texpooldir)/etex.pool
# end of etex.mk