summaryrefslogtreecommitdiff
path: root/dviware/crudetype/version3/pro-pas.ch
blob: 18032db59ac5132219d6fd85cf2ac3022fb9baad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
% pro-pas.ch -*-mode: change; webfile: crudetype.web version 3.01;-*-
% Attempted changefile for PRO-pascal for MS-DOS, RMD.
% Doesnt work; unfortunately the disgnostics of pro-pascal are so vague
% that I cannot tell what is wrong
%
% COPYRIGHT ( C ) R.M.Damerell,1990
%
% This may be distributed on the same terms as the main Crudetype program.
%
% 1. All copies of the software must carry an exact copy of this notice.
%
% 2. This software is distributed free of charge, "AS IS" with absolutely no
% guarantee of performance. Any persons receiving or using this software must do
% so entirely at their own risk. Neither the authors nor their institutions
% accept any liability for any defects of this software, or for any consequential
% loss or damage however caused.
%
% 3. Any person who changes this software must clearly mark it as modified and
% add a note describing the changes made.
%

% WEAVE: print changes only
@x  Module 0; Lines 42 -- 42
\pageno=\contentspagenumber \advance\pageno by 1
@y
\pageno=\contentspagenumber \advance\pageno by 1
\def\title{Crudetype for {\mc MS-Dos }  }
@z

@x  Module 4; Lines 213 -- 213
@d banner=='This is Crudetype, Version 3.01, copyright, experimental'
@y
@d banner=='This is Crudetype, Version 3.01, copyright, experimental MS-DOS'
@z

@x  Module 5; Lines 234 -- 234
  var @<Globals in the outer block@>
@y
  common @<Common variables@>
  var @<Globals in the outer block@>
@z

@x  Module 11; Lines 312 -- 312
  i_word = -max_half-1 .. max_half ;
@y
  i_word = -max_half-1 .. max_half ;
  var_str_type = string[100];
@z

@x  Module 12; Lines 334 -- 334
@d Q_string == packed array[ first..last:integer] of char
@y
@d Q_string == var_str_type
@d first = 1
@d last == length( ss)
@z

@x  Module 14; Lines 360 -- 361
@<Lowest...@>=
  {Declare |parse_file|}
@y
@<Lowest...@>=
  procedure  parse_file( name: var_string; var dir, nam, ex: var_string) ;
  var p,r,s: s_ptr ;
  begin
    dir := blank; nam := blank; ex := blank;
    s := name.len ;
    if ( s>0) then begin
      p := s_search( name, '\', -s);
      if ( p>0) then substring( dir, name, 1, p) ;
      r := s_search( name, '.', -s);
      if ( r>p) then substring( ex, name, r, s-r+1)
      else r := s +1 ;
      substring( nam, name, p+1, r-p-1) ;
    end;
  end;
@z

% Mess-DOS filenames
% lower case file names, default to putting the .lpr file in the
% same directory as the .dvi file
@x  Module 18; Lines 433 -- 435
  be_string( '.DVI' ) ; dvi_def := buffer ;
  be_string( 'TEX$FONTS:.TFM' ) ; tfm_def := buffer ;
  be_string( 'TEX$GF:.&DGF' ) ; raster_def := buffer ;
@y
  be_string( '.DVI' ) ; dvi_def := buffer ;
  be_string( 'TEX\FONTS\' ) ; tfm_def := buffer ;
  be_string( 'TEX\GFDIR\.&DGF' ) ; raster_def := buffer ;
@z

@x  Module 19; Lines 442 -- 443
@<Lowest...@>=
  {Declare |open_binary|}
@y

@d close_binary(#)== do_nothing ;

@<Lowest...@>=
  function open_binary (var f_f: byte_file; name: var_string ): boolean;
  begin
    if fstat( name.data) then
    begin
      assign (f_f, name.data);
      reset( f_f) ;
      open_binary := true
    end
    else
    open_binary := false
  end;
@z

@x  Module 20; Lines 446 -- 446
  rewrite(printfile) ;
@y
  if inspection then
  assign(printfile, 'CON' )
  else assign(printfile, print_name.data ) ;
  rewrite(printfile ) ;
@z

@x  Module 21; Lines 453 -- 455
@d prefix == "/"
@d got_cl == ( command.len > 0)
@d read_command_line( #) == do_nothing
@y
@d prefix == "-"
@d got_cl == ( command.len > 0)
@d read_command_line( #) == getcomm( #)
@z

@x  Module 22; Lines 468 -- 477
@ Here are macros for the adaptable merge sort. See the section on sorting for
explanation.

@d image(#) == pool[#]
@d create == incr(cell)
@d link_type == page_i
@d first_cell == cell := 0
@d wipe_out(#) ==
@d declare_pool ==  pool: array [page_i] of page_record;
@d garbage == cell := zzz ;
@y
@ Here are macros for the adaptable merge sort. See the section on sorting for
explanation. Pro-Pascal craps out on large arrays.

@d image(#) == #^
@d create == new(cell)
@d first_cell == do_nothing
@d link_type == ^page_record
@d wipe_out(#) == dispose(#) ; { release data piecemeal}
@d garbage == do_nothing
@d declare_pool == do_nothing
@z

% Binary file types.
@x  Module 33; Lines 675 -- 676
  @!byte_block=packed array [0..block_length-1] of byte ;
  @!byte_file= packed file of byte_block;
@y
  @!byte_file= packed file of byte;
@z

@x  Module 38; Lines 753 -- 758
        read_byte := f_file^[f_indx] ;
        incr(f_indx);
        if f_indx =block_length then begin
            get(f_file );
            f_indx:=0;
          end;
@y
        read_byte := f_file^ ;
        incr(f_indx);
        get(f_file );
@z

@x  Module 38; Lines 768 -- 773
    while( f_indx >= block_length) do
      begin
        if eof(f_file) then
          warn('End of file' )
        else get(f_file );
        f_indx := f_indx - block_length ;
@y
    while( n > 0) do
      begin
        if eof(f_file) then
          warn('End of file' )
        else get(f_file );
        decr(n) ;
@z

@x  Module 98; Lines 1696 -- 1698
@ @<Glob...@>=
  ligatures : array[1..max_ligs] of lig_thing;
  top_of_ligs: 0..max_ligs ; {highest used point in |ligatures|}
@y
@ @<Common...@>=
  ligatures : array[1..max_ligs] of lig_thing;
  top_of_ligs: 0..max_ligs ; {highest used point in |ligatures|}
@z