Debian Codegraph @

texk/web2c/alephdir/comocp.ch

raw
1 % comcop.ch: Local adaptations for file omocp.ch
2 %
3 % This file is part of the Omega project, which
4 % is based on the web2c distribution of TeX.
5 %
6 % Copyright (c) 1994--2000 John Plaice and Yannis Haralambous
7 %
8 % This library is free software; you can redistribute it and/or
9 % modify it under the terms of the GNU Library General Public
10 % License as published by the Free Software Foundation; either
11 % version 2 of the License, or (at your option) any later version.
12 %
13 % This library 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 GNU
16 % Library General Public License for more details.
17 %
18 % You should have received a copy of the GNU Library General Public
19 % License along with this library; if not, write to the Free Software
20 % Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 %
22 %---------------------------------------
23 @x
24 @!inf_hyph_size = iinf_hyphen_size; {Must be not less than |hyph_prime|!}
25 @y
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;
29 @z
30 %---------------------------------------
31 @x
32 @!max_print_line:integer;
33 {width of longest text lines output; should be at least 60}
34 @y
35 @!max_print_line:integer;
36 {width of longest text lines output; should be at least 60}
37 @!ocp_list_size:integer;
38 @z
39 %---------------------------------------
40 @x
41 if not b_open_in(ocp_file) then ocp_abort("opening file");
42 @y
43 if not ocp_open_in(ocp_file) then ocp_abort("opening file");
44 @z
45 %---------------------------------------
46 @x
47 @d ocpget==get(ocp_file)
48 @d ocpbyte==ocp_file^
49 @y
50 @d ocpget==ocp_temp:=getc(ocp_file)
51 @d ocpbyte==ocp_temp
52 @z
53 %---------------------------------------
54 @x
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;
65 @y
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;
76 @z
77 %---------------------------------------
78 @x
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]);
85 print_nl("\ocplist");
86 print_esc(ocp_list_id_text(k));
87 print_char("=");
88 print_ocp_list(ocp_list_list[k]);
89 end;
90 dump_int(ocp_lstackmem_ptr);
91 for k:=0 to ocp_lstackmem_ptr-1 do dump_wd(ocp_lstack_info[k])
92 @y
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
99 print_nl("\ocplist");
100 print_esc(ocp_list_id_text(k));
101 print_char("=");
102 print_ocp_list(ocp_list_list[k]);
103 end;
104 dump_int(ocp_lstackmem_ptr);
105 dump_things(ocp_lstack_info[0], ocp_lstackmem_ptr)
106 @z
107 %---------------------------------------
108 @x
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])
117 @y
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)
125 @z
126 %---------------------------------------
127 @x
128 setup_bound_var (79)('max_print_line')(max_print_line);
129 @y
130 setup_bound_var (79)('max_print_line')(max_print_line);
131 setup_bound_var(1000)('ocp_list_size')(ocp_list_size);
132 @z
133 %---------------------------------------
134 @x
135 hyph_link:=xmalloc_array (hyph_pointer, hyph_size);
136 @y
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);
141 @z