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 BEGINFMTCHECKSUM 367403084L
50 #define ENDFMTCHECKSUM 69069L
52 extern clock_t start_time, main_time, finish_time; /* in local.c */
54 /* imported from pascal.h */
55 /* localized here to avoid conflict with io.h in other code */
57 #define read(f, b) ((b) = getc (f))
58 #define readln(f) { register int c; while ((c = getc (f)) != '\n' && c != EOF); }
59 /* #define readln(f) { while (getc (f) >= ' '); } ? use fgets ? */
62 void do_initex (void); /* later in this file */
65 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
67 void initialize (void)
71 integer flag; /* bkph */
72 #ifndef ALLOCATEHYPHEN
76 /* We already initialized xchr if we are using non_ascii setup */
80 /* Normally, there is no translation of character code numbers */
83 register integer for_end;
88 xchr[i]= (char) i; /* 95/Jan/7 */
92 /* This is a kind of joke, since the characters are given as numeric codes ! */
192 register integer for_end;
197 while(i++ < for_end);
201 register integer for_end;
206 while(i++ < for_end);
208 #endif /* end of JOKE */
209 } /* end of plain ASCII case (otherwise have read in xchr vector before) */
211 /* Fill in background of `delete' for inverse mapping */
214 register integer for_end;
218 do xord[chr(i)] = 127;
219 while(i++ < for_end);
224 register integer for_end;
228 do xord[xchr[i]] = i;
229 while(i++ < for_end);
233 register integer for_end;
237 do xord[xchr[i]] = i;
238 while(i++ < for_end);
242 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
243 /* Now invert the xchr mapping to get xord mapping */
246 register integer for_end;
250 do xord[xchr[i]] = (char) i;
251 while(i++ < for_end);
254 xord[127]= 127; /* hmm, a fixed point ? why ? */
256 flag = 0; /* 93/Dec/28 - bkph */
257 if (trace_flag != 0) {
258 for (k = 0; k < 256; k++) /* entries in xord / xchr */
263 if (flag) { /* 127 here means mapping undefined */
264 show_line("Inverted mapping xord[] pairs:\n", 0);
265 for (k = 0; k < 256; k++) { /* entries in xord / xchr */
267 sprintf(log_line, "%d => %d\n", k, xord[k]);
268 show_line(log_line, 0);
273 if (interaction < 0) /* may now set in local.c bkph */
274 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
276 deletions_allowed = true;
277 set_box_allowed = true;
280 use_err_help = false;
282 OK_to_interrupt = true;
284 /* darn, need to know mem_top, mem_max etc for the following ... */
287 /* waslomax = mem_min; */
289 /* washimin = mem_max; */
298 cur_list.aux_field.cint = ignore_depth;
300 /* *********************************************************************** */
301 /* cur_list .lhmfield = 0; */ /* removed in 3.14159 */
302 /* cur_list .rhmfield = 0; */ /* removed in 3.14159 */
303 /* *********************************************************************** */
307 page_tail = mem_top - 2;
309 if (is_initex) /* in iniTeX we did already allocate mem [] */
311 mem[mem_top - 2].hh.v.RH = 0;
312 /* last_glue = 262143L; */ /* NO! */
313 last_glue = empty_flag;
318 /* from int_base to eqtb_size */
320 register integer for_end;
321 k = (hash_size + 3163);
322 for_end = (hash_size + 4006);
325 while(k++ < for_end);
327 no_new_control_sequence = true;
328 hash[514].v.LH = 0; /* next(hash_base):= 0 */
329 hash[514].v.RH = 0; /* text(hash_base):= 0 */
330 /* 514 + hash_size + 266 = hashbase + hashsize + 10 + font_max */
331 /* for k <- hashbase+1 to undefined_control_sequence - 1 do ... p.257 */
333 register integer for_end;
335 for_end = (hash_size + 780);
337 do hash[k]= hash[514];
338 while(k++ < for_end);
356 register integer for_end;
361 while(k++ < for_end);
368 register integer for_end;
372 do font_used[k]= false;
373 while(k++ < for_end);
375 null_character.b0 = 0;
376 null_character.b1 = 0;
377 null_character.b2 = 0;
378 null_character.b3 = 0;
384 doing_leaders = false;
387 half_buf = dvi_buf_size / 2;
388 dvi_limit = dvi_buf_size;
392 /* down_ptr:=null; right_ptr:=null; l.12027 */
398 empty_field.v.RH = 0;
399 empty_field.v.LH = 0;
400 null_delimiter.b0 = 0;
401 null_delimiter.b1 = 0;
402 null_delimiter.b2 = 0;
403 null_delimiter.b3 = 0;
410 /* *not* OK with ALLOCATEHYPHEN, since may not be allocated yet */
411 #ifndef ALLOCATEHYPHEN
412 /* {register integer for_end; z = 0; for_end = 607; if(z <= for_end) do */
414 register integer for_end;
416 for_end = hyphen_prime;
422 while(z++ < for_end);
426 output_active = false;
427 insert_penalties = 0;
428 ligature_present = false;
429 cancel_boundary = false;
434 long_help_seen = false;
437 register integer for_end;
441 do write_open[k]= false;
442 while(k++ < for_end);
447 /* initex stuff split off for convenience of optimization adjustments */
448 if (is_initex) do_initex ();
450 /* trap the -i on command line situation if INITEX was NOT defined */
452 show_line("Sorry, somebody forgot to make an INITEX!\n", 1);
454 #endif /* not INITEX */
457 /* do the part of initialize() that requires mem_top, mem_max or mem[] */
458 /* do this part after allocating main memory */
461 void initialize_aux (void)
465 /* waslomax = mem_min; */
467 /* washimin = mem_max; */
472 /* max_nest_stack = 0; */
476 cur_list.aux_field.cint = ignore_depth;
479 /* shown_mode = 0; */
480 /* page_contents = 0; */
481 page_tail = mem_top - 2;
482 //mem[mem_top - 2].hh.v.RH = 0;
485 #endif // end of ifdef ALLOCATEMAIN
487 void line_break_ (integer finalwidowpenalty)
488 {/* 30 31 32 33 34 35 22 */
491 halfword q, r, s, prevs;
492 internal_font_number f;
493 /* small_number j; */
494 int j; /* 95/Jan/7 */
495 /* unsigned char c; */
496 unsigned int c; /* 95/Jan/7 */
498 /* savedbadness = 0; */ /* 96/Feb/9 */
499 pack_begin_line = mode_line;
500 mem[mem_top - 3].hh.v.RH = link(head);
501 if((tail >= hi_mem_min))
503 link(tail) = new_penalty(10000);
506 else if(mem[tail].hh.b0 != 10)
508 link(tail) = new_penalty(10000);
513 delete_glue_ref(mem[tail + 1].hh.v.LH);
514 flush_node_list(mem[tail + 1].hh.v.RH);
515 mem[tail + 1].cint = 10000;
517 link(tail) = new_param_glue(par_fill_skip_code);
518 /* *********************************************************************** */
519 /* following is new in 3.14159 */
520 init_cur_lang = prev_graf % 65536L;
521 init_l_hyf = prev_graf / 4194304L; /* 2^22 */
522 init_r_hyf =(prev_graf / 65536L)% 64;
523 /* *********************************************************************** */
525 noshrinkerroryet = true;
526 if((mem[eqtb[(hash_size + 789)].hh.v.RH].hh.b1 != 0)&&
527 (mem[eqtb[(hash_size + 789)].hh.v.RH + 3].cint != 0))
529 eqtb[(hash_size + 789)].hh.v.RH =
530 finite_shrink(eqtb[(hash_size + 789)].hh.v.RH);
532 if((mem[eqtb[(hash_size + 790)].hh.v.RH].hh.b1 != 0)&&
533 (mem[eqtb[(hash_size + 790)].hh.v.RH + 3].cint != 0))
535 eqtb[(hash_size + 790)].hh.v.RH =
536 finite_shrink(eqtb[(hash_size + 790)].hh.v.RH);
538 q = eqtb[(hash_size + 789)].hh.v.RH;
539 r = eqtb[(hash_size + 790)].hh.v.RH;
540 background[1]= mem[q + 1].cint + mem[r + 1].cint;
545 background[2 + mem[q].hh.b0]= mem[q + 2].cint;
546 background[2 + mem[r].hh.b0]= background[2 + mem[r].hh.b0]+
548 background[6]= mem[q + 3].cint + mem[r + 3].cint;
549 minimum_demerits = 1073741823L; /* 2^30 - 1 */ /* 40000000 hex - 1 */
550 minimal_demerits[3]= 1073741823L;
551 minimal_demerits[2]= 1073741823L;
552 minimal_demerits[1]= 1073741823L;
553 minimal_demerits[0]= 1073741823L;
554 if(eqtb[(hash_size + 1312)].hh.v.RH == 0)
555 if(eqtb[(hash_size + 3747)].cint == 0)
557 last_special_line = 0;
558 second_width = eqtb[(hash_size + 3733)].cint;
562 last_special_line = abs(eqtb[(hash_size + 3204)].cint);
563 if(eqtb[(hash_size + 3204)].cint < 0)
565 first_width = eqtb[(hash_size + 3733)].cint -
566 abs(eqtb[(hash_size + 3747)].cint);
567 if(eqtb[(hash_size + 3747)].cint >= 0)
568 first_indent = eqtb[(hash_size + 3747)].cint;
569 else first_indent = 0;
570 second_width = eqtb[(hash_size + 3733)].cint;
573 first_width = eqtb[(hash_size + 3733)].cint;
575 second_width = eqtb[(hash_size + 3733)].cint -
576 abs(eqtb[(hash_size + 3747)].cint);
577 if(eqtb[(hash_size + 3747)].cint >= 0)
578 second_indent = eqtb[(hash_size + 3747)].cint;
579 else second_indent = 0;
583 last_special_line = mem[eqtb[(hash_size + 1312)].hh.v.RH].hh.v.LH - 1;
584 second_width = mem[eqtb[(hash_size + 1312)].hh.v.RH + 2 *(last_special_line + 1)].cint;
585 second_indent = mem[eqtb[(hash_size + 1312)].hh.v.RH + 2 * last_special_line + 1].cint;
587 /* if looseness=0 then easy_line:=last_special_line */
588 if(eqtb[(hash_size + 3182)].cint == 0)
589 easyline = last_special_line;
590 /* else easyline = 262143L; */ /* NO! */
591 else easyline = empty_flag;
592 /* threshold:=pretolerance; */
593 threshold = eqtb[(hash_size + 3163)].cint;
598 /* if tracing_paragraphs>0 then */
599 if(eqtb[(hash_size + 3195)].cint > 0)
602 print_nl("@firstpass");
607 first_pass_count++; /* 96 Feb 9 */
610 /* threshold:=tolerance; second_pass:=true; */
611 threshold = eqtb[(hash_size + 3164)].cint;
613 /* final_pass:=(emergency_stretch<=0); */
614 final_pass =(eqtb[(hash_size + 3750)].cint <= 0);
617 if(eqtb[(hash_size + 3195)].cint > 0)
622 /* if threshold>inf_bad then threshold:=inf_bad; */
623 if(threshold > 10000)
629 if (is_initex) { /* bkph */
630 if(trie_not_ready)init_trie ();
633 /* ********************************************************************* */
634 /* following has changed in 3.14159 */
636 cur_lang = init_cur_lang;
637 /* lhyf = cur_list .lhmfield; */
639 /* rhyf = cur_list .rhmfield; */
641 /* ********************************************************************* */
646 mem[q].hh.v.RH = mem_top - 7;
647 mem[q + 1].hh.v.RH = 0;
648 mem[q + 1].hh.v.LH = prev_graf + 1;
650 mem[mem_top - 7].hh.v.RH = q;
651 active_width[1] = background[1];
652 active_width[2] = background[2];
653 active_width[3] = background[3];
654 active_width[4] = background[4];
655 active_width[5] = background[5];
656 active_width[6] = background[6];
657 /* passive:=null; printed_node:=temp_head; pass_number:=0; */
659 printed_node = mem_top - 3;
661 font_in_short_display = 0;
662 cur_p = mem[mem_top - 3].hh.v.RH;
665 /* while (cur_p<>null)and(link(active)<>last_active) do */
666 while((cur_p != 0)&&(mem[mem_top - 7].hh.v.RH != mem_top - 7))
668 if((cur_p >= hi_mem_min))
672 f = mem[cur_p].hh.b0;
673 active_width[1]= active_width[1]+ font_info[width_base[f]+
674 font_info[char_base[f]+ mem[cur_p].hh.b1].qqqq.b0].cint
676 cur_p = mem[cur_p].hh.v.RH;
677 } while(!(!(cur_p >= hi_mem_min)));
679 switch(mem[cur_p].hh.b0)
683 active_width[1]= active_width[1]+ mem[cur_p + 1].cint;
686 if(mem[cur_p].hh.b1 == 4)
688 cur_lang = mem[cur_p + 1].hh.v.RH; /* ASCII_code */
689 lhyf = mem[cur_p + 1].hh.b0;
690 rhyf = mem[cur_p + 1].hh.b1;
697 if((prevp >= hi_mem_min))
699 else if((mem[prevp].hh.b0 < 9))
701 /* *********************************************************************** */
702 /* following is new in 3.14159 */
703 else if((mem[prevp].hh.b0 == 11)&&(mem[prevp].hh.b1
706 /* *********************************************************************** */
708 if((mem[mem[cur_p + 1].hh.v.LH].hh.b1 != 0)&&(mem[
709 mem[cur_p + 1].hh.v.LH + 3].cint != 0))
711 mem[cur_p + 1].hh.v.LH = finite_shrink(mem[cur_p + 1].hh.v.LH);
713 q = mem[cur_p + 1].hh.v.LH;
714 active_width[1]= active_width[1]+ mem[q + 1].cint;
715 active_width[2 + mem[q].hh.b0]= active_width[2 + mem[q]
716 .hh.b0]+ mem[q + 2].cint;
717 active_width[6]= active_width[6]+ mem[q + 3].cint;
718 if(second_pass && autobreaking)
721 s = mem[prevs].hh.v.RH;
725 if((s >= hi_mem_min))
730 else if(mem[s].hh.b0 == 6)
731 if(mem[s + 1].hh.v.RH == 0)
735 q = mem[s + 1].hh.v.RH;
739 else if((mem[s].hh.b0 == 11)&&(mem[s].hh.b1 ==
742 else if(mem[s].hh.b0 == 8)
744 if(mem[s].hh.b1 == 4)
746 cur_lang = mem[s + 1].hh.v.RH; /* ASCII_code */
747 lhyf = mem[s + 1].hh.b0;
748 rhyf = mem[s + 1].hh.b1;
753 if(eqtb[(hash_size + 2139) + c].hh.v.RH != 0)
754 /* signed unsigned mismatch ? (c is unsigned) */
755 if((eqtb[(hash_size + 2139) + c].hh.v.RH == c)||
756 (eqtb[(hash_size + 3201)].cint > 0))
760 s = mem[prevs].hh.v.RH;
762 lab32: hyf_char = hyphen_char[hf];
763 /* if hyf_char<0 then goto done1; */
764 if(hyf_char < 0) goto lab31;
765 /* if hyf_char>255 then goto done1; */
766 if(hyf_char > 255) goto lab31; /* ? */
768 if(lhyf + rhyf > 63) goto lab31;
771 if((s >= hi_mem_min)) {
772 if(mem[s].hh.b0 != hf)
774 hyfbchar = mem[s].hh.b1;
775 c = hyfbchar; /* unsigned char c; */
776 if(eqtb[(hash_size + 2139) + c].hh.v.RH == 0)
783 /* long to short ... */
784 hc[hn]= eqtb[(hash_size + 2139) + c].hh.v.RH;
785 hyfbchar = 256; /* special mark */
787 else if(mem[s].hh.b0 == 6)
789 if(mem[s + 1].hh.b0 != hf)
791 /* j:=hn; q:=lig_ptr(s); l.17554 */
793 q = mem[s + 1].hh.v.RH;
794 /* if q>null then hyf_bchar:=character(q); l.17554 BUG ??? */
796 if(q != 0) /* 94/Mar/23 BUG FIX */
797 hyfbchar = mem[q].hh.b1;
798 /* while q>null do l.17555 BUG ??? */
800 while(q != 0){ /* 94/Mar/23 BUG FIX */
802 if(eqtb[(hash_size + 2139) + c].hh.v.RH == 0)
808 /* long to short ... */
809 hc[j]= eqtb[(hash_size + 2139) + c].hh.v.RH;
814 if(odd(mem[s].hh.b1))
815 hyfbchar = font_bchar[hf];
816 else hyfbchar = 256; /* special mark */
818 else if((mem[s].hh.b0 == 11)&&(mem[s].hh.b1 ==
822 /* ******************************************************************** */
823 hyfbchar = font_bchar[hf]; /* new code in 3.14159 */
824 /* ******************************************************************** */
833 if(!((s >= hi_mem_min)))
839 if(mem[s].hh.b1 != 0)
864 /* ******************************************************************* */
865 if(mem[cur_p].hh.b1 == 1)/* change in 3.14159 */
866 /* ******************************************************************* */
868 if(!(mem[cur_p].hh.v.RH >= hi_mem_min)&& autobreaking)
869 if(mem[mem[cur_p].hh.v.RH].hh.b0 == 10)
871 active_width[1]= active_width[1]+ mem[cur_p + 1].cint;
873 /* ******************************************************************* */
874 /* change in 3.14159 */
875 else active_width[1]= active_width[1]+ mem[cur_p + 1].cint;
876 /* ******************************************************************* */
880 f = mem[cur_p + 1].hh.b0;
881 active_width[1]= active_width[1]+ font_info[width_base[f]+
882 font_info[char_base[f]+ mem[cur_p + 1].hh.b1].qqqq.b0]
888 s = mem[cur_p + 1].hh.v.LH;
891 try_break(eqtb[(hash_size + 3167)].cint, 1);
895 if((s >= hi_mem_min))
898 disc_width = disc_width + font_info[width_base[f]+ font_info
899 [ char_base[f]+ mem[s].hh.b1].qqqq.b0].cint;
901 else switch(mem[s].hh.b0)
904 f = mem[s + 1].hh.b0;
905 disc_width = disc_width + font_info[width_base[f]+
906 font_info[char_base[f]+ mem[s + 1].hh.b1].qqqq.b0
914 disc_width = disc_width + mem[s + 1].cint;
918 confusion(931); /* disc3 */
919 return; // abort_flag set
925 active_width[1]= active_width[1]+ disc_width;
926 try_break(eqtb[(hash_size + 3166)].cint, 1);
927 active_width[1]= active_width[1]- disc_width;
929 r = mem[cur_p].hh.b1;
930 s = mem[cur_p].hh.v.RH;
932 if((s >= hi_mem_min))
935 active_width[1]= active_width[1]+ font_info[width_base[f
936 ]+ font_info[char_base[f]+ mem[s].hh.b1].qqqq.b0]
939 else switch(mem[s].hh.b0)
942 f = mem[s + 1].hh.b0;
943 active_width[1]= active_width[1]+ font_info[width_base[
944 f]+ font_info[char_base[f]+ mem[s + 1].hh.b1].qqqq
952 active_width[1]= active_width[1]+ mem[s + 1].cint;
956 confusion(932); /* disc4 */
957 return; // abort_flag set
971 autobreaking =(mem[cur_p].hh.b1 == 1);
973 if(!(mem[cur_p].hh.v.RH >= hi_mem_min)&& autobreaking)
974 if(mem[mem[cur_p].hh.v.RH].hh.b0 == 10)
976 active_width[1]= active_width[1]+ mem[cur_p + 1].cint;
981 try_break(mem[cur_p + 1].cint, 0);
990 confusion(930); /* paragraph */
991 return; // abort_flag set
996 cur_p = mem[cur_p].hh.v.RH;
1001 try_break(-10000, 1);
1002 if(mem[mem_top - 7].hh.v.RH != mem_top - 7)
1004 r = mem[mem_top - 7].hh.v.RH;
1005 fewest_demerits = 1073741823L; /* 2^30 - 1 */
1007 if(mem[r].hh.b0 != 2)
1008 if(mem[r + 2].cint < fewest_demerits)
1010 fewest_demerits = mem[r + 2].cint;
1014 } while(!(r == mem_top - 7));
1015 best_line = mem[best_bet + 1].hh.v.LH;
1016 /* if looseness=0 then goto done; */
1017 if(eqtb[(hash_size + 3182)].cint == 0){
1018 /* if (final_pass && eqtb[(hash_size + 3750)].cint > 0){ */
1019 /* paragraph_failed++; */
1021 goto lab30; /* normal exit */
1024 /* r:=link(active); actual_looseness:=0; */
1025 r = mem[mem_top - 7].hh.v.RH;
1026 actual_looseness = 0;
1028 if(mem[r].hh.b0 != 2)
1030 /* line_diff:=line_number(r)-best_line; */
1031 line_diff = toint(mem[r + 1].hh.v.LH)- toint(best_line
1033 /* if ((line_diff<actual_looseness)and(looseness<=line_diff))or@|
1034 ((line_diff>actual_looseness)and(looseness>=line_diff)) then */
1035 if(((line_diff < actual_looseness)&&
1036 (eqtb[(hash_size + 3182)].cint
1037 <= line_diff)) ||((line_diff > actual_looseness)&&
1038 (eqtb[(hash_size + 3182)].cint >= line_diff)))
1041 actual_looseness = line_diff;
1042 fewest_demerits = mem[r + 2].cint;
1044 else if((line_diff == actual_looseness)&&(mem[r + 2]
1045 .cint < fewest_demerits))
1048 fewest_demerits = mem[r + 2].cint;
1052 } while(!(r == mem_top - 7));
1053 best_line = mem[best_bet + 1].hh.v.LH;
1055 /* if (actual_looseness=looseness)or final_pass then goto done; */
1056 /* if((actual_looseness == eqtb[(hash_size + 3182)].cint)|| final_pass)*/
1057 if((actual_looseness == eqtb[(hash_size + 3182)].cint)) {
1065 q = mem[mem_top - 7].hh.v.RH;
1066 while(q != mem_top - 7){
1067 cur_p = mem[q].hh.v.RH;
1068 if(mem[q].hh.b0 == 2)
1070 else free_node(q, 3);
1075 cur_p = mem[q].hh.v.RH;
1083 if(eqtb[(hash_size + 3195)].cint > 0)
1084 print_nl("@second_pass"); /* */
1086 /* threshold:=tolerance; */
1087 threshold = eqtb[(hash_size + 3164)].cint;
1089 second_pass_count++; /* 96 Feb 9 */
1090 /* final_pass:=(emergency_stretch<=0); */
1091 final_pass =(eqtb[(hash_size + 3750)].cint <= 0);
1097 if(eqtb[(hash_size + 3195)].cint > 0) /* tracing_paragraphs */
1098 print_nl("@emergencypass"); /* */
1100 /* can only get here is \emergencystretch has been set positive */
1101 /* background[2]:=background[2]+emergency_stretch; final_pass:=true; */
1102 background[2]= background[2]+ eqtb[(hash_size + 3750)].cint;
1104 final_pass_count++; /* 96 Feb 9 */
1105 } /* end of if second_pass */
1106 } /* end of while(true)do */
1107 /* cannot drop through from above loop */
1108 lab30: /* common exit point */
1109 /* if (badness > (pre)tolerance) */
1110 /* if(last_badness > threshold){ */
1111 /* if(savedbadness > threshold){ */ /* do we believe this ??? */
1112 /* paragraph_failed++; */ /* 96/Feb/9 */
1114 /* if (prevgraf == 1) singleline++; */
1115 /* if (nest[nest_ptr].pg_field == 1) singleline++; */
1116 /* At this point best_line is number of lines in paragraph + 1 */
1117 if (best_line == 2) singleline++;
1120 if(eqtb[(hash_size + 3195)].cint > 0)
1122 end_diagnostic(true);
1123 normalize_selector ();
1126 post_line_break(finalwidowpenalty);
1127 q = mem[mem_top - 7].hh.v.RH;
1128 while(q != mem_top - 7){
1129 cur_p = mem[q].hh.v.RH;
1130 if(mem[q].hh.b0 == 2)
1132 else free_node(q, 3);
1136 while(q != 0){ /* while q<>null do l.16979 */
1137 cur_p = mem[q].hh.v.RH;
1141 pack_begin_line = 0;
1144 void prefixed_command (void)
1147 internal_font_number f;
1154 while(cur_cmd == 93){
1155 if(! odd(a / cur_chr))
1156 a = a + cur_chr; /* small_number a; */
1159 } while(!((cur_cmd != 10)&&(cur_cmd != 0)));
1162 print_err("You can't use a prefix with `");
1163 print_cmd_chr(cur_cmd, cur_chr);
1164 print_char(39); /* ' */
1165 help1("I'll pretend you didn't say \\long or \\outer or \\global.");
1170 if((cur_cmd != 97)&&(a % 4 != 0)) {
1171 print_err("You can't use `");
1173 print_string("' or `");
1175 print_string("' with `");
1176 print_cmd_chr(cur_cmd, cur_chr);
1177 print_char(39); /* ' */
1178 help1("I'll pretend you didn't say \\long or \\outer here.");
1181 if(eqtb[(hash_size + 3206)].cint != 0)
1182 if(eqtb[(hash_size + 3206)].cint < 0)
1195 /* set_font: define(cur_font_loc,data,cur_chr); */
1197 geq_define((hash_size + 1834), 120, cur_chr);
1198 else eq_define((hash_size + 1834), 120, cur_chr);
1202 if(odd(cur_chr)&& !(a >= 4)&&
1203 (eqtb[(hash_size + 3206)].cint >= 0))
1208 q = scan_toks(true, e);
1209 if((a >= 4)) geq_define(p, 111 +(a % 4), def_ref);
1210 else eq_define(p, 111 +(a % 4), def_ref);
1222 } while(!(cur_cmd != 10));
1240 incr(mem[cur_chr].hh.v.LH);
1242 geq_define(p, cur_cmd, cur_chr);
1243 else eq_define(p, cur_cmd, cur_chr);
1251 if((a >= 4)) geq_define(p, 0, 256);
1252 else eq_define(p, 0, 256);
1253 scan_optional_equals ();
1259 geq_define(p, 68, cur_val);
1260 else eq_define(p, 68, cur_val);
1265 scan_fifteen_bit_int ();
1267 geq_define(p, 69, cur_val);
1268 else eq_define(p, 69, cur_val);
1273 scan_eight_bit_int ();
1277 geq_define(p, 73, (hash_size + 3218) + cur_val);
1278 else eq_define(p, 73, (hash_size + 3218) + cur_val);
1282 geq_define(p, 74, (hash_size + 3751) + cur_val);
1283 else eq_define(p, 74, (hash_size + 3751) + cur_val);
1287 geq_define(p, 75, (hash_size + 800) + cur_val);
1288 else eq_define(p, 75, (hash_size + 800) + cur_val);
1292 geq_define(p, 76, (hash_size + 1056) + cur_val);
1293 else eq_define(p, 76, (hash_size + 1056) + cur_val);
1297 geq_define(p, 72, (hash_size + 1322) + cur_val);
1298 else eq_define(p, 72, (hash_size + 1322) + cur_val);
1310 if(! scan_keyword(836)) /* to */
1312 print_err("Missing `to' inserted");
1313 help2("You should have said `\\read<number> to \\cs'.",
1314 "I'm going to look for the \\cs now.");
1320 if((a >= 4)) geq_define(p, 111, cur_val);
1321 else eq_define(p, 111, cur_val);
1330 scan_eight_bit_int ();
1331 p = (hash_size + 1322) + cur_val;
1334 scan_optional_equals ();
1337 } while(!((cur_cmd != 10)&&(cur_cmd != 0)));
1342 scan_eight_bit_int ();
1344 cur_chr = (hash_size + 1322) + cur_val;
1348 q = eqtb[cur_chr].hh.v.RH;
1351 geq_define(p, 101, 0);
1352 else eq_define(p, 101, 0);
1355 incr(mem[q].hh.v.LH);
1357 geq_define(p, 111, q);
1358 else eq_define(p, 111, q);
1365 q = scan_toks(false, false);
1366 if(mem[def_ref].hh.v.RH == 0){
1368 geq_define(p, 101, 0);
1369 else eq_define(p, 101, 0);
1371 mem[def_ref].hh.v.RH = avail;
1381 if(p == (hash_size + 1313)) /* output ? */
1383 mem[q].hh.v.RH = get_avail ();
1385 mem[q].hh.v.LH = 637;
1387 mem[q].hh.v.LH = 379;
1388 mem[q].hh.v.RH = mem[def_ref].hh.v.RH;
1389 mem[def_ref].hh.v.RH = q;
1392 geq_define(p, 111, def_ref);
1393 else eq_define(p, 111, def_ref);
1400 scan_optional_equals ();
1403 geq_word_define(p, cur_val);
1404 else eq_word_define(p, cur_val);
1410 scan_optional_equals ();
1411 scan_dimen(false, false, false);
1413 geq_word_define(p, cur_val);
1414 else eq_word_define(p, cur_val);
1422 scan_optional_equals ();
1423 if(n == 76) scan_glue(3);
1427 geq_define(p, 117, cur_val);
1428 else eq_define(p, 117, cur_val);
1433 if(cur_chr == (hash_size + 1883))
1435 else if(cur_chr == (hash_size + 2907))
1436 n = 32768L; /* 2^15 */
1437 else if(cur_chr == (hash_size + 2651))
1438 n = 32767; /* 2^15 - 1*/
1439 else if(cur_chr == (hash_size + 3474))
1440 n = 16777215L; /* 2^24 - 1 */
1441 else n = 255; /* 2^8 - 1 */
1445 scan_optional_equals ();
1447 if(((cur_val < 0)&&(p < (hash_size + 3474))) ||(cur_val > n))
1449 print_err("Invalid code(");
1451 if(p < (hash_size + 3474))
1452 print_string("), should be in the range 0..");
1454 print_string("), should be at most ");
1456 help1("I'm going to use 0 instead of that illegal code value.");
1460 if(p < (hash_size + 2907))
1462 geq_define(p, 120, cur_val);
1463 else eq_define(p, 120, cur_val);
1464 else if(p < (hash_size + 3474))
1466 geq_define(p, 120, cur_val);
1467 else eq_define(p, 120, cur_val);
1469 geq_word_define(p, cur_val);
1470 else eq_word_define(p, cur_val);
1476 scan_four_bit_int ();
1478 scan_optional_equals ();
1481 geq_define(p, 120, cur_val);
1482 else eq_define(p, 120, cur_val);
1489 do_register_command(a);
1493 scan_eight_bit_int ();
1497 scan_optional_equals ();
1498 if(set_box_allowed){
1499 scan_box(1073741824L + n); /* 2^30 + n */ /* box_flag + n */
1502 print_err("Improper ");
1503 print_esc("setbox"); /* */
1504 help2("Sorry, \\setbox is not allowed after \\halign in a display,",
1505 "or between \\accent and an accented character.");
1517 alter_page_so_far ();
1527 scan_optional_equals ();
1534 p = get_node(2 * n + 1);
1537 register integer for_end;
1542 scan_dimen(false, false, false);
1543 mem[p + 2 * j - 1].cint = cur_val;
1544 scan_dimen(false, false, false);
1545 mem[p + 2 * j].cint = cur_val;
1547 while(j++ < for_end);
1551 geq_define((hash_size + 1312), 118, p);
1552 else eq_define((hash_size + 1312), 118, p);
1560 if (is_initex) { /* bkph */
1565 print_err("Patterns can be loaded only by INITEX");
1570 } while(!(cur_cmd == 2));
1575 new_hyph_exceptions ();
1581 find_font_dimen(true);
1583 scan_optional_equals ();
1584 scan_dimen(false, false, false);
1585 font_info[k].cint = cur_val;
1593 scan_optional_equals ();
1595 if(n == 0)hyphen_char[f]= cur_val;
1596 else skew_char[f]= cur_val;
1607 confusion(1172); /* prefix */
1608 return; // abort_flag set
1611 } /* end of cur_cmd switch */
1615 if(after_token != 0) {
1616 cur_tok = after_token;
1622 /* added following explanations 96/Jan/10 */
1624 void bad_formator_pool (char *name, char *defaultname, char *envvar)
1626 if (name == NULL) name = defaultname;
1627 sprintf(log_line, "(Perhaps %s is for an older version of TeX)\n", name);
1628 show_line(log_line, 0);
1629 name_of_file[name_length + 1] = '\0'; /* null terminate */
1630 sprintf(log_line, "(Alternatively, %s may have been corrupted)\n", name_of_file+1);
1631 show_line(log_line, 0);
1632 name_of_file[name_length + 1] = ' '; /* space terminate */
1634 "(Perhaps your %s environment variable is not set correctly)\n", envvar);
1635 show_line(log_line, 0);
1637 char *s; /* extra info 99/April/28 */
1638 if ((s = grabenv(envvar)) != NULL) {
1639 sprintf(log_line, "(%s=%s)\n", envvar, s);
1640 show_line(log_line, 0);
1643 sprintf(log_line, "%s environment variable not set\n", envvar);
1644 show_line(log_line, 0);
1652 bool load_fmt_file (void)
1654 register bool Result;
1660 undump_int(x); /* CHECKSUM */
1661 if (x != BEGINFMTCHECKSUM) /* magic FMT file start 4C 20 E6 15 hex */
1664 undump_int(x); /* mem_bot */
1668 undump_int(x); /* mem_top */
1671 /* we already read this once earlier to grab mem_top */
1673 sprintf(log_line, "Read from fmt file mem_top = %d TeX words\n", x);
1674 show_line(log_line, 0);
1676 mem = allocate_main_memory(x); /* allocate main memory at this point */
1677 if (mem == NULL) exit(1); /* redundant sanity test ! */
1678 initialize_aux(); /* do `mem' part of initialize */
1679 /* mem = zmem; */ /* update pointer to main memory */
1685 undump_int(x); /* eqtbsize */
1686 if(x != (hash_size + 4006)) /* eqtbsize */
1688 undump_int(x); /* hash_prime */
1691 undump_int(x); /* hyphen_prime */
1693 #ifdef ALLOCATEHYPHEN
1694 /* allow format files dumped with arbitrary (prime) hyphenation exceptions */
1695 realloc_hyphen (x); /* reset_hyphen(); */
1699 if(x != hyphen_prime)
1702 undump_int(x); /* pool_size */
1706 #ifdef ALLOCATESTRING
1707 if (x > current_pool_size) {
1709 sprintf(log_line, "undump string pool reallocation (%d > %d)\n", x, current_pool_size);
1710 show_line(log_line, 0);
1712 str_pool = realloc_str_pool (x - current_pool_size + increment_pool_size);
1714 if(x > current_pool_size) /* 94/Jan/24 */
1720 sprintf(log_line, "%s%s\n", "---! Must increase the ", "string pool size");
1721 show_line(log_line, 0);
1723 } else pool_ptr = x;
1726 undump_int(x); /* max_strings */
1730 #ifdef ALLOCATESTRING
1731 if (x > current_max_strings) {
1733 sprintf(log_line, "undump string pointer reallocation (%d > %d)\n", x, current_max_strings);
1734 show_line(log_line, 0);
1736 str_start = realloc_str_start(x - current_max_strings + increment_max_strings);
1738 if(x > current_max_strings) /* 94/Jan/24 */
1740 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1745 sprintf(log_line, "%s%s\n", "---! Must increase the ", "max strings");
1746 show_line(log_line, 0);
1752 if (undumpthings(str_start[0], str_ptr + 1)) return -1; /* undump string ptrs */
1753 if (undumpthings(str_pool[0], pool_ptr)) return -1; /* undump string pool */
1755 init_str_ptr = str_ptr;
1756 init_pool_ptr = pool_ptr;
1757 /* undump the dynamic memory - paragraph 1312 in the book */
1760 if((x < 1019)||(x > mem_top - 14))
1762 else lo_mem_max = x;
1766 if((x < 20)||(x > lo_mem_max))
1770 p = 0; /* mem_bot */
1773 if (undumpthings(mem[p], q + 2 - p)
1775 p = q + mem[q].hh.v.LH;
1776 if((p > lo_mem_max)||((q >= mem[q + 1].hh.v.RH)&&(mem[q +
1777 1].hh.v.RH != rover)))
1779 q = mem[q + 1].hh.v.RH;
1780 } while(!(q == rover));
1781 if (undumpthings(mem[p], lo_mem_max + 1 - p)
1783 /* if(mem_min < -2) */
1784 if(mem_min < mem_bot - 2) /* ? splice in block below */
1786 /* or call add_variable_space(mem_bot - (mem_min + 1)) */
1788 if (trace_flag) show_line("Splicing in mem_min space in undump!\n", 0);
1790 p = mem[rover + 1].hh.v.LH;
1792 mem[mem_min].hh.v.RH = 0; /* null */
1793 mem[mem_min].hh.v.LH = 0; /* null */
1794 mem[p + 1].hh.v.RH = q;
1795 mem[rover + 1].hh.v.LH = q;
1796 mem[q + 1].hh.v.RH = rover;
1797 mem[q + 1].hh.v.LH = p;
1798 /* mem[q].hh.v.RH = 262143L; */ /* NO! */
1799 mem[q].hh.v.RH = empty_flag;
1800 /* mem[q].hh.v.LH = -0 - q; */
1801 mem[q].hh.v.LH = mem_bot - q; /* ? size of block */
1805 if((x < lo_mem_max + 1)||(x > mem_top - 13))
1807 else hi_mem_min = x;
1811 /* if((x < 0)||(x > mem_top)) */
1812 if((x < mem_bot)||(x > mem_top))
1817 if (undumpthings(mem[hi_mem_min], mem_end + 1 - hi_mem_min)
1819 undump_int(var_used);
1820 undump_int(dyn_used);
1824 if((x < 1)||(k + x > (hash_size + 4007)))
1826 if (undumpthings(eqtb[k], x)
1830 if((x < 0)||(k + x > (hash_size + 4007)))
1833 register integer for_end;
1835 for_end = k + x - 1;
1837 eqtb[j]= eqtb[k - 1];
1838 while(j++ < for_end);
1841 } while(!(k > (hash_size + 4006)));
1844 /* if((x < hashbase)||(x > hashbase + hashsize)) */
1845 /* if((x < 514)||(x > (hash_size + 514))) */
1846 if((x < 514)||(x > (hash_size + hash_extra + 514))) /*96/Jan/10*/
1850 par_token = 4095 + par_loc;
1853 /* if((x < hashbase)||(x > hashbase + hashsize)) */
1854 /* if((x < 514)||(x > (hash_size + 514))) */
1855 if((x < 514)||(x > (hash_size + hash_extra + 514))) /*96/Jan/10*/
1862 /* if((x < hashbase)||(x > hashbase + hashsize)) */
1863 /* if((x < 514)||(x > (hash_size + 514))) */
1864 if((x < 514)||(x > (hash_size + hash_extra + 514))) /*96/Jan/10*/
1872 if((x < p + 1)||(x > hash_used))
1877 } while(!(p == hash_used));
1878 if (undumpthings(hash[hash_used + 1], (hash_size + 780) - hash_used)
1881 undump_int(cs_count); /* cs_count */
1883 sprintf(log_line, "itex undump cs_count %d ", cs_count); /* debugging */
1884 show_line(log_line, 0);
1887 undump_int(x); /* font_mem_size */
1890 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1893 sprintf(log_line, "Read from fmt fmem_ptr = %d\n", x);
1894 show_line(log_line, 0);
1896 if(x > current_font_mem_size) { /* 93/Nov/28 dynamic allocate font_info */
1898 sprintf(log_line, "Undump realloc font_info (%d > %d)\n",
1899 x, current_font_mem_size);
1900 show_line(log_line, 0);
1902 font_info = realloc_font_info (x - current_font_mem_size + increment_font_mem_size);
1904 if(x > current_font_mem_size) /* in case allocation failed 94/Jan/24 */
1906 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1907 if(x > font_mem_size)
1911 sprintf(log_line, "%s%s\n", "---! Must increase the ", "font mem size");
1912 show_line(log_line, 0);
1914 } else fmem_ptr = x;
1917 if (undumpthings(font_info[0], fmem_ptr)) return -1;
1919 undump_int(x); /* font_max */
1925 sprintf(log_line, "%s%s\n", "---! Must increase the ", "font max");
1926 show_line(log_line, 0);
1931 frozenfontptr = font_ptr; /* remember number of fonts frozen into format */
1932 if (undumpthings(font_check[0], font_ptr + 1)) return -1;
1933 if (undumpthings(font_size[0], font_ptr + 1)) return -1;
1934 if (undumpthings(font_dsize[0], font_ptr + 1)) return -1;
1935 if (undumpthings(font_params[0], font_ptr + 1)) return -1;
1936 if (undumpthings(hyphen_char[0], font_ptr + 1)) return -1;
1937 if (undumpthings(skew_char[0], font_ptr + 1)) return -1;
1938 if (undumpthings(font_name[0], font_ptr + 1)) return -1;
1939 if (undumpthings(font_area[0], font_ptr + 1)) return -1;
1940 if (undumpthings(font_bc[0], font_ptr + 1)) return -1;
1941 if (undumpthings(font_ec[0], font_ptr + 1)) return -1;
1942 if (undumpthings(char_base[0], font_ptr + 1)) return -1;
1943 if (undumpthings(width_base[0], font_ptr + 1)) return -1;
1944 if (undumpthings(height_base[0], font_ptr + 1)) return -1;
1945 if (undumpthings(depth_base[0], font_ptr + 1)) return -1;
1946 if (undumpthings(italic_base[0], font_ptr + 1)) return -1;
1947 if (undumpthings(lig_kern_base[0], font_ptr + 1)) return -1;
1948 if (undumpthings(kern_base[0], font_ptr + 1)) return -1;
1949 if (undumpthings(exten_base[0], font_ptr + 1)) return -1;
1950 if (undumpthings(param_base[0], font_ptr + 1)) return -1;
1951 if (undumpthings(font_glue[0], font_ptr + 1)) return -1;
1952 if (undumpthings(bchar_label[0], font_ptr + 1)) return -1;
1953 if (undumpthings(font_bchar[0], font_ptr + 1)) return -1;
1954 if (undumpthings(font_false_bchar[0], font_ptr + 1)) return -1;
1957 /* log not opened yet, so can't show fonts frozen into format */
1959 /* May be able to avoid the following since we switched to */
1960 /* non_address from font_mem_size to 0 96/Jan/15 ??? */
1961 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1963 /* deal with fmt files dumped with *different* font_mem_size 93/Nov/29 */
1964 { int count = 0, oldfont_mem_size = 0;
1965 for (x = 0; x <= font_ptr; x++) {
1966 if(bchar_label[x] > oldfont_mem_size) oldfont_mem_size = bchar_label[x];
1969 /* somewhat arbitrary sanity check ... */
1970 /* if (oldfont_mem_size != font_mem_size && oldfont_mem_size > font_max) { */
1971 if (oldfont_mem_size != non_address && oldfont_mem_size > font_max) { /* 96/Jan/16 */
1972 for (x = 0; x <= font_ptr; x++) {
1973 if(bchar_label[x] == oldfont_mem_size) {
1974 /* bchar_label[x] = font_mem_size; */
1975 bchar_label[x] = non_address; /* 96/Jan/16 */
1981 "oldfont_mem_size is %d --- hit %d times. Using non_address %d\n",
1982 oldfont_mem_size, count, non_address);
1983 show_line(log_line, 0);
1988 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1989 /* undump(0)(hyph_size)(hyph_count); */
1992 /* if((x < 0)||(x > 607)) */
1993 if((x < 0)||(x > hyphen_prime))
1998 /* undump hypenation exception tables p.1325 */
2000 register integer for_end;
2002 for_end = hyph_count;
2008 /* if((x < 0)||(x > 607)) */
2009 if((x < 0)||(x > hyphen_prime))
2014 /* undump(0)(str_ptr)(hyph_word[j]); */
2017 if((x < 0)||(x > str_ptr))
2022 /* undump(min_halfword)(max_halfword)(hyph_list[j]); */
2025 /* if((x < 0)||(x > 262143L)) */
2026 if((x < 0)||(x > max_halfword)) /* mem_top ? no p.1325 */
2031 } while(k++ < for_end);
2033 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2034 #ifdef ALLOCATEHYPHEN
2035 /* if user specified new hyphen prime - flush existing exception patterns ! */
2036 /* but, we can reclaim the string storage wasted ... */
2038 if (new_hyphen_prime != 0) {
2039 realloc_hyphen(new_hyphen_prime); /* reset_hyphen(); */
2040 hyphen_prime = new_hyphen_prime;
2044 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2049 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2050 #ifdef ALLOCATETRIES
2052 allocate_tries(x); /* allocate only as much as is needed */
2053 /* trie_size = x; */ /* ??? */
2056 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2060 sprintf(log_line, "%s%s\n", "---! Must increase the ", "trie size");
2061 show_line(log_line, 0);
2067 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2068 if (is_initex) /* bkph */
2069 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2072 if (undumpthings(trie_trl[0], j + 1)) return -1;
2073 if (undumpthings(trie_tro[0], j + 1)) return -1;
2074 if (undumpthings(trie_trc[0], j + 1)) return -1;
2079 if(x > trie_op_size)
2082 sprintf(log_line, "%s%s\n", "---! Must increase the ", "trie op size");
2083 show_line(log_line, 0);
2089 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2090 if (is_initex) /* bkph */
2091 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2095 begin undump(0)(63)(hyf_distance[k]); {a |small_number|}
2096 undump(0)(63)(hyf_num[k]);
2097 undump(min_quarterword)(max_quarterword)(hyf_next[k]); end; */
2099 if (undumpthings(hyf_distance[1], j)) return -1;
2100 if (undumpthings(hyf_num[1], j)) return -1;
2101 if (undumpthings(hyf_next[1], j)) return -1;
2104 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2105 if (is_initex) { /* bkph */
2106 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2108 register integer for_end;
2113 while(k++ < for_end);
2119 /* undump(0)(k-1)(k) */
2122 if((x < 0)||(x > k - 1))
2126 /* undump(1)(j)(x) */
2129 if((x < 1)||(x > j))
2135 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2136 if (is_initex) /* bkph */
2137 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2140 /* j:=j-x; op_start[k]:=qo(j); */
2146 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2147 if (is_initex) /* bkph */
2148 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2149 trie_not_ready = false
2154 if((x < 0)||(x > 3))
2156 /* else interaction = x; */
2157 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2158 if (interaction < 0) /* may now set in local.c bkph 94/Jan/8 */
2159 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2164 if((x < 0)||(x > str_ptr))
2166 else format_ident = x;
2169 /* test_eof(fmt_file)? */
2171 if((x != ENDFMTCHECKSUM)|| feof(fmt_file)) /* magic checksum --- change ? */
2178 sprintf(log_line, "(Fatal format file error; I'm stymied)\n");
2179 show_line(log_line, 1);
2180 /* added following bit of explanation 96/Jan/10 */
2182 bad_formator_pool(format_file, "the format file", "TEXFORMATS");
2187 void final_cleanup (void)
2190 c = cur_chr; /* small_number c */
2191 if (job_name == 0) open_log_file ();
2192 while (input_ptr > 0) {
2193 if (cur_input.state_field == 0) {
2195 } else end_file_reading ();
2197 while (open_parens > 0) {
2201 if(cur_level > level_one) {
2203 print_esc("end occurred ");
2204 print_string("inside a group at level ");
2205 print_int(cur_level - 1);
2208 while (cond_ptr != 0) {
2210 print_esc("end occurred ");
2211 print_string("when ");
2212 print_cmd_chr(105, cur_if); /* i */
2215 print_string("on line ");
2218 print_string(" was incomplete)");
2219 if_line = mem[cond_ptr + 1].cint;
2220 cur_if = mem[cond_ptr].hh.b1;
2221 /* *********************************************************************** */
2222 temp_ptr = cond_ptr; /* new in 3.14159 */
2223 cond_ptr = mem[cond_ptr].hh.v.RH;
2224 free_node(temp_ptr, 2); /* new in 3.14159 */
2225 /* *********************************************************************** */
2228 if(((history == 1)||(interaction < 3)))
2232 print_nl(" (see the transcript file for additional information)");
2238 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2239 if (is_initex) { /* bkph */
2240 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2241 /* *************************** new in 3.14159 ***************************** */
2243 register integer for_end;
2248 delete_token_ref(cur_mark[c]);
2249 while(c++ < for_end);
2251 /* *********************************************************************** */
2252 store_fmt_file (); // returns a value ?
2255 if (!is_initex) /* 2000/March/3 */
2256 print_nl(" (\\dump is performed only by INITEX)"); /* */
2260 // debugging code for checking the string pool
2263 int checkpool (char *task)
2265 int c, i, k, n, st, flag, bad=0;
2268 sprintf(log_line, "Check on string pool start (%s)\n", task);
2269 show_line(log_line, 0);
2271 for (k = 0; k < 32; k++) {
2272 if (str_start[k] != 3 * k) {
2273 sprintf(log_line, "k %d str_start[k] %d\n", k, str_start[k]);
2274 show_line(log_line, 0);
2277 for (k = 32; k < 128; k++) {
2278 if (str_start[k] != 96 + (k - 32)) {
2279 sprintf(log_line, "k %d str_start[k] %d\n", k, str_start[k]);
2280 show_line(log_line, 0);
2283 for (k = 128; k < 256; k++) {
2284 if (str_start[k] != 194 + 4 * (k - 128)){
2285 sprintf(log_line, "k %d str_start[k] %d\n", k, str_start[k]);
2286 show_line(log_line, 0);
2290 sprintf(log_line, "Check on string pool (%s)\n", task);
2291 show_line(log_line, 0);
2293 for (k = 0; k < str_ptr; k++) {
2294 if (str_start[k+1] == 0) break;
2295 n = str_start[k+1] - str_start[k];
2299 for (i = 0; i < n; i++) {
2300 if (str_pool[st + i] == 0) {
2303 if (str_pool[st + i] > 255) {
2309 sprintf(log_line, "BAD %d (start at %d): ", k, st);
2310 show_line(log_line, 0);
2312 for (i = 0; i < n; i++) {
2313 c = str_pool[st + i];
2315 sprintf(s, "%d ", c);
2334 show_line(log_line, stdout);
2337 sprintf(log_line, "end of check (%s)\n", bad ? "BAD" : "OK");
2338 show_line(log_line, 0);
2340 if (task == NULL) return bad;
2344 } /* DEBUGGING ONLY */
2347 void show_frozen (void)
2350 fprintf(log_file, "\n");
2351 fprintf(log_file, "(%d fonts frozen in format file:\n", font_ptr);
2352 /* ignore font 0 which is nullfont */
2353 /* for (i = 1; i < font_ptr+1; i++) */
2354 for (i = 1; i <= font_ptr; i++) {
2355 if (i > 1) fprintf(log_file, ", ");
2356 if ((i % 8) == 0) fprintf(log_file, "\n");
2357 n = str_start[font_name[i]+1]-str_start[font_name[i]];
2358 for (j = 0; j < n; j++) {
2359 putc(str_pool[str_start[font_name[i]]+j], log_file);
2360 /* str_pool[str_start[font_name[i]]+j] = '?'; */
2363 fprintf(log_file, ") ");
2366 /* Main entry point called from texmf.c int main(int ac, char *av[]) */
2367 /* call from main_program in texmf.c */
2368 /* This in turn calls initialize() */
2370 #pragma warning(disable:4127) // conditional expression is constant
2372 /* void texbody() */
2373 int texbody (void) /* now returns a value --- bkph */
2377 set_paths(TEXFORMATPATHBIT + TEXINPUTPATHBIT + TEXPOOLPATHBIT + TFMFILEPATHBIT);
2379 if(ready_already == 314159L)goto lab1; /* magic number */
2380 /* These tests are almost all compile time tests and so could be eliminated */
2382 if((half_error_line < 30)||(half_error_line > error_line - 15))
2384 if(max_print_line < 60) bad = 2;
2385 if(dvi_buf_size % 8 != 0) bad = 3;
2386 if(1100 > mem_top)bad = 4; /* not compile time */
2387 /* if(hash_prime > hash_size) */
2388 if(hash_prime > (hash_size + hash_extra)) bad = 5;
2389 if(max_in_open >= 128)bad = 6; /* p.14 */
2390 if(mem_top < 267)bad = 7; /* where from ? *//* not compile time */
2393 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2394 if (is_initex) { /* bkph */
2395 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2396 if((mem_min != 0)||(mem_max != mem_top)) bad = 10;
2399 /* if((mem_min > 0)||(mem_max < mem_top)) */
2400 if((mem_min > mem_bot)||(mem_max < mem_top)) bad = 10;
2401 /* if((0 > 0)||(255 < 127)) */
2402 if((min_quarterword > 0)||(max_quarterword < 255)) bad = 11;
2403 /* if((0 > 0)||(262143L < 32767)) */
2404 if((min_halfword > 0)||(max_halfword < 32767)) bad = 12;
2405 /* if((0 < 0)||(255 > 262143L)) */
2406 if((min_quarterword < min_halfword)||(max_quarterword > max_halfword))
2408 /* if((mem_min < 0)||(mem_max >= 262143L)||(-0 - mem_min > 262144L)) */
2409 if((mem_min < min_halfword)||(mem_max >= max_halfword)||(mem_bot - mem_min >= max_halfword))
2411 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2412 if(mem_max > mem_top + mem_extra_high) /* not compile time */
2413 bad = 14; /* ha ha */
2414 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2415 /* if((0 < 0)||(font_max > 255)) */
2416 if((0 < min_quarterword)||(font_max > max_quarterword)) /* 93/Dec/3 */
2418 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2419 #ifdef INCREASEFONTS
2420 /* if(font_max > 512)*/ /* 93/Dec/3 */
2421 if(font_max > 1024) /* 96/Jan/17 */
2423 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2427 /* if((save_size > 262143L)||(max_strings > 262143L)) */
2428 if((save_size > max_halfword)||(max_strings > max_halfword))
2430 /* if(buf_size > 262143L)*/
2431 if(buf_size > max_halfword)bad = 18;
2433 if(max_quarterword - min_quarterword < 255) bad = 19;
2434 /* if cs_token_flag + undefined_control_sequence > max_halfword then bad <- 21;*/
2435 /* if((hash_size + 4876) > 262143L)*/
2436 /* if((hash_size + 4876) > max_halfword) */
2437 if((hash_size + 4095 + 781) > max_halfword) bad = 21;
2438 if(format_default_length > PATHMAX) bad = 31;
2439 /* if(2 * 262143L < mem_top - mem_min) */
2440 if(max_halfword < (mem_top - mem_min) / 2) bad = 41;
2442 sprintf(log_line, "%s%s%ld\n", "Ouch---my internal constants have been clobbered!",
2443 "---case ", (long) bad);
2444 show_line(log_line, 1);
2446 bad_formator_pool(format_file, "the format file", "TEXFORMATS"); /* 96/Jan/17 */
2447 goto lab9999; // abort
2452 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2454 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2455 if(! get_strings_started ()) goto lab9999; // abort
2457 init_str_ptr = str_ptr;
2458 init_pool_ptr = pool_ptr;
2459 dateandtime(eqtb[(hash_size + 3183)].cint,
2460 eqtb[(hash_size + 3184)].cint,
2461 eqtb[(hash_size + 3185)].cint,
2462 eqtb[(hash_size + 3186)].cint);
2465 ready_already = 314159L; /* magic number */
2467 lab1: /* get here directly if ready_already already set ... */
2472 show_line(tex_version, 0);
2473 sprintf(log_line, " (%s %s)", application, yandyversion);
2474 show_line(log_line, 0);
2475 if(format_ident > 0)slow_print(format_ident);
2481 name_in_progress = false;
2483 output_file_name = 0;
2489 high_in_open = 0; /* max_in_open name already used 1999 Jan 17 */
2491 max_open_parens = 0; /* max_open_parens */
2494 max_param_stack = 0;
2495 #ifdef ALLOCATEBUFFER
2496 /* first = current_buf_size; */
2497 memset (buffer, 0, current_buf_size); /* redundant */
2499 /* first = buf_size; */
2500 memset (buffer, 0, buf_size); /* redundant ? */
2505 } while(!(first == 0)); */
2506 first = 0; /* 1999/Jan/22 */
2509 warning_index = 0; /* warning_index:=null; l.7068 */
2511 cur_input.state_field = 33;
2512 cur_input.start_field = 1;
2513 cur_input.index_field = 0;
2515 cur_input.name_field = 0;
2517 align_state = 1000000L;
2518 if(! init_terminal ())goto lab9999; // abort
2519 cur_input.limit_field = last;
2522 /* if((format_ident == 0)||(buffer[cur_input.loc_field]== 38)) */
2523 /* For Windows NT, lets allow + instead of & for format specification */
2524 if((format_ident == 0)||
2525 (buffer[cur_input.loc_field]== '&')||
2526 (buffer[cur_input.loc_field]== '+'))
2528 if(format_ident != 0)initialize ();
2529 if(! open_fmt_file ())goto lab9999; // abort
2530 if(! load_fmt_file ()){
2532 goto lab9999; // abort
2535 while((cur_input.loc_field < cur_input.limit_field)&&
2536 (buffer[cur_input.loc_field]== 32))
2537 incr(cur_input.loc_field);
2540 if (debug_flag) check_eqtb("after format"); /* debugging 94/Apr/5 */
2542 if((eqtb[(hash_size + 3211)].cint < 0)||
2543 (eqtb[(hash_size + 3211)].cint > 255))
2544 decr(cur_input.limit_field);
2545 /* long to unsigned char ... */
2546 else buffer[cur_input.limit_field]= eqtb[(hash_size + 3211)].cint;
2547 dateandtime(eqtb[(hash_size + 3183)].cint,
2548 eqtb[(hash_size + 3184)].cint,
2549 eqtb[(hash_size + 3185)].cint,
2550 eqtb[(hash_size + 3186)].cint);
2551 magic_offset = str_start[886]- 9 * 16; /* following: */
2552 /* "0234000122*4000133**3**344*0400400*000000234000111*1111112341011" */
2553 if(interaction == 0) selector = 16;
2555 if((cur_input.loc_field < cur_input.limit_field)&&
2556 (eqtb[(hash_size + 1883) +
2557 buffer[cur_input.loc_field]].hh.v.RH != 0))
2561 /* show font TFMs frozen into format file */
2562 /* moved here after start_input to ensure the log file is open */
2563 if (show_tfm_flag && log_opened && font_ptr > 0) /* 98/Sep/28 */
2567 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2568 main_time = clock();
2569 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2572 if (show_cs_names) print_cs_names(stdout, 0); /* 98/Mar/31 */
2574 main_control(); /* read-eval-print loop :-) in tex8.c */
2576 // what if abort_flag is set now ?
2578 if (show_cs_names) print_cs_names(stdout, 1); /* 98/Mar/31 */
2580 // what if abort_flag is set now ?
2584 // if (abort_flag) return -1;
2586 close_files_and_terminate();
2595 if((history != 0)&&(history != 1)) code = 1;
2597 // now return instead of exit to allow cleanup in local.c
2601 } /* end of texbody */
2604 /* add a block of variable size node space below mem_bot */
2605 void add_variable_space(int size)
2606 { /* used in tex0.c, local.c, itex.c */
2612 if (mem_min == 0) t = mem_min; /* bottom of present block */
2613 else t = mem_min + 1;
2614 mem_min = t - (size + 1); /* first word in new block - 1 */
2615 /* mem_min = mem_start; */ /* allocate all of it at once */
2616 if (mem_min < mem_start) { /* sanity test */
2617 if (trace_flag) show_line("WARNING: mem_min < mem_start!\n", 0);
2618 mem_min = mem_start;
2620 p = mem[rover + 1].hh.v.LH;
2622 mem[mem_min].hh.v.RH = 0; /* insert blank word below ??? */
2623 mem[mem_min].hh.v.LH = 0; /* insert blank word below ??? */
2624 mem[p + 1].hh.v.RH = q;
2625 mem[rover + 1].hh.v.LH = q;
2626 mem[q + 1].hh.v.RH = rover;
2627 mem[q + 1].hh.v.LH = p;
2628 mem[q].hh.v.RH = empty_flag;
2629 mem[q].hh.v.LH = t - q; /* block size */
2634 /*************************************************************************/
2636 /* All ini TeX code is here at end so can use same pragma optimize for it */
2638 /* Ini-TeX code is rarely needed/used so make it small rather than fast */
2640 #pragma optimize("t", off)
2641 /* #pragma optimize("2", off) */
2642 #pragma optimize("s", on)
2643 /* #pragma optimize("1", on) */
2646 /* split out to allow sharing of code from do_initex and newpattern */
2647 void reset_trie (void)
2651 register integer for_end;
2652 k = - (integer) trie_op_size;
2653 for_end = trie_op_size;
2655 do trie_op_hash[k]= 0;
2656 while(k++ < for_end);
2659 register integer for_end;
2660 k = 0; for_end = 255;
2662 do trie_used[k]= min_trie_op;
2663 while(k++ < for_end);
2665 max_op_used = min_trie_op;
2667 trie_not_ready = true;
2671 trie_not_ready = true;
2674 void reset_hyphen (void)
2675 { /* borrowed code from initialize() */
2678 register integer for_end;
2680 for_end = hyphen_prime;
2684 hyph_list[z]= 0; /* hyph_list[z]:=null; l.18131 */
2686 while(z++ < for_end);
2691 /* split out to allow optimize for space, not time */
2692 void do_initex (void)
2696 /* hyph_pointer z; */
2698 /* for k:=mem_bot+1 to lo_mem_stat_max do mem[k].sc:=0; p.164 */
2700 register integer for_end;
2705 while(k++ < for_end);
2708 while(k <= 19){ /* while k <= lo_mem_stat-max ... */
2709 /* glue_ref_count(k):=null+1; */
2715 mem[6].cint = 65536L;
2717 mem[10].cint = 65536L;
2719 mem[14].cint = 65536L;
2721 mem[15].cint = 65536L;
2723 mem[18].cint = -65536L;
2725 rover = 20; /* rover = lo_mem_stat-max + 1 ... */
2726 /* mem[rover].hh.v.RH = 262143L; */
2727 mem[rover].hh.v.RH = empty_flag;
2728 /* mem[rover].hh.v.LH = 1000; */
2729 mem[rover].hh.v.LH = block_size;
2730 mem[rover + 1].hh.v.LH = rover;
2731 mem[rover + 1].hh.v.RH = rover;
2732 /* lo_mem_max = rover + 1000; */
2733 lo_mem_max = rover + block_size;
2734 mem[lo_mem_max].hh.v.RH = 0;
2735 mem[lo_mem_max].hh.v.LH = 0;
2736 /* for k <- hi_mem_stat_min to mem_top do mem[k] = mem[lo_mem_max]; */
2738 register integer for_end;
2742 do mem[k]= mem[lo_mem_max];
2743 while(k++ < for_end);
2745 /* info(omit_template) <- end_template_token; p.790 */
2746 /* @d end_template_token==cs_token_flag+frozen_end_template */
2747 /* mem[mem_top - 10].hh.v.LH = 14114; */
2748 /* mem[mem_top - 10].hh.v.LH = 10019 + 4095; */ /* + eqtbextra ? NO */
2749 /* mem[mem_top - 10].hh.v.LH = (hash_size + 4614); */
2750 /* mem[mem_top - 10].hh.v.LH = (hash_size + 4095 + 519); */
2751 mem[mem_top - 10].hh.v.LH = (hash_size + hash_extra + 4095 + 519);
2752 /* link(end_span) <- max_quarterword + 1 p.797 */
2753 /* mem[mem_top - 9].hh.v.RH = 256; */ /* 94/Apr/4 ? */
2754 mem[mem_top - 9].hh.v.RH = max_quarterword + 1; /* 96/Oct/12 ??? */
2755 /* info(end_span) <- null p.797 */
2756 mem[mem_top - 9].hh.v.LH = 0;
2757 /* type(last_active) <- hyphenated; p.820 */
2758 mem[mem_top - 7].hh.b0 = 1;
2759 /* line_number(last_active) <- max_halfword; p.820 */
2760 /* mem[mem_top - 6].hh.v.LH = 262143L; */
2761 mem[mem_top - 6].hh.v.LH = empty_flag; /* max_halfword ? */
2762 /* subtype(last_active) <- 0; p.820 */
2763 mem[mem_top - 7].hh.b1 = 0;
2764 /* subtype(page_ins_head) <- 255; p.981 */
2765 mem[mem_top].hh.b1 = 255; /* subtype(page_ins_head) = qi(255) p.981 */
2766 /* type(page_ins_head) <- split_up; p.981 */
2767 mem[mem_top].hh.b0 = 1;
2768 /* link(page_ins_head) <- page_ins_head; p.981 */
2769 mem[mem_top].hh.v.RH = mem_top;
2770 /* type(page_head) <- glue_node; p. 988 */
2771 mem[mem_top - 2].hh.b0 = 10;
2772 /* subtype(page_head) <- normal; p. 988 */
2773 mem[mem_top - 2].hh.b1 = 0;
2774 avail = 0; /* avail <- null p.164 */
2775 mem_end = mem_top; /* mem_end <- mem_top */
2776 hi_mem_min = mem_top - 13; /* hi_mem_min <- hi_mem_stat_min */
2777 var_used = 20; /* var_used <- lo_mem_stat_max */
2778 dyn_used = 14; /* dyn_used <- hi_mem_stat_usage */
2779 /* eq_type(undefined_control_sequence) <- undefined_cs; */
2780 /* equiv(undefined_control_sequence) <- null; */
2781 /* eq_level(undefined_control_sequence) <- level_zero; */
2782 eqtb[(hash_size + 781)].hh.b0 = 101;
2783 eqtb[(hash_size + 781)].hh.v.RH = 0;
2784 eqtb[(hash_size + 781)].hh.b1 = 0;
2785 /* for k <- active_base to undefined_control_sequence -1 do */
2786 /* eqtb[k] <- eqtb(undefined_control_sequence); */
2787 /* {register integer for_end; k = 1; for_end = 10280; if(k <= for_end) do */
2789 register integer for_end;
2791 for_end = (hash_size + 780);
2793 eqtb[k]= eqtb[(hash_size + 781)];
2794 while(k++ < for_end);
2796 eqtb[(hash_size + 782)].hh.v.RH = 0; /* glue_base (hash_size + 782) */
2797 eqtb[(hash_size + 782)].hh.b1 = 1;
2798 eqtb[(hash_size + 782)].hh.b0 = 117;
2799 /* equiv(glue_base):=zero_glue; eq_level(glue_base):=level_one; */
2800 /* eq_type(glue_base):=glue_ref; */
2801 /* {register integer for_end; k = 10283; for_end = 10811; if(k <= for_end) */
2803 register integer for_end;
2804 k = (hash_size + 783);
2805 for_end = (hash_size + 1311);
2807 do eqtb[k]= eqtb[(hash_size + 782)];
2808 while(k++ < for_end);
2810 /* glue_ref_count(zero_glue):=glue_ref_count(zero_glue)+local_base-glue_base; */
2811 /* local_base - glue_base = 530 = 17 glue_pars + 256 skip + 256 mu_skip */
2812 mem[0].hh.v.RH = mem[0].hh.v.RH + 530; /* mem[mem_bot]? */
2813 /* box(0):=null; eq_type(box_base):=box_ref; eq_level(box_base):=level_one; */
2814 eqtb[(hash_size + 1312)].hh.v.RH = 0;
2815 eqtb[(hash_size + 1312)].hh.b0 = 118;
2816 eqtb[(hash_size + 1312)].hh.b1 = 1;
2817 /* for k:=box_base+1 to box_base+255 do eqtb[k]:=eqtb[box_base]; */
2818 /* {register integer for_end; k = 10813; for_end = 11077; if(k <= for_end) */
2820 register integer for_end;
2821 k = (hash_size + 1313);
2822 for_end = (hash_size + 1577);
2824 do eqtb[k]= eqtb[(hash_size + 781)];
2825 while(k++ < for_end);
2827 eqtb[(hash_size + 1578)].hh.v.RH = 0;
2828 eqtb[(hash_size + 1578)].hh.b0 = 119;
2829 eqtb[(hash_size + 1578)].hh.b1 = 1;
2830 /* {register integer for_end; k = 11079; for_end = 11333; if(k <= for_end) */
2832 register integer for_end;
2833 k = (hash_size + 1579);
2834 for_end = (hash_size + 1833);
2836 do eqtb[k]= eqtb[(hash_size + 1578)];
2837 while(k++ < for_end);
2839 eqtb[(hash_size + 1834)].hh.v.RH = 0;
2840 eqtb[(hash_size + 1834)].hh.b0 = 120;
2841 eqtb[(hash_size + 1834)].hh.b1 = 1;
2842 /* {register integer for_end; k = 11335; for_end = 11382; if(k <= for_end) */
2844 register integer for_end;
2845 k = (hash_size + 1835);
2846 for_end = (hash_size + 1882);
2848 do eqtb[k]= eqtb[(hash_size + 1834)];
2849 while(k++ < for_end);
2851 eqtb[(hash_size + 1883)].hh.v.RH = 0;
2852 eqtb[(hash_size + 1883)].hh.b0 = 120;
2853 eqtb[(hash_size + 1883)].hh.b1 = 1;
2854 /* initialize cat_code, lc_code, uc_code, sf_code, math_code 256 * 5 */
2855 /* {register integer for_end; k = 11384; for_end = 12662; if(k <= for_end) */
2857 register integer for_end;
2858 k = (hash_size + 1884);
2859 for_end = (hash_size + 3162);
2861 do eqtb[k]= eqtb[(hash_size + 1883)];
2862 while(k++ < for_end);
2864 /* cat_code(k) <- other_char; math_code(k) <- hi(k); sf_code(k) = 1000; */
2866 register integer for_end;
2871 eqtb[(hash_size + 1883) + k].hh.v.RH = 12;
2872 eqtb[(hash_size + 2907) + k].hh.v.RH = k;
2873 eqtb[(hash_size + 2651) + k].hh.v.RH = 1000;
2875 while(k++ < for_end);
2877 /* cat_base == 11383 */
2878 /* cat_code(carriage_return) <- car_ret; cat_code(" ") <- space */
2879 /* cat_code("\") <- escape; cat_code("%") <- comment; ... */
2880 eqtb[(hash_size + 1896)].hh.v.RH = 5;
2881 eqtb[(hash_size + 1915)].hh.v.RH = 10;
2882 eqtb[(hash_size + 1975)].hh.v.RH = 0;
2883 eqtb[(hash_size + 1920)].hh.v.RH = 14;
2884 eqtb[(hash_size + 2010)].hh.v.RH = 15;
2885 eqtb[(hash_size + 1883)].hh.v.RH = 9;
2886 /* for k:="0" to "9" do math_code(k):=hi(k+var_code); */
2888 register integer for_end;
2892 eqtb[(hash_size + 2907) + k].hh.v.RH = k + 28672; /* '70000 */
2893 while(k++ < for_end);
2895 /* cat_code of uppercase and lowercase letters ... */
2897 register integer for_end;
2903 eqtb[(hash_size + 1883) + k].hh.v.RH = 11;
2904 eqtb[(hash_size + 1883) + k + 32].hh.v.RH = 11;
2905 /* mathcode(k) = hi(k + var_code + "100); */ /* '70000 + 256 */
2906 eqtb[(hash_size + 2907) + k].hh.v.RH =
2907 k + 28928; /* '70000 + 256 */
2908 /* mathcode(k + "a" - "A") = hi(k + "a" - "A" + var_code + "100); */
2909 eqtb[(hash_size + 2907) + k + 32].hh.v.RH =
2910 k + 28960; /* '70000 + 256 + 32 */
2912 eqtb[(hash_size + 2139) + k].hh.v.RH = k + 32;
2913 eqtb[(hash_size + 2139) + k + 32].hh.v.RH = k + 32;
2915 eqtb[(hash_size + 2395) + k].hh.v.RH = k;
2916 eqtb[(hash_size + 2395) + k + 32].hh.v.RH = k;
2918 eqtb[(hash_size + 2651) + k].hh.v.RH = 999;
2920 while(k++ < for_end);
2922 /* {register integer for_end; k = 12663; for_end = 12973; if(k <= for_end) */
2924 register integer for_end;
2925 k = (hash_size + 3163);
2926 for_end = (hash_size + 3473);
2930 while(k++ < for_end);
2932 eqtb[(hash_size + 3180)].cint = 1000;
2933 eqtb[(hash_size + 3164)].cint = 10000;
2934 eqtb[(hash_size + 3204)].cint = 1;
2935 eqtb[(hash_size + 3203)].cint = 25;
2936 eqtb[(hash_size + 3208)].cint = 92;
2937 eqtb[(hash_size + 3211)].cint = 13;
2938 /* {register integer for_end; k = 13230; for_end = 13506; if(k <= for_end) */
2940 register integer for_end;
2944 eqtb[(hash_size + 3474) + k].cint = -1;
2945 while(k++ < for_end);
2947 eqtb[(hash_size + 3520)].cint = 0;
2948 /* {register integer for_end; k = 13230; for_end = 13506; if(k <= for_end) */
2950 register integer for_end;
2951 k = (hash_size + 3730);
2952 for_end = (hash_size + 4006);
2954 do eqtb[k].cint = 0;
2955 while(k++ < for_end);
2957 /* hash_used = 10014; */ /* hash_used = frozen_control_sequence */
2958 /* frozen_control_sequence = hashsize + hashbase p.222 */
2959 /* hash_used = (hash_size + 514); */
2960 hash_used = (hash_size + hash_extra + 514); /* 96/Jan/10 */
2962 if (trace_flag) show_line("itex cs_count = 0 ", 0); /* debugging */
2963 /* eq_type(frozen_dont_expand) <- dont_expand; */
2964 /* eqtb[10023].hh.b0 = 116; */
2965 /* eqtb[(hash_size + 523)].hh.b0 = 116; */
2966 eqtb[(hash_size + hash_extra + 523)].hh.b0 = 116;
2967 /* hash[(hash_size + 523)].v.RH = 499; */
2968 hash[(hash_size + hash_extra + 523)].v.RH = 499; /* notexpanded */
2969 /* @<Initialize table...@>= l.10750 */
2970 font_ptr = 0; /* font_ptr:=null_font; */
2971 fmem_ptr = 7; /* fmem_ptr:=7; */
2972 font_name[0]= 795; /* nullfont */
2973 font_area[0]= 335; /* "" */
2974 hyphen_char[0]= 45; /* - */
2976 /* ************************************************************************ */
2977 /* bchar_label[null_font]:=non_address; */ /* 3.14159 */
2978 /* bchar_label[0]= font_mem_size; */ /* OK ? 93/Nov/26 */
2979 bchar_label[0]= non_address; /* i.e. 0 --- 96/Jan/16 */
2980 /* ************************************************************************ */
2981 font_bchar[0] = 256; /* font_bchar[null_font]:=non_char; */
2982 font_false_bchar[0] = 256; /* font_false_bchar[null_font]:=non_char; */
2992 lig_kern_base[0] = 0;
2998 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2999 reset_trie (); /* shared 93/Nov/26 */
3000 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3001 /* {register integer for_end; k = 0; for_end = 6; if(k <= for_end) do
3002 font_info[k].cint = 0;
3003 while(k++ < for_end); }
3004 {register integer for_end; k = - (integer) trie_op_size; for_end =
3005 trie_op_size; if(k <= for_end) do
3007 while(k++ < for_end); }
3008 {register integer for_end; k = 0; for_end = 255; if(k <= for_end) do
3009 trie_used[k]= min_trie_op;
3010 while(k++ < for_end); }
3011 max_op_used = min_trie_op;
3013 trie_not_ready = true;
3017 /* text(frozen_protection):="inaccessible"; */
3018 /* hash[10014].v.RH = 1183; */
3019 /* hash[(hash_size + 514)].v.RH = 1184; */
3020 hash[(hash_size + hash_extra + 514)].v.RH = 1184; /* 1183 */
3021 format_ident = 1251; /* 1250 */
3022 /* hash[(hash_size + 522)].v.RH = 1290; */ /* 1288 */
3023 hash[(hash_size + hash_extra + 522)].v.RH = 1290; /* 1288 */
3024 /* eqtb[(hash_size + 522)].hh.b1 = 1; */
3025 eqtb[(hash_size + hash_extra + 522)].hh.b1 = 1;
3026 /* eqtb[(hash_size + 522)].hh.b0 = 113; */
3027 eqtb[(hash_size + hash_extra + 522)].hh.b0 = 113;
3028 /* eqtb[(hash_size + 522)].hh.v.RH = 0; */
3029 eqtb[(hash_size + hash_extra + 522)].hh.v.RH = 0;
3034 /* starts string pool with strings for 256 chars and then reads tex.pool */
3035 /* adjusted to try both "tex.pool" and "tex.poo" 95/Feb/19 */
3036 /* I have added a texpool file, but I need merge the pool to the binary */
3037 /* lots of things updates the kpathsea sources -- Clerk Ma */
3038 bool get_strings_started (void)
3040 register bool Result;
3046 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3047 int flag; /* 95/Feb/19 */
3048 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3053 register integer for_end;
3058 if(((k < 32)||(k > 126)))
3061 str_pool[pool_ptr]= 94; /* ^ */
3065 str_pool[pool_ptr]= 94; /* ^ */
3070 str_pool[pool_ptr]= k + 64;
3075 str_pool[pool_ptr]= k - 64;
3081 str_pool[pool_ptr]= l + 48; /* '0' */
3084 str_pool[pool_ptr]= l + 87; /* 'a' - 10 */
3091 str_pool[pool_ptr]= l + 48; /* '0' */
3094 str_pool[pool_ptr]= l + 87; /* 'a' - 10 */
3099 str_pool[pool_ptr]= k;
3104 while(k++ < for_end);
3106 vstrcpy((char *) name_of_file + 1, pool_name);
3107 name_of_file[0]= ' ';
3108 name_of_file[strlen(pool_name) + 1]= ' ';
3109 name_length = strlen(pool_name);
3110 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3111 /* if(a_open_in(pool_file, TEXPOOLPATH)) */
3112 flag = a_open_in(pool_file, TEXPOOLPATH);
3113 if (flag == 0) { /* 95/Feb/19 */
3114 pool_name [name_length - 1] = '\0'; /* `tex.pool' => `tex.poo' */
3115 vstrcpy((char *) name_of_file + 1, pool_name);
3116 name_of_file[0]= ' ';
3117 name_of_file[strlen(pool_name)+ 1]= ' ';
3118 name_length = strlen(pool_name);
3119 flag = a_open_in(pool_file, TEXPOOLPATH);
3125 /* if(eof(pool_file)) */ /* feof(pool_file)??? */
3126 if(test_eof(pool_file))
3129 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3130 show_line("! string pool file has no check sum.\n", 1);
3131 /* added following bit of explanation 96/Jan/16 */
3133 bad_formator_pool(string_file, "the pool file", "TEXPOOL");
3134 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3135 (void) a_close(pool_file);
3141 if(m == '*') /* last line starts with * */
3146 if((xord[n]< 48)||(xord[n]> 57))
3149 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3150 show_line("! string pool file check sum doesn't have nine digits.\n", 1);
3151 /* added following bit of explanation 96/Jan/16 */
3153 bad_formator_pool(string_file, "the pool file", "TEXPOOL");
3154 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3155 (void) a_close(pool_file);
3159 a = 10 * a + xord[n]- 48;
3165 /* tex.pool file check sum *367403084 */
3167 if(a != BEGINFMTCHECKSUM) {
3169 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3170 show_line("! string pool check sum doesn't match; tangle me again.\n", 1);
3171 /* added following bit of explanation 96/Jan/16 */
3173 bad_formator_pool(string_file, "the pool file", "TEXPOOL");
3174 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3175 (void) a_close(pool_file);
3181 if((xord[m] < 48)||(xord[m] > 57)||(xord[n] < 48)||(xord[n] > 57))
3184 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3185 show_line("! string pool line doesn't begin with two digits.\n", 1);
3186 /* added following bit of explanation 96/Jan/16 */
3188 bad_formator_pool(string_file, "the pool file", "TEXPOOL");
3189 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3190 (void) a_close(pool_file);
3194 l = xord[m]* 10 + xord[n]- 48 * 11;
3195 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3196 #ifdef ALLOCATESTRING
3197 /* can freely extend memory, so we need not be paranoid - stringvacancies */
3198 /* if(pool_ptr + l + stringvacancies > current_pool_size)*/
3199 if(pool_ptr + l + stringmargin > current_pool_size){
3200 if (trace_flag) show_line("String margin reallocation\n", 0);
3201 /* str_pool = realloc_str_pool (pool_ptr + l + stringvacancies */
3202 str_pool = realloc_str_pool (pool_ptr + l + stringmargin - current_pool_size + increment_pool_size);
3204 if(pool_ptr + l + stringmargin > current_pool_size) /* 94/Jan/24 */
3206 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3207 if(pool_ptr + l + stringvacancies > pool_size)
3211 show_line("! You have to increase POOLSIZE.\n", 1);
3212 (void) a_close(pool_file);
3217 register integer for_end;
3224 else read(pool_file, m);
3226 str_pool[pool_ptr]= xord[m];
3229 } while(k++ < for_end);
3231 readln(pool_file); /* flush rest to end of file / end of line */
3236 (void) a_close(pool_file);
3241 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3242 sprintf(log_line, "! I can't read %s.\n", pool_name);
3243 show_line(log_line, 1);
3245 show_line(" (Was unable to find tex.poo or tex.pool)\n", 0); /* extra explain */
3246 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3255 void sort_avail (void)
3259 p = get_node(1073741824L); /* 2^30 merge adjacent free nodes */
3260 p = mem[rover + 1].hh.v.RH;
3261 /* mem[rover + 1].hh.v.RH = 262143L; */ /* NO! */
3262 mem[rover + 1].hh.v.RH = empty_flag;
3264 while(p != oldrover)if(p < rover)
3267 p = mem[q + 1].hh.v.RH;
3268 mem[q + 1].hh.v.RH = rover;
3272 while(mem[q + 1].hh.v.RH < p)q = mem[q + 1].hh.v.RH;
3273 r = mem[p + 1].hh.v.RH;
3274 mem[p + 1].hh.v.RH = mem[q + 1].hh.v.RH;
3275 mem[q + 1].hh.v.RH = p;
3279 /* while(mem[p + 1].hh.v.RH != 262143L){ */ /* NO! */
3280 while (mem[p + 1].hh.v.RH != empty_flag) {
3281 mem[mem[p + 1].hh.v.RH + 1].hh.v.LH = p;
3282 p = mem[p + 1].hh.v.RH;
3284 mem[p + 1].hh.v.RH = rover;
3285 mem[rover + 1].hh.v.LH = p;
3290 void primitive_ (str_number s, quarterword c, halfword o)
3294 /* small_number l; */
3295 int l; /* 95/Jan/7 */
3297 cur_val = s + 257; /* cur_val <- s + single_base; p.264 */
3300 l = str_start[s + 1]- k; /* small_number l */
3302 register integer for_end;
3306 do buffer[j]= str_pool[k + j];
3307 while(j++ < for_end);
3309 cur_val = id_lookup(0, l);
3312 pool_ptr = str_start[str_ptr];
3314 /* ********************** debugging only 96/Jan/20 should not happen */
3316 if (s > 65535L) show_line("ERROR: hash entry too large\n", 1);
3318 hash[cur_val].v.RH = s;
3320 eqtb[cur_val].hh.b1 = 1;
3321 eqtb[cur_val].hh.b0 = c;
3322 eqtb[cur_val].hh.v.RH = o;
3326 /* more weird constants ? page 394 */
3329 trie_op_code new_trie_op_ (small_number d, small_number n, trie_op_code v)
3331 register trie_op_code Result;
3335 /* the 313, 361 and 1009 are hard-wired constants here p.944 */
3336 /* begin h:=abs(n+313*d+361*v+1009*cur_lang) mod (trie_op_size+trie_op_size) */
3337 h = abs(toint(n)+ 313 * toint(d)+ 361 * toint(v)+ 1009 *
3338 toint(cur_lang)) %(trie_op_size - neg_trie_op_size)+ neg_trie_op_size;
3340 /* if l=0 then {empty position found for a new op} */
3341 l = trie_op_hash[h];
3344 if(trie_op_ptr == trie_op_size){
3345 overflow("pattern memory ops", trie_op_size); /* pattern memory ops - NOT DYNAMIC */
3346 return 0; // abort_flag set
3348 u = trie_used[cur_lang];
3349 /* if u=max_quarterword then ??? */
3350 if(u == max_trie_op){
3351 /* overflow("pattern memory ops per language",
3352 max_quarterword-min_quarterword); ??? */
3353 overflow("pattern memory ops per language", max_trie_op - min_trie_op); /* pattern memory ops per language */
3354 return 0; // abort_flag set
3358 trie_used[cur_lang]= u;
3361 hyf_distance[trie_op_ptr]= d;
3362 hyf_num[trie_op_ptr]= n;
3363 hyf_next[trie_op_ptr]= v;
3364 trie_op_lang[trie_op_ptr]= cur_lang;
3365 trie_op_hash[h]= trie_op_ptr;
3366 trie_op_val[trie_op_ptr]= u;
3370 if((hyf_distance[l]== d)&&(hyf_num[l]== n)&&(hyf_next[l
3371 ]== v)&&(trie_op_lang[l]== cur_lang))
3373 Result = trie_op_val[l];
3376 if(h > - (integer) trie_op_size)
3378 else h = trie_op_size;
3380 /* return Result; */ /* unreachable code */
3382 /* what are those horrible constants there ? page 395 */
3383 trie_pointer trie_node_ (trie_pointer p)
3384 {/* 10 */ register trie_pointer Result;
3387 /* the 1009, 2718, 3142 are hard-wired constants here (not hyphen_prime) */
3388 h = abs(toint(trie_c[p])+ 1009 * toint(trie_o[p])+ 2718 *
3389 toint(trie_l[p])+ 3142 * toint(trie_r[p])) % trie_size;
3398 if((trie_c[q]== trie_c[p])&&(trie_o[q]== trie_o[p])&&(
3399 trie_l[q]== trie_l[p])&&(trie_r[q]== trie_r[p]))
3408 /* return Result; */ /* unreachable code */
3410 trie_pointer compress_trie_ (trie_pointer p)
3411 {register trie_pointer Result;
3415 trie_l[p]= compress_trie(trie_l[p]);
3416 trie_r[p]= compress_trie(trie_r[p]);
3417 Result = trie_node(p);
3421 void first_fit_ (trie_pointer p)
3433 if(trie_max < h + 256)
3435 if(trie_size <= h + 256){
3436 overflow("pattern memory", trie_size); /* pattern memory - NOT DYNAMIC */
3437 /* not dynamic ---- but can be set -h=... from command line in ini-TeX */
3438 return; // abort_flag set
3442 trie_taken[trie_max]= false;
3443 trie_trl[trie_max]= trie_max + 1;
3444 trie_tro[trie_max]= trie_max - 1;
3445 } while(!(trie_max == h + 256));
3451 if(trie_trl[h + trie_c[q]] == 0)
3456 lab45: z = trie_trl[z];
3459 trie_taken[h]= true; /* h may be used without ... */
3472 ll = z; /* short ll */
3477 } while(!(l == ll));
3482 void trie_pack_ (trie_pointer p)
3487 if((q > 0)&&(trie_hash[q]== 0))
3495 void trie_fix_ (trie_pointer p)
3504 trie_trl[z + c]= trie_hash[q];
3506 trie_tro[z + c]= trie_o[p];
3512 void new_patterns (void)
3514 /* ******************************************************************* */
3515 /* was small_number k, l; in 3.141 */
3517 /* ******************************************************************* */
3523 int c; /* 95/Jan/7 */
3524 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3525 if (! trie_not_ready) { /* new stuff */
3526 if (allow_patterns) {
3527 if (trace_flag) show_line("Resetting patterns\n", 0);
3528 reset_trie(); /* RESET PATTERNS - 93/Nov/26 */
3529 if (reset_exceptions) {
3530 if (trace_flag) show_line("Resetting exceptions\n", 0);
3531 reset_hyphen(); /* RESET HYPHENEXCEPTIONS - 93/Nov/26 */
3535 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3538 if(eqtb[(hash_size + 3213)].cint <= 0)
3540 else if(eqtb[(hash_size + 3213)].cint > 255)
3542 else cur_lang = eqtb[(hash_size + 3213)].cint;
3546 digitsensed = false;
3552 if(digitsensed ||(cur_chr < 48)||(cur_chr > 57))
3554 if(cur_chr == 46) /* . */
3558 cur_chr = eqtb[(hash_size + 2139) + cur_chr].hh.v.RH;
3561 print_err("Nonletter");
3562 help1("(See Appendix H.)");
3571 digitsensed = false;
3576 hyf[k]= cur_chr - 48;
3593 v = new_trie_op(k - l, hyf[l], v);
3606 while((p > 0)&&(c > trie_c[p])) {
3611 if((p == 0)||(c < trie_c[p]))
3613 if(trie_ptr == trie_size){
3614 overflow("pattern memory", trie_size); /* pattern memory - NOT DYNAMIC */
3615 /* not dynamic ---- but can be set -h=... from command line in ini-TeX */
3616 return; // abort_flag set
3619 trie_r[trie_ptr]= p;
3626 trie_o[p]= min_trie_op;
3630 if(trie_o[q]!= min_trie_op)
3632 print_err("Duplicate pattern");
3633 help1("(See Appendix H.)");
3642 digitsensed = false;
3648 print_esc("patterns");
3649 help1("(See Appendix H.)");
3658 print_err("Too late for ");
3659 print_esc("patterns");
3660 help1("All patterns must be given before typesetting begins.");
3662 mem[mem_top - 12].hh.v.RH = scan_toks(false, false);
3663 flush_list(def_ref);
3666 void init_trie (void)
3669 /* integer j, k, t; */
3671 int t; /* 95/Jan/7 */
3673 op_start[0]= - (integer) min_trie_op;
3675 register integer for_end;
3679 op_start[j]= op_start[j - 1]+ trie_used[j - 1];
3680 while(j++ < for_end);
3683 register integer for_end;
3685 for_end = trie_op_ptr;
3688 trie_op_hash[j]= op_start[trie_op_lang[j]] + trie_op_val[j];
3689 while(j++ < for_end);
3692 register integer for_end;
3694 for_end = trie_op_ptr;
3697 while(trie_op_hash[j]> j){
3698 k = trie_op_hash[j];
3699 t = hyf_distance[k];
3700 hyf_distance[k]= hyf_distance[j];
3703 hyf_num[k]= hyf_num[j];
3706 hyf_next[k]= hyf_next[j];
3708 trie_op_hash[j]= trie_op_hash[k];
3711 while(j++ < for_end);
3714 register integer for_end;
3716 for_end = trie_size;
3719 while(p++ < for_end);
3721 trie_l[0]= compress_trie(trie_l[0]);
3723 register integer for_end;
3728 while(p++ < for_end);
3731 register integer for_end;
3736 while(p++ < for_end);
3742 first_fit(trie_l[0]);
3743 trie_pack(trie_l[0]);
3748 register integer for_end;
3754 trie_tro[r]= min_trie_op;
3757 while(r++ < for_end);
3762 trie_fix(trie_l[0]);
3768 trie_tro[r]= min_trie_op;
3772 } while(!(r > trie_max));
3775 trie_not_ready = false;
3780 void store_fmt_file (void)
3785 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3786 if (!is_initex) { /* redundant check 94/Feb/14 */
3787 show_line("! \\dump is performed only by INITEX\n", 1);
3789 show_line(" (Use -i on the command line)\n", 0);
3793 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3795 print_err("You can't dump inside a group");
3796 help1("`{...\\dump}' is a no-no..");
3798 if(interaction == 3) interaction = 2;
3804 if(interaction > 0) debug_help ();
3807 jump_out (); // trying to \dump inside a group
3808 // return; // drops through now
3810 } /* end of if save_ptr != 0 */
3813 print_string(" (format=");
3815 print_char(32); /* */
3816 /* print_int(eqtb[(hash_size + 3186)].cint % 100); */ /* Y2K */
3817 print_int(eqtb[(hash_size + 3186)].cint); /* 98/Oct/12 */
3819 int n= eqtb[(hash_size + 3186)].cint;
3820 sprintf(log_line, "YEAR: %ld\n", n);
3821 show_line(log_line, 0);
3823 print_char(46); /* . */
3824 print_int(eqtb[(hash_size + 3185)].cint);
3825 print_char(46); /* . */
3826 print_int(eqtb[(hash_size + 3184)].cint);
3827 print_char(41); /*)*/
3828 if(interaction == 0)selector = 18;
3831 #ifdef ALLOCATESTRING
3832 if(pool_ptr + 1 > current_pool_size)
3833 str_pool = realloc_str_pool (increment_pool_size);
3834 if(pool_ptr + 1 > current_pool_size){ /* in case it failed 94/Jan/24 */
3835 overflow("pool size", current_pool_size - init_pool_ptr); /* 97/Mar/9 */
3836 return; // abort_flag set
3839 if(pool_ptr + 1 > pool_size){
3840 overflow("pool size", pool_size - init_pool_ptr); /* pool size */
3841 return; // abort_flag set
3845 format_ident = make_string ();
3846 pack_job_name(780); /* .fmt */
3847 while(! w_open_out(fmt_file)) {
3848 prompt_file_name(1267, 780); /* format file name .fmt */
3850 print_nl(" Beginning to dump on file "); /* */
3851 slow_print(w_make_name_string(fmt_file));
3854 pool_ptr = str_start[str_ptr];
3857 slow_print(format_ident);
3858 dump_int(BEGINFMTCHECKSUM); /* magic FMT file start 4C 20 E6 15 hex */
3862 dump_int((hash_size + 4006)); /* eqtbsize */
3863 dump_int(hash_prime);
3864 /* dump_int(607); */
3865 dump_int(hyphen_prime); /* bkph */
3868 if (dumpthings(str_start[0], str_ptr + 1)
3870 if (dumpthings(str_pool[0], pool_ptr)
3874 print_string("strings of total length ");
3875 print_int(pool_ptr);
3878 dump_int(lo_mem_max);
3884 if (dumpthings(mem[p], q + 2 - p)
3887 var_used = var_used + q - p;
3888 p = q + mem[q].hh.v.LH;
3889 q = mem[q + 1].hh.v.RH;
3890 } while(!(q == rover));
3891 var_used = var_used + lo_mem_max - p;
3892 dyn_used = mem_end + 1 - hi_mem_min;
3893 if (dumpthings(mem[p], lo_mem_max + 1 - p)
3895 x = x + lo_mem_max + 1 - p;
3896 dump_int(hi_mem_min);
3898 if (dumpthings(mem[hi_mem_min], mem_end + 1 - hi_mem_min)
3900 x = x + mem_end + 1 - hi_mem_min;
3910 print_string("memory locations dumped; current usage is ");
3911 print_int(var_used);
3912 print_char(38); /* & */
3913 print_int(dyn_used);
3917 while(j < (hash_size + 3162)){
3918 if((eqtb[j].hh.v.RH == eqtb[j + 1].hh.v.RH)&&(eqtb[j
3919 ].hh.b0 == eqtb[j + 1].hh.b0)&&(eqtb[j].hh.b1 == eqtb[j +
3924 l = (hash_size + 3163);
3928 while(j < (hash_size + 3162)){
3929 if((eqtb[j].hh.v.RH != eqtb[j + 1].hh.v.RH)||(eqtb[j
3930 ].hh.b0 != eqtb[j + 1].hh.b0)||(eqtb[j].hh.b1 != eqtb[j +
3935 lab31: dump_int(l - k);
3936 if (dumpthings(eqtb[k], l - k)
3940 } while(!(k == (hash_size + 3163)));
3943 while(j < (hash_size + 4006)){
3944 if(eqtb[j].cint == eqtb[j + 1].cint)
3948 l = (hash_size + 4007);
3952 while(j < (hash_size + 4006)){
3953 if(eqtb[j].cint != eqtb[j + 1].cint)
3957 lab32: dump_int(l - k);
3958 if (dumpthings(eqtb[k], l - k)
3962 } while(!(k > (hash_size + 4006)));
3964 dump_int(write_loc);
3965 dump_int(hash_used);
3966 /* cs_count:=frozen_control_sequence-1-hash_used; */
3967 /* cs_count = (hash_size + 513) - hash_used; */
3968 cs_count = (hash_size + hash_extra + 513) - hash_used;
3969 /* cs_count = (hash_size + 780) - hash_used; */ /* ??? */
3971 sprintf(log_line, "itex cs_count %d hash_size %d hash_extra %d hash_used %d",
3972 cs_count, hash_size, hash_extra, hash_used); /* debugging */
3973 show_line(log_line, 0);
3975 /* for p <- hash_base to hash_used do */
3977 register integer for_end;
3979 for_end = hash_used;
3981 if(hash[p].v.RH != 0){
3986 sprintf(log_line, "itex cs_count++ ");
3987 show_line(log_line, 0); /* debugging */
3990 while(p++ < for_end);
3993 /* for p <- hash_used+1 to undefined_control_sequence-1 do dump_hh(hash[p]) */
3994 if (dumpthings(hash[hash_used + 1], (hash_size + 780) - hash_used)
3998 print_int(cs_count);
3999 print_string(" multiletter control sequences");
4002 if (dumpthings(font_info[0], fmem_ptr)) return;
4003 /* frozenfontptr = font_ptr; */ /* number of fonts frozen into format */
4005 if (dumpthings(font_check[0], font_ptr + 1))return;
4006 if (dumpthings(font_size[0], font_ptr + 1))return;
4007 if (dumpthings(font_dsize[0], font_ptr + 1))return;
4008 if (dumpthings(font_params[0], font_ptr + 1))return;
4009 if (dumpthings(hyphen_char[0], font_ptr + 1))return;
4010 if (dumpthings(skew_char[0], font_ptr + 1))return;
4011 if (dumpthings(font_name[0], font_ptr + 1))return;
4012 if (dumpthings(font_area[0], font_ptr + 1))return;
4013 if (dumpthings(font_bc[0], font_ptr + 1))return;
4014 if (dumpthings(font_ec[0], font_ptr + 1))return;
4015 if (dumpthings(char_base[0], font_ptr + 1))return;
4016 if (dumpthings(width_base[0], font_ptr + 1))return;
4017 if (dumpthings(height_base[0], font_ptr + 1))return;
4018 if (dumpthings(depth_base[0], font_ptr + 1))return;
4019 if (dumpthings(italic_base[0], font_ptr + 1))return;
4020 if (dumpthings(lig_kern_base[0], font_ptr + 1))return;
4021 if (dumpthings(kern_base[0], font_ptr + 1))return;
4022 if (dumpthings(exten_base[0], font_ptr + 1))return;
4023 if (dumpthings(param_base[0], font_ptr + 1))return;
4024 if (dumpthings(font_glue[0], font_ptr + 1))return;
4025 if (dumpthings(bchar_label[0], font_ptr + 1))return;
4026 if (dumpthings(font_bchar[0], font_ptr + 1))return;
4027 if (dumpthings(font_false_bchar[0], font_ptr + 1))return;
4029 register integer for_end;
4036 /* print_esc(hash[(hash_size + 524) + k].v.RH); */
4037 //print_esc(hash[(hash_size + hash_extra + 524) + k].v.RH);
4038 print_esc("");print(hash[(hash_size + hash_extra + 524) + k].v.RH);
4039 print_char(61); /* = */
4040 print_file_name(font_name[k], font_area[k], 335);
4041 if(font_size[k]!= font_dsize[k])
4043 print_string(" at ");
4044 print_scaled(font_size[k]);
4048 while(k++ < for_end);
4052 print_int(fmem_ptr - 7);
4053 print_string("words of font info for");
4054 print_int(font_ptr - 0);
4055 print_string(" preloaded font");
4057 print_char(115); /* s */
4058 dump_int(hyph_count);
4059 /* {register integer for_end; k = 0; for_end = 607; if(k <= for_end) do */
4061 register integer for_end;
4063 for_end = hyphen_prime;
4065 if(hyph_word[k]!= 0)
4068 dump_int(hyph_word[k]);
4069 dump_int(hyph_list[k]);
4071 while(k++ < for_end);
4074 print_int(hyph_count);
4075 print_string(" hyphenation exception");
4077 print_char(115); /* s */
4081 if (dumpthings(trie_trl[0], trie_max + 1)
4083 if (dumpthings(trie_tro[0], trie_max + 1)
4085 if (dumpthings(trie_trc[0], trie_max + 1)
4087 dump_int(trie_op_ptr);
4088 if (dumpthings(hyf_distance[1], trie_op_ptr)
4090 if (dumpthings(hyf_num[1], trie_op_ptr)
4092 if (dumpthings(hyf_next[1], trie_op_ptr)
4094 print_nl("Hyphenation trie of length "); /* */
4095 print_int(trie_max);
4096 print_string("has");
4097 print_int(trie_op_ptr);
4099 if(trie_op_ptr != 1)
4100 print_char(115); /* s */
4101 print_string("out of");
4102 print_int(trie_op_size);
4104 register integer for_end;
4111 print_int(trie_used[k]);
4112 print_string("for language");
4115 dump_int(trie_used[k]);
4117 while(k-- > for_end);
4119 dump_int(interaction);
4120 dump_int(format_ident);
4121 dump_int(ENDFMTCHECKSUM); /* magic checksum end of FMT file --- change ??? */
4122 eqtb[(hash_size + 3194)].cint = 0; /* tracingstats */
4125 } /* end of store_fmt_file */
4129 void init_prim (void)
4131 no_new_control_sequence = false;
4132 primitive(373, 75, (hash_size + 782)); /* lineskip */
4133 primitive(374, 75, (hash_size + 783)); /* baselineskip */
4134 primitive(375, 75, (hash_size + 784)); /* parskip */
4135 primitive(376, 75, (hash_size + 785)); /* abovedisplayskip */
4136 primitive(377, 75, (hash_size + 786)); /* belowdisplayskip */
4137 primitive(378, 75, (hash_size + 787)); /* abovedisplayshortskip */
4138 primitive(379, 75, (hash_size + 788)); /* belowdisplayshortskip */
4139 primitive(380, 75, (hash_size + 789)); /* leftskip */
4140 primitive(381, 75, (hash_size + 790)); /* rightskip */
4141 primitive(382, 75, (hash_size + 791)); /* topskip */
4142 primitive(383, 75, (hash_size + 792)); /* splittopskip */
4143 primitive(384, 75, (hash_size + 793)); /* tabskip */
4144 primitive(385, 75, (hash_size + 794)); /* spaceskip */
4145 primitive(386, 75, (hash_size + 795)); /* xspaceskip */
4146 primitive(387, 75, (hash_size + 796)); /* parfillskip */
4147 primitive(388, 76, (hash_size + 797)); /* thinmuskip */
4148 primitive(389, 76, (hash_size + 798)); /* medmuskip */
4149 primitive(390, 76, (hash_size + 799)); /* thickmuskip */
4150 primitive(395, 72, (hash_size + 1313)); /* output */
4151 primitive(396, 72, (hash_size + 1314)); /* everypar */
4152 primitive(397, 72, (hash_size + 1315)); /* everymath */
4153 primitive(398, 72, (hash_size + 1316)); /* everydisplay */
4154 primitive(399, 72, (hash_size + 1317)); /* everyhbox */
4155 primitive(400, 72, (hash_size + 1318)); /* everyvbox */
4156 primitive(401, 72, (hash_size + 1319)); /* everyjob */
4157 primitive(402, 72, (hash_size + 1320)); /* everycr */
4158 primitive(403, 72, (hash_size + 1321)); /* errhelp */
4159 primitive(417, 73, (hash_size + 3163)); /* pretolerance */
4160 primitive(418, 73, (hash_size + 3164)); /* tolerance */
4161 primitive(419, 73, (hash_size + 3165)); /* linepenalty */
4162 primitive(420, 73, (hash_size + 3166)); /* hyphenpenalty */
4163 primitive(421, 73, (hash_size + 3167)); /* exhyphenpenalty */
4164 primitive(422, 73, (hash_size + 3168)); /* clubpenalty */
4165 primitive(423, 73, (hash_size + 3169)); /* widowpenalty */
4166 primitive(424, 73, (hash_size + 3170)); /* displaywidowpenalty */
4167 primitive(425, 73, (hash_size + 3171)); /* brokenpenalty */
4168 primitive(426, 73, (hash_size + 3172)); /* binoppenalty */
4169 primitive(427, 73, (hash_size + 3173)); /* relpenalty */
4170 primitive(428, 73, (hash_size + 3174)); /* predisplaypenalty */
4171 primitive(429, 73, (hash_size + 3175)); /* postdisplaypenalty */
4172 primitive(430, 73, (hash_size + 3176)); /* interlinepenalty */
4173 primitive(431, 73, (hash_size + 3177)); /* doublehyphendemerits */
4174 primitive(432, 73, (hash_size + 3178)); /* finalhyphendemerits */
4175 primitive(433, 73, (hash_size + 3179)); /* adjdemerits */
4176 primitive(434, 73, (hash_size + 3180)); /* mag */
4177 primitive(435, 73, (hash_size + 3181)); /* delimiterfactor */
4178 primitive(436, 73, (hash_size + 3182)); /* looseness */
4179 primitive(437, 73, (hash_size + 3183)); /* time */
4180 primitive(438, 73, (hash_size + 3184)); /* day */
4181 primitive(439, 73, (hash_size + 3185)); /* month */
4182 primitive(440, 73, (hash_size + 3186)); /* year */
4183 primitive(441, 73, (hash_size + 3187)); /* showboxbreadth */
4184 primitive(442, 73, (hash_size + 3188)); /* showboxdepth */
4185 primitive(443, 73, (hash_size + 3189)); /* hbadness */
4186 primitive(444, 73, (hash_size + 3190)); /* vbadness */
4187 primitive(445, 73, (hash_size + 3191)); /* pausing */
4188 primitive(446, 73, (hash_size + 3192)); /* tracingonline */
4189 primitive(447, 73, (hash_size + 3193)); /* tracingmacros */
4190 primitive(448, 73, (hash_size + 3194)); /* tracingstats */
4191 primitive(449, 73, (hash_size + 3195)); /* tracingparagraphs */
4192 primitive(450, 73, (hash_size + 3196)); /* tracingpages */
4193 primitive(451, 73, (hash_size + 3197)); /* tracingoutput */
4194 primitive(452, 73, (hash_size + 3198)); /* tracinglostchars */
4195 primitive(453, 73, (hash_size + 3199)); /* tracingcommands */
4196 primitive(454, 73, (hash_size + 3200)); /* tracingrestores */
4197 primitive(455, 73, (hash_size + 3201)); /* uchyph */
4198 primitive(456, 73, (hash_size + 3202)); /* outputpenalty */
4199 primitive(457, 73, (hash_size + 3203)); /* maxdeadcycles */
4200 primitive(458, 73, (hash_size + 3204)); /* hangafter */
4201 primitive(459, 73, (hash_size + 3205)); /* floatingpenalty */
4202 primitive(460, 73, (hash_size + 3206)); /* globaldefs */
4203 primitive(461, 73, (hash_size + 3207)); /* fam */
4204 primitive(462, 73, (hash_size + 3208)); /* escapechar */
4205 primitive(463, 73, (hash_size + 3209)); /* defaulthyphenchar */
4206 primitive(464, 73, (hash_size + 3210)); /* defaultskewchar */
4207 primitive(465, 73, (hash_size + 3211)); /* endlinechar */
4208 primitive(466, 73, (hash_size + 3212)); /* newlinechar */
4209 primitive(467, 73, (hash_size + 3213)); /* language */
4210 primitive(468, 73, (hash_size + 3214)); /* lefthyphenmin */
4211 primitive(469, 73, (hash_size + 3215)); /* righthyphenmin */
4212 primitive(470, 73, (hash_size + 3216)); /* holdinginserts */
4213 primitive(471, 73, (hash_size + 3217)); /* errorcontextlines */
4214 primitive(475, 74, (hash_size + 3730)); /* parindent */
4215 primitive(476, 74, (hash_size + 3731)); /* mathsurround */
4216 primitive(477, 74, (hash_size + 3732)); /* lineskiplimit */
4217 primitive(478, 74, (hash_size + 3733)); /* hsize */
4218 primitive(479, 74, (hash_size + 3734)); /* vsize */
4219 primitive(480, 74, (hash_size + 3735)); /* maxdepth */
4220 primitive(481, 74, (hash_size + 3736)); /* splitmaxdepth */
4221 primitive(482, 74, (hash_size + 3737)); /* boxmaxdepth */
4222 primitive(483, 74, (hash_size + 3738)); /* hfuzz */
4223 primitive(484, 74, (hash_size + 3739)); /* vfuzz */
4224 primitive(485, 74, (hash_size + 3740)); /* delimitershortfall */
4225 primitive(486, 74, (hash_size + 3741)); /* nulldelimiterspace */
4226 primitive(487, 74, (hash_size + 3742)); /* scriptspace */
4227 primitive(488, 74, (hash_size + 3743)); /* predisplaysize */
4228 primitive(489, 74, (hash_size + 3744)); /* displaywidth */
4229 primitive(490, 74, (hash_size + 3745)); /* displayindent */
4230 primitive(491, 74, (hash_size + 3746)); /* overfullrule */
4231 primitive(492, 74, (hash_size + 3747)); /* hangindent */
4232 primitive(493, 74, (hash_size + 3748)); /* hoffset */
4233 primitive(494, 74, (hash_size + 3749)); /* voffset */
4234 primitive(495, 74, (hash_size + 3750)); /* emergencystretch */
4235 primitive(32, 64, 0); /* */
4236 primitive(47, 44, 0); /* / */
4237 primitive(505, 45, 0); /* accent */
4238 primitive(506, 90, 0); /* advance */
4239 primitive(507, 40, 0); /* afterassignment */
4240 primitive(508, 41, 0); /* aftergroup */
4241 primitive(509, 61, 0); /* begingroup */
4242 primitive(510, 16, 0); /* char */
4243 primitive(501, 107, 0); /* csname */
4244 primitive(511, 15, 0); /* delimiter */
4245 primitive(512, 92, 0); /* divide */
4246 primitive(502, 67, 0); /* endcsname */
4247 primitive(513, 62, 0); /* endgroup */
4248 /* hash[(hash_size + 516)].v.RH = 513; */
4249 hash[(hash_size + hash_extra + 516)].v.RH = 513; /* endgroup */
4250 /* eqtb[(hash_size + 516)]= eqtb[cur_val]; */
4251 eqtb[(hash_size + hash_extra + 516)]= eqtb[cur_val];
4252 primitive(514, 102, 0); /* expandafter */
4253 primitive(515, 88, 0); /* font */
4254 primitive(516, 77, 0); /* fontdimen */
4255 primitive(517, 32, 0); /* halign */
4256 primitive(518, 36, 0); /* hrule */
4257 primitive(519, 39, 0); /* ignorespaces */
4258 primitive(327, 37, 0); /* insert */
4259 primitive(348, 18, 0); /* mark */
4260 primitive(520, 46, 0); /* mathaccent */
4261 primitive(521, 17, 0); /* mathchar */
4262 primitive(522, 54, 0); /* mathchoice */
4263 primitive(523, 91, 0); /* multiply */
4264 primitive(524, 34, 0); /* noalign */
4265 primitive(525, 65, 0); /* noboundary */
4266 primitive(526, 103, 0); /* noexpand */
4267 primitive(332, 55, 0); /* nonscript */
4268 primitive(527, 63, 0); /* omit */
4269 primitive(405, 84, 0); /* parshape */
4270 primitive(528, 42, 0); /* penalty */
4271 primitive(529, 80, 0); /* prevgraf */
4272 primitive(530, 66, 0); /* radical */
4273 primitive(531, 96, 0); /* read */
4274 primitive(532, 0, 256); /* primitive("relax",relax,256); */
4275 /* hash[(hash_size + 521)].v.RH = 532; */
4276 hash[(hash_size + hash_extra + 521)].v.RH = 532; /* read */
4277 /* eqtb[(hash_size + 521)]= eqtb[cur_val]; */
4278 eqtb[(hash_size + hash_extra + 521)]= eqtb[cur_val];
4279 primitive(533, 98, 0); /* setbox */
4280 primitive(534, 109, 0); /* the */
4281 primitive(404, 71, 0); /* toks */
4282 primitive(349, 38, 0); /* vadjust */
4283 primitive(535, 33, 0); /* valign */
4284 primitive(536, 56, 0); /* vcenter */
4285 primitive(537, 35, 0); /* vrule */
4286 primitive(594, 13, 256); /* par */
4288 par_token = 4095 + par_loc;
4289 primitive(626, 104, 0); /* input */
4290 primitive(627, 104, 1); /* endinput */
4291 primitive(628, 110, 0); /* topmark */
4292 primitive(629, 110, 1); /* firstmark */
4293 primitive(630, 110, 2); /* botmark */
4294 primitive(631, 110, 3); /* splitfirstmark */
4295 primitive(632, 110, 4); /* splitbotmark */
4296 primitive(473, 89, 0); /* count */
4297 primitive(497, 89, 1); /* dimen */
4298 primitive(392, 89, 2); /* skip */
4299 primitive(393, 89, 3); /* muskip */
4300 primitive(665, 79, 102); /* spacefactor */
4301 primitive(666, 79, 1); /* prevdepth */
4302 primitive(667, 82, 0); /* dead_cycles */
4303 primitive(668, 82, 1); /* insert_penalties */
4304 primitive(669, 83, 1); /* wd */
4305 primitive(670, 83, 3); /* ht */
4306 primitive(671, 83, 2); /* dp */
4307 primitive(672, 70, 0); /* last_penalty */
4308 primitive(673, 70, 1); /* last_kern */
4309 primitive(674, 70, 2); /* lastskip */
4310 primitive(675, 70, 3); /* inputlineno */
4311 primitive(676, 70, 4); /* badness */
4312 primitive(732, 108, 0); /* number */
4313 primitive(733, 108, 1); /* romannumeral */
4314 primitive(734, 108, 2); /* string */
4315 primitive(735, 108, 3); /* meaning */
4316 primitive(736, 108, 4); /* font_name */
4317 primitive(737, 108, 5); /* job_name */
4318 primitive(753, 105, 0); /* if */
4319 primitive(754, 105, 1); /* ifcat */
4320 primitive(755, 105, 2); /* ifnum */
4321 primitive(756, 105, 3); /* ifdim */
4322 primitive(757, 105, 4); /* ifodd */
4323 primitive(758, 105, 5); /* ifvmode */
4324 primitive(759, 105, 6); /* ifhmode */
4325 primitive(760, 105, 7); /* ifmmode */
4326 primitive(761, 105, 8); /* ifinner */
4327 primitive(762, 105, 9); /* ifvoid */
4328 primitive(763, 105, 10); /* ifhbox */
4329 primitive(764, 105, 11); /* ifvbox */
4330 primitive(765, 105, 12); /* ifx */
4331 primitive(766, 105, 13); /* ifeof */
4332 primitive(767, 105, 14); /* iftrue */
4333 primitive(768, 105, 15); /* iffalse */
4334 primitive(769, 105, 16); /* ifcase */
4335 primitive(770, 106, 2); /* fi */
4336 /* hash[(hash_size + 518)].v.RH = 770; */
4337 hash[(hash_size + hash_extra + 518)].v.RH = 770; /* fi */
4338 /* eqtb[(hash_size + 518)]= eqtb[cur_val]; */
4339 eqtb[(hash_size + hash_extra + 518)]= eqtb[cur_val];
4340 primitive(771, 106, 4); /* or */
4341 primitive(772, 106, 3); /* else */
4342 primitive(795, 87, 0); /* nullfont */
4343 /* hash[(hash_size + 524)].v.RH = 795; */ /* hash[frozen_null_font] */
4344 hash[(hash_size + hash_extra + 524)].v.RH = 795; /* nullfont */
4345 /* eqtb[(hash_size + 524)]= eqtb[cur_val]; */
4346 eqtb[(hash_size + hash_extra + 524)]= eqtb[cur_val];
4347 primitive(892, 4, 256); /* span */
4348 /* primitive("span",tab_mark,span_code); */
4349 primitive(893, 5, 257); /* cr */
4350 /* primitive("cr",car_ret,cr_code); */
4351 /* hash[(hash_size + 515)].v.RH = 893; */
4352 hash[(hash_size + hash_extra + 515)].v.RH = 893; /* cr */
4353 /* eqtb[(hash_size + 515)]= eqtb[cur_val]; */
4354 eqtb[(hash_size + hash_extra + 515)]= eqtb[cur_val];
4355 primitive(894, 5, 258); /* cr cr */
4356 /* hash[(hash_size + 519)].v.RH = 895; */
4357 hash[(hash_size + hash_extra + 519)].v.RH = 895; /* endtemplate */
4358 /* hash[(hash_size + 520)].v.RH = 895; */
4359 hash[(hash_size + hash_extra + 520)].v.RH = 895; /* endtemplate */
4360 /* eqtb[(hash_size + 520)].hh.b0 = 9; */
4361 eqtb[(hash_size + hash_extra + 520)].hh.b0 = 9;
4362 /* eqtb[(hash_size + 520)].hh.v.RH = mem_top - 11; */
4363 eqtb[(hash_size + hash_extra + 520)].hh.v.RH = mem_top - 11;
4364 /* eqtb[(hash_size + 520)].hh.b1 = 1; */
4365 eqtb[(hash_size + hash_extra + 520)].hh.b1 = 1;
4366 /* eqtb[(hash_size + 519)]= eqtb[(hash_size + 520)]; */
4367 eqtb[(hash_size + hash_extra + 519)]=
4368 eqtb[(hash_size + hash_extra + 520)];
4369 /* eqtb[(hash_size + 519)].hh.b0 = 115; */
4370 eqtb[(hash_size + hash_extra + 519)].hh.b0 = 115;
4371 primitive(964, 81, 0); /* pagegoal */
4372 primitive(965, 81, 1); /* pagetotal */
4373 primitive(966, 81, 2); /* pagestretch */
4374 primitive(967, 81, 3); /* pagefilstretch */
4375 primitive(968, 81, 4); /* pagefillstretch */
4376 primitive(969, 81, 5); /* pagefilllstretch */
4377 primitive(970, 81, 6); /* pageshrink */
4378 primitive(971, 81, 7); /* pagedepth */
4379 primitive(1019, 14, 0); /* end */
4380 primitive(1020, 14, 1); /* dump */
4381 primitive(1021, 26, 4); /* hskip */
4382 primitive(1022, 26, 0); /* hfil */
4383 primitive(1023, 26, 1); /* hfill */
4384 primitive(1024, 26, 2); /* hss */
4385 primitive(1025, 26, 3); /* hfilneg */
4386 primitive(1026, 27, 4); /* vskip */
4387 primitive(1027, 27, 0); /* vfil */
4388 primitive(1028, 27, 1); /* vfill */
4389 primitive(1029, 27, 2); /* vss */
4390 primitive(1030, 27, 3); /* vfilneg */
4391 primitive(333, 28, 5); /* mskip */
4392 primitive(337, 29, 1); /* kern */
4393 primitive(339, 30, 99); /* mkern */
4394 primitive(1048, 21, 1); /* moveleft */
4395 primitive(1049, 21, 0); /* moveright */
4396 primitive(1050, 22, 1); /* raise */
4397 primitive(1051, 22, 0); /* lower */
4398 primitive(406, 20, 0); /* box */
4399 primitive(1052, 20, 1); /* copy */
4400 primitive(1053, 20, 2); /* lastbox */
4401 primitive(959, 20, 3); /* vsplit */
4402 primitive(1054, 20, 4); /* vtop */
4403 primitive(961, 20, 5); /* vbox */
4404 primitive(1055, 20, 106); /* hbox */
4405 primitive(1056, 31, 99); /* ship_out */
4406 primitive(1057, 31, 100); /* leaders */
4407 primitive(1058, 31, 101); /* cleaders */
4408 primitive(1059, 31, 102); /* xleaders */
4409 primitive(1074, 43, 1); /* indent */
4410 primitive(1075, 43, 0); /* noindent */
4411 primitive(1084, 25, 12); /* unpenalty */
4412 primitive(1085, 25, 11); /* unkern */
4413 primitive(1086, 25, 10); /* unskip */
4414 primitive(1087, 23, 0); /* unhbox */
4415 primitive(1088, 23, 1); /* unhcopy */
4416 primitive(1089, 24, 0); /* unvbox */
4417 primitive(1090, 24, 1); /* unvcopy */
4418 primitive(45, 47, 1); /* - */
4419 primitive(346, 47, 0); /* discretionary */
4420 primitive(1121, 48, 0); /* eqno */
4421 primitive(1122, 48, 1); /* leqno */
4422 primitive(860, 50, 16); /* mathord */
4423 primitive(861, 50, 17); /* mathop */
4424 primitive(862, 50, 18); /* mathbin */
4425 primitive(863, 50, 19); /* mathrel */
4426 primitive(864, 50, 20); /* mathopen */
4427 primitive(865, 50, 21); /* mathclose */
4428 primitive(866, 50, 22); /* mathpunct */
4429 primitive(867, 50, 23); /* mathinner */
4430 primitive(869, 50, 26); /* underline */
4431 primitive(868, 50, 27); /* overline */
4432 primitive(1123, 51, 0); /* displaylimits */
4433 primitive(872, 51, 1); /* limits */
4434 primitive(873, 51, 2); /* nolimits */
4435 primitive(855, 53, 0); /* displaystyle */
4436 primitive(856, 53, 2); /* textstyle */
4437 primitive(857, 53, 4); /* scriptstyle */
4438 primitive(858, 53, 6); /* scriptscriptstyle */
4439 primitive(1141, 52, 0); /* above */
4440 primitive(1142, 52, 1); /* over */
4441 primitive(1143, 52, 2); /* atop */
4442 primitive(1144, 52, 3); /* abovewithdelims */
4443 primitive(1145, 52, 4); /* overwithdelims */
4444 primitive(1146, 52, 5); /* atopwithdelims */
4445 primitive(870, 49, 30); /* left */
4446 primitive(871, 49, 31); /* right */
4447 /* hash[(hash_size + 517)].v.RH = 871; */
4448 hash[(hash_size + hash_extra + 517)].v.RH = 871; /* right */
4449 /* eqtb[(hash_size + 517)]= eqtb[cur_val]; */
4450 eqtb[(hash_size + hash_extra + 517)]= eqtb[cur_val];
4451 primitive(1165, 93, 1); /* long */
4452 primitive(1166, 93, 2); /* outer */
4453 primitive(1167, 93, 4); /* global */
4454 primitive(1168, 97, 0); /* def */
4455 primitive(1169, 97, 1); /* gdef */
4456 primitive(1170, 97, 2); /* edef */
4457 primitive(1171, 97, 3); /* xdef */
4458 primitive(1185, 94, 0); /* let */
4459 primitive(1186, 94, 1); /* futurelet */
4460 primitive(1187, 95, 0); /* chardef */
4461 primitive(1188, 95, 1); /* mathchardef */
4462 primitive(1189, 95, 2); /* countdef */
4463 primitive(1190, 95, 3); /* dimendef */
4464 primitive(1191, 95, 4); /* skipdef */
4465 primitive(1192, 95, 5); /* muskipdef */
4466 primitive(1193, 95, 6); /* toksdef */
4467 primitive(412, 85, (hash_size + 1883)); /* catcode */
4468 primitive(416, 85, (hash_size + 2907)); /* mathcode */
4469 primitive(413, 85, (hash_size + 2139)); /* lccode */
4470 primitive(414, 85, (hash_size + 2395)); /* uccode */
4471 primitive(415, 85, (hash_size + 2651)); /* sfcode */
4472 primitive(474, 85, (hash_size + 3474)); /* delcode */
4473 primitive(409, 86, (hash_size + 1835)); /* textfont */
4474 primitive(410, 86, (hash_size + 1851)); /* scriptfont */
4475 primitive(411, 86, (hash_size + 1867)); /* scriptscriptfont */
4476 primitive(935, 99, 0); /* hyphenation */
4477 primitive(947, 99, 1); /* patterns */
4478 primitive(1211, 78, 0); /* hyphen_char */
4479 primitive(1212, 78, 1); /* skew_char */
4480 primitive(272, 100, 0); /* batchmode */
4481 primitive(273, 100, 1); /* nonstopmode */
4482 primitive(274, 100, 2); /* scrollmode */
4483 primitive(1221, 100, 3); /* errorstopmode */
4484 primitive(1222, 60, 1); /* openin */
4485 primitive(1223, 60, 0); /* closein */
4486 primitive(1224, 58, 0); /* message */
4487 primitive(1225, 58, 1); /* errmessage */
4488 primitive(1231, 57, (hash_size + 2139)); /* lowercase */
4489 primitive(1232, 57, (hash_size + 2395)); /* uppercase */
4490 primitive(1233, 19, 0); /* show */
4491 primitive(1234, 19, 1); /* show_box */
4492 primitive(1235, 19, 2); /* showthe */
4493 primitive(1236, 19, 3); /* showlists */
4494 primitive(1279, 59, 0); /* openout */
4495 primitive(591, 59, 1); /* write */
4496 write_loc = cur_val;
4497 primitive(1280, 59, 2); /* closeout */
4498 primitive(1281, 59, 3); /* special */
4499 primitive(1282, 59, 4); /* immediate */
4500 primitive(1283, 59, 5); /* setlanguage */
4501 no_new_control_sequence = true;
4505 #pragma optimize("s", off) /* 96/Sep/12 */
4506 /* #pragma optimize("1", off) */
4507 #pragma optimize("t", on) /* 96/Sep/12 */
4508 /* #pragma optimize("2", on) */