OSDN Git Service

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