@x @d banner=='This is TIE, Version 1.3' @y @d banner=='This is TIE, Version 1.3 (MUNIX changes by THD/ITI)' @z @x @!max_name_length=54; {adapt this to your local name space} @y @!max_name_length=120; {adapt this to your local name space} @z @x @!ascii_code=0..127; {seven-bit numbers, a subrange of the integers} @y @!ascii_code=packed 0..127; @z @x @!text_file=packed file of text_char; @y @!text_file=text; @z @x xchr["\"]:='\'; @y xchr["\"]:='\\'; @z @x for i:=1 to @'37 do xchr[i]:=' '; @y for i:=1 to @'37 do xchr[i]:=' '; xchr[tab_mark]:=chr(tab_mark); @z @x reset(term_in,'TTY:','/I') @y reset(term_in,'/dev/tty') @z @x rewrite(term_out,'TTY:'); @y rewrite(term_out,'/dev/tty'); @z @x @d update_terminal == break(term_out) {empty the terminal output buffer} @y @d update_terminal == write_ln(term_out) {empty the terminal output buffer} @z Delete definition of |get_line|. Replace by procedure. @x @d get_line(#)==get_ln_from_file(#,input_files[#]); @y @z Add the definition now @x exit: end; @y exit: end; procedure get_line(i:file_index);@/ begin case i of 0 : get_ln_from_file(0,infile0); 1 : get_ln_from_file(1,infile1); 2 : get_ln_from_file(2,infile2); 3 : get_ln_from_file(3,infile3); 4 : get_ln_from_file(4,infile4); 5 : get_ln_from_file(5,infile5); 6 : get_ln_from_file(6,infile6); 7 : get_ln_from_file(7,infile7); 8 : get_ln_from_file(8,infile8); 9 : get_ln_from_file(9,infile9); end; end; @z @x @!input_files: array[0..max_file_index] of text_file; @y @!infile0,@!infile1,@!infile2,@!infile3,@!infile4,@!infile5:text_file; @!infile6,@!infile7,@!infile8,@!infile9:text_file; @z @x @ We continue with a function to open a text file. Success is indicated by a boolean result. We assume that empty files can be handled like non existent ones. @^system dependencies@> @p function file_open(var f:text_file;name:name_type):boolean; begin reset(f,name.name); file_open:=not eof(f); end; @y @ We continue with a function to open a text file. Success is indicated by a boolean result. We assume that empty files can be handled like non existent ones. @^system dependencies@> We use a special function to determine missing files. @p function lookop(var n:string):integer; externc; function file_open(var f:text_file;name:name_type):boolean;@/ var curname:string; begin curname:=con@&vert(name.name,string); if lookop(curname)=1 then begin reset(f,curname); file_open:=not eof(f); end else file_open:=false; end; @z @x for i:=1 to max_name_length do name_of_file.name[i]:=' '; for i:=1 to prefix.nam_len do name_of_file.name[i]:=prefix.name[i]; for i:=1 to extension.nam_len do name_of_file.name[prefix.nam_len+i]:=extension.name[i]; @y for i:=1 to prefix.nam_len do name_of_file.name[i]:=prefix.name[i]; for i:=1 to extension.nam_len do name_of_file.name[prefix.nam_len+i]:=extension.name[i]; name_of_file.name[prefix.nam_len+extension.nam_len+1]:=chr(0); @z @x if not file_open(input_files[0],input_organization[0].name_of_file) then @y if not file_open(infile0,input_organization[0].name_of_file) then @z @x procedure open_input; {prepare to read |input_files|} label done; var i:integer; @y procedure open_input; {prepare to read |input_files|} label done; var i:integer; b:boolean; @z @x if not file_open(input_files[no_ch], input_organization[no_ch].name_of_file) @y case no_ch of 1: b:=file_open(infile1,input_organization[1].name_of_file); 2: b:=file_open(infile2,input_organization[2].name_of_file); 3: b:=file_open(infile3,input_organization[3].name_of_file); 4: b:=file_open(infile4,input_organization[4].name_of_file); 5: b:=file_open(infile5,input_organization[5].name_of_file); 6: b:=file_open(infile6,input_organization[6].name_of_file); 7: b:=file_open(infile7,input_organization[7].name_of_file); 8: b:=file_open(infile8,input_organization[8].name_of_file); 9: b:=file_open(infile9,input_organization[9].name_of_file); end; if not b @z @x cf_ext.name[1]:='.'; cf_ext.name[2]:='C'; cf_ext.name[3]:='F'; cf_ext.name[4]:=' '; cf_ext.nam_len:=4; for i:=cf_ext.nam_len+1 to max_name_length do cf_ext.name[i]:=' '; @y cf_ext.name[1]:='.'; cf_ext.name[2]:='c'; cf_ext.name[3]:='f'; cf_ext.name[4]:=' '; cf_ext.name[5]:=chr(0); cf_ext.nam_len:=4; @z @x {here files should be closed if the operating system requires it} @y {here files should be closed if the operating system requires it} {terminate with return code} halt(history); @z