1
% comcop.ch: Local adaptations for file omocp.ch
3
% This file is part of Omega,
4
% which is based on the web2c distribution of TeX,
6
% Copyright (c) 1994--2001 John Plaice and Yannis Haralambous
8
% Omega is free software; you can redistribute it and/or modify
9
% it under the terms of the GNU General Public License as published by
10
% the Free Software Foundation; either version 2 of the License, or
11
% (at your option) any later version.
13
% Omega is distributed in the hope that it will be useful,
14
% but WITHOUT ANY WARRANTY; without even the implied warranty of
15
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
% GNU General Public License for more details.
18
% You should have received a copy of the GNU General Public License
19
% along with Omega; if not, write to the Free Software Foundation, Inc.,
20
% 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
22
%---------------------------------------
24
@!inf_hyph_size = iinf_hyphen_size; {Must be not less than |hyph_prime|!}
26
@!inf_hyph_size = iinf_hyphen_size; {Must be not less than |hyph_prime|!}
27
@!sup_ocp_list_size = 1000000;
28
@!inf_ocp_list_size = 1000;
30
%---------------------------------------
32
@!max_print_line:integer;
33
{width of longest text lines output; should be at least 60}
35
@!max_print_line:integer;
36
{width of longest text lines output; should be at least 60}
37
@!ocp_list_size:integer;
39
%---------------------------------------
41
if not b_open_in(ocp_file) then ocp_abort("opening file");
43
if not ocp_open_in(ocp_file) then ocp_abort("opening file");
45
%---------------------------------------
47
@d ocpget==get(ocp_file)
50
@d ocpget==ocp_temp:=getc(ocp_file)
53
%---------------------------------------
55
@!ocp_list_info:array[ocp_list_index] of memory_word;
56
{the big collection of ocp list data}
57
@!ocp_listmem_ptr:ocp_list_index; {first unused word of |ocp_list_info|}
58
@!ocp_listmem_run_ptr:ocp_list_index; {temp unused word of |ocp_list_info|}
59
@!ocp_lstack_info:array[ocp_lstack_index] of memory_word;
60
{the big collection of ocp lstack data}
61
@!ocp_lstackmem_ptr:ocp_lstack_index; {first unused word of |ocp_lstack_info|}
62
@!ocp_lstackmem_run_ptr:ocp_lstack_index; {temp unused word of |ocp_lstack_info|}
63
@!ocp_list_ptr:internal_ocp_list_number; {largest internal ocp list number in use}
64
@!ocp_list_list:array[internal_ocp_list_number] of ocp_list_index;
66
@!ocp_list_info:^memory_word;
67
{the big collection of ocp list data}
68
@!ocp_listmem_ptr:ocp_list_index; {first unused word of |ocp_list_info|}
69
@!ocp_listmem_run_ptr:ocp_list_index; {temp unused word of |ocp_list_info|}
70
@!ocp_lstack_info:^memory_word;
71
{the big collection of ocp lstack data}
72
@!ocp_lstackmem_ptr:ocp_lstack_index; {first unused word of |ocp_lstack_info|}
73
@!ocp_lstackmem_run_ptr:ocp_lstack_index; {temp unused word of |ocp_lstack_info|}
74
@!ocp_list_ptr:internal_ocp_list_number; {largest internal ocp list number in use}
75
@!ocp_list_list:^ocp_list_index;
77
%---------------------------------------
79
@ @<Dump the ocp list information@>=
80
dump_int(ocp_listmem_ptr);
81
for k:=0 to ocp_listmem_ptr-1 do dump_wd(ocp_list_info[k]);
82
dump_int(ocp_list_ptr);
83
for k:=null_ocp_list to ocp_list_ptr do begin
84
dump_int(ocp_list_list[k]);
86
print_esc(ocp_list_id_text(k));
88
print_ocp_list(ocp_list_list[k]);
90
dump_int(ocp_lstackmem_ptr);
91
for k:=0 to ocp_lstackmem_ptr-1 do dump_wd(ocp_lstack_info[k])
93
@ @<Dump the ocp list information@>=
94
dump_int(ocp_listmem_ptr);
95
dump_things(ocp_list_info[0], ocp_listmem_ptr);
96
dump_int(ocp_list_ptr);
97
dump_things(ocp_list_list[null_ocp_list], ocp_list_ptr+1-null_ocp_list);
98
for k:=null_ocp_list to ocp_list_ptr do begin
100
print_esc(ocp_list_id_text(k));
102
print_ocp_list(ocp_list_list[k]);
104
dump_int(ocp_lstackmem_ptr);
105
dump_things(ocp_lstack_info[0], ocp_lstackmem_ptr)
107
%---------------------------------------
109
@ @<Undump the ocp list information@>=
110
undump_size(1)(1000000)('ocp list mem size')(ocp_listmem_ptr);
111
for k:=0 to ocp_listmem_ptr-1 do undump_wd(ocp_list_info[k]);
112
undump_size(ocp_list_base)(ocp_list_biggest)('ocp list max')(ocp_list_ptr);
113
for k:=null_ocp_list to ocp_list_ptr do
114
undump_int(ocp_list_list[k]);
115
undump_size(1)(1000000)('ocp lstack mem size')(ocp_lstackmem_ptr);
116
for k:=0 to ocp_lstackmem_ptr-1 do undump_wd(ocp_lstack_info[k])
118
@ @<Undump the ocp list information@>=
119
undump_size(1)(1000000)('ocp list mem size')(ocp_listmem_ptr);
120
undump_things(ocp_list_info[0], ocp_listmem_ptr);
121
undump_size(0)(1000000)('ocp list max')(ocp_list_ptr);
122
undump_things(ocp_list_list[null_ocp_list], ocp_list_ptr+1-null_ocp_list);
123
undump_size(0)(1000000)('ocp lstack mem size')(ocp_lstackmem_ptr);
124
undump_things(ocp_lstack_info[0], ocp_lstackmem_ptr)
126
%---------------------------------------
128
setup_bound_var (79)('max_print_line')(max_print_line);
130
setup_bound_var (79)('max_print_line')(max_print_line);
131
setup_bound_var(1000)('ocp_list_size')(ocp_list_size);
133
%---------------------------------------
135
hyph_link:=xmalloc_array (hyph_pointer, hyph_size);
137
hyph_link:=xmalloc_array (hyph_pointer, hyph_size);
138
ocp_list_info:=xmalloc_array (memory_word, ocp_list_size);
139
ocp_lstack_info:=xmalloc_array (memory_word, ocp_list_size);
140
ocp_list_list:=xmalloc_array (ocp_list_index, ocp_list_size);