1 /* Copyright 1992 Karl Berry
2 Copyright 2007 TeX Users Group
3 Copyright 2014 Clerk Ma
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 #pragma warning(disable:4115) // kill rpcasync.h complaint
27 #define MYLIBAPI __declspec(dllexport)
32 #pragma warning(disable:4996)
33 #pragma warning(disable:4131) // old style declarator
34 #pragma warning(disable:4135) // conversion between different integral types
35 #pragma warning(disable:4127) // conditional expression is constant
43 #pragma warning(disable:4244) /* 96/Jan/10 */
45 #include <time.h> // needed for clock_t
47 /* #define CHECKPOOL */ /* debugging only */
49 #define ENDFMTCHECKSUM 69069L
51 #define BEGINFMTCHECKSUM 367403084L
53 extern clock_t start_time, main_time, finish_time; /* in local.c */
55 /* imported from pascal.h */
56 /* localized here to avoid conflict with io.h in other code */
58 #define read(f, b) ((b) = getc (f))
59 #define readln(f) { register int c; while ((c = getc (f)) != '\n' && c != EOF); }
60 /* #define readln(f) { while (getc (f) >= ' '); } ? use fgets ? */
63 void do_initex (void); /* later in this file */
66 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
68 void initialize (void)
72 integer flag; /* bkph */
73 #ifndef ALLOCATEHYPHEN
77 /* We already initialized xchr if we are using non_ascii setup */
81 /* Normally, there is no translation of character code numbers */
84 register integer for_end;
89 /* xchr[i]= chr(i); */
90 xchr[i]= (char) i; /* 95/Jan/7 */
94 /* This is a kind of joke, since the characters are given as numeric codes ! */
194 register integer for_end;
199 while(i++ < for_end);
203 register integer for_end;
208 while(i++ < for_end);
210 #endif /* end of JOKE */
211 } /* end of plain ASCII case (otherwise have read in xchr vector before) */
213 /* Fill in background of `delete' for inverse mapping */
216 register integer for_end;
220 do xord[chr(i)] = 127;
221 while(i++ < for_end);
226 register integer for_end;
230 do xord[xchr[i]] = i;
231 while(i++ < for_end);
235 register integer for_end;
239 do xord[xchr[i]] = i;
240 while(i++ < for_end);
244 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
245 /* Now invert the xchr mapping to get xord mapping */
248 register integer for_end;
252 do xord[xchr[i]] = (char) i;
253 while(i++ < for_end);
256 xord[127]= 127; /* hmm, a fixed point ? why ? */
258 flag = 0; /* 93/Dec/28 - bkph */
259 if (trace_flag != 0) {
260 for (k = 0; k < 256; k++) /* entries in xord / xchr */
265 if (flag) { /* 127 here means mapping undefined */
266 show_line("Inverted mapping xord[] pairs:\n", 0);
267 for (k = 0; k < 256; k++) { /* entries in xord / xchr */
269 sprintf(log_line, "%d => %d\n", k, xord[k]);
270 show_line(log_line, 0);
275 if (interaction < 0) /* may now set in local.c bkph */
276 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
278 deletions_allowed = true;
279 set_box_allowed = true;
282 use_err_help = false;
284 OK_to_interrupt = true;
286 /* darn, need to know mem_top, mem_max etc for the following ... */
289 /* waslomax = mem_min; */
291 /* washimin = mem_max; */
300 cur_list.aux_field.cint = ignore_depth;
302 /* *********************************************************************** */
303 /* cur_list .lhmfield = 0; */ /* removed in 3.14159 */
304 /* cur_list .rhmfield = 0; */ /* removed in 3.14159 */
305 /* *********************************************************************** */
309 page_tail = mem_top - 2;
311 if (is_initex) /* in iniTeX we did already allocate mem [] */
313 mem[mem_top - 2].hh.v.RH = 0;
314 /* last_glue = 262143L; */ /* NO! */
315 last_glue = empty_flag;
320 /* from int_base to eqtb_size */
322 register integer for_end;
323 k = (hash_size + 3163);
324 for_end = (hash_size + 4006);
327 while(k++ < for_end);
329 no_new_control_sequence = true;
330 hash[514].v.LH = 0; /* next(hash_base):= 0 */
331 hash[514].v.RH = 0; /* text(hash_base):= 0 */
332 /* 514 + hash_size + 266 = hashbase + hashsize + 10 + font_max */
333 /* for k <- hashbase+1 to undefined_control_sequence - 1 do ... p.257 */
335 register integer for_end;
337 for_end = (hash_size + 780);
339 do hash[k]= hash[514];
340 while(k++ < for_end);
358 register integer for_end;
363 while(k++ < for_end);
370 register integer for_end;
374 do font_used[k]= false;
375 while(k++ < for_end);
377 null_character.b0 = 0;
378 null_character.b1 = 0;
379 null_character.b2 = 0;
380 null_character.b3 = 0;
386 doing_leaders = false;
389 half_buf = dvi_buf_size / 2;
390 dvi_limit = dvi_buf_size;
394 /* down_ptr:=null; right_ptr:=null; l.12027 */
400 empty_field.v.RH = 0;
401 empty_field.v.LH = 0;
402 null_delimiter.b0 = 0;
403 null_delimiter.b1 = 0;
404 null_delimiter.b2 = 0;
405 null_delimiter.b3 = 0;
412 /* *not* OK with ALLOCATEHYPHEN, since may not be allocated yet */
413 #ifndef ALLOCATEHYPHEN
414 /* {register integer for_end; z = 0; for_end = 607; if(z <= for_end) do */
416 register integer for_end;
418 for_end = hyphen_prime;
424 while(z++ < for_end);
428 output_active = false;
429 insert_penalties = 0;
430 ligature_present = false;
431 cancel_boundary = false;
436 long_help_seen = false;
439 register integer for_end;
443 do write_open[k]= false;
444 while(k++ < for_end);
449 /* initex stuff split off for convenience of optimization adjustments */
450 if (is_initex) do_initex ();
452 /* trap the -i on command line situation if INITEX was NOT defined */
454 show_line("Sorry, somebody forgot to make an INITEX!\n", 1);
456 #endif /* not INITEX */
459 /* do the part of initialize() that requires mem_top, mem_max or mem[] */
460 /* do this part after allocating main memory */
463 void initialize_aux(void) {
467 /* waslomax = mem_min; */
469 /* washimin = mem_max; */
474 /* max_nest_stack = 0; */
478 cur_list.aux_field.cint = ignore_depth;
481 /* shown_mode = 0; */
482 /* page_contents = 0; */
483 page_tail = mem_top - 2;
484 //mem[mem_top - 2].hh.v.RH = 0;
487 #endif // end of ifdef ALLOCATEMAIN
489 void line_break_ (integer finalwidowpenalty)
490 {/* 30 31 32 33 34 35 22 */
493 halfword q, r, s, prevs;
494 internal_font_number f;
495 /* small_number j; */
496 int j; /* 95/Jan/7 */
497 /* unsigned char c; */
498 unsigned int c; /* 95/Jan/7 */
500 /* savedbadness = 0; */ /* 96/Feb/9 */
501 pack_begin_line = mode_line;
502 mem[mem_top - 3].hh.v.RH = mem[head].hh.v.RH;
503 if((tail >= hi_mem_min))
505 mem[tail].hh.v.RH = new_penalty(10000);
506 tail = mem[tail].hh.v.RH;
508 else if(mem[tail].hh.b0 != 10)
510 mem[tail].hh.v.RH = new_penalty(10000);
511 tail = mem[tail].hh.v.RH;
515 mem[tail].hh.b0 = 12;
516 delete_glue_ref(mem[tail + 1].hh.v.LH);
517 flush_node_list(mem[tail + 1].hh.v.RH);
518 mem[tail + 1].cint = 10000;
520 mem[tail].hh.v.RH = new_param_glue(14);
521 /* *********************************************************************** */
522 /* following is new in 3.14159 */
523 init_cur_lang = prev_graf % 65536L;
524 /* init_cur_lang = prev_graf & 65535L; */ /* last 16 bits */
525 init_l_hyf = prev_graf / 4194304L; /* 2^22 */
526 /* init_l_hyf = prev_graf >> 22; */ /* top 10 bits */
527 init_r_hyf =(prev_graf / 65536L)% 64;
528 /* init_r_hyf =(prev_graf >> 16)& 65; */ /* next to last 6 bits */
529 /* *********************************************************************** */
531 noshrinkerroryet = true;
532 if((mem[eqtb[(hash_size + 789)].hh.v.RH].hh.b1 != 0)&&
533 (mem[eqtb[(hash_size + 789)].hh.v.RH + 3].cint != 0))
535 eqtb[(hash_size + 789)].hh.v.RH =
536 finite_shrink(eqtb[(hash_size + 789)].hh.v.RH);
538 if((mem[eqtb[(hash_size + 790)].hh.v.RH].hh.b1 != 0)&&
539 (mem[eqtb[(hash_size + 790)].hh.v.RH + 3].cint != 0))
541 eqtb[(hash_size + 790)].hh.v.RH =
542 finite_shrink(eqtb[(hash_size + 790)].hh.v.RH);
544 q = eqtb[(hash_size + 789)].hh.v.RH;
545 r = eqtb[(hash_size + 790)].hh.v.RH;
546 background[1]= mem[q + 1].cint + mem[r + 1].cint;
551 background[2 + mem[q].hh.b0]= mem[q + 2].cint;
552 background[2 + mem[r].hh.b0]= background[2 + mem[r].hh.b0]+
554 background[6]= mem[q + 3].cint + mem[r + 3].cint;
555 minimum_demerits = 1073741823L; /* 2^30 - 1 */ /* 40000000 hex - 1 */
556 minimal_demerits[3]= 1073741823L;
557 minimal_demerits[2]= 1073741823L;
558 minimal_demerits[1]= 1073741823L;
559 minimal_demerits[0]= 1073741823L;
560 if(eqtb[(hash_size + 1312)].hh.v.RH == 0)
561 if(eqtb[(hash_size + 3747)].cint == 0)
563 last_special_line = 0;
564 second_width = eqtb[(hash_size + 3733)].cint;
569 last_special_line = abs(eqtb[(hash_size + 3204)].cint);
570 if(eqtb[(hash_size + 3204)].cint < 0)
572 first_width = eqtb[(hash_size + 3733)].cint -
573 abs(eqtb[(hash_size + 3747)].cint);
574 if(eqtb[(hash_size + 3747)].cint >= 0)
575 first_indent = eqtb[(hash_size + 3747)].cint;
576 else first_indent = 0;
577 second_width = eqtb[(hash_size + 3733)].cint;
582 first_width = eqtb[(hash_size + 3733)].cint;
584 second_width = eqtb[(hash_size + 3733)].cint -
585 abs(eqtb[(hash_size + 3747)].cint);
586 if(eqtb[(hash_size + 3747)].cint >= 0)
587 second_indent = eqtb[(hash_size + 3747)].cint;
588 else second_indent = 0;
593 last_special_line = mem[eqtb[(hash_size + 1312)].hh.v.RH].hh.v.LH - 1;
594 second_width = mem[eqtb[(hash_size + 1312)].hh.v.RH + 2 *(last_special_line + 1)
596 second_indent = mem[eqtb[(hash_size + 1312)].hh.v.RH + 2 * last_special_line + 1]
599 /* if looseness=0 then easy_line:=last_special_line */
600 if(eqtb[(hash_size + 3182)].cint == 0)
601 easyline = last_special_line;
602 /* else easyline = 262143L; */ /* NO! */
603 else easyline = empty_flag;
604 /* threshold:=pretolerance; */
605 threshold = eqtb[(hash_size + 3163)].cint;
610 /* if tracing_paragraphs>0 then */
611 if(eqtb[(hash_size + 3195)].cint > 0)
614 print_nl("@firstpass");
619 first_pass_count++; /* 96 Feb 9 */
622 /* threshold:=tolerance; second_pass:=true; */
623 threshold = eqtb[(hash_size + 3164)].cint;
625 /* final_pass:=(emergency_stretch<=0); */
626 final_pass =(eqtb[(hash_size + 3750)].cint <= 0);
629 if(eqtb[(hash_size + 3195)].cint > 0)
634 /* if threshold>inf_bad then threshold:=inf_bad; */
635 if(threshold > 10000)
641 if (is_initex) { /* bkph */
642 if(trie_not_ready)init_trie ();
645 /* ********************************************************************* */
646 /* following has changed in 3.14159 */
648 cur_lang = init_cur_lang;
649 /* lhyf = cur_list .lhmfield; */
651 /* rhyf = cur_list .rhmfield; */
653 /* ********************************************************************* */
658 mem[q].hh.v.RH = mem_top - 7;
659 mem[q + 1].hh.v.RH = 0;
660 mem[q + 1].hh.v.LH = prev_graf + 1;
662 mem[mem_top - 7].hh.v.RH = q;
663 active_width[1]= background[1];
664 active_width[2]= background[2];
665 active_width[3]= background[3];
666 active_width[4]= background[4];
667 active_width[5]= background[5];
668 active_width[6]= background[6];
669 /* passive:=null; printed_node:=temp_head; pass_number:=0; */
671 printed_node = mem_top - 3;
673 font_in_short_display = 0;
674 cur_p = mem[mem_top - 3].hh.v.RH;
677 /* while (cur_p<>null)and(link(active)<>last_active) do */
678 while((cur_p != 0)&&(mem[mem_top - 7].hh.v.RH != mem_top - 7))
680 if((cur_p >= hi_mem_min))
684 f = mem[cur_p].hh.b0;
685 active_width[1]= active_width[1]+ font_info[width_base[f]+
686 font_info[char_base[f]+ mem[cur_p].hh.b1].qqqq.b0].cint
688 cur_p = mem[cur_p].hh.v.RH;
689 } while(!(!(cur_p >= hi_mem_min)));
691 switch(mem[cur_p].hh.b0)
695 active_width[1]= active_width[1]+ mem[cur_p + 1].cint;
698 if(mem[cur_p].hh.b1 == 4)
700 cur_lang = mem[cur_p + 1].hh.v.RH; /* ASCII_code */
701 lhyf = mem[cur_p + 1].hh.b0;
702 rhyf = mem[cur_p + 1].hh.b1;
709 if((prevp >= hi_mem_min))
711 else if((mem[prevp].hh.b0 < 9))
713 /* *********************************************************************** */
714 /* following is new in 3.14159 */
715 else if((mem[prevp].hh.b0 == 11)&&(mem[prevp].hh.b1
718 /* *********************************************************************** */
720 if((mem[mem[cur_p + 1].hh.v.LH].hh.b1 != 0)&&(mem[
721 mem[cur_p + 1].hh.v.LH + 3].cint != 0))
723 mem[cur_p + 1].hh.v.LH = finite_shrink(mem[cur_p + 1].hh.v.LH);
725 q = mem[cur_p + 1].hh.v.LH;
726 active_width[1]= active_width[1]+ mem[q + 1].cint;
727 active_width[2 + mem[q].hh.b0]= active_width[2 + mem[q]
728 .hh.b0]+ mem[q + 2].cint;
729 active_width[6]= active_width[6]+ mem[q + 3].cint;
730 if(second_pass && autobreaking)
733 s = mem[prevs].hh.v.RH;
737 if((s >= hi_mem_min))
742 else if(mem[s].hh.b0 == 6)
743 if(mem[s + 1].hh.v.RH == 0)
747 q = mem[s + 1].hh.v.RH;
751 else if((mem[s].hh.b0 == 11)&&(mem[s].hh.b1 ==
754 else if(mem[s].hh.b0 == 8)
756 if(mem[s].hh.b1 == 4)
758 cur_lang = mem[s + 1].hh.v.RH; /* ASCII_code */
759 lhyf = mem[s + 1].hh.b0;
760 rhyf = mem[s + 1].hh.b1;
765 if(eqtb[(hash_size + 2139) + c].hh.v.RH != 0)
766 /* signed unsigned mismatch ? (c is unsigned) */
767 if((eqtb[(hash_size + 2139) + c].hh.v.RH == c)||
768 (eqtb[(hash_size + 3201)].cint > 0))
772 s = mem[prevs].hh.v.RH;
774 lab32: hyf_char = hyphen_char[hf];
775 /* if hyf_char<0 then goto done1; */
776 if(hyf_char < 0) goto lab31;
777 /* if hyf_char>255 then goto done1; */
778 if(hyf_char > 255) goto lab31; /* ? */
780 if(lhyf + rhyf > 63) goto lab31;
783 if((s >= hi_mem_min)) {
784 if(mem[s].hh.b0 != hf)
786 hyfbchar = mem[s].hh.b1;
787 c = hyfbchar; /* unsigned char c; */
788 if(eqtb[(hash_size + 2139) + c].hh.v.RH == 0)
795 /* long to short ... */
796 hc[hn]= eqtb[(hash_size + 2139) + c].hh.v.RH;
797 hyfbchar = 256; /* special mark */
799 else if(mem[s].hh.b0 == 6)
801 if(mem[s + 1].hh.b0 != hf)
803 /* j:=hn; q:=lig_ptr(s); l.17554 */
805 q = mem[s + 1].hh.v.RH;
806 /* if q>null then hyf_bchar:=character(q); l.17554 BUG ??? */
808 if(q != 0) /* 94/Mar/23 BUG FIX */
809 hyfbchar = mem[q].hh.b1;
810 /* while q>null do l.17555 BUG ??? */
812 while(q != 0){ /* 94/Mar/23 BUG FIX */
814 if(eqtb[(hash_size + 2139) + c].hh.v.RH == 0)
820 /* long to short ... */
821 hc[j]= eqtb[(hash_size + 2139) + c].hh.v.RH;
826 if(odd(mem[s].hh.b1))
827 hyfbchar = font_bchar[hf];
828 else hyfbchar = 256; /* special mark */
830 else if((mem[s].hh.b0 == 11)&&(mem[s].hh.b1 ==
834 /* ******************************************************************** */
835 hyfbchar = font_bchar[hf]; /* new code in 3.14159 */
836 /* ******************************************************************** */
845 if(!((s >= hi_mem_min)))
851 if(mem[s].hh.b1 != 0)
876 /* ******************************************************************* */
877 if(mem[cur_p].hh.b1 == 1)/* change in 3.14159 */
878 /* ******************************************************************* */
880 if(!(mem[cur_p].hh.v.RH >= hi_mem_min)&& autobreaking)
881 if(mem[mem[cur_p].hh.v.RH].hh.b0 == 10)
883 active_width[1]= active_width[1]+ mem[cur_p + 1].cint;
885 /* ******************************************************************* */
886 /* change in 3.14159 */
887 else active_width[1]= active_width[1]+ mem[cur_p + 1].cint;
888 /* ******************************************************************* */
892 f = mem[cur_p + 1].hh.b0;
893 active_width[1]= active_width[1]+ font_info[width_base[f]+
894 font_info[char_base[f]+ mem[cur_p + 1].hh.b1].qqqq.b0]
900 s = mem[cur_p + 1].hh.v.LH;
903 try_break(eqtb[(hash_size + 3167)].cint, 1);
907 if((s >= hi_mem_min))
910 disc_width = disc_width + font_info[width_base[f]+ font_info
911 [ char_base[f]+ mem[s].hh.b1].qqqq.b0].cint;
913 else switch(mem[s].hh.b0)
916 f = mem[s + 1].hh.b0;
917 disc_width = disc_width + font_info[width_base[f]+
918 font_info[char_base[f]+ mem[s + 1].hh.b1].qqqq.b0
926 disc_width = disc_width + mem[s + 1].cint;
930 confusion(931); /* disc3 */
931 return; // abort_flag set
937 active_width[1]= active_width[1]+ disc_width;
938 try_break(eqtb[(hash_size + 3166)].cint, 1);
939 active_width[1]= active_width[1]- disc_width;
941 r = mem[cur_p].hh.b1;
942 s = mem[cur_p].hh.v.RH;
944 if((s >= hi_mem_min))
947 active_width[1]= active_width[1]+ font_info[width_base[f
948 ]+ font_info[char_base[f]+ mem[s].hh.b1].qqqq.b0]
951 else switch(mem[s].hh.b0)
954 f = mem[s + 1].hh.b0;
955 active_width[1]= active_width[1]+ font_info[width_base[
956 f]+ font_info[char_base[f]+ mem[s + 1].hh.b1].qqqq
964 active_width[1]= active_width[1]+ mem[s + 1].cint;
968 confusion(932); /* disc4 */
969 return; // abort_flag set
983 autobreaking =(mem[cur_p].hh.b1 == 1);
985 if(!(mem[cur_p].hh.v.RH >= hi_mem_min)&& autobreaking)
986 if(mem[mem[cur_p].hh.v.RH].hh.b0 == 10)
988 active_width[1]= active_width[1]+ mem[cur_p + 1].cint;
993 try_break(mem[cur_p + 1].cint, 0);
1002 confusion(930); /* paragraph */
1003 return; // abort_flag set
1008 cur_p = mem[cur_p].hh.v.RH;
1013 try_break(-10000, 1);
1014 if(mem[mem_top - 7].hh.v.RH != mem_top - 7)
1016 r = mem[mem_top - 7].hh.v.RH;
1017 fewest_demerits = 1073741823L; /* 2^30 - 1 */
1019 if(mem[r].hh.b0 != 2)
1020 if(mem[r + 2].cint < fewest_demerits)
1022 fewest_demerits = mem[r + 2].cint;
1026 } while(!(r == mem_top - 7));
1027 best_line = mem[best_bet + 1].hh.v.LH;
1028 /* if looseness=0 then goto done; */
1029 if(eqtb[(hash_size + 3182)].cint == 0){
1030 /* if (final_pass && eqtb[(hash_size + 3750)].cint > 0){ */
1031 /* paragraph_failed++; */
1033 goto lab30; /* normal exit */
1036 /* r:=link(active); actual_looseness:=0; */
1037 r = mem[mem_top - 7].hh.v.RH;
1038 actual_looseness = 0;
1040 if(mem[r].hh.b0 != 2)
1042 /* line_diff:=line_number(r)-best_line; */
1043 line_diff = toint(mem[r + 1].hh.v.LH)- toint(best_line
1045 /* if ((line_diff<actual_looseness)and(looseness<=line_diff))or@|
1046 ((line_diff>actual_looseness)and(looseness>=line_diff)) then */
1047 if(((line_diff < actual_looseness)&&
1048 (eqtb[(hash_size + 3182)].cint
1049 <= line_diff)) ||((line_diff > actual_looseness)&&
1050 (eqtb[(hash_size + 3182)].cint >= line_diff)))
1053 actual_looseness = line_diff;
1054 fewest_demerits = mem[r + 2].cint;
1056 else if((line_diff == actual_looseness)&&(mem[r + 2]
1057 .cint < fewest_demerits))
1060 fewest_demerits = mem[r + 2].cint;
1064 } while(!(r == mem_top - 7));
1065 best_line = mem[best_bet + 1].hh.v.LH;
1067 /* if (actual_looseness=looseness)or final_pass then goto done; */
1068 /* if((actual_looseness == eqtb[(hash_size + 3182)].cint)|| final_pass)*/
1069 if((actual_looseness == eqtb[(hash_size + 3182)].cint)) {
1077 q = mem[mem_top - 7].hh.v.RH;
1078 while(q != mem_top - 7){
1079 cur_p = mem[q].hh.v.RH;
1080 if(mem[q].hh.b0 == 2)
1082 else free_node(q, 3);
1087 cur_p = mem[q].hh.v.RH;
1095 if(eqtb[(hash_size + 3195)].cint > 0)
1096 print_nl("@second_pass"); /* */
1098 /* threshold:=tolerance; */
1099 threshold = eqtb[(hash_size + 3164)].cint;
1101 second_pass_count++; /* 96 Feb 9 */
1102 /* final_pass:=(emergency_stretch<=0); */
1103 final_pass =(eqtb[(hash_size + 3750)].cint <= 0);
1109 if(eqtb[(hash_size + 3195)].cint > 0) /* tracing_paragraphs */
1110 print_nl("@emergencypass"); /* */
1112 /* can only get here is \emergencystretch has been set positive */
1113 /* background[2]:=background[2]+emergency_stretch; final_pass:=true; */
1114 background[2]= background[2]+ eqtb[(hash_size + 3750)].cint;
1116 final_pass_count++; /* 96 Feb 9 */
1117 } /* end of if second_pass */
1118 } /* end of while(true)do */
1119 /* cannot drop through from above loop */
1120 lab30: /* common exit point */
1121 /* if (badness > (pre)tolerance) */
1122 /* if(last_badness > threshold){ */
1123 /* if(savedbadness > threshold){ */ /* do we believe this ??? */
1124 /* paragraph_failed++; */ /* 96/Feb/9 */
1126 /* if (prevgraf == 1) singleline++; */
1127 /* if (nest[nest_ptr].pg_field == 1) singleline++; */
1128 /* At this point best_line is number of lines in paragraph + 1 */
1129 if (best_line == 2) singleline++;
1132 if(eqtb[(hash_size + 3195)].cint > 0)
1134 end_diagnostic(true);
1135 normalize_selector ();
1138 post_line_break(finalwidowpenalty);
1139 q = mem[mem_top - 7].hh.v.RH;
1140 while(q != mem_top - 7){
1141 cur_p = mem[q].hh.v.RH;
1142 if(mem[q].hh.b0 == 2)
1144 else free_node(q, 3);
1148 while(q != 0){ /* while q<>null do l.16979 */
1149 cur_p = mem[q].hh.v.RH;
1153 pack_begin_line = 0;
1156 void prefixed_command (void)
1159 internal_font_number f;
1166 while(cur_cmd == 93){
1167 if(! odd(a / cur_chr))
1168 a = a + cur_chr; /* small_number a; */
1171 } while(!((cur_cmd != 10)&&(cur_cmd != 0)));
1174 print_err("You can't use a prefix with `");
1175 print_cmd_chr(cur_cmd, cur_chr);
1176 print_char(39); /* ' */
1177 help1("I'll pretend you didn't say \\long or \\outer or \\global.");
1182 if((cur_cmd != 97)&&(a % 4 != 0)) {
1183 print_err("You can't use `");
1184 print_esc(1165); /* long */
1185 print(1175); /* ' or ` */
1186 print_esc(1166); /* outer */
1187 print(1176); /* ' with ` */
1188 print_cmd_chr(cur_cmd, cur_chr);
1189 print_char(39); /* ' */
1190 help1("I'll pretend you didn't say \\long or \\outer here.");
1193 if(eqtb[(hash_size + 3206)].cint != 0)
1194 if(eqtb[(hash_size + 3206)].cint < 0)
1207 /* set_font: define(cur_font_loc,data,cur_chr); */
1209 geq_define((hash_size + 1834), 120, cur_chr);
1210 else eq_define((hash_size + 1834), 120, cur_chr);
1214 if(odd(cur_chr)&& !(a >= 4)&&
1215 (eqtb[(hash_size + 3206)].cint >= 0))
1220 q = scan_toks(true, e);
1221 if((a >= 4)) geq_define(p, 111 +(a % 4), def_ref);
1222 else eq_define(p, 111 +(a % 4), def_ref);
1234 } while(!(cur_cmd != 10));
1252 incr(mem[cur_chr].hh.v.LH);
1254 geq_define(p, cur_cmd, cur_chr);
1255 else eq_define(p, cur_cmd, cur_chr);
1263 if((a >= 4)) geq_define(p, 0, 256);
1264 else eq_define(p, 0, 256);
1265 scan_optional_equals ();
1271 geq_define(p, 68, cur_val);
1272 else eq_define(p, 68, cur_val);
1277 scan_fifteen_bit_int ();
1279 geq_define(p, 69, cur_val);
1280 else eq_define(p, 69, cur_val);
1285 scan_eight_bit_int ();
1289 geq_define(p, 73, (hash_size + 3218) + cur_val);
1290 else eq_define(p, 73, (hash_size + 3218) + cur_val);
1294 geq_define(p, 74, (hash_size + 3751) + cur_val);
1295 else eq_define(p, 74, (hash_size + 3751) + cur_val);
1299 geq_define(p, 75, (hash_size + 800) + cur_val);
1300 else eq_define(p, 75, (hash_size + 800) + cur_val);
1304 geq_define(p, 76, (hash_size + 1056) + cur_val);
1305 else eq_define(p, 76, (hash_size + 1056) + cur_val);
1309 geq_define(p, 72, (hash_size + 1322) + cur_val);
1310 else eq_define(p, 72, (hash_size + 1322) + cur_val);
1322 if(! scan_keyword(836)) /* to */
1324 print_err("Missing `to' inserted");
1325 help2("You should have said `\\read<number> to \\cs'.",
1326 "I'm going to look for the \\cs now.");
1332 if((a >= 4)) geq_define(p, 111, cur_val);
1333 else eq_define(p, 111, cur_val);
1342 scan_eight_bit_int ();
1343 p = (hash_size + 1322) + cur_val;
1346 scan_optional_equals ();
1349 } while(!((cur_cmd != 10)&&(cur_cmd != 0)));
1354 scan_eight_bit_int ();
1356 cur_chr = (hash_size + 1322) + cur_val;
1360 q = eqtb[cur_chr].hh.v.RH;
1363 geq_define(p, 101, 0);
1364 else eq_define(p, 101, 0);
1367 incr(mem[q].hh.v.LH);
1369 geq_define(p, 111, q);
1370 else eq_define(p, 111, q);
1377 q = scan_toks(false, false);
1378 if(mem[def_ref].hh.v.RH == 0){
1380 geq_define(p, 101, 0);
1381 else eq_define(p, 101, 0);
1383 mem[def_ref].hh.v.RH = avail;
1393 if(p == (hash_size + 1313)) /* output ? */
1395 mem[q].hh.v.RH = get_avail ();
1397 mem[q].hh.v.LH = 637;
1399 mem[q].hh.v.LH = 379;
1400 mem[q].hh.v.RH = mem[def_ref].hh.v.RH;
1401 mem[def_ref].hh.v.RH = q;
1404 geq_define(p, 111, def_ref);
1405 else eq_define(p, 111, def_ref);
1412 scan_optional_equals ();
1415 geq_word_define(p, cur_val);
1416 else eq_word_define(p, cur_val);
1422 scan_optional_equals ();
1423 scan_dimen(false, false, false);
1425 geq_word_define(p, cur_val);
1426 else eq_word_define(p, cur_val);
1434 scan_optional_equals ();
1435 if(n == 76) scan_glue(3);
1439 geq_define(p, 117, cur_val);
1440 else eq_define(p, 117, cur_val);
1445 if(cur_chr == (hash_size + 1883))
1447 else if(cur_chr == (hash_size + 2907))
1448 n = 32768L; /* 2^15 */
1449 else if(cur_chr == (hash_size + 2651))
1450 n = 32767; /* 2^15 - 1*/
1451 else if(cur_chr == (hash_size + 3474))
1452 n = 16777215L; /* 2^24 - 1 */
1453 else n = 255; /* 2^8 - 1 */
1457 scan_optional_equals ();
1459 if(((cur_val < 0)&&(p < (hash_size + 3474))) ||(cur_val > n))
1461 print_err("Invalid code(");
1463 if(p < (hash_size + 3474))
1464 print(1197); /*), should be in the range 0.. */
1465 else print(1198); /*), should be at most */
1467 help1("I'm going to use 0 instead of that illegal code value.");
1471 if(p < (hash_size + 2907))
1473 geq_define(p, 120, cur_val);
1474 else eq_define(p, 120, cur_val);
1475 else if(p < (hash_size + 3474))
1477 geq_define(p, 120, cur_val);
1478 else eq_define(p, 120, cur_val);
1480 geq_word_define(p, cur_val);
1481 else eq_word_define(p, cur_val);
1487 scan_four_bit_int ();
1489 scan_optional_equals ();
1492 geq_define(p, 120, cur_val);
1493 else eq_define(p, 120, cur_val);
1500 do_register_command(a);
1504 scan_eight_bit_int ();
1508 scan_optional_equals ();
1509 if(set_box_allowed){
1510 scan_box(1073741824L + n); /* 2^30 + n */ /* box_flag + n */
1513 print_err("Improper ");
1514 print_esc(533); /* setbox */
1515 help2("Sorry, \\setbox is not allowed after \\halign in a display,",
1516 "or between \\accent and an accented character.");
1528 alter_page_so_far ();
1538 scan_optional_equals ();
1545 p = get_node(2 * n + 1);
1548 register integer for_end;
1553 scan_dimen(false, false, false);
1554 mem[p + 2 * j - 1].cint = cur_val;
1555 scan_dimen(false, false, false);
1556 mem[p + 2 * j].cint = cur_val;
1558 while(j++ < for_end);
1562 geq_define((hash_size + 1312), 118, p);
1563 else eq_define((hash_size + 1312), 118, p);
1571 if (is_initex) { /* bkph */
1576 print_err("Patterns can be loaded only by INITEX");
1581 } while(!(cur_cmd == 2));
1586 new_hyph_exceptions ();
1592 find_font_dimen(true);
1594 scan_optional_equals ();
1595 scan_dimen(false, false, false);
1596 font_info[k].cint = cur_val;
1604 scan_optional_equals ();
1606 if(n == 0)hyphen_char[f]= cur_val;
1607 else skew_char[f]= cur_val;
1618 confusion(1172); /* prefix */
1619 return; // abort_flag set
1622 } /* end of cur_cmd switch */
1626 if(after_token != 0) {
1627 cur_tok = after_token;
1633 /* added following explanations 96/Jan/10 */
1635 void bad_formator_pool (char *name, char *defaultname, char *envvar)
1637 if (name == NULL) name = defaultname;
1638 sprintf(log_line, "(Perhaps %s is for an older version of TeX)\n", name);
1639 show_line(log_line, 0);
1640 name_of_file[name_length + 1] = '\0'; /* null terminate */
1641 sprintf(log_line, "(Alternatively, %s may have been corrupted)\n", name_of_file+1);
1642 show_line(log_line, 0);
1643 name_of_file[name_length + 1] = ' '; /* space terminate */
1645 "(Perhaps your %s environment variable is not set correctly)\n", envvar);
1646 show_line(log_line, 0);
1648 char *s; /* extra info 99/April/28 */
1649 if ((s = grabenv(envvar)) != NULL) {
1650 sprintf(log_line, "(%s=%s)\n", envvar, s);
1651 show_line(log_line, 0);
1654 sprintf(log_line, "%s environment variable not set\n", envvar);
1655 show_line(log_line, 0);
1663 bool load_fmt_file (void)
1664 {/* 6666 10 */ register bool Result;
1669 undump_int(x); /* CHECKSUM */
1670 if(x != BEGINFMTCHECKSUM) /* magic FMT file start 4C 20 E6 15 hex */
1673 undump_int(x); /* mem_bot */
1678 undump_int(x); /* mem_top */
1679 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1681 /* we already read this once earlier to grab mem_top */
1683 sprintf(log_line, "Read from fmt file mem_top = %d TeX words\n", x);
1684 show_line(log_line, 0);
1686 /* allocate_main_memory (x); */ /* allocate main memory at this point */
1687 mem = allocate_main_memory(x); /* allocate main memory at this point */
1688 if (mem == NULL) exit(1); /* redundant sanity test ! */
1689 initialize_aux(); /* do `mem' part of initialize */
1690 /* mem = zmem; */ /* update pointer to main memory */
1692 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1696 undump_int(x); /* eqtbsize */
1697 if(x != (hash_size + 4006)) /* eqtbsize */
1699 undump_int(x); /* hash_prime */
1702 undump_int(x); /* hyphen_prime */
1703 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1704 #ifdef ALLOCATEHYPHEN
1705 /* allow format files dumped with arbitrary (prime) hyphenation exceptions */
1706 realloc_hyphen (x); /* reset_hyphen(); */
1709 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1711 if(x != hyphen_prime)
1714 undump_int(x); /* pool_size */
1717 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1718 #ifdef ALLOCATESTRING
1719 if(x > current_pool_size) {
1721 sprintf(log_line, "undump string pool reallocation (%d > %d)\n",
1722 x, current_pool_size);
1723 show_line(log_line, 0);
1725 str_pool = realloc_str_pool (x - current_pool_size + increment_pool_size);
1727 if(x > current_pool_size) /* 94/Jan/24 */
1729 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1734 sprintf(log_line, "%s%s\n", "---! Must increase the ", "string pool size");
1735 show_line(log_line, 0);
1741 undump_int(x); /* max_strings */
1744 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1745 #ifdef ALLOCATESTRING
1746 if(x > current_max_strings){
1748 sprintf(log_line, "undump string pointer reallocation (%d > %d)\n",
1749 x, current_max_strings);
1750 show_line(log_line, 0);
1752 str_start = realloc_str_start(x - current_max_strings + increment_max_strings);
1754 if(x > current_max_strings) /* 94/Jan/24 */
1756 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1761 sprintf(log_line, "%s%s\n", "---! Must increase the ", "max strings");
1762 show_line(log_line, 0);
1768 if (undumpthings(str_start[0], str_ptr + 1) /* undump string ptrs */
1770 if (undumpthings(str_pool[0], pool_ptr) /* undump string pool */
1773 init_str_ptr = str_ptr;
1774 init_pool_ptr = pool_ptr;
1775 /* undump the dynamic memory - paragraph 1312 in the book */
1778 if((x < 1019)||(x > mem_top - 14))
1780 else lo_mem_max = x;
1784 if((x < 20)||(x > lo_mem_max))
1788 p = 0; /* mem_bot */
1791 if (undumpthings(mem[p], q + 2 - p)
1793 p = q + mem[q].hh.v.LH;
1794 if((p > lo_mem_max)||((q >= mem[q + 1].hh.v.RH)&&(mem[q +
1795 1].hh.v.RH != rover)))
1797 q = mem[q + 1].hh.v.RH;
1798 } while(!(q == rover));
1799 if (undumpthings(mem[p], lo_mem_max + 1 - p)
1801 /* if(mem_min < -2) */
1802 if(mem_min < mem_bot - 2) /* ? splice in block below */
1804 /* or call add_variable_space(mem_bot - (mem_min + 1)) */
1806 if (trace_flag) show_line("Splicing in mem_min space in undump!\n", 0);
1808 p = mem[rover + 1].hh.v.LH;
1810 mem[mem_min].hh.v.RH = 0; /* null */
1811 mem[mem_min].hh.v.LH = 0; /* null */
1812 mem[p + 1].hh.v.RH = q;
1813 mem[rover + 1].hh.v.LH = q;
1814 mem[q + 1].hh.v.RH = rover;
1815 mem[q + 1].hh.v.LH = p;
1816 /* mem[q].hh.v.RH = 262143L; */ /* NO! */
1817 mem[q].hh.v.RH = empty_flag;
1818 /* mem[q].hh.v.LH = -0 - q; */
1819 mem[q].hh.v.LH = mem_bot - q; /* ? size of block */
1823 if((x < lo_mem_max + 1)||(x > mem_top - 13))
1825 else hi_mem_min = x;
1829 /* if((x < 0)||(x > mem_top)) */
1830 if((x < mem_bot)||(x > mem_top))
1835 if (undumpthings(mem[hi_mem_min], mem_end + 1 - hi_mem_min)
1837 undump_int(var_used);
1838 undump_int(dyn_used);
1842 if((x < 1)||(k + x > (hash_size + 4007)))
1844 if (undumpthings(eqtb[k], x)
1848 if((x < 0)||(k + x > (hash_size + 4007)))
1851 register integer for_end;
1853 for_end = k + x - 1;
1855 eqtb[j]= eqtb[k - 1];
1856 while(j++ < for_end);
1859 } while(!(k > (hash_size + 4006)));
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*/
1868 par_token = 4095 + par_loc;
1871 /* if((x < hashbase)||(x > hashbase + hashsize)) */
1872 /* if((x < 514)||(x > (hash_size + 514))) */
1873 if((x < 514)||(x > (hash_size + hash_extra + 514))) /*96/Jan/10*/
1880 /* if((x < hashbase)||(x > hashbase + hashsize)) */
1881 /* if((x < 514)||(x > (hash_size + 514))) */
1882 if((x < 514)||(x > (hash_size + hash_extra + 514))) /*96/Jan/10*/
1890 if((x < p + 1)||(x > hash_used))
1895 } while(!(p == hash_used));
1896 if (undumpthings(hash[hash_used + 1], (hash_size + 780) - hash_used)
1899 undump_int(cs_count); /* cs_count */
1901 sprintf(log_line, "itex undump cs_count %d ", cs_count); /* debugging */
1902 show_line(log_line, 0);
1905 undump_int(x); /* font_mem_size */
1908 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1911 sprintf(log_line, "Read from fmt fmem_ptr = %d\n", x);
1912 show_line(log_line, 0);
1914 if(x > current_font_mem_size){ /* 93/Nov/28 dynamic allocate font_info */
1916 sprintf(log_line, "Undump realloc font_info (%d > %d)\n",
1917 x, current_font_mem_size);
1918 show_line(log_line, 0);
1920 font_info = realloc_font_info(x - current_font_mem_size + increment_font_mem_size);
1922 if(x > current_font_mem_size) /* in case allocation failed 94/Jan/24 */
1924 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1925 if(x > font_mem_size)
1929 sprintf(log_line, "%s%s\n", "---! Must increase the ", "font mem size");
1930 show_line(log_line, 0);
1936 if (undumpthings(font_info[0], fmem_ptr)
1939 undump_int(x); /* font_max */
1945 sprintf(log_line, "%s%s\n", "---! Must increase the ", "font max");
1946 show_line(log_line, 0);
1951 frozenfontptr = font_ptr; /* remember number of fonts frozen into format */
1952 if (undumpthings(font_check[0], font_ptr + 1)
1954 if (undumpthings(font_size[0], font_ptr + 1)
1956 if (undumpthings(font_dsize[0], font_ptr + 1)
1958 if (undumpthings(font_params[0], font_ptr + 1)
1960 if (undumpthings(hyphen_char[0], font_ptr + 1)
1962 if (undumpthings(skew_char[0], font_ptr + 1)
1964 if (undumpthings(font_name[0], font_ptr + 1)
1966 if (undumpthings(font_area[0], font_ptr + 1)
1968 if (undumpthings(font_bc[0], font_ptr + 1)
1970 if (undumpthings(font_ec[0], font_ptr + 1)
1972 if (undumpthings(char_base[0], font_ptr + 1)
1974 if (undumpthings(width_base[0], font_ptr + 1)
1976 if (undumpthings(height_base[0], font_ptr + 1)
1978 if (undumpthings(depth_base[0], font_ptr + 1)
1980 if (undumpthings(italic_base[0], font_ptr + 1)
1982 if (undumpthings(lig_kern_base[0], font_ptr + 1)
1984 if (undumpthings(kern_base[0], font_ptr + 1)
1986 if (undumpthings(exten_base[0], font_ptr + 1)
1988 if (undumpthings(param_base[0], font_ptr + 1)
1990 if (undumpthings(font_glue[0], font_ptr + 1)
1992 if (undumpthings(bchar_label[0], font_ptr + 1)
1994 if (undumpthings(font_bchar[0], font_ptr + 1)
1996 if (undumpthings(font_false_bchar[0], font_ptr + 1)
2000 /* log not opened yet, so can't show fonts frozen into format */
2002 /* May be able to avoid the following since we switched to */
2003 /* non_address from font_mem_size to 0 96/Jan/15 ??? */
2004 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2006 /* deal with fmt files dumped with *different* font_mem_size 93/Nov/29 */
2007 { int count = 0, oldfont_mem_size = 0;
2008 for (x = 0; x <= font_ptr; x++) {
2009 if(bchar_label[x] > oldfont_mem_size) oldfont_mem_size = bchar_label[x];
2011 /* somewhat arbitrary sanity check ... */
2012 /* if (oldfont_mem_size != font_mem_size && oldfont_mem_size > font_max) { */
2013 if (oldfont_mem_size != non_address && oldfont_mem_size > font_max) { /* 96/Jan/16 */
2014 for (x = 0; x <= font_ptr; x++) {
2015 if(bchar_label[x] == oldfont_mem_size) {
2016 /* bchar_label[x] = font_mem_size; */
2017 bchar_label[x] = non_address; /* 96/Jan/16 */
2024 "oldfont_mem_size is %d --- hit %d times. Using non_address %d\n",
2025 oldfont_mem_size, count, non_address);
2026 show_line(log_line, 0);
2032 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2033 /* undump(0)(hyph_size)(hyph_count); */
2036 /* if((x < 0)||(x > 607)) */
2037 if((x < 0)||(x > hyphen_prime))
2039 else hyph_count = x;
2041 /* undump hypenation exception tables p.1325 */
2043 register integer for_end;
2045 for_end = hyph_count;
2051 /* if((x < 0)||(x > 607)) */
2052 if((x < 0)||(x > hyphen_prime))
2056 /* undump(0)(str_ptr)(hyph_word[j]); */
2059 if((x < 0)||(x > str_ptr))
2061 else hyph_word[j]= x;
2063 /* undump(min_halfword)(max_halfword)(hyph_list[j]); */
2066 /* if((x < 0)||(x > 262143L)) */
2067 if((x < 0)||(x > max_halfword)) /* mem_top ? no p.1325 */
2069 else hyph_list[j]= x;
2072 while(k++ < for_end);
2074 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2075 #ifdef ALLOCATEHYPHEN
2076 /* if user specified new hyphen prime - flush existing exception patterns ! */
2077 /* but, we can reclaim the string storage wasted ... */
2079 if (new_hyphen_prime != 0) {
2080 realloc_hyphen(new_hyphen_prime); /* reset_hyphen(); */
2081 hyphen_prime = new_hyphen_prime;
2085 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2090 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2091 #ifdef ALLOCATETRIES
2093 ALLOCATETRIES(x); /* allocate only as much as is needed */
2094 /* trie_size = x; */ /* ??? */
2097 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2101 sprintf(log_line, "%s%s\n", "---! Must increase the ", "trie size");
2102 show_line(log_line, 0);
2109 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2110 if (is_initex) /* bkph */
2111 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2114 if (undumpthings(trietrl[0], j + 1)
2116 if (undumpthings(trietro[0], j + 1)
2118 if (undumpthings(trietrc[0], j + 1)
2124 if(x > trie_op_size)
2127 sprintf(log_line, "%s%s\n", "---! Must increase the ", "trie op size");
2128 show_line(log_line, 0);
2135 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2136 if (is_initex) /* bkph */
2137 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2141 begin undump(0)(63)(hyf_distance[k]); {a |small_number|}
2142 undump(0)(63)(hyf_num[k]);
2143 undump(min_quarterword)(max_quarterword)(hyf_next[k]); end; */
2144 if (undumpthings(hyf_distance[1], j)
2146 if (undumpthings(hyf_num[1], j)
2148 if (undumpthings(hyf_next[1], j)
2152 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2153 if (is_initex) { /* bkph */
2154 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2156 register integer for_end;
2161 while(k++ < for_end);
2167 /* undump(0)(k-1)(k) */
2170 if((x < 0)||(x > k - 1))
2174 /* undump(1)(j)(x) */
2177 if((x < 1)||(x > j))
2183 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2184 if (is_initex) /* bkph */
2185 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2188 /* j:=j-x; op_start[k]:=qo(j); */
2194 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2195 if (is_initex) /* bkph */
2196 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2197 trie_not_ready = false
2202 if((x < 0)||(x > 3))
2204 /* else interaction = x; */
2205 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2206 if (interaction < 0) /* may now set in local.c bkph 94/Jan/8 */
2207 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2212 if((x < 0)||(x > str_ptr))
2214 else format_ident = x;
2217 /* test_eof(fmt_file)? */
2218 if((x != ENDFMTCHECKSUM)|| feof(fmt_file)) /* magic checksum --- change ? */
2225 sprintf(log_line, "(Fatal format file error; I'm stymied)\n");
2226 show_line(log_line, 1);
2227 /* added following bit of explanation 96/Jan/10 */
2229 bad_formator_pool(format_file, "the format file", "TEXFORMATS");
2234 void final_clean_up (void)
2237 c = cur_chr; /* small_number c */
2238 if(job_name == 0)open_log_file ();
2239 /* ******************************** 3.14159 ***************************** */
2240 while(input_ptr > 0)
2241 if(cur_input.state_field == 0){
2244 else end_file_reading ();
2245 /* *********************************************************************** */
2246 while(open_parens > 0){
2251 print_nl("("); /*(*/
2252 print_esc(1271); /* end occurred */
2253 print(1272); /* inside a group at level */
2254 print_int(cur_level - 1);
2255 print_char(41); /*)*/
2257 while(cond_ptr != 0){
2258 print_nl("("); /*(*/
2259 print_esc(1271); /* end occurred */
2260 print(1273); /* when */
2261 print_cmd_chr(105, cur_if); /* i */
2264 print(1274); /* on line */
2267 print(1275); /* was incomplete) */
2268 if_line = mem[cond_ptr + 1].cint;
2269 cur_if = mem[cond_ptr].hh.b1;
2270 /* *********************************************************************** */
2271 temp_ptr = cond_ptr; /* new in 3.14159 */
2272 cond_ptr = mem[cond_ptr].hh.v.RH;
2273 free_node(temp_ptr, 2); /* new in 3.14159 */
2274 /* *********************************************************************** */
2277 if(((history == 1)||(interaction < 3)))
2281 print_nl(" (see the transcript file for additional information)"); /* */
2287 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2288 if (is_initex) { /* bkph */
2289 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2290 /* *************************** new in 3.14159 ***************************** */
2292 register integer for_end;
2297 delete_token_ref(cur_mark[c]);
2298 while(c++ < for_end);
2300 /* *********************************************************************** */
2301 store_fmt_file (); // returns a value ?
2304 if (!is_initex) /* 2000/March/3 */
2305 print_nl(" (\\dump is performed only by INITEX)"); /* */
2309 // debugging code for checking the string pool
2312 int checkpool (char *task)
2314 int c, i, k, n, st, flag, bad=0;
2317 sprintf(log_line, "Check on string pool start (%s)\n", task);
2318 show_line(log_line, 0);
2320 for (k = 0; k < 32; k++) {
2321 if (str_start[k] != 3 * k) {
2322 sprintf(log_line, "k %d str_start[k] %d\n", k, str_start[k]);
2323 show_line(log_line, 0);
2326 for (k = 32; k < 128; k++) {
2327 if (str_start[k] != 96 + (k - 32)) {
2328 sprintf(log_line, "k %d str_start[k] %d\n", k, str_start[k]);
2329 show_line(log_line, 0);
2332 for (k = 128; k < 256; k++) {
2333 if (str_start[k] != 194 + 4 * (k - 128)){
2334 sprintf(log_line, "k %d str_start[k] %d\n", k, str_start[k]);
2335 show_line(log_line, 0);
2339 sprintf(log_line, "Check on string pool (%s)\n", task);
2340 show_line(log_line, 0);
2342 for (k = 0; k < str_ptr; k++) {
2343 if (str_start[k+1] == 0) break;
2344 n = str_start[k+1] - str_start[k];
2348 for (i = 0; i < n; i++) {
2349 if (str_pool[st + i] == 0) {
2352 if (str_pool[st + i] > 255) {
2358 sprintf(log_line, "BAD %d (start at %d): ", k, st);
2359 show_line(log_line, 0);
2361 for (i = 0; i < n; i++) {
2362 c = str_pool[st + i];
2364 sprintf(s, "%d ", c);
2383 show_line(log_line, stdout);
2386 sprintf(log_line, "end of check (%s)\n", bad ? "BAD" : "OK");
2387 show_line(log_line, 0);
2389 if (task == NULL) return bad;
2393 } /* DEBUGGING ONLY */
2396 void show_frozen (void)
2399 fprintf(log_file, "\n");
2400 fprintf(log_file, "(%d fonts frozen in format file:\n", font_ptr);
2401 /* ignore font 0 which is nullfont */
2402 /* for (i = 1; i < font_ptr+1; i++) */
2403 for (i = 1; i <= font_ptr; i++) {
2404 if (i > 1) fprintf(log_file, ", ");
2405 if ((i % 8) == 0) fprintf(log_file, "\n");
2406 n = str_start[font_name[i]+1]-str_start[font_name[i]];
2407 for (j = 0; j < n; j++) {
2408 putc(str_pool[str_start[font_name[i]]+j], log_file);
2409 /* str_pool[str_start[font_name[i]]+j] = '?'; */
2412 fprintf(log_file, ") ");
2415 /* Main entry point called from texmf.c int main(int ac, char *av[]) */
2416 /* call from main_program in texmf.c */
2417 /* This in turn calls initialize() */
2419 #pragma warning(disable:4127) // conditional expression is constant
2421 /* void texbody() */
2422 int texbody (void) /* now returns a value --- bkph */
2426 set_paths(TEXFORMATPATHBIT + TEXINPUTPATHBIT + TEXPOOLPATHBIT + TFMFILEPATHBIT);
2428 if(ready_already == 314159L)goto lab1; /* magic number */
2429 /* These tests are almost all compile time tests and so could be eliminated */
2431 if((half_error_line < 30)||(half_error_line > error_line - 15))
2433 if(max_print_line < 60) bad = 2;
2434 if(dvi_buf_size % 8 != 0) bad = 3;
2435 if(1100 > mem_top)bad = 4; /* not compile time */
2436 /* if(hash_prime > hash_size) */
2437 if(hash_prime > (hash_size + hash_extra)) bad = 5;
2438 if(max_in_open >= 128)bad = 6; /* p.14 */
2439 if(mem_top < 267)bad = 7; /* where from ? *//* not compile time */
2442 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2443 if (is_initex) { /* bkph */
2444 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2445 if((mem_min != 0)||(mem_max != mem_top)) bad = 10;
2448 /* if((mem_min > 0)||(mem_max < mem_top)) */
2449 if((mem_min > mem_bot)||(mem_max < mem_top)) bad = 10;
2450 /* if((0 > 0)||(255 < 127)) */
2451 if((min_quarterword > 0)||(max_quarterword < 255)) bad = 11;
2452 /* if((0 > 0)||(262143L < 32767)) */
2453 if((min_halfword > 0)||(max_halfword < 32767)) bad = 12;
2454 /* if((0 < 0)||(255 > 262143L)) */
2455 if((min_quarterword < min_halfword)||(max_quarterword > max_halfword))
2457 /* if((mem_min < 0)||(mem_max >= 262143L)||(-0 - mem_min > 262144L)) */
2458 if((mem_min < min_halfword)||(mem_max >= max_halfword)||(mem_bot - mem_min >= max_halfword))
2460 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2461 if(mem_max > mem_top + mem_extra_high) /* not compile time */
2462 bad = 14; /* ha ha */
2463 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2464 /* if((0 < 0)||(font_max > 255)) */
2465 if((0 < min_quarterword)||(font_max > max_quarterword)) /* 93/Dec/3 */
2467 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2468 #ifdef INCREASEFONTS
2469 /* if(font_max > 512)*/ /* 93/Dec/3 */
2470 if(font_max > 1024) /* 96/Jan/17 */
2472 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2476 /* if((save_size > 262143L)||(max_strings > 262143L)) */
2477 if((save_size > max_halfword)||(max_strings > max_halfword))
2479 /* if(buf_size > 262143L)*/
2480 if(buf_size > max_halfword)bad = 18;
2482 if(max_quarterword - min_quarterword < 255) bad = 19;
2483 /* if cs_token_flag + undefined_control_sequence > max_halfword then bad <- 21;*/
2484 /* if((hash_size + 4876) > 262143L)*/
2485 /* if((hash_size + 4876) > max_halfword) */
2486 if((hash_size + 4095 + 781) > max_halfword) bad = 21;
2487 if(format_default_length > PATHMAX) bad = 31;
2488 /* if(2 * 262143L < mem_top - mem_min) */
2489 if(max_halfword < (mem_top - mem_min) / 2) bad = 41;
2491 sprintf(log_line, "%s%s%ld\n", "Ouch---my internal constants have been clobbered!",
2492 "---case ", (long) bad);
2493 show_line(log_line, 1);
2495 bad_formator_pool(format_file, "the format file", "TEXFORMATS"); /* 96/Jan/17 */
2496 goto lab9999; // abort
2501 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2503 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2504 if(! get_strings_started ()) goto lab9999; // abort
2506 init_str_ptr = str_ptr;
2507 init_pool_ptr = pool_ptr;
2508 dateandtime(eqtb[(hash_size + 3183)].cint,
2509 eqtb[(hash_size + 3184)].cint,
2510 eqtb[(hash_size + 3185)].cint,
2511 eqtb[(hash_size + 3186)].cint);
2514 ready_already = 314159L; /* magic number */
2516 lab1: /* get here directly if ready_already already set ... */
2521 show_line(tex_version, 0);
2522 sprintf(log_line, " (%s %s)", application, yandyversion);
2523 show_line(log_line, 0);
2524 if(format_ident > 0)slow_print(format_ident);
2530 name_in_progress = false;
2532 output_file_name = 0;
2538 high_in_open = 0; /* max_in_open name already used 1999 Jan 17 */
2540 max_open_parens = 0; /* max_open_parens */
2543 max_param_stack = 0;
2544 #ifdef ALLOCATEBUFFER
2545 /* first = current_buf_size; */
2546 memset (buffer, 0, current_buf_size); /* redundant */
2548 /* first = buf_size; */
2549 memset (buffer, 0, buf_size); /* redundant ? */
2554 } while(!(first == 0)); */
2555 first = 0; /* 1999/Jan/22 */
2558 warning_index = 0; /* warning_index:=null; l.7068 */
2560 cur_input.state_field = 33;
2561 cur_input.start_field = 1;
2562 cur_input.index_field = 0;
2564 cur_input.name_field = 0;
2566 align_state = 1000000L;
2567 if(! init_terminal ())goto lab9999; // abort
2568 cur_input.limit_field = last;
2571 /* if((format_ident == 0)||(buffer[cur_input.loc_field]== 38)) */
2572 /* For Windows NT, lets allow + instead of & for format specification */
2573 if((format_ident == 0)||
2574 (buffer[cur_input.loc_field]== '&')||
2575 (buffer[cur_input.loc_field]== '+'))
2577 if(format_ident != 0)initialize ();
2578 if(! open_fmt_file ())goto lab9999; // abort
2579 if(! load_fmt_file ()){
2581 goto lab9999; // abort
2584 while((cur_input.loc_field < cur_input.limit_field)&&
2585 (buffer[cur_input.loc_field]== 32))
2586 incr(cur_input.loc_field);
2589 if (debug_flag) check_eqtb("after format"); /* debugging 94/Apr/5 */
2591 if((eqtb[(hash_size + 3211)].cint < 0)||
2592 (eqtb[(hash_size + 3211)].cint > 255))
2593 decr(cur_input.limit_field);
2594 /* long to unsigned char ... */
2595 else buffer[cur_input.limit_field]= eqtb[(hash_size + 3211)].cint;
2596 dateandtime(eqtb[(hash_size + 3183)].cint,
2597 eqtb[(hash_size + 3184)].cint,
2598 eqtb[(hash_size + 3185)].cint,
2599 eqtb[(hash_size + 3186)].cint);
2600 magic_offset = str_start[886]- 9 * 16; /* following: */
2601 /* "0234000122*4000133**3**344*0400400*000000234000111*1111112341011" */
2602 if(interaction == 0) selector = 16;
2604 if((cur_input.loc_field < cur_input.limit_field)&&
2605 (eqtb[(hash_size + 1883) +
2606 buffer[cur_input.loc_field]].hh.v.RH != 0))
2610 /* show font TFMs frozen into format file */
2611 /* moved here after start_input to ensure the log file is open */
2612 if (show_tfm_flag && log_opened && font_ptr > 0) /* 98/Sep/28 */
2616 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2617 main_time = clock();
2618 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
2621 if (show_cs_names) print_cs_names(stdout, 0); /* 98/Mar/31 */
2623 main_control(); /* read-eval-print loop :-) in tex8.c */
2625 // what if abort_flag is set now ?
2627 if (show_cs_names) print_cs_names(stdout, 1); /* 98/Mar/31 */
2629 // what if abort_flag is set now ?
2633 // if (abort_flag) return -1;
2635 close_files_and_terminate();
2644 if((history != 0)&&(history != 1)) code = 1;
2646 // now return instead of exit to allow cleanup in local.c
2650 } /* end of texbody */
2653 /* add a block of variable size node space below mem_bot */
2654 void add_variable_space(int size)
2655 { /* used in tex0.c, local.c, itex.c */
2661 if (mem_min == 0) t = mem_min; /* bottom of present block */
2662 else t = mem_min + 1;
2663 mem_min = t - (size + 1); /* first word in new block - 1 */
2664 /* mem_min = mem_start; */ /* allocate all of it at once */
2665 if (mem_min < mem_start) { /* sanity test */
2666 if (trace_flag) show_line("WARNING: mem_min < mem_start!\n", 0);
2667 mem_min = mem_start;
2669 p = mem[rover + 1].hh.v.LH;
2671 mem[mem_min].hh.v.RH = 0; /* insert blank word below ??? */
2672 mem[mem_min].hh.v.LH = 0; /* insert blank word below ??? */
2673 mem[p + 1].hh.v.RH = q;
2674 mem[rover + 1].hh.v.LH = q;
2675 mem[q + 1].hh.v.RH = rover;
2676 mem[q + 1].hh.v.LH = p;
2677 mem[q].hh.v.RH = empty_flag;
2678 mem[q].hh.v.LH = t - q; /* block size */
2683 /*************************************************************************/
2685 /* All ini TeX code is here at end so can use same pragma optimize for it */
2687 /* Ini-TeX code is rarely needed/used so make it small rather than fast */
2689 #pragma optimize("t", off)
2690 /* #pragma optimize("2", off) */
2691 #pragma optimize("s", on)
2692 /* #pragma optimize("1", on) */
2695 /* split out to allow sharing of code from do_initex and newpattern */
2696 void reset_trie (void)
2700 register integer for_end;
2701 k = - (integer) trie_op_size;
2702 for_end = trie_op_size;
2704 do trieophash[k]= 0;
2705 while(k++ < for_end);
2708 register integer for_end;
2709 k = 0; for_end = 255;
2711 do trie_used[k]= min_trie_op;
2712 while(k++ < for_end);
2714 max_op_used = min_trie_op;
2716 trie_not_ready = true;
2720 trie_not_ready = true;
2723 void reset_hyphen (void)
2724 { /* borrowed code from initialize() */
2727 register integer for_end;
2729 for_end = hyphen_prime;
2733 hyph_list[z]= 0; /* hyph_list[z]:=null; l.18131 */
2735 while(z++ < for_end);
2740 void do_initex (void)
2741 { /* split out to allow optimize for space, not time */
2745 /* hyph_pointer z; */
2747 /* for k:=mem_bot+1 to lo_mem_stat_max do mem[k].sc:=0; p.164 */
2749 register integer for_end;
2754 while(k++ < for_end);
2757 while(k <= 19){ /* while k <= lo_mem_stat-max ... */
2758 /* glue_ref_count(k):=null+1; */
2764 mem[6].cint = 65536L;
2766 mem[10].cint = 65536L;
2768 mem[14].cint = 65536L;
2770 mem[15].cint = 65536L;
2772 mem[18].cint = -65536L;
2774 rover = 20; /* rover = lo_mem_stat-max + 1 ... */
2775 /* mem[rover].hh.v.RH = 262143L; */
2776 mem[rover].hh.v.RH = empty_flag;
2777 /* mem[rover].hh.v.LH = 1000; */
2778 mem[rover].hh.v.LH = block_size;
2779 mem[rover + 1].hh.v.LH = rover;
2780 mem[rover + 1].hh.v.RH = rover;
2781 /* lo_mem_max = rover + 1000; */
2782 lo_mem_max = rover + block_size;
2783 mem[lo_mem_max].hh.v.RH = 0;
2784 mem[lo_mem_max].hh.v.LH = 0;
2785 /* for k <- hi_mem_stat_min to mem_top do mem[k] = mem[lo_mem_max]; */
2787 register integer for_end;
2791 do mem[k]= mem[lo_mem_max];
2792 while(k++ < for_end);
2794 /* info(omit_template) <- end_template_token; p.790 */
2795 /* @d end_template_token==cs_token_flag+frozen_end_template */
2796 /* mem[mem_top - 10].hh.v.LH = 14114; */
2797 /* mem[mem_top - 10].hh.v.LH = 10019 + 4095; */ /* + eqtbextra ? NO */
2798 /* mem[mem_top - 10].hh.v.LH = (hash_size + 4614); */
2799 /* mem[mem_top - 10].hh.v.LH = (hash_size + 4095 + 519); */
2800 mem[mem_top - 10].hh.v.LH = (hash_size + hash_extra + 4095 + 519);
2801 /* link(end_span) <- max_quarterword + 1 p.797 */
2802 /* mem[mem_top - 9].hh.v.RH = 256; */ /* 94/Apr/4 ? */
2803 mem[mem_top - 9].hh.v.RH = max_quarterword + 1; /* 96/Oct/12 ??? */
2804 /* info(end_span) <- null p.797 */
2805 mem[mem_top - 9].hh.v.LH = 0;
2806 /* type(last_active) <- hyphenated; p.820 */
2807 mem[mem_top - 7].hh.b0 = 1;
2808 /* line_number(last_active) <- max_halfword; p.820 */
2809 /* mem[mem_top - 6].hh.v.LH = 262143L; */
2810 mem[mem_top - 6].hh.v.LH = empty_flag; /* max_halfword ? */
2811 /* subtype(last_active) <- 0; p.820 */
2812 mem[mem_top - 7].hh.b1 = 0;
2813 /* subtype(page_ins_head) <- 255; p.981 */
2814 mem[mem_top].hh.b1 = 255; /* subtype(page_ins_head) = qi(255) p.981 */
2815 /* type(page_ins_head) <- split_up; p.981 */
2816 mem[mem_top].hh.b0 = 1;
2817 /* link(page_ins_head) <- page_ins_head; p.981 */
2818 mem[mem_top].hh.v.RH = mem_top;
2819 /* type(page_head) <- glue_node; p. 988 */
2820 mem[mem_top - 2].hh.b0 = 10;
2821 /* subtype(page_head) <- normal; p. 988 */
2822 mem[mem_top - 2].hh.b1 = 0;
2823 avail = 0; /* avail <- null p.164 */
2824 mem_end = mem_top; /* mem_end <- mem_top */
2825 hi_mem_min = mem_top - 13; /* hi_mem_min <- hi_mem_stat_min */
2826 var_used = 20; /* var_used <- lo_mem_stat_max */
2827 dyn_used = 14; /* dyn_used <- hi_mem_stat_usage */
2828 /* eq_type(undefined_control_sequence) <- undefined_cs; */
2829 /* equiv(undefined_control_sequence) <- null; */
2830 /* eq_level(undefined_control_sequence) <- level_zero; */
2831 eqtb[(hash_size + 781)].hh.b0 = 101;
2832 eqtb[(hash_size + 781)].hh.v.RH = 0;
2833 eqtb[(hash_size + 781)].hh.b1 = 0;
2834 /* for k <- active_base to undefined_control_sequence -1 do */
2835 /* eqtb[k] <- eqtb(undefined_control_sequence); */
2836 /* {register integer for_end; k = 1; for_end = 10280; if(k <= for_end) do */
2838 register integer for_end;
2840 for_end = (hash_size + 780);
2842 eqtb[k]= eqtb[(hash_size + 781)];
2843 while(k++ < for_end);
2845 eqtb[(hash_size + 782)].hh.v.RH = 0; /* glue_base (hash_size + 782) */
2846 eqtb[(hash_size + 782)].hh.b1 = 1;
2847 eqtb[(hash_size + 782)].hh.b0 = 117;
2848 /* equiv(glue_base):=zero_glue; eq_level(glue_base):=level_one; */
2849 /* eq_type(glue_base):=glue_ref; */
2850 /* {register integer for_end; k = 10283; for_end = 10811; if(k <= for_end) */
2852 register integer for_end;
2853 k = (hash_size + 783);
2854 for_end = (hash_size + 1311);
2856 do eqtb[k]= eqtb[(hash_size + 782)];
2857 while(k++ < for_end);
2859 /* glue_ref_count(zero_glue):=glue_ref_count(zero_glue)+local_base-glue_base; */
2860 /* local_base - glue_base = 530 = 17 glue_pars + 256 skip + 256 mu_skip */
2861 mem[0].hh.v.RH = mem[0].hh.v.RH + 530; /* mem[mem_bot]? */
2862 /* box(0):=null; eq_type(box_base):=box_ref; eq_level(box_base):=level_one; */
2863 eqtb[(hash_size + 1312)].hh.v.RH = 0;
2864 eqtb[(hash_size + 1312)].hh.b0 = 118;
2865 eqtb[(hash_size + 1312)].hh.b1 = 1;
2866 /* for k:=box_base+1 to box_base+255 do eqtb[k]:=eqtb[box_base]; */
2867 /* {register integer for_end; k = 10813; for_end = 11077; if(k <= for_end) */
2869 register integer for_end;
2870 k = (hash_size + 1313);
2871 for_end = (hash_size + 1577);
2873 do eqtb[k]= eqtb[(hash_size + 781)];
2874 while(k++ < for_end);
2876 eqtb[(hash_size + 1578)].hh.v.RH = 0;
2877 eqtb[(hash_size + 1578)].hh.b0 = 119;
2878 eqtb[(hash_size + 1578)].hh.b1 = 1;
2879 /* {register integer for_end; k = 11079; for_end = 11333; if(k <= for_end) */
2881 register integer for_end;
2882 k = (hash_size + 1579);
2883 for_end = (hash_size + 1833);
2885 do eqtb[k]= eqtb[(hash_size + 1578)];
2886 while(k++ < for_end);
2888 eqtb[(hash_size + 1834)].hh.v.RH = 0;
2889 eqtb[(hash_size + 1834)].hh.b0 = 120;
2890 eqtb[(hash_size + 1834)].hh.b1 = 1;
2891 /* {register integer for_end; k = 11335; for_end = 11382; if(k <= for_end) */
2893 register integer for_end;
2894 k = (hash_size + 1835);
2895 for_end = (hash_size + 1882);
2897 do eqtb[k]= eqtb[(hash_size + 1834)];
2898 while(k++ < for_end);
2900 eqtb[(hash_size + 1883)].hh.v.RH = 0;
2901 eqtb[(hash_size + 1883)].hh.b0 = 120;
2902 eqtb[(hash_size + 1883)].hh.b1 = 1;
2903 /* initialize cat_code, lc_code, uc_code, sf_code, math_code 256 * 5 */
2904 /* {register integer for_end; k = 11384; for_end = 12662; if(k <= for_end) */
2906 register integer for_end;
2907 k = (hash_size + 1884);
2908 for_end = (hash_size + 3162);
2910 do eqtb[k]= eqtb[(hash_size + 1883)];
2911 while(k++ < for_end);
2913 /* cat_code(k) <- other_char; math_code(k) <- hi(k); sf_code(k) = 1000; */
2915 register integer for_end;
2920 eqtb[(hash_size + 1883) + k].hh.v.RH = 12;
2921 eqtb[(hash_size + 2907) + k].hh.v.RH = k;
2922 eqtb[(hash_size + 2651) + k].hh.v.RH = 1000;
2924 while(k++ < for_end);
2926 /* cat_base == 11383 */
2927 /* cat_code(carriage_return) <- car_ret; cat_code(" ") <- space */
2928 /* cat_code("\") <- escape; cat_code("%") <- comment; ... */
2929 eqtb[(hash_size + 1896)].hh.v.RH = 5;
2930 eqtb[(hash_size + 1915)].hh.v.RH = 10;
2931 eqtb[(hash_size + 1975)].hh.v.RH = 0;
2932 eqtb[(hash_size + 1920)].hh.v.RH = 14;
2933 eqtb[(hash_size + 2010)].hh.v.RH = 15;
2934 eqtb[(hash_size + 1883)].hh.v.RH = 9;
2935 /* for k:="0" to "9" do math_code(k):=hi(k+var_code); */
2937 register integer for_end;
2941 eqtb[(hash_size + 2907) + k].hh.v.RH = k + 28672; /* '70000 */
2942 while(k++ < for_end);
2944 /* cat_code of uppercase and lowercase letters ... */
2946 register integer for_end;
2952 eqtb[(hash_size + 1883) + k].hh.v.RH = 11;
2953 eqtb[(hash_size + 1883) + k + 32].hh.v.RH = 11;
2954 /* mathcode(k) = hi(k + var_code + "100); */ /* '70000 + 256 */
2955 eqtb[(hash_size + 2907) + k].hh.v.RH =
2956 k + 28928; /* '70000 + 256 */
2957 /* mathcode(k + "a" - "A") = hi(k + "a" - "A" + var_code + "100); */
2958 eqtb[(hash_size + 2907) + k + 32].hh.v.RH =
2959 k + 28960; /* '70000 + 256 + 32 */
2961 eqtb[(hash_size + 2139) + k].hh.v.RH = k + 32;
2962 eqtb[(hash_size + 2139) + k + 32].hh.v.RH = k + 32;
2964 eqtb[(hash_size + 2395) + k].hh.v.RH = k;
2965 eqtb[(hash_size + 2395) + k + 32].hh.v.RH = k;
2967 eqtb[(hash_size + 2651) + k].hh.v.RH = 999;
2969 while(k++ < for_end);
2971 /* {register integer for_end; k = 12663; for_end = 12973; if(k <= for_end) */
2973 register integer for_end;
2974 k = (hash_size + 3163);
2975 for_end = (hash_size + 3473);
2979 while(k++ < for_end);
2981 eqtb[(hash_size + 3180)].cint = 1000;
2982 eqtb[(hash_size + 3164)].cint = 10000;
2983 eqtb[(hash_size + 3204)].cint = 1;
2984 eqtb[(hash_size + 3203)].cint = 25;
2985 eqtb[(hash_size + 3208)].cint = 92;
2986 eqtb[(hash_size + 3211)].cint = 13;
2987 /* {register integer for_end; k = 13230; for_end = 13506; if(k <= for_end) */
2989 register integer for_end;
2993 eqtb[(hash_size + 3474) + k].cint = -1;
2994 while(k++ < for_end);
2996 eqtb[(hash_size + 3520)].cint = 0;
2997 /* {register integer for_end; k = 13230; for_end = 13506; if(k <= for_end) */
2999 register integer for_end;
3000 k = (hash_size + 3730);
3001 for_end = (hash_size + 4006);
3003 do eqtb[k].cint = 0;
3004 while(k++ < for_end);
3006 /* hash_used = 10014; */ /* hash_used = frozen_control_sequence */
3007 /* frozen_control_sequence = hashsize + hashbase p.222 */
3008 /* hash_used = (hash_size + 514); */
3009 hash_used = (hash_size + hash_extra + 514); /* 96/Jan/10 */
3011 if (trace_flag) show_line("itex cs_count=0 ", 0); /* debugging */
3012 /* eq_type(frozen_dont_expand) <- dont_expand; */
3013 /* eqtb[10023].hh.b0 = 116; */
3014 /* eqtb[(hash_size + 523)].hh.b0 = 116; */
3015 eqtb[(hash_size + hash_extra + 523)].hh.b0 = 116;
3016 /* hash[(hash_size + 523)].v.RH = 499; */
3017 hash[(hash_size + hash_extra + 523)].v.RH = 499; /* notexpanded */
3018 /* @<Initialize table...@>= l.10750 */
3019 font_ptr = 0; /* font_ptr:=null_font; */
3020 fmem_ptr = 7; /* fmem_ptr:=7; */
3021 font_name[0]= 795; /* nullfont */
3022 font_area[0]= 335; /* "" */
3023 hyphen_char[0]= 45; /* - */
3025 /* ************************************************************************ */
3026 /* bchar_label[null_font]:=non_address; */ /* 3.14159 */
3027 /* bchar_label[0]= font_mem_size; */ /* OK ? 93/Nov/26 */
3028 bchar_label[0]= non_address; /* i.e. 0 --- 96/Jan/16 */
3029 /* ************************************************************************ */
3030 font_bchar[0]= 256; /* font_bchar[null_font]:=non_char; */
3031 font_false_bchar[0]= 256; /* font_false_bchar[null_font]:=non_char; */
3041 lig_kern_base[0]= 0;
3047 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3048 reset_trie (); /* shared 93/Nov/26 */
3049 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3050 /* {register integer for_end; k = 0; for_end = 6; if(k <= for_end) do
3051 font_info[k].cint = 0;
3052 while(k++ < for_end); }
3053 {register integer for_end; k = - (integer) trie_op_size; for_end =
3054 trie_op_size; if(k <= for_end) do
3056 while(k++ < for_end); }
3057 {register integer for_end; k = 0; for_end = 255; if(k <= for_end) do
3058 trie_used[k]= min_trie_op;
3059 while(k++ < for_end); }
3060 max_op_used = min_trie_op;
3062 trie_not_ready = true;
3066 /* text(frozen_protection):="inaccessible"; */
3067 /* hash[10014].v.RH = 1183; */
3068 /* hash[(hash_size + 514)].v.RH = 1184; */
3069 hash[(hash_size + hash_extra + 514)].v.RH = 1184; /* 1183 */
3070 format_ident = 1251; /* 1250 */
3071 /* hash[(hash_size + 522)].v.RH = 1290; */ /* 1288 */
3072 hash[(hash_size + hash_extra + 522)].v.RH = 1290; /* 1288 */
3073 /* eqtb[(hash_size + 522)].hh.b1 = 1; */
3074 eqtb[(hash_size + hash_extra + 522)].hh.b1 = 1;
3075 /* eqtb[(hash_size + 522)].hh.b0 = 113; */
3076 eqtb[(hash_size + hash_extra + 522)].hh.b0 = 113;
3077 /* eqtb[(hash_size + 522)].hh.v.RH = 0; */
3078 eqtb[(hash_size + hash_extra + 522)].hh.v.RH = 0;
3083 /* starts string pool with strings for 256 chars and then reads tex.pool */
3084 /* adjusted to try both "tex.pool" and "tex.poo" 95/Feb/19 */
3085 bool get_strings_started (void)
3086 {/* 30 10 */ register bool Result;
3092 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3093 int flag; /* 95/Feb/19 */
3094 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3099 register integer for_end;
3104 if(((k < 32)||(k > 126)))
3107 str_pool[pool_ptr]= 94; /* ^ */
3111 str_pool[pool_ptr]= 94; /* ^ */
3116 str_pool[pool_ptr]= k + 64;
3121 str_pool[pool_ptr]= k - 64;
3129 str_pool[pool_ptr]= l + 48; /* '0' */
3133 str_pool[pool_ptr]= l + 87; /* 'a' - 10 */
3140 str_pool[pool_ptr]= l + 48; /* '0' */
3144 str_pool[pool_ptr]= l + 87; /* 'a' - 10 */
3150 str_pool[pool_ptr]= k;
3155 while(k++ < for_end);
3157 vstrcpy(name_of_file + 1, poolname);
3158 name_of_file[0]= ' ';
3159 name_of_file[strlen(poolname)+ 1]= ' ';
3160 name_length = strlen(poolname);
3161 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3162 /* if(a_open_in(pool_file, TEXPOOLPATH)) */
3163 flag = a_open_in(pool_file, TEXPOOLPATH);
3164 if (flag == 0) { /* 95/Feb/19 */
3165 poolname [name_length - 1] = '\0'; /* `tex.pool' => `tex.poo' */
3166 vstrcpy(name_of_file + 1, poolname);
3167 name_of_file[0]= ' ';
3168 name_of_file[strlen(poolname)+ 1]= ' ';
3169 name_length = strlen(poolname);
3170 flag = a_open_in(pool_file, TEXPOOLPATH);
3177 /* if(eof(pool_file)) */ /* feof(pool_file)??? */
3178 if(test_eof(pool_file))
3181 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3182 show_line("! string pool file has no check sum.\n", 1);
3183 /* added following bit of explanation 96/Jan/16 */
3185 bad_formator_pool(string_file, "the pool file", "TEXPOOL");
3186 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3187 (void) a_close(pool_file);
3193 if(m == '*') /* last line starts with * */
3198 if((xord[n]< 48)||(xord[n]> 57))
3201 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3202 show_line("! string pool file check sum doesn't have nine digits.\n", 1);
3203 /* added following bit of explanation 96/Jan/16 */
3205 bad_formator_pool(string_file, "the pool file", "TEXPOOL");
3206 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3207 (void) a_close(pool_file);
3211 a = 10 * a + xord[n]- 48;
3217 /* tex.pool file check sum *367403084 */
3218 lab30: if(a != BEGINFMTCHECKSUM){
3220 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3221 show_line("! string pool check sum doesn't match; tangle me again.\n", 1);
3222 /* added following bit of explanation 96/Jan/16 */
3224 bad_formator_pool(string_file, "the pool file", "TEXPOOL");
3225 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3226 (void) a_close(pool_file);
3234 if((xord[m]< 48)||(xord[m]> 57)||(xord[n]< 48
3238 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3239 show_line("! string pool line doesn't begin with two digits.\n", 1);
3240 /* added following bit of explanation 96/Jan/16 */
3242 bad_formator_pool(string_file, "the pool file", "TEXPOOL");
3243 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3244 (void) a_close(pool_file);
3248 l = xord[m]* 10 + xord[n]- 48 * 11;
3249 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3250 #ifdef ALLOCATESTRING
3251 /* can freely extend memory, so we need not be paranoid - stringvacancies */
3252 /* if(pool_ptr + l + stringvacancies > current_pool_size)*/
3253 if(pool_ptr + l + stringmargin > current_pool_size){
3254 if (trace_flag) show_line("String margin reallocation\n", 0);
3255 /* str_pool = realloc_str_pool (pool_ptr + l + stringvacancies */
3256 str_pool = realloc_str_pool (pool_ptr + l + stringmargin
3257 - current_pool_size + increment_pool_size);
3259 if(pool_ptr + l + stringmargin > current_pool_size) /* 94/Jan/24 */
3261 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3262 if(pool_ptr + l + stringvacancies > pool_size)
3266 show_line("! You have to increase POOLSIZE.\n", 1);
3267 (void) a_close(pool_file);
3272 register integer for_end;
3280 else read(pool_file, m);
3282 str_pool[pool_ptr]= xord[m];
3286 while(k++ < for_end);
3288 readln(pool_file); /* flush rest to end of file / end of line */
3293 (void) a_close(pool_file);
3299 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3300 sprintf(log_line, "! I can't read %s.\n", poolname);
3301 show_line(log_line, 1);
3303 show_line(" (Was unable to find tex.poo or tex.pool)\n", 0); /* extra explain */
3304 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3313 void sort_avail (void)
3317 p = get_node(1073741824L); /* 2^30 merge adjacent free nodes */
3318 p = mem[rover + 1].hh.v.RH;
3319 /* mem[rover + 1].hh.v.RH = 262143L; */ /* NO! */
3320 mem[rover + 1].hh.v.RH = empty_flag;
3322 while(p != oldrover)if(p < rover)
3325 p = mem[q + 1].hh.v.RH;
3326 mem[q + 1].hh.v.RH = rover;
3332 while(mem[q + 1].hh.v.RH < p)q = mem[q + 1].hh.v.RH;
3333 r = mem[p + 1].hh.v.RH;
3334 mem[p + 1].hh.v.RH = mem[q + 1].hh.v.RH;
3335 mem[q + 1].hh.v.RH = p;
3339 /* while(mem[p + 1].hh.v.RH != 262143L){ */ /* NO! */
3340 while(mem[p + 1].hh.v.RH != empty_flag){
3342 mem[mem[p + 1].hh.v.RH + 1].hh.v.LH = p;
3343 p = mem[p + 1].hh.v.RH;
3345 mem[p + 1].hh.v.RH = rover;
3346 mem[rover + 1].hh.v.LH = p;
3351 void primitive_ (str_number s, quarterword c, halfword o)
3355 /* small_number l; */
3356 int l; /* 95/Jan/7 */
3358 cur_val = s + 257; /* cur_val <- s + single_base; p.264 */
3361 l = str_start[s + 1]- k; /* small_number l */
3363 register integer for_end;
3367 do buffer[j]= str_pool[k + j];
3368 while(j++ < for_end);
3370 cur_val = id_lookup(0, l);
3373 pool_ptr = str_start[str_ptr];
3375 /* ********************** debugging only 96/Jan/20 should not happen */
3377 if (s > 65535L) show_line("ERROR: hash entry too large\n", 1);
3379 hash[cur_val].v.RH = s;
3381 eqtb[cur_val].hh.b1 = 1;
3382 eqtb[cur_val].hh.b0 = c;
3383 eqtb[cur_val].hh.v.RH = o;
3387 /* more weird constants ? page 394 */
3390 trie_op_code new_trie_op_ (small_number d, small_number n, trie_op_code v)
3391 {/* 10 */ register trie_op_code Result;
3395 /* the 313, 361 and 1009 are hard-wired constants here p.944 */
3396 /* begin h:=abs(n+313*d+361*v+1009*cur_lang) mod (trie_op_size+trie_op_size) */
3397 h = abs(toint(n)+ 313 * toint(d)+ 361 * toint(v)+ 1009 *
3398 toint(cur_lang)) %(trie_op_size - neg_trie_op_size)+ neg_trie_op_size;
3401 /* if l=0 then {empty position found for a new op} */
3405 if(trie_op_ptr == trie_op_size){
3406 overflow(943, trie_op_size); /* pattern memory ops - NOT DYNAMIC */
3407 return 0; // abort_flag set
3409 u = trie_used[cur_lang];
3410 /* if u=max_quarterword then ??? */
3411 if(u == max_trie_op){
3412 /* overflow("pattern memory ops per language",
3413 max_quarterword-min_quarterword); ??? */
3414 overflow(944, max_trie_op - min_trie_op); /* pattern memory ops per language */
3415 return 0; // abort_flag set
3419 trie_used[cur_lang]= u;
3422 hyf_distance[trie_op_ptr]= d;
3423 hyf_num[trie_op_ptr]= n;
3424 hyf_next[trie_op_ptr]= v;
3425 trie_op_lang[trie_op_ptr]= cur_lang;
3426 trieophash[h]= trie_op_ptr;
3427 trie_op_val[trie_op_ptr]= u;
3431 if((hyf_distance[l]== d)&&(hyf_num[l]== n)&&(hyf_next[l
3432 ]== v)&&(trie_op_lang[l]== cur_lang))
3434 Result = trie_op_val[l];
3437 if(h > - (integer) trie_op_size)
3439 else h = trie_op_size;
3441 /* return Result; */ /* unreachable code */
3443 /* what are those horrible constants there ? page 395 */
3444 trie_pointer trie_node_ (trie_pointer p)
3445 {/* 10 */ register trie_pointer Result;
3448 /* the 1009, 2718, 3142 are hard-wired constants here (not hyphen_prime) */
3449 h = abs(toint(trie_c[p])+ 1009 * toint(trie_o[p])+ 2718 *
3450 toint(trie_l[p])+ 3142 * toint(trie_r[p])) % trie_size;
3459 if((trie_c[q]== trie_c[p])&&(trie_o[q]== trie_o[p])&&(
3460 trie_l[q]== trie_l[p])&&(trie_r[q]== trie_r[p]))
3469 /* return Result; */ /* unreachable code */
3471 trie_pointer compress_trie_ (trie_pointer p)
3472 {register trie_pointer Result;
3477 trie_l[p]= compress_trie(trie_l[p]);
3478 trie_r[p]= compress_trie(trie_r[p]);
3479 Result = trie_node(p);
3483 void first_fit_ (trie_pointer p)
3495 if(trie_max < h + 256)
3497 if(trie_size <= h + 256){
3498 overflow(945, trie_size); /* pattern memory - NOT DYNAMIC */
3499 /* not dynamic ---- but can be set -h=... from command line in ini-TeX */
3500 return; // abort_flag set
3504 trie_taken[trie_max]= false;
3505 trietrl[trie_max]= trie_max + 1;
3506 trietro[trie_max]= trie_max - 1;
3507 } while(!(trie_max == h + 256));
3513 if(trietrl[h + trie_c[q]] == 0)
3518 lab45: z = trietrl[z];
3521 trie_taken[h]= true; /* h may be used without ... */
3534 ll = z; /* short ll */
3539 } while(!(l == ll));
3544 void trie_pack_ (trie_pointer p)
3549 if((q > 0)&&(trie_hash[q]== 0))
3557 void trie_fix_ (trie_pointer p)
3566 trietrl[z + c]= trie_hash[q];
3568 trietro[z + c]= trie_o[p];
3574 void new_patterns (void)
3576 /* ******************************************************************* */
3577 /* was small_number k, l; in 3.141 */
3579 /* ******************************************************************* */
3585 int c; /* 95/Jan/7 */
3586 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3587 if (! trie_not_ready) { /* new stuff */
3588 if (allow_patterns) {
3589 if (trace_flag) show_line("Resetting patterns\n", 0);
3590 reset_trie(); /* RESET PATTERNS - 93/Nov/26 */
3591 if (reset_exceptions) {
3592 if (trace_flag) show_line("Resetting exceptions\n", 0);
3593 reset_hyphen(); /* RESET HYPHENEXCEPTIONS - 93/Nov/26 */
3597 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3600 if(eqtb[(hash_size + 3213)].cint <= 0)
3602 else if(eqtb[(hash_size + 3213)].cint > 255)
3604 else cur_lang = eqtb[(hash_size + 3213)].cint;
3608 digitsensed = false;
3614 if(digitsensed ||(cur_chr < 48)||(cur_chr > 57))
3616 if(cur_chr == 46) /* . */
3620 cur_chr = eqtb[(hash_size + 2139) + cur_chr].hh.v.RH;
3623 print_err("Nonletter");
3624 help1("(See Appendix H.)");
3633 digitsensed = false;
3638 hyf[k]= cur_chr - 48;
3655 v = new_trie_op(k - l, hyf[l], v);
3668 while((p > 0)&&(c > trie_c[p])) {
3673 if((p == 0)||(c < trie_c[p]))
3675 if(trie_ptr == trie_size){
3676 overflow(945, trie_size); /* pattern memory - NOT DYNAMIC */
3677 /* not dynamic ---- but can be set -h=... from command line in ini-TeX */
3678 return; // abort_flag set
3681 trie_r[trie_ptr]= p;
3688 trie_o[p]= min_trie_op;
3692 if(trie_o[q]!= min_trie_op)
3694 print_err("Duplicate pattern");
3695 help1("(See Appendix H.)");
3704 digitsensed = false;
3710 print_esc(947); /* patterns */
3711 help1("(See Appendix H.)");
3720 print_err("Too late for ");
3721 print_esc(947); /* patterns */
3722 help1("All patterns must be given before typesetting begins.");
3724 mem[mem_top - 12].hh.v.RH = scan_toks(false, false);
3725 flush_list(def_ref);
3728 void init_trie (void)
3731 /* integer j, k, t; */
3733 int t; /* 95/Jan/7 */
3735 op_start[0]= - (integer) min_trie_op;
3737 register integer for_end;
3741 op_start[j]= op_start[j - 1]+ trie_used[j - 1];
3742 while(j++ < for_end);
3745 register integer for_end;
3747 for_end = trie_op_ptr;
3750 trieophash[j]= op_start[trie_op_lang[j]] + trie_op_val[j];
3751 while(j++ < for_end);
3754 register integer for_end;
3756 for_end = trie_op_ptr;
3759 while(trieophash[j]> j){
3761 t = hyf_distance[k];
3762 hyf_distance[k]= hyf_distance[j];
3765 hyf_num[k]= hyf_num[j];
3768 hyf_next[k]= hyf_next[j];
3770 trieophash[j]= trieophash[k];
3773 while(j++ < for_end);
3776 register integer for_end;
3778 for_end = trie_size;
3781 while(p++ < for_end);
3783 trie_l[0]= compress_trie(trie_l[0]);
3785 register integer for_end;
3790 while(p++ < for_end);
3793 register integer for_end;
3798 while(p++ < for_end);
3804 first_fit(trie_l[0]);
3805 trie_pack(trie_l[0]);
3810 register integer for_end;
3816 trietro[r]= min_trie_op;
3819 while(r++ < for_end);
3824 trie_fix(trie_l[0]);
3830 trietro[r]= min_trie_op;
3834 } while(!(r > trie_max));
3837 trie_not_ready = false;
3842 void store_fmt_file (void)
3847 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3848 if (!is_initex) { /* redundant check 94/Feb/14 */
3849 show_line("! \\dump is performed only by INITEX\n", 1);
3851 show_line(" (Use -i on the command line)\n", 0);
3855 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
3857 print_err("You can't dump inside a group");
3858 help1("`{...\\dump}' is a no-no..");
3860 if(interaction == 3) interaction = 2;
3866 if(interaction > 0) debug_help ();
3869 jump_out (); // trying to \dump inside a group
3870 // return; // drops through now
3872 } /* end of if save_ptr != 0 */
3875 print(1266); /* (format= */
3877 print_char(32); /* */
3878 /* print_int(eqtb[(hash_size + 3186)].cint % 100); */ /* Y2K */
3879 print_int(eqtb[(hash_size + 3186)].cint); /* 98/Oct/12 */
3881 int n= eqtb[(hash_size + 3186)].cint;
3882 sprintf(log_line, "YEAR: %ld\n", n);
3883 show_line(log_line, 0);
3885 print_char(46); /* . */
3886 print_int(eqtb[(hash_size + 3185)].cint);
3887 print_char(46); /* . */
3888 print_int(eqtb[(hash_size + 3184)].cint);
3889 print_char(41); /*)*/
3890 if(interaction == 0)selector = 18;
3893 #ifdef ALLOCATESTRING
3894 if(pool_ptr + 1 > current_pool_size)
3895 str_pool = realloc_str_pool (increment_pool_size);
3896 if(pool_ptr + 1 > current_pool_size){ /* in case it failed 94/Jan/24 */
3897 overflow(257, current_pool_size - init_pool_ptr); /* 97/Mar/9 */
3898 return; // abort_flag set
3901 if(pool_ptr + 1 > pool_size){
3902 overflow(257, pool_size - init_pool_ptr); /* pool size */
3903 return; // abort_flag set
3907 format_ident = make_string ();
3908 pack_job_name(780); /* .fmt */
3909 while(! w_open_out(fmt_file)) {
3910 prompt_file_name(1267, 780); /* format file name .fmt */
3912 print_nl(" Beginning to dump on file "); /* */
3913 slow_print(w_make_name_string(fmt_file));
3916 pool_ptr = str_start[str_ptr];
3919 slow_print(format_ident);
3920 dump_int(BEGINFMTCHECKSUM); /* magic FMT file start 4C 20 E6 15 hex */
3924 dump_int((hash_size + 4006)); /* eqtbsize */
3925 dump_int(hash_prime);
3926 /* dump_int(607); */
3927 dump_int(hyphen_prime); /* bkph */
3930 if (dumpthings(str_start[0], str_ptr + 1)
3932 if (dumpthings(str_pool[0], pool_ptr)
3936 print(1254); /* strings of total length */
3937 print_int(pool_ptr);
3940 dump_int(lo_mem_max);
3946 if (dumpthings(mem[p], q + 2 - p)
3949 var_used = var_used + q - p;
3950 p = q + mem[q].hh.v.LH;
3951 q = mem[q + 1].hh.v.RH;
3952 } while(!(q == rover));
3953 var_used = var_used + lo_mem_max - p;
3954 dyn_used = mem_end + 1 - hi_mem_min;
3955 if (dumpthings(mem[p], lo_mem_max + 1 - p)
3957 x = x + lo_mem_max + 1 - p;
3958 dump_int(hi_mem_min);
3960 if (dumpthings(mem[hi_mem_min], mem_end + 1 - hi_mem_min)
3962 x = x + mem_end + 1 - hi_mem_min;
3972 print(1255); /* memory locations dumped; current usage is */
3973 print_int(var_used);
3974 print_char(38); /* & */
3975 print_int(dyn_used);
3979 while(j < (hash_size + 3162)){
3980 if((eqtb[j].hh.v.RH == eqtb[j + 1].hh.v.RH)&&(eqtb[j
3981 ].hh.b0 == eqtb[j + 1].hh.b0)&&(eqtb[j].hh.b1 == eqtb[j +
3986 l = (hash_size + 3163);
3990 while(j < (hash_size + 3162)){
3991 if((eqtb[j].hh.v.RH != eqtb[j + 1].hh.v.RH)||(eqtb[j
3992 ].hh.b0 != eqtb[j + 1].hh.b0)||(eqtb[j].hh.b1 != eqtb[j +
3997 lab31: dump_int(l - k);
3998 if (dumpthings(eqtb[k], l - k)
4002 } while(!(k == (hash_size + 3163)));
4005 while(j < (hash_size + 4006)){
4006 if(eqtb[j].cint == eqtb[j + 1].cint)
4010 l = (hash_size + 4007);
4014 while(j < (hash_size + 4006)){
4015 if(eqtb[j].cint != eqtb[j + 1].cint)
4019 lab32: dump_int(l - k);
4020 if (dumpthings(eqtb[k], l - k)
4024 } while(!(k > (hash_size + 4006)));
4026 dump_int(write_loc);
4027 dump_int(hash_used);
4028 /* cs_count:=frozen_control_sequence-1-hash_used; */
4029 /* cs_count = (hash_size + 513) - hash_used; */
4030 cs_count = (hash_size + hash_extra + 513) - hash_used;
4031 /* cs_count = (hash_size + 780) - hash_used; */ /* ??? */
4033 sprintf(log_line, "itex cs_count %d hash_size %d hash_extra %d hash_used %d",
4034 cs_count, hash_size, hash_extra, hash_used); /* debugging */
4035 show_line(log_line, 0);
4037 /* for p <- hash_base to hash_used do */
4039 register integer for_end;
4041 for_end = hash_used;
4043 if(hash[p].v.RH != 0){
4048 sprintf(log_line, "itex cs_count++ ");
4049 show_line(log_line, 0); /* debugging */
4052 while(p++ < for_end);
4055 /* for p <- hash_used+1 to undefined_control_sequence-1 do dump_hh(hash[p]) */
4056 if (dumpthings(hash[hash_used + 1], (hash_size + 780) - hash_used)
4060 print_int(cs_count);
4061 print(1256); /* multiletter control sequences */
4064 if (dumpthings(font_info[0], fmem_ptr)
4066 /* frozenfontptr = font_ptr; */ /* number of fonts frozen into format */
4068 if (dumpthings(font_check[0], font_ptr + 1))return;
4069 if (dumpthings(font_size[0], font_ptr + 1))return;
4070 if (dumpthings(font_dsize[0], font_ptr + 1))return;
4071 if (dumpthings(font_params[0], font_ptr + 1))return;
4072 if (dumpthings(hyphen_char[0], font_ptr + 1))return;
4073 if (dumpthings(skew_char[0], font_ptr + 1))return;
4074 if (dumpthings(font_name[0], font_ptr + 1))return;
4075 if (dumpthings(font_area[0], font_ptr + 1))return;
4076 if (dumpthings(font_bc[0], font_ptr + 1))return;
4077 if (dumpthings(font_ec[0], font_ptr + 1))return;
4078 if (dumpthings(char_base[0], font_ptr + 1))return;
4079 if (dumpthings(width_base[0], font_ptr + 1))return;
4080 if (dumpthings(height_base[0], font_ptr + 1))return;
4081 if (dumpthings(depth_base[0], font_ptr + 1))return;
4082 if (dumpthings(italic_base[0], font_ptr + 1))return;
4083 if (dumpthings(lig_kern_base[0], font_ptr + 1))return;
4084 if (dumpthings(kern_base[0], font_ptr + 1))return;
4085 if (dumpthings(exten_base[0], font_ptr + 1))return;
4086 if (dumpthings(param_base[0], font_ptr + 1))return;
4087 if (dumpthings(font_glue[0], font_ptr + 1))return;
4088 if (dumpthings(bchar_label[0], font_ptr + 1))return;
4089 if (dumpthings(font_bchar[0], font_ptr + 1))return;
4090 if (dumpthings(font_false_bchar[0], font_ptr + 1))return;
4092 register integer for_end;
4098 print_nl("\\font"); /* \font */
4099 /* print_esc(hash[(hash_size + 524) + k].v.RH); */
4100 print_esc(hash[(hash_size + hash_extra + 524) + k].v.RH);
4101 print_char(61); /* = */
4102 print_file_name(font_name[k], font_area[k], 335);
4103 if(font_size[k]!= font_dsize[k])
4105 print(738); /* at */
4106 print_scaled(font_size[k]);
4107 print(394); /* pt */
4110 while(k++ < for_end);
4114 print_int(fmem_ptr - 7);
4115 print(1257); /* words of font info for */
4116 print_int(font_ptr - 0);
4117 print(1258); /* preloaded font */
4119 print_char(115); /* s */
4120 dump_int(hyph_count);
4121 /* {register integer for_end; k = 0; for_end = 607; if(k <= for_end) do */
4123 register integer for_end;
4125 for_end = hyphen_prime;
4127 if(hyph_word[k]!= 0)
4130 dump_int(hyph_word[k]);
4131 dump_int(hyph_list[k]);
4133 while(k++ < for_end);
4136 print_int(hyph_count);
4137 print(1260); /* hyphenation exception */
4139 print_char(115); /* s */
4143 if (dumpthings(trietrl[0], trie_max + 1)
4145 if (dumpthings(trietro[0], trie_max + 1)
4147 if (dumpthings(trietrc[0], trie_max + 1)
4149 dump_int(trie_op_ptr);
4150 if (dumpthings(hyf_distance[1], trie_op_ptr)
4152 if (dumpthings(hyf_num[1], trie_op_ptr)
4154 if (dumpthings(hyf_next[1], trie_op_ptr)
4156 print_nl("Hyphenation trie of length "); /* */
4157 print_int(trie_max);
4158 print(1262); /* has */
4159 print_int(trie_op_ptr);
4160 print(1263); /* op */
4161 if(trie_op_ptr != 1)
4162 print_char(115); /* s */
4163 print(1264); /* out of */
4164 print_int(trie_op_size);
4166 register integer for_end;
4172 print_nl(" "); /* */
4173 print_int(trie_used[k]);
4174 print(1265); /* for language */
4177 dump_int(trie_used[k]);
4179 while(k-- > for_end);
4181 dump_int(interaction);
4182 dump_int(format_ident);
4183 dump_int(ENDFMTCHECKSUM); /* magic checksum end of FMT file --- change ??? */
4184 eqtb[(hash_size + 3194)].cint = 0; /* tracingstats */
4187 } /* end of store_fmt_file */
4191 void init_prim (void)
4193 no_new_control_sequence = false;
4194 primitive(373, 75, (hash_size + 782)); /* lineskip */
4195 primitive(374, 75, (hash_size + 783)); /* baselineskip */
4196 primitive(375, 75, (hash_size + 784)); /* parskip */
4197 primitive(376, 75, (hash_size + 785)); /* abovedisplayskip */
4198 primitive(377, 75, (hash_size + 786)); /* belowdisplayskip */
4199 primitive(378, 75, (hash_size + 787)); /* abovedisplayshortskip */
4200 primitive(379, 75, (hash_size + 788)); /* belowdisplayshortskip */
4201 primitive(380, 75, (hash_size + 789)); /* leftskip */
4202 primitive(381, 75, (hash_size + 790)); /* rightskip */
4203 primitive(382, 75, (hash_size + 791)); /* topskip */
4204 primitive(383, 75, (hash_size + 792)); /* splittopskip */
4205 primitive(384, 75, (hash_size + 793)); /* tabskip */
4206 primitive(385, 75, (hash_size + 794)); /* spaceskip */
4207 primitive(386, 75, (hash_size + 795)); /* xspaceskip */
4208 primitive(387, 75, (hash_size + 796)); /* parfillskip */
4209 primitive(388, 76, (hash_size + 797)); /* thinmuskip */
4210 primitive(389, 76, (hash_size + 798)); /* medmuskip */
4211 primitive(390, 76, (hash_size + 799)); /* thickmuskip */
4212 primitive(395, 72, (hash_size + 1313)); /* output */
4213 primitive(396, 72, (hash_size + 1314)); /* everypar */
4214 primitive(397, 72, (hash_size + 1315)); /* everymath */
4215 primitive(398, 72, (hash_size + 1316)); /* everydisplay */
4216 primitive(399, 72, (hash_size + 1317)); /* everyhbox */
4217 primitive(400, 72, (hash_size + 1318)); /* everyvbox */
4218 primitive(401, 72, (hash_size + 1319)); /* everyjob */
4219 primitive(402, 72, (hash_size + 1320)); /* everycr */
4220 primitive(403, 72, (hash_size + 1321)); /* errhelp */
4221 primitive(417, 73, (hash_size + 3163)); /* pretolerance */
4222 primitive(418, 73, (hash_size + 3164)); /* tolerance */
4223 primitive(419, 73, (hash_size + 3165)); /* linepenalty */
4224 primitive(420, 73, (hash_size + 3166)); /* hyphenpenalty */
4225 primitive(421, 73, (hash_size + 3167)); /* exhyphenpenalty */
4226 primitive(422, 73, (hash_size + 3168)); /* clubpenalty */
4227 primitive(423, 73, (hash_size + 3169)); /* widowpenalty */
4228 primitive(424, 73, (hash_size + 3170)); /* displaywidowpenalty */
4229 primitive(425, 73, (hash_size + 3171)); /* brokenpenalty */
4230 primitive(426, 73, (hash_size + 3172)); /* binoppenalty */
4231 primitive(427, 73, (hash_size + 3173)); /* relpenalty */
4232 primitive(428, 73, (hash_size + 3174)); /* predisplaypenalty */
4233 primitive(429, 73, (hash_size + 3175)); /* postdisplaypenalty */
4234 primitive(430, 73, (hash_size + 3176)); /* interlinepenalty */
4235 primitive(431, 73, (hash_size + 3177)); /* doublehyphendemerits */
4236 primitive(432, 73, (hash_size + 3178)); /* finalhyphendemerits */
4237 primitive(433, 73, (hash_size + 3179)); /* adjdemerits */
4238 primitive(434, 73, (hash_size + 3180)); /* mag */
4239 primitive(435, 73, (hash_size + 3181)); /* delimiterfactor */
4240 primitive(436, 73, (hash_size + 3182)); /* looseness */
4241 primitive(437, 73, (hash_size + 3183)); /* time */
4242 primitive(438, 73, (hash_size + 3184)); /* day */
4243 primitive(439, 73, (hash_size + 3185)); /* month */
4244 primitive(440, 73, (hash_size + 3186)); /* year */
4245 primitive(441, 73, (hash_size + 3187)); /* showboxbreadth */
4246 primitive(442, 73, (hash_size + 3188)); /* showboxdepth */
4247 primitive(443, 73, (hash_size + 3189)); /* hbadness */
4248 primitive(444, 73, (hash_size + 3190)); /* vbadness */
4249 primitive(445, 73, (hash_size + 3191)); /* pausing */
4250 primitive(446, 73, (hash_size + 3192)); /* tracingonline */
4251 primitive(447, 73, (hash_size + 3193)); /* tracingmacros */
4252 primitive(448, 73, (hash_size + 3194)); /* tracingstats */
4253 primitive(449, 73, (hash_size + 3195)); /* tracingparagraphs */
4254 primitive(450, 73, (hash_size + 3196)); /* tracingpages */
4255 primitive(451, 73, (hash_size + 3197)); /* tracingoutput */
4256 primitive(452, 73, (hash_size + 3198)); /* tracinglostchars */
4257 primitive(453, 73, (hash_size + 3199)); /* tracingcommands */
4258 primitive(454, 73, (hash_size + 3200)); /* tracingrestores */
4259 primitive(455, 73, (hash_size + 3201)); /* uchyph */
4260 primitive(456, 73, (hash_size + 3202)); /* outputpenalty */
4261 primitive(457, 73, (hash_size + 3203)); /* maxdeadcycles */
4262 primitive(458, 73, (hash_size + 3204)); /* hangafter */
4263 primitive(459, 73, (hash_size + 3205)); /* floatingpenalty */
4264 primitive(460, 73, (hash_size + 3206)); /* globaldefs */
4265 primitive(461, 73, (hash_size + 3207)); /* fam */
4266 primitive(462, 73, (hash_size + 3208)); /* escapechar */
4267 primitive(463, 73, (hash_size + 3209)); /* defaulthyphenchar */
4268 primitive(464, 73, (hash_size + 3210)); /* defaultskewchar */
4269 primitive(465, 73, (hash_size + 3211)); /* endlinechar */
4270 primitive(466, 73, (hash_size + 3212)); /* newlinechar */
4271 primitive(467, 73, (hash_size + 3213)); /* language */
4272 primitive(468, 73, (hash_size + 3214)); /* lefthyphenmin */
4273 primitive(469, 73, (hash_size + 3215)); /* righthyphenmin */
4274 primitive(470, 73, (hash_size + 3216)); /* holdinginserts */
4275 primitive(471, 73, (hash_size + 3217)); /* errorcontextlines */
4276 primitive(475, 74, (hash_size + 3730)); /* parindent */
4277 primitive(476, 74, (hash_size + 3731)); /* mathsurround */
4278 primitive(477, 74, (hash_size + 3732)); /* lineskiplimit */
4279 primitive(478, 74, (hash_size + 3733)); /* hsize */
4280 primitive(479, 74, (hash_size + 3734)); /* vsize */
4281 primitive(480, 74, (hash_size + 3735)); /* maxdepth */
4282 primitive(481, 74, (hash_size + 3736)); /* splitmaxdepth */
4283 primitive(482, 74, (hash_size + 3737)); /* boxmaxdepth */
4284 primitive(483, 74, (hash_size + 3738)); /* hfuzz */
4285 primitive(484, 74, (hash_size + 3739)); /* vfuzz */
4286 primitive(485, 74, (hash_size + 3740)); /* delimitershortfall */
4287 primitive(486, 74, (hash_size + 3741)); /* nulldelimiterspace */
4288 primitive(487, 74, (hash_size + 3742)); /* scriptspace */
4289 primitive(488, 74, (hash_size + 3743)); /* predisplaysize */
4290 primitive(489, 74, (hash_size + 3744)); /* displaywidth */
4291 primitive(490, 74, (hash_size + 3745)); /* displayindent */
4292 primitive(491, 74, (hash_size + 3746)); /* overfullrule */
4293 primitive(492, 74, (hash_size + 3747)); /* hangindent */
4294 primitive(493, 74, (hash_size + 3748)); /* hoffset */
4295 primitive(494, 74, (hash_size + 3749)); /* voffset */
4296 primitive(495, 74, (hash_size + 3750)); /* emergencystretch */
4297 primitive(32, 64, 0); /* */
4298 primitive(47, 44, 0); /* / */
4299 primitive(505, 45, 0); /* accent */
4300 primitive(506, 90, 0); /* advance */
4301 primitive(507, 40, 0); /* afterassignment */
4302 primitive(508, 41, 0); /* aftergroup */
4303 primitive(509, 61, 0); /* begingroup */
4304 primitive(510, 16, 0); /* char */
4305 primitive(501, 107, 0); /* csname */
4306 primitive(511, 15, 0); /* delimiter */
4307 primitive(512, 92, 0); /* divide */
4308 primitive(502, 67, 0); /* endcsname */
4309 primitive(513, 62, 0); /* endgroup */
4310 /* hash[(hash_size + 516)].v.RH = 513; */
4311 hash[(hash_size + hash_extra + 516)].v.RH = 513; /* endgroup */
4312 /* eqtb[(hash_size + 516)]= eqtb[cur_val]; */
4313 eqtb[(hash_size + hash_extra + 516)]= eqtb[cur_val];
4314 primitive(514, 102, 0); /* expandafter */
4315 primitive(515, 88, 0); /* font */
4316 primitive(516, 77, 0); /* fontdimen */
4317 primitive(517, 32, 0); /* halign */
4318 primitive(518, 36, 0); /* hrule */
4319 primitive(519, 39, 0); /* ignorespaces */
4320 primitive(327, 37, 0); /* insert */
4321 primitive(348, 18, 0); /* mark */
4322 primitive(520, 46, 0); /* mathaccent */
4323 primitive(521, 17, 0); /* mathchar */
4324 primitive(522, 54, 0); /* mathchoice */
4325 primitive(523, 91, 0); /* multiply */
4326 primitive(524, 34, 0); /* noalign */
4327 primitive(525, 65, 0); /* noboundary */
4328 primitive(526, 103, 0); /* noexpand */
4329 primitive(332, 55, 0); /* nonscript */
4330 primitive(527, 63, 0); /* omit */
4331 primitive(405, 84, 0); /* parshape */
4332 primitive(528, 42, 0); /* penalty */
4333 primitive(529, 80, 0); /* prevgraf */
4334 primitive(530, 66, 0); /* radical */
4335 primitive(531, 96, 0); /* read */
4336 primitive(532, 0, 256); /* primitive("relax",relax,256); */
4337 /* hash[(hash_size + 521)].v.RH = 532; */
4338 hash[(hash_size + hash_extra + 521)].v.RH = 532; /* read */
4339 /* eqtb[(hash_size + 521)]= eqtb[cur_val]; */
4340 eqtb[(hash_size + hash_extra + 521)]= eqtb[cur_val];
4341 primitive(533, 98, 0); /* setbox */
4342 primitive(534, 109, 0); /* the */
4343 primitive(404, 71, 0); /* toks */
4344 primitive(349, 38, 0); /* vadjust */
4345 primitive(535, 33, 0); /* valign */
4346 primitive(536, 56, 0); /* vcenter */
4347 primitive(537, 35, 0); /* vrule */
4348 primitive(594, 13, 256); /* par */
4350 par_token = 4095 + par_loc;
4351 primitive(626, 104, 0); /* input */
4352 primitive(627, 104, 1); /* endinput */
4353 primitive(628, 110, 0); /* topmark */
4354 primitive(629, 110, 1); /* firstmark */
4355 primitive(630, 110, 2); /* botmark */
4356 primitive(631, 110, 3); /* splitfirstmark */
4357 primitive(632, 110, 4); /* splitbotmark */
4358 primitive(473, 89, 0); /* count */
4359 primitive(497, 89, 1); /* dimen */
4360 primitive(392, 89, 2); /* skip */
4361 primitive(393, 89, 3); /* muskip */
4362 primitive(665, 79, 102); /* spacefactor */
4363 primitive(666, 79, 1); /* prevdepth */
4364 primitive(667, 82, 0); /* dead_cycles */
4365 primitive(668, 82, 1); /* insert_penalties */
4366 primitive(669, 83, 1); /* wd */
4367 primitive(670, 83, 3); /* ht */
4368 primitive(671, 83, 2); /* dp */
4369 primitive(672, 70, 0); /* last_penalty */
4370 primitive(673, 70, 1); /* last_kern */
4371 primitive(674, 70, 2); /* lastskip */
4372 primitive(675, 70, 3); /* inputlineno */
4373 primitive(676, 70, 4); /* badness */
4374 primitive(732, 108, 0); /* number */
4375 primitive(733, 108, 1); /* romannumeral */
4376 primitive(734, 108, 2); /* string */
4377 primitive(735, 108, 3); /* meaning */
4378 primitive(736, 108, 4); /* font_name */
4379 primitive(737, 108, 5); /* job_name */
4380 primitive(753, 105, 0); /* if */
4381 primitive(754, 105, 1); /* ifcat */
4382 primitive(755, 105, 2); /* ifnum */
4383 primitive(756, 105, 3); /* ifdim */
4384 primitive(757, 105, 4); /* ifodd */
4385 primitive(758, 105, 5); /* ifvmode */
4386 primitive(759, 105, 6); /* ifhmode */
4387 primitive(760, 105, 7); /* ifmmode */
4388 primitive(761, 105, 8); /* ifinner */
4389 primitive(762, 105, 9); /* ifvoid */
4390 primitive(763, 105, 10); /* ifhbox */
4391 primitive(764, 105, 11); /* ifvbox */
4392 primitive(765, 105, 12); /* ifx */
4393 primitive(766, 105, 13); /* ifeof */
4394 primitive(767, 105, 14); /* iftrue */
4395 primitive(768, 105, 15); /* iffalse */
4396 primitive(769, 105, 16); /* ifcase */
4397 primitive(770, 106, 2); /* fi */
4398 /* hash[(hash_size + 518)].v.RH = 770; */
4399 hash[(hash_size + hash_extra + 518)].v.RH = 770; /* fi */
4400 /* eqtb[(hash_size + 518)]= eqtb[cur_val]; */
4401 eqtb[(hash_size + hash_extra + 518)]= eqtb[cur_val];
4402 primitive(771, 106, 4); /* or */
4403 primitive(772, 106, 3); /* else */
4404 primitive(795, 87, 0); /* nullfont */
4405 /* hash[(hash_size + 524)].v.RH = 795; */ /* hash[frozen_null_font] */
4406 hash[(hash_size + hash_extra + 524)].v.RH = 795; /* nullfont */
4407 /* eqtb[(hash_size + 524)]= eqtb[cur_val]; */
4408 eqtb[(hash_size + hash_extra + 524)]= eqtb[cur_val];
4409 primitive(892, 4, 256); /* span */
4410 /* primitive("span",tab_mark,span_code); */
4411 primitive(893, 5, 257); /* cr */
4412 /* primitive("cr",car_ret,cr_code); */
4413 /* hash[(hash_size + 515)].v.RH = 893; */
4414 hash[(hash_size + hash_extra + 515)].v.RH = 893; /* cr */
4415 /* eqtb[(hash_size + 515)]= eqtb[cur_val]; */
4416 eqtb[(hash_size + hash_extra + 515)]= eqtb[cur_val];
4417 primitive(894, 5, 258); /* cr cr */
4418 /* hash[(hash_size + 519)].v.RH = 895; */
4419 hash[(hash_size + hash_extra + 519)].v.RH = 895; /* endtemplate */
4420 /* hash[(hash_size + 520)].v.RH = 895; */
4421 hash[(hash_size + hash_extra + 520)].v.RH = 895; /* endtemplate */
4422 /* eqtb[(hash_size + 520)].hh.b0 = 9; */
4423 eqtb[(hash_size + hash_extra + 520)].hh.b0 = 9;
4424 /* eqtb[(hash_size + 520)].hh.v.RH = mem_top - 11; */
4425 eqtb[(hash_size + hash_extra + 520)].hh.v.RH = mem_top - 11;
4426 /* eqtb[(hash_size + 520)].hh.b1 = 1; */
4427 eqtb[(hash_size + hash_extra + 520)].hh.b1 = 1;
4428 /* eqtb[(hash_size + 519)]= eqtb[(hash_size + 520)]; */
4429 eqtb[(hash_size + hash_extra + 519)]=
4430 eqtb[(hash_size + hash_extra + 520)];
4431 /* eqtb[(hash_size + 519)].hh.b0 = 115; */
4432 eqtb[(hash_size + hash_extra + 519)].hh.b0 = 115;
4433 primitive(964, 81, 0); /* pagegoal */
4434 primitive(965, 81, 1); /* pagetotal */
4435 primitive(966, 81, 2); /* pagestretch */
4436 primitive(967, 81, 3); /* pagefilstretch */
4437 primitive(968, 81, 4); /* pagefillstretch */
4438 primitive(969, 81, 5); /* pagefilllstretch */
4439 primitive(970, 81, 6); /* pageshrink */
4440 primitive(971, 81, 7); /* pagedepth */
4441 primitive(1019, 14, 0); /* end */
4442 primitive(1020, 14, 1); /* dump */
4443 primitive(1021, 26, 4); /* hskip */
4444 primitive(1022, 26, 0); /* hfil */
4445 primitive(1023, 26, 1); /* hfill */
4446 primitive(1024, 26, 2); /* hss */
4447 primitive(1025, 26, 3); /* hfilneg */
4448 primitive(1026, 27, 4); /* vskip */
4449 primitive(1027, 27, 0); /* vfil */
4450 primitive(1028, 27, 1); /* vfill */
4451 primitive(1029, 27, 2); /* vss */
4452 primitive(1030, 27, 3); /* vfilneg */
4453 primitive(333, 28, 5); /* mskip */
4454 primitive(337, 29, 1); /* kern */
4455 primitive(339, 30, 99); /* mkern */
4456 primitive(1048, 21, 1); /* moveleft */
4457 primitive(1049, 21, 0); /* moveright */
4458 primitive(1050, 22, 1); /* raise */
4459 primitive(1051, 22, 0); /* lower */
4460 primitive(406, 20, 0); /* box */
4461 primitive(1052, 20, 1); /* copy */
4462 primitive(1053, 20, 2); /* lastbox */
4463 primitive(959, 20, 3); /* vsplit */
4464 primitive(1054, 20, 4); /* vtop */
4465 primitive(961, 20, 5); /* vbox */
4466 primitive(1055, 20, 106); /* hbox */
4467 primitive(1056, 31, 99); /* ship_out */
4468 primitive(1057, 31, 100); /* leaders */
4469 primitive(1058, 31, 101); /* cleaders */
4470 primitive(1059, 31, 102); /* xleaders */
4471 primitive(1074, 43, 1); /* indent */
4472 primitive(1075, 43, 0); /* noindent */
4473 primitive(1084, 25, 12); /* unpenalty */
4474 primitive(1085, 25, 11); /* unkern */
4475 primitive(1086, 25, 10); /* unskip */
4476 primitive(1087, 23, 0); /* unhbox */
4477 primitive(1088, 23, 1); /* unhcopy */
4478 primitive(1089, 24, 0); /* unvbox */
4479 primitive(1090, 24, 1); /* unvcopy */
4480 primitive(45, 47, 1); /* - */
4481 primitive(346, 47, 0); /* discretionary */
4482 primitive(1121, 48, 0); /* eqno */
4483 primitive(1122, 48, 1); /* leqno */
4484 primitive(860, 50, 16); /* mathord */
4485 primitive(861, 50, 17); /* mathop */
4486 primitive(862, 50, 18); /* mathbin */
4487 primitive(863, 50, 19); /* mathrel */
4488 primitive(864, 50, 20); /* mathopen */
4489 primitive(865, 50, 21); /* mathclose */
4490 primitive(866, 50, 22); /* mathpunct */
4491 primitive(867, 50, 23); /* mathinner */
4492 primitive(869, 50, 26); /* underline */
4493 primitive(868, 50, 27); /* overline */
4494 primitive(1123, 51, 0); /* displaylimits */
4495 primitive(872, 51, 1); /* limits */
4496 primitive(873, 51, 2); /* nolimits */
4497 primitive(855, 53, 0); /* displaystyle */
4498 primitive(856, 53, 2); /* textstyle */
4499 primitive(857, 53, 4); /* scriptstyle */
4500 primitive(858, 53, 6); /* scriptscriptstyle */
4501 primitive(1141, 52, 0); /* above */
4502 primitive(1142, 52, 1); /* over */
4503 primitive(1143, 52, 2); /* atop */
4504 primitive(1144, 52, 3); /* abovewithdelims */
4505 primitive(1145, 52, 4); /* overwithdelims */
4506 primitive(1146, 52, 5); /* atopwithdelims */
4507 primitive(870, 49, 30); /* left */
4508 primitive(871, 49, 31); /* right */
4509 /* hash[(hash_size + 517)].v.RH = 871; */
4510 hash[(hash_size + hash_extra + 517)].v.RH = 871; /* right */
4511 /* eqtb[(hash_size + 517)]= eqtb[cur_val]; */
4512 eqtb[(hash_size + hash_extra + 517)]= eqtb[cur_val];
4513 primitive(1165, 93, 1); /* long */
4514 primitive(1166, 93, 2); /* outer */
4515 primitive(1167, 93, 4); /* global */
4516 primitive(1168, 97, 0); /* def */
4517 primitive(1169, 97, 1); /* gdef */
4518 primitive(1170, 97, 2); /* edef */
4519 primitive(1171, 97, 3); /* xdef */
4520 primitive(1185, 94, 0); /* let */
4521 primitive(1186, 94, 1); /* futurelet */
4522 primitive(1187, 95, 0); /* chardef */
4523 primitive(1188, 95, 1); /* mathchardef */
4524 primitive(1189, 95, 2); /* countdef */
4525 primitive(1190, 95, 3); /* dimendef */
4526 primitive(1191, 95, 4); /* skipdef */
4527 primitive(1192, 95, 5); /* muskipdef */
4528 primitive(1193, 95, 6); /* toksdef */
4529 primitive(412, 85, (hash_size + 1883)); /* catcode */
4530 primitive(416, 85, (hash_size + 2907)); /* mathcode */
4531 primitive(413, 85, (hash_size + 2139)); /* lccode */
4532 primitive(414, 85, (hash_size + 2395)); /* uccode */
4533 primitive(415, 85, (hash_size + 2651)); /* sfcode */
4534 primitive(474, 85, (hash_size + 3474)); /* delcode */
4535 primitive(409, 86, (hash_size + 1835)); /* textfont */
4536 primitive(410, 86, (hash_size + 1851)); /* scriptfont */
4537 primitive(411, 86, (hash_size + 1867)); /* scriptscriptfont */
4538 primitive(935, 99, 0); /* hyphenation */
4539 primitive(947, 99, 1); /* patterns */
4540 primitive(1211, 78, 0); /* hyphen_char */
4541 primitive(1212, 78, 1); /* skew_char */
4542 primitive(272, 100, 0); /* batchmode */
4543 primitive(273, 100, 1); /* nonstopmode */
4544 primitive(274, 100, 2); /* scrollmode */
4545 primitive(1221, 100, 3); /* errorstopmode */
4546 primitive(1222, 60, 1); /* openin */
4547 primitive(1223, 60, 0); /* closein */
4548 primitive(1224, 58, 0); /* message */
4549 primitive(1225, 58, 1); /* errmessage */
4550 primitive(1231, 57, (hash_size + 2139)); /* lowercase */
4551 primitive(1232, 57, (hash_size + 2395)); /* uppercase */
4552 primitive(1233, 19, 0); /* show */
4553 primitive(1234, 19, 1); /* show_box */
4554 primitive(1235, 19, 2); /* showthe */
4555 primitive(1236, 19, 3); /* showlists */
4556 primitive(1279, 59, 0); /* openout */
4557 primitive(591, 59, 1); /* write */
4558 write_loc = cur_val;
4559 primitive(1280, 59, 2); /* closeout */
4560 primitive(1281, 59, 3); /* special */
4561 primitive(1282, 59, 4); /* immediate */
4562 primitive(1283, 59, 5); /* setlanguage */
4563 no_new_control_sequence = true;
4567 #pragma optimize("s", off) /* 96/Sep/12 */
4568 /* #pragma optimize("1", off) */
4569 #pragma optimize("t", on) /* 96/Sep/12 */
4570 /* #pragma optimize("2", on) */