%  This TOPS-20 change file for GFTYPE was written by Tomas Rokicki.
%  Send bug reports to ROKICKI@SU-SCORE.

@x [2]
\pageno=\contentspagenumber \advance\pageno by 1
@y
\pageno=\contentspagenumber \advance\pageno by 1
\let\maybe=\iffalse
\def\ttw{{\mc TOPS-20}}
\def\title{GFtype changes for \ttw}
@z

@x [3]
@d banner=='This is GFtype, Version 2.2' {printed when the program starts}
@y
@d banner=='This is GFtype, Version 2.2' {printed when the program starts}
@z

@x [6]
@d print(#)==write(#)
@d print_ln(#)==write_ln(#)
@d print_nl==write_ln
@y
@d print(#)==write(tty,#)
@d print_ln(#)==write_ln(tty,#)
@d print_nl==write_ln(tty)
@z

@x [6]
@p program GF_type(@!gf_file,@!output);
@y
@p program GF_type;
@z

@x
@<Constants...@>=
@!terminal_line_length=150; {maximum number of characters input in a single
  line of input from the terminal}
@!line_length=79; {\\{xxx} strings will not produce lines longer than this}
@!max_row=79; {vertical extent of pixel image array}
@!max_col=79; {horizontal extent of pixel image array}
@y
@<Constants...@>=
@!terminal_line_length=150; {maximum number of characters input in a single
  line of input from the terminal}
@!line_length=79; {\\{xxx} strings will not produce lines longer than this}
@!max_row=79; {vertical extent of pixel image array}
@!max_col=79; {horizontal extent of pixel image array}
@!name_length=80; {maximum length of a name}
@z

@x [52]
begin reset(gf_file);
@y
begin reset(gf_file,gf_name,'/O/B:8');
if eof(gf_file) then abort('GF file does not exist!');
@z

@x [53]
@!cur_loc:integer; {where we are about to look, in |gf_file|}
@y
@!cur_loc:integer; {where we are about to look, in |gf_file|}
@!gf_name:packed array[1..name_length] of char;
@z

@x [57]
into the |buffer| array. The |term_in| file is used for terminal input,
and |term_out| for terminal output.
@^system dependencies@>

@<Glob...@>=
@!buffer:array[0..terminal_line_length] of ASCII_code;
@!term_in:text_file; {the terminal, considered as an input file}
@!term_out:text_file; {the terminal, considered as an output file}
@y
into the |buffer| array.  The |tty| file is used for terminal input and
terminal output.

@d term_in==tty {the terminal, considered as an input file}
@d term_out==tty {the terminal, considered as an output file}

@<Glob...@>=
@!buffer:array[0..terminal_line_length] of ASCII_code;
@z

@x [59]
begin update_terminal; reset(term_in);
@y
begin update_terminal;
@z

@x [61]
begin rewrite(term_out); {prepare the terminal for output}
write_ln(term_out,banner);@/
@y
begin
  print('GF file name:  ');
  read_ln(tty,gf_name);
@z