1 /* Copyright 1992 Karl Berry
2 Copyright 2007 TeX Users Group
3 Copyright 2014 Clerk Ma
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.
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.
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
25 #pragma warning(disable:4115) // kill rpcasync.h complaint
27 #define MYLIBAPI __declspec(dllexport)
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
43 #pragma warning(disable:4244) /* 96/Jan/10 */
45 #include <time.h> // needed for clock_t
47 /* #define CHECKPOOL */ /* debugging only */
49 #define ENDFMTCHECKSUM 69069L
51 #define BEGINFMTCHECKSUM 367403084L
53 extern clock_t start_time, main_time, finish_time; /* in local.c */
55 /* imported from pascal.h */
56 /* localized here to avoid conflict with io.h in other code */
58 #define read(f, b) ((b) = getc (f))
59 #define readln(f) { register int c; while ((c = getc (f)) != '\n' && c != EOF); }
60 /* #define readln(f) { while (getc (f) >= ' '); } ? use fgets ? */
63 void do_initex (void); /* later in this file */
66 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
68 void initialize (void)
72 integer flag; /* bkph */
73 #ifndef ALLOCATEHYPHEN
77 /* We already initialized xchr if we are using non_ascii setup */
81 /* Normally, there is no translation of character code numbers */
84 register integer for_end;
89 /* xchr[i]= chr(i); */
90 xchr[i]= (char) i; /* 95/Jan/7 */
94 /* This is a kind of joke, since the characters are given as numeric codes ! */
194 register integer for_end;
199 while(i++ < for_end);
203 register integer for_end;
208 while(i++ < for_end);
210 #endif /* end of JOKE */
211 } /* end of plain ASCII case (otherwise have read in xchr vector before) */
213 /* Fill in background of `delete' for inverse mapping */
216 register integer for_end;
220 do xord[chr(i)] = 127;
221 while(i++ < for_end);
226 register integer for_end;
230 do xord[xchr[i]] = i;
231 while(i++ < for_end);
235 register integer for_end;
239 do xord[xchr[i]] = i;
240 while(i++ < for_end);
244 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
245 /* Now invert the xchr mapping to get xord mapping */
248 register integer for_end;
252 do xord[xchr[i]] = (char) i;
253 while(i++ < for_end);
256 xord[127]= 127; /* hmm, a fixed point ? why ? */
258 flag = 0; /* 93/Dec/28 - bkph */
259 if (trace_flag != 0) {
260 for (k = 0; k < 256; k++) /* entries in xord / xchr */
265 if (flag) { /* 127 here means mapping undefined */
266 showline("Inverted mapping xord[] pairs:\n", 0);
267 for (k = 0; k < 256; k++) { /* entries in xord / xchr */
269 sprintf(log_line, "%d => %d\n", k, xord[k]);
270 showline(log_line, 0);
275 if (interaction < 0) /* may now set in local.c bkph */
276 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
278 deletions_allowed = true;
279 set_box_allowed = true;
282 use_err_help = false;
284 OK_to_interrupt = true;
286 /* darn, need to know mem_top, mem_max etc for the following ... */
289 /* waslomax = mem_min; */
291 /* washimin = mem_max; */
300 cur_list.aux_field.cint = ignore_depth;
302 /* *********************************************************************** */
303 /* cur_list .lhmfield = 0; */ /* removed in 3.14159 */
304 /* cur_list .rhmfield = 0; */ /* removed in 3.14159 */
305 /* *********************************************************************** */
309 page_tail = mem_top - 2;
311 if (is_initex) /* in iniTeX we did already allocate mem [] */
313 mem[mem_top - 2].hh.v.RH = 0;
314 /* last_glue = 262143L; */ /* NO! */
315 last_glue = empty_flag;
320 /* from int_base to eqtb_size */
322 register integer for_end;
323 k = (hash_size + 3163);
324 for_end = (hash_size + 4006);
327 while(k++ < for_end);
329 no_new_control_sequence = true;
330 hash[514].v.LH = 0; /* next(hash_base):= 0 */
331 hash[514].v.RH = 0; /* text(hash_base):= 0 */
332 /* 514 + hash_size + 266 = hashbase + hashsize + 10 + font_max */
333 /* for k <- hashbase+1 to undefined_control_sequence - 1 do ... p.257 */
335 register integer for_end;
337 for_end = (hash_size + 780);
339 do hash[k]= hash[514];
340 while(k++ < for_end);
358 register integer for_end;
363 while(k++ < for_end);
370 register integer for_end;
374 do font_used[k]= false;
375 while(k++ < for_end);
377 null_character.b0 = 0;
378 null_character.b1 = 0;
379 null_character.b2 = 0;
380 null_character.b3 = 0;
386 doing_leaders = false;
389 half_buf = dvi_buf_size / 2;
390 dvi_limit = dvi_buf_size;
394 /* down_ptr:=null; right_ptr:=null; l.12027 */
400 empty_field.v.RH = 0;
401 empty_field.v.LH = 0;
402 null_delimiter.b0 = 0;
403 null_delimiter.b1 = 0;
404 null_delimiter.b2 = 0;
405 null_delimiter.b3 = 0;
412 /* *not* OK with ALLOCATEHYPHEN, since may not be allocated yet */
413 #ifndef ALLOCATEHYPHEN
414 /* {register integer for_end; z = 0; for_end = 607; if(z <= for_end) do */
416 register integer for_end;
418 for_end = hyphen_prime;
424 while(z++ < for_end);
428 output_active = false;
429 insert_penalties = 0;
430 ligature_present = false;
431 cancel_boundary = false;
436 long_help_seen = false;
439 register integer for_end;
443 do write_open[k]= false;
444 while(k++ < for_end);
449 /* initex stuff split off for convenience of optimization adjustments */
450 if (is_initex) do_initex ();
452 /* trap the -i on command line situation if INITEX was NOT defined */
454 showline("Sorry, somebody forgot to make an INITEX!\n", 1);
456 #endif /* not INITEX */
459 /* do the part of initialize() that requires mem_top, mem_max or mem[] */
460 /* do this part after allocating main memory */
463 void initialize_aux(void) {
467 /* waslomax = mem_min; */
469 /* washimin = mem_max; */
474 /* max_nest_stack = 0; */
478 cur_list.aux_field.cint = ignore_depth;
481 /* shown_mode = 0; */
482 /* page_contents = 0; */
483 page_tail = mem_top - 2;
484 //mem[mem_top - 2].hh.v.RH = 0;
487 #endif // end of ifdef ALLOCATEMAIN
489 void line_break_ (integer finalwidowpenalty)
490 {/* 30 31 32 33 34 35 22 */
493 halfword q, r, s, prevs;
494 internal_font_number f;
495 /* small_number j; */
496 int j; /* 95/Jan/7 */
497 /* unsigned char c; */
498 unsigned int c; /* 95/Jan/7 */
500 /* savedbadness = 0; */ /* 96/Feb/9 */
501 pack_begin_line = mode_line;
502 mem[mem_top - 3].hh.v.RH = mem[head].hh.v.RH;
503 if((tail >= hi_mem_min))
505 mem[tail].hh.v.RH = new_penalty(10000);
506 tail = mem[tail].hh.v.RH;
508 else if(mem[tail].hh.b0 != 10)
510 mem[tail].hh.v.RH = new_penalty(10000);
511 tail = mem[tail].hh.v.RH;
515 mem[tail].hh.b0 = 12;
516 delete_glue_ref(mem[tail + 1].hh.v.LH);
517 flush_node_list(mem[tail + 1].hh.v.RH);
518 mem[tail + 1].cint = 10000;
520 mem[tail].hh.v.RH = new_param_glue(14);
521 /* *********************************************************************** */
522 /* following is new in 3.14159 */
523 init_cur_lang = prev_graf % 65536L;
524 /* init_cur_lang = prev_graf & 65535L; */ /* last 16 bits */
525 init_l_hyf = prev_graf / 4194304L; /* 2^22 */
526 /* init_l_hyf = prev_graf >> 22; */ /* top 10 bits */
527 init_r_hyf =(prev_graf / 65536L)% 64;
528 /* init_r_hyf =(prev_graf >> 16)& 65; */ /* next to last 6 bits */
529 /* *********************************************************************** */
531 noshrinkerroryet = true;
532 if((mem[eqtb[(hash_size + 789)].hh.v.RH].hh.b1 != 0)&&
533 (mem[eqtb[(hash_size + 789)].hh.v.RH + 3].cint != 0))
535 eqtb[(hash_size + 789)].hh.v.RH =
536 finite_shrink(eqtb[(hash_size + 789)].hh.v.RH);
538 if((mem[eqtb[(hash_size + 790)].hh.v.RH].hh.b1 != 0)&&
539 (mem[eqtb[(hash_size + 790)].hh.v.RH + 3].cint != 0))
541 eqtb[(hash_size + 790)].hh.v.RH =
542 finite_shrink(eqtb[(hash_size + 790)].hh.v.RH);
544 q = eqtb[(hash_size + 789)].hh.v.RH;
545 r = eqtb[(hash_size + 790)].hh.v.RH;
546 background[1]= mem[q + 1].cint + mem[r + 1].cint;
551 background[2 + mem[q].hh.b0]= mem[q + 2].cint;
552 background[2 + mem[r].hh.b0]= background[2 + mem[r].hh.b0]+
554 background[6]= mem[q + 3].cint + mem[r + 3].cint;
555 minimum_demerits = 1073741823L; /* 2^30 - 1 */ /* 40000000 hex - 1 */
556 minimal_demerits[3]= 1073741823L;
557 minimal_demerits[2]= 1073741823L;
558 minimal_demerits[1]= 1073741823L;
559 minimal_demerits[0]= 1073741823L;
560 if(eqtb[(hash_size + 1312)].hh.v.RH == 0)
561 if(eqtb[(hash_size + 3747)].cint == 0)
563 last_special_line = 0;
564 second_width = eqtb[(hash_size + 3733)].cint;
569 last_special_line = abs(eqtb[(hash_size + 3204)].cint);
570 if(eqtb[(hash_size + 3204)].cint < 0)
572 first_width = eqtb[(hash_size + 3733)].cint -
573 abs(eqtb[(hash_size + 3747)].cint);
574 if(eqtb[(hash_size + 3747)].cint >= 0)
575 first_indent = eqtb[(hash_size + 3747)].cint;
576 else first_indent = 0;
577 second_width = eqtb[(hash_size + 3733)].cint;
582 first_width = eqtb[(hash_size + 3733)].cint;
584 second_width = eqtb[(hash_size + 3733)].cint -
585 abs(eqtb[(hash_size + 3747)].cint);
586 if(eqtb[(hash_size + 3747)].cint >= 0)
587 second_indent = eqtb[(hash_size + 3747)].cint;
588 else second_indent = 0;
593 last_special_line = mem[eqtb[(hash_size + 1312)].hh.v.RH].hh.v.LH - 1;
594 second_width = mem[eqtb[(hash_size + 1312)].hh.v.RH + 2 *(last_special_line + 1)
596 second_indent = mem[eqtb[(hash_size + 1312)].hh.v.RH + 2 * last_special_line + 1]
599 /* if looseness=0 then easy_line:=last_special_line */
600 if(eqtb[(hash_size + 3182)].cint == 0)
601 easyline = last_special_line;
602 /* else easyline = 262143L; */ /* NO! */
603 else easyline = empty_flag;
604 /* threshold:=pretolerance; */
605 threshold = eqtb[(hash_size + 3163)].cint;
610 /* if tracing_paragraphs>0 then */
611 if(eqtb[(hash_size + 3195)].cint > 0)
614 print_nl(927); /* @firstpass */
619 first_pass_count++; /* 96 Feb 9 */
622 /* threshold:=tolerance; second_pass:=true; */
623 threshold = eqtb[(hash_size + 3164)].cint;
625 /* final_pass:=(emergency_stretch<=0); */
626 final_pass =(eqtb[(hash_size + 3750)].cint <= 0);
629 if(eqtb[(hash_size + 3195)].cint > 0)
634 /* if threshold>inf_bad then threshold:=inf_bad; */
635 if(threshold > 10000)
641 if (is_initex) { /* bkph */
642 if(trie_not_ready)init_trie ();
645 /* ********************************************************************* */
646 /* following has changed in 3.14159 */
648 cur_lang = init_cur_lang;
649 /* lhyf = cur_list .lhmfield; */
651 /* rhyf = cur_list .rhmfield; */
653 /* ********************************************************************* */
658 mem[q].hh.v.RH = mem_top - 7;
659 mem[q + 1].hh.v.RH = 0;
660 mem[q + 1].hh.v.LH = prev_graf + 1;
662 mem[mem_top - 7].hh.v.RH = q;
663 active_width[1]= background[1];
664 active_width[2]= background[2];
665 active_width[3]= background[3];
666 active_width[4]= background[4];
667 active_width[5]= background[5];
668 active_width[6]= background[6];
669 /* passive:=null; printed_node:=temp_head; pass_number:=0; */
671 printed_node = mem_top - 3;
673 font_in_short_display = 0;
674 cur_p = mem[mem_top - 3].hh.v.RH;
677 /* while (cur_p<>null)and(link(active)<>last_active) do */
678 while((cur_p != 0)&&(mem[mem_top - 7].hh.v.RH != mem_top - 7))
680 if((cur_p >= hi_mem_min))
684 f = mem[cur_p].hh.b0;
685 active_width[1]= active_width[1]+ font_info[width_base[f]+
686 font_info[char_base[f]+ mem[cur_p].hh.b1].qqqq.b0].cint
688 cur_p = mem[cur_p].hh.v.RH;
689 } while(!(!(cur_p >= hi_mem_min)));
691 switch(mem[cur_p].hh.b0)
695 active_width[1]= active_width[1]+ mem[cur_p + 1].cint;
698 if(mem[cur_p].hh.b1 == 4)
700 cur_lang = mem[cur_p + 1].hh.v.RH; /* ASCII_code */
701 lhyf = mem[cur_p + 1].hh.b0;
702 rhyf = mem[cur_p + 1].hh.b1;
709 if((prevp >= hi_mem_min))
711 else if((mem[prevp].hh.b0 < 9))
713 /* *********************************************************************** */
714 /* following is new in 3.14159 */
715 else if((mem[prevp].hh.b0 == 11)&&(mem[prevp].hh.b1
718 /* *********************************************************************** */
720 if((mem[mem[cur_p + 1].hh.v.LH].hh.b1 != 0)&&(mem[
721 mem[cur_p + 1].hh.v.LH + 3].cint != 0))
723 mem[cur_p + 1].hh.v.LH = finite_shrink(mem[cur_p + 1].hh.v.LH);
725 q = mem[cur_p + 1].hh.v.LH;
726 active_width[1]= active_width[1]+ mem[q + 1].cint;
727 active_width[2 + mem[q].hh.b0]= active_width[2 + mem[q]
728 .hh.b0]+ mem[q + 2].cint;
729 active_width[6]= active_width[6]+ mem[q + 3].cint;
730 if(second_pass && autobreaking)
733 s = mem[prevs].hh.v.RH;
737 if((s >= hi_mem_min))
742 else if(mem[s].hh.b0 == 6)
743 if(mem[s + 1].hh.v.RH == 0)
747 q = mem[s + 1].hh.v.RH;
751 else if((mem[s].hh.b0 == 11)&&(mem[s].hh.b1 ==
754 else if(mem[s].hh.b0 == 8)
756 if(mem[s].hh.b1 == 4)
758 cur_lang = mem[s + 1].hh.v.RH; /* ASCII_code */
759 lhyf = mem[s + 1].hh.b0;
760 rhyf = mem[s + 1].hh.b1;
765 if(eqtb[(hash_size + 2139) + c].hh.v.RH != 0)
766 /* signed unsigned mismatch ? (c is unsigned) */
767 if((eqtb[(hash_size + 2139) + c].hh.v.RH == c)||
768 (eqtb[(hash_size + 3201)].cint > 0))
772 s = mem[prevs].hh.v.RH;
774 lab32: hyf_char = hyphen_char[hf];
775 /* if hyf_char<0 then goto done1; */
776 if(hyf_char < 0) goto lab31;
777 /* if hyf_char>255 then goto done1; */
778 if(hyf_char > 255) goto lab31; /* ? */
780 if(lhyf + rhyf > 63) goto lab31;
783 if((s >= hi_mem_min)) {
784 if(mem[s].hh.b0 != hf)
786 hyfbchar = mem[s].hh.b1;
787 c = hyfbchar; /* unsigned char c; */
788 if(eqtb[(hash_size + 2139) + c].hh.v.RH == 0)
795 /* long to short ... */
796 hc[hn]= eqtb[(hash_size + 2139) + c].hh.v.RH;
797 hyfbchar = 256; /* special mark */
799 else if(mem[s].hh.b0 == 6)
801 if(mem[s + 1].hh.b0 != hf)
803 /* j:=hn; q:=lig_ptr(s); l.17554 */
805 q = mem[s + 1].hh.v.RH;
806 /* if q>null then hyf_bchar:=character(q); l.17554 BUG ??? */
808 if(q != 0) /* 94/Mar/23 BUG FIX */
809 hyfbchar = mem[q].hh.b1;
810 /* while q>null do l.17555 BUG ??? */
812 while(q != 0){ /* 94/Mar/23 BUG FIX */
814 if(eqtb[(hash_size + 2139) + c].hh.v.RH == 0)
820 /* long to short ... */
821 hc[j]= eqtb[(hash_size + 2139) + c].hh.v.RH;
826 if(odd(mem[s].hh.b1))
827 hyfbchar = font_bchar[hf];
828 else hyfbchar = 256; /* special mark */
830 else if((mem[s].hh.b0 == 11)&&(mem[s].hh.b1 ==
834 /* ******************************************************************** */
835 hyfbchar = font_bchar[hf]; /* new code in 3.14159 */
836 /* ******************************************************************** */
845 if(!((s >= hi_mem_min)))
851 if(mem[s].hh.b1 != 0)
876 /* ******************************************************************* */
877 if(mem[cur_p].hh.b1 == 1)/* change in 3.14159 */
878 /* ******************************************************************* */
880 if(!(mem[cur_p].hh.v.RH >= hi_mem_min)&& autobreaking)
881 if(mem[mem[cur_p].hh.v.RH].hh.b0 == 10)
883 active_width[1]= active_width[1]+ mem[cur_p + 1].cint;
885 /* ******************************************************************* */
886 /* change in 3.14159 */
887 else active_width[1]= active_width[1]+ mem[cur_p + 1].cint;
888 /* ******************************************************************* */
892 f = mem[cur_p + 1].hh.b0;
893 active_width[1]= active_width[1]+ font_info[width_base[f]+
894 font_info[char_base[f]+ mem[cur_p + 1].hh.b1].qqqq.b0]
900 s = mem[cur_p + 1].hh.v.LH;
903 try_break(eqtb[(hash_size + 3167)].cint, 1);
907 if((s >= hi_mem_min))
910 disc_width = disc_width + font_info[width_base[f]+ font_info
911 [ char_base[f]+ mem[s].hh.b1].qqqq.b0].cint;
913 else switch(mem[s].hh.b0)
916 f = mem[s + 1].hh.b0;
917 disc_width = disc_width + font_info[width_base[f]+
918 font_info[char_base[f]+ mem[s + 1].hh.b1].qqqq.b0
926 disc_width = disc_width + mem[s + 1].cint;
930 confusion(931); /* disc3 */
931 return; // abort_flag set
937 active_width[1]= active_width[1]+ disc_width;
938 try_break(eqtb[(hash_size + 3166)].cint, 1);
939 active_width[1]= active_width[1]- disc_width;
941 r = mem[cur_p].hh.b1;
942 s = mem[cur_p].hh.v.RH;
944 if((s >= hi_mem_min))
947 active_width[1]= active_width[1]+ font_info[width_base[f
948 ]+ font_info[char_base[f]+ mem[s].hh.b1].qqqq.b0]
951 else switch(mem[s].hh.b0)
954 f = mem[s + 1].hh.b0;
955 active_width[1]= active_width[1]+ font_info[width_base[
956 f]+ font_info[char_base[f]+ mem[s + 1].hh.b1].qqqq
964 active_width[1]= active_width[1]+ mem[s + 1].cint;
968 confusion(932); /* disc4 */
969 return; // abort_flag set
983 autobreaking =(mem[cur_p].hh.b1 == 1);
985 if(!(mem[cur_p].hh.v.RH >= hi_mem_min)&& autobreaking)
986 if(mem[mem[cur_p].hh.v.RH].hh.b0 == 10)
988 active_width[1]= active_width[1]+ mem[cur_p + 1].cint;
993 try_break(mem[cur_p + 1].cint, 0);
1002 confusion(930); /* paragraph */
1003 return; // abort_flag set
1008 cur_p = mem[cur_p].hh.v.RH;
1013 try_break(-10000, 1);
1014 if(mem[mem_top - 7].hh.v.RH != mem_top - 7)
1016 r = mem[mem_top - 7].hh.v.RH;
1017 fewest_demerits = 1073741823L; /* 2^30 - 1 */
1019 if(mem[r].hh.b0 != 2)
1020 if(mem[r + 2].cint < fewest_demerits)
1022 fewest_demerits = mem[r + 2].cint;
1026 } while(!(r == mem_top - 7));
1027 best_line = mem[best_bet + 1].hh.v.LH;
1028 /* if looseness=0 then goto done; */
1029 if(eqtb[(hash_size + 3182)].cint == 0){
1030 /* if (final_pass && eqtb[(hash_size + 3750)].cint > 0){ */
1031 /* paragraph_failed++; */
1033 goto lab30; /* normal exit */
1036 /* r:=link(active); actual_looseness:=0; */
1037 r = mem[mem_top - 7].hh.v.RH;
1038 actual_looseness = 0;
1040 if(mem[r].hh.b0 != 2)
1042 /* line_diff:=line_number(r)-best_line; */
1043 line_diff = toint(mem[r + 1].hh.v.LH)- toint(best_line
1045 /* if ((line_diff<actual_looseness)and(looseness<=line_diff))or@|
1046 ((line_diff>actual_looseness)and(looseness>=line_diff)) then */
1047 if(((line_diff < actual_looseness)&&
1048 (eqtb[(hash_size + 3182)].cint
1049 <= line_diff)) ||((line_diff > actual_looseness)&&
1050 (eqtb[(hash_size + 3182)].cint >= line_diff)))
1053 actual_looseness = line_diff;
1054 fewest_demerits = mem[r + 2].cint;
1056 else if((line_diff == actual_looseness)&&(mem[r + 2]
1057 .cint < fewest_demerits))
1060 fewest_demerits = mem[r + 2].cint;
1064 } while(!(r == mem_top - 7));
1065 best_line = mem[best_bet + 1].hh.v.LH;
1067 /* if (actual_looseness=looseness)or final_pass then goto done; */
1068 /* if((actual_looseness == eqtb[(hash_size + 3182)].cint)|| final_pass)*/
1069 if((actual_looseness == eqtb[(hash_size + 3182)].cint)) {
1077 q = mem[mem_top - 7].hh.v.RH;
1078 while(q != mem_top - 7){
1079 cur_p = mem[q].hh.v.RH;
1080 if(mem[q].hh.b0 == 2)
1082 else free_node(q, 3);
1087 cur_p = mem[q].hh.v.RH;
1095 if(eqtb[(hash_size + 3195)].cint > 0)
1096 print_nl(928); /* @second_pass */
1098 /* threshold:=tolerance; */
1099 threshold = eqtb[(hash_size + 3164)].cint;
1101 second_pass_count++; /* 96 Feb 9 */
1102 /* final_pass:=(emergency_stretch<=0); */
1103 final_pass =(eqtb[(hash_size + 3750)].cint <= 0);
1109 if(eqtb[(hash_size + 3195)].cint > 0) /* tracing_paragraphs */
1110 print_nl(929); /* @emergencypass */
1112 /* can only get here is \emergencystretch has been set positive */
1113 /* background[2]:=background[2]+emergency_stretch; final_pass:=true; */
1114 background[2]= background[2]+ eqtb[(hash_size + 3750)].cint;
1116 final_pass_count++; /* 96 Feb 9 */
1117 } /* end of if second_pass */
1118 } /* end of while(true)do */
1119 /* cannot drop through from above loop */
1120 lab30: /* common exit point */
1121 /* if (badness > (pre)tolerance) */
1122 /* if(last_badness > threshold){ */
1123 /* if(savedbadness > threshold){ */ /* do we believe this ??? */
1124 /* paragraph_failed++; */ /* 96/Feb/9 */
1126 /* if (prevgraf == 1) singleline++; */
1127 /* if (nest[nest_ptr].pg_field == 1) singleline++; */
1128 /* At this point best_line is number of lines in paragraph + 1 */
1129 if (best_line == 2) singleline++;
1132 if(eqtb[(hash_size + 3195)].cint > 0)
1134 end_diagnostic(true);
1135 normalize_selector ();
1138 post_line_break(finalwidowpenalty);
1139 q = mem[mem_top - 7].hh.v.RH;
1140 while(q != mem_top - 7){
1141 cur_p = mem[q].hh.v.RH;
1142 if(mem[q].hh.b0 == 2)
1144 else free_node(q, 3);
1148 while(q != 0){ /* while q<>null do l.16979 */
1149 cur_p = mem[q].hh.v.RH;
1153 pack_begin_line = 0;
1156 void prefixed_command (void)
1159 internal_font_number f;
1166 while(cur_cmd == 93){
1167 if(! odd(a / cur_chr))
1168 a = a + cur_chr; /* small_number a; */
1171 } while(!((cur_cmd != 10)&&(cur_cmd != 0)));
1175 if(interaction == 3)
1177 print_nl(262); /* ! */
1178 print(1173); /* You can't use a prefix with ` */
1180 print_cmd_chr(cur_cmd, cur_chr);
1181 print_char(39); /* ' */
1184 help_line[0]= 1174; /* I'll pretend you didn't say \long or \outer or \global. */
1190 if((cur_cmd != 97)&&(a % 4 != 0)) {
1192 if(interaction == 3)
1194 print_nl(262); /* ! */
1195 print(682); /* You can't use ` */
1197 print_esc(1165); /* long */
1198 print(1175); /* ' or ` */
1199 print_esc(1166); /* outer */
1200 print(1176); /* ' with ` */
1201 print_cmd_chr(cur_cmd, cur_chr);
1202 print_char(39); /* ' */
1205 help_line[0]= 1177; /* I'll pretend you didn't say \long or \outer here. */
1209 if(eqtb[(hash_size + 3206)].cint != 0)
1210 if(eqtb[(hash_size + 3206)].cint < 0)
1223 /* set_font: define(cur_font_loc,data,cur_chr); */
1225 geq_define((hash_size + 1834), 120, cur_chr);
1226 else eq_define((hash_size + 1834), 120, cur_chr);
1230 if(odd(cur_chr)&& !(a >= 4)&&
1231 (eqtb[(hash_size + 3206)].cint >= 0))
1236 q = scan_toks(true, e);
1237 if((a >= 4)) geq_define(p, 111 +(a % 4), def_ref);
1238 else eq_define(p, 111 +(a % 4), def_ref);
1250 } while(!(cur_cmd != 10));
1268 incr(mem[cur_chr].hh.v.LH);
1270 geq_define(p, cur_cmd, cur_chr);
1271 else eq_define(p, cur_cmd, cur_chr);
1279 if((a >= 4)) geq_define(p, 0, 256);
1280 else eq_define(p, 0, 256);
1281 scan_optional_equals ();
1287 geq_define(p, 68, cur_val);
1288 else eq_define(p, 68, cur_val);
1293 scan_fifteen_bit_int ();
1295 geq_define(p, 69, cur_val);
1296 else eq_define(p, 69, cur_val);
1301 scan_eight_bit_int ();
1305 geq_define(p, 73, (hash_size + 3218) + cur_val);
1306 else eq_define(p, 73, (hash_size + 3218) + cur_val);
1310 geq_define(p, 74, (hash_size + 3751) + cur_val);
1311 else eq_define(p, 74, (hash_size + 3751) + cur_val);
1315 geq_define(p, 75, (hash_size + 800) + cur_val);
1316 else eq_define(p, 75, (hash_size + 800) + cur_val);
1320 geq_define(p, 76, (hash_size + 1056) + cur_val);
1321 else eq_define(p, 76, (hash_size + 1056) + cur_val);
1325 geq_define(p, 72, (hash_size + 1322) + cur_val);
1326 else eq_define(p, 72, (hash_size + 1322) + cur_val);
1338 if(! scan_keyword(836)) /* to */
1341 if(interaction == 3)
1343 print_nl(262); /* ! */
1344 print(1067); /* Missing `to' inserted */
1348 help_line[1]= 1194; /* You should have said `\read<number> to \cs'. */
1349 help_line[0]= 1195; /* I'm going to look for the \cs now. */
1356 if((a >= 4)) geq_define(p, 111, cur_val);
1357 else eq_define(p, 111, cur_val);
1366 scan_eight_bit_int ();
1367 p = (hash_size + 1322) + cur_val;
1370 scan_optional_equals ();
1373 } while(!((cur_cmd != 10)&&(cur_cmd != 0)));
1378 scan_eight_bit_int ();
1380 cur_chr = (hash_size + 1322) + cur_val;
1384 q = eqtb[cur_chr].hh.v.RH;
1387 geq_define(p, 101, 0);
1388 else eq_define(p, 101, 0);
1391 incr(mem[q].hh.v.LH);
1393 geq_define(p, 111, q);
1394 else eq_define(p, 111, q);
1401 q = scan_toks(false, false);
1402 if(mem[def_ref].hh.v.RH == 0){
1404 geq_define(p, 101, 0);
1405 else eq_define(p, 101, 0);
1407 mem[def_ref].hh.v.RH = avail;
1417 if(p == (hash_size + 1313)) /* output ? */
1419 mem[q].hh.v.RH = get_avail ();
1421 mem[q].hh.v.LH = 637;
1423 mem[q].hh.v.LH = 379;
1424 mem[q].hh.v.RH = mem[def_ref].hh.v.RH;
1425 mem[def_ref].hh.v.RH = q;
1428 geq_define(p, 111, def_ref);
1429 else eq_define(p, 111, def_ref);
1436 scan_optional_equals ();
1439 geq_word_define(p, cur_val);
1440 else eq_word_define(p, cur_val);
1446 scan_optional_equals ();
1447 scan_dimen(false, false, false);
1449 geq_word_define(p, cur_val);
1450 else eq_word_define(p, cur_val);
1458 scan_optional_equals ();
1459 if(n == 76) scan_glue(3);
1463 geq_define(p, 117, cur_val);
1464 else eq_define(p, 117, cur_val);
1469 if(cur_chr == (hash_size + 1883))
1471 else if(cur_chr == (hash_size + 2907))
1472 n = 32768L; /* 2^15 */
1473 else if(cur_chr == (hash_size + 2651))
1474 n = 32767; /* 2^15 - 1*/
1475 else if(cur_chr == (hash_size + 3474))
1476 n = 16777215L; /* 2^24 - 1 */
1477 else n = 255; /* 2^8 - 1 */
1481 scan_optional_equals ();
1483 if(((cur_val < 0)&&(p < (hash_size + 3474))) ||(cur_val > n))
1486 if(interaction == 3)
1488 print_nl(262); /* ! */
1489 print(1196); /* Invalid code(*/
1492 if(p < (hash_size + 3474))
1493 print(1197); /*), should be in the range 0.. */
1494 else print(1198); /*), should be at most */
1498 help_line[0]= 1199; /* I'm going to use 0 instead of that illegal code value. */
1503 if(p < (hash_size + 2907))
1505 geq_define(p, 120, cur_val);
1506 else eq_define(p, 120, cur_val);
1507 else if(p < (hash_size + 3474))
1509 geq_define(p, 120, cur_val);
1510 else eq_define(p, 120, cur_val);
1512 geq_word_define(p, cur_val);
1513 else eq_word_define(p, cur_val);
1519 scan_four_bit_int ();
1521 scan_optional_equals ();
1524 geq_define(p, 120, cur_val);
1525 else eq_define(p, 120, cur_val);
1532 do_register_command(a);
1536 scan_eight_bit_int ();
1540 scan_optional_equals ();
1541 if(set_box_allowed){
1542 scan_box(1073741824L + n); /* 2^30 + n */ /* box_flag + n */
1547 if(interaction == 3)
1549 print_nl(262); /* ! */
1550 print(677); /* Improper */
1552 print_esc(533); /* setbox */
1555 help_line[1]= 1205; /* Sorry, \setbox is not allowed after \halign in a display, */
1556 help_line[0]= 1206; /* or between \accent and an accented character. */
1569 alter_page_so_far ();
1579 scan_optional_equals ();
1586 p = get_node(2 * n + 1);
1589 register integer for_end;
1594 scan_dimen(false, false, false);
1595 mem[p + 2 * j - 1].cint = cur_val;
1596 scan_dimen(false, false, false);
1597 mem[p + 2 * j].cint = cur_val;
1599 while(j++ < for_end);
1603 geq_define((hash_size + 1312), 118, p);
1604 else eq_define((hash_size + 1312), 118, p);
1612 if (is_initex) { /* bkph */
1618 if(interaction == 3)
1620 print_nl(262); /* ! */
1621 print(1210); /* Patterns can be loaded only by INITEX */
1627 } while(!(cur_cmd == 2));
1632 new_hyph_exceptions ();
1638 find_font_dimen(true);
1640 scan_optional_equals ();
1641 scan_dimen(false, false, false);
1642 font_info[k].cint = cur_val;
1650 scan_optional_equals ();
1652 if(n == 0)hyphen_char[f]= cur_val;
1653 else skew_char[f]= cur_val;
1664 confusion(1172); /* prefix */
1665 return; // abort_flag set
1668 } /* end of cur_cmd switch */
1672 if(after_token != 0) {
1673 cur_tok = after_token;
1679 /* added following explanations 96/Jan/10 */
1681 void badformatorpool (char *name, char *defaultname, char *envvar)
1683 if (name == NULL) name = defaultname;
1684 sprintf(log_line, "(Perhaps %s is for an older version of TeX)\n", name);
1685 showline(log_line, 0);
1686 name_of_file[name_length + 1] = '\0'; /* null terminate */
1687 sprintf(log_line, "(Alternatively, %s may have been corrupted)\n", name_of_file+1);
1688 showline(log_line, 0);
1689 name_of_file[name_length + 1] = ' '; /* space terminate */
1691 "(Perhaps your %s environment variable is not set correctly)\n", envvar);
1692 showline(log_line, 0);
1694 char *s; /* extra info 99/April/28 */
1695 if ((s = grabenv(envvar)) != NULL) {
1696 sprintf(log_line, "(%s=%s)\n", envvar, s);
1697 showline(log_line, 0);
1700 sprintf(log_line, "%s environment variable not set\n", envvar);
1701 showline(log_line, 0);
1709 bool load_fmt_file (void)
1710 {/* 6666 10 */ register bool Result;
1715 undump_int(x); /* CHECKSUM */
1716 if(x != BEGINFMTCHECKSUM) /* magic FMT file start 4C 20 E6 15 hex */
1719 undump_int(x); /* mem_bot */
1724 undump_int(x); /* mem_top */
1725 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1727 /* we already read this once earlier to grab mem_top */
1729 sprintf(log_line, "Read from fmt file mem_top = %d TeX words\n", x);
1730 showline(log_line, 0);
1732 /* allocate_main_memory (x); */ /* allocate main memory at this point */
1733 mem = allocate_main_memory(x); /* allocate main memory at this point */
1734 if (mem == NULL) exit(1); /* redundant sanity test ! */
1735 initialize_aux(); /* do `mem' part of initialize */
1736 /* mem = zmem; */ /* update pointer to main memory */
1738 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1742 undump_int(x); /* eqtbsize */
1743 if(x != (hash_size + 4006)) /* eqtbsize */
1745 undump_int(x); /* hash_prime */
1748 undump_int(x); /* hyphen_prime */
1749 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1750 #ifdef ALLOCATEHYPHEN
1751 /* allow format files dumped with arbitrary (prime) hyphenation exceptions */
1752 realloc_hyphen (x); /* reset_hyphen(); */
1755 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1757 if(x != hyphen_prime)
1760 undump_int(x); /* pool_size */
1763 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1764 #ifdef ALLOCATESTRING
1765 if(x > current_pool_size) {
1767 sprintf(log_line, "undump string pool reallocation (%d > %d)\n",
1768 x, current_pool_size);
1769 showline(log_line, 0);
1771 str_pool = realloc_str_pool (x - current_pool_size + increment_pool_size);
1773 if(x > current_pool_size) /* 94/Jan/24 */
1775 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1780 sprintf(log_line, "%s%s\n", "---! Must increase the ", "string pool size");
1781 showline(log_line, 0);
1787 undump_int(x); /* max_strings */
1790 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1791 #ifdef ALLOCATESTRING
1792 if(x > current_max_strings){
1794 sprintf(log_line, "undump string pointer reallocation (%d > %d)\n",
1795 x, current_max_strings);
1796 showline(log_line, 0);
1798 str_start = realloc_str_start(x - current_max_strings + increment_max_strings);
1800 if(x > current_max_strings) /* 94/Jan/24 */
1802 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1807 sprintf(log_line, "%s%s\n", "---! Must increase the ", "max strings");
1808 showline(log_line, 0);
1814 if (undumpthings(str_start[0], str_ptr + 1) /* undump string ptrs */
1816 if (undumpthings(str_pool[0], pool_ptr) /* undump string pool */
1819 init_str_ptr = str_ptr;
1820 init_pool_ptr = pool_ptr;
1821 /* undump the dynamic memory - paragraph 1312 in the book */
1824 if((x < 1019)||(x > mem_top - 14))
1826 else lo_mem_max = x;
1830 if((x < 20)||(x > lo_mem_max))
1834 p = 0; /* mem_bot */
1837 if (undumpthings(mem[p], q + 2 - p)
1839 p = q + mem[q].hh.v.LH;
1840 if((p > lo_mem_max)||((q >= mem[q + 1].hh.v.RH)&&(mem[q +
1841 1].hh.v.RH != rover)))
1843 q = mem[q + 1].hh.v.RH;
1844 } while(!(q == rover));
1845 if (undumpthings(mem[p], lo_mem_max + 1 - p)
1847 /* if(mem_min < -2) */
1848 if(mem_min < mem_bot - 2) /* ? splice in block below */
1850 /* or call addvariablespace(mem_bot - (mem_min + 1)) */
1852 if (trace_flag) showline("Splicing in mem_min space in undump!\n", 0);
1854 p = mem[rover + 1].hh.v.LH;
1856 mem[mem_min].hh.v.RH = 0; /* null */
1857 mem[mem_min].hh.v.LH = 0; /* null */
1858 mem[p + 1].hh.v.RH = q;
1859 mem[rover + 1].hh.v.LH = q;
1860 mem[q + 1].hh.v.RH = rover;
1861 mem[q + 1].hh.v.LH = p;
1862 /* mem[q].hh.v.RH = 262143L; */ /* NO! */
1863 mem[q].hh.v.RH = empty_flag;
1864 /* mem[q].hh.v.LH = -0 - q; */
1865 mem[q].hh.v.LH = mem_bot - q; /* ? size of block */
1869 if((x < lo_mem_max + 1)||(x > mem_top - 13))
1871 else hi_mem_min = x;
1875 /* if((x < 0)||(x > mem_top)) */
1876 if((x < mem_bot)||(x > mem_top))
1881 if (undumpthings(mem[hi_mem_min], mem_end + 1 - hi_mem_min)
1883 undump_int(var_used);
1884 undump_int(dyn_used);
1888 if((x < 1)||(k + x > (hash_size + 4007)))
1890 if (undumpthings(eqtb[k], x)
1894 if((x < 0)||(k + x > (hash_size + 4007)))
1897 register integer for_end;
1899 for_end = k + x - 1;
1901 eqtb[j]= eqtb[k - 1];
1902 while(j++ < for_end);
1905 } while(!(k > (hash_size + 4006)));
1908 /* if((x < hashbase)||(x > hashbase + hashsize)) */
1909 /* if((x < 514)||(x > (hash_size + 514))) */
1910 if((x < 514)||(x > (hash_size + hash_extra + 514))) /*96/Jan/10*/
1914 par_token = 4095 + par_loc;
1917 /* if((x < hashbase)||(x > hashbase + hashsize)) */
1918 /* if((x < 514)||(x > (hash_size + 514))) */
1919 if((x < 514)||(x > (hash_size + hash_extra + 514))) /*96/Jan/10*/
1926 /* if((x < hashbase)||(x > hashbase + hashsize)) */
1927 /* if((x < 514)||(x > (hash_size + 514))) */
1928 if((x < 514)||(x > (hash_size + hash_extra + 514))) /*96/Jan/10*/
1936 if((x < p + 1)||(x > hash_used))
1941 } while(!(p == hash_used));
1942 if (undumpthings(hash[hash_used + 1], (hash_size + 780) - hash_used)
1945 undump_int(cs_count); /* cs_count */
1947 sprintf(log_line, "itex undump cs_count %d ", cs_count); /* debugging */
1948 showline(log_line, 0);
1951 undump_int(x); /* font_mem_size */
1954 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1957 sprintf(log_line, "Read from fmt fmem_ptr = %d\n", x);
1958 showline(log_line, 0);
1960 if(x > current_font_mem_size){ /* 93/Nov/28 dynamic allocate font_info */
1962 sprintf(log_line, "Undump realloc font_info (%d > %d)\n",
1963 x, current_font_mem_size);
1964 showline(log_line, 0);
1966 font_info = realloc_font_info(x - current_font_mem_size + increment_font_mem_size);
1968 if(x > current_font_mem_size) /* in case allocation failed 94/Jan/24 */
1970 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1971 if(x > font_mem_size)
1975 sprintf(log_line, "%s%s\n", "---! Must increase the ", "font mem size");
1976 showline(log_line, 0);
1982 if (undumpthings(font_info[0], fmem_ptr)
1985 undump_int(x); /* font_max */
1991 sprintf(log_line, "%s%s\n", "---! Must increase the ", "font max");
1992 showline(log_line, 0);
1997 frozenfontptr = font_ptr; /* remember number of fonts frozen into format */
1998 if (undumpthings(font_check[0], font_ptr + 1)
2000 if (undumpthings(font_size[0], font_ptr + 1)
2002 if (undumpthings(font_dsize[0], font_ptr + 1)
2004 if (undumpthings(font_params[0], font_ptr + 1)
2006 if (undumpthings(hyphen_char[0], font_ptr + 1)
2008 if (undumpthings(skew_char[0], font_ptr + 1)
2010 if (undumpthings(font_name[0], font_ptr + 1)
2012 if (undumpthings(font_area[0], font_ptr + 1)
2014 if (undumpthings(font_bc[0], font_ptr + 1)
2016 if (undumpthings(font_ec[0], font_ptr + 1)
2018 if (undumpthings(char_base[0], font_ptr + 1)
2020 if (undumpthings(width_base[0], font_ptr + 1)
2022 if (undumpthings(height_base[0], font_ptr + 1)
2024 if (undumpthings(depth_base[0], font_ptr + 1)
2026 if (undumpthings(italic_base[0], font_ptr + 1)
2028 if (undumpthings(lig_kern_base[0], font_ptr + 1)
2030 if (undumpthings(kern_base[0], font_ptr + 1)
2032 if (undumpthings(exten_base[0], font_ptr + 1)
2034 if (undumpthings(param_base[0], font_ptr + 1)
2036 if (undumpthings(font_glue[0], font_ptr + 1)
2038 if (undumpthings(bchar_label[0], font_ptr + 1)
2040 if (undumpthings(font_bchar[0], font_ptr + 1)
2042 if (undumpthings(font_false_bchar[0], font_ptr + 1)
2046 /* log not opened yet, so can't show fonts frozen into format */
2048 /* May be able to avoid the following since we switched to */
2049 /* non_address from font_mem_size to 0 96/Jan/15 ??? */
2050 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2052 /* deal with fmt files dumped with *different* font_mem_size 93/Nov/29 */
2053 { int count = 0, oldfont_mem_size = 0;
2054 for (x = 0; x <= font_ptr; x++) {
2055 if(bchar_label[x] > oldfont_mem_size) oldfont_mem_size = bchar_label[x];
2057 /* somewhat arbitrary sanity check ... */
2058 /* if (oldfont_mem_size != font_mem_size && oldfont_mem_size > font_max) { */
2059 if (oldfont_mem_size != non_address && oldfont_mem_size > font_max) { /* 96/Jan/16 */
2060 for (x = 0; x <= font_ptr; x++) {
2061 if(bchar_label[x] == oldfont_mem_size) {
2062 /* bchar_label[x] = font_mem_size; */
2063 bchar_label[x] = non_address; /* 96/Jan/16 */
2070 "oldfont_mem_size is %d --- hit %d times. Using non_address %d\n",
2071 oldfont_mem_size, count, non_address);
2072 showline(log_line, 0);
2078 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2079 /* undump(0)(hyph_size)(hyph_count); */
2082 /* if((x < 0)||(x > 607)) */
2083 if((x < 0)||(x > hyphen_prime))
2085 else hyph_count = x;
2087 /* undump hypenation exception tables p.1325 */
2089 register integer for_end;
2091 for_end = hyph_count;
2097 /* if((x < 0)||(x > 607)) */
2098 if((x < 0)||(x > hyphen_prime))
2102 /* undump(0)(str_ptr)(hyph_word[j]); */
2105 if((x < 0)||(x > str_ptr))
2107 else hyph_word[j]= x;
2109 /* undump(min_halfword)(max_halfword)(hyph_list[j]); */
2112 /* if((x < 0)||(x > 262143L)) */
2113 if((x < 0)||(x > max_halfword)) /* mem_top ? no p.1325 */
2115 else hyph_list[j]= x;
2118 while(k++ < for_end);
2120 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2121 #ifdef ALLOCATEHYPHEN
2122 /* if user specified new hyphen prime - flush existing exception patterns ! */
2123 /* but, we can reclaim the string storage wasted ... */
2125 if (new_hyphen_prime != 0) {
2126 realloc_hyphen(new_hyphen_prime); /* reset_hyphen(); */
2127 hyphen_prime = new_hyphen_prime;
2131 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2136 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2137 #ifdef ALLOCATETRIES
2139 ALLOCATETRIES(x); /* allocate only as much as is needed */
2140 /* trie_size = x; */ /* ??? */
2143 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2147 sprintf(log_line, "%s%s\n", "---! Must increase the ", "trie size");
2148 showline(log_line, 0);
2155 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2156 if (is_initex) /* bkph */
2157 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2160 if (undumpthings(trietrl[0], j + 1)
2162 if (undumpthings(trietro[0], j + 1)
2164 if (undumpthings(trietrc[0], j + 1)
2170 if(x > trie_op_size)
2173 sprintf(log_line, "%s%s\n", "---! Must increase the ", "trie op size");
2174 showline(log_line, 0);
2181 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2182 if (is_initex) /* bkph */
2183 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2187 begin undump(0)(63)(hyf_distance[k]); {a |small_number|}
2188 undump(0)(63)(hyf_num[k]);
2189 undump(min_quarterword)(max_quarterword)(hyf_next[k]); end; */
2190 if (undumpthings(hyf_distance[1], j)
2192 if (undumpthings(hyf_num[1], j)
2194 if (undumpthings(hyf_next[1], j)
2198 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2199 if (is_initex) { /* bkph */
2200 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2202 register integer for_end;
2207 while(k++ < for_end);
2213 /* undump(0)(k-1)(k) */
2216 if((x < 0)||(x > k - 1))
2220 /* undump(1)(j)(x) */
2223 if((x < 1)||(x > j))
2229 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2230 if (is_initex) /* bkph */
2231 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2234 /* j:=j-x; op_start[k]:=qo(j); */
2240 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2241 if (is_initex) /* bkph */
2242 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2243 trie_not_ready = false
2248 if((x < 0)||(x > 3))
2250 /* else interaction = x; */
2251 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2252 if (interaction < 0) /* may now set in local.c bkph 94/Jan/8 */
2253 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2258 if((x < 0)||(x > str_ptr))
2260 else format_ident = x;
2263 /* test_eof(fmt_file)? */
2264 if((x != ENDFMTCHECKSUM)|| feof(fmt_file)) /* magic checksum --- change ? */
2271 sprintf(log_line, "(Fatal format file error; I'm stymied)\n");
2272 showline(log_line, 1);
2273 /* added following bit of explanation 96/Jan/10 */
2275 badformatorpool(format_file, "the format file", "TEXFORMATS");
2280 void final_clean_up (void)
2283 c = cur_chr; /* small_number c */
2284 if(job_name == 0)open_log_file ();
2285 /* ******************************** 3.14159 ***************************** */
2286 while(input_ptr > 0)
2287 if(cur_input.state_field == 0){
2290 else end_file_reading ();
2291 /* *********************************************************************** */
2292 while(open_parens > 0){
2298 print_esc(1271); /* end occurred */
2299 print(1272); /* inside a group at level */
2300 print_int(cur_level - 1);
2301 print_char(41); /*)*/
2303 while(cond_ptr != 0){
2305 print_esc(1271); /* end occurred */
2306 print(1273); /* when */
2307 print_cmd_chr(105, cur_if); /* i */
2310 print(1274); /* on line */
2313 print(1275); /* was incomplete) */
2314 if_line = mem[cond_ptr + 1].cint;
2315 cur_if = mem[cond_ptr].hh.b1;
2316 /* *********************************************************************** */
2317 temp_ptr = cond_ptr; /* new in 3.14159 */
2318 cond_ptr = mem[cond_ptr].hh.v.RH;
2319 free_node(temp_ptr, 2); /* new in 3.14159 */
2320 /* *********************************************************************** */
2323 if(((history == 1)||(interaction < 3)))
2327 print_nl(1276); /* (see the transcript file for additional information) */
2333 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2334 if (is_initex) { /* bkph */
2335 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2336 /* *************************** new in 3.14159 ***************************** */
2338 register integer for_end;
2343 delete_token_ref(cur_mark[c]);
2344 while(c++ < for_end);
2346 /* *********************************************************************** */
2347 storefmtfile (); // returns a value ?
2350 if (!is_initex) /* 2000/March/3 */
2351 print_nl(1277); /* (\dump is performed only by INITEX) */
2355 // debugging code for checking the string pool
2358 int checkpool (char *task)
2360 int c, i, k, n, st, flag, bad=0;
2363 sprintf(log_line, "Check on string pool start (%s)\n", task);
2364 showline(log_line, 0);
2366 for (k = 0; k < 32; k++) {
2367 if (str_start[k] != 3 * k) {
2368 sprintf(log_line, "k %d str_start[k] %d\n", k, str_start[k]);
2369 showline(log_line, 0);
2372 for (k = 32; k < 128; k++) {
2373 if (str_start[k] != 96 + (k - 32)) {
2374 sprintf(log_line, "k %d str_start[k] %d\n", k, str_start[k]);
2375 showline(log_line, 0);
2378 for (k = 128; k < 256; k++) {
2379 if (str_start[k] != 194 + 4 * (k - 128)){
2380 sprintf(log_line, "k %d str_start[k] %d\n", k, str_start[k]);
2381 showline(log_line, 0);
2385 sprintf(log_line, "Check on string pool (%s)\n", task);
2386 showline(log_line, 0);
2388 for (k = 0; k < str_ptr; k++) {
2389 if (str_start[k+1] == 0) break;
2390 n = str_start[k+1] - str_start[k];
2394 for (i = 0; i < n; i++) {
2395 if (str_pool[st + i] == 0) {
2398 if (str_pool[st + i] > 255) {
2404 sprintf(log_line, "BAD %d (start at %d): ", k, st);
2405 showline(log_line, 0);
2407 for (i = 0; i < n; i++) {
2408 c = str_pool[st + i];
2410 sprintf(s, "%d ", c);
2429 showline(log_line, stdout);
2432 sprintf(log_line, "end of check (%s)\n", bad ? "BAD" : "OK");
2433 showline(log_line, 0);
2435 if (task == NULL) return bad;
2439 } /* DEBUGGING ONLY */
2442 void showfrozen (void)
2445 fprintf(log_file, "\n");
2446 fprintf(log_file, "(%d fonts frozen in format file:\n", font_ptr);
2447 /* ignore font 0 which is nullfont */
2448 /* for (i = 1; i < font_ptr+1; i++) */
2449 for (i = 1; i <= font_ptr; i++) {
2450 if (i > 1) fprintf(log_file, ", ");
2451 if ((i % 8) == 0) fprintf(log_file, "\n");
2452 n = str_start[font_name[i]+1]-str_start[font_name[i]];
2453 for (j = 0; j < n; j++) {
2454 putc(str_pool[str_start[font_name[i]]+j], log_file);
2455 /* str_pool[str_start[font_name[i]]+j] = '?'; */
2458 fprintf(log_file, ") ");
2461 /* Main entry point called from texmf.c int main(int ac, char *av[]) */
2462 /* call from main_program in texmf.c */
2463 /* This in turn calls initialize() */
2465 #pragma warning(disable:4127) // conditional expression is constant
2467 /* void texbody() */
2468 int texbody (void) /* now returns a value --- bkph */
2472 setpaths(TEXFORMATPATHBIT + TEXINPUTPATHBIT + TEXPOOLPATHBIT + TFMFILEPATHBIT);
2474 if(ready_already == 314159L)goto lab1; /* magic number */
2475 /* These tests are almost all compile time tests and so could be eliminated */
2477 if((half_error_line < 30)||(half_error_line > error_line - 15))
2479 if(max_print_line < 60) bad = 2;
2480 if(dvi_buf_size % 8 != 0) bad = 3;
2481 if(1100 > mem_top)bad = 4; /* not compile time */
2482 /* if(hash_prime > hash_size) */
2483 if(hash_prime > (hash_size + hash_extra)) bad = 5;
2484 if(max_in_open >= 128)bad = 6; /* p.14 */
2485 if(mem_top < 267)bad = 7; /* where from ? *//* not compile time */
2488 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2489 if (is_initex) { /* bkph */
2490 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2491 if((mem_min != 0)||(mem_max != mem_top)) bad = 10;
2494 /* if((mem_min > 0)||(mem_max < mem_top)) */
2495 if((mem_min > mem_bot)||(mem_max < mem_top)) bad = 10;
2496 /* if((0 > 0)||(255 < 127)) */
2497 if((min_quarterword > 0)||(max_quarterword < 255)) bad = 11;
2498 /* if((0 > 0)||(262143L < 32767)) */
2499 if((min_halfword > 0)||(max_halfword < 32767)) bad = 12;
2500 /* if((0 < 0)||(255 > 262143L)) */
2501 if((min_quarterword < min_halfword)||(max_quarterword > max_halfword))
2503 /* if((mem_min < 0)||(mem_max >= 262143L)||(-0 - mem_min > 262144L)) */
2504 if((mem_min < min_halfword)||(mem_max >= max_halfword)||(mem_bot - mem_min >= max_halfword))
2506 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2507 if(mem_max > mem_top + mem_extra_high) /* not compile time */
2508 bad = 14; /* ha ha */
2509 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2510 /* if((0 < 0)||(font_max > 255)) */
2511 if((0 < min_quarterword)||(font_max > max_quarterword)) /* 93/Dec/3 */
2513 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2514 #ifdef INCREASEFONTS
2515 /* if(font_max > 512)*/ /* 93/Dec/3 */
2516 if(font_max > 1024) /* 96/Jan/17 */
2518 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2522 /* if((save_size > 262143L)||(max_strings > 262143L)) */
2523 if((save_size > max_halfword)||(max_strings > max_halfword))
2525 /* if(buf_size > 262143L)*/
2526 if(buf_size > max_halfword)bad = 18;
2528 if(max_quarterword - min_quarterword < 255) bad = 19;
2529 /* if cs_token_flag + undefined_control_sequence > max_halfword then bad <- 21;*/
2530 /* if((hash_size + 4876) > 262143L)*/
2531 /* if((hash_size + 4876) > max_halfword) */
2532 if((hash_size + 4095 + 781) > max_halfword) bad = 21;
2533 if(format_default_length > PATHMAX) bad = 31;
2534 /* if(2 * 262143L < mem_top - mem_min) */
2535 if(max_halfword < (mem_top - mem_min) / 2) bad = 41;
2537 sprintf(log_line, "%s%s%ld\n", "Ouch---my internal constants have been clobbered!",
2538 "---case ", (long) bad);
2539 showline(log_line, 1);
2541 badformatorpool(format_file, "the format file", "TEXFORMATS"); /* 96/Jan/17 */
2542 goto lab9999; // abort
2547 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2549 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2550 if(! get_strings_started ()) goto lab9999; // abort
2552 init_str_ptr = str_ptr;
2553 init_pool_ptr = pool_ptr;
2554 dateandtime(eqtb[(hash_size + 3183)].cint,
2555 eqtb[(hash_size + 3184)].cint,
2556 eqtb[(hash_size + 3185)].cint,
2557 eqtb[(hash_size + 3186)].cint);
2560 ready_already = 314159L; /* magic number */
2562 lab1: /* get here directly if ready_already already set ... */
2567 showline(tex_version, 0);
2568 sprintf(log_line, " (%s %s)", application, yandyversion);
2569 showline(log_line, 0);
2570 if(format_ident > 0)slow_print(format_ident);
2576 name_in_progress = false;
2578 output_file_name = 0;
2584 high_in_open = 0; /* max_in_open name already used 1999 Jan 17 */
2586 max_open_parens = 0; /* max_open_parens */
2589 max_param_stack = 0;
2590 #ifdef ALLOCATEBUFFER
2591 /* first = current_buf_size; */
2592 memset (buffer, 0, current_buf_size); /* redundant */
2594 /* first = buf_size; */
2595 memset (buffer, 0, buf_size); /* redundant ? */
2600 } while(!(first == 0)); */
2601 first = 0; /* 1999/Jan/22 */
2604 warning_index = 0; /* warning_index:=null; l.7068 */
2606 cur_input.state_field = 33;
2607 cur_input.start_field = 1;
2608 cur_input.index_field = 0;
2610 cur_input.name_field = 0;
2612 align_state = 1000000L;
2613 if(! init_terminal ())goto lab9999; // abort
2614 cur_input.limit_field = last;
2617 /* if((format_ident == 0)||(buffer[cur_input.loc_field]== 38)) */
2618 /* For Windows NT, lets allow + instead of & for format specification */
2619 if((format_ident == 0)||
2620 (buffer[cur_input.loc_field]== '&')||
2621 (buffer[cur_input.loc_field]== '+'))
2623 if(format_ident != 0)initialize ();
2624 if(! open_fmt_file ())goto lab9999; // abort
2625 if(! load_fmt_file ()){
2627 goto lab9999; // abort
2630 while((cur_input.loc_field < cur_input.limit_field)&&
2631 (buffer[cur_input.loc_field]== 32))
2632 incr(cur_input.loc_field);
2635 if (debug_flag) check_eqtb("after format"); /* debugging 94/Apr/5 */
2637 if((eqtb[(hash_size + 3211)].cint < 0)||
2638 (eqtb[(hash_size + 3211)].cint > 255))
2639 decr(cur_input.limit_field);
2640 /* long to unsigned char ... */
2641 else buffer[cur_input.limit_field]= eqtb[(hash_size + 3211)].cint;
2642 dateandtime(eqtb[(hash_size + 3183)].cint,
2643 eqtb[(hash_size + 3184)].cint,
2644 eqtb[(hash_size + 3185)].cint,
2645 eqtb[(hash_size + 3186)].cint);
2646 magic_offset = str_start[886]- 9 * 16; /* following: */
2647 /* "0234000122*4000133**3**344*0400400*000000234000111*1111112341011" */
2648 if(interaction == 0) selector = 16;
2650 if((cur_input.loc_field < cur_input.limit_field)&&
2651 (eqtb[(hash_size + 1883) +
2652 buffer[cur_input.loc_field]].hh.v.RH != 0))
2656 /* show font TFMs frozen into format file */
2657 /* moved here after start_input to ensure the log file is open */
2658 if (show_tfm_flag && log_opened && font_ptr > 0) /* 98/Sep/28 */
2662 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2663 main_time = clock();
2664 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2667 if (show_cs_names) printcsnames(stdout, 0); /* 98/Mar/31 */
2669 main_control(); /* read-eval-print loop :-) in tex8.c */
2671 // what if abort_flag is set now ?
2673 if (show_cs_names) printcsnames(stdout, 1); /* 98/Mar/31 */
2675 // what if abort_flag is set now ?
2679 // if (abort_flag) return -1;
2681 close_files_and_terminate();
2690 if((history != 0)&&(history != 1)) code = 1;
2692 // now return instead of exit to allow cleanup in local.c
2696 } /* end of texbody */
2699 /* add a block of variable size node space below mem_bot */
2700 void addvariablespace(int size)
2701 { /* used in tex0.c, local.c, itex.c */
2707 if (mem_min == 0) t = mem_min; /* bottom of present block */
2708 else t = mem_min + 1;
2709 mem_min = t - (size + 1); /* first word in new block - 1 */
2710 /* mem_min = mem_start; */ /* allocate all of it at once */
2711 if (mem_min < mem_start) { /* sanity test */
2712 if (trace_flag) showline("WARNING: mem_min < mem_start!\n", 0);
2713 mem_min = mem_start;
2715 p = mem[rover + 1].hh.v.LH;
2717 mem[mem_min].hh.v.RH = 0; /* insert blank word below ??? */
2718 mem[mem_min].hh.v.LH = 0; /* insert blank word below ??? */
2719 mem[p + 1].hh.v.RH = q;
2720 mem[rover + 1].hh.v.LH = q;
2721 mem[q + 1].hh.v.RH = rover;
2722 mem[q + 1].hh.v.LH = p;
2723 mem[q].hh.v.RH = empty_flag;
2724 mem[q].hh.v.LH = t - q; /* block size */
2729 /*************************************************************************/
2731 /* All ini TeX code is here at end so can use same pragma optimize for it */
2733 /* Ini-TeX code is rarely needed/used so make it small rather than fast */
2735 #pragma optimize("t", off)
2736 /* #pragma optimize("2", off) */
2737 #pragma optimize("s", on)
2738 /* #pragma optimize("1", on) */
2741 /* split out to allow sharing of code from do_initex and newpattern */
2742 void resettrie (void)
2746 register integer for_end;
2747 k = - (integer) trie_op_size;
2748 for_end = trie_op_size;
2750 do trieophash[k]= 0;
2751 while(k++ < for_end);
2754 register integer for_end;
2755 k = 0; for_end = 255;
2757 do trie_used[k]= min_trie_op;
2758 while(k++ < for_end);
2760 max_op_used = min_trie_op;
2762 trie_not_ready = true;
2766 trie_not_ready = true;
2769 void reset_hyphen (void)
2770 { /* borrowed code from initialize() */
2773 register integer for_end;
2775 for_end = hyphen_prime;
2779 hyph_list[z]= 0; /* hyph_list[z]:=null; l.18131 */
2781 while(z++ < for_end);
2786 void do_initex (void)
2787 { /* split out to allow optimize for space, not time */
2791 /* hyph_pointer z; */
2793 /* for k:=mem_bot+1 to lo_mem_stat_max do mem[k].sc:=0; p.164 */
2795 register integer for_end;
2800 while(k++ < for_end);
2803 while(k <= 19){ /* while k <= lo_mem_stat-max ... */
2804 /* glue_ref_count(k):=null+1; */
2810 mem[6].cint = 65536L;
2812 mem[10].cint = 65536L;
2814 mem[14].cint = 65536L;
2816 mem[15].cint = 65536L;
2818 mem[18].cint = -65536L;
2820 rover = 20; /* rover = lo_mem_stat-max + 1 ... */
2821 /* mem[rover].hh.v.RH = 262143L; */
2822 mem[rover].hh.v.RH = empty_flag;
2823 /* mem[rover].hh.v.LH = 1000; */
2824 mem[rover].hh.v.LH = block_size;
2825 mem[rover + 1].hh.v.LH = rover;
2826 mem[rover + 1].hh.v.RH = rover;
2827 /* lo_mem_max = rover + 1000; */
2828 lo_mem_max = rover + block_size;
2829 mem[lo_mem_max].hh.v.RH = 0;
2830 mem[lo_mem_max].hh.v.LH = 0;
2831 /* for k <- hi_mem_stat_min to mem_top do mem[k] = mem[lo_mem_max]; */
2833 register integer for_end;
2837 do mem[k]= mem[lo_mem_max];
2838 while(k++ < for_end);
2840 /* info(omit_template) <- end_template_token; p.790 */
2841 /* @d end_template_token==cs_token_flag+frozen_end_template */
2842 /* mem[mem_top - 10].hh.v.LH = 14114; */
2843 /* mem[mem_top - 10].hh.v.LH = 10019 + 4095; */ /* + eqtbextra ? NO */
2844 /* mem[mem_top - 10].hh.v.LH = (hash_size + 4614); */
2845 /* mem[mem_top - 10].hh.v.LH = (hash_size + 4095 + 519); */
2846 mem[mem_top - 10].hh.v.LH = (hash_size + hash_extra + 4095 + 519);
2847 /* link(end_span) <- max_quarterword + 1 p.797 */
2848 /* mem[mem_top - 9].hh.v.RH = 256; */ /* 94/Apr/4 ? */
2849 mem[mem_top - 9].hh.v.RH = max_quarterword + 1; /* 96/Oct/12 ??? */
2850 /* info(end_span) <- null p.797 */
2851 mem[mem_top - 9].hh.v.LH = 0;
2852 /* type(last_active) <- hyphenated; p.820 */
2853 mem[mem_top - 7].hh.b0 = 1;
2854 /* line_number(last_active) <- max_halfword; p.820 */
2855 /* mem[mem_top - 6].hh.v.LH = 262143L; */
2856 mem[mem_top - 6].hh.v.LH = empty_flag; /* max_halfword ? */
2857 /* subtype(last_active) <- 0; p.820 */
2858 mem[mem_top - 7].hh.b1 = 0;
2859 /* subtype(page_ins_head) <- 255; p.981 */
2860 mem[mem_top].hh.b1 = 255; /* subtype(page_ins_head) = qi(255) p.981 */
2861 /* type(page_ins_head) <- split_up; p.981 */
2862 mem[mem_top].hh.b0 = 1;
2863 /* link(page_ins_head) <- page_ins_head; p.981 */
2864 mem[mem_top].hh.v.RH = mem_top;
2865 /* type(page_head) <- glue_node; p. 988 */
2866 mem[mem_top - 2].hh.b0 = 10;
2867 /* subtype(page_head) <- normal; p. 988 */
2868 mem[mem_top - 2].hh.b1 = 0;
2869 avail = 0; /* avail <- null p.164 */
2870 mem_end = mem_top; /* mem_end <- mem_top */
2871 hi_mem_min = mem_top - 13; /* hi_mem_min <- hi_mem_stat_min */
2872 var_used = 20; /* var_used <- lo_mem_stat_max */
2873 dyn_used = 14; /* dyn_used <- hi_mem_stat_usage */
2874 /* eq_type(undefined_control_sequence) <- undefined_cs; */
2875 /* equiv(undefined_control_sequence) <- null; */
2876 /* eq_level(undefined_control_sequence) <- level_zero; */
2877 eqtb[(hash_size + 781)].hh.b0 = 101;
2878 eqtb[(hash_size + 781)].hh.v.RH = 0;
2879 eqtb[(hash_size + 781)].hh.b1 = 0;
2880 /* for k <- active_base to undefined_control_sequence -1 do */
2881 /* eqtb[k] <- eqtb(undefined_control_sequence); */
2882 /* {register integer for_end; k = 1; for_end = 10280; if(k <= for_end) do */
2884 register integer for_end;
2886 for_end = (hash_size + 780);
2888 eqtb[k]= eqtb[(hash_size + 781)];
2889 while(k++ < for_end);
2891 eqtb[(hash_size + 782)].hh.v.RH = 0; /* glue_base (hash_size + 782) */
2892 eqtb[(hash_size + 782)].hh.b1 = 1;
2893 eqtb[(hash_size + 782)].hh.b0 = 117;
2894 /* equiv(glue_base):=zero_glue; eq_level(glue_base):=level_one; */
2895 /* eq_type(glue_base):=glue_ref; */
2896 /* {register integer for_end; k = 10283; for_end = 10811; if(k <= for_end) */
2898 register integer for_end;
2899 k = (hash_size + 783);
2900 for_end = (hash_size + 1311);
2902 do eqtb[k]= eqtb[(hash_size + 782)];
2903 while(k++ < for_end);
2905 /* glue_ref_count(zero_glue):=glue_ref_count(zero_glue)+local_base-glue_base; */
2906 /* local_base - glue_base = 530 = 17 glue_pars + 256 skip + 256 mu_skip */
2907 mem[0].hh.v.RH = mem[0].hh.v.RH + 530; /* mem[mem_bot]? */
2908 /* box(0):=null; eq_type(box_base):=box_ref; eq_level(box_base):=level_one; */
2909 eqtb[(hash_size + 1312)].hh.v.RH = 0;
2910 eqtb[(hash_size + 1312)].hh.b0 = 118;
2911 eqtb[(hash_size + 1312)].hh.b1 = 1;
2912 /* for k:=box_base+1 to box_base+255 do eqtb[k]:=eqtb[box_base]; */
2913 /* {register integer for_end; k = 10813; for_end = 11077; if(k <= for_end) */
2915 register integer for_end;
2916 k = (hash_size + 1313);
2917 for_end = (hash_size + 1577);
2919 do eqtb[k]= eqtb[(hash_size + 781)];
2920 while(k++ < for_end);
2922 eqtb[(hash_size + 1578)].hh.v.RH = 0;
2923 eqtb[(hash_size + 1578)].hh.b0 = 119;
2924 eqtb[(hash_size + 1578)].hh.b1 = 1;
2925 /* {register integer for_end; k = 11079; for_end = 11333; if(k <= for_end) */
2927 register integer for_end;
2928 k = (hash_size + 1579);
2929 for_end = (hash_size + 1833);
2931 do eqtb[k]= eqtb[(hash_size + 1578)];
2932 while(k++ < for_end);
2934 eqtb[(hash_size + 1834)].hh.v.RH = 0;
2935 eqtb[(hash_size + 1834)].hh.b0 = 120;
2936 eqtb[(hash_size + 1834)].hh.b1 = 1;
2937 /* {register integer for_end; k = 11335; for_end = 11382; if(k <= for_end) */
2939 register integer for_end;
2940 k = (hash_size + 1835);
2941 for_end = (hash_size + 1882);
2943 do eqtb[k]= eqtb[(hash_size + 1834)];
2944 while(k++ < for_end);
2946 eqtb[(hash_size + 1883)].hh.v.RH = 0;
2947 eqtb[(hash_size + 1883)].hh.b0 = 120;
2948 eqtb[(hash_size + 1883)].hh.b1 = 1;
2949 /* initialize cat_code, lc_code, uc_code, sf_code, math_code 256 * 5 */
2950 /* {register integer for_end; k = 11384; for_end = 12662; if(k <= for_end) */
2952 register integer for_end;
2953 k = (hash_size + 1884);
2954 for_end = (hash_size + 3162);
2956 do eqtb[k]= eqtb[(hash_size + 1883)];
2957 while(k++ < for_end);
2959 /* cat_code(k) <- other_char; math_code(k) <- hi(k); sf_code(k) = 1000; */
2961 register integer for_end;
2966 eqtb[(hash_size + 1883) + k].hh.v.RH = 12;
2967 eqtb[(hash_size + 2907) + k].hh.v.RH = k;
2968 eqtb[(hash_size + 2651) + k].hh.v.RH = 1000;
2970 while(k++ < for_end);
2972 /* cat_base == 11383 */
2973 /* cat_code(carriage_return) <- car_ret; cat_code(" ") <- space */
2974 /* cat_code("\") <- escape; cat_code("%") <- comment; ... */
2975 eqtb[(hash_size + 1896)].hh.v.RH = 5;
2976 eqtb[(hash_size + 1915)].hh.v.RH = 10;
2977 eqtb[(hash_size + 1975)].hh.v.RH = 0;
2978 eqtb[(hash_size + 1920)].hh.v.RH = 14;
2979 eqtb[(hash_size + 2010)].hh.v.RH = 15;
2980 eqtb[(hash_size + 1883)].hh.v.RH = 9;
2981 /* for k:="0" to "9" do math_code(k):=hi(k+var_code); */
2983 register integer for_end;
2987 eqtb[(hash_size + 2907) + k].hh.v.RH = k + 28672; /* '70000 */
2988 while(k++ < for_end);
2990 /* cat_code of uppercase and lowercase letters ... */
2992 register integer for_end;
2998 eqtb[(hash_size + 1883) + k].hh.v.RH = 11;
2999 eqtb[(hash_size + 1883) + k + 32].hh.v.RH = 11;
3000 /* mathcode(k) = hi(k + var_code + "100); */ /* '70000 + 256 */
3001 eqtb[(hash_size + 2907) + k].hh.v.RH =
3002 k + 28928; /* '70000 + 256 */
3003 /* mathcode(k + "a" - "A") = hi(k + "a" - "A" + var_code + "100); */
3004 eqtb[(hash_size + 2907) + k + 32].hh.v.RH =
3005 k + 28960; /* '70000 + 256 + 32 */
3007 eqtb[(hash_size + 2139) + k].hh.v.RH = k + 32;
3008 eqtb[(hash_size + 2139) + k + 32].hh.v.RH = k + 32;
3010 eqtb[(hash_size + 2395) + k].hh.v.RH = k;
3011 eqtb[(hash_size + 2395) + k + 32].hh.v.RH = k;
3013 eqtb[(hash_size + 2651) + k].hh.v.RH = 999;
3015 while(k++ < for_end);
3017 /* {register integer for_end; k = 12663; for_end = 12973; if(k <= for_end) */
3019 register integer for_end;
3020 k = (hash_size + 3163);
3021 for_end = (hash_size + 3473);
3025 while(k++ < for_end);
3027 eqtb[(hash_size + 3180)].cint = 1000;
3028 eqtb[(hash_size + 3164)].cint = 10000;
3029 eqtb[(hash_size + 3204)].cint = 1;
3030 eqtb[(hash_size + 3203)].cint = 25;
3031 eqtb[(hash_size + 3208)].cint = 92;
3032 eqtb[(hash_size + 3211)].cint = 13;
3033 /* {register integer for_end; k = 13230; for_end = 13506; if(k <= for_end) */
3035 register integer for_end;
3039 eqtb[(hash_size + 3474) + k].cint = -1;
3040 while(k++ < for_end);
3042 eqtb[(hash_size + 3520)].cint = 0;
3043 /* {register integer for_end; k = 13230; for_end = 13506; if(k <= for_end) */
3045 register integer for_end;
3046 k = (hash_size + 3730);
3047 for_end = (hash_size + 4006);
3049 do eqtb[k].cint = 0;
3050 while(k++ < for_end);
3052 /* hash_used = 10014; */ /* hash_used = frozen_control_sequence */
3053 /* frozen_control_sequence = hashsize + hashbase p.222 */
3054 /* hash_used = (hash_size + 514); */
3055 hash_used = (hash_size + hash_extra + 514); /* 96/Jan/10 */
3057 if (trace_flag) showline("itex cs_count=0 ", 0); /* debugging */
3058 /* eq_type(frozen_dont_expand) <- dont_expand; */
3059 /* eqtb[10023].hh.b0 = 116; */
3060 /* eqtb[(hash_size + 523)].hh.b0 = 116; */
3061 eqtb[(hash_size + hash_extra + 523)].hh.b0 = 116;
3062 /* hash[(hash_size + 523)].v.RH = 499; */
3063 hash[(hash_size + hash_extra + 523)].v.RH = 499; /* notexpanded */
3064 /* @<Initialize table...@>= l.10750 */
3065 font_ptr = 0; /* font_ptr:=null_font; */
3066 fmem_ptr = 7; /* fmem_ptr:=7; */
3067 font_name[0]= 795; /* nullfont */
3068 font_area[0]= 335; /* "" */
3069 hyphen_char[0]= 45; /* - */
3071 /* ************************************************************************ */
3072 /* bchar_label[null_font]:=non_address; */ /* 3.14159 */
3073 /* bchar_label[0]= font_mem_size; */ /* OK ? 93/Nov/26 */
3074 bchar_label[0]= non_address; /* i.e. 0 --- 96/Jan/16 */
3075 /* ************************************************************************ */
3076 font_bchar[0]= 256; /* font_bchar[null_font]:=non_char; */
3077 font_false_bchar[0]= 256; /* font_false_bchar[null_font]:=non_char; */
3087 lig_kern_base[0]= 0;
3093 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3094 resettrie (); /* shared 93/Nov/26 */
3095 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3096 /* {register integer for_end; k = 0; for_end = 6; if(k <= for_end) do
3097 font_info[k].cint = 0;
3098 while(k++ < for_end); }
3099 {register integer for_end; k = - (integer) trie_op_size; for_end =
3100 trie_op_size; if(k <= for_end) do
3102 while(k++ < for_end); }
3103 {register integer for_end; k = 0; for_end = 255; if(k <= for_end) do
3104 trie_used[k]= min_trie_op;
3105 while(k++ < for_end); }
3106 max_op_used = min_trie_op;
3108 trie_not_ready = true;
3112 /* text(frozen_protection):="inaccessible"; */
3113 /* hash[10014].v.RH = 1183; */
3114 /* hash[(hash_size + 514)].v.RH = 1184; */
3115 hash[(hash_size + hash_extra + 514)].v.RH = 1184; /* 1183 */
3116 format_ident = 1251; /* 1250 */
3117 /* hash[(hash_size + 522)].v.RH = 1290; */ /* 1288 */
3118 hash[(hash_size + hash_extra + 522)].v.RH = 1290; /* 1288 */
3119 /* eqtb[(hash_size + 522)].hh.b1 = 1; */
3120 eqtb[(hash_size + hash_extra + 522)].hh.b1 = 1;
3121 /* eqtb[(hash_size + 522)].hh.b0 = 113; */
3122 eqtb[(hash_size + hash_extra + 522)].hh.b0 = 113;
3123 /* eqtb[(hash_size + 522)].hh.v.RH = 0; */
3124 eqtb[(hash_size + hash_extra + 522)].hh.v.RH = 0;
3129 /* starts string pool with strings for 256 chars and then reads tex.pool */
3130 /* adjusted to try both "tex.pool" and "tex.poo" 95/Feb/19 */
3131 bool get_strings_started (void)
3132 {/* 30 10 */ register bool Result;
3138 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3139 int flag; /* 95/Feb/19 */
3140 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3145 register integer for_end;
3150 if(((k < 32)||(k > 126)))
3153 str_pool[pool_ptr]= 94; /* ^ */
3157 str_pool[pool_ptr]= 94; /* ^ */
3162 str_pool[pool_ptr]= k + 64;
3167 str_pool[pool_ptr]= k - 64;
3175 str_pool[pool_ptr]= l + 48; /* '0' */
3179 str_pool[pool_ptr]= l + 87; /* 'a' - 10 */
3186 str_pool[pool_ptr]= l + 48; /* '0' */
3190 str_pool[pool_ptr]= l + 87; /* 'a' - 10 */
3196 str_pool[pool_ptr]= k;
3201 while(k++ < for_end);
3203 vstrcpy(name_of_file + 1, poolname);
3204 name_of_file[0]= ' ';
3205 name_of_file[strlen(poolname)+ 1]= ' ';
3206 name_length = strlen(poolname);
3207 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3208 /* if(a_open_in(pool_file, TEXPOOLPATH)) */
3209 flag = a_open_in(pool_file, TEXPOOLPATH);
3210 if (flag == 0) { /* 95/Feb/19 */
3211 poolname [name_length - 1] = '\0'; /* `tex.pool' => `tex.poo' */
3212 vstrcpy(name_of_file + 1, poolname);
3213 name_of_file[0]= ' ';
3214 name_of_file[strlen(poolname)+ 1]= ' ';
3215 name_length = strlen(poolname);
3216 flag = a_open_in(pool_file, TEXPOOLPATH);
3223 /* if(eof(pool_file)) */ /* feof(pool_file)??? */
3224 if(test_eof(pool_file))
3227 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3228 showline("! string pool file has no check sum.\n", 1);
3229 /* added following bit of explanation 96/Jan/16 */
3231 badformatorpool(string_file, "the pool file", "TEXPOOL");
3232 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3233 (void) a_close(pool_file);
3239 if(m == '*') /* last line starts with * */
3244 if((xord[n]< 48)||(xord[n]> 57))
3247 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3248 showline("! string pool file check sum doesn't have nine digits.\n", 1);
3249 /* added following bit of explanation 96/Jan/16 */
3251 badformatorpool(string_file, "the pool file", "TEXPOOL");
3252 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3253 (void) a_close(pool_file);
3257 a = 10 * a + xord[n]- 48;
3263 /* tex.pool file check sum *367403084 */
3264 lab30: if(a != BEGINFMTCHECKSUM){
3266 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3267 showline("! string pool check sum doesn't match; tangle me again.\n", 1);
3268 /* added following bit of explanation 96/Jan/16 */
3270 badformatorpool(string_file, "the pool file", "TEXPOOL");
3271 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3272 (void) a_close(pool_file);
3280 if((xord[m]< 48)||(xord[m]> 57)||(xord[n]< 48
3284 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3285 showline("! string pool line doesn't begin with two digits.\n", 1);
3286 /* added following bit of explanation 96/Jan/16 */
3288 badformatorpool(string_file, "the pool file", "TEXPOOL");
3289 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3290 (void) a_close(pool_file);
3294 l = xord[m]* 10 + xord[n]- 48 * 11;
3295 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3296 #ifdef ALLOCATESTRING
3297 /* can freely extend memory, so we need not be paranoid - stringvacancies */
3298 /* if(pool_ptr + l + stringvacancies > current_pool_size)*/
3299 if(pool_ptr + l + stringmargin > current_pool_size){
3300 if (trace_flag) showline("String margin reallocation\n", 0);
3301 /* str_pool = realloc_str_pool (pool_ptr + l + stringvacancies */
3302 str_pool = realloc_str_pool (pool_ptr + l + stringmargin
3303 - current_pool_size + increment_pool_size);
3305 if(pool_ptr + l + stringmargin > current_pool_size) /* 94/Jan/24 */
3307 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3308 if(pool_ptr + l + stringvacancies > pool_size)
3312 showline("! You have to increase POOLSIZE.\n", 1);
3313 (void) a_close(pool_file);
3318 register integer for_end;
3326 else read(pool_file, m);
3328 str_pool[pool_ptr]= xord[m];
3332 while(k++ < for_end);
3334 readln(pool_file); /* flush rest to end of file / end of line */
3339 (void) a_close(pool_file);
3345 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3346 sprintf(log_line, "! I can't read %s.\n", poolname);
3347 showline(log_line, 1);
3349 showline(" (Was unable to find tex.poo or tex.pool)\n", 0); /* extra explain */
3350 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3359 void sort_avail (void)
3363 p = get_node(1073741824L); /* 2^30 merge adjacent free nodes */
3364 p = mem[rover + 1].hh.v.RH;
3365 /* mem[rover + 1].hh.v.RH = 262143L; */ /* NO! */
3366 mem[rover + 1].hh.v.RH = empty_flag;
3368 while(p != oldrover)if(p < rover)
3371 p = mem[q + 1].hh.v.RH;
3372 mem[q + 1].hh.v.RH = rover;
3378 while(mem[q + 1].hh.v.RH < p)q = mem[q + 1].hh.v.RH;
3379 r = mem[p + 1].hh.v.RH;
3380 mem[p + 1].hh.v.RH = mem[q + 1].hh.v.RH;
3381 mem[q + 1].hh.v.RH = p;
3385 /* while(mem[p + 1].hh.v.RH != 262143L){ */ /* NO! */
3386 while(mem[p + 1].hh.v.RH != empty_flag){
3388 mem[mem[p + 1].hh.v.RH + 1].hh.v.LH = p;
3389 p = mem[p + 1].hh.v.RH;
3391 mem[p + 1].hh.v.RH = rover;
3392 mem[rover + 1].hh.v.LH = p;
3397 void primitive_ (str_number s, quarterword c, halfword o)
3401 /* small_number l; */
3402 int l; /* 95/Jan/7 */
3404 cur_val = s + 257; /* cur_val <- s + single_base; p.264 */
3407 l = str_start[s + 1]- k; /* small_number l */
3409 register integer for_end;
3413 do buffer[j]= str_pool[k + j];
3414 while(j++ < for_end);
3416 cur_val = id_lookup(0, l);
3419 pool_ptr = str_start[str_ptr];
3421 /* ********************** debugging only 96/Jan/20 should not happen */
3423 if (s > 65535L) showline("ERROR: hash entry too large\n", 1);
3425 hash[cur_val].v.RH = s;
3427 eqtb[cur_val].hh.b1 = 1;
3428 eqtb[cur_val].hh.b0 = c;
3429 eqtb[cur_val].hh.v.RH = o;
3433 /* more weird constants ? page 394 */
3436 trie_op_code new_trie_op_ (small_number d, small_number n, trie_op_code v)
3437 {/* 10 */ register trie_op_code Result;
3441 /* the 313, 361 and 1009 are hard-wired constants here p.944 */
3442 /* begin h:=abs(n+313*d+361*v+1009*cur_lang) mod (trie_op_size+trie_op_size) */
3443 h = abs(toint(n)+ 313 * toint(d)+ 361 * toint(v)+ 1009 *
3444 toint(cur_lang)) %(trie_op_size - neg_trie_op_size)+ neg_trie_op_size;
3447 /* if l=0 then {empty position found for a new op} */
3451 if(trie_op_ptr == trie_op_size){
3452 overflow(943, trie_op_size); /* pattern memory ops - NOT DYNAMIC */
3453 return 0; // abort_flag set
3455 u = trie_used[cur_lang];
3456 /* if u=max_quarterword then ??? */
3457 if(u == max_trie_op){
3458 /* overflow("pattern memory ops per language",
3459 max_quarterword-min_quarterword); ??? */
3460 overflow(944, max_trie_op - min_trie_op); /* pattern memory ops per language */
3461 return 0; // abort_flag set
3465 trie_used[cur_lang]= u;
3468 hyf_distance[trie_op_ptr]= d;
3469 hyf_num[trie_op_ptr]= n;
3470 hyf_next[trie_op_ptr]= v;
3471 trie_op_lang[trie_op_ptr]= cur_lang;
3472 trieophash[h]= trie_op_ptr;
3473 trie_op_val[trie_op_ptr]= u;
3477 if((hyf_distance[l]== d)&&(hyf_num[l]== n)&&(hyf_next[l
3478 ]== v)&&(trie_op_lang[l]== cur_lang))
3480 Result = trie_op_val[l];
3483 if(h > - (integer) trie_op_size)
3485 else h = trie_op_size;
3487 /* return Result; */ /* unreachable code */
3489 /* what are those horrible constants there ? page 395 */
3490 trie_pointer trie_node_ (trie_pointer p)
3491 {/* 10 */ register trie_pointer Result;
3494 /* the 1009, 2718, 3142 are hard-wired constants here (not hyphen_prime) */
3495 h = abs(toint(trie_c[p])+ 1009 * toint(trie_o[p])+ 2718 *
3496 toint(trie_l[p])+ 3142 * toint(trie_r[p])) % trie_size;
3505 if((trie_c[q]== trie_c[p])&&(trie_o[q]== trie_o[p])&&(
3506 trie_l[q]== trie_l[p])&&(trie_r[q]== trie_r[p]))
3515 /* return Result; */ /* unreachable code */
3517 trie_pointer compress_trie_ (trie_pointer p)
3518 {register trie_pointer Result;
3523 trie_l[p]= compress_trie(trie_l[p]);
3524 trie_r[p]= compress_trie(trie_r[p]);
3525 Result = trie_node(p);
3529 void first_fit_ (trie_pointer p)
3541 if(trie_max < h + 256)
3543 if(trie_size <= h + 256){
3544 overflow(945, trie_size); /* pattern memory - NOT DYNAMIC */
3545 /* not dynamic ---- but can be set -h=... from command line in ini-TeX */
3546 return; // abort_flag set
3550 trie_taken[trie_max]= false;
3551 trietrl[trie_max]= trie_max + 1;
3552 trietro[trie_max]= trie_max - 1;
3553 } while(!(trie_max == h + 256));
3559 if(trietrl[h + trie_c[q]] == 0)
3564 lab45: z = trietrl[z];
3567 trie_taken[h]= true; /* h may be used without ... */
3580 ll = z; /* short ll */
3585 } while(!(l == ll));
3590 void trie_pack_ (trie_pointer p)
3595 if((q > 0)&&(trie_hash[q]== 0))
3603 void trie_fix_ (trie_pointer p)
3612 trietrl[z + c]= trie_hash[q];
3614 trietro[z + c]= trie_o[p];
3620 void new_patterns (void)
3622 /* ******************************************************************* */
3623 /* was small_number k, l; in 3.141 */
3625 /* ******************************************************************* */
3631 int c; /* 95/Jan/7 */
3632 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3633 if (! trie_not_ready) { /* new stuff */
3634 if (allow_patterns) {
3635 if (trace_flag) showline("Resetting patterns\n", 0);
3636 resettrie(); /* RESET PATTERNS - 93/Nov/26 */
3637 if (reset_exceptions) {
3638 if (trace_flag) showline("Resetting exceptions\n", 0);
3639 reset_hyphen(); /* RESET HYPHENEXCEPTIONS - 93/Nov/26 */
3643 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3646 if(eqtb[(hash_size + 3213)].cint <= 0)
3648 else if(eqtb[(hash_size + 3213)].cint > 255)
3650 else cur_lang = eqtb[(hash_size + 3213)].cint;
3654 digitsensed = false;
3660 if(digitsensed ||(cur_chr < 48)||(cur_chr > 57))
3662 if(cur_chr == 46) /* . */
3666 cur_chr = eqtb[(hash_size + 2139) + cur_chr].hh.v.RH;
3670 if(interaction == 3)
3672 print_nl(262); /* ! */
3673 print(951); /* Nonletter */
3677 help_line[0]= 950; /* (See Appendix H.) */
3687 digitsensed = false;
3692 hyf[k]= cur_chr - 48;
3709 v = new_trie_op(k - l, hyf[l], v);
3722 while((p > 0)&&(c > trie_c[p])) {
3727 if((p == 0)||(c < trie_c[p]))
3729 if(trie_ptr == trie_size){
3730 overflow(945, trie_size); /* pattern memory - NOT DYNAMIC */
3731 /* not dynamic ---- but can be set -h=... from command line in ini-TeX */
3732 return; // abort_flag set
3735 trie_r[trie_ptr]= p;
3742 trie_o[p]= min_trie_op;
3746 if(trie_o[q]!= min_trie_op)
3749 if(interaction == 3)
3751 print_nl(262); /* ! */
3752 print(952); /* Duplicate pattern */
3756 help_line[0]= 950; /* (See Appendix H.) */
3766 digitsensed = false;
3772 if(interaction == 3)
3774 print_nl(262); /* ! */
3775 print(949); /* Bad */
3777 print_esc(947); /* patterns */
3780 help_line[0]= 950; /* (See Appendix H.) */
3792 if(interaction == 3)
3794 print_nl(262); /* ! */
3795 print(946); /* Too late for */
3797 print_esc(947); /* patterns */
3800 help_line[0]= 948; /* All patterns must be given before typesetting begins. */
3803 mem[mem_top - 12].hh.v.RH = scan_toks(false, false);
3804 flush_list(def_ref);
3807 void init_trie (void)
3810 /* integer j, k, t; */
3812 int t; /* 95/Jan/7 */
3814 op_start[0]= - (integer) min_trie_op;
3816 register integer for_end;
3820 op_start[j]= op_start[j - 1]+ trie_used[j - 1];
3821 while(j++ < for_end);
3824 register integer for_end;
3826 for_end = trie_op_ptr;
3829 trieophash[j]= op_start[trie_op_lang[j]] + trie_op_val[j];
3830 while(j++ < for_end);
3833 register integer for_end;
3835 for_end = trie_op_ptr;
3838 while(trieophash[j]> j){
3840 t = hyf_distance[k];
3841 hyf_distance[k]= hyf_distance[j];
3844 hyf_num[k]= hyf_num[j];
3847 hyf_next[k]= hyf_next[j];
3849 trieophash[j]= trieophash[k];
3852 while(j++ < for_end);
3855 register integer for_end;
3857 for_end = trie_size;
3860 while(p++ < for_end);
3862 trie_l[0]= compress_trie(trie_l[0]);
3864 register integer for_end;
3869 while(p++ < for_end);
3872 register integer for_end;
3877 while(p++ < for_end);
3883 first_fit(trie_l[0]);
3884 trie_pack(trie_l[0]);
3889 register integer for_end;
3895 trietro[r]= min_trie_op;
3898 while(r++ < for_end);
3903 trie_fix(trie_l[0]);
3909 trietro[r]= min_trie_op;
3913 } while(!(r > trie_max));
3916 trie_not_ready = false;
3921 void storefmtfile (void)
3926 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3927 if (!is_initex) { /* redundant check 94/Feb/14 */
3928 showline("! \\dump is performed only by INITEX\n", 1);
3930 showline(" (Use -i on the command line)\n", 0);
3934 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3937 if(interaction == 3)
3939 print_nl(262); /* ! */
3940 print(1252); /* You can't dump inside a group */
3944 help_line[0]= 1253; /* `{...\dump}' is a no-no.. */
3947 if(interaction == 3) interaction = 2;
3953 if(interaction > 0) debug_help ();
3956 jump_out (); // trying to \dump inside a group
3957 // return; // drops through now
3959 } /* end of if save_ptr != 0 */
3962 print(1266); /* (format= */
3964 print_char(32); /* */
3965 /* print_int(eqtb[(hash_size + 3186)].cint % 100); */ /* Y2K */
3966 print_int(eqtb[(hash_size + 3186)].cint); /* 98/Oct/12 */
3968 int n= eqtb[(hash_size + 3186)].cint;
3969 sprintf(log_line, "YEAR: %ld\n", n);
3970 showline(log_line, 0);
3972 print_char(46); /* . */
3973 print_int(eqtb[(hash_size + 3185)].cint);
3974 print_char(46); /* . */
3975 print_int(eqtb[(hash_size + 3184)].cint);
3976 print_char(41); /*)*/
3977 if(interaction == 0)selector = 18;
3980 #ifdef ALLOCATESTRING
3981 if(pool_ptr + 1 > current_pool_size)
3982 str_pool = realloc_str_pool (increment_pool_size);
3983 if(pool_ptr + 1 > current_pool_size){ /* in case it failed 94/Jan/24 */
3984 overflow(257, current_pool_size - init_pool_ptr); /* 97/Mar/9 */
3985 return; // abort_flag set
3988 if(pool_ptr + 1 > pool_size){
3989 overflow(257, pool_size - init_pool_ptr); /* pool size */
3990 return; // abort_flag set
3994 format_ident = make_string ();
3995 pack_job_name(780); /* .fmt */
3996 while(! w_open_out(fmt_file)) {
3997 prompt_file_name(1267, 780); /* format file name .fmt */
3999 print_nl(1268); /* Beginning to dump on file */
4000 slow_print(w_make_name_string(fmt_file));
4003 pool_ptr = str_start[str_ptr];
4005 print_nl(335); /* */
4006 slow_print(format_ident);
4007 dump_int(BEGINFMTCHECKSUM); /* magic FMT file start 4C 20 E6 15 hex */
4011 dump_int((hash_size + 4006)); /* eqtbsize */
4012 dump_int(hash_prime);
4013 /* dump_int(607); */
4014 dump_int(hyphen_prime); /* bkph */
4017 if (dumpthings(str_start[0], str_ptr + 1)
4019 if (dumpthings(str_pool[0], pool_ptr)
4023 print(1254); /* strings of total length */
4024 print_int(pool_ptr);
4027 dump_int(lo_mem_max);
4033 if (dumpthings(mem[p], q + 2 - p)
4036 var_used = var_used + q - p;
4037 p = q + mem[q].hh.v.LH;
4038 q = mem[q + 1].hh.v.RH;
4039 } while(!(q == rover));
4040 var_used = var_used + lo_mem_max - p;
4041 dyn_used = mem_end + 1 - hi_mem_min;
4042 if (dumpthings(mem[p], lo_mem_max + 1 - p)
4044 x = x + lo_mem_max + 1 - p;
4045 dump_int(hi_mem_min);
4047 if (dumpthings(mem[hi_mem_min], mem_end + 1 - hi_mem_min)
4049 x = x + mem_end + 1 - hi_mem_min;
4059 print(1255); /* memory locations dumped; current usage is */
4060 print_int(var_used);
4061 print_char(38); /* & */
4062 print_int(dyn_used);
4066 while(j < (hash_size + 3162)){
4067 if((eqtb[j].hh.v.RH == eqtb[j + 1].hh.v.RH)&&(eqtb[j
4068 ].hh.b0 == eqtb[j + 1].hh.b0)&&(eqtb[j].hh.b1 == eqtb[j +
4073 l = (hash_size + 3163);
4077 while(j < (hash_size + 3162)){
4078 if((eqtb[j].hh.v.RH != eqtb[j + 1].hh.v.RH)||(eqtb[j
4079 ].hh.b0 != eqtb[j + 1].hh.b0)||(eqtb[j].hh.b1 != eqtb[j +
4084 lab31: dump_int(l - k);
4085 if (dumpthings(eqtb[k], l - k)
4089 } while(!(k == (hash_size + 3163)));
4092 while(j < (hash_size + 4006)){
4093 if(eqtb[j].cint == eqtb[j + 1].cint)
4097 l = (hash_size + 4007);
4101 while(j < (hash_size + 4006)){
4102 if(eqtb[j].cint != eqtb[j + 1].cint)
4106 lab32: dump_int(l - k);
4107 if (dumpthings(eqtb[k], l - k)
4111 } while(!(k > (hash_size + 4006)));
4113 dump_int(write_loc);
4114 dump_int(hash_used);
4115 /* cs_count:=frozen_control_sequence-1-hash_used; */
4116 /* cs_count = (hash_size + 513) - hash_used; */
4117 cs_count = (hash_size + hash_extra + 513) - hash_used;
4118 /* cs_count = (hash_size + 780) - hash_used; */ /* ??? */
4120 sprintf(log_line, "itex cs_count %d hash_size %d hash_extra %d hash_used %d",
4121 cs_count, hash_size, hash_extra, hash_used); /* debugging */
4122 showline(log_line, 0);
4124 /* for p <- hash_base to hash_used do */
4126 register integer for_end;
4128 for_end = hash_used;
4130 if(hash[p].v.RH != 0){
4135 sprintf(log_line, "itex cs_count++ ");
4136 showline(log_line, 0); /* debugging */
4139 while(p++ < for_end);
4142 /* for p <- hash_used+1 to undefined_control_sequence-1 do dump_hh(hash[p]) */
4143 if (dumpthings(hash[hash_used + 1], (hash_size + 780) - hash_used)
4147 print_int(cs_count);
4148 print(1256); /* multiletter control sequences */
4151 if (dumpthings(font_info[0], fmem_ptr)
4153 /* frozenfontptr = font_ptr; */ /* number of fonts frozen into format */
4155 if (dumpthings(font_check[0], font_ptr + 1))return;
4156 if (dumpthings(font_size[0], font_ptr + 1))return;
4157 if (dumpthings(font_dsize[0], font_ptr + 1))return;
4158 if (dumpthings(font_params[0], font_ptr + 1))return;
4159 if (dumpthings(hyphen_char[0], font_ptr + 1))return;
4160 if (dumpthings(skew_char[0], font_ptr + 1))return;
4161 if (dumpthings(font_name[0], font_ptr + 1))return;
4162 if (dumpthings(font_area[0], font_ptr + 1))return;
4163 if (dumpthings(font_bc[0], font_ptr + 1))return;
4164 if (dumpthings(font_ec[0], font_ptr + 1))return;
4165 if (dumpthings(char_base[0], font_ptr + 1))return;
4166 if (dumpthings(width_base[0], font_ptr + 1))return;
4167 if (dumpthings(height_base[0], font_ptr + 1))return;
4168 if (dumpthings(depth_base[0], font_ptr + 1))return;
4169 if (dumpthings(italic_base[0], font_ptr + 1))return;
4170 if (dumpthings(lig_kern_base[0], font_ptr + 1))return;
4171 if (dumpthings(kern_base[0], font_ptr + 1))return;
4172 if (dumpthings(exten_base[0], font_ptr + 1))return;
4173 if (dumpthings(param_base[0], font_ptr + 1))return;
4174 if (dumpthings(font_glue[0], font_ptr + 1))return;
4175 if (dumpthings(bchar_label[0], font_ptr + 1))return;
4176 if (dumpthings(font_bchar[0], font_ptr + 1))return;
4177 if (dumpthings(font_false_bchar[0], font_ptr + 1))return;
4179 register integer for_end;
4185 print_nl(1259); /* \font */
4186 /* print_esc(hash[(hash_size + 524) + k].v.RH); */
4187 print_esc(hash[(hash_size + hash_extra + 524) + k].v.RH);
4188 print_char(61); /* = */
4189 print_file_name(font_name[k], font_area[k], 335);
4190 if(font_size[k]!= font_dsize[k])
4192 print(738); /* at */
4193 print_scaled(font_size[k]);
4194 print(394); /* pt */
4197 while(k++ < for_end);
4201 print_int(fmem_ptr - 7);
4202 print(1257); /* words of font info for */
4203 print_int(font_ptr - 0);
4204 print(1258); /* preloaded font */
4206 print_char(115); /* s */
4207 dump_int(hyph_count);
4208 /* {register integer for_end; k = 0; for_end = 607; if(k <= for_end) do */
4210 register integer for_end;
4212 for_end = hyphen_prime;
4214 if(hyph_word[k]!= 0)
4217 dump_int(hyph_word[k]);
4218 dump_int(hyph_list[k]);
4220 while(k++ < for_end);
4223 print_int(hyph_count);
4224 print(1260); /* hyphenation exception */
4226 print_char(115); /* s */
4230 if (dumpthings(trietrl[0], trie_max + 1)
4232 if (dumpthings(trietro[0], trie_max + 1)
4234 if (dumpthings(trietrc[0], trie_max + 1)
4236 dump_int(trie_op_ptr);
4237 if (dumpthings(hyf_distance[1], trie_op_ptr)
4239 if (dumpthings(hyf_num[1], trie_op_ptr)
4241 if (dumpthings(hyf_next[1], trie_op_ptr)
4243 print_nl(1261); /* Hyphenation trie of length */
4244 print_int(trie_max);
4245 print(1262); /* has */
4246 print_int(trie_op_ptr);
4247 print(1263); /* op */
4248 if(trie_op_ptr != 1)
4249 print_char(115); /* s */
4250 print(1264); /* out of */
4251 print_int(trie_op_size);
4253 register integer for_end;
4259 print_nl(794); /* */
4260 print_int(trie_used[k]);
4261 print(1265); /* for language */
4264 dump_int(trie_used[k]);
4266 while(k-- > for_end);
4268 dump_int(interaction);
4269 dump_int(format_ident);
4270 dump_int(ENDFMTCHECKSUM); /* magic checksum end of FMT file --- change ??? */
4271 eqtb[(hash_size + 3194)].cint = 0; /* tracingstats */
4274 } /* end of storefmtfile */
4278 void init_prim (void)
4280 no_new_control_sequence = false;
4281 primitive(373, 75, (hash_size + 782)); /* lineskip */
4282 primitive(374, 75, (hash_size + 783)); /* baselineskip */
4283 primitive(375, 75, (hash_size + 784)); /* parskip */
4284 primitive(376, 75, (hash_size + 785)); /* abovedisplayskip */
4285 primitive(377, 75, (hash_size + 786)); /* belowdisplayskip */
4286 primitive(378, 75, (hash_size + 787)); /* abovedisplayshortskip */
4287 primitive(379, 75, (hash_size + 788)); /* belowdisplayshortskip */
4288 primitive(380, 75, (hash_size + 789)); /* leftskip */
4289 primitive(381, 75, (hash_size + 790)); /* rightskip */
4290 primitive(382, 75, (hash_size + 791)); /* topskip */
4291 primitive(383, 75, (hash_size + 792)); /* splittopskip */
4292 primitive(384, 75, (hash_size + 793)); /* tabskip */
4293 primitive(385, 75, (hash_size + 794)); /* spaceskip */
4294 primitive(386, 75, (hash_size + 795)); /* xspaceskip */
4295 primitive(387, 75, (hash_size + 796)); /* parfillskip */
4296 primitive(388, 76, (hash_size + 797)); /* thinmuskip */
4297 primitive(389, 76, (hash_size + 798)); /* medmuskip */
4298 primitive(390, 76, (hash_size + 799)); /* thickmuskip */
4299 primitive(395, 72, (hash_size + 1313)); /* output */
4300 primitive(396, 72, (hash_size + 1314)); /* everypar */
4301 primitive(397, 72, (hash_size + 1315)); /* everymath */
4302 primitive(398, 72, (hash_size + 1316)); /* everydisplay */
4303 primitive(399, 72, (hash_size + 1317)); /* everyhbox */
4304 primitive(400, 72, (hash_size + 1318)); /* everyvbox */
4305 primitive(401, 72, (hash_size + 1319)); /* everyjob */
4306 primitive(402, 72, (hash_size + 1320)); /* everycr */
4307 primitive(403, 72, (hash_size + 1321)); /* errhelp */
4308 primitive(417, 73, (hash_size + 3163)); /* pretolerance */
4309 primitive(418, 73, (hash_size + 3164)); /* tolerance */
4310 primitive(419, 73, (hash_size + 3165)); /* linepenalty */
4311 primitive(420, 73, (hash_size + 3166)); /* hyphenpenalty */
4312 primitive(421, 73, (hash_size + 3167)); /* exhyphenpenalty */
4313 primitive(422, 73, (hash_size + 3168)); /* clubpenalty */
4314 primitive(423, 73, (hash_size + 3169)); /* widowpenalty */
4315 primitive(424, 73, (hash_size + 3170)); /* displaywidowpenalty */
4316 primitive(425, 73, (hash_size + 3171)); /* brokenpenalty */
4317 primitive(426, 73, (hash_size + 3172)); /* binoppenalty */
4318 primitive(427, 73, (hash_size + 3173)); /* relpenalty */
4319 primitive(428, 73, (hash_size + 3174)); /* predisplaypenalty */
4320 primitive(429, 73, (hash_size + 3175)); /* postdisplaypenalty */
4321 primitive(430, 73, (hash_size + 3176)); /* interlinepenalty */
4322 primitive(431, 73, (hash_size + 3177)); /* doublehyphendemerits */
4323 primitive(432, 73, (hash_size + 3178)); /* finalhyphendemerits */
4324 primitive(433, 73, (hash_size + 3179)); /* adjdemerits */
4325 primitive(434, 73, (hash_size + 3180)); /* mag */
4326 primitive(435, 73, (hash_size + 3181)); /* delimiterfactor */
4327 primitive(436, 73, (hash_size + 3182)); /* looseness */
4328 primitive(437, 73, (hash_size + 3183)); /* time */
4329 primitive(438, 73, (hash_size + 3184)); /* day */
4330 primitive(439, 73, (hash_size + 3185)); /* month */
4331 primitive(440, 73, (hash_size + 3186)); /* year */
4332 primitive(441, 73, (hash_size + 3187)); /* showboxbreadth */
4333 primitive(442, 73, (hash_size + 3188)); /* showboxdepth */
4334 primitive(443, 73, (hash_size + 3189)); /* hbadness */
4335 primitive(444, 73, (hash_size + 3190)); /* vbadness */
4336 primitive(445, 73, (hash_size + 3191)); /* pausing */
4337 primitive(446, 73, (hash_size + 3192)); /* tracingonline */
4338 primitive(447, 73, (hash_size + 3193)); /* tracingmacros */
4339 primitive(448, 73, (hash_size + 3194)); /* tracingstats */
4340 primitive(449, 73, (hash_size + 3195)); /* tracingparagraphs */
4341 primitive(450, 73, (hash_size + 3196)); /* tracingpages */
4342 primitive(451, 73, (hash_size + 3197)); /* tracingoutput */
4343 primitive(452, 73, (hash_size + 3198)); /* tracinglostchars */
4344 primitive(453, 73, (hash_size + 3199)); /* tracingcommands */
4345 primitive(454, 73, (hash_size + 3200)); /* tracingrestores */
4346 primitive(455, 73, (hash_size + 3201)); /* uchyph */
4347 primitive(456, 73, (hash_size + 3202)); /* outputpenalty */
4348 primitive(457, 73, (hash_size + 3203)); /* maxdeadcycles */
4349 primitive(458, 73, (hash_size + 3204)); /* hangafter */
4350 primitive(459, 73, (hash_size + 3205)); /* floatingpenalty */
4351 primitive(460, 73, (hash_size + 3206)); /* globaldefs */
4352 primitive(461, 73, (hash_size + 3207)); /* fam */
4353 primitive(462, 73, (hash_size + 3208)); /* escapechar */
4354 primitive(463, 73, (hash_size + 3209)); /* defaulthyphenchar */
4355 primitive(464, 73, (hash_size + 3210)); /* defaultskewchar */
4356 primitive(465, 73, (hash_size + 3211)); /* endlinechar */
4357 primitive(466, 73, (hash_size + 3212)); /* newlinechar */
4358 primitive(467, 73, (hash_size + 3213)); /* language */
4359 primitive(468, 73, (hash_size + 3214)); /* lefthyphenmin */
4360 primitive(469, 73, (hash_size + 3215)); /* righthyphenmin */
4361 primitive(470, 73, (hash_size + 3216)); /* holdinginserts */
4362 primitive(471, 73, (hash_size + 3217)); /* errorcontextlines */
4363 primitive(475, 74, (hash_size + 3730)); /* parindent */
4364 primitive(476, 74, (hash_size + 3731)); /* mathsurround */
4365 primitive(477, 74, (hash_size + 3732)); /* lineskiplimit */
4366 primitive(478, 74, (hash_size + 3733)); /* hsize */
4367 primitive(479, 74, (hash_size + 3734)); /* vsize */
4368 primitive(480, 74, (hash_size + 3735)); /* maxdepth */
4369 primitive(481, 74, (hash_size + 3736)); /* splitmaxdepth */
4370 primitive(482, 74, (hash_size + 3737)); /* boxmaxdepth */
4371 primitive(483, 74, (hash_size + 3738)); /* hfuzz */
4372 primitive(484, 74, (hash_size + 3739)); /* vfuzz */
4373 primitive(485, 74, (hash_size + 3740)); /* delimitershortfall */
4374 primitive(486, 74, (hash_size + 3741)); /* nulldelimiterspace */
4375 primitive(487, 74, (hash_size + 3742)); /* scriptspace */
4376 primitive(488, 74, (hash_size + 3743)); /* predisplaysize */
4377 primitive(489, 74, (hash_size + 3744)); /* displaywidth */
4378 primitive(490, 74, (hash_size + 3745)); /* displayindent */
4379 primitive(491, 74, (hash_size + 3746)); /* overfullrule */
4380 primitive(492, 74, (hash_size + 3747)); /* hangindent */
4381 primitive(493, 74, (hash_size + 3748)); /* hoffset */
4382 primitive(494, 74, (hash_size + 3749)); /* voffset */
4383 primitive(495, 74, (hash_size + 3750)); /* emergencystretch */
4384 primitive(32, 64, 0); /* */
4385 primitive(47, 44, 0); /* / */
4386 primitive(505, 45, 0); /* accent */
4387 primitive(506, 90, 0); /* advance */
4388 primitive(507, 40, 0); /* afterassignment */
4389 primitive(508, 41, 0); /* aftergroup */
4390 primitive(509, 61, 0); /* begingroup */
4391 primitive(510, 16, 0); /* char */
4392 primitive(501, 107, 0); /* csname */
4393 primitive(511, 15, 0); /* delimiter */
4394 primitive(512, 92, 0); /* divide */
4395 primitive(502, 67, 0); /* endcsname */
4396 primitive(513, 62, 0); /* endgroup */
4397 /* hash[(hash_size + 516)].v.RH = 513; */
4398 hash[(hash_size + hash_extra + 516)].v.RH = 513; /* endgroup */
4399 /* eqtb[(hash_size + 516)]= eqtb[cur_val]; */
4400 eqtb[(hash_size + hash_extra + 516)]= eqtb[cur_val];
4401 primitive(514, 102, 0); /* expandafter */
4402 primitive(515, 88, 0); /* font */
4403 primitive(516, 77, 0); /* fontdimen */
4404 primitive(517, 32, 0); /* halign */
4405 primitive(518, 36, 0); /* hrule */
4406 primitive(519, 39, 0); /* ignorespaces */
4407 primitive(327, 37, 0); /* insert */
4408 primitive(348, 18, 0); /* mark */
4409 primitive(520, 46, 0); /* mathaccent */
4410 primitive(521, 17, 0); /* mathchar */
4411 primitive(522, 54, 0); /* mathchoice */
4412 primitive(523, 91, 0); /* multiply */
4413 primitive(524, 34, 0); /* noalign */
4414 primitive(525, 65, 0); /* noboundary */
4415 primitive(526, 103, 0); /* noexpand */
4416 primitive(332, 55, 0); /* nonscript */
4417 primitive(527, 63, 0); /* omit */
4418 primitive(405, 84, 0); /* parshape */
4419 primitive(528, 42, 0); /* penalty */
4420 primitive(529, 80, 0); /* prevgraf */
4421 primitive(530, 66, 0); /* radical */
4422 primitive(531, 96, 0); /* read */
4423 primitive(532, 0, 256); /* primitive("relax",relax,256); */
4424 /* hash[(hash_size + 521)].v.RH = 532; */
4425 hash[(hash_size + hash_extra + 521)].v.RH = 532; /* read */
4426 /* eqtb[(hash_size + 521)]= eqtb[cur_val]; */
4427 eqtb[(hash_size + hash_extra + 521)]= eqtb[cur_val];
4428 primitive(533, 98, 0); /* setbox */
4429 primitive(534, 109, 0); /* the */
4430 primitive(404, 71, 0); /* toks */
4431 primitive(349, 38, 0); /* vadjust */
4432 primitive(535, 33, 0); /* valign */
4433 primitive(536, 56, 0); /* vcenter */
4434 primitive(537, 35, 0); /* vrule */
4435 primitive(594, 13, 256); /* par */
4437 par_token = 4095 + par_loc;
4438 primitive(626, 104, 0); /* input */
4439 primitive(627, 104, 1); /* endinput */
4440 primitive(628, 110, 0); /* topmark */
4441 primitive(629, 110, 1); /* firstmark */
4442 primitive(630, 110, 2); /* botmark */
4443 primitive(631, 110, 3); /* splitfirstmark */
4444 primitive(632, 110, 4); /* splitbotmark */
4445 primitive(473, 89, 0); /* count */
4446 primitive(497, 89, 1); /* dimen */
4447 primitive(392, 89, 2); /* skip */
4448 primitive(393, 89, 3); /* muskip */
4449 primitive(665, 79, 102); /* spacefactor */
4450 primitive(666, 79, 1); /* prevdepth */
4451 primitive(667, 82, 0); /* dead_cycles */
4452 primitive(668, 82, 1); /* insert_penalties */
4453 primitive(669, 83, 1); /* wd */
4454 primitive(670, 83, 3); /* ht */
4455 primitive(671, 83, 2); /* dp */
4456 primitive(672, 70, 0); /* last_penalty */
4457 primitive(673, 70, 1); /* last_kern */
4458 primitive(674, 70, 2); /* lastskip */
4459 primitive(675, 70, 3); /* inputlineno */
4460 primitive(676, 70, 4); /* badness */
4461 primitive(732, 108, 0); /* number */
4462 primitive(733, 108, 1); /* romannumeral */
4463 primitive(734, 108, 2); /* string */
4464 primitive(735, 108, 3); /* meaning */
4465 primitive(736, 108, 4); /* font_name */
4466 primitive(737, 108, 5); /* job_name */
4467 primitive(753, 105, 0); /* if */
4468 primitive(754, 105, 1); /* ifcat */
4469 primitive(755, 105, 2); /* ifnum */
4470 primitive(756, 105, 3); /* ifdim */
4471 primitive(757, 105, 4); /* ifodd */
4472 primitive(758, 105, 5); /* ifvmode */
4473 primitive(759, 105, 6); /* ifhmode */
4474 primitive(760, 105, 7); /* ifmmode */
4475 primitive(761, 105, 8); /* ifinner */
4476 primitive(762, 105, 9); /* ifvoid */
4477 primitive(763, 105, 10); /* ifhbox */
4478 primitive(764, 105, 11); /* ifvbox */
4479 primitive(765, 105, 12); /* ifx */
4480 primitive(766, 105, 13); /* ifeof */
4481 primitive(767, 105, 14); /* iftrue */
4482 primitive(768, 105, 15); /* iffalse */
4483 primitive(769, 105, 16); /* ifcase */
4484 primitive(770, 106, 2); /* fi */
4485 /* hash[(hash_size + 518)].v.RH = 770; */
4486 hash[(hash_size + hash_extra + 518)].v.RH = 770; /* fi */
4487 /* eqtb[(hash_size + 518)]= eqtb[cur_val]; */
4488 eqtb[(hash_size + hash_extra + 518)]= eqtb[cur_val];
4489 primitive(771, 106, 4); /* or */
4490 primitive(772, 106, 3); /* else */
4491 primitive(795, 87, 0); /* nullfont */
4492 /* hash[(hash_size + 524)].v.RH = 795; */ /* hash[frozen_null_font] */
4493 hash[(hash_size + hash_extra + 524)].v.RH = 795; /* nullfont */
4494 /* eqtb[(hash_size + 524)]= eqtb[cur_val]; */
4495 eqtb[(hash_size + hash_extra + 524)]= eqtb[cur_val];
4496 primitive(892, 4, 256); /* span */
4497 /* primitive("span",tab_mark,span_code); */
4498 primitive(893, 5, 257); /* cr */
4499 /* primitive("cr",car_ret,cr_code); */
4500 /* hash[(hash_size + 515)].v.RH = 893; */
4501 hash[(hash_size + hash_extra + 515)].v.RH = 893; /* cr */
4502 /* eqtb[(hash_size + 515)]= eqtb[cur_val]; */
4503 eqtb[(hash_size + hash_extra + 515)]= eqtb[cur_val];
4504 primitive(894, 5, 258); /* cr cr */
4505 /* hash[(hash_size + 519)].v.RH = 895; */
4506 hash[(hash_size + hash_extra + 519)].v.RH = 895; /* endtemplate */
4507 /* hash[(hash_size + 520)].v.RH = 895; */
4508 hash[(hash_size + hash_extra + 520)].v.RH = 895; /* endtemplate */
4509 /* eqtb[(hash_size + 520)].hh.b0 = 9; */
4510 eqtb[(hash_size + hash_extra + 520)].hh.b0 = 9;
4511 /* eqtb[(hash_size + 520)].hh.v.RH = mem_top - 11; */
4512 eqtb[(hash_size + hash_extra + 520)].hh.v.RH = mem_top - 11;
4513 /* eqtb[(hash_size + 520)].hh.b1 = 1; */
4514 eqtb[(hash_size + hash_extra + 520)].hh.b1 = 1;
4515 /* eqtb[(hash_size + 519)]= eqtb[(hash_size + 520)]; */
4516 eqtb[(hash_size + hash_extra + 519)]=
4517 eqtb[(hash_size + hash_extra + 520)];
4518 /* eqtb[(hash_size + 519)].hh.b0 = 115; */
4519 eqtb[(hash_size + hash_extra + 519)].hh.b0 = 115;
4520 primitive(964, 81, 0); /* pagegoal */
4521 primitive(965, 81, 1); /* pagetotal */
4522 primitive(966, 81, 2); /* pagestretch */
4523 primitive(967, 81, 3); /* pagefilstretch */
4524 primitive(968, 81, 4); /* pagefillstretch */
4525 primitive(969, 81, 5); /* pagefilllstretch */
4526 primitive(970, 81, 6); /* pageshrink */
4527 primitive(971, 81, 7); /* pagedepth */
4528 primitive(1019, 14, 0); /* end */
4529 primitive(1020, 14, 1); /* dump */
4530 primitive(1021, 26, 4); /* hskip */
4531 primitive(1022, 26, 0); /* hfil */
4532 primitive(1023, 26, 1); /* hfill */
4533 primitive(1024, 26, 2); /* hss */
4534 primitive(1025, 26, 3); /* hfilneg */
4535 primitive(1026, 27, 4); /* vskip */
4536 primitive(1027, 27, 0); /* vfil */
4537 primitive(1028, 27, 1); /* vfill */
4538 primitive(1029, 27, 2); /* vss */
4539 primitive(1030, 27, 3); /* vfilneg */
4540 primitive(333, 28, 5); /* mskip */
4541 primitive(337, 29, 1); /* kern */
4542 primitive(339, 30, 99); /* mkern */
4543 primitive(1048, 21, 1); /* moveleft */
4544 primitive(1049, 21, 0); /* moveright */
4545 primitive(1050, 22, 1); /* raise */
4546 primitive(1051, 22, 0); /* lower */
4547 primitive(406, 20, 0); /* box */
4548 primitive(1052, 20, 1); /* copy */
4549 primitive(1053, 20, 2); /* lastbox */
4550 primitive(959, 20, 3); /* vsplit */
4551 primitive(1054, 20, 4); /* vtop */
4552 primitive(961, 20, 5); /* vbox */
4553 primitive(1055, 20, 106); /* hbox */
4554 primitive(1056, 31, 99); /* ship_out */
4555 primitive(1057, 31, 100); /* leaders */
4556 primitive(1058, 31, 101); /* cleaders */
4557 primitive(1059, 31, 102); /* xleaders */
4558 primitive(1074, 43, 1); /* indent */
4559 primitive(1075, 43, 0); /* noindent */
4560 primitive(1084, 25, 12); /* unpenalty */
4561 primitive(1085, 25, 11); /* unkern */
4562 primitive(1086, 25, 10); /* unskip */
4563 primitive(1087, 23, 0); /* unhbox */
4564 primitive(1088, 23, 1); /* unhcopy */
4565 primitive(1089, 24, 0); /* unvbox */
4566 primitive(1090, 24, 1); /* unvcopy */
4567 primitive(45, 47, 1); /* - */
4568 primitive(346, 47, 0); /* discretionary */
4569 primitive(1121, 48, 0); /* eqno */
4570 primitive(1122, 48, 1); /* leqno */
4571 primitive(860, 50, 16); /* mathord */
4572 primitive(861, 50, 17); /* mathop */
4573 primitive(862, 50, 18); /* mathbin */
4574 primitive(863, 50, 19); /* mathrel */
4575 primitive(864, 50, 20); /* mathopen */
4576 primitive(865, 50, 21); /* mathclose */
4577 primitive(866, 50, 22); /* mathpunct */
4578 primitive(867, 50, 23); /* mathinner */
4579 primitive(869, 50, 26); /* underline */
4580 primitive(868, 50, 27); /* overline */
4581 primitive(1123, 51, 0); /* displaylimits */
4582 primitive(872, 51, 1); /* limits */
4583 primitive(873, 51, 2); /* nolimits */
4584 primitive(855, 53, 0); /* displaystyle */
4585 primitive(856, 53, 2); /* textstyle */
4586 primitive(857, 53, 4); /* scriptstyle */
4587 primitive(858, 53, 6); /* scriptscriptstyle */
4588 primitive(1141, 52, 0); /* above */
4589 primitive(1142, 52, 1); /* over */
4590 primitive(1143, 52, 2); /* atop */
4591 primitive(1144, 52, 3); /* abovewithdelims */
4592 primitive(1145, 52, 4); /* overwithdelims */
4593 primitive(1146, 52, 5); /* atopwithdelims */
4594 primitive(870, 49, 30); /* left */
4595 primitive(871, 49, 31); /* right */
4596 /* hash[(hash_size + 517)].v.RH = 871; */
4597 hash[(hash_size + hash_extra + 517)].v.RH = 871; /* right */
4598 /* eqtb[(hash_size + 517)]= eqtb[cur_val]; */
4599 eqtb[(hash_size + hash_extra + 517)]= eqtb[cur_val];
4600 primitive(1165, 93, 1); /* long */
4601 primitive(1166, 93, 2); /* outer */
4602 primitive(1167, 93, 4); /* global */
4603 primitive(1168, 97, 0); /* def */
4604 primitive(1169, 97, 1); /* gdef */
4605 primitive(1170, 97, 2); /* edef */
4606 primitive(1171, 97, 3); /* xdef */
4607 primitive(1185, 94, 0); /* let */
4608 primitive(1186, 94, 1); /* futurelet */
4609 primitive(1187, 95, 0); /* chardef */
4610 primitive(1188, 95, 1); /* mathchardef */
4611 primitive(1189, 95, 2); /* countdef */
4612 primitive(1190, 95, 3); /* dimendef */
4613 primitive(1191, 95, 4); /* skipdef */
4614 primitive(1192, 95, 5); /* muskipdef */
4615 primitive(1193, 95, 6); /* toksdef */
4616 primitive(412, 85, (hash_size + 1883)); /* catcode */
4617 primitive(416, 85, (hash_size + 2907)); /* mathcode */
4618 primitive(413, 85, (hash_size + 2139)); /* lccode */
4619 primitive(414, 85, (hash_size + 2395)); /* uccode */
4620 primitive(415, 85, (hash_size + 2651)); /* sfcode */
4621 primitive(474, 85, (hash_size + 3474)); /* delcode */
4622 primitive(409, 86, (hash_size + 1835)); /* textfont */
4623 primitive(410, 86, (hash_size + 1851)); /* scriptfont */
4624 primitive(411, 86, (hash_size + 1867)); /* scriptscriptfont */
4625 primitive(935, 99, 0); /* hyphenation */
4626 primitive(947, 99, 1); /* patterns */
4627 primitive(1211, 78, 0); /* hyphen_char */
4628 primitive(1212, 78, 1); /* skew_char */
4629 primitive(272, 100, 0); /* batchmode */
4630 primitive(273, 100, 1); /* nonstopmode */
4631 primitive(274, 100, 2); /* scrollmode */
4632 primitive(1221, 100, 3); /* errorstopmode */
4633 primitive(1222, 60, 1); /* openin */
4634 primitive(1223, 60, 0); /* closein */
4635 primitive(1224, 58, 0); /* message */
4636 primitive(1225, 58, 1); /* errmessage */
4637 primitive(1231, 57, (hash_size + 2139)); /* lowercase */
4638 primitive(1232, 57, (hash_size + 2395)); /* uppercase */
4639 primitive(1233, 19, 0); /* show */
4640 primitive(1234, 19, 1); /* show_box */
4641 primitive(1235, 19, 2); /* showthe */
4642 primitive(1236, 19, 3); /* showlists */
4643 primitive(1279, 59, 0); /* openout */
4644 primitive(591, 59, 1); /* write */
4645 write_loc = cur_val;
4646 primitive(1280, 59, 2); /* closeout */
4647 primitive(1281, 59, 3); /* special */
4648 primitive(1282, 59, 4); /* immediate */
4649 primitive(1283, 59, 5); /* setlanguage */
4650 no_new_control_sequence = true;
4654 #pragma optimize("s", off) /* 96/Sep/12 */
4655 /* #pragma optimize("1", off) */
4656 #pragma optimize("t", on) /* 96/Sep/12 */
4657 /* #pragma optimize("2", on) */