2 #pragma warning(disable:4996)
3 #pragma warning(disable:4131) // old style declarator
4 #pragma warning(disable:4135) // conversion between different integral types
5 #pragma warning(disable:4127) // conditional expression is constant
11 #pragma warning(disable:4244) /* 96/Jan/10 */
13 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
15 void show_box_(halfword p)
17 depth_threshold = show_box_depth;
18 breadth_max = show_box_breadth;
24 if (pool_ptr + depth_threshold >= current_pool_size)
25 str_pool = realloc_str_pool(increment_pool_size);
27 if (pool_ptr + depth_threshold >= current_pool_size)
28 depth_threshold = current_pool_size - pool_ptr - 1;
30 if (pool_ptr + depth_threshold >= pool_size)
31 depth_threshold = pool_size - pool_ptr - 1;
38 void delete_token_ref_(halfword p)
40 if (token_ref_count(p) == 0)
43 decr(token_ref_count(p));
46 void delete_glue_ref_(halfword p)
48 if (glue_ref_count(p) == 0)
49 free_node(p, glue_spec_size);
51 decr(glue_ref_count(p));
54 void flush_node_list_(halfword p)
58 while (p != 0) { /* while p<>null */
71 flush_node_list(list_ptr(p));
72 free_node(p, box_node_size);
78 free_node(p, rule_node_size);
84 flush_node_list(ins_ptr(p));
85 delete_glue_ref(split_top_ptr(p));
86 free_node(p, ins_node_size);
95 free_node(p, open_node_size);
100 delete_token_ref(write_tokens(p));
101 free_node(p, write_node_size);
106 case set_language_code:
107 free_node(p, small_node_size);
112 return; // abort_flag set
121 if (mem[mem[p + 1].hh.v.LH].hh.v.RH == 0)
122 free_node(mem[p + 1].hh.v.LH, 4);
124 decr(mem[mem[p + 1].hh.v.LH].hh.v.RH);
127 if (leader_ptr(p) != 0)
128 flush_node_list(leader_ptr(p));
135 flush_node_list(lig_ptr(p));
138 delete_token_ref(mark_ptr(p));
141 flush_node_list(pre_break(p));
142 flush_node_list(post_break(p));
145 flush_node_list(adjust_ptr(p));
149 free_node(p, style_node_size);
155 flush_node_list(display_mlist(p));
156 flush_node_list(text_mlist(p));
157 flush_node_list(script_mlist(p));
158 flush_node_list(script_script_mlist(p));
159 free_node(p, style_node_size);
177 if (math_type(nucleus(p)) >= sub_box)
178 flush_node_list(info(nucleus(p)));
180 if (math_type(supscr(p)) >= sub_box)
181 flush_node_list(info(supscr(p)));
183 if (math_type(subscr(p)) >= sub_box)
184 flush_node_list(info(subscr(p)));
186 if (type(p) == radical_noad)
187 free_node(p, radical_noad_size);
190 if (type(p) == accent_noad)
191 free_node(p, accent_noad_size);
193 free_node(p, noad_size);
201 free_node(p, noad_size);
207 flush_node_list(info(numerator(p)));
208 flush_node_list(info(denominator(p)));
209 free_node(p, fraction_noad_size);
215 confusion("flushing");
216 return; // abort_flag set
220 free_node(p, small_node_size);
227 halfword copy_node_list_(halfword p)
229 register halfword Result;
238 while (p != 0) { /* while p<>null do l.3969 */
241 if ((p >= hi_mem_min))
243 else switch (type(p))
249 r = get_node(box_node_size);
250 mem[r + 6] = mem[p + 6];
251 mem[r + 5] = mem[p + 5];
252 list_ptr(r) = copy_node_list(list_ptr(p));
258 r = get_node(rule_node_size);
259 words = rule_node_size;
264 r = get_node(ins_node_size);
265 mem[r + 4] = mem[p + 4];
266 add_glue_ref(split_top_ptr(p));
267 ins_ptr(r) = copy_node_list(ins_ptr(p));
268 words = ins_node_size - 1;
276 r = get_node(open_node_size);
277 words = open_node_size;
284 r = get_node(write_node_size);
285 add_token_ref(write_tokens(p));
286 words = write_node_size;
293 r = get_node(small_node_size);
294 words = small_node_size;
301 return 0; // abort_flag set
309 r = get_node(small_node_size);
310 add_glue_ref(glue_ptr(p));
311 glue_ptr(r) = glue_ptr(p);
312 leader_ptr(r) = copy_node_list(leader_ptr(p));
320 r = get_node(small_node_size);
321 words = small_node_size;
327 r = get_node(small_node_size);
328 mem[lig_char(r)] = mem[lig_char(p)];
329 lig_ptr(r) = copy_node_list(lig_ptr(p));
335 r = get_node(small_node_size);
336 pre_break(r) = copy_node_list(pre_break(p));
337 post_break(r) = copy_node_list(pre_break(p));
343 r = get_node(small_node_size);
344 add_token_ref(mark_ptr(p));
345 words = small_node_size;
351 r = get_node(small_node_size);
352 adjust_ptr(r) = copy_node_list(adjust_ptr(p));
358 confusion("copying");
359 return 0; // abort_flag set
367 mem[r + words] = mem[p + words]; /* r may be used without having ... */
383 void print_mode_(integer m)
387 switch (m / (max_command + 1))
390 print_string("vertical");
393 print_string("horizontal");
396 print_string("display math");
408 switch ((- (integer) m) / (max_command + 1))
411 print_string("internal vertical");
414 print_string("restricted horizontal");
417 print_string("math");
422 print_string(" mode");
425 void push_nest (void)
427 if (nest_ptr > max_nest_stack)
429 max_nest_stack = nest_ptr;
431 #ifdef ALLOCATEINPUTSTACK
432 if (nest_ptr == current_nest_size)
433 nest = realloc_nest_stack(increment_nest_size);
435 if (nest_ptr == current_nest_size) /* check again after allocation */
437 overflow("semantic nest size", current_nest_size);
438 return; // abort_flag set
441 if (nest_ptr == nest_size)
443 overflow("semantic nest size", nest_size); /* semantic next size - not dynamic */
444 return; // abort_flag set
448 nest[nest_ptr]= cur_list;
460 cur_list = nest[nest_ptr];
463 void show_activities (void)
471 nest[nest_ptr] = cur_list;
475 for (p = nest_ptr; p >= 0; p--)
477 m = nest[p].mode_field;
478 a = nest[p].aux_field;
481 print_string(" entered at line ");
482 print_int(abs(nest[p].ml_field));
486 if (nest[p].pg_field != 040600000)
488 print_string(" (language");
489 print_int(nest[p].pg_field % 65536L);
490 print_string(":hyphenmin");
491 print_int(nest[p].pg_field / 4194304L);
493 print_int((nest[p].pg_field / 65536L) % 64);
498 if (nest[p].ml_field < 0)
500 print_string(" (\\output routine)");
505 if (page_head != page_tail)
507 print_nl("### current page:");
511 print_string(" (held over for next output)");
514 show_box(link(page_head));
516 if (page_contents > 0)
518 print_nl("total height ");
520 print_nl(" goal height ");
521 print_scaled(page_so_far[0]);
522 r = link(page_ins_head);
530 print_string(" adds ");
532 if (count(t) == 1000)
535 t = x_over_n(height(r), 1000) * count(t);
539 if (type(r) == split_up)
548 if ((type(q) == ins_node) && (subtype(q) == subtype(r)))
551 while (!(q == broken_ins(r)));
555 print_string(" might split");
562 if (link(contrib_head) != 0)
563 print_nl("### recent contributions:");
566 show_box(link(nest[p].head_field));
568 switch (abs(m) / (max_command + 1))
572 print_nl("prevdepth ");
574 if (a.cint <= ignore_depth)
575 print_string("ignored");
577 print_scaled(a.cint);
579 if (nest[p].pg_field != 0)
581 print_string(", prevgraf ");
582 print_int(nest[p].pg_field);
583 print_string(" line");
585 if (nest[p].pg_field != 1)
593 print_nl("spacefactor ");
594 print_int(a.hh.v.LH);
600 print_string(", current language ");
601 print_int(a.hh.v.RH);
610 print_string("this will be denominator of:");
618 void print_param_(integer n)
622 case pretolerance_code:
623 print_esc("pretolerance");
627 print_esc("tolerance");
630 case line_penalty_code:
631 print_esc("linepenalty");
634 case hyphen_penalty_code:
635 print_esc("hyphenpenalty");
638 case ex_hyphen_penalty_code:
639 print_esc("exhyphenpenalty");
642 case club_penalty_code:
643 print_esc("clubpenalty");
646 case widow_penalty_code:
647 print_esc("widowpenalty");
650 case display_widow_penalty_code:
651 print_esc("displaywidowpenalty");
654 case broken_penalty_code:
655 print_esc("brokenpenalty");
658 case bin_op_penalty_code:
659 print_esc("binoppenalty");
662 case rel_penalty_code:
663 print_esc("relpenalty");
666 case pre_display_penalty_code:
667 print_esc("predisplaypenalty");
670 case post_display_penalty_code:
671 print_esc("postdisplaypenalty");
674 case inter_line_penalty_code:
675 print_esc("interlinepenalty");
678 case double_hyphen_demerits_code:
679 print_esc("doublehyphendemerits");
682 case final_hyphen_demerits_code:
683 print_esc("finalhyphendemerits");
686 case adj_demerits_code:
687 print_esc("adjdemerits");
694 case delimiter_factor_code:
695 print_esc("delimiterfactor");
699 print_esc("looseness");
718 case show_box_breadth_code:
719 print_esc("showboxbreadth");
722 case show_box_depth_code:
723 print_esc("showboxdepth");
727 print_esc("hbadness");
731 print_esc("vbadness");
735 print_esc("pausing");
738 case tracing_online_code:
739 print_esc("tracingonline");
742 case tracing_macros_code:
743 print_esc("tracingmacros");
746 case tracing_stats_code:
747 print_esc("tracingstats");
750 case tracing_paragraphs_code:
751 print_esc("tracingparagraphs");
754 case tracing_pages_code:
755 print_esc("tracingpages");
758 case tracing_output_code:
759 print_esc("tracingoutput");
762 case tracing_lost_chars_code:
763 print_esc("tracinglostchars");
766 case tracing_commands_code:
767 print_esc("tracingcommands");
770 case tracing_restores_code:
771 print_esc("tracingrestores");
778 case output_penalty_code:
779 print_esc("outputpenalty");
782 case max_dead_cycles_code:
783 print_esc("maxdeadcycles");
786 case hang_after_code:
787 print_esc("hangafter");
790 case floating_penalty_code:
791 print_esc("floatingpenalty");
794 case global_defs_code:
795 print_esc("globaldefs");
802 case escape_char_code:
803 print_esc("escapechar");
806 case default_hyphen_char_code:
807 print_esc("defaulthyphenchar");
810 case default_skew_char_code:
811 print_esc("defaultskewchar");
814 case end_line_char_code:
815 print_esc("endlinechar");
818 case new_line_char_code:
819 print_esc("newlinechar");
823 print_esc("language");
826 case left_hyphen_min_code:
827 print_esc("lefthyphenmin");
830 case right_hyphen_min_code:
831 print_esc("righthyphenmin");
834 case holding_inserts_code:
835 print_esc("holdinginserts");
838 case error_context_lines_code:
839 print_esc("errorcontextlines");
843 print_string("[unknown integer parameter!]");
848 void begin_diagnostic (void)
850 old_setting = selector;
852 if ((tracing_online <= 0) && (selector == term_and_log))
856 if (history == spotless)
857 history = warning_issued;
861 void end_diagnostic_(bool blankline)
868 selector = old_setting;
871 void print_length_param_ (integer n)
875 case par_indent_code:
876 print_esc("parindent");
879 case math_surround_code:
880 print_esc("mathsurround");
883 case line_skip_limit_code:
884 print_esc("lineskiplimit");
896 print_esc("maxdepth");
899 case split_max_depth_code:
900 print_esc("splitmaxdepth");
903 case box_max_depth_code:
904 print_esc("boxmaxdepth");
915 case delimiter_shortfall_code:
916 print_esc("delimitershortfall");
919 case null_delimiter_space_code:
920 print_esc("nulldelimiterspace");
923 case script_space_code:
924 print_esc("scriptspace");
927 case pre_display_size_code:
928 print_esc("predisplaysize");
931 case display_width_code:
932 print_esc("displaywidth");
935 case display_indent_code:
936 print_esc("displayindent");
939 case overfull_rule_code:
940 print_esc("overfullrule");
943 case hang_indent_code:
944 print_esc("hangindent");
948 print_esc("hoffset");
952 print_esc("voffset");
955 case emergency_stretch_code:
956 print_esc("emergencystretch");
960 print_string("[unknown dimen parameter!]");
965 void print_cmd_chr_ (quarterword cmd, halfword chr_code)
970 print_string("begin-group character ");
975 print_string("end-group character ");
980 print_string("math shift character ");
985 print_string("macro parameter character ");
990 print_string("superscript character ");
995 print_string("subscript character ");
1000 print_string("end of alignment template");
1004 print_string("blank space ");
1009 print_string("the letter ");
1014 print_string("the character ");
1019 case assign_mu_glue:
1020 if (chr_code < skip_base)
1022 print_skip_param(chr_code - glue_base);
1026 if (chr_code < mu_skip_base)
1029 print_int(chr_code - skip_base);
1033 print_esc("muskip");
1034 print_int(chr_code - mu_skip_base);
1040 if (chr_code >= toks_base)
1043 print_int(chr_code - toks_base);
1049 case output_routine_loc:
1050 print_esc("output");
1054 print_esc("everypar");
1057 case every_math_loc:
1058 print_esc("everymath");
1061 case every_display_loc:
1062 print_esc("everydisplay");
1065 case every_hbox_loc:
1066 print_esc("everyhbox");
1069 case every_vbox_loc:
1070 print_esc("everyvbox");
1074 print_esc("everyjob");
1078 print_esc("everycr");
1082 print_esc("errhelp");
1089 if (chr_code < count_base)
1091 print_param(chr_code - int_base);
1096 print_int(chr_code - count_base);
1101 if (chr_code < scaled_base)
1103 print_length_param(chr_code - dimen_base);
1108 print_int(chr_code - scaled_base);
1113 print_esc("accent");
1117 print_esc("advance");
1120 case after_assignment:
1121 print_esc("afterassignment");
1125 print_esc("aftergroup");
1128 case assign_font_dimen:
1129 print_esc("fontdimen");
1133 print_esc("begingroup");
1137 print_esc("penalty");
1145 print_esc("csname");
1153 print_esc("delimiter");
1157 print_esc("divide");
1161 print_esc("endcsname");
1165 print_esc("endgroup");
1173 print_esc("expandafter");
1177 print_esc("halign");
1185 print_esc("ignorespaces");
1189 print_esc("insert");
1201 print_esc("mathaccent");
1205 print_esc("mathchar");
1209 print_esc("mathchoice");
1213 print_esc("multiply");
1217 print_esc("noalign");
1221 print_esc("noboundary");
1225 print_esc("noexpand");
1229 print_esc("nonscript");
1237 print_esc("radical");
1249 print_esc("setbox");
1253 print_esc("prevgraf");
1257 print_esc("parshape");
1269 print_esc("vadjust");
1273 print_esc("valign");
1277 print_esc("vcenter");
1292 print_esc("endinput");
1298 case first_mark_code:
1299 print_esc("firstmark");
1303 print_esc("botmark");
1306 case split_first_mark_code:
1307 print_esc("splitfirstmark");
1310 case split_bot_mark_code:
1311 print_esc("splitbotmark");
1315 print_esc("topmark");
1321 if (chr_code == int_val)
1323 else if (chr_code == dimen_val)
1325 else if (chr_code == glue_val)
1328 print_esc("muskip");
1332 if (chr_code == vmode)
1333 print_esc("prevdepth");
1335 print_esc("spacefactor");
1340 print_esc("deadcycles");
1342 print_esc("insertpenalties");
1346 if (chr_code == width_offset)
1348 else if (chr_code == height_offset)
1358 print_esc("lastpenalty");
1362 print_esc("lastkern");
1366 print_esc("lastskip");
1369 case input_line_no_code:
1370 print_esc("inputlineno");
1374 print_esc("badness");
1383 print_esc("number");
1386 case roman_numeral_code:
1387 print_esc("romannumeral");
1391 print_esc("string");
1395 print_esc("meaning");
1398 case font_name_code:
1399 print_esc("fontname");
1403 print_esc("jobname");
1428 print_esc("ifvmode");
1432 print_esc("ifhmode");
1436 print_esc("ifmmode");
1440 print_esc("ifinner");
1444 print_esc("ifvoid");
1448 print_esc("ifhbox");
1452 print_esc("ifvbox");
1464 print_esc("iftrue");
1468 print_esc("iffalse");
1472 print_esc("ifcase");
1482 if (chr_code == fi_code)
1484 else if (chr_code == or_code)
1491 if (chr_code == span_code)
1495 print_string("alignment tab character ");
1501 if (chr_code == cr_code)
1507 case set_page_dimen:
1511 print_esc("pagegoal");
1515 print_esc("pagetotal");
1519 print_esc("pagestretch");
1523 print_esc("pagefilstretch");
1527 print_esc("pagefillstretch");
1531 print_esc("pagefilllstretch");
1535 print_esc("pageshrink");
1539 print_esc("pagedepth");
1571 print_esc("hfilneg");
1596 print_esc("vfilneg");
1615 print_esc("moveleft");
1617 print_esc("moveright");
1639 print_esc("lastbox");
1643 print_esc("vsplit");
1650 case vtop_code + vmode:
1661 if (chr_code == a_leaders)
1662 print_esc("leaders");
1663 else if (chr_code == c_leaders)
1664 print_esc("cleaders");
1665 else if (chr_code == x_leaders)
1666 print_esc("xleaders");
1668 print_esc("shipout");
1673 print_esc("noindent");
1675 print_esc("indent");
1679 if (chr_code == glue_node)
1680 print_esc("unskip");
1681 else if (chr_code == kern_node)
1682 print_esc("unkern");
1684 print_esc("unpenalty");
1688 if (chr_code == copy_code)
1689 print_esc("unhcopy");
1691 print_esc("unhbox");
1695 if (chr_code == copy_code)
1696 print_esc("unvcopy");
1698 print_esc("unvbox");
1705 print_esc("discretionary");
1719 print_esc("mathord");
1723 print_esc("mathop");
1727 print_esc("mathbin");
1731 print_esc("mathrel");
1735 print_esc("mathopen");
1739 print_esc("mathclose");
1743 print_esc("mathpunct");
1747 print_esc("mathinner");
1751 print_esc("underline");
1755 print_esc("overline");
1761 if (chr_code == limits)
1762 print_esc("limits");
1763 else if (chr_code == no_limits)
1764 print_esc("nolimits");
1766 print_esc("displaylimits");
1770 print_style(chr_code);
1784 case delimited_code + above_code:
1785 print_esc("abovewithdelims");
1788 case delimited_code + over_code:
1789 print_esc("overwithdelims");
1792 case delimited_code + atop_code:
1793 print_esc("atopwithdelims");
1803 if (chr_code == left_noad)
1812 else if (chr_code == 2)
1815 print_esc("global");
1821 else if (chr_code == 1)
1823 else if (chr_code == 2)
1830 if (chr_code != normal)
1831 print_esc("futurelet");
1840 print_esc("chardef");
1843 case math_char_def_code:
1844 print_esc("mathchardef");
1847 case count_def_code:
1848 print_esc("countdef");
1851 case dimen_def_code:
1852 print_esc("dimendef");
1856 print_esc("skipdef");
1859 case mu_skip_def_code:
1860 print_esc("muskipdef");
1864 print_esc("toksdef");
1871 print_hex(chr_code);
1875 print_esc("mathchar");
1876 print_hex(chr_code);
1880 if (chr_code == cat_code_base)
1881 print_esc("catcode");
1882 else if (chr_code == math_code_base)
1883 print_esc("mathcode");
1884 else if (chr_code == lc_code_base)
1885 print_esc("lccode");
1886 else if (chr_code == uc_code_base)
1887 print_esc("uccode");
1888 else if (chr_code == sf_code_base)
1889 print_esc("sfcode");
1891 print_esc("delcode");
1895 print_size(chr_code - math_font_base);
1900 print_esc("patterns");
1902 print_esc("hyphenation");
1905 case assign_font_int:
1907 print_esc("hyphenchar");
1909 print_esc("skewchar");
1913 print_string("select font ");
1914 slow_print(font_name[chr_code]);
1916 if (font_size[chr_code] != font_dsize[chr_code])
1918 print_string(" at ");
1919 print_scaled(font_size[chr_code]);
1924 case set_interaction:
1928 print_esc("batchmode");
1932 print_esc("nonstopmode");
1936 print_esc("scrollmode");
1940 print_esc("errorstopmode");
1947 print_esc("closein");
1949 print_esc("openin");
1954 print_esc("message");
1956 print_esc("errmessage");
1960 if (chr_code == lc_code_base)
1961 print_esc("lowercase");
1963 print_esc("uppercase");
1970 print_esc("showbox");
1974 print_esc("showthe");
1978 print_esc("showlists");
1988 print_string("undefined");
1992 print_string("macro");
1996 print_esc("long macro");
2000 print_esc("outer macro");
2003 case long_outer_call:
2005 print_esc("outer macro");
2009 print_esc("outer endtemplate");
2016 print_esc("openout");
2024 print_esc("closeout");
2028 print_esc("special");
2031 case immediate_code:
2032 print_esc("immediate");
2035 case set_language_code:
2036 print_esc("setlanguage");
2040 print_string("[unknown extension!]");
2046 print_string("[unknown command code!]");
2052 void show_eqtb_(halfword n)
2054 if (n < active_base)
2061 print_cmd_chr(eq_type(n), equiv(n));
2063 if (eq_type(n) >= call)
2066 show_token_list(link(equiv(n)), 0, 32);
2073 print_skip_param(n - glue_base);
2076 if (n < glue_base + thin_mu_skip_code)
2077 print_spec(equiv(n), "pt");
2079 print_spec(equiv(n), "mu");
2082 if (n < mu_skip_base)
2085 print_int(n - skip_base);
2087 print_spec(equiv(n), "pt");
2091 print_esc("muskip");
2092 print_int(n - mu_skip_base);
2094 print_spec(equiv(n), "mu");
2098 if (n == par_shape_loc)
2100 print_esc("parshape");
2103 if (par_shape_ptr == 0)
2106 print_int(info(par_shape_ptr));
2111 print_cmd_chr(assign_toks, n);
2115 show_token_list(link(equiv(n)), 0, 32);
2121 print_int(n - toks_base);
2125 show_token_list(link(equiv(n)), 0, 32);
2128 if (n < cur_font_loc)
2131 print_int(n - box_base);
2135 print_string("void");
2138 depth_threshold = 0;
2140 show_node_list(equiv(n));
2144 if (n < cat_code_base)
2146 if (n == cur_font_loc)
2147 print_string("current font");
2149 if (n < math_font_base + 16)
2151 print_esc("textfont");
2152 print_int(n - math_font_base);
2155 if (n < math_font_base + 32)
2157 print_esc("scriptfont");
2158 print_int(n - math_font_base - 16);
2162 print_esc("scriptscriptfont");
2163 print_int(n - math_font_base - 32);
2168 print(hash[font_id_base + equiv(n)].v.RH);
2171 if (n < math_code_base)
2173 if (n < lc_code_base)
2175 print_esc("catcode");
2176 print_int(n - cat_code_base);
2179 if (n < uc_code_base)
2181 print_esc("lccode");
2182 print_int(n - lc_code_base);
2185 if (n < sf_code_base)
2187 print_esc("uccode");
2188 print_int(n - uc_code_base);
2192 print_esc("sfcode");
2193 print_int(n - sf_code_base);
2197 print_int(equiv(n));
2201 print_esc("mathcode");
2202 print_int(n - math_code_base);
2204 print_int(equiv(n));
2210 print_param(n - int_base);
2212 if (n < del_code_base)
2215 print_int(n - count_base);
2219 print_esc("delcode");
2220 print_int(n - del_code_base);
2224 print_int(eqtb[n].cint);
2229 if (n < scaled_base)
2230 print_length_param(n - dimen_base);
2234 print_int(n - scaled_base);
2238 print_scaled(eqtb[n].cint);
2246 halfword id_lookup_(integer j, integer l)
2255 for (k = j + 1; k <= j + l - 1; k++)
2257 h = h + h + buffer[k];
2259 while (h >= hash_prime)
2268 if (length(text(p)) == l)
2269 if (str_eq_buf(text(p), j))
2274 if (no_new_control_sequence)
2276 p = undefined_control_sequence;
2286 overflow("hash size", hash_size + hash_extra); /* 96/Jan/10 */
2287 return 0; // abort_flag set
2292 while (!(text(hash_used) == 0));
2295 if (hash_used > 65535L) /* debugging only 1996/Jan/20 */
2297 sprintf(log_line, "ERROR: %s too large %d\n", "hash entry", hash_used);
2298 show_line(log_line, 1);
2302 next(p) = hash_used;
2309 while (pool_ptr > str_start[str_ptr])
2312 str_pool[pool_ptr + l] = str_pool[pool_ptr];
2315 for (k = j; k <= j + l - 1; k++)
2316 append_char(buffer[k]);
2320 pool_pointer tempstring = make_string();
2322 if (tempstring > 65535L) /* cannot happen */
2324 sprintf(log_line, "ERROR: %s too large %d\n", "string ptr", tempstring);
2325 show_line(log_line, 1);
2327 text(p) = tempstring;
2330 text(p) = make_string();
2333 pool_ptr = pool_ptr + d;
2340 str_pool[pool_ptr] = '\0';
2341 sprintf(log_line, " tex1 cs_count++ '%s' ", &str_pool[pool_ptr-l-d]);
2342 show_line(log_line, 0); /* debugging */
2356 void new_save_level_(group_code c)
2358 if (save_ptr > max_save_stack)
2360 max_save_stack = save_ptr;
2362 #ifdef ALLOCATESAVESTACK
2363 if (max_save_stack > current_save_size - 6)
2364 save_stack = realloc_save_stack(increment_save_size);
2366 if (max_save_stack > current_save_size - 6) /* check again after allocation */
2368 overflow("save size", current_save_size);
2369 return; // abort_flag set
2372 if (max_save_stack > save_size - 6) /* save size - not dynamic */
2374 overflow("save size", save_size);
2375 return; // abort_flag set
2379 save_type(save_ptr) = level_boundary;
2380 save_level(save_ptr) = (quarterword) cur_group;
2381 save_index(save_ptr) = cur_boundary;
2383 if (cur_level == max_quarterword)
2385 overflow("grouping levels", max_quarterword - min_quarterword); /* 96/Oct/12 ??? */
2386 return; // abort_flag set
2389 cur_boundary = save_ptr;
2395 void eq_destroy_(memory_word w)
2399 switch (eq_type_field(w))
2404 case long_outer_call:
2405 delete_token_ref(equiv_field(w));
2409 delete_glue_ref(equiv_field(w));
2416 free_node(q, info(q) + info(q) + 1);
2420 flush_node_list(equiv_field(w));
2428 void eq_save_(halfword p, quarterword l)
2430 if (save_ptr > max_save_stack)
2432 max_save_stack = save_ptr;
2434 #ifdef ALLOCATESAVESTACK
2435 if (max_save_stack > current_save_size - 6)
2436 save_stack = realloc_save_stack (increment_save_size);
2438 if (max_save_stack > current_save_size - 6) /* check again after allocation */
2440 overflow("save size", current_save_size);
2441 return; // abort_flag set
2444 if (max_save_stack > save_size - 6) /* save size not dynamic */
2446 overflow("save size", save_size);
2447 return; // abort_flag set
2452 if (l == level_zero)
2453 save_type(save_ptr) = restore_zero;
2456 save_stack[save_ptr] = eqtb[p];
2458 save_type(save_ptr) = restore_old_value;
2461 save_level(save_ptr) = l;
2462 save_index(save_ptr) = p;
2466 void eq_define_(halfword p, quarterword t, halfword e)
2468 if (eq_level(p) == cur_level)
2469 eq_destroy(eqtb[p]);
2470 else if (cur_level > level_one)
2471 eq_save(p, eq_level(p));
2473 eq_level(p) = (quarterword) cur_level; /* because cur_level padded out */
2478 void eq_word_define_(halfword p, integer w)
2480 if (xeq_level[p] != cur_level)
2482 eq_save(p, xeq_level[p]);
2483 xeq_level[p] = (quarterword) cur_level; /* because cur_level padded out */
2489 void geq_define_(halfword p, quarterword t, halfword e)
2491 eq_destroy(eqtb[p]);
2492 eq_level(p) = level_one;
2497 void geq_word_define_(halfword p, integer w)
2503 void save_for_after_(halfword t)
2507 if (save_ptr > max_save_stack)
2509 max_save_stack = save_ptr;
2511 #ifdef ALLOCATESAVESTACK
2512 if (max_save_stack > current_save_size - 6)
2513 save_stack = realloc_save_stack (increment_save_size);
2515 if (max_save_stack > current_save_size - 6) /* check again after allocation */
2517 overflow("save size", current_save_size);
2518 return; // abort_flag set
2521 if (max_save_stack > save_size - 6) /* save satck - not dynamic */
2523 overflow("save size", save_size);
2524 return; // abort_flag set
2529 save_type(save_ptr) = insert_token;
2530 save_level(save_ptr) = level_zero;
2531 save_index(save_ptr) = t;
2535 /* restore_trace_, unsave followed in the old tex1.c */