| 1 |
% ovp2ovf.up. Public domain. |
| 2 |
% |
| 3 |
% Allow character codes up to "10FFFF. |
| 4 |
|
| 5 |
@x [3] Increase constants. |
| 6 |
@d char_max=@"FFFF |
| 7 |
@y |
| 8 |
@d char_max=@"10FFFF |
| 9 |
@z |
| 10 |
@x [3] Increase constants. |
| 11 |
@!vf_size=200000; {maximum length of |vf| data, in bytes} |
| 12 |
@y |
| 13 |
@!vf_size=800000; {maximum length of |vf| data, in bytes} |
| 14 |
@z |
| 15 |
|
| 16 |
@x [60] |
| 17 |
@p function get_byte:byte; {scans a one-byte property value} |
| 18 |
@y |
| 19 |
We have to distinguish between character codes that may exceed |@"FFFF| |
| 20 |
and those that are store in one |byte| and thus must not exceed |@"FFFF|. |
| 21 |
|
| 22 |
@p function get_char_code:integer; {scans a character code value} |
| 23 |
@z |
| 24 |
@x [60] |
| 25 |
cur_char:=" "; get_byte:=acc; |
| 26 |
@y |
| 27 |
cur_char:=" "; get_char_code:=acc; |
| 28 |
end; |
| 29 |
@# |
| 30 |
function get_byte:integer; {scans a one-byte property value} |
| 31 |
var acc:integer; {an accumulator} |
| 32 |
begin acc:=get_char_code; |
| 33 |
if acc>@"FFFF then begin |
| 34 |
skip_error('This value shouldn''t exceed "FFFF'); |
| 35 |
@.This value shouldn't...@> |
| 36 |
acc:=0; cur_char:=" "; |
| 37 |
end; |
| 38 |
get_byte:=acc; |
| 39 |
@z |
| 40 |
@x [62] |
| 41 |
begin skip_error('This value shouldn''t exceed 65535'); |
| 42 |
@y |
| 43 |
begin skip_error('This value shouldn''t exceed 1114111'); |
| 44 |
@z |
| 45 |
@x [63] |
| 46 |
begin skip_error('This value shouldn''t exceed ''177777'); |
| 47 |
@y |
| 48 |
begin skip_error('This value shouldn''t exceed ''4177777'); |
| 49 |
@z |
| 50 |
@x [64] |
| 51 |
begin skip_error('This value shouldn''t exceed "FFFF'); |
| 52 |
@y |
| 53 |
begin skip_error('This value shouldn''t exceed "10FFFF'); |
| 54 |
@z |
| 55 |
|
| 56 |
@x [80] |
| 57 |
for k:=256 to max_char do packet_length[k]:=3; |
| 58 |
@y |
| 59 |
for k:=256 to @"FFFF do packet_length[k]:=3; |
| 60 |
for k:=@"10000 to max_char do packet_length[k]:=4; |
| 61 |
@z |
| 62 |
|
| 63 |
@x [112] |
| 64 |
else begin backup; c:=get_byte; |
| 65 |
@y |
| 66 |
else begin backup; c:=get_char_code; |
| 67 |
@z |
| 68 |
|
| 69 |
@x [120] |
| 70 |
@ @<Read an extended label step@>= |
| 71 |
begin c:=get_byte; |
| 72 |
@y |
| 73 |
@ @<Read an extended label step@>= |
| 74 |
begin c:=get_char_code; |
| 75 |
@z |
| 76 |
|
| 77 |
@x [130] |
| 78 |
c:=get_byte; {read the character code that is being specified} |
| 79 |
@y |
| 80 |
c:=get_char_code; {read the character code that is being specified} |
| 81 |
@z |
| 82 |
|
| 83 |
@x [133] |
| 84 |
c:=get_byte; {read the character code that is being specified} |
| 85 |
@y |
| 86 |
c:=get_char_code; {read the character code that is being specified} |
| 87 |
@z |
| 88 |
|
| 89 |
@x [148] |
| 90 |
procedure read_packet(@!c:byte); |
| 91 |
@y |
| 92 |
procedure read_packet(@!c:integer); |
| 93 |
@z |
| 94 |
|
| 95 |
@x [151] |
| 96 |
else begin cc:=get_byte; |
| 97 |
@y |
| 98 |
else begin cc:=get_char_code; |
| 99 |
@z |
| 100 |
|
| 101 |
@x [188] |
| 102 |
while (not diff) and (cprime<=ec) do begin |
| 103 |
@y |
| 104 |
while (not diff) and (cprime<=ec) and (cprime-c<@"10000) do begin |
| 105 |
@z |