home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 45
/
Amiga_Dream_45.iso
/
Amiga
/
Magazine
/
Dossier-LaTeX
/
AmiWeb2C.lha
/
source
/
web2c-6.1
/
web2c
/
mpware
/
dvitomp.chch
< prev
next >
Wrap
Text File
|
1995-04-10
|
6KB
|
194 lines
Changes for DVITOMP.CH by Andreas Scherer, April 10, 1995.
@x l.48
@d banner=='% Written by DVItoMP, C Version 0.63'
@y
@d banner=='% Written by DVItoMP, C Version 0.63'
@d amiga==ifdef('_AMIGA')
@d agima==endif('_AMIGA')
@z
@x l.57
@p program DVI_to_MP;
@y
@p program DVI_to_MP;
amiga@;
@=#include "dvitomp.version";@>
agima@;
@z
@x l.63
begin setpaths; {read environment, to find TEXFONTS, if there}
@y
begin set_paths(TFM_FILE_PATH_BIT + VF_FILE_PATH_BIT);
{read environment, to find TEXFONTS, if there}
@z
@x l.73
@!name_length=FILENAMESIZE; {a file name shouldn't be longer than this}
@y
@!name_length=PATH_MAX; {a file name shouldn't be longer than this}
@z
Replace Web2C 5.581 by Web2C 6.1. There is no |test_access|, only
|test_read_access|, and the parameters are different. If there's a problem
in opening the output file for writing, this will be made clear by the
operating system (`Resource busy' or the like).
@x l.127
In C we retrieve the file name from the command line and use an external
|test_access| procedure to detect any problems so that we can issue
appropriate error messages. This procedure takes the file name from
the global variable |cur_name|. It has two other arguments that we
shall use later on to control path searching for input files.
@^system dependencies@>
@d write_access_mode=2 {``write'' mode for |test_access|}
@d no_file_path=0 {no path searching should be done}
@p procedure test_usage;
begin if argc<>3 then
begin err_print_ln('Usage: dvitomp <dvi-file> <mpx-file>');
jump_out;
end;
end;
@#
procedure open_mpx_file; {prepares to write text on |mpx_file|}
begin test_usage;
argv(2,cur_name);
if test_access(write_access_mode,no_file_path) then
rewrite(mpx_file, real_name_of_file)
else abort('Cannot write on the mpx file');
end;
@y
In C we retrieve the file name from the command line.
@^system dependencies@>
@p procedure test_usage;
begin if argc<>3 then
begin err_print_ln('Usage: dvitomp <dvi-file> <mpx-file>');
jump_out;
end;
end;
@#
procedure open_mpx_file; {prepares to write text on |mpx_file|}
begin test_usage;
argv(2,cur_name);
rewrite(mpx_file, cur_name);
end;
@z
@x l.176
specifies the file name. In C, we test the success of this operation by
first using the external |test_access| function, which also does path
searching based on the user's environment or the default path.
@^system dependencies@>
@d read_access_mode=4 {``read'' mode for |test_access|}
@d font_file_path=3 {path specifier for \.{TFM} files}
@d vf_file_path=12 {path specifier for \.{VF} files}
@p procedure open_dvi_file; {prepares to read packed bytes in |dvi_file|}
begin test_usage;
argv(1, cur_name);
if test_access(read_access_mode,no_file_path) then
reset(dvi_file, real_name_of_file)
else abort('DVI file not found');
end;
@#
function open_tfm_file:boolean; {prepares to read packed bytes in |tfm_file|}
var @!ok:boolean;
begin ok:=test_access(read_access_mode,font_file_path);
if ok then reset(tfm_file,real_name_of_file);
open_tfm_file:=ok;
end;
@#
function open_vf_file:boolean; {prepares to read packed bytes in |tfm_file|}
var @!ok:boolean;
begin ok:=test_access(read_access_mode,vf_file_path);
if ok then reset(vf_file,real_name_of_file);
open_vf_file:=ok;
end;
@y
specifies the file name. In C, we test the success of this operation by
first using the external |test_read_access| function, which also does path
searching based on the user's environment or the default path.
@^system dependencies@>
@p procedure open_dvi_file; {prepares to read packed bytes in |dvi_file|}
begin test_usage;
argv (toint(1), cur_name);
reset (dvi_file, cur_name);
end;
@z
@x l.1056 of DVITOMP.WEB
if open_vf_file then did_it:=in_VF(f);
@y
if test_read_access (cur_name, VF_FILE_PATH)
then begin
reset (vf_file, cur_name);
did_it:=in_VF(f);
end;
@z
@x l.1059 of DVITOMP.WEB
if not open_tfm_file then font_abort('No TFM file found for ')(f);
@.no TFM file found@>
did_it:=in_TFM(f);
@y
if test_read_access (cur_name, TFM_FILE_PATH)
then begin
reset (tfm_file, cur_name);
@.no TFM file found@>
did_it:=in_TFM(f);
end else font_abort('No TFM file found for ')(f);
@z
John Hobby had his own |print_real| routine, which wrote to |mpxfile|
automatically. Web2C 6.1 writes to |stdout|. Redirect the output.
@x l.326
print_real(m,1,5); print(',');
print_real(x,1,4); print(',');
print_real(y,1,4);
@y
f_print_real(mpxfile,m,1,5); print(',');
f_print_real(mpxfile,x,1,4); print(',');
f_print_real(mpxfile,y,1,4);
@z
@x l.346
print_real(xx1,1,4); print(',');
print_real(yy1,1,4); print(')..(');
print_real(xx2,1,4); print(',');
print_real(yy2,1,4); print('), ');
print_real(ww,1,4);
@y
f_print_real(mpxfile,xx1,1,4); print(',');
f_print_real(mpxfile,yy1,1,4); print(')..(');
f_print_real(mpxfile,xx2,1,4); print(',');
f_print_real(mpxfile,yy2,1,4); print('), ');
f_print_real(mpxfile,ww,1,4);
@z
@x l.362
print_real(dd,1,4); print(')--(');
print_real(w,1,4); print(',');
print_real(dd,1,4); print_ln(')--');@/
print(' (');
print_real(w,1,4); print(',');
print_real(h,1,4); print(')--(0,');
print_real(h,1,4); print_ln(')--cycle;');
@y
f_print_real(mpxfile,dd,1,4); print(')--(');
f_print_real(mpxfile,w,1,4); print(',');
f_print_real(mpxfile,dd,1,4); print_ln(')--');@/
print(' (');
f_print_real(mpxfile,w,1,4); print(',');
f_print_real(mpxfile,h,1,4); print(')--(0,');
f_print_real(mpxfile,h,1,4); print_ln(')--cycle;');
@z