% Change file for the VPtoVF processor, for use on Berkeley UNIX systems. % This file based on PLtoTF.ch by Pavel Curtis, Pavel@Cornell. % History: % 12/14/89 (don) Initial version % 4/26/90 (don) Up to version 1.1 % 9/6/90 (don) Up to version 1.2 % 3/25/91 (don) Up to version 1.3 % 3/6/95 (don) Up to version 1.4 % 8/8/98 (don) Up to version 1.5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [0] WEAVE: print changes only %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x \pageno=\contentspagenumber \advance\pageno by 1 @y \pageno=\contentspagenumber \advance\pageno by 1 \let\maybe=\iffalse \def\title{VP\lowercase{to}VF changes for SunOS} @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [1] Change banner string %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x @d banner=='This is VPtoVF, Version 1.5' {printed when the program starts} @y @d banner=='This is VPtoVF, Version 1.5 for SunOS' {printed when the program starts} @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [2] Fix filenames in program statement; add `final_end' label; add access %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x @p program VPtoVF(@!vpl_file,@!vf_file,@!tfm_file,@!output); const @@/ type @@/ var @@/ @y @d final_end==9999 @p program VPtoVF(@!output); label final_end; const @@/ type UNIX_file_name=packed array[1..100] of char; @@/ var @@/ function testreadaccess(var fn:UNIX_file_name):boolean; external; @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [6] Open VPL file %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x reset(vpl_file); @y if argc < 4 then begin print_ln('Usage: vptovf '); goto final_end; end; argv(1, vpl_name); if testreadaccess(vpl_name) then reset(vpl_file, vpl_name) else begin print_ln('I can''t read the VPL file!'); goto final_end; end; @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [21] Change type of output files and declare extra binary-file variables %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x @!vf_file:packed file of 0..255; @!tfm_file:packed file of 0..255; @y @!vf_file, @!tfm_file : packed file of -128..127; @!tmp : 0..255; @!vf_name, @!tfm_name, @!vpl_name : UNIX_file_name; @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [22] Open output files %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x @ On some systems you may have to do something special to write a packed file of bytes. For example, the following code didn't work when it was first tried at Stanford, because packed files have to be opened with a special switch setting on the \PASCAL\ that was used. @^system dependencies@> @= rewrite(vf_file); rewrite(tfm_file); @y @ On some systems you may have to do something special to write a packed file of bytes. @^system dependencies@> @= argv(2, vf_name); argv(3, tfm_name); rewrite(vf_file, vf_name); rewrite(tfm_file, tfm_name); @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [156] Change TFM-byte output to fix ranges %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x @d out(#)==write(tfm_file,#) @y @d out(#)==begin tmp := #; if tmp > 127 then write(tfm_file, tmp - 256) else write(tfm_file, tmp) end @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [175] Change VF-byte output to fix ranges %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x @d vout(#)==write(vf_file,#) @y @d vout(#)==begin tmp := #; if tmp > 127 then write(vf_file, tmp - 256) else write(vf_file, tmp) end @z %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % [181] Define label `final_end'; print newline at end of program %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @x end. @y final_end: print_ln(' '); end. @z