OSDN Git Service

clean
[putex/putex.git] / src / texsourc / itex.c
1 /* Copyright 1992 Karl Berry
2    Copyright 2007 TeX Users Group
3    Copyright 2014 Clerk Ma
4
5    This program is free software; you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation; either version 2 of the License, or
8    (at your option) any later version.
9
10    This program is distributed in the hope that it will be useful, but
11    WITHOUT ANY WARRANTY; without even the implied warranty of
12    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13    General Public License for more details.
14
15    You should have received a copy of the GNU General Public License
16    along with this program; if not, write to the Free Software
17    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18    02110-1301 USA.  */
19
20 #ifdef _WINDOWS
21   #define NOCOMM
22   #define NOSOUND
23   #define NODRIVERS
24   #define STRICT
25   #pragma warning(disable:4115) // kill rpcasync.h complaint
26   #include <windows.h>
27   #define MYLIBAPI __declspec(dllexport)
28 #endif
29
30 #include "texwin.h"
31
32 #pragma warning(disable:4996)
33 #pragma warning(disable:4131) // old style declarator
34 #pragma warning(disable:4135) // conversion between different integral types
35 #pragma warning(disable:4127) // conditional expression is constant
36
37 #include <setjmp.h>
38
39 #define EXTERN extern
40
41 #include "texd.h"
42
43 #pragma warning(disable:4244) /* 96/Jan/10 */
44
45 #include <time.h>
46
47 #define BEGINFMTCHECKSUM 367403084L
48 #define ENDFMTCHECKSUM   69069L
49
50 extern clock_t start_time, main_time, finish_time; /* in local.c */
51
52 /* imported from pascal.h */
53 /* localized here to avoid conflict with io.h in other code */
54
55 #define read(f, b) ((b) = getc (f))
56 #define readln(f) { register int c; while ((c = getc (f)) != '\n' && c != EOF); }
57
58 #ifdef INITEX
59   void do_initex (void); /* later in this file */
60 #endif
61
62 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
63
64 void initialize (void)
65 {
66   integer i; 
67   integer k; 
68   integer flag; /* bkph */
69 #ifndef ALLOCATEHYPHEN
70   hyph_pointer z;
71 #endif
72
73 /* We already initialized xchr if we are using non_ascii setup */
74
75   if (!non_ascii) {
76 /* Normally, there is no translation of character code numbers */
77     for (i = 0; i <= 255; i++) xchr[i] = (char) i;
78 /* This is a kind of joke, since the characters are given as numeric codes ! */
79 #ifdef JOKE
80     xchr[32] = ' ';  xchr[33] = '!';  xchr[34] = '"';  xchr[35] = '#';
81     xchr[36] = '$';  xchr[37] = '%';  xchr[38] = '&';  xchr[39] = '\'';
82     xchr[40] = '(';  xchr[41] = ')';  xchr[42] = '*';  xchr[43] = '+';
83     xchr[44] = ',';  xchr[45] = '-';  xchr[46] = '.';  xchr[47] = '/';
84     xchr[48] = '0';  xchr[49] = '1';  xchr[50] = '2';  xchr[51] = '3';
85     xchr[52] = '4';  xchr[53] = '5';  xchr[54] = '6';  xchr[55] = '7';
86     xchr[56] = '8';  xchr[57] = '9';  xchr[58] = ':';  xchr[59] = ';';
87     xchr[60] = '<';  xchr[61] = '=';  xchr[62] = '>';  xchr[63] = '?';
88     xchr[64] = '@';  xchr[65] = 'A';  xchr[66] = 'B';  xchr[67] = 'C';
89     xchr[68] = 'D';  xchr[69] = 'E';  xchr[70] = 'F';  xchr[71] = 'G';
90     xchr[72] = 'H';  xchr[73] = 'I';  xchr[74] = 'J';  xchr[75] = 'K';
91     xchr[76] = 'L';  xchr[77] = 'M';  xchr[78] = 'N';  xchr[79] = 'O';
92     xchr[80] = 'P';  xchr[81] = 'Q';  xchr[82] = 'R';  xchr[83] = 'S';
93     xchr[84] = 'T';  xchr[85] = 'U';  xchr[86] = 'V';  xchr[87] = 'W';
94     xchr[88] = 'X';  xchr[89] = 'Y';  xchr[90] = 'Z';  xchr[91] = '[';
95     xchr[92] = '\\'; xchr[93] = ']';  xchr[94] = '^';  xchr[95] = '_';
96     xchr[96] = '`';  xchr[97] = 'a';  xchr[98] = 'b';  xchr[99] = 'c';
97     xchr[100] = 'd'; xchr[101] = 'e'; xchr[102] = 'f'; xchr[103] = 'g';
98     xchr[104] = 'h'; xchr[105] = 'i'; xchr[106] = 'j'; xchr[107] = 'k';
99     xchr[108] = 'l'; xchr[109] = 'm'; xchr[110] = 'n'; xchr[111] = 'o';
100     xchr[112] = 'p'; xchr[113] = 'q'; xchr[114] = 'r'; xchr[115] = 's';
101     xchr[116] = 't'; xchr[117] = 'u'; xchr[118] = 'v'; xchr[119] = 'w';
102     xchr[120] = 'x'; xchr[121] = 'y'; xchr[122] = 'z'; xchr[123] = '{';
103     xchr[124] = '|'; xchr[125] = '}'; xchr[126] = '~';
104
105     for (i = 0; i <= 31; i++) xchr[i] = chr(i);
106
107     for (i = 127; i <= 255; i++) xchr[i]= chr(i);
108 #endif /* end of JOKE */
109   }
110 /* end of plain ASCII case (otherwise have read in xchr vector before) */
111 /* Fill in background of `delete' for inverse mapping */
112   for (i = 0; i <= 255; i++) xord[chr(i)] = 127;
113 #ifdef JOKE
114   for (i = 128; i <= 255 ; i++) xord[xchr[i]] = i;
115
116   for (i = 0; i <= 126; i++) xord[xchr[i]] = i;
117 #endif
118   
119 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
120 /* Now invert the xchr mapping to get xord mapping */
121   for (i = 0; i <= 255; i++) xord[xchr[i]] = (char) i;
122
123   xord[127] = 127; /* hmm, a fixed point ? why ? */
124
125   flag = 0; /* 93/Dec/28 - bkph */
126
127   if (trace_flag != 0)
128   {
129     for (k = 0; k < 256; k++) /*  entries in xord / xchr */
130       if (xord[k] != k)
131       {
132         flag = 1;
133         break;
134       }
135     if (flag)
136     { /* 127 here means mapping undefined */
137       show_line("Inverted mapping xord[] pairs:\n", 0);
138       for (k = 0; k < 256; k++)
139       {/*  entries in xord / xchr */
140         if (xord[k] != 127)
141         {
142           sprintf(log_line, "%d => %d\n", k, xord[k]);
143           show_line(log_line, 0);
144         }
145       }
146     }
147   }
148   if (interaction < 0) /* may now set in local.c bkph */
149 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
150     interaction = error_stop_mode;
151   deletions_allowed = true;
152   set_box_allowed = true;
153   error_count = 0;
154   help_ptr = 0;
155   use_err_help = false;
156   interrupt = 0;
157   OK_to_interrupt = true;
158   ;
159 /* darn, need to know mem_top, mem_max etc for the following ... */
160 #ifdef DEBUG
161   was_mem_end = mem_min;
162 /*  was_lo_max = mem_min; */
163   was_lo_max = mem_bot;
164 /*  was_hi_min = mem_max; */
165   was_hi_min = mem_top;
166   panicking = false;
167 #endif /* DEBUG */
168   nest_ptr = 0;
169   max_nest_stack = 0;
170   mode = 1;
171   head = contrib_head;
172   tail = contrib_head; 
173   cur_list.aux_field.cint = ignore_depth;
174   mode_line = 0;
175   prev_graf = 0;
176   shown_mode = 0;
177   page_contents = 0;
178   page_tail = page_head;
179 #ifdef ALLOCATEMAIN
180   if (is_initex) /* in iniTeX we did already allocate mem [] */
181 #endif
182     mem[page_head].hh.v.RH = 0;
183 /*  last_glue = 262143L;  */ /* NO! */
184   last_glue = empty_flag;
185   last_penalty = 0;
186   last_kern = 0;
187   page_so_far[7] = 0;
188   page_max_depth = 0;
189   for (k = int_base; k <= eqtb_size; k++) xeq_level[k] = 1;
190   no_new_control_sequence = true; 
191   hash[514].v.LH = 0; /* next(hash_base):= 0 */
192   hash[514].v.RH = 0; /* text(hash_base):= 0 */
193 /* 514 + hash_size + 266 = hashbase + hashsize + 10 + font_max  */
194 /* for k <- hashbase+1 to undefined_control_sequence - 1 do ... p.257 */
195   for (k = hash_base + 1; k <= undefined_control_sequence - 1; k++) hash[k] = hash[hash_base];
196   save_ptr = 0;
197   cur_level = 1;
198   cur_group = 0;
199   cur_boundary = 0;
200   max_save_stack = 0;
201   mag_set = 0;
202   cur_mark[0] = 0;
203   cur_mark[1] = 0;
204   cur_mark[2] = 0;
205   cur_mark[3] = 0;
206   cur_mark[4] = 0;
207   cur_val = 0;
208   cur_val_level = 0;
209   radix = 0;
210   cur_order = 0;
211   for (k = 0; k <= 16; k++) read_open[k] = 2;
212   cond_ptr = 0;
213   if_limit = 0;
214   cur_if = 0;
215   if_line = 0;
216   for (k = 0; k <= font_max; k++) font_used[k] = false;
217   null_character.b0 = 0;
218   null_character.b1 = 0;
219   null_character.b2 = 0;
220   null_character.b3 = 0;
221   total_pages = 0;
222   max_v = 0;
223   max_h = 0;
224   max_push = 0;
225   last_bop = -1;
226   doing_leaders = false;
227   dead_cycles = 0;
228   cur_s = -1;
229   half_buf = dvi_buf_size / 2;
230   dvi_limit = dvi_buf_size;
231   dvi_ptr = 0;
232   dvi_offset = 0;
233   dvi_gone = 0;
234 /* down_ptr:=null; right_ptr:=null; l.12027 */
235   down_ptr = 0;
236   right_ptr = 0;
237   adjust_tail = 0;
238   last_badness = 0;
239   pack_begin_line = 0;
240   empty_field.v.RH = 0;
241   empty_field.v.LH = 0;
242   null_delimiter.b0 = 0;
243   null_delimiter.b1 = 0;
244   null_delimiter.b2 = 0;
245   null_delimiter.b3 = 0;
246   align_ptr = 0;
247   cur_align = 0;
248   cur_span = 0;
249   cur_loop = 0;
250   cur_head = 0;
251   cur_tail = 0;
252 /*  *not* OK with ALLOCATEHYPHEN, since may not be allocated yet */
253 #ifndef ALLOCATEHYPHEN
254 /*  {register integer for_end; z = 0; for_end = 607; if (z <= for_end) do */
255   for (z = 0; z <= hyphen_prime; z++)
256   {
257     hyph_word[z]= 0;
258     hyph_list[z]= 0;
259   }
260 #endif
261   hyph_count = 0;
262   output_active = false;
263   insert_penalties = 0;
264   ligature_present = false;
265   cancel_boundary = false;
266   lft_hit = false;
267   rt_hit = false;
268   ins_disc = false;
269   after_token = 0;
270   long_help_seen = false;
271   format_ident = 0;
272   for (k = 0; k <= 17; k++)
273     write_open[k] = false;
274   edit_name_start = 0;
275   ;
276 #ifdef INITEX
277 /* initex stuff split off for convenience of optimization adjustments */
278   if (is_initex)
279   {
280     do_initex();
281   }
282 #else
283 /* trap the -i on command line situation if INITEX was NOT defined */
284   if (is_initex)
285   {
286     show_line("Sorry, somebody forgot to make an INITEX!\n", 1);
287   }
288 #endif /* not INITEX */
289
290
291 /* do the part of initialize() that requires mem_top, mem_max or mem[] */
292 /* do this part after allocating main memory */
293
294 #ifdef ALLOCATEMAIN
295 void initialize_aux (void)
296 {
297 #ifdef DEBUG
298   was_mem_end = mem_min;
299 /*  was_lo_max = mem_min; */
300   was_lo_max = mem_bot;
301 /*  was_hi_min = mem_max;  */
302   was_hi_min = mem_top;
303   panicking = false;
304 #endif /* DEBUG */
305 /*  nest_ptr = 0; */
306 /*  max_nest_stack = 0; */
307   mode = 1;
308   head = contrib_head;
309   tail = contrib_head;
310   cur_list.aux_field.cint = ignore_depth;
311   mode_line = 0;
312   prev_graf = 0;
313 /*  shown_mode = 0;  */
314 /*  page_contents = 0;  */
315   page_tail = page_head;
316   //mem[mem_top - 2].hh.v.RH = 0;
317   link(page_head) = 0;
318 }
319 #endif  // end of ifdef ALLOCATEMAIN
320
321 void line_break_ (integer finalwidowpenalty)
322 {
323   bool autobreaking;
324   halfword prevp;
325   halfword q, r, s, prevs;
326   internal_font_number f;
327 /*  small_number j;  */
328   int j;                /* 95/Jan/7 */
329 /*  unsigned char c;  */
330   unsigned int c;           /* 95/Jan/7 */
331 /*  savedbadness = 0; */        /* 96/Feb/9 */
332   pack_begin_line = mode_line;
333   mem[temp_head].hh.v.RH = link(head);
334   if ((tail >= hi_mem_min))
335   {
336     link(tail) = new_penalty(10000);
337     tail = link(tail);
338   } 
339   else if (mem[tail].hh.b0 != 10)
340   {
341     link(tail) = new_penalty(10000);
342     tail = link(tail);
343   }
344   else
345   {
346     type(tail) = 12;
347     delete_glue_ref(mem[tail + 1].hh.v.LH);
348     flush_node_list(mem[tail + 1].hh.v.RH);
349     mem[tail + 1].cint = 10000;
350   }
351   link(tail) = new_param_glue(par_fill_skip_code);
352 /* *********************************************************************** */
353 /* following is new in 3.14159 */
354   init_cur_lang = prev_graf % 65536L;
355   init_l_hyf = prev_graf / 4194304L; /* 2^22 */
356   init_r_hyf = (prev_graf / 65536L)% 64;
357 /* *********************************************************************** */
358   pop_nest();
359   noshrinkerroryet = true;
360   if ((mem[eqtb[(hash_size + 789)].hh.v.RH].hh.b1 != 0) &&
361       (mem[eqtb[(hash_size + 789)].hh.v.RH + 3].cint != 0))
362   {
363     eqtb[(hash_size + 789)].hh.v.RH = finite_shrink(eqtb[(hash_size + 789)].hh.v.RH);
364   }
365   if ((mem[eqtb[(hash_size + 790)].hh.v.RH].hh.b1 != 0) &&
366       (mem[eqtb[(hash_size + 790)].hh.v.RH + 3].cint != 0))
367   {
368     eqtb[(hash_size + 790)].hh.v.RH = finite_shrink(eqtb[(hash_size + 790)].hh.v.RH);
369   }
370   q = eqtb[(hash_size + 789)].hh.v.RH;
371   r = eqtb[(hash_size + 790)].hh.v.RH;
372   background[1] = mem[q + 1].cint + mem[r + 1].cint;
373   background[2] = 0;
374   background[3] = 0;
375   background[4] = 0;
376   background[5] = 0;
377   background[2 + mem[q].hh.b0] = mem[q + 2].cint;
378   background[2 + mem[r].hh.b0] = background[2 + mem[r].hh.b0] + mem[r + 2].cint;
379   background[6] = mem[q + 3].cint + mem[r + 3].cint;
380   minimum_demerits = 1073741823L; /* 2^30 - 1 *//* 40000000 hex - 1 */
381   minimal_demerits[3] = 1073741823L;
382   minimal_demerits[2] = 1073741823L;
383   minimal_demerits[1] = 1073741823L;
384   minimal_demerits[0] = 1073741823L;
385   if (par_shape_ptr == 0)
386   if (hang_indent == 0)
387   {
388     last_special_line = 0; 
389     second_width = hsize; 
390     second_indent = 0; 
391   } 
392   else
393   {
394     last_special_line = abs(hang_after);
395     if (hang_after < 0)
396     {
397       first_width = hsize - abs(hang_indent);
398       if (hang_indent >= 0)
399       first_indent = hang_indent;
400       else first_indent = 0;
401       second_width = hsize;
402       second_indent = 0;
403     } else {
404       first_width = hsize;
405       first_indent = 0;
406       second_width = hsize - abs(hang_indent);
407       if (hang_indent >= 0)
408         second_indent = hang_indent;
409       else second_indent = 0;
410     }
411   }
412   else {
413     last_special_line = mem[par_shape_ptr].hh.v.LH - 1;
414     second_width = mem[par_shape_ptr + 2 *(last_special_line + 1)].cint;
415     second_indent = mem[par_shape_ptr + 2 * last_special_line + 1].cint;
416   }
417 /* if looseness=0 then easy_line:=last_special_line */
418   if (looseness == 0)
419   easyline = last_special_line;
420 /*  else easyline = 262143L;  */ /* NO! */
421   else easyline = empty_flag;
422 /* threshold:=pretolerance; */
423   threshold = pretolerance;
424   if (threshold >= 0)
425   {
426   ;
427 #ifdef STAT
428 /*   if tracing_paragraphs>0 then */
429     if (tracing_paragraphs > 0)
430     {
431       begin_diagnostic(); 
432       print_nl("@firstpass");
433     } 
434 #endif /* STAT */
435     second_pass = false; 
436     final_pass = false; 
437   first_pass_count++;         /* 96 Feb 9 */
438   } 
439   else {
440 /*  threshold:=tolerance; second_pass:=true; */      
441     threshold = tolerance; 
442     second_pass = true; 
443 /*   final_pass:=(emergency_stretch<=0); */
444     final_pass =(emergency_stretch <= 0); 
445   ;
446 #ifdef STAT
447     if (tracing_paragraphs > 0)
448     begin_diagnostic(); 
449 #endif /* STAT */
450   } 
451   while(true){
452 /*  if threshold>inf_bad then threshold:=inf_bad; */
453     if (threshold > 10000)
454     threshold = 10000; 
455     if (second_pass)
456     {
457   ;
458 #ifdef INITEX
459   if (is_initex)  { /* bkph */
460       if (trie_not_ready)init_trie(); 
461   }         /* bkph */
462 #endif /* INITEX */
463 /* ********************************************************************* */
464 /* following has changed in 3.14159 */
465 /*      cur_lang = 0;  */
466       cur_lang = init_cur_lang; 
467 /*      lhyf = cur_list .lhmfield; */
468       lhyf = init_l_hyf; 
469 /*      rhyf = cur_list .rhmfield;  */
470       rhyf = init_r_hyf; 
471 /* ********************************************************************* */
472     } 
473     q = get_node(3); 
474     mem[q].hh.b0 = 0; 
475     mem[q].hh.b1 = 2; 
476     mem[q].hh.v.RH = active; 
477     mem[q + 1].hh.v.RH = 0; 
478     mem[q + 1].hh.v.LH = prev_graf + 1; 
479     mem[q + 2].cint = 0; 
480     mem[active].hh.v.RH = q; 
481     active_width[1] = background[1]; 
482     active_width[2] = background[2]; 
483     active_width[3] = background[3]; 
484     active_width[4] = background[4]; 
485     active_width[5] = background[5]; 
486     active_width[6] = background[6]; 
487 /*  passive:=null; printed_node:=temp_head; pass_number:=0; */
488     passive = 0; 
489     printed_node = temp_head; 
490     pass_number = 0; 
491     font_in_short_display = 0; 
492     cur_p = mem[temp_head].hh.v.RH; 
493     autobreaking = true; 
494     prevp = cur_p; 
495 /*  while (cur_p<>null)and(link(active)<>last_active) do */
496     while((cur_p != 0)&&(mem[active].hh.v.RH != active)) 
497     {
498       if ((cur_p >= hi_mem_min)) 
499       {
500   prevp = cur_p; 
501   do {
502       f = mem[cur_p].hh.b0; 
503     active_width[1]= active_width[1]+ font_info[width_base[f]+ 
504     font_info[char_base[f]+ mem[cur_p].hh.b1].qqqq.b0].cint 
505   ; 
506     cur_p = mem[cur_p].hh.v.RH; 
507   } while(!(!(cur_p >= hi_mem_min))); 
508       } 
509       switch(mem[cur_p].hh.b0)
510       {case 0 : 
511       case 1 : 
512       case 2 : 
513   active_width[1]= active_width[1]+ mem[cur_p + 1].cint; 
514   break; 
515       case 8 : 
516   if (mem[cur_p].hh.b1 == 4)
517   {
518     cur_lang = mem[cur_p + 1].hh.v.RH;  /* ASCII_code */
519     lhyf = mem[cur_p + 1].hh.b0; 
520     rhyf = mem[cur_p + 1].hh.b1; 
521   } 
522   break; 
523       case 10 : 
524   {
525     if (autobreaking)
526     {
527       if ((prevp >= hi_mem_min)) 
528       try_break(0, 0); 
529       else if ((mem[prevp].hh.b0 < 9)) 
530       try_break(0, 0); 
531 /* *********************************************************************** */
532 /* following is new in 3.14159 */
533       else if ((mem[prevp].hh.b0 == 11)&&(mem[prevp].hh.b1 
534       != 1)) 
535       try_break(0, 0); 
536 /* *********************************************************************** */
537     } 
538     if ((mem[mem[cur_p + 1].hh.v.LH].hh.b1 != 0)&&(mem[
539     mem[cur_p + 1].hh.v.LH + 3].cint != 0)) 
540     {
541       mem[cur_p + 1].hh.v.LH = finite_shrink(mem[cur_p + 1].hh.v.LH); 
542     } 
543     q = mem[cur_p + 1].hh.v.LH; 
544     active_width[1]= active_width[1]+ mem[q + 1].cint; 
545     active_width[2 + mem[q].hh.b0]= active_width[2 + mem[q]
546     .hh.b0]+ mem[q + 2].cint; 
547     active_width[6]= active_width[6]+ mem[q + 3].cint; 
548     if (second_pass && autobreaking)
549     {
550       prevs = cur_p; 
551       s = mem[prevs].hh.v.RH; 
552       if (s != 0)
553       {
554         while(true){
555     if ((s >= hi_mem_min)) 
556     {
557       c = mem[s].hh.b1; 
558       hf = mem[s].hh.b0; 
559     } 
560     else if (mem[s].hh.b0 == 6)
561     if (mem[s + 1].hh.v.RH == 0)
562     goto lab22; 
563     else {
564         
565       q = mem[s + 1].hh.v.RH; 
566       c = mem[q].hh.b1; 
567       hf = mem[q].hh.b0; 
568     } 
569     else if ((mem[s].hh.b0 == 11)&&(mem[s].hh.b1 == 
570     0)) 
571     goto lab22; 
572     else if (mem[s].hh.b0 == 8)
573     {
574       if (mem[s].hh.b1 == 4)
575       {
576         cur_lang = mem[s + 1].hh.v.RH;  /* ASCII_code */
577         lhyf = mem[s + 1].hh.b0; 
578         rhyf = mem[s + 1].hh.b1; 
579       } 
580       goto lab22; 
581     } 
582     else goto lab31; 
583     if (eqtb[(hash_size + 2139) + c].hh.v.RH != 0)
584 /*    signed unsigned mismatch ? (c is unsigned) */
585     if ((eqtb[(hash_size + 2139) + c].hh.v.RH == c)|| 
586       (uc_hyph > 0)) 
587     goto lab32; 
588     else goto lab31; 
589     lab22: prevs = s; 
590     s = mem[prevs].hh.v.RH; 
591         } 
592         lab32: hyf_char = hyphen_char[hf]; 
593 /* if hyf_char<0 then goto done1; */
594         if (hyf_char < 0) goto lab31; 
595 /* if hyf_char>255 then goto done1; */
596         if (hyf_char > 255) goto lab31; /* ? */
597         ha = prevs; 
598         if (lhyf + rhyf > 63) goto lab31; 
599         hn = 0; 
600         while(true){
601     if ((s >= hi_mem_min)) {
602       if (mem[s].hh.b0 != hf)
603       goto lab33; 
604       hyfbchar = mem[s].hh.b1; 
605       c = hyfbchar;     /*  unsigned char c;  */
606       if (eqtb[(hash_size + 2139) + c].hh.v.RH == 0)
607       goto lab33; 
608       if (hn == 63)
609       goto lab33; 
610       hb = s; 
611       incr(hn); 
612       hu[hn]= c; 
613 /*      long to short ... */
614       hc[hn]= eqtb[(hash_size + 2139) + c].hh.v.RH; 
615       hyfbchar = 256;   /* special mark */
616     } 
617     else if (mem[s].hh.b0 == 6)
618     {
619       if (mem[s + 1].hh.b0 != hf)
620       goto lab33; 
621 /* j:=hn; q:=lig_ptr(s); l.17554 */ 
622       j = hn; 
623       q = mem[s + 1].hh.v.RH; 
624 /* if q>null then hyf_bchar:=character(q); l.17554  BUG ??? */
625 /*      if (q > 0) */
626       if (q != 0)           /* 94/Mar/23 BUG FIX */
627       hyfbchar = mem[q].hh.b1; 
628 /* while q>null do l.17555 BUG ??? */
629 /*      while(q > 0)*/
630       while(q != 0){        /* 94/Mar/23 BUG FIX */
631         c = mem[q].hh.b1; 
632         if (eqtb[(hash_size + 2139) + c].hh.v.RH == 0)
633         goto lab33; 
634         if (j == 63)
635         goto lab33; 
636         incr(j); 
637         hu[j]= c; 
638 /*      long to short ... */
639         hc[j]= eqtb[(hash_size + 2139) + c].hh.v.RH; 
640         q = mem[q].hh.v.RH; 
641       } 
642       hb = s; 
643       hn = j; 
644       if (odd(mem[s].hh.b1)) 
645       hyfbchar = font_bchar[hf]; 
646       else hyfbchar = 256;    /* special mark */
647     } 
648     else if ((mem[s].hh.b0 == 11)&&(mem[s].hh.b1 == 
649     0)) 
650     { 
651       hb = s; 
652 /* ******************************************************************** */
653       hyfbchar = font_bchar[hf];    /* new code in 3.14159 */
654 /* ******************************************************************** */
655     } 
656     else goto lab33; 
657     s = mem[s].hh.v.RH; 
658         } 
659         lab33:; 
660         if (hn < lhyf + rhyf)
661         goto lab31; 
662         while(true){
663     if (!((s >= hi_mem_min)))
664     switch(mem[s].hh.b0)
665     {case 6 : 
666     ; 
667       break; 
668     case 11 : 
669       if (mem[s].hh.b1 != 0)
670       goto lab34; 
671       break; 
672     case 8 : 
673     case 10 : 
674     case 12 : 
675     case 3 : 
676     case 5 : 
677     case 4 : 
678       goto lab34; 
679       break; 
680       default: 
681       goto lab31; 
682       break; 
683     } 
684     s = mem[s].hh.v.RH; 
685         } 
686         lab34:; 
687         hyphenate(); 
688       } 
689       lab31:; 
690     } 
691   } 
692   break; 
693       case 11 : 
694 /* ******************************************************************* */
695   if (mem[cur_p].hh.b1 == 1)/*  change in 3.14159 */
696 /* ******************************************************************* */
697   {
698     if (!(mem[cur_p].hh.v.RH >= hi_mem_min)&& autobreaking)
699     if (mem[mem[cur_p].hh.v.RH].hh.b0 == 10)
700     try_break(0, 0); 
701     active_width[1]= active_width[1]+ mem[cur_p + 1].cint; 
702   } 
703 /* ******************************************************************* */
704 /*  change in 3.14159 */
705   else active_width[1]= active_width[1]+ mem[cur_p + 1].cint; 
706 /* ******************************************************************* */
707   break; 
708       case 6 : 
709   {
710     f = mem[cur_p + 1].hh.b0; 
711     active_width[1]= active_width[1]+ font_info[width_base[f]+ 
712     font_info[char_base[f]+ mem[cur_p + 1].hh.b1].qqqq.b0]
713    .cint; 
714   } 
715   break; 
716       case 7 : 
717   {
718     s = mem[cur_p + 1].hh.v.LH; 
719     disc_width = 0; 
720     if (s == 0)
721     try_break(ex_hyphen_penalty, 1); 
722     else {
723       do {
724     if ((s >= hi_mem_min)) 
725         {
726     f = mem[s].hh.b0; 
727     disc_width = disc_width + font_info[width_base[f]+ font_info 
728     [ char_base[f]+ mem[s].hh.b1].qqqq.b0].cint; 
729         } 
730         else switch(mem[s].hh.b0)
731         {case 6 : 
732     {
733       f = mem[s + 1].hh.b0; 
734       disc_width = disc_width + font_info[width_base[f]+ 
735       font_info[char_base[f]+ mem[s + 1].hh.b1].qqqq.b0 
736     ].cint; 
737     } 
738     break; 
739         case 0 : 
740         case 1 : 
741         case 2 : 
742         case 11 : 
743     disc_width = disc_width + mem[s + 1].cint; 
744     break; 
745     default: 
746       {
747         confusion("disc3");
748         return;       // abort_flag set
749       }
750       break; 
751         } 
752         s = mem[s].hh.v.RH; 
753       } while(!(s == 0)); 
754       active_width[1]= active_width[1]+ disc_width; 
755       try_break(hyphen_penalty, 1); 
756       active_width[1]= active_width[1]- disc_width; 
757     } 
758     r = mem[cur_p].hh.b1; 
759     s = mem[cur_p].hh.v.RH; 
760     while(r > 0){
761       if ((s >= hi_mem_min)) 
762       {
763         f = mem[s].hh.b0; 
764         active_width[1]= active_width[1]+ font_info[width_base[f 
765       ]+ font_info[char_base[f]+ mem[s].hh.b1].qqqq.b0]
766        .cint; 
767       } 
768       else switch(mem[s].hh.b0)
769       {case 6 : 
770         {
771     f = mem[s + 1].hh.b0; 
772     active_width[1]= active_width[1]+ font_info[width_base[
773     f]+ font_info[char_base[f]+ mem[s + 1].hh.b1].qqqq 
774     .b0].cint; 
775         } 
776         break; 
777       case 0 : 
778       case 1 : 
779       case 2 : 
780       case 11 : 
781         active_width[1]= active_width[1]+ mem[s + 1].cint; 
782         break; 
783         default:
784         {
785           confusion("disc4");
786           return;       // abort_flag set
787         }
788         break; 
789       } 
790       decr(r); 
791       s = mem[s].hh.v.RH; 
792     } 
793     prevp = cur_p; 
794     cur_p = s; 
795     goto lab35; 
796   } 
797   break; 
798       case 9 : 
799   {
800     autobreaking =(mem[cur_p].hh.b1 == 1); 
801     {
802       if (!(mem[cur_p].hh.v.RH >= hi_mem_min)&& autobreaking)
803       if (mem[mem[cur_p].hh.v.RH].hh.b0 == 10)
804       try_break(0, 0); 
805       active_width[1]= active_width[1]+ mem[cur_p + 1].cint; 
806     } 
807   } 
808   break; 
809       case 12 : 
810   try_break(mem[cur_p + 1].cint, 0); 
811   break; 
812       case 4 : 
813       case 3 : 
814       case 5 : 
815   ; 
816   break; 
817   default: 
818     {
819       confusion("paragraph");
820       return;       // abort_flag set
821     }
822     break; 
823       } 
824       prevp = cur_p; 
825       cur_p = mem[cur_p].hh.v.RH; 
826       lab35:; 
827     } 
828     if (cur_p == 0)
829     {
830       try_break(-10000, 1); 
831       if (mem[active].hh.v.RH != active)
832       {
833   r = mem[active].hh.v.RH; 
834   fewest_demerits = 1073741823L; /* 2^30 - 1 */
835   do {
836       if (mem[r].hh.b0 != 2)
837     if (mem[r + 2].cint < fewest_demerits)
838     {
839       fewest_demerits = mem[r + 2].cint; 
840       best_bet = r; 
841     } 
842     r = mem[r].hh.v.RH; 
843   } while(!(r == active)); 
844   best_line = mem[best_bet + 1].hh.v.LH; 
845 /*  if looseness=0 then goto done; */
846   if (looseness == 0){
847 /*    if (final_pass && eqtb[(hash_size + 3750)].cint > 0){ */
848 /*      paragraph_failed++; */
849 /*    } */
850     goto lab30;           /* normal exit */
851   }
852   {
853 /* r:=link(active); actual_looseness:=0; */
854     r = mem[active].hh.v.RH; 
855     actual_looseness = 0; 
856     do {
857         if (mem[r].hh.b0 != 2)
858       {
859 /*   line_diff:=line_number(r)-best_line; */
860         line_diff = toint(mem[r + 1].hh.v.LH)- toint(best_line 
861       ); 
862 /*   if ((line_diff<actual_looseness)and(looseness<=line_diff))or@|
863         ((line_diff>actual_looseness)and(looseness>=line_diff)) then */
864         if (((line_diff < actual_looseness) && (looseness <= line_diff)) ||
865           ((line_diff > actual_looseness) && (looseness >= line_diff)))
866         {
867     best_bet = r; 
868     actual_looseness = line_diff; 
869     fewest_demerits = mem[r + 2].cint; 
870         } 
871         else if ((line_diff == actual_looseness)&&(mem[r + 2]
872        .cint < fewest_demerits)) 
873         {
874     best_bet = r; 
875     fewest_demerits = mem[r + 2].cint; 
876         } 
877       } 
878       r = mem[r].hh.v.RH; 
879     } while(!(r == active)); 
880     best_line = mem[best_bet + 1].hh.v.LH; 
881   } 
882 /*  if (actual_looseness=looseness)or final_pass then goto done; */
883 /*  if ((actual_looseness == eqtb[(hash_size + 3182)].cint)|| final_pass)*/
884   if ((actual_looseness == looseness)) {
885     goto lab30;
886   }
887   if (final_pass){
888     goto lab30;
889   }
890       } 
891     } 
892     q = mem[active].hh.v.RH; 
893     while(q != active){
894       cur_p = mem[q].hh.v.RH; 
895       if (mem[q].hh.b0 == 2)
896       free_node(q, 7); 
897       else free_node(q, 3); 
898       q = cur_p; 
899     } 
900     q = passive; 
901     while(q != 0){
902       cur_p = mem[q].hh.v.RH; 
903       free_node(q, 2); 
904       q = cur_p; 
905     } 
906     if (! second_pass)
907     {
908   ;
909 #ifdef STAT
910       if (tracing_paragraphs > 0)
911       print_nl("@secondpass");      /*  */
912 #endif /* STAT */
913 /* threshold:=tolerance; */
914       threshold = tolerance; 
915       second_pass = true; 
916     second_pass_count++;          /* 96 Feb 9 */
917 /*   final_pass:=(emergency_stretch<=0); */
918       final_pass =(emergency_stretch <= 0); 
919     } 
920     else {
921   
922   ;
923 #ifdef STAT
924       if (tracing_paragraphs > 0)
925       print_nl("@emergencypass");     /*  */
926 #endif /* STAT */
927 /*     can only get here is \emergencystretch has been set positive */
928 /*     background[2]:=background[2]+emergency_stretch; final_pass:=true; */
929       background[2]= background[2]+ emergency_stretch;
930     final_pass = true; 
931     final_pass_count++;         /* 96 Feb 9 */
932   } /* end of if second_pass */
933   } /* end of while(true)do */
934 /* cannot drop through from above loop */
935   lab30:                /* common exit point */
936 /*  if (badness > (pre)tolerance) */
937 /*    if (last_badness > threshold){ */
938 /*    if (savedbadness > threshold){ */ /* do we believe this ??? */ 
939 /*    paragraph_failed++; */  /* 96/Feb/9 */
940 /*  } */
941 /*    if (prevgraf == 1) singleline++; */
942 /*    if (nest[nest_ptr].pg_field == 1) singleline++; */
943 /*    At this point best_line is number of lines in paragraph + 1 */
944     if (best_line == 2) singleline++;
945   ;
946 #ifdef STAT
947   if (tracing_paragraphs > 0)
948   {
949     end_diagnostic(true); 
950     normalize_selector(); 
951   } 
952 #endif /* STAT */
953   post_line_break(finalwidowpenalty); 
954   q = mem[active].hh.v.RH; 
955   while(q != active){
956     cur_p = mem[q].hh.v.RH; 
957     if (mem[q].hh.b0 == 2)
958     free_node(q, 7); 
959     else free_node(q, 3); 
960     q = cur_p; 
961   } 
962   q = passive; 
963   while(q != 0){ /* while q<>null do l.16979 */
964     cur_p = mem[q].hh.v.RH; 
965     free_node(q, 2); 
966     q = cur_p; 
967   } 
968   pack_begin_line = 0; 
969
970 /* sec 1211 */
971 void prefixed_command (void) 
972 {
973   small_number a; 
974   internal_font_number f; 
975   halfword j; 
976   font_index k; 
977   halfword p, q; 
978   integer n; 
979   bool e; 
980   a = 0; 
981   while (cur_cmd == prefix) {
982     if (!odd(a / cur_chr))
983       a = a + cur_chr;      /*   small_number a;  */
984     do {
985       get_x_token();
986     } while(!((cur_cmd != spacer) && (cur_cmd != relax))); 
987     if (cur_cmd <= max_non_prefixed_command) {
988       print_err("You can't use a prefix with `");
989       print_cmd_chr(cur_cmd, cur_chr);
990       print_char('\'');
991       help1("I'll pretend you didn't say \\long or \\outer or \\global.");
992       back_error();
993       return;
994     }
995   }
996   if ((cur_cmd != 97) && (a % 4 != 0)) {
997     print_err("You can't use `");
998     print_esc("long");
999     print_string("' or `");
1000     print_esc("outer");
1001     print_string("' with `");
1002     print_cmd_chr(cur_cmd, cur_chr); 
1003     print_char(39);   /* ' */
1004     help1("I'll pretend you didn't say \\long or \\outer here.");
1005     error(); 
1006   } 
1007   if (global_defs != 0)
1008   if (global_defs < 0)
1009   {
1010     if ((a >= 4)) 
1011     a = a - 4; 
1012   } else {
1013     if (!(a >= 4)) 
1014     a = a + 4; 
1015   } 
1016
1017   switch (cur_cmd) {
1018     case 87:
1019 /* set_font: define(cur_font_loc,data,cur_chr); */
1020     if ((a >= 4)) 
1021     geq_define((hash_size + 1834), 120, cur_chr); 
1022     else eq_define((hash_size + 1834), 120, cur_chr); 
1023     break; 
1024   case 97:
1025     {
1026       if (odd(cur_chr) && !(a >= 4) && (global_defs >= 0))
1027         a = a + 4;
1028       e = (cur_chr >= 2);
1029       get_r_token();
1030       p = cur_cs;
1031       q = scan_toks(true, e);
1032       if ((a >= 4)) geq_define(p, 111 +(a % 4), def_ref);
1033       else eq_define(p, 111 +(a % 4), def_ref);
1034     }
1035     break;
1036   case 94:
1037     {
1038       n = cur_chr;
1039       get_r_token();
1040       p = cur_cs;
1041       if (n == 0) {
1042         do {
1043           get_token();
1044         } while (!(cur_cmd != 10));
1045         if (cur_tok == 3133) {
1046           get_token();
1047           if (cur_cmd == 10)
1048             get_token();
1049         }
1050       } else {
1051         get_token();
1052         q = cur_tok;
1053         get_token();
1054         back_input();
1055         cur_tok = q;
1056         back_input();
1057       }
1058       if (cur_cmd >= 111)
1059         incr(mem[cur_chr].hh.v.LH);
1060       if ((a >= 4))
1061         geq_define(p, cur_cmd, cur_chr);
1062       else
1063         eq_define(p, cur_cmd, cur_chr);
1064     }
1065     break;
1066   case 95:
1067     {
1068       n = cur_chr;
1069       get_r_token();
1070       p = cur_cs;
1071       if ((a >= 4))
1072         geq_define(p, 0, 256);
1073       else
1074         eq_define(p, 0, 256);
1075       scan_optional_equals();
1076       switch (n) {
1077       case 0:
1078         {
1079           scan_char_num();
1080           if ((a >= 4))
1081             geq_define(p, 68, cur_val);
1082           else eq_define(p, 68, cur_val);
1083         }
1084         break;
1085       case 1:
1086         {
1087           scan_fifteen_bit_int();
1088           if ((a >= 4))
1089             geq_define(p, 69, cur_val);
1090           else
1091             eq_define(p, 69, cur_val);
1092         }
1093         break;
1094       default:
1095         {
1096           scan_eight_bit_int();
1097     switch(n){
1098       case 2 : 
1099       if ((a >= 4)) 
1100       geq_define(p, 73, (hash_size + 3218) + cur_val); 
1101       else eq_define(p, 73, (hash_size + 3218) + cur_val); 
1102       break; 
1103     case 3 : 
1104       if ((a >= 4)) 
1105       geq_define(p, 74, (hash_size + 3751) + cur_val); 
1106       else eq_define(p, 74, (hash_size + 3751) + cur_val); 
1107       break; 
1108     case 4 : 
1109       if ((a >= 4)) 
1110       geq_define(p, 75, (hash_size + 800) + cur_val); 
1111       else eq_define(p, 75, (hash_size + 800) + cur_val); 
1112       break; 
1113     case 5 : 
1114       if ((a >= 4)) 
1115       geq_define(p, 76, (hash_size + 1056) + cur_val); 
1116       else eq_define(p, 76, (hash_size + 1056) + cur_val); 
1117       break; 
1118     case 6 : 
1119       if ((a >= 4)) 
1120       geq_define(p, 72, toks_base + cur_val); 
1121       else eq_define(p, 72, toks_base + cur_val); 
1122       break; 
1123     } 
1124   } 
1125   break; 
1126       } 
1127     } 
1128     break; 
1129   case 96 : 
1130     {
1131       scan_int(); 
1132       n = cur_val; 
1133       if (! scan_keyword("to")) /* to */
1134       {
1135       print_err("Missing `to' inserted");
1136     help2("You should have said `\\read<number> to \\cs'.", 
1137       "I'm going to look for the \\cs now.");
1138   error(); 
1139       } 
1140       get_r_token(); 
1141       p = cur_cs; 
1142     read_toks(n, p); 
1143       if ((a >= 4)) geq_define(p, 111, cur_val); 
1144       else eq_define(p, 111, cur_val); 
1145     } 
1146     break; 
1147   case 71 : 
1148   case 72 : 
1149     {
1150       q = cur_cs; 
1151       if (cur_cmd == 71)
1152       {
1153   scan_eight_bit_int(); 
1154   p = toks_base + cur_val; 
1155       } 
1156       else p = cur_chr; 
1157       scan_optional_equals(); 
1158       do {
1159     get_x_token(); 
1160       } while(!((cur_cmd != 10)&&(cur_cmd != 0))); 
1161       if (cur_cmd != 1)
1162       {
1163   if (cur_cmd == 71)
1164   {
1165     scan_eight_bit_int(); 
1166     cur_cmd = 72; 
1167     cur_chr = toks_base + cur_val; 
1168   } 
1169   if (cur_cmd == 72)
1170   {
1171     q = eqtb[cur_chr].hh.v.RH; 
1172     if (q == 0)
1173     if ((a >= 4)) 
1174     geq_define(p, 101, 0); 
1175     else eq_define(p, 101, 0); 
1176     else {
1177         
1178       incr(mem[q].hh.v.LH); 
1179       if ((a >= 4)) 
1180       geq_define(p, 111, q); 
1181       else eq_define(p, 111, q); 
1182     } 
1183     goto lab30; 
1184   } 
1185       } 
1186       back_input(); 
1187       cur_cs = q; 
1188       q = scan_toks(false, false); 
1189       if (mem[def_ref].hh.v.RH == 0){
1190   if ((a >= 4)) 
1191   geq_define(p, 101, 0); 
1192   else eq_define(p, 101, 0); 
1193   {
1194     mem[def_ref].hh.v.RH = avail; 
1195     avail = def_ref; 
1196   ;
1197 #ifdef STAT
1198     decr(dyn_used); 
1199 #endif /* STAT */
1200   } 
1201       } 
1202       else {
1203     
1204   if (p == (hash_size + 1313))      /* output ? */
1205   {
1206     mem[q].hh.v.RH = get_avail(); 
1207     q = mem[q].hh.v.RH; 
1208     mem[q].hh.v.LH = 637; 
1209     q = get_avail(); 
1210     mem[q].hh.v.LH = 379;
1211     mem[q].hh.v.RH = mem[def_ref].hh.v.RH; 
1212     mem[def_ref].hh.v.RH = q; 
1213   } 
1214   if ((a >= 4)) 
1215   geq_define(p, 111, def_ref); 
1216   else eq_define(p, 111, def_ref); 
1217       } 
1218     } 
1219     break; 
1220   case 73 : 
1221     {
1222       p = cur_chr; 
1223       scan_optional_equals(); 
1224       scan_int(); 
1225       if ((a >= 4)) 
1226       geq_word_define(p, cur_val); 
1227       else eq_word_define(p, cur_val); 
1228     } 
1229     break; 
1230   case 74 : 
1231     {
1232       p = cur_chr; 
1233       scan_optional_equals(); 
1234       scan_dimen(false, false, false); 
1235       if ((a >= 4)) 
1236       geq_word_define(p, cur_val); 
1237       else eq_word_define(p, cur_val); 
1238     } 
1239     break; 
1240   case 75 : 
1241   case 76 : 
1242     {
1243       p = cur_chr; 
1244       n = cur_cmd; 
1245       scan_optional_equals(); 
1246       if (n == 76) scan_glue(3);
1247       else scan_glue(2);
1248       trap_zero_glue(); 
1249       if ((a >= 4)) 
1250       geq_define(p, 117, cur_val); 
1251       else eq_define(p, 117, cur_val); 
1252     } 
1253     break; 
1254   case 85 : 
1255     {
1256       if (cur_chr == (hash_size + 1883))
1257       n = 15; 
1258       else if (cur_chr == (hash_size + 2907))
1259       n = 32768L;                 /* 2^15 */
1260       else if (cur_chr == (hash_size + 2651))
1261       n = 32767;                /* 2^15 - 1*/
1262       else if (cur_chr == (hash_size + 3474))
1263       n = 16777215L;              /* 2^24 - 1 */
1264       else n = 255;             /* 2^8 - 1 */
1265       p = cur_chr; 
1266       scan_char_num(); 
1267       p = p + cur_val; 
1268       scan_optional_equals(); 
1269       scan_int(); 
1270       if (((cur_val < 0)&&(p < (hash_size + 3474))) ||(cur_val > n)) 
1271       {
1272       print_err("Invalid code(");
1273   print_int(cur_val); 
1274   if (p < (hash_size + 3474))
1275     print_string("), should be in the range 0..");
1276   else
1277     print_string("), should be at most ");
1278   print_int(n); 
1279   help1("I'm going to use 0 instead of that illegal code value.");
1280   error(); 
1281   cur_val = 0; 
1282       } 
1283       if (p < (hash_size + 2907))
1284       if ((a >= 4)) 
1285       geq_define(p, 120, cur_val); 
1286       else eq_define(p, 120, cur_val); 
1287       else if (p < (hash_size + 3474))
1288       if ((a >= 4)) 
1289       geq_define(p, 120, cur_val); 
1290       else eq_define(p, 120, cur_val); 
1291       else if ((a >= 4)) 
1292       geq_word_define(p, cur_val); 
1293       else eq_word_define(p, cur_val); 
1294     } 
1295     break; 
1296   case 86 : 
1297     {
1298       p = cur_chr; 
1299       scan_four_bit_int(); 
1300       p = p + cur_val; 
1301       scan_optional_equals(); 
1302       scan_font_ident(); 
1303       if ((a >= 4)) 
1304       geq_define(p, 120, cur_val); 
1305       else eq_define(p, 120, cur_val); 
1306     } 
1307     break; 
1308   case 89 : 
1309   case 90 : 
1310   case 91 : 
1311   case 92 : 
1312     do_register_command(a); 
1313     break; 
1314   case 98 : 
1315     {
1316       scan_eight_bit_int(); 
1317       if ((a >= 4)) 
1318       n = 256 + cur_val; 
1319       else n = cur_val; 
1320       scan_optional_equals(); 
1321       if (set_box_allowed){
1322       scan_box(1073741824L + n); /* 2^30 + n */ /* box_flag + n */
1323     }
1324       else {
1325     print_err("Improper ");
1326   print_esc("setbox");    /*  */
1327   help2("Sorry, \\setbox is not allowed after \\halign in a display,",
1328     "or between \\accent and an accented character.");
1329   error(); 
1330       } 
1331     } 
1332     break; 
1333   case 79 : 
1334     alter_aux(); 
1335     break; 
1336   case 80 : 
1337     alter_prev_graf(); 
1338     break; 
1339   case 81 : 
1340     alter_page_so_far(); 
1341     break; 
1342   case 82 : 
1343     alter_integer(); 
1344     break; 
1345   case 83 : 
1346     alter_box_dimen(); 
1347     break; 
1348   case 84 : 
1349     {
1350       scan_optional_equals(); 
1351       scan_int(); 
1352       n = cur_val; 
1353       if (n <= 0)
1354       p = 0; 
1355       else {
1356     
1357   p = get_node(2 * n + 1); 
1358   mem[p].hh.v.LH = n; 
1359   {
1360     register integer for_end;
1361     j = 1;
1362     for_end = n;
1363     if (j <= for_end) do 
1364     {
1365       scan_dimen(false, false, false); 
1366       mem[p + 2 * j - 1].cint = cur_val; 
1367       scan_dimen(false, false, false); 
1368       mem[p + 2 * j].cint = cur_val; 
1369     } 
1370     while(j++ < for_end);
1371   } 
1372       } 
1373       if ((a >= 4)) 
1374       geq_define((hash_size + 1312), 118, p); 
1375       else eq_define((hash_size + 1312), 118, p); 
1376     } 
1377     break; 
1378   case 99 : 
1379     if (cur_chr == 1)
1380     {
1381   ;
1382 #ifdef INITEX
1383   if (is_initex) {    /* bkph */
1384       new_patterns(); 
1385       goto lab30; 
1386   }           /* bkph */
1387 #endif /* INITEX */
1388      print_err("Patterns can be loaded only by INITEX");
1389       help_ptr = 0; 
1390       error(); 
1391       do {
1392       get_token(); 
1393       } while(!(cur_cmd == 2)); 
1394       return; 
1395     } 
1396     else {
1397   
1398       new_hyph_exceptions(); 
1399       goto lab30; 
1400     } 
1401     break; 
1402   case 77 : 
1403     {
1404       find_font_dimen(true); 
1405       k = cur_val; 
1406       scan_optional_equals(); 
1407       scan_dimen(false, false, false); 
1408       font_info[k].cint = cur_val; 
1409     } 
1410     break; 
1411   case 78 : 
1412     {
1413       n = cur_chr; 
1414       scan_font_ident(); 
1415       f = cur_val; 
1416       scan_optional_equals(); 
1417       scan_int(); 
1418       if (n == 0)hyphen_char[f]= cur_val; 
1419       else skew_char[f]= cur_val; 
1420     } 
1421     break; 
1422   case 88 : 
1423     new_font(a); 
1424     break; 
1425   case 100 : 
1426     new_interaction(); 
1427     break; 
1428     default: 
1429   {
1430     confusion("prefix");
1431     return;       // abort_flag set
1432   }
1433   break; 
1434   } /* end of cur_cmd switch */
1435
1436
1437 lab30:
1438   if (after_token != 0) {
1439     cur_tok = after_token; 
1440     back_input(); 
1441     after_token = 0; 
1442   } 
1443
1444
1445 /* added following explanations 96/Jan/10 */
1446
1447 void bad_formator_pool (char *name, char *defaultname, char *envvar)
1448 {
1449   if (name == NULL) name = defaultname;
1450   sprintf(log_line, "(Perhaps %s is for an older version of TeX)\n", name); 
1451   show_line(log_line, 0);
1452   name_of_file[name_length + 1] = '\0';
1453   sprintf(log_line, "(Alternatively, %s may have been corrupted)\n", name_of_file+1);
1454   show_line(log_line, 0);
1455   name_of_file[name_length + 1] = ' ';
1456   sprintf(log_line,
1457     "(Perhaps your %s environment variable is not set correctly)\n", envvar);
1458   show_line(log_line, 0);
1459   {
1460     char *s;            /* extra info 99/April/28 */
1461     if ((s = grabenv(envvar)) != NULL) {
1462       sprintf(log_line, "(%s=%s)\n", envvar, s);
1463       show_line(log_line, 0);
1464     }
1465     else {
1466       sprintf(log_line, "%s environment variable not set\n", envvar);
1467       show_line(log_line, 0);
1468     }
1469   }
1470 #ifndef _WINDOWS
1471   fflush(stdout); 
1472 #endif
1473
1474 /* sec 1303 */
1475 bool load_fmt_file (void) 
1476 {
1477   register bool Result;
1478   integer j, k;
1479   halfword p, q;
1480   integer x;
1481
1482 /* sec 1308 */
1483   undump_int(x); /* CHECKSUM */
1484   if (x != BEGINFMTCHECKSUM) /* magic FMT file start 4C 20 E6 15 hex */
1485     goto lab6666; 
1486
1487   undump_int(x); /* mem_bot */
1488   if (x != mem_bot)
1489     goto lab6666;
1490
1491   undump_int(x); /* mem_top */
1492
1493 #ifdef ALLOCATEMAIN
1494 /* we already read this once earlier to grab mem_top */
1495   if (trace_flag) {
1496     sprintf(log_line, "Read from fmt file mem_top = %d TeX words\n", x);
1497     show_line(log_line, 0);
1498   }
1499   mem = allocate_main_memory(x); /* allocate main memory at this point */
1500   if (mem == NULL) exit(1);      /* redundant sanity test ! */
1501   initialize_aux();              /* do `mem' part of initialize */
1502 /*  mem = zmem; */               /* update pointer to main memory */
1503 #endif
1504
1505   if (x != mem_top)
1506     goto lab6666; 
1507
1508   undump_int(x); /* eqtbsize */
1509   if (x != (hash_size + 4006)) /* eqtbsize */
1510     goto lab6666;
1511   undump_int(x); /* hash_prime */
1512   if (x != hash_prime)
1513     goto lab6666; 
1514   undump_int(x); /* hyphen_prime */
1515
1516 #ifdef ALLOCATEHYPHEN
1517 /* allow format files dumped with arbitrary (prime) hyphenation exceptions */
1518   realloc_hyphen (x);            /* reset_hyphen(); */
1519   hyphen_prime = x;
1520 #endif
1521
1522   if (x != hyphen_prime)
1523     goto lab6666; 
1524   {
1525     undump_int(x); /* pool_size */
1526     if (x < 0)
1527       goto lab6666; 
1528
1529 #ifdef ALLOCATESTRING
1530     if (x > current_pool_size) {
1531       if (trace_flag) {
1532         sprintf(log_line, "undump string pool reallocation (%d > %d)\n", x, current_pool_size);
1533         show_line(log_line, 0);
1534       }
1535       str_pool = realloc_str_pool (x - current_pool_size + increment_pool_size);
1536     }
1537     if (x > current_pool_size)   /* 94/Jan/24 */
1538 #else
1539     if (x > pool_size)
1540 #endif
1541     {
1542       ;
1543       sprintf(log_line, "%s%s\n",  "---! Must increase the ", "string pool size");
1544       show_line(log_line, 0);
1545       goto lab6666;
1546     } else pool_ptr = x; 
1547   } 
1548   {
1549     undump_int(x);  /* max_strings */
1550     if (x < 0)
1551       goto lab6666; 
1552
1553 #ifdef ALLOCATESTRING
1554     if (x > current_max_strings) {
1555       if (trace_flag) {
1556         sprintf(log_line, "undump string pointer reallocation (%d > %d)\n", x, current_max_strings);
1557         show_line(log_line, 0);
1558       }
1559       str_start = realloc_str_start(x - current_max_strings + increment_max_strings);
1560     }
1561     if (x > current_max_strings) /* 94/Jan/24 */
1562 #else
1563 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1564     if (x > max_strings)
1565 #endif
1566     {
1567       ; 
1568       sprintf(log_line,  "%s%s\n",  "---! Must increase the ", "max strings"); 
1569       show_line(log_line, 0);
1570       goto lab6666; 
1571     } 
1572     else str_ptr = x; 
1573   } 
1574
1575   if (undumpthings(str_start[0], str_ptr + 1)) return -1; /* undump string ptrs */
1576   if (undumpthings(str_pool[0], pool_ptr)) return -1; /*  undump string pool */
1577
1578   init_str_ptr = str_ptr; 
1579   init_pool_ptr = pool_ptr; 
1580 /*  undump the dynamic memory - paragraph 1312 in the book */
1581   {
1582     undump_int(x); 
1583     if ((x < 1019)||(x > mem_top - 14)) 
1584     goto lab6666; 
1585     else lo_mem_max = x; 
1586   } 
1587   {
1588     undump_int(x); 
1589     if ((x < 20)||(x > lo_mem_max)) 
1590     goto lab6666; 
1591     else rover = x; 
1592   } 
1593   p = 0;                  /* mem_bot */
1594   q = rover; 
1595   do {
1596       if (undumpthings(mem[p], q + 2 - p) 
1597     )return -1;
1598     p = q + mem[q].hh.v.LH; 
1599     if ((p > lo_mem_max)||((q >= mem[q + 1].hh.v.RH)&&(mem[q + 
1600     1].hh.v.RH != rover)))
1601     goto lab6666; 
1602     q = mem[q + 1].hh.v.RH; 
1603   } while(!(q == rover)); 
1604   if (undumpthings(mem[p], lo_mem_max + 1 - p) 
1605   )return -1;
1606 /*  if (mem_min < -2) */
1607   if (mem_min < mem_bot - 2)          /*  ? splice in block below */
1608   {
1609 /*  or call add_variable_space(mem_bot - (mem_min + 1)) */
1610
1611     if (trace_flag) show_line("Splicing in mem_min space in undump!\n", 0);
1612
1613     p = mem[rover + 1].hh.v.LH; 
1614     q = mem_min + 1; 
1615     mem[mem_min].hh.v.RH = 0;       /* null */
1616     mem[mem_min].hh.v.LH = 0;       /* null */
1617     mem[p + 1].hh.v.RH = q; 
1618     mem[rover + 1].hh.v.LH = q; 
1619     mem[q + 1].hh.v.RH = rover; 
1620     mem[q + 1].hh.v.LH = p; 
1621 /*    mem[q].hh.v.RH = 262143L;  */ /* NO! */
1622     mem[q].hh.v.RH = empty_flag; 
1623 /*    mem[q].hh.v.LH = -0 - q;  */
1624     mem[q].hh.v.LH = mem_bot - q;     /* ? size of block  */
1625   } 
1626   {
1627     undump_int(x); 
1628     if ((x < lo_mem_max + 1)||(x > mem_top - 13)) 
1629     goto lab6666; 
1630     else hi_mem_min = x; 
1631   } 
1632   {
1633     undump_int(x); 
1634 /*    if ((x < 0)||(x > mem_top))  */
1635     if ((x < mem_bot)||(x > mem_top)) 
1636     goto lab6666; 
1637     else avail = x; 
1638   } 
1639   mem_end = mem_top; 
1640   if (undumpthings(mem[hi_mem_min], mem_end + 1 - hi_mem_min) 
1641   )return -1;
1642   undump_int(var_used); 
1643   undump_int(dyn_used); 
1644   k = 1; 
1645   do {
1646       undump_int(x); 
1647     if ((x < 1)||(k + x > (hash_size + 4007))) 
1648     goto lab6666; 
1649     if (undumpthings(eqtb[k], x) 
1650    )return -1;
1651     k = k + x; 
1652     undump_int(x); 
1653     if ((x < 0)||(k + x > (hash_size + 4007))) 
1654     goto lab6666; 
1655     {
1656     register integer for_end;
1657     j = k;
1658     for_end = k + x - 1;
1659     if (j <= for_end) do 
1660       eqtb[j]= eqtb[k - 1]; 
1661     while(j++ < for_end);
1662   } 
1663     k = k + x; 
1664   } while(!(k > (hash_size + 4006))); 
1665   {
1666     undump_int(x); 
1667 /*  if ((x < hashbase)||(x > hashbase + hashsize)) */
1668 /*    if ((x < 514)||(x > (hash_size + 514)))  */
1669     if ((x < 514)||(x > (hash_size + hash_extra + 514)))  /*96/Jan/10*/
1670     goto lab6666; 
1671     else par_loc = x; 
1672   } 
1673   par_token = 4095 + par_loc; 
1674   {
1675     undump_int(x); 
1676 /*  if ((x < hashbase)||(x > hashbase + hashsize)) */
1677 /*    if ((x < 514)||(x > (hash_size + 514)))  */
1678     if ((x < 514)||(x > (hash_size + hash_extra + 514))) /*96/Jan/10*/
1679     goto lab6666; 
1680     else
1681     write_loc = x; 
1682   } 
1683   {
1684     undump_int(x); 
1685 /*  if ((x < hashbase)||(x > hashbase + hashsize)) */
1686 /*    if ((x < 514)||(x > (hash_size + 514)))  */
1687     if ((x < 514)||(x > (hash_size + hash_extra + 514))) /*96/Jan/10*/
1688     goto lab6666; 
1689     else hash_used = x; 
1690   } 
1691   p = 513; 
1692   do {
1693       { 
1694       undump_int(x); 
1695       if ((x < p + 1)||(x > hash_used)) 
1696       goto lab6666; 
1697       else p = x; 
1698     } 
1699     undump_hh(hash[p]); 
1700   } while(!(p == hash_used)); 
1701   if (undumpthings(hash[hash_used + 1], (hash_size + 780) - hash_used) 
1702   )return -1;
1703
1704   undump_int(cs_count);     /* cs_count */
1705   if (trace_flag) {
1706     sprintf(log_line, "itex undump cs_count %d ", cs_count); /* debugging */
1707     show_line(log_line, 0);
1708   }
1709   {
1710     undump_int(x);        /* font_mem_size */
1711     if (x < 7)
1712     goto lab6666; 
1713 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1714 #ifdef ALLOCATEFONT
1715     if (trace_flag) {
1716       sprintf(log_line, "Read from fmt fmem_ptr = %d\n", x);
1717       show_line(log_line, 0);
1718     }
1719     if (x > current_font_mem_size) { /* 93/Nov/28 dynamic allocate font_info */
1720       if (trace_flag) {
1721         sprintf(log_line, "Undump realloc font_info (%d > %d)\n",
1722             x, current_font_mem_size);
1723         show_line(log_line, 0);
1724       }
1725       font_info = realloc_font_info (x - current_font_mem_size + increment_font_mem_size);
1726     }
1727     if (x > current_font_mem_size)  /* in case allocation failed 94/Jan/24 */
1728 #else
1729 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1730     if (x > font_mem_size)
1731 #endif
1732     {
1733       ;
1734       sprintf(log_line, "%s%s\n",  "---! Must increase the ", "font mem size");
1735       show_line(log_line, 0);
1736       goto lab6666; 
1737     } else fmem_ptr = x; 
1738   } 
1739   {
1740     if (undumpthings(font_info[0], fmem_ptr)) return -1;
1741     {
1742       undump_int(x); /* font_max */
1743       if (x < 0)
1744         goto lab6666; 
1745       if (x > font_max)
1746       {
1747         ; 
1748         sprintf(log_line, "%s%s\n",  "---! Must increase the ", "font max"); 
1749         show_line(log_line, 0);
1750         goto lab6666; 
1751       } 
1752       else font_ptr = x; 
1753     }
1754     frozenfontptr = font_ptr; /* remember number of fonts frozen into format */
1755     if (undumpthings(font_check[0], font_ptr + 1)) return -1;
1756     if (undumpthings(font_size[0], font_ptr + 1)) return -1;
1757     if (undumpthings(font_dsize[0], font_ptr + 1)) return -1;
1758     if (undumpthings(font_params[0], font_ptr + 1)) return -1;
1759     if (undumpthings(hyphen_char[0], font_ptr + 1)) return -1;
1760     if (undumpthings(skew_char[0], font_ptr + 1)) return -1;
1761     if (undumpthings(font_name[0], font_ptr + 1)) return -1;
1762     if (undumpthings(font_area[0], font_ptr + 1)) return -1;
1763     if (undumpthings(font_bc[0], font_ptr + 1)) return -1;
1764     if (undumpthings(font_ec[0], font_ptr + 1)) return -1;
1765     if (undumpthings(char_base[0], font_ptr + 1)) return -1;
1766     if (undumpthings(width_base[0], font_ptr + 1)) return -1;
1767     if (undumpthings(height_base[0], font_ptr + 1)) return -1;
1768     if (undumpthings(depth_base[0], font_ptr + 1)) return -1;
1769     if (undumpthings(italic_base[0], font_ptr + 1)) return -1;
1770     if (undumpthings(lig_kern_base[0], font_ptr + 1)) return -1;
1771     if (undumpthings(kern_base[0], font_ptr + 1)) return -1;
1772     if (undumpthings(exten_base[0], font_ptr + 1)) return -1;
1773     if (undumpthings(param_base[0], font_ptr + 1)) return -1;
1774     if (undumpthings(font_glue[0], font_ptr + 1)) return -1;
1775     if (undumpthings(bchar_label[0], font_ptr + 1)) return -1;
1776     if (undumpthings(font_bchar[0], font_ptr + 1)) return -1;
1777     if (undumpthings(font_false_bchar[0], font_ptr + 1)) return -1;
1778   }
1779
1780 /* log not opened yet, so can't show fonts frozen into format */
1781   
1782 /* May be able to avoid the following since we switched to */
1783 /* non_address from font_mem_size to 0 96/Jan/15 ??? */
1784 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1785 #ifdef ALLOCATEFONT
1786 /* deal with fmt files dumped with *different* font_mem_size 93/Nov/29 */
1787  { int count = 0, oldfont_mem_size = 0;
1788    for (x = 0; x <= font_ptr; x++) {
1789      if (bchar_label[x] > oldfont_mem_size) oldfont_mem_size = bchar_label[x];
1790    }
1791
1792 /* somewhat arbitrary sanity check ... */
1793 /* if (oldfont_mem_size != font_mem_size && oldfont_mem_size > font_max) { */
1794    if (oldfont_mem_size != non_address && oldfont_mem_size > font_max) { /* 96/Jan/16 */
1795      for (x = 0; x <= font_ptr; x++) {
1796        if (bchar_label[x] == oldfont_mem_size) {
1797          /* bchar_label[x] = font_mem_size; */
1798          bchar_label[x] = non_address;  /* 96/Jan/16 */
1799          count++;
1800        }
1801      }
1802      if (trace_flag) {
1803        sprintf(log_line,
1804            "oldfont_mem_size is %d --- hit %d times. Using non_address %d\n",
1805            oldfont_mem_size, count, non_address);
1806        show_line(log_line, 0);
1807      }
1808    }
1809  }
1810 #endif
1811 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1812 /* undump(0)(hyph_size)(hyph_count); */
1813   {
1814     undump_int(x); 
1815 /* if ((x < 0)||(x > 607))  */
1816     if ((x < 0)||(x > hyphen_prime))
1817       goto lab6666; 
1818     else
1819       hyph_count = x; 
1820   }
1821 /* undump hypenation exception tables p.1325 */
1822   {
1823     register integer for_end;
1824     k = 1;
1825     for_end = hyph_count;
1826     if (k <= for_end) 
1827       do 
1828       {
1829         {
1830           undump_int(x); 
1831 /* if ((x < 0)||(x > 607))  */
1832           if ((x < 0)||(x > hyphen_prime))
1833             goto lab6666;
1834           else
1835             j = x; 
1836         }
1837 /* undump(0)(str_ptr)(hyph_word[j]); */
1838         {
1839           undump_int(x); 
1840           if ((x < 0)||(x > str_ptr))
1841             goto lab6666;
1842           else
1843             hyph_word[j]= x;
1844         } 
1845 /* undump(min_halfword)(max_halfword)(hyph_list[j]); */
1846         {
1847           undump_int(x); 
1848 /* if ((x < 0)||(x > 262143L)) */
1849           if ((x < 0)||(x > max_halfword)) /* mem_top ? no p.1325 */
1850             goto lab6666;
1851           else
1852             hyph_list[j]= x;
1853         }
1854       } while(k++ < for_end);
1855   } 
1856 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1857 #ifdef ALLOCATEHYPHEN
1858 /* if user specified new hyphen prime - flush existing exception patterns ! */
1859 /* but, we can reclaim the string storage wasted ... */
1860   if (is_initex) {
1861     if (new_hyphen_prime != 0) {
1862       realloc_hyphen(new_hyphen_prime); /*  reset_hyphen(); */
1863       hyphen_prime = new_hyphen_prime;
1864     }
1865   }
1866 #endif
1867 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1868   {
1869     undump_int(x);
1870     if (x < 0)
1871       goto lab6666; 
1872 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1873 #ifdef ALLOCATETRIES
1874     if (!is_initex) {
1875       allocate_tries(x); /* allocate only as much as is needed */
1876 /* trie_size = x; */ /* ??? */
1877     }
1878 #endif
1879 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1880     if (x > trie_size)
1881     {
1882       ;
1883       sprintf(log_line, "%s%s\n",  "---! Must increase the ", "trie size"); 
1884       show_line(log_line, 0);
1885       goto lab6666;
1886     } else j = x; 
1887   }
1888   ;
1889 #ifdef INITEX
1890 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1891   if (is_initex) /* bkph */
1892 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1893     trie_max = j; 
1894 #endif /* INITEX */
1895   if (undumpthings(trie_trl[0], j + 1)) return -1;
1896   if (undumpthings(trie_tro[0], j + 1)) return -1;
1897   if (undumpthings(trie_trc[0], j + 1)) return -1;
1898   {
1899     undump_int(x); 
1900     if (x < 0)
1901       goto lab6666; 
1902     if (x > trie_op_size)
1903     {
1904       ;
1905       sprintf(log_line, "%s%s\n",  "---! Must increase the ", "trie op size"); 
1906       show_line(log_line, 0);
1907       goto lab6666; 
1908     } else j = x; 
1909   } 
1910 ;
1911 #ifdef INITEX
1912 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1913   if (is_initex)   /* bkph */
1914 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1915     trie_op_ptr = j; 
1916 #endif /* INITEX */
1917 /* for k:=1 to j do
1918   begin undump(0)(63)(hyf_distance[k]); {a |small_number|}
1919   undump(0)(63)(hyf_num[k]);
1920   undump(min_quarterword)(max_quarterword)(hyf_next[k]); end; */
1921   
1922   if (undumpthings(hyf_distance[1], j)) return -1;
1923   if (undumpthings(hyf_num[1], j)) return -1;
1924   if (undumpthings(hyf_next[1], j)) return -1;
1925   ;
1926 #ifdef INITEX
1927 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1928   if (is_initex) {     /* bkph */
1929 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1930     {
1931       register integer for_end;
1932       k = 0;
1933       for_end = 255;
1934       if (k <= for_end) do
1935         trie_used[k]= 0;
1936       while(k++ < for_end);
1937     }
1938   }
1939 #endif /* INITEX */
1940   k = 256;
1941   while(j > 0){
1942 /* undump(0)(k-1)(k) */
1943     {
1944       undump_int(x); 
1945       if ((x < 0)||(x > k - 1)) 
1946         goto lab6666; 
1947       else k = x; 
1948     } 
1949 /* undump(1)(j)(x) */
1950     {
1951       undump_int(x); 
1952       if ((x < 1)||(x > j)) 
1953       goto lab6666; 
1954       else x = x; 
1955     } 
1956   ;
1957 #ifdef INITEX
1958 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1959   if (is_initex)          /* bkph */
1960 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1961     trie_used[k]= x; 
1962 #endif /* INITEX */
1963 /*   j:=j-x; op_start[k]:=qo(j); */
1964     j = j - x; 
1965     op_start[k]= j; 
1966   } 
1967   ;
1968 #ifdef INITEX
1969 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1970   if (is_initex)          /* bkph */
1971 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1972     trie_not_ready = false 
1973 #endif /* INITEX */
1974
1975   {
1976     undump_int(x); 
1977     if ((x < 0)||(x > 3)) 
1978     goto lab6666; 
1979 /*    else interaction = x;  */
1980 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1981     if (interaction < 0)    /* may now set in local.c bkph 94/Jan/8 */
1982 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1983     interaction = x;
1984   } 
1985   {
1986     undump_int(x); 
1987     if ((x < 0)||(x > str_ptr)) 
1988     goto lab6666; 
1989     else format_ident = x; 
1990   } 
1991   undump_int(x); 
1992 /*  test_eof(fmt_file)? */
1993   
1994   if ((x != ENDFMTCHECKSUM)|| feof(fmt_file)) /* magic checksum --- change ? */
1995     goto lab6666; 
1996
1997   Result = true; 
1998   return(Result); 
1999
2000   lab6666:; 
2001   sprintf(log_line, "(Fatal format file error; I'm stymied)\n"); 
2002   show_line(log_line, 1);
2003 /* added following bit of explanation 96/Jan/10 */
2004   if (! knuth_flag)
2005     bad_formator_pool(format_file, "the format file", "TEXFORMATS");
2006   Result = false; 
2007   return Result; 
2008
2009 /* sec 1335 */
2010 void final_cleanup (void) 
2011
2012   small_number c; 
2013   c = cur_chr;
2014   if (job_name == 0) open_log_file(); 
2015   while (input_ptr > 0) {
2016     if (cur_input.state_field == 0) {
2017       end_token_list();
2018     } else end_file_reading();
2019   }
2020   while (open_parens > 0) {
2021     print_string(" )");
2022     decr(open_parens); 
2023   } 
2024   if (cur_level > level_one) {
2025     print_nl("(");
2026     print_esc("end occurred ");
2027     print_string("inside a group at level ");
2028     print_int(cur_level - 1); 
2029     print_char(')');
2030   } 
2031   while (cond_ptr != 0) {
2032     print_nl("(");
2033     print_esc("end occurred ");
2034     print_string("when ");
2035     print_cmd_chr(105, cur_if); /* i */
2036     if (if_line != 0) {
2037       print_string("on line ");
2038       print_int(if_line); 
2039     } 
2040     print_string(" was incomplete)");
2041     if_line = mem[cond_ptr + 1].cint; 
2042     cur_if = mem[cond_ptr].hh.b1; 
2043     temp_ptr = cond_ptr;
2044     cond_ptr = mem[cond_ptr].hh.v.RH;
2045     free_node(temp_ptr, 2);
2046   } 
2047   if (history != 0)
2048     if (((history == 1) || (interaction < 3)))
2049       if (selector == 19)
2050       {
2051         selector = 17;
2052         print_nl(" (see the transcript file for additional information)");
2053         selector = 19;
2054       }
2055   if (c == 1) {
2056     ;
2057 #ifdef INITEX
2058 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2059     if (is_initex) {          /* bkph */
2060 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2061 /* *************************** new in 3.14159 ***************************** */
2062     {
2063     register integer for_end;
2064     c = 0;
2065     for_end = 4;
2066     if (c <= for_end) do 
2067       if (cur_mark[c]!= 0)
2068         delete_token_ref(cur_mark[c]); 
2069     while(c++ < for_end);
2070   } 
2071 /* *********************************************************************** */
2072 /* 422. Amendment to bugfix 414 (reported by David Fuchs, September 2007) */
2073     if (last_glue != max_halfword) delete_glue_ref(last_glue);
2074     store_fmt_file(); // returns a value ?
2075   }
2076 #endif /* INITEX */
2077   if (!is_initex)       /* 2000/March/3 */
2078     print_nl(" (\\dump is performed only by INITEX)");    /*  */
2079   } 
2080 }
2081
2082 // debugging code for checking the string pool
2083 #ifdef CHECKPOOL
2084 int checkpool (char *task)
2085
2086   int c, i, k, n, st, flag, bad=0;
2087
2088   if (task != NULL) {
2089     sprintf(log_line, "Check on string pool start (%s)\n", task);
2090     show_line(log_line, 0);
2091   }
2092   for (k = 0; k < 32; k++) {
2093     if (str_start[k] != 3 * k) {
2094       sprintf(log_line, "k %d str_start[k] %d\n", k, str_start[k]);
2095       show_line(log_line, 0);
2096     }
2097   }
2098   for (k = 32; k < 128; k++) {
2099     if (str_start[k] != 96 + (k - 32)) {
2100       sprintf(log_line, "k %d str_start[k] %d\n", k, str_start[k]);
2101       show_line(log_line, 0);
2102     }
2103   }
2104   for (k = 128; k < 256; k++) {
2105     if (str_start[k] != 194 + 4 * (k - 128)){
2106       sprintf(log_line, "k %d str_start[k] %d\n", k, str_start[k]);
2107       show_line(log_line, 0);
2108     }
2109   }
2110   if (task != NULL) {
2111     sprintf(log_line, "Check on string pool (%s)\n", task);
2112     show_line(log_line, 0);
2113   }
2114   for (k = 0; k < str_ptr; k++) {
2115     if (str_start[k+1] == 0) break;
2116     n = length(k);
2117     if (n < 0) break;
2118     st = str_start[k];
2119     flag = 0;
2120     for (i = 0; i < n; i++) {
2121       if (str_pool[st + i] == 0) {
2122         flag = 1; break;
2123       }
2124       if (str_pool[st + i] > 255) {
2125         flag = 1; break;
2126       }
2127     }
2128     if (flag) {
2129       bad++;
2130       sprintf(log_line, "BAD %d (start at %d): ", k, st);
2131       show_line(log_line, 0);
2132       s = log_line;
2133       for (i = 0; i < n; i++) {
2134         c = str_pool[st + i];
2135         if (c > 255) {
2136           sprintf(s, "%d ", c);
2137           s += strlen(s);
2138           continue;
2139         }
2140         if (c >= 128) {
2141           c -= 128;
2142           sprintf(s, "M-");
2143           s += strlen(s);
2144         }
2145         if (c < 32) {
2146           c += 64;
2147           sprintf(s, "C-");
2148           s += strlen(s);
2149         }
2150 //        putc(c, stdout);
2151         *s++ = c;   // ???
2152       }
2153       *s++ = '\n';
2154       *s++ = '\0';
2155       show_line(log_line, stdout);
2156     }
2157   }
2158   sprintf(log_line, "end of check (%s)\n", bad ? "BAD" : "OK");
2159   show_line(log_line, 0);
2160   if (bad) {
2161     if (task == NULL) return bad;
2162     else exit(1);
2163   }
2164   return bad;
2165 }  /* DEBUGGING ONLY */
2166 #endif
2167
2168 void show_frozen (void)
2169 {
2170   int i, j, n;
2171   fprintf(log_file, "\n");
2172   fprintf(log_file, "(%d fonts frozen in format file:\n", font_ptr);
2173 /*  ignore font 0 which is nullfont */
2174 /*  for (i = 1; i < font_ptr+1; i++) */
2175   for (i = 1; i <= font_ptr; i++) {
2176     if (i > 1) fprintf(log_file, ", ");
2177     if ((i % 8) == 0) fprintf(log_file, "\n");
2178     n = str_start[font_name[i]+1]-str_start[font_name[i]];
2179     for (j = 0; j < n; j++) {
2180       putc(str_pool[str_start[font_name[i]]+j], log_file);
2181 /*         str_pool[str_start[font_name[i]]+j] = '?'; */
2182     }
2183   }
2184   fprintf(log_file, ") ");
2185 }
2186
2187 /* Main entry point called from texmf.c int main(int ac, char *av[]) */
2188 /* call from main_program in texmf.c */
2189 /* This in turn calls initialize() */
2190
2191 #pragma warning(disable:4127)   // conditional expression is constant
2192
2193 /* void texbody()  */
2194 int texbody (void)          /* now returns a value --- bkph */
2195
2196   history = 3; 
2197
2198   set_paths(TEXFORMATPATHBIT + TEXINPUTPATHBIT + TEXPOOLPATHBIT + TFMFILEPATHBIT); 
2199
2200   if (ready_already == 314159L) goto lab1; /* magic number */
2201 /*  These tests are almost all compile time tests and so could be eliminated */
2202   bad = 0;
2203   if ((half_error_line < 30) || (half_error_line > error_line - 15)) bad = 1; 
2204   if (max_print_line < 60)  bad = 2; 
2205   if (dvi_buf_size % 8 != 0) bad = 3; 
2206   if (1100 > mem_top)bad = 4;   /* not compile time */
2207 /*  if (hash_prime > hash_size) */
2208   if (hash_prime > (hash_size + hash_extra)) bad = 5; 
2209   if (max_in_open >= 128)bad = 6;   /* p.14 */
2210   if (mem_top < 267)bad = 7;    /* where from ? *//* not compile time */
2211   ;
2212 #ifdef INITEX
2213 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2214   if (is_initex) {          /* bkph */
2215 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2216     if ((mem_min != 0)||(mem_max != mem_top))   bad = 10;
2217   }
2218 #endif /* INITEX */
2219 /*  if ((mem_min > 0)||(mem_max < mem_top))  */
2220   if ((mem_min > mem_bot)||(mem_max < mem_top))  bad = 10;
2221 /*  if ((0 > 0)||(255 < 127))  */
2222   if ((min_quarterword > 0)||(max_quarterword < 255))  bad = 11;
2223 /*  if ((0 > 0)||(262143L < 32767))  */
2224   if ((min_halfword > 0)||(max_halfword < 32767))  bad = 12;
2225 /*  if ((0 < 0)||(255 > 262143L))  */
2226   if ((min_quarterword < min_halfword)||(max_quarterword > max_halfword)) 
2227     bad = 13; 
2228 /*  if ((mem_min < 0)||(mem_max >= 262143L)||(-0 - mem_min > 262144L))  */
2229   if ((mem_min < min_halfword)||(mem_max >= max_halfword)||(mem_bot - mem_min >= max_halfword)) 
2230     bad = 14; 
2231 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2232   if (mem_max > mem_top + mem_extra_high)     /* not compile time */
2233     bad = 14;       /* ha ha */
2234 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2235 /*  if ((0 < 0)||(font_max > 255)) */
2236   if ((0 < min_quarterword)||(font_max > max_quarterword))  /* 93/Dec/3 */
2237     bad = 15; 
2238 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2239 #ifdef INCREASEFONTS
2240 /*  if (font_max > 512)*/             /* 93/Dec/3 */
2241   if (font_max > 1024)                /* 96/Jan/17 */
2242 #else
2243 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2244   if (font_max > 256) 
2245 #endif
2246     bad = 16; 
2247 /*  if ((save_size > 262143L)||(max_strings > 262143L)) */
2248   if ((save_size > max_halfword)||(max_strings > max_halfword)) 
2249     bad = 17; 
2250 /*  if (buf_size > 262143L)*/
2251   if (buf_size > max_halfword)bad = 18; 
2252 /*  if (255 < 255) */
2253   if (max_quarterword - min_quarterword < 255) bad = 19; 
2254 /* if cs_token_flag + undefined_control_sequence > max_halfword then bad <- 21;*/
2255 /*  if ((hash_size + 4876) > 262143L)*/
2256 /*  if ((hash_size + 4876) > max_halfword) */
2257   if ((hash_size + 4095 + 781) > max_halfword) bad = 21; 
2258   if (format_default_length > PATHMAX)  bad = 31; 
2259 /*  if (2 * 262143L < mem_top - mem_min) */
2260   if (max_halfword < (mem_top - mem_min) / 2) bad = 41; 
2261   if (bad > 0) {
2262     sprintf(log_line,  "%s%s%ld\n",  "Ouch---my internal constants have been clobbered!",
2263       "---case ", (long) bad); 
2264   show_line(log_line, 1);
2265     if (! knuth_flag) 
2266     bad_formator_pool(format_file, "the format file", "TEXFORMATS");  /* 96/Jan/17 */
2267     goto lab9999;     // abort
2268   } 
2269   initialize(); 
2270   ;
2271 #ifdef INITEX
2272 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2273   if (is_initex) {
2274 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2275     if (!get_strings_started ())
2276       goto lab9999;   // abort
2277     init_prim(); 
2278     init_str_ptr = str_ptr; 
2279     init_pool_ptr = pool_ptr; 
2280     dateandtime(tex_time, day, month, year); 
2281   }
2282 #endif /* INITEX */
2283   ready_already = 314159L;      /* magic number */
2284
2285 lab1:     /* get here directly if ready_already already set ... */
2286   selector = 17; 
2287   tally = 0; 
2288   term_offset = 0; 
2289   file_offset = 0; 
2290   show_line(tex_version, 0); 
2291   sprintf(log_line, " (%s %s)", application, yandyversion);
2292   show_line(log_line, 0);
2293   if (format_ident > 0)slow_print(format_ident); 
2294   print_ln(); 
2295 #ifndef _WINDOWS
2296   fflush(stdout); 
2297 #endif
2298   job_name = 0; 
2299   name_in_progress = false; 
2300   log_opened = false; 
2301   output_file_name = 0; 
2302   {
2303     {
2304       input_ptr = 0;
2305       max_in_stack = 0;
2306       in_open = 0;
2307       high_in_open = 0; /* max_in_open name already used 1999 Jan 17 */
2308       open_parens = 0;
2309       max_open_parens = 0;  /* max_open_parens */
2310       max_buf_stack = 0;
2311       param_ptr = 0;
2312       max_param_stack = 0;
2313 #ifdef ALLOCATEBUFFER
2314 /*    first = current_buf_size; */
2315       memset (buffer, 0, current_buf_size); /* redundant */
2316 #else
2317 /*    first = buf_size; */
2318       memset (buffer, 0, buf_size);     /* redundant ? */
2319 #endif
2320 /*      do {
2321       buffer[first]= 0; 
2322       decr(first); 
2323       } while(!(first == 0)); */
2324       first = 0;              /* 1999/Jan/22 */
2325
2326       scanner_status = 0;
2327       warning_index = 0; /* warning_index:=null; l.7068 */
2328       first = 1;
2329       cur_input.state_field = 33;
2330       cur_input.start_field = 1;
2331       cur_input.index_field = 0;
2332       line = 0;
2333       cur_input.name_field = 0;
2334       force_eof = false;
2335       align_state = 1000000L;
2336       if (!init_terminal ())
2337         goto lab9999; // abort
2338       cur_input.limit_field = last;
2339       first = last + 1; 
2340     } 
2341 /*    if ((format_ident == 0)||(buffer[cur_input.loc_field]== 38)) */
2342 /*    For Windows NT, lets allow + instead of & for format specification */
2343     if ((format_ident == 0) ||
2344       (buffer[cur_input.loc_field] == '&') ||
2345       (buffer[cur_input.loc_field] == '+'))
2346     {
2347       if (format_ident != 0)
2348         initialize(); 
2349       if (!open_fmt_file ())
2350         goto lab9999; // abort
2351       if (!load_fmt_file ())
2352       {
2353         w_close(fmt_file);
2354         goto lab9999; // abort
2355       } 
2356       w_close(fmt_file); 
2357       while((cur_input.loc_field < cur_input.limit_field) &&
2358         (buffer[cur_input.loc_field] == 32))
2359         incr(cur_input.loc_field);
2360     }
2361 #ifdef CHECKEQTB
2362   if (debug_flag) check_eqtb("after format"); /* debugging 94/Apr/5 */
2363 #endif
2364     if ((end_line_char < 0) || (end_line_char > 255))
2365       decr(cur_input.limit_field);
2366     else
2367       buffer[cur_input.limit_field] = end_line_char;
2368     dateandtime(tex_time, day, month, year);
2369     magic_offset = str_start[886]- 9 * 16;  /* following: */
2370 /*  "0234000122*4000133**3**344*0400400*000000234000111*1111112341011" */
2371     if (interaction == 0)
2372       selector = 16;
2373     else
2374       selector = 17; 
2375      if ((cur_input.loc_field < cur_input.limit_field) &&
2376        (eqtb[(hash_size + 1883) + buffer[cur_input.loc_field]].hh.v.RH != 0))
2377        start_input();
2378   }
2379
2380 /*  show font TFMs frozen into format file */
2381 /*  moved here after start_input to ensure the log file is open */
2382   if (show_tfm_flag && log_opened && font_ptr > 0)    /* 98/Sep/28 */
2383     show_frozen();
2384
2385
2386 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2387   main_time = clock();
2388 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2389   history = 0; 
2390
2391   if (show_cs_names)
2392     print_cs_names(stdout, 0);    /* 98/Mar/31 */
2393
2394   main_control();     /* read-eval-print loop :-) in tex8.c */
2395
2396 //  what if abort_flag is set now ?
2397
2398   if (show_cs_names)
2399     print_cs_names(stdout, 1);    /* 98/Mar/31 */
2400
2401 //  what if abort_flag is set now ?
2402
2403   final_cleanup();
2404
2405 //  if (abort_flag) return -1;
2406
2407   close_files_and_terminate(); 
2408
2409 lab9999:
2410   {
2411     int code;
2412 #ifndef _WINDOWS
2413     fflush(stdout); 
2414 #endif
2415     ready_already = 0; 
2416     if ((history != 0) && (history != 1))
2417       code = 1;
2418     else code = 0;
2419 //    now return instead of exit to allow cleanup in local.c
2420     return code;
2421 //    uexit(code);  
2422   }
2423 } /* end of texbody */
2424
2425 #ifdef ALLOCATEMAIN
2426 /* add a block of variable size node space below mem_bot */
2427 /* used in tex0.c, local.c, itex.c */
2428 void add_variable_space(int size)
2429 {
2430   halfword p;
2431   halfword q;
2432   integer t;
2433
2434   if (mem_min == 0)
2435     t = mem_min;  /* bottom of present block */
2436   else
2437     t = mem_min + 1;
2438
2439   mem_min = t - (size + 1);     /* first word in new block - 1 */
2440 /*  mem_min = mem_start; */     /* allocate all of it at once */
2441   if (mem_min < mem_start)      /* sanity test */
2442   {
2443     if (trace_flag)
2444       show_line("WARNING: mem_min < mem_start!\n", 0);
2445     mem_min = mem_start;
2446   }
2447   p = mem[rover + 1].hh.v.LH;
2448   q = mem_min + 1;
2449   mem[mem_min].hh.v.RH = 0; /* insert blank word below ??? */
2450   mem[mem_min].hh.v.LH = 0; /* insert blank word below ??? */
2451   mem[p + 1].hh.v.RH = q;
2452   mem[rover + 1].hh.v.LH = q;
2453   mem[q + 1].hh.v.RH = rover;
2454   mem[q + 1].hh.v.LH = p;
2455   mem[q].hh.v.RH = empty_flag;
2456   mem[q].hh.v.LH = t - q; /* block size */
2457   rover = q;
2458 }
2459 #endif
2460
2461 /*************************************************************************/
2462 /* All ini TeX code is here at end so can use same pragma optimize for it */
2463 /* Ini-TeX code is rarely needed/used so make it small rather than fast */
2464
2465 #pragma optimize("t", off)
2466 #pragma optimize("s", on)
2467
2468 #ifdef INITEX
2469 /* split out to allow sharing of code from do_initex and newpattern */
2470 void reset_trie (void)
2471 {
2472   integer k;
2473   for (k = - (integer) trie_op_size; k <= trie_op_size; k++)
2474     trie_op_hash[k] = 0;
2475   for (k = 0; k <= 255; k++)
2476     trie_used[k] = min_trie_op;
2477   max_op_used = min_trie_op;
2478   trie_op_ptr = 0;
2479   trie_not_ready = true;
2480   trie_l[0] = 0;
2481   trie_c[0] = 0;
2482   trie_ptr = 0;
2483   trie_not_ready = true;
2484 }
2485 /* borrowed code from initialize() */
2486 void reset_hyphen (void)
2487 {
2488   hyph_pointer z;
2489
2490   for (z = 0; z <= hyphen_prime; z++)
2491   {
2492     hyph_word[z] = 0;
2493     hyph_list[z] = 0; /* hyph_list[z]:=null; l.18131 */
2494   } 
2495   hyph_count = 0;
2496 }
2497 /* split out to allow optimize for space, not time */
2498 void do_initex (void)
2499
2500 /*  integer i; */
2501   integer k; 
2502 /*  hyph_pointer z; */
2503
2504 /* -> 0164 */
2505   for (k = mem_bot + 1; k <= lo_mem_stat_max; k++)
2506     mem[k].cint = 0;
2507   k = mem_bot;
2508   while(k <= lo_mem_stat_max)
2509   {
2510     glue_ref_count(k) = 1;
2511     stretch_order(k) = normal;
2512     shrink_order(k) = normal;
2513     k = k + glue_spec_size;
2514   }
2515   stretch(fil_glue) = 65535L;
2516   stretch_order(fil_glue) = fil;
2517   stretch(fill_glue) = 65535L;
2518   stretch_order(fill_glue) = fill;
2519   stretch(ss_glue) = 65535L;
2520   stretch_order(ss_glue) = fil;
2521   shrink(ss_glue) = 65535L;
2522   shrink_order(ss_glue) = fil; 
2523   stretch(fil_neg_glue) = -65536L;
2524   stretch_order(fil_neg_glue) = fil;
2525   rover = lo_mem_stat_max + 1;
2526   link(rover) = empty_flag;
2527   node_size(rover) = block_size;
2528   llink(rover) = rover;
2529   rlink(rover) = rover;
2530   lo_mem_max = rover + block_size;
2531   link(lo_mem_max) = 0;
2532   info(lo_mem_max) = 0;
2533   for (k = hi_mem_stat_min; k <= mem_top; k++)
2534     mem[k] = mem[lo_mem_max];
2535   info(omit_template) = end_template_token;
2536   link(end_span) = max_quarterword + 1;
2537   info(end_span) = 0;
2538   type(last_active) = hyphenated;
2539   line_number(last_active) = max_halfword;
2540   subtype(last_active) = 0;
2541   subtype(page_ins_head) = 255;
2542   type(page_ins_head) = split_up;
2543   link(mem_top) = page_ins_head;
2544   type(page_head) = glue_node;
2545   subtype(page_head) = normal;
2546   avail = 0;              /* avail <- null p.164 */
2547   mem_end = mem_top;            /* mem_end <- mem_top */
2548   hi_mem_min = hi_mem_stat_min;
2549   var_used = 20;            /* var_used <- lo_mem_stat_max */
2550   dyn_used = 14;            /* dyn_used <- hi_mem_stat_usage */
2551   eq_type(undefined_control_sequence) = undefined_cs;
2552   equiv(undefined_control_sequence) = 0;
2553   eq_level(undefined_control_sequence) = level_zero;
2554   for (k = active_base; k <= undefined_control_sequence - 1; k++)
2555     eqtb[k]= eqtb[undefined_control_sequence];
2556   eqtb[(hash_size + 782)].hh.v.RH = 0; /* glue_base (hash_size + 782) */
2557   eq_level(glue_base) = level_one;
2558   eqtb[(hash_size + 782)].hh.b0 = 117;
2559   for (k = glue_base + 1; k <= local_base - 1; k++) eqtb[k]= eqtb[glue_base];
2560 /* glue_ref_count(zero_glue):=glue_ref_count(zero_glue)+local_base-glue_base; */
2561 /* local_base - glue_base = 530 = 17 glue_pars + 256 skip + 256 mu_skip */
2562   mem[0].hh.v.RH = mem[0].hh.v.RH + 530; /* mem[mem_bot]? */
2563 /* box(0):=null; eq_type(box_base):=box_ref; eq_level(box_base):=level_one; */
2564   eqtb[(hash_size + 1312)].hh.v.RH = 0; 
2565   eqtb[(hash_size + 1312)].hh.b0 = 118;
2566   eqtb[(hash_size + 1312)].hh.b1 = 1;
2567   for (k = output_routine_loc; k <= toks_base + 255; k++) eqtb[k]= eqtb[undefined_control_sequence];
2568   eqtb[(hash_size + 1578)].hh.v.RH = 0;
2569   eqtb[(hash_size + 1578)].hh.b0 = 119;
2570   eqtb[(hash_size + 1578)].hh.b1 = 1;
2571   for (k = box_base + 1; k <= box_base + 255; k++) eqtb[k]= eqtb[box_base];
2572   eqtb[(hash_size + 1834)].hh.v.RH = 0;
2573   eqtb[(hash_size + 1834)].hh.b0 = 120;
2574   eqtb[(hash_size + 1834)].hh.b1 = 1;
2575   for (k = math_font_base; k <= math_font_base + 47; k++) eqtb[k]= eqtb[cur_font_loc];
2576   eqtb[(hash_size + 1883)].hh.v.RH = 0;
2577   eqtb[(hash_size + 1883)].hh.b0 = 120;
2578   eqtb[(hash_size + 1883)].hh.b1 = 1;
2579   for (k = cat_code_base; k <= int_base - 1; k++) eqtb[k]= eqtb[cat_code_base];
2580   for (k = 0; k <= 255; k++) {
2581     eqtb[(hash_size + 1883) + k].hh.v.RH = 12;
2582     eqtb[(hash_size + 2907) + k].hh.v.RH = k;
2583     eqtb[(hash_size + 2651) + k].hh.v.RH = 1000;
2584   }
2585 /* cat_base == 11383 */ 
2586   eqtb[(hash_size + 1896)].hh.v.RH = car_ret;
2587   eqtb[(hash_size + 1915)].hh.v.RH = spacer;
2588   eqtb[(hash_size + 1975)].hh.v.RH = escape;
2589   eqtb[(hash_size + 1920)].hh.v.RH = comment;
2590   eqtb[(hash_size + 2010)].hh.v.RH = invalid_char;
2591   eqtb[(hash_size + 1883)].hh.v.RH = ignore;
2592 /* for k:="0" to "9" do math_code(k):=hi(k+var_code); */
2593   for (k = '0'; k <= '9'; k++) eqtb[(hash_size + 2907) + k].hh.v.RH = k + 28672;
2594 /* cat_code of uppercase and lowercase letters ... */
2595   for (k = 'A'; k <= 'Z'; k++)
2596   {
2597 /* cat_code ... */
2598     eqtb[(hash_size + 1883) + k].hh.v.RH = 11;
2599     eqtb[(hash_size + 1883) + k + 32].hh.v.RH = 11;
2600 /* mathcode(k) = hi(k + var_code + "100); */ /* '70000 + 256 */
2601     eqtb[(hash_size + 2907) + k].hh.v.RH = k + 28928; /* '70000 + 256 */
2602 /* mathcode(k + "a" - "A") = hi(k + "a" - "A" + var_code + "100); */
2603     eqtb[(hash_size + 2907) + k + 32].hh.v.RH = k + 28960; /* '70000 + 256 + 32 */
2604 /* lc_code ... */
2605     eqtb[(hash_size + 2139) + k].hh.v.RH = k + 32;
2606     eqtb[(hash_size + 2139) + k + 32].hh.v.RH = k + 32;
2607 /* uc_code ... */
2608     eqtb[(hash_size + 2395) + k].hh.v.RH = k;
2609     eqtb[(hash_size + 2395) + k + 32].hh.v.RH = k;
2610 /* sf_code */
2611     eqtb[(hash_size + 2651) + k].hh.v.RH = 999;
2612   }
2613   for (k = int_base; k <= del_code_base - 1; k++) eqtb[k].cint = 0;
2614   mag = 1000;
2615   tolerance = 10000;
2616   hang_after = 1;
2617   max_dead_cycles = 25;
2618   escape_char = 92;
2619   end_line_char = 13;
2620   for (k = 0; k <= 255; k++)
2621     eqtb[(hash_size + 3474) + k].cint = -1; 
2622   eqtb[(hash_size + 3520)].cint = 0;
2623   for (k = dimen_base; k <= eqtb_size; k++)
2624     eqtb[k].cint = 0;
2625 /*  hash_used = 10014;  */ /*   hash_used = frozen_control_sequence */
2626 /* frozen_control_sequence =  hashsize + hashbase p.222 */
2627 /*  hash_used = (hash_size + 514);  */
2628   hash_used = (hash_size + hash_extra + 514); /* 96/Jan/10 */
2629   cs_count = 0; 
2630   if (trace_flag) show_line("itex cs_count = 0 ", 0);   /* debugging */
2631 /* eq_type(frozen_dont_expand) <- dont_expand; */
2632 /*  eqtb[10023].hh.b0 = 116;  */
2633 /*  eqtb[(hash_size + 523)].hh.b0 = 116;  */
2634   eqtb[(hash_size + hash_extra + 523)].hh.b0 = dont_expand;
2635 /*  hash[(hash_size + 523)].v.RH = 499;  */
2636   hash[(hash_size + hash_extra + 523)].v.RH = 499;  /* notexpanded */
2637 /* @<Initialize table...@>= l.10750 */
2638   font_ptr = 0;       /* font_ptr:=null_font; */
2639   fmem_ptr = 7;       /* fmem_ptr:=7; */
2640   font_name[0] = 795; /* nullfont */
2641   font_area[0] = 335; /* "" */
2642   hyphen_char[0] = 45;  /* - */
2643   skew_char[0] = -1; 
2644 /* ************************************************************************ */
2645 /* bchar_label[null_font]:=non_address; */ /* 3.14159 */
2646 /*  bchar_label[0]= font_mem_size; */ /* OK ? 93/Nov/26 */
2647   bchar_label[0]= non_address;  /* i.e. 0 --- 96/Jan/16  */
2648 /* ************************************************************************ */
2649   font_bchar[0]       = 256; /* font_bchar[null_font]:=non_char; */
2650   font_false_bchar[0] = 256; /* font_false_bchar[null_font]:=non_char; */
2651   font_bc[0]          = 1;
2652   font_ec[0]          = 0;
2653   font_size[0]        = 0;
2654   font_dsize[0]       = 0;
2655   char_base[0]        = 0;
2656   width_base[0]       = 0;
2657   height_base[0]      = 0;
2658   depth_base[0]       = 0;
2659   italic_base[0]      = 0;
2660   lig_kern_base[0]    = 0;
2661   kern_base[0]        = 0;
2662   exten_base[0]       = 0;
2663   font_glue[0]        = 0;
2664   font_params[0]      = 7;
2665   param_base[0]       = -1;
2666 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***  */
2667   reset_trie();         /* shared 93/Nov/26 */
2668 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***  */
2669 /*  {register integer for_end; k = 0; for_end = 6; if (k <= for_end) do 
2670     font_info[k].cint = 0; 
2671   while(k++ < for_end); } 
2672   {register integer for_end; k = - (integer) trie_op_size; for_end = 
2673   trie_op_size; if (k <= for_end) do 
2674     trie_op_hash[k]= 0; 
2675   while(k++ < for_end); } 
2676   {register integer for_end; k = 0; for_end = 255; if (k <= for_end) do 
2677     trie_used[k]= min_trie_op; 
2678   while(k++ < for_end); } 
2679   max_op_used = min_trie_op; 
2680   trie_op_ptr = 0; 
2681   trie_not_ready = true; 
2682   trie_l[0]= 0; 
2683   trie_c[0]= 0; 
2684   trie_ptr = 0; */
2685 /* text(frozen_protection):="inaccessible"; */
2686 /*  hash[10014].v.RH = 1183; */
2687 /*  hash[(hash_size + 514)].v.RH = 1184;  */
2688   hash[(hash_size + hash_extra + 514)].v.RH = 1184; /* 1183 */
2689   format_ident = 1251;  /* 1250 */
2690 /*  hash[(hash_size + 522)].v.RH = 1290; */ /* 1288 */
2691   hash[(hash_size + hash_extra + 522)].v.RH = 1290; /* 1288 */
2692 /*  eqtb[(hash_size + 522)].hh.b1 = 1;  */
2693   eqtb[(hash_size + hash_extra + 522)].hh.b1 = 1; 
2694 /*  eqtb[(hash_size + 522)].hh.b0 = 113;  */
2695   eqtb[(hash_size + hash_extra + 522)].hh.b0 = 113; 
2696 /*  eqtb[(hash_size + 522)].hh.v.RH = 0;  */
2697   eqtb[(hash_size + hash_extra + 522)].hh.v.RH = 0; 
2698
2699 #endif /* INITEX */
2700
2701 #ifdef INITEX
2702 /* starts string pool with strings for 256 chars and then reads tex.pool */
2703 /* adjusted to try both "tex.pool" and "tex.poo" 95/Feb/19               */
2704 /* I have added a texpool file, but I need merge the pool to the binary  */
2705 /* lots of things updates the kpathsea sources -- Clerk Ma               */
2706 bool get_strings_started (void)
2707 {
2708   register bool Result;
2709   unsigned char k, l;
2710   ASCII_code m, n;
2711   str_number g;
2712   integer a;
2713   bool c;
2714 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2715   int flag; /* 95/Feb/19 */
2716 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2717   pool_ptr = 0;
2718   str_ptr = 0;
2719   str_start[0] = 0;
2720   {
2721     register integer for_end;
2722     k = 0;
2723     for_end = 255;
2724     if (k <= for_end) 
2725       do {
2726         if (((k < 32) || (k > 126))) {
2727           append_char('^');
2728           append_char('^');
2729           if (k < 64)
2730             append_char(k + 64);
2731           else if (k < 128)
2732             append_char(k - 64);
2733           else {
2734             l = k / 16;
2735             if (l < 10) {
2736               str_pool[pool_ptr] = l + 48; /* '0' */
2737               incr(pool_ptr);
2738             } else {
2739               str_pool[pool_ptr] = l + 87; /* 'a' - 10 */
2740               incr(pool_ptr);
2741             }
2742             l = k % 16;
2743             if (l < 10) {
2744               str_pool[pool_ptr] = l + 48; /* '0' */
2745               incr(pool_ptr);
2746             } else {
2747               str_pool[pool_ptr] = l + 87; /* 'a' - 10 */
2748               incr(pool_ptr);
2749             }
2750           }
2751         } else append_char(k);
2752         g = make_string();
2753       } while(k++ < for_end);
2754   }
2755   vstrcpy((char *) name_of_file + 1, pool_name);
2756   name_of_file[0] = ' ';
2757   name_of_file[strlen(pool_name) + 1] = ' '; 
2758   name_length = strlen(pool_name);
2759 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2760 /*  if (a_open_in(pool_file, TEXPOOLPATH))  */
2761   flag = a_open_in(pool_file, TEXPOOLPATH);
2762   if (flag == 0) /* 95/Feb/19 */
2763   {
2764     pool_name [name_length - 1] = '\0'; /* `tex.pool' => `tex.poo' */
2765     vstrcpy((char *) name_of_file + 1, pool_name);
2766     name_of_file[0]= ' ';
2767     name_of_file[strlen(pool_name) + 1]= ' ';
2768     name_length = strlen(pool_name);
2769     flag = a_open_in(pool_file, TEXPOOLPATH);
2770   }
2771   if (flag) {
2772     c = false;
2773     do {
2774       {
2775 /* if (eof(pool_file)) */ /* feof(pool_file)??? */
2776         if (test_eof(pool_file)) {
2777           ;
2778 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2779           show_line("! string pool file has no check sum.\n", 1);
2780 /* added following bit of explanation 96/Jan/16 */
2781           if (! knuth_flag)
2782             bad_formator_pool(string_file, "the pool file", "TEXPOOL");
2783 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2784           (void) a_close(pool_file);
2785           Result = false;
2786           return(Result);
2787         }
2788         read(pool_file, m);
2789         read(pool_file, n);
2790         if (m == '*') /* last line starts with * */
2791         {
2792           a = 0;
2793           k = 1;
2794           while (true) {
2795             if ((xord[n]< 48)||(xord[n]> 57)) {
2796               ; 
2797 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2798               show_line("! string pool file check sum doesn't have nine digits.\n", 1);
2799 /* added following bit of explanation 96/Jan/16 */
2800               if (!knuth_flag)
2801                 bad_formator_pool(string_file, "the pool file", "TEXPOOL");
2802 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2803               (void) a_close(pool_file);
2804               Result = false;
2805               return(Result);
2806             }
2807             a = 10 * a + xord[n]- 48;
2808             if (k == 9)
2809               goto lab30;
2810             incr(k);
2811             read(pool_file, n);
2812           } 
2813 /* tex.pool file check sum *367403084 */
2814 lab30: 
2815           if (a != BEGINFMTCHECKSUM) {
2816             ; 
2817 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2818             show_line("! string pool check sum doesn't match; tangle me again.\n", 1);
2819 /* added following bit of explanation 96/Jan/16 */
2820             if (!knuth_flag)
2821               bad_formator_pool(string_file, "the pool file", "TEXPOOL");
2822 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2823             (void) a_close(pool_file);
2824             Result = false;
2825             return(Result);
2826           }
2827           c = true;
2828         } else {
2829           if ((xord[m] < 48)||(xord[m] > 57)||(xord[n] < 48)||(xord[n] > 57)) 
2830           {
2831             ; 
2832 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2833             show_line("! string pool line doesn't begin with two digits.\n", 1);
2834 /* added following bit of explanation 96/Jan/16 */
2835             if (! knuth_flag)
2836               bad_formator_pool(string_file, "the pool file", "TEXPOOL");
2837 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2838             (void) a_close(pool_file);
2839             Result = false;
2840             return(Result);
2841           }
2842           l = xord[m]* 10 + xord[n]- 48 * 11;
2843 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2844 #ifdef ALLOCATESTRING
2845 /* can freely extend memory, so we need not be paranoid - stringvacancies */
2846 /* if (pool_ptr + l + stringvacancies > current_pool_size)*/
2847           if (pool_ptr + l + stringmargin > current_pool_size) {
2848             if (trace_flag)
2849               show_line("String margin reallocation\n", 0);
2850 /* str_pool =  realloc_str_pool (pool_ptr + l + stringvacancies */
2851             str_pool =  realloc_str_pool (pool_ptr + l + stringmargin - current_pool_size  + increment_pool_size);
2852           }
2853           if (pool_ptr + l + stringmargin > current_pool_size) /* 94/Jan/24 */
2854 #else
2855 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2856           if (pool_ptr + l + stringvacancies > pool_size)
2857 #endif
2858           {
2859             ;
2860             show_line("! You have to increase POOLSIZE.\n", 1);
2861             (void) a_close(pool_file);
2862             Result = false;
2863             return(Result);
2864           }
2865           {
2866             register integer for_end;
2867             k = 1;
2868             for_end = l;
2869             if (k <= for_end) 
2870               do {
2871                 if (eoln(pool_file))
2872                   m = ' ';
2873                 else read(pool_file, m);
2874                 {
2875                   str_pool[pool_ptr] = xord[m];
2876                   incr(pool_ptr);
2877                 }
2878               } while(k++ < for_end);
2879           }
2880           readln(pool_file); /* flush rest to end of file / end of line */
2881           g = make_string();
2882         }
2883       }
2884     } while (!(c));
2885     (void) a_close(pool_file);
2886     Result = true;
2887   } else {
2888     ; 
2889 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2890     sprintf(log_line, "! I can't read %s.\n", pool_name);
2891     show_line(log_line, 1);
2892     if (!knuth_flag)
2893       show_line("  (Was unable to find tex.poo or tex.pool)\n", 0); /* extra explain */
2894 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2895     Result = false;
2896     return(Result); 
2897   }
2898   return Result;
2899 }
2900 #endif /* INITEX */
2901
2902 #ifdef INITEX
2903 void sort_avail (void) 
2904
2905   halfword p, q, r;
2906   halfword old_rover;
2907   p = get_node(1073741824L); /* 2^30 merge adjacent free nodes */
2908   p = rlink(rover);
2909   rlink(rover) = empty_flag;
2910   old_rover = rover;
2911   while (p != old_rover)
2912     if (p < rover) {
2913       q = p;
2914       p = rlink(q);
2915       rlink(q) = rover;
2916       rover = q;
2917     } else {
2918       q = rover;
2919       while (rlink(q) < p)
2920         q = rlink(q);
2921       r = rlink(p);
2922       rlink(p) = rlink(q);
2923       rlink(q) = p;
2924       p = r;
2925     }
2926   p = rover;
2927   while (rlink(p) != empty_flag) {
2928     llink(rlink(p)) = p;
2929     p = rlink(p);
2930   }
2931   mem[p + 1].hh.v.RH = rover; 
2932   llink(rover) = p; 
2933
2934 #endif /* INITEX */
2935
2936 #ifdef INITEX
2937 /*****************APTEX********************/
2938 /*
2939 str_number make_string_pool (char *s)
2940 {
2941   while (*s != '\0') {
2942     append_char(*s); incr(s);
2943   }
2944   return (make_string());
2945 }
2946 void primitive_s (char * s, quarterword c, halfword o)
2947 {
2948   pool_pointer k, l;
2949   small_number j;
2950   str_number prim_str;
2951   if (s[1] = '\0')
2952     cur_val = s[0] + single_base;
2953   else {
2954     prim_str = make_string_pool(s);
2955     k = str_start[prim_str]; l = str_start[prim_str] - k;
2956     for (j = 0; j < l; incr(j)) buffer[j] = str_pool[k + j];
2957     cur_val = id_lookup(0, l);
2958     flush_string();
2959     hash[cur_val].v.RH = prim_str;
2960   }
2961   eq_level(cur_val) = level_one; eq_type(cur_val) = c; equiv(cur_val) = o;
2962 }
2963 */
2964 /*****************APTEX********************/
2965 void primitive_ (str_number s, quarterword c, halfword o)
2966
2967   pool_pointer k;
2968   small_number j;
2969 /*  small_number l;  */
2970   int l; /* 95/Jan/7 */
2971   if (s < 256)
2972     cur_val = s + 257; /* cur_val <- s + single_base; p.264 */
2973   else {
2974     k = str_start[s];
2975     l = str_start[s + 1] - k; /* small_number l */
2976     {
2977       register integer for_end;
2978       j = 0;
2979       for_end = l - 1;
2980       if (j <= for_end)
2981         do buffer[j]= str_pool[k + j];
2982         while(j++ < for_end);
2983     }
2984     cur_val = id_lookup(0, l);
2985     flush_string();
2986 /* **********************  debugging only  96/Jan/20 should not happen */
2987 #ifdef SHORTHASH
2988     if (s > 65535L)
2989       show_line("ERROR: hash entry too large\n", 1);
2990 #endif
2991     hash[cur_val].v.RH = s;
2992   }
2993   eqtb[cur_val].hh.b1 = 1;
2994   eqtb[cur_val].hh.b0 = c;
2995   eqtb[cur_val].hh.v.RH = o;
2996
2997 #endif /* INITEX */
2998
2999 /* more weird constants ? page 394 */
3000
3001 #ifdef INITEX
3002 trie_op_code new_trie_op_ (small_number d, small_number n, trie_op_code v)
3003 {
3004   register trie_op_code Result;
3005   integer h;
3006   trie_op_code u;
3007   integer l;
3008 /* the 313, 361 and 1009 are hard-wired constants here p.944 */
3009 /* begin h:=abs(n+313*d+361*v+1009*cur_lang) mod (trie_op_size+trie_op_size) */
3010   h = abs(toint(n) + 313 * toint(d) + 361 * toint(v) + 1009 *
3011     toint(cur_lang)) % (trie_op_size - neg_trie_op_size) + neg_trie_op_size;
3012   while (true) {
3013 /*  if l=0 then {empty position found for a new op} */
3014     l = trie_op_hash[h];
3015     if (l == 0) {
3016       if (trie_op_ptr == trie_op_size) {
3017         overflow("pattern memory ops", trie_op_size); /* pattern memory ops  - NOT DYNAMIC */
3018         return 0;     // abort_flag set
3019       }
3020       u = trie_used[cur_lang];
3021 /*    if u=max_quarterword then ??? */
3022       if (u == max_trie_op) {
3023 /*      overflow("pattern memory ops per language", max_quarterword-min_quarterword); ??? */
3024         overflow("pattern memory ops per language", max_trie_op - min_trie_op); /* pattern memory ops per language */
3025         return 0;     // abort_flag set
3026       }
3027       incr(trie_op_ptr);
3028       incr(u);
3029       trie_used[cur_lang] = u;
3030       if (u > max_op_used)
3031         max_op_used = u;
3032       hyf_distance[trie_op_ptr] = d;
3033       hyf_num[trie_op_ptr] = n;
3034       hyf_next[trie_op_ptr] = v;
3035       trie_op_lang[trie_op_ptr] = cur_lang;
3036       trie_op_hash[h] = trie_op_ptr;
3037       trie_op_val[trie_op_ptr] = u;
3038       Result = u;
3039       return(Result);
3040     }
3041     if ((hyf_distance[l]== d) && (hyf_num[l]== n) &&
3042       (hyf_next[l]== v) && (trie_op_lang[l]== cur_lang)) {
3043         Result = trie_op_val[l];
3044         return(Result);
3045     }
3046     if (h > - (integer) trie_op_size)
3047       decr(h);
3048     else h = trie_op_size;
3049   }
3050 /* return Result;  */ /* unreachable code */
3051 }
3052 /* what are those horrible constants there ? page 395 */
3053 trie_pointer trie_node_ (trie_pointer p)
3054 {
3055   register trie_pointer Result;
3056   trie_pointer h;
3057   trie_pointer q;
3058 /* the 1009, 2718, 3142 are hard-wired constants here (not hyphen_prime) */
3059   h = abs(toint(trie_c[p]) + 1009 * toint(trie_o[p]) + 2718 * 
3060   toint(trie_l[p]) + 3142 * toint(trie_r[p])) % trie_size;
3061   while (true) {
3062     q = trie_hash[h];
3063     if (q == 0) {
3064       trie_hash[h]= p;
3065       Result = p;
3066       return(Result);
3067     }
3068     if ((trie_c[q] == trie_c[p]) && (trie_o[q] == trie_o[p]) &&
3069       (trie_l[q]== trie_l[p]) && (trie_r[q]== trie_r[p])) {
3070         Result = q;
3071         return(Result);
3072     }
3073     if (h > 0)
3074       decr(h);
3075     else h = trie_size;
3076   } 
3077 /* return Result;  */ /* unreachable code */
3078 }
3079 trie_pointer compress_trie_ (trie_pointer p)
3080 {
3081   register trie_pointer Result;
3082   if (p == 0)
3083     Result = 0;
3084   else {
3085     trie_l[p] = compress_trie(trie_l[p]);
3086     trie_r[p] = compress_trie(trie_r[p]);
3087     Result = trie_node(p);
3088   }
3089   return Result;
3090 }
3091 void first_fit_ (trie_pointer p)
3092 {
3093   trie_pointer h;
3094   trie_pointer z;
3095   trie_pointer q;
3096   ASCII_code c;
3097   trie_pointer l, r;
3098   short ll;
3099   c = trie_c[p];
3100   z = trie_min[c];
3101   while (true) {
3102     h = z - c;
3103     if (trie_max < h + 256) {
3104       if (trie_size <= h + 256) {
3105         overflow("pattern memory", trie_size);  /* pattern memory - NOT DYNAMIC */
3106 /*      not dynamic ---- but can be set -h=... from command line in ini-TeX */
3107         return;     // abort_flag set
3108       }
3109       do {
3110         incr(trie_max);
3111         trie_taken[trie_max]= false;
3112         trie_trl[trie_max]= trie_max + 1;
3113         trie_tro[trie_max]= trie_max - 1;
3114       } while (!(trie_max == h + 256));
3115     }
3116     if (trie_taken[h])
3117       goto lab45;
3118     q = trie_r[p];
3119     while (q > 0) {
3120       if (trie_trl[h + trie_c[q]] == 0)
3121         goto lab45;
3122       q = trie_r[q];
3123     }
3124     goto lab40;
3125 lab45:
3126     z = trie_trl[z];
3127   }
3128 lab40:
3129   trie_taken[h] = true; /* h may be used without ... */
3130   trie_hash[p] = h;
3131   q = p;
3132   do {
3133     z = h + trie_c[q];
3134     l = trie_tro[z];
3135     r = trie_trl[z];
3136     trie_tro[r]= l;
3137     trie_trl[l]= r;
3138     trie_trl[z]= 0;
3139     if (l < 256) {
3140       if (z < 256)
3141         ll = z;         /* short ll */
3142       else
3143         ll = 256;
3144       do {
3145         trie_min[l] = r;
3146         incr(l);
3147       } while (!(l == ll));
3148     }
3149     q = trie_r[q];
3150   } while (!(q == 0));
3151 }
3152 void trie_pack_ (trie_pointer p) 
3153 {
3154   trie_pointer q; 
3155   do {
3156       q = trie_l[p]; 
3157     if ((q > 0)&&(trie_hash[q]== 0)) 
3158     {
3159       first_fit(q); 
3160       trie_pack(q); 
3161     } 
3162     p = trie_r[p]; 
3163   } while(!(p == 0)); 
3164
3165 void trie_fix_ (trie_pointer p)
3166
3167   trie_pointer q; 
3168   ASCII_code c; 
3169   trie_pointer z; 
3170   z = trie_hash[p]; 
3171   do {
3172       q = trie_l[p]; 
3173     c = trie_c[p]; 
3174     trie_trl[z + c]= trie_hash[q]; 
3175     trie_trc[z + c]= c; 
3176     trie_tro[z + c]= trie_o[p]; 
3177     if (q > 0)
3178     trie_fix(q); 
3179     p = trie_r[p]; 
3180   } while(!(p == 0)); 
3181
3182 void new_patterns (void) 
3183 {
3184 /* ******************************************************************* */
3185 /*  was small_number k, l;  in 3.141 */
3186   char k, l; 
3187 /* ******************************************************************* */
3188   bool digitsensed; 
3189   trie_op_code v; 
3190   trie_pointer p, q; 
3191   bool firstchild; 
3192 /*  ASCII_code c;  */
3193   int c;                /* 95/Jan/7 */
3194 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3195   if (!trie_not_ready)
3196   {          /* new stuff */
3197     if (allow_patterns)
3198     { 
3199       if (trace_flag)
3200         show_line("Resetting patterns\n", 0);
3201       reset_trie();         /* RESET PATTERNS -  93/Nov/26 */
3202       if (reset_exceptions)
3203       {
3204         if (trace_flag)
3205           show_line("Resetting exceptions\n", 0);
3206         reset_hyphen();     /* RESET HYPHENEXCEPTIONS -  93/Nov/26 */
3207       }
3208     }
3209   }
3210 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3211   if (trie_not_ready) {
3212     if (language <= 0)
3213       cur_lang = 0;
3214     else if (language > 255)
3215       cur_lang = 0;
3216     else cur_lang = language;
3217     scan_left_brace();
3218     k = 0;
3219     hyf[0] = 0;
3220     digitsensed = false;
3221     while (true) {
3222       get_x_token();
3223       switch (cur_cmd) {
3224       case 11:
3225       case 12:
3226         if (digitsensed || (cur_chr < 48) || (cur_chr > 57)) {
3227           if (cur_chr == '.')
3228             cur_chr = 0;
3229           else {
3230             cur_chr = eqtb[(hash_size + 2139) + cur_chr].hh.v.RH;
3231             if (cur_chr == 0) {
3232               print_err("Nonletter");
3233               help1("(See Appendix H.)");
3234               error();
3235             }
3236           }
3237           if (k < 63) {
3238             incr(k);
3239             hc[k] = cur_chr;
3240             hyf[k] = 0;
3241             digitsensed = false;
3242           }
3243         } else if (k < 63) {
3244           hyf[k] = cur_chr - 48;
3245           digitsensed = true;
3246         }
3247         break; 
3248       case 10:
3249       case 2:
3250         {
3251           if (k > 0) {
3252             if (hc[1]== 0)
3253               hyf[0] = 0;
3254             if (hc[k]== 0)
3255               hyf[k] = 0;
3256             l = k;
3257             v = min_trie_op;
3258             while (true) {
3259               if (hyf[l]!= 0)
3260                 v = new_trie_op(k - l, hyf[l], v);
3261               if (l > 0)
3262                 decr(l);
3263               else
3264                 goto lab31;
3265             }
3266 lab31:;
3267             q = 0;
3268             hc[0]= cur_lang;
3269             while (l <= k) {
3270               c = hc[l];
3271               incr(l);
3272               p = trie_l[q];
3273               firstchild = true;
3274               while ((p > 0) && (c > trie_c[p])) {
3275                 q = p;
3276                 p = trie_r[q];
3277                 firstchild = false;
3278               }
3279               if ((p == 0) || (c < trie_c[p])) {
3280                 if (trie_ptr == trie_size) {
3281                   overflow("pattern memory", trie_size);  /* pattern memory - NOT DYNAMIC */
3282 /*      not dynamic ---- but can be set -h=... from command line in ini-TeX */
3283                   return;     // abort_flag set
3284                 }
3285                 incr(trie_ptr);
3286                 trie_r[trie_ptr] = p;
3287                 p = trie_ptr;
3288                 trie_l[p] = 0;
3289                 if (firstchild)
3290                   trie_l[q]= p;
3291                 else trie_r[q]= p;
3292                 trie_c[p] = c;
3293                 trie_o[p] = min_trie_op;
3294               }
3295               q = p;
3296             }
3297             if (trie_o[q]!= min_trie_op) {
3298               print_err("Duplicate pattern");
3299               help1("(See Appendix H.)");
3300               error();
3301             }
3302             trie_o[q]= v;
3303           }
3304           if (cur_cmd == 2)
3305             goto lab30;
3306           k = 0;
3307           hyf[0] = 0;
3308           digitsensed = false;
3309         }
3310         break;
3311       default:
3312         {
3313           print_err("Bad ");
3314           print_esc("patterns");
3315           help1("(See Appendix H.)");
3316           error();
3317         }
3318         break;
3319       }
3320     }
3321 lab30:;
3322   } else {
3323     print_err("Too late for ");
3324     print_esc("patterns");
3325     help1("All patterns must be given before typesetting begins.");
3326     error();
3327     mem[lig_trick].hh.v.RH = scan_toks(false, false);
3328     flush_list(def_ref);
3329   }
3330 }
3331 void init_trie (void) 
3332 {
3333   trie_pointer p; 
3334 /*  integer j, k, t;  */
3335   integer j, k; 
3336   int t;                  /* 95/Jan/7 */
3337   trie_pointer r, s; 
3338   op_start[0]= - (integer) min_trie_op; 
3339   {
3340     register integer for_end;
3341     j = 1;
3342     for_end = 255;
3343     if (j <= for_end) do 
3344       op_start[j]= op_start[j - 1]+ trie_used[j - 1]; 
3345     while(j++ < for_end);
3346   } 
3347   {
3348     register integer for_end;
3349     j = 1;
3350     for_end = trie_op_ptr;
3351     if (j <= for_end) 
3352       do 
3353         trie_op_hash[j]= op_start[trie_op_lang[j]] + trie_op_val[j]; 
3354     while(j++ < for_end);
3355   } 
3356   {
3357     register integer for_end;
3358     j = 1;
3359     for_end = trie_op_ptr;
3360     if (j <= for_end) 
3361       do 
3362     while(trie_op_hash[j]> j){
3363       k = trie_op_hash[j]; 
3364       t = hyf_distance[k]; 
3365       hyf_distance[k]= hyf_distance[j]; 
3366       hyf_distance[j]= t; 
3367       t = hyf_num[k]; 
3368       hyf_num[k]= hyf_num[j]; 
3369       hyf_num[j]= t; 
3370       t = hyf_next[k]; 
3371       hyf_next[k]= hyf_next[j]; 
3372       hyf_next[j]= t; 
3373       trie_op_hash[j]= trie_op_hash[k]; 
3374       trie_op_hash[k]= k; 
3375     } 
3376     while(j++ < for_end);
3377   } 
3378   {
3379     register integer for_end;
3380     p = 0;
3381     for_end = trie_size;
3382     if (p <= for_end) 
3383       do trie_hash[p]= 0; 
3384     while(p++ < for_end);
3385   } 
3386   trie_l[0]= compress_trie(trie_l[0]); 
3387   {
3388     register integer for_end;
3389     p = 0;
3390     for_end = trie_ptr;
3391     if (p <= for_end) 
3392       do trie_hash[p]= 0; 
3393     while(p++ < for_end);
3394   } 
3395   {
3396     register integer for_end;
3397     p = 0;
3398     for_end = 255;
3399     if (p <= for_end) do 
3400       trie_min[p]= p + 1; 
3401     while(p++ < for_end);
3402   } 
3403   trie_trl[0]= 1; 
3404   trie_max = 0; 
3405   if (trie_l[0]!= 0)
3406   {
3407     first_fit(trie_l[0]); 
3408     trie_pack(trie_l[0]); 
3409   } 
3410   if (trie_l[0]== 0)
3411   {
3412     {
3413     register integer for_end;
3414     r = 0;
3415     for_end = 256;
3416     if (r <= for_end) do 
3417     {
3418       trie_trl[r]= 0; 
3419       trie_tro[r]= min_trie_op; 
3420       trie_trc[r]= 0; 
3421     } 
3422     while(r++ < for_end);
3423   } 
3424     trie_max = 256; 
3425   } 
3426   else {
3427     trie_fix(trie_l[0]); 
3428     r = 0; 
3429     do {
3430   s = trie_trl[r]; 
3431       {
3432   trie_trl[r]= 0; 
3433   trie_tro[r]= min_trie_op; 
3434   trie_trc[r]= 0; 
3435       } 
3436       r = s; 
3437     } while(!(r > trie_max)); 
3438   } 
3439   trie_trc[0]= 63; 
3440   trie_not_ready = false; 
3441
3442 #endif /* INITEX */
3443
3444 #ifdef INITEX
3445 void store_fmt_file (void) 
3446 {
3447   integer j, k, l; 
3448   halfword p, q; 
3449   integer x; 
3450 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3451   if (!is_initex) {     /* redundant check 94/Feb/14 */
3452     show_line("! \\dump is performed only by INITEX\n", 1);
3453     if (! knuth_flag)
3454       show_line("  (Use -i on the command line)\n", 0);
3455     abort_flag++;
3456     return;
3457   }
3458 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3459   if (save_ptr != 0) {
3460     print_err("You can't dump inside a group");
3461     help1("`{...\\dump}' is a no-no..");
3462     succumb();
3463   } /* end of if save_ptr != 0 */
3464
3465   selector = 21; 
3466   print_string(" (format=");
3467   print(job_name); 
3468   print_char(' ');
3469   print_int(year);
3470   print_char('.');
3471   print_int(month); 
3472   print_char('.');
3473   print_int(day); 
3474   print_char(')');
3475   if (interaction == 0) selector = 18; 
3476   else selector = 19; 
3477   {
3478 #ifdef ALLOCATESTRING
3479     if (pool_ptr + 1 > current_pool_size)
3480       str_pool = realloc_str_pool (increment_pool_size);
3481     if (pool_ptr + 1 > current_pool_size) { /* in case it failed 94/Jan/24 */
3482       overflow("pool size", current_pool_size - init_pool_ptr); /* 97/Mar/9 */
3483       return;     // abort_flag set
3484     }
3485 #else
3486     if (pool_ptr + 1 > pool_size) {
3487       overflow("pool size", pool_size - init_pool_ptr); /* pool size */
3488       return;     // abort_flag set
3489     }
3490 #endif
3491   } 
3492   format_ident = make_string(); 
3493   pack_job_name(780);   /* .fmt */
3494   while(! w_open_out(fmt_file)) {
3495     prompt_file_name(1267, 780); /* format file name  .fmt */
3496   }
3497   print_nl(" Beginning to dump on file ");
3498   slow_print(w_make_name_string(fmt_file));
3499   flush_string();
3500   print_nl("");
3501   slow_print(format_ident); 
3502   dump_int(BEGINFMTCHECKSUM); /* magic FMT file start 4C 20 E6 15 hex */
3503 /*  dump_int(0); */
3504   dump_int(mem_bot); 
3505   dump_int(mem_top); 
3506   dump_int((hash_size + 4006)); /* eqtbsize */
3507   dump_int(hash_prime); 
3508 /*  dump_int(607);  */
3509   dump_int(hyphen_prime);   /* bkph */
3510   dump_int(pool_ptr); 
3511   dump_int(str_ptr); 
3512   if (dumpthings(str_start[0], str_ptr + 1)) return;
3513   if (dumpthings(str_pool[0], pool_ptr)) return;
3514   print_ln();
3515   print_int(str_ptr);
3516   print_string(" strings of total length ");
3517   print_int(pool_ptr);
3518   sort_avail();
3519   var_used = 0;
3520   dump_int(lo_mem_max);
3521   dump_int(rover);
3522   p = 0;
3523   q = rover;
3524   x = 0;
3525   do {
3526     if (dumpthings(mem[p], q + 2 - p))
3527       return;
3528     x = x + q + 2 - p;
3529     var_used = var_used + q - p;
3530     p = q + mem[q].hh.v.LH;
3531     q = mem[q + 1].hh.v.RH;
3532   } while (!(q == rover));
3533   var_used = var_used + lo_mem_max - p;
3534   dyn_used = mem_end + 1 - hi_mem_min;
3535   if (dumpthings(mem[p], lo_mem_max + 1 - p)) return;
3536   x = x + lo_mem_max + 1 - p;
3537   dump_int(hi_mem_min);
3538   dump_int(avail);
3539   if (dumpthings(mem[hi_mem_min], mem_end + 1 - hi_mem_min)) return;
3540   x = x + mem_end + 1 - hi_mem_min;
3541   p = avail;
3542   while (p != 0) {
3543     decr(dyn_used);
3544     p = mem[p].hh.v.RH;
3545   }
3546   dump_int(var_used);
3547   dump_int(dyn_used);
3548   print_ln();
3549   print_int(x); 
3550   print_string(" memory locations dumped; current usage is ");
3551   print_int(var_used); 
3552   print_char('&');
3553   print_int(dyn_used); 
3554   k = 1; 
3555   do {
3556     j = k;
3557     while(j < (hash_size + 3162)) {
3558       if ((eqtb[j].hh.v.RH == eqtb[j + 1].hh.v.RH) &&
3559         (eqtb[j].hh.b0 == eqtb[j + 1].hh.b0) &&
3560         (eqtb[j].hh.b1 == eqtb[j + 1].hh.b1))
3561         goto lab41;
3562       incr(j);
3563     }
3564     l = (hash_size + 3163);
3565     goto lab31;
3566 lab41:
3567     incr(j);
3568     l = j;
3569     while (j < (hash_size + 3162)) {
3570       if ((eqtb[j].hh.v.RH != eqtb[j + 1].hh.v.RH) ||
3571         (eqtb[j].hh.b0 != eqtb[j + 1].hh.b0) ||
3572         (eqtb[j].hh.b1 != eqtb[j + 1].hh.b1))
3573         goto lab31;
3574       incr(j);
3575     }
3576 lab31:
3577     dump_int(l - k);
3578     if (dumpthings(eqtb[k], l - k)) return;
3579     k = j + 1;
3580     dump_int(k - l);
3581   } while (!(k == (hash_size + 3163)));
3582   do {
3583     j = k;
3584     while (j < (hash_size + 4006)) {
3585       if (eqtb[j].cint == eqtb[j + 1].cint)
3586         goto lab42;
3587       incr(j);
3588     }
3589     l = (hash_size + 4007);
3590     goto lab32;
3591 lab42:
3592     incr(j);
3593     l = j;
3594     while (j < (hash_size + 4006)) {
3595       if (eqtb[j].cint != eqtb[j + 1].cint)
3596         goto lab32;
3597       incr(j);
3598     }
3599 lab32:
3600     dump_int(l - k);
3601     if (dumpthings(eqtb[k], l - k)) return;
3602     k = j + 1;
3603     dump_int(k - l);
3604   } while (!(k > (hash_size + 4006)));
3605   dump_int(par_loc);
3606   dump_int(write_loc);
3607   dump_int(hash_used);
3608 /*  cs_count:=frozen_control_sequence-1-hash_used; */
3609 /*  cs_count = (hash_size + 513) - hash_used;  */
3610   cs_count = (hash_size + hash_extra + 513) - hash_used;
3611 /*  cs_count = (hash_size + 780) - hash_used;  */ /* ??? */
3612   if (trace_flag) {
3613     sprintf(log_line, "itex cs_count %d hash_size %d hash_extra %d hash_used %d",
3614       cs_count, hash_size, hash_extra, hash_used);      /* debugging */
3615     show_line(log_line, 0);
3616   }
3617 /*  for p <- hash_base to hash_used do */
3618   {
3619     register integer for_end;
3620     p = 514;
3621     for_end = hash_used;
3622     if (p <= for_end) do 
3623       if (hash[p].v.RH != 0) {
3624         dump_int(p);
3625         dump_hh(hash[p]);
3626         incr(cs_count);
3627         if (trace_flag) {
3628           sprintf(log_line, "itex cs_count++ ");
3629           show_line(log_line, 0); /* debugging */
3630         }
3631       } while (p++ < for_end);
3632   }
3633 /*  ??? */
3634 /* for p <- hash_used+1 to undefined_control_sequence-1 do dump_hh(hash[p]) */
3635   if (dumpthings(hash[hash_used + 1], (hash_size + 780) - hash_used)) return;
3636   dump_int(cs_count);
3637   print_ln();
3638   print_int(cs_count);
3639   print_string(" multiletter control sequences");
3640   dump_int(fmem_ptr);
3641   {
3642     if (dumpthings(font_info[0], fmem_ptr)) return;
3643 /*  frozenfontptr = font_ptr; */    /* number of fonts frozen into format */
3644     dump_int(font_ptr);
3645     if (dumpthings(font_check[0], font_ptr + 1)) return;
3646     if (dumpthings(font_size[0], font_ptr + 1)) return;
3647     if (dumpthings(font_dsize[0], font_ptr + 1)) return;
3648     if (dumpthings(font_params[0], font_ptr + 1)) return;
3649     if (dumpthings(hyphen_char[0], font_ptr + 1)) return;
3650     if (dumpthings(skew_char[0], font_ptr + 1)) return;
3651     if (dumpthings(font_name[0], font_ptr + 1)) return;
3652     if (dumpthings(font_area[0], font_ptr + 1)) return;
3653     if (dumpthings(font_bc[0], font_ptr + 1)) return;
3654     if (dumpthings(font_ec[0], font_ptr + 1)) return;
3655     if (dumpthings(char_base[0], font_ptr + 1)) return;
3656     if (dumpthings(width_base[0], font_ptr + 1)) return;
3657     if (dumpthings(height_base[0], font_ptr + 1)) return;
3658     if (dumpthings(depth_base[0], font_ptr + 1)) return;
3659     if (dumpthings(italic_base[0], font_ptr + 1)) return;
3660     if (dumpthings(lig_kern_base[0], font_ptr + 1)) return;
3661     if (dumpthings(kern_base[0], font_ptr + 1)) return;
3662     if (dumpthings(exten_base[0], font_ptr + 1)) return;
3663     if (dumpthings(param_base[0], font_ptr + 1)) return;
3664     if (dumpthings(font_glue[0], font_ptr + 1)) return;
3665     if (dumpthings(bchar_label[0], font_ptr + 1)) return;
3666     if (dumpthings(font_bchar[0], font_ptr + 1)) return;
3667     if (dumpthings(font_false_bchar[0], font_ptr + 1)) return;
3668     {
3669       register integer for_end;
3670       k = 0;
3671       for_end = font_ptr;
3672       if (k <= for_end)
3673         do {
3674           print_nl("\\font");
3675 /*  print_esc(hash[(hash_size + 524) + k].v.RH);  */
3676   //print_esc(hash[(hash_size + hash_extra + 524) + k].v.RH);
3677           print_esc("");print(hash[(hash_size + hash_extra + 524) + k].v.RH);
3678           print_char('=');
3679           print_file_name(font_name[k], font_area[k], 335);
3680           if (font_size[k]!= font_dsize[k]) {
3681             print_string(" at ");
3682             print_scaled(font_size[k]);
3683             print_string("pt");
3684           }
3685         } while (k++ < for_end);
3686     }
3687   }
3688   print_ln();
3689   print_int(fmem_ptr - 7);
3690   print_string(" words of font info for ");
3691   print_int(font_ptr - 0);
3692   print_string(" preloaded font");
3693   if (font_ptr != 1)
3694     print_char('s');
3695   dump_int(hyph_count);
3696 /*  {register integer for_end; k = 0; for_end = 607; if (k <= for_end) do */
3697   {
3698     register integer for_end;
3699     k = 0;
3700     for_end = hyphen_prime;
3701     if (k <= for_end) do
3702       if (hyph_word[k]!= 0)
3703       {
3704         dump_int(k);
3705         dump_int(hyph_word[k]);
3706         dump_int(hyph_list[k]);
3707       } while(k++ < for_end);
3708   }
3709   print_ln();
3710   print_int(hyph_count);
3711   print_string(" hyphenation exception");
3712   if (hyph_count != 1)
3713     print_char('s');
3714   if (trie_not_ready)
3715     init_trie();
3716   dump_int(trie_max);
3717   if (dumpthings(trie_trl[0], trie_max + 1)) return;
3718   if (dumpthings(trie_tro[0], trie_max + 1)) return;
3719   if (dumpthings(trie_trc[0], trie_max + 1)) return;
3720   dump_int(trie_op_ptr);
3721   if (dumpthings(hyf_distance[1], trie_op_ptr)) return;
3722   if (dumpthings(hyf_num[1], trie_op_ptr)) return;
3723   if (dumpthings(hyf_next[1], trie_op_ptr)) return;
3724   print_nl("Hyphenation trie of length ");
3725   print_int(trie_max);
3726   print_string(" has ");
3727   print_int(trie_op_ptr);
3728   print_string(" op");
3729   if (trie_op_ptr != 1)
3730     print_char('s');
3731   print_string(" out of ");
3732   print_int(trie_op_size); 
3733   {
3734     register integer for_end;
3735     k = 255;
3736     for_end = 0;
3737     if (k >= for_end) do
3738       if (trie_used[k]> 0)
3739       {
3740         print_nl("  ");
3741         print_int(trie_used[k]);
3742         print_string(" for language ");
3743         print_int(k);
3744         dump_int(k);
3745         dump_int(trie_used[k]);
3746       } while(k-- > for_end);
3747   }
3748   dump_int(interaction);
3749   dump_int(format_ident);
3750   dump_int(ENDFMTCHECKSUM); /* magic checksum end of FMT file --- change ??? */ 
3751   tracing_stats = 0;
3752   w_close(fmt_file); 
3753 //  return 0;
3754 } /* end of store_fmt_file */
3755 #endif /* INITEX */
3756
3757 #ifdef INITEX
3758 void init_prim (void) 
3759
3760   no_new_control_sequence = false;
3761   //primitive_s("lineskip", assign_glue, glue_base + line_skip_code);
3762   primitive(373, assign_glue, glue_base + line_skip_code);          /* lineskip */
3763   primitive(374, assign_glue, glue_base + baseline_skip_code);      /* baselineskip */
3764   primitive(375, assign_glue, glue_base + par_skip_code);           /* parskip */
3765   primitive(376, assign_glue, glue_base + above_display_skip_code); /* abovedisplayskip */
3766   primitive(377, assign_glue, glue_base + below_display_skip_code); /* belowdisplayskip */
3767   primitive(378, assign_glue, glue_base + above_display_short_skip_code); /* abovedisplayshortskip */
3768   primitive(379, assign_glue, glue_base + below_display_short_skip_code); /* belowdisplayshortskip */
3769   primitive(380, assign_glue, glue_base + left_skip_code); /* leftskip */
3770   primitive(381, assign_glue, glue_base + right_skip_code); /* rightskip */
3771   primitive(382, assign_glue, glue_base + top_skip_code); /* topskip */
3772   primitive(383, assign_glue, glue_base + split_top_skip_code); /* splittopskip */
3773   primitive(384, assign_glue, glue_base + tab_skip_code); /* tabskip */
3774   primitive(385, assign_glue, glue_base + space_skip_code); /* spaceskip */
3775   primitive(386, assign_glue, glue_base + xspace_skip_code); /* xspaceskip */
3776   primitive(387, assign_glue, glue_base + par_fill_skip_code); /* parfillskip */
3777   primitive(388, assign_mu_glue, glue_base + thin_mu_skip_code); /* thinmuskip */
3778   primitive(389, assign_mu_glue, glue_base + med_mu_skip_code); /* medmuskip */
3779   primitive(390, assign_mu_glue, glue_base + thick_mu_skip_code); /* thickmuskip */
3780   primitive(395, assign_toks, output_routine_loc); /* output */
3781   primitive(396, assign_toks, every_par_loc); /* everypar */
3782   primitive(397, assign_toks, every_math_loc); /* everymath */
3783   primitive(398, assign_toks, every_display_loc); /* everydisplay */
3784   primitive(399, assign_toks, every_hbox_loc); /* everyhbox */
3785   primitive(400, assign_toks, every_vbox_loc); /* everyvbox */
3786   primitive(401, assign_toks, every_job_loc); /* everyjob */
3787   primitive(402, assign_toks, every_cr_loc); /* everycr */
3788   primitive(403, assign_toks, err_help_loc); /* errhelp */
3789   primitive(417, assign_int, int_base + pretolerance_code); /* pretolerance */
3790   primitive(418, assign_int, int_base + tolerance_code); /* tolerance */
3791   primitive(419, assign_int, int_base + line_penalty_code); /* linepenalty */
3792   primitive(420, assign_int, int_base + hyphen_penalty_code); /* hyphenpenalty */
3793   primitive(421, assign_int, int_base + ex_hyphen_penalty_code); /* exhyphenpenalty */
3794   primitive(422, assign_int, int_base + club_penalty_code); /* clubpenalty */
3795   primitive(423, assign_int, int_base + widow_penalty_code); /* widowpenalty */
3796   primitive(424, assign_int, int_base + display_widow_penalty_code); /* displaywidowpenalty */
3797   primitive(425, assign_int, int_base + broken_penalty_code); /* brokenpenalty */
3798   primitive(426, assign_int, int_base + bin_op_penalty_code); /* binoppenalty */
3799   primitive(427, assign_int, int_base + rel_penalty_code); /* relpenalty */
3800   primitive(428, assign_int, int_base + pre_display_penalty_code); /* predisplaypenalty */
3801   primitive(429, assign_int, int_base + post_display_penalty_code); /* postdisplaypenalty */
3802   primitive(430, assign_int, int_base + inter_line_penalty_code); /* interlinepenalty */
3803   primitive(431, assign_int, int_base + double_hyphen_demerits_code); /* doublehyphendemerits */
3804   primitive(432, assign_int, int_base + final_hyphen_demerits_code); /* finalhyphendemerits */
3805   primitive(433, assign_int, int_base + adj_demerits_code); /* adjdemerits */
3806   primitive(434, assign_int, int_base + mag_code); /* mag */
3807   primitive(435, assign_int, int_base + delimiter_factor_code); /* delimiterfactor */
3808   primitive(436, assign_int, int_base + looseness_code); /* looseness */
3809   primitive(437, assign_int, int_base + time_code); /* time */
3810   primitive(438, assign_int, int_base + day_code); /* day */
3811   primitive(439, assign_int, int_base + month_code); /* month */
3812   primitive(440, assign_int, int_base + year_code); /* year */
3813   primitive(441, assign_int, int_base + show_box_breadth_code); /* showboxbreadth */
3814   primitive(442, assign_int, int_base + show_box_depth_code); /* showboxdepth */
3815   primitive(443, assign_int, int_base + hbadness_code); /* hbadness */
3816   primitive(444, assign_int, int_base + vbadness_code); /* vbadness */
3817   primitive(445, assign_int, int_base + pausing_code); /* pausing */
3818   primitive(446, assign_int, int_base + tracing_online_code); /* tracingonline */
3819   primitive(447, assign_int, int_base + tracing_macros_code); /* tracingmacros */
3820   primitive(448, assign_int, int_base + tracing_stats_code); /* tracingstats */
3821   primitive(449, assign_int, int_base + tracing_paragraphs_code); /* tracingparagraphs */
3822   primitive(450, assign_int, int_base + tracing_pages_code); /* tracingpages */
3823   primitive(451, assign_int, int_base + tracing_output_code); /* tracingoutput */
3824   primitive(452, assign_int, int_base + tracing_lost_chars_code); /* tracinglostchars */
3825   primitive(453, assign_int, int_base + tracing_commands_code); /* tracingcommands */
3826   primitive(454, assign_int, int_base + tracing_restores_code); /* tracingrestores */
3827   primitive(455, assign_int, int_base + uc_hyph_code); /* uchyph */
3828   primitive(456, assign_int, int_base + output_penalty_code); /* outputpenalty */
3829   primitive(457, assign_int, int_base + max_dead_cycles_code); /* maxdeadcycles */
3830   primitive(458, assign_int, int_base + hang_after_code); /* hangafter */
3831   primitive(459, assign_int, int_base + floating_penalty_code); /* floatingpenalty */
3832   primitive(460, assign_int, int_base + global_defs_code); /* globaldefs */
3833   primitive(461, assign_int, int_base + cur_fam_code); /* fam */
3834   primitive(462, assign_int, int_base + escape_char_code); /* escapechar */
3835   primitive(463, assign_int, int_base + default_hyphen_char_code); /* defaulthyphenchar */
3836   primitive(464, assign_int, int_base + default_skew_char_code); /* defaultskewchar */
3837   primitive(465, assign_int, int_base + end_line_char_code); /* endlinechar */
3838   primitive(466, assign_int, int_base + new_line_char_code); /* newlinechar */
3839   primitive(467, assign_int, int_base + language_code); /* language */
3840   primitive(468, assign_int, int_base + left_hyphen_min_code); /* lefthyphenmin */
3841   primitive(469, assign_int, int_base + right_hyphen_min_code); /* righthyphenmin */
3842   primitive(470, assign_int, int_base + holding_inserts_code); /* holdinginserts */
3843   primitive(471, assign_int, int_base + error_context_lines_code); /* errorcontextlines */
3844   primitive(475, assign_dimen, dimen_base + par_indent_code); /* parindent */
3845   primitive(476, assign_dimen, dimen_base + math_surround_code); /* mathsurround */
3846   primitive(477, assign_dimen, dimen_base + line_skip_limit_code); /* lineskiplimit */
3847   primitive(478, assign_dimen, dimen_base + hsize_code); /* hsize */
3848   primitive(479, assign_dimen, dimen_base + vsize_code); /* vsize */
3849   primitive(480, assign_dimen, dimen_base + max_depth_code); /* maxdepth */
3850   primitive(481, assign_dimen, dimen_base + split_max_depth_code); /* splitmaxdepth */
3851   primitive(482, assign_dimen, dimen_base + box_max_depth_code); /* boxmaxdepth */
3852   primitive(483, assign_dimen, dimen_base + hfuzz_code); /* hfuzz */
3853   primitive(484, assign_dimen, dimen_base + vfuzz_code); /* vfuzz */
3854   primitive(485, assign_dimen, dimen_base + delimiter_shortfall_code); /* delimitershortfall */
3855   primitive(486, assign_dimen, dimen_base + null_delimiter_space_code); /* nulldelimiterspace */
3856   primitive(487, assign_dimen, dimen_base + script_space_code); /* scriptspace */
3857   primitive(488, assign_dimen, dimen_base + pre_display_size_code); /* predisplaysize */
3858   primitive(489, assign_dimen, dimen_base + display_width_code); /* displaywidth */
3859   primitive(490, assign_dimen, dimen_base + display_indent_code); /* displayindent */
3860   primitive(491, assign_dimen, dimen_base + overfull_rule_code); /* overfullrule */
3861   primitive(492, assign_dimen, dimen_base + hang_indent_code); /* hangindent */
3862   primitive(493, assign_dimen, dimen_base + h_offset_code); /* hoffset */
3863   primitive(494, assign_dimen, dimen_base + v_offset_code); /* voffset */
3864   primitive(495, assign_dimen, dimen_base + emergency_stretch_code);  /* emergencystretch */
3865   primitive(32, ex_space, 0); /*   */
3866   primitive(47, ital_corr, 0);  /* / */
3867   primitive(505, accent, 0);  /* accent */
3868   primitive(506, advance, 0); /* advance */
3869   primitive(507, after_assignment, 0);  /* afterassignment */
3870   primitive(508, after_group, 0); /* aftergroup */
3871   primitive(509, begin_group, 0); /* begingroup */
3872   primitive(510, char_num, 0);  /* char */
3873   primitive(501, cs_name, 0);   /* csname */
3874   primitive(511, delim_num, 0); /* delimiter */
3875   primitive(512, divide, 0);  /* divide */
3876   primitive(502, end_cs_name, 0); /* endcsname */
3877   primitive(513, end_group, 0); /* endgroup */
3878 /*  hash[(hash_size + 516)].v.RH = 513; */  
3879   hash[(hash_size + hash_extra + 516)].v.RH = 513;  /* endgroup */
3880 /*  eqtb[(hash_size + 516)]= eqtb[cur_val]; */
3881   eqtb[(hash_size + hash_extra + 516)]= eqtb[cur_val]; 
3882   primitive(514, expand_after, 0);    /* expandafter */
3883   primitive(515, def_font, 0);  /* font */
3884   primitive(516, assign_font_dimen, 0); /* fontdimen */
3885   primitive(517, halign, 0);  /* halign */
3886   primitive(518, hrule, 0); /* hrule */
3887   primitive(519, ignore_spaces, 0); /* ignorespaces */
3888   primitive(327, insert, 0); /* insert */
3889   primitive(348, mark, 0); /* mark */
3890   primitive(520, math_accent, 0); /* mathaccent */
3891   primitive(521, math_char_num, 0); /* mathchar */
3892   primitive(522, math_choice, 0); /* mathchoice */
3893   primitive(523, multiply, 0);  /* multiply */
3894   primitive(524, no_align, 0);  /* noalign */
3895   primitive(525, no_boundary, 0); /* noboundary */
3896   primitive(526, no_expand, 0);   /* noexpand */
3897   primitive(332, non_script, 0); /* nonscript */
3898   primitive(527, omit, 0);  /* omit */
3899   primitive(405, set_shape, 0); /* parshape */
3900   primitive(528, break_penalty, 0); /* penalty */
3901   primitive(529, set_prev_graf, 0); /* prevgraf */
3902   primitive(530, radical, 0); /* radical */
3903   primitive(531, read_to_cs, 0);  /* read */
3904   primitive(532, relax, 256);   /* primitive("relax",relax,256); */
3905 /*  hash[(hash_size + 521)].v.RH = 532; */ 
3906   hash[(hash_size + hash_extra + 521)].v.RH = 532;  /* read */
3907 /*  eqtb[(hash_size + 521)]= eqtb[cur_val];  */
3908   eqtb[(hash_size + hash_extra + 521)]= eqtb[cur_val]; 
3909   primitive(533, set_box, 0); /* setbox */
3910   primitive(534, the, 0);   /* the */
3911   primitive(404, toks_register, 0); /* toks */
3912   primitive(349, vadjust, 0); /* vadjust */
3913   primitive(535, valign, 0);  /* valign */
3914   primitive(536, vcenter, 0); /* vcenter */
3915   primitive(537, vrule, 0); /* vrule */
3916   primitive(594, par_end, 256); /* par */
3917   par_loc = cur_val; 
3918   par_token = 4095 + par_loc; 
3919   primitive(626, input, 0);   /* input */
3920   primitive(627, input, 1);   /* endinput */
3921   primitive(628, top_bot_mark, 0);    /* topmark */
3922   primitive(629, top_bot_mark, 1);    /* firstmark */
3923   primitive(630, top_bot_mark, 2);    /* botmark */
3924   primitive(631, top_bot_mark, 3);    /* splitfirstmark */
3925   primitive(632, top_bot_mark, 4);    /* splitbotmark */
3926   primitive(473, tex_register, 0);  /* count */
3927   primitive(497, tex_register, 1);  /* dimen */
3928   primitive(392, tex_register, 2);  /* skip */
3929   primitive(393, tex_register, 3);  /* muskip */
3930   primitive(665, set_aux, 102); /* spacefactor */
3931   primitive(666, set_aux, 1); /* prevdepth */
3932   primitive(667, set_page_int, 0);  /* dead_cycles */
3933   primitive(668, set_page_int, 1);  /* insert_penalties */
3934   primitive(669, set_box_dimen, 1); /* wd */
3935   primitive(670, set_box_dimen, 3); /* ht */
3936   primitive(671, set_box_dimen, 2); /* dp */
3937   primitive(672, last_item, 0); /* last_penalty */
3938   primitive(673, last_item, 1); /* last_kern */
3939   primitive(674, last_item, 2); /* lastskip */
3940   primitive(675, last_item, 3); /* inputlineno */
3941   primitive(676, last_item, 4); /* badness */
3942   primitive(732, convert, 0);   /* number */
3943   primitive(733, convert, 1);   /* romannumeral */
3944   primitive(734, convert, 2);   /* string */
3945   primitive(735, convert, 3);   /* meaning */
3946   primitive(736, convert, 4);   /* font_name */
3947   primitive(737, convert, 5);   /* job_name */
3948   primitive(753, if_test, 0);   /* if */
3949   primitive(754, if_test, 1);   /* ifcat */
3950   primitive(755, if_test, 2);   /* ifnum */
3951   primitive(756, if_test, 3);   /* ifdim */
3952   primitive(757, if_test, 4);   /* ifodd */
3953   primitive(758, if_test, 5);   /* ifvmode */
3954   primitive(759, if_test, 6);   /* ifhmode */
3955   primitive(760, if_test, 7);   /* ifmmode */
3956   primitive(761, if_test, 8);   /* ifinner */
3957   primitive(762, if_test, 9);   /* ifvoid */
3958   primitive(763, if_test, 10);  /* ifhbox */
3959   primitive(764, if_test, 11);  /* ifvbox */
3960   primitive(765, if_test, 12);  /* ifx */
3961   primitive(766, if_test, 13);  /* ifeof */
3962   primitive(767, if_test, 14);  /* iftrue */
3963   primitive(768, if_test, 15);  /* iffalse */
3964   primitive(769, if_test, 16);  /* ifcase */
3965   primitive(770, fi_or_else, 2);    /* fi */
3966 /*  hash[(hash_size + 518)].v.RH = 770; */ 
3967   hash[(hash_size + hash_extra + 518)].v.RH = 770;    /* fi */
3968 /*  eqtb[(hash_size + 518)]= eqtb[cur_val];  */
3969   eqtb[(hash_size + hash_extra + 518)]= eqtb[cur_val]; 
3970   primitive(771, fi_or_else, 4);    /* or */
3971   primitive(772, fi_or_else, 3);    /* else */
3972   primitive(795, set_font, 0);    /* nullfont */
3973 /*  hash[(hash_size + 524)].v.RH = 795; */  /* hash[frozen_null_font] */
3974   hash[(hash_size + hash_extra + 524)].v.RH = 795;  /* nullfont */
3975 /*  eqtb[(hash_size + 524)]= eqtb[cur_val];  */
3976   eqtb[(hash_size + hash_extra + 524)]= eqtb[cur_val]; 
3977   primitive(892, tab_mark, 256);    /* span */
3978       /* primitive("span",tab_mark,span_code); */
3979   primitive(893, car_ret, 257);   /* cr */
3980       /* primitive("cr",car_ret,cr_code); */
3981 /*  hash[(hash_size + 515)].v.RH = 893; */  
3982   hash[(hash_size + hash_extra + 515)].v.RH = 893;    /* cr */
3983 /*  eqtb[(hash_size + 515)]= eqtb[cur_val];  */
3984   eqtb[(hash_size + hash_extra + 515)]= eqtb[cur_val]; 
3985   primitive(894, car_ret, 258);     /* cr cr */
3986 /*  hash[(hash_size + 519)].v.RH = 895;  */
3987   hash[(hash_size + hash_extra + 519)].v.RH = 895; /* endtemplate */
3988 /*  hash[(hash_size + 520)].v.RH = 895;  */
3989   hash[(hash_size + hash_extra + 520)].v.RH = 895; /* endtemplate */
3990 /*  eqtb[(hash_size + 520)].hh.b0 = 9;  */
3991   eqtb[(hash_size + hash_extra + 520)].hh.b0 = 9; 
3992 /*  eqtb[(hash_size + 520)].hh.v.RH = null_list;  */
3993   eqtb[(hash_size + hash_extra + 520)].hh.v.RH = null_list; 
3994 /*  eqtb[(hash_size + 520)].hh.b1 = 1;  */
3995   eqtb[(hash_size + hash_extra + 520)].hh.b1 = 1; 
3996 /*  eqtb[(hash_size + 519)]= eqtb[(hash_size + 520)];  */
3997   eqtb[(hash_size + hash_extra + 519)]=
3998     eqtb[(hash_size + hash_extra + 520)]; 
3999 /*  eqtb[(hash_size + 519)].hh.b0 = 115;  */
4000   eqtb[(hash_size + hash_extra + 519)].hh.b0 = 115; 
4001   primitive(964, set_page_dimen, 0);  /* pagegoal */
4002   primitive(965, set_page_dimen, 1);  /* pagetotal */
4003   primitive(966, set_page_dimen, 2);  /* pagestretch */
4004   primitive(967, set_page_dimen, 3);  /* pagefilstretch */
4005   primitive(968, set_page_dimen, 4);  /* pagefillstretch */
4006   primitive(969, set_page_dimen, 5);  /* pagefilllstretch */
4007   primitive(970, set_page_dimen, 6);  /* pageshrink */
4008   primitive(971, set_page_dimen, 7);  /* pagedepth */
4009   primitive(1019, end_match, 0);    /* end */
4010   primitive(1020, stop, 1);   /* dump */
4011   primitive(1021, hskip, 4);    /* hskip */
4012   primitive(1022, hskip, 0);    /* hfil */
4013   primitive(1023, hskip, 1);    /* hfill */
4014   primitive(1024, hskip, 2);    /* hss */
4015   primitive(1025, hskip, 3);    /* hfilneg */
4016   primitive(1026, vskip, 4);    /* vskip */
4017   primitive(1027, vskip, 0);    /* vfil */
4018   primitive(1028, vskip, 1);    /* vfill */
4019   primitive(1029, vskip, 2);    /* vss */
4020   primitive(1030, vskip, 3);    /* vfilneg */
4021   primitive(333, mskip, 5); /* mskip */
4022   primitive(337, kern, 1); /* kern */
4023   primitive(339, mkern, 99); /* mkern */
4024   primitive(1048, hmove, 1);    /* moveleft */
4025   primitive(1049, hmove, 0);    /* moveright */
4026   primitive(1050, vmove, 1);    /* raise */
4027   primitive(1051, vmove, 0);    /* lower */
4028   primitive(406, make_box, 0);  /* box */
4029   primitive(1052, make_box, 1);   /* copy */
4030   primitive(1053, make_box, 2);   /* lastbox */
4031   primitive(959, make_box, 3);  /* vsplit */
4032   primitive(1054, make_box, 4);   /* vtop */
4033   primitive(961, make_box, 5);  /* vbox */
4034   primitive(1055, make_box, 106); /* hbox */
4035   primitive(1056, leader_ship, 99); /* ship_out */
4036   primitive(1057, leader_ship, 100);  /* leaders */
4037   primitive(1058, leader_ship, 101);  /* cleaders */
4038   primitive(1059, leader_ship, 102);  /* xleaders */
4039   primitive(1074, start_par, 1);    /* indent */
4040   primitive(1075, start_par, 0);    /* noindent */
4041   primitive(1084, remove_item, 12); /* unpenalty */
4042   primitive(1085, remove_item, 11); /* unkern */
4043   primitive(1086, remove_item, 10); /* unskip */
4044   primitive(1087, un_hbox, 0);    /* unhbox */
4045   primitive(1088, un_hbox, 1);    /* unhcopy */
4046   primitive(1089, un_vbox, 0);    /* unvbox */
4047   primitive(1090, un_vbox, 1);    /* unvcopy */
4048   primitive(45, discretionary, 1);    /* - */
4049   primitive(346, discretionary, 0); /* discretionary */
4050   primitive(1121, eq_no, 0);    /* eqno */
4051   primitive(1122, eq_no, 1);    /* leqno */
4052   primitive(860, math_comp, 16);    /* mathord */
4053   primitive(861, math_comp, 17); /* mathop */
4054   primitive(862, math_comp, 18); /* mathbin */
4055   primitive(863, math_comp, 19); /* mathrel */
4056   primitive(864, math_comp, 20); /* mathopen */
4057   primitive(865, math_comp, 21); /* mathclose */
4058   primitive(866, math_comp, 22); /* mathpunct */
4059   primitive(867, math_comp, 23); /* mathinner */
4060   primitive(869, math_comp, 26); /* underline */
4061   primitive(868, math_comp, 27); /* overline */
4062   primitive(1123, limit_switch, 0); /* displaylimits */
4063   primitive(872, limit_switch, 1); /* limits */
4064   primitive(873, limit_switch, 2); /* nolimits */
4065   primitive(855, math_style, 0); /* displaystyle */
4066   primitive(856, math_style, 2); /* textstyle */
4067   primitive(857, math_style, 4); /* scriptstyle */
4068   primitive(858, math_style, 6); /* scriptscriptstyle */
4069   primitive(1141, above, 0); /* above */
4070   primitive(1142, above, 1); /* over */
4071   primitive(1143, above, 2); /* atop */
4072   primitive(1144, above, 3); /* abovewithdelims */
4073   primitive(1145, above, 4); /* overwithdelims */
4074   primitive(1146, above, 5); /* atopwithdelims */
4075   primitive(870, left_right, 30); /* left */
4076   primitive(871, left_right, 31); /* right */
4077 /*  hash[(hash_size + 517)].v.RH = 871;  */
4078   hash[(hash_size + hash_extra + 517)].v.RH = 871;    /* right */
4079 /*  eqtb[(hash_size + 517)]= eqtb[cur_val];  */
4080   eqtb[(hash_size + hash_extra + 517)]= eqtb[cur_val]; 
4081   primitive(1165, prefix, 1); /* long */
4082   primitive(1166, prefix, 2); /* outer */
4083   primitive(1167, prefix, 4); /* global */
4084   primitive(1168, def, 0); /* def */
4085   primitive(1169, def, 1); /* gdef */
4086   primitive(1170, def, 2); /* edef */
4087   primitive(1171, def, 3); /* xdef */
4088   primitive(1185, let, 0); /* let */
4089   primitive(1186, let, 1); /* futurelet */
4090   primitive(1187, shorthand_def, 0); /* chardef */
4091   primitive(1188, shorthand_def, 1); /* mathchardef */
4092   primitive(1189, shorthand_def, 2); /* countdef */
4093   primitive(1190, shorthand_def, 3); /* dimendef */
4094   primitive(1191, shorthand_def, 4); /* skipdef */
4095   primitive(1192, shorthand_def, 5); /* muskipdef */
4096   primitive(1193, shorthand_def, 6); /* toksdef */
4097   primitive(412, def_code, (hash_size + 1883)); /* catcode */
4098   primitive(416, def_code, (hash_size + 2907)); /* mathcode */
4099   primitive(413, def_code, (hash_size + 2139)); /* lccode */
4100   primitive(414, def_code, (hash_size + 2395)); /* uccode */
4101   primitive(415, def_code, (hash_size + 2651)); /* sfcode */
4102   primitive(474, def_code, (hash_size + 3474)); /* delcode */
4103   primitive(409, def_family, (hash_size + 1835)); /* textfont */
4104   primitive(410, def_family, (hash_size + 1851)); /* scriptfont */
4105   primitive(411, def_family, (hash_size + 1867)); /* scriptscriptfont */
4106   primitive(935, hyph_data, 0); /* hyphenation */
4107   primitive(947, hyph_data, 1); /* patterns */
4108   primitive(1211, assign_font_int, 0); /* hyphen_char */
4109   primitive(1212, assign_font_int, 1); /* skew_char */
4110   primitive(272, set_interaction, 0); /* batchmode */
4111   primitive(273, set_interaction, 1); /* nonstopmode */
4112   primitive(274, set_interaction, 2); /* scrollmode */
4113   primitive(1221, set_interaction, 3); /* errorstopmode */
4114   primitive(1222, in_stream, 1); /* openin */
4115   primitive(1223, in_stream, 0); /* closein */
4116   primitive(1224, message, 0); /* message */
4117   primitive(1225, message, 1); /* errmessage */
4118   primitive(1231, case_shift, (hash_size + 2139)); /* lowercase */
4119   primitive(1232, case_shift, (hash_size + 2395)); /* uppercase */
4120   primitive(1233, xray, 0); /* show */
4121   primitive(1234, xray, 1); /* show_box */
4122   primitive(1235, xray, 2); /* showthe */
4123   primitive(1236, xray, 3); /* showlists */
4124   primitive(1279, extension, 0); /* openout */
4125   primitive(591, extension, 1); /* write */
4126   write_loc = cur_val; 
4127   primitive(1280, extension, 2);    /* closeout */
4128   primitive(1281, extension, 3);    /* special */
4129   primitive(1282, extension, 4);    /* immediate */
4130   primitive(1283, extension, 5);    /* setlanguage */
4131   no_new_control_sequence = true; 
4132
4133 #endif /* INITEX */
4134
4135 #pragma optimize("s", off)            /* 96/Sep/12 */
4136 /* #pragma optimize("1", off) */
4137 #pragma optimize("t", on)           /* 96/Sep/12 */
4138 /* #pragma optimize("2", on) */