summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2012-02-05 10:37:29 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2012-02-05 10:37:29 +0000
commit6e57e84ceabd402c094912da764ffd338646aa14 (patch)
tree68e308487697127f015216285e7db1228a7cf113
parentee1615182e9cd048ae1571e9362495d17339aa4d (diff)
VFtoVP: Allow arbitrarily large TFM files (as in TFtoPL)
OVF2OVP: Allow arbitrarily large OFM files OPL2OFM, OVP2OVF: Build fix for MinGW git-svn-id: svn://tug.org/texlive/trunk@25291 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/texk/texlive/linked_scripts/Makefile.am4
-rw-r--r--Build/source/texk/web2c/ChangeLog4
-rw-r--r--Build/source/texk/web2c/omegaware/ChangeLog7
-rw-r--r--Build/source/texk/web2c/omegaware/opl2ofm.ch8
-rw-r--r--Build/source/texk/web2c/omegaware/ovf2ovp.ch44
-rw-r--r--Build/source/texk/web2c/omegaware/ovp2ovf.ch8
-rw-r--r--Build/source/texk/web2c/vftovp.ch38
7 files changed, 104 insertions, 9 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/Makefile.am b/Build/source/texk/texlive/linked_scripts/Makefile.am
index 98908a4fb65..3fbb7c176fc 100644
--- a/Build/source/texk/texlive/linked_scripts/Makefile.am
+++ b/Build/source/texk/texlive/linked_scripts/Makefile.am
@@ -206,6 +206,8 @@ else !WIN32
echo "creating link '$$link' -> '$$file'"; \
$(LN_S) $$file $$link || exit 1; \
done && \
+## man dir link for those mans which can use it, but don't overwrite a
+## real file, e.g., /usr/bin/man.
if test -d "$$REL/texmf/doc/man" \
&& test -z "$(TL_INSTALL_OMIT_MAN_LINK)" \
&& (test -h man || test ! -e man); then \
@@ -213,8 +215,6 @@ else !WIN32
rm -f man; \
(ln -s "$$REL/texmf/doc/man" man || :); \
else :; fi
-## man dir link for those mans which can use it, but don't overwrite a
-## real file, e.g., /usr/bin/man.
endif !WIN32
.PHONY: install-links
diff --git a/Build/source/texk/web2c/ChangeLog b/Build/source/texk/web2c/ChangeLog
index 1134c60a997..9bfd0594720 100644
--- a/Build/source/texk/web2c/ChangeLog
+++ b/Build/source/texk/web2c/ChangeLog
@@ -1,3 +1,7 @@
+2012-02-04 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * vftovp.ch: Allow arbitrarily large TFM files as in TFtoPL.
+
2012-02-01 Peter Breitenlohner <peb@mppmu.mpg.de>
* tex.ch, gftodvi.ch: Ensure dvi file size < 2GB.
diff --git a/Build/source/texk/web2c/omegaware/ChangeLog b/Build/source/texk/web2c/omegaware/ChangeLog
index ab8c9ad0af3..9e9b7640f2e 100644
--- a/Build/source/texk/web2c/omegaware/ChangeLog
+++ b/Build/source/texk/web2c/omegaware/ChangeLog
@@ -1,3 +1,10 @@
+2012-02-04 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * ovf2ovp.ch: Allow arbitrarily large TFM files as in TFtoPL.
+
+ * opl2ofm.ch, ovp2ovf.ch: Avoid name conflict; MinGW defines
+ `byte' in <rpcndr.h>.
+
2012-02-01 Peter Breitenlohner <peb@mppmu.mpg.de>
* ofm2opl.web, ovf2ovp.web: Both nl and lig_size are in words,
diff --git a/Build/source/texk/web2c/omegaware/opl2ofm.ch b/Build/source/texk/web2c/omegaware/opl2ofm.ch
index a330baa7138..72ebcf928e3 100644
--- a/Build/source/texk/web2c/omegaware/opl2ofm.ch
+++ b/Build/source/texk/web2c/omegaware/opl2ofm.ch
@@ -73,6 +73,14 @@ packed file of bytes. It's no problem in C.
rewritebin (tfm_file, tfm_name);
@z
+@x [17] Avoid name conflict; MinGW defines `byte' in <rpcndr.h>.
+correspond to one-character constants like \.{"A"} in \.{WEB} language.
+@y
+correspond to one-character constants like \.{"A"} in \.{WEB} language.
+
+@d byte == byte_type
+@z
+
@x [18] Pascal Web's char
@d first_ord=0 {ordinal number of the smallest element of |char|}
@y
diff --git a/Build/source/texk/web2c/omegaware/ovf2ovp.ch b/Build/source/texk/web2c/omegaware/ovf2ovp.ch
index caead6f17b3..70523958741 100644
--- a/Build/source/texk/web2c/omegaware/ovf2ovp.ch
+++ b/Build/source/texk/web2c/omegaware/ovf2ovp.ch
@@ -17,6 +17,18 @@
%\def\title{VF$\,$\lowercase{to}$\,$VP changes for C}
@z
+% [2] We need to tell web2c about one special variable.
+% Perhaps it would be better to allow @define's
+% anywhere in a source file, but that seemed just as painful as this.
+@x
+@p program OVF2OVP(@!vf_file,@!tfm_file,@!vpl_file,@!output);
+@y
+@p
+{Tangle doesn't recognize @@ when it's right after the \.=.}
+@\@= @@define var tfm;@>@\
+program OVF2OVP(@!vf_file,@!tfm_file,@!vpl_file,@!output);
+@z
+
@x still [2] Set up for path reading.
procedure initialize; {this procedure gets things started properly}
var @!k:integer; {all-purpose index for initialization}
@@ -28,6 +40,9 @@ procedure initialize; {this procedure gets things started properly}
begin
kpse_set_program_name (argv[0], nil);
kpse_init_prog ('VFTOVP', 0, nil, nil);
+ {We |xrealloc| when we know how big the file is. The 1000 comes
+ from the negative lower bound.}
+ tfm_file_array := cast_to_byte_pointer (xmalloc (1009));
parse_arguments;
@z
@@ -41,6 +56,11 @@ procedure initialize; {this procedure gets things started properly}
@<Constants...@>=
@z
+@x [4] Drop unused constant.
+@!tfm_size=2000000; {maximum length of |tfm| data, in bytes}
+@y
+@z
+
@x
@!name_length=50; {a file name shouldn't be longer than this}
@y
@@ -91,18 +111,26 @@ end else begin
end;
@z
-% [24] `index' is not a good choice of identifier in C.
-@x
+@x [23] `index' is not a good choice of identifier in C.
@<Types...@>=
@!index=0..tfm_size; {address of a byte in |tfm|}
@y
@d index == index_type
@<Types...@>=
-@!index=0..tfm_size; {address of a byte in |tfm|}
+@!index=integer; {address of a byte in |tfm|}
+@z
+
+@x [24] Make |tfm| be dynamically allocated.
+@!tfm:array [-1000..tfm_size] of byte; {the input data all goes here}
+@y
+{Kludge here to define |tfm| as a macro which takes care of the negative
+ lower bound. We've defined |tfm| for the benefit of web2c above.}
+@=#define tfm (tfmfilearray + 1001);@>@\
+@!tfm_file_array: pointer_to_byte; {the input data all goes here}
@z
-% [24] abort() should cause a bad exit code.
+% [25] abort() should cause a bad exit code.
@x
@d abort(#)==begin print_ln(#);
print_ln('Sorry, but I can''t go on; are you sure this is a OFM?');
@@ -115,6 +143,14 @@ end;
end
@z
+@x [25] Allow arbitrarily large input files.
+if 4*lf-1>tfm_size then abort('The file is bigger than I can handle!');
+@.The file is bigger...@>
+@y
+tfm_file_array
+ := cast_to_byte_pointer (xrealloc (tfm_file_array, 4 * lf - 1 + 1002));
+@z
+
% [31] Ditto for vf_abort.
@x
@d vf_abort(#)==begin
diff --git a/Build/source/texk/web2c/omegaware/ovp2ovf.ch b/Build/source/texk/web2c/omegaware/ovp2ovf.ch
index 8b92bef3cb0..f390a4780ec 100644
--- a/Build/source/texk/web2c/omegaware/ovp2ovf.ch
+++ b/Build/source/texk/web2c/omegaware/ovp2ovf.ch
@@ -63,6 +63,14 @@ rewritebin (vf_file, vf_name);
rewritebin (tfm_file, tfm_name);
@z
+@x [23] Avoid name conflict; MinGW defines `byte' in <rpcndr.h>.
+correspond to one-character constants like \.{"A"} in \.{WEB} language.
+@y
+correspond to one-character constants like \.{"A"} in \.{WEB} language.
+
+@d byte == byte_type
+@z
+
@x [24] Pascal Web's char
@d first_ord=0 {ordinal number of the smallest element of |char|}
@y
diff --git a/Build/source/texk/web2c/vftovp.ch b/Build/source/texk/web2c/vftovp.ch
index 309cf825ae4..1dc20d184e4 100644
--- a/Build/source/texk/web2c/vftovp.ch
+++ b/Build/source/texk/web2c/vftovp.ch
@@ -19,6 +19,19 @@
@d print_real(#)==fprint_real(stderr,#)
@z
+% [2] We need to tell web2c about one special variable.
+% Perhaps it would be better to allow @define's
+% anywhere in a source file, but that seemed just as painful as this.
+@x
+@p program VFtoVP(@!vf_file,@!tfm_file,@!vpl_file,@!output);
+@y
+@p
+{Tangle doesn't recognize @@ when it's right after the \.=.}
+@\@= @@define var tfm;@>@\
+
+program VFtoVP(@!vf_file,@!tfm_file,@!vpl_file,@!output);
+@z
+
@x still [2] Set up for path reading.
procedure initialize; {this procedure gets things started properly}
var @!k:integer; {all-purpose index for initialization}
@@ -30,6 +43,9 @@ procedure initialize; {this procedure gets things started properly}
begin
kpse_set_program_name (argv[0], nil);
kpse_init_prog ('VFTOVP', 0, nil, nil);
+ {We |xrealloc| when we know how big the file is. The 1000 comes
+ from the negative lower bound.}
+ tfm_file_array := cast_to_byte_pointer (xmalloc (1003));
parse_arguments;
@z
@@ -50,7 +66,6 @@ procedure initialize; {this procedure gets things started properly}
@y
@d class == class_var
@<Constants...@>=
-@!tfm_size=150000; {maximum length of |tfm| data, in bytes}
@!vf_size=100000; {maximum length of |vf| data, in bytes}
@!max_fonts=300; {maximum number of local fonts in the |vf| file}
@!lig_size=32510; {maximum length of |lig_kern| program, in words}
@@ -100,7 +115,7 @@ end else begin
end;
@z
-% [24] `index' is not a good choice of identifier in C.
+% [22] `index' is not a good choice of identifier in C.
@x
@<Types...@>=
@!index=0..tfm_size; {address of a byte in |tfm|}
@@ -108,7 +123,16 @@ end;
@d index == index_type
@<Types...@>=
-@!index=0..tfm_size; {address of a byte in |tfm|}
+@!index=integer; {address of a byte in |tfm|}
+@z
+
+@x [23] Make |tfm| be dynamically allocated.
+@!tfm:array [-1000..tfm_size] of byte; {the \.{TFM} input data all goes here}
+@y
+{Kludge here to define |tfm| as a macro which takes care of the negative
+ lower bound. We've defined |tfm| for the benefit of web2c above.}
+@=#define tfm (tfmfilearray + 1001);@>@\
+@!tfm_file_array: pointer_to_byte; {the input data all goes here}
@z
% [24] abort() should cause a bad exit code.
@@ -124,6 +148,14 @@ end;
end
@z
+@x [24] Allow arbitrarily large input files.
+if 4*lf-1>tfm_size then abort('The file is bigger than I can handle!');
+@.The file is bigger...@>
+@y
+tfm_file_array
+ := cast_to_byte_pointer (xrealloc (tfm_file_array, 4 * lf - 1 + 1002));
+@z
+
% [25] Both nl and lig_size are in words, so the multiplication is not
% needed. Found by "C.M. Connelly" <c@eskimo.com> and
% Melissa O'Neill <oneill@cs.sfu.ca>