From 6e57e84ceabd402c094912da764ffd338646aa14 Mon Sep 17 00:00:00 2001 From: Peter Breitenlohner Date: Sun, 5 Feb 2012 10:37:29 +0000 Subject: 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 --- Build/source/texk/web2c/omegaware/ChangeLog | 7 +++++ Build/source/texk/web2c/omegaware/opl2ofm.ch | 8 +++++ Build/source/texk/web2c/omegaware/ovf2ovp.ch | 44 +++++++++++++++++++++++++--- Build/source/texk/web2c/omegaware/ovp2ovf.ch | 8 +++++ 4 files changed, 63 insertions(+), 4 deletions(-) (limited to 'Build/source/texk/web2c/omegaware') 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 + + * ovf2ovp.ch: Allow arbitrarily large TFM files as in TFtoPL. + + * opl2ofm.ch, ovp2ovf.ch: Avoid name conflict; MinGW defines + `byte' in . + 2012-02-01 Peter Breitenlohner * 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 . +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} @= @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. @= @!index=0..tfm_size; {address of a byte in |tfm|} @y @d index == index_type @= -@!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 . +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 -- cgit v1.2.3