1 /* Copyright 2014 Clerk Ma
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2 of the License, or
6 (at your option) any later version.
8 This program is distributed in the hope that it will be useful, but
9 WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
50 putc('\n', write_file[selector]);
55 void print_char_ (ASCII_code s)
57 if (s == new_line_char)
58 if (selector < pseudo)
72 if (term_offset == max_print_line)
78 if (file_offset == max_print_line)
90 if (file_offset == max_print_line)
99 if (term_offset == max_print_line)
109 if (tally < trick_count)
110 trick_buf[tally % error_line] = s;
115 #ifdef ALLOCATESTRING
116 if (pool_ptr + 1 > current_pool_size)
117 str_pool = realloc_str_pool(increment_pool_size);
119 if (pool_ptr < current_pool_size)
122 if (pool_ptr < pool_size)
128 putc(xchr[s], write_file[selector]);
135 void print_ (integer s)
150 if (selector > pseudo)
156 if (s == new_line_char)
157 if (selector < pseudo)
166 /* translate ansi to dos 850 */
167 if (!show_in_hex && s < 256 && s >= 32)
169 if (show_in_dos && s > 127)
171 if (wintodos[s - 128] > 0)
173 print_char(wintodos[s - 128]);
179 while (j < str_start[s + 1])
181 print_char(str_pool[j]);
188 print_char(s); /* don't translate to hex */
192 { /* not just a character */
195 while (j < str_start[s + 1])
197 print_char(str_pool[j]);
202 new_line_char = nl; /* restore eol */
207 /* we get here with s > 256 - i.e. not a single character */
210 while (j < str_start[s + 1])
212 print_char(str_pool[j]);
216 /* string version print. */
217 void prints_ (const char * s)
223 void slow_print_ (integer s)
227 if ((s >= str_ptr) || (s < 256))
233 while (j < str_start[s + 1])
241 void print_nl (const char * s)
243 if (((term_offset > 0) && (odd(selector))) ||
244 ((file_offset > 0) && (selector >= log_only)))
250 void print_esc (const char * s)
263 void print_the_digs (eight_bits k)
270 print_char('0' + dig[k]);
272 print_char('A' + dig[k]);
276 void print_int_ (integer n)
308 dig[k] = (char) (n % 10);
317 void print_cs_ (integer p)
320 if (p >= single_base)
324 print_esc("endcsname");
329 print_esc(""); print(p - single_base);
331 if (cat_code(p - single_base) == letter)
334 else if (p < active_base)
335 print_esc("IMPOSSIBLE.");
337 print(p - active_base);
338 else if (p >= undefined_control_sequence)
339 print_esc("IMPOSSIBLE.");
340 else if ((text(p) >= str_ptr))
341 print_esc("NONEXISTENT.");
350 void sprint_cs (pointer p)
354 print(p - active_base);
355 else if (p < null_cs)
358 print(p - single_base);
363 print_esc("endcsname");
367 print_esc(""); print(text(p));
371 void print_file_name (integer n, integer a, integer e)
378 void print_size_ (integer s)
381 print_esc("textfont");
383 print_esc("scriptfont");
385 print_esc("scriptscriptfont");
388 void print_write_whatsit_(const char * s, pointer p)
392 if (write_stream(p) < 16)
393 print_int(write_stream(p));
394 else if (write_stream(p) == 16)
402 close_files_and_terminate();
411 puts("EXITING at JUMPOUT");
413 if ((history != 0) && (history != 1))
425 integer s1, s2, s3, s4;
427 if (history < error_message_issued)
428 history = error_message_issued;
433 if (interaction == error_stop_mode)
437 clear_for_error_prompt();
460 if (deletions_allowed)
466 align_state = 1000000L;
467 OK_to_interrupt = false;
469 if ((last > first + 1) && (buffer[first + 1] >= '0') && (buffer[first + 1] <= '9'))
470 c = (c * 10 + buffer[first + 1] - '0' * 11);
484 OK_to_interrupt = true;
485 help2("I have just deleted some text, as you asked.",
486 "You can now delete more, or insert, or whatever.");
504 edit_name_start = str_start[input_stack[base_ptr].name_field];
505 edit_name_length = length(input_stack[base_ptr].name_field);
516 use_err_help = false;
521 help2("Sorry, I don't know how to help in this situation.",
522 "Maybe you should try asking a human?");
526 prints(help_line[help_ptr]);
529 while (!(help_ptr == 0));
532 help4("Sorry, I already gave what help I could...",
533 "Maybe you should try asking a human?",
534 "An error might have occurred before I noticed any problems.",
535 "``If all else fails, read the instructions.''");
542 begin_file_reading();
544 if (last > first + 1)
551 prompt_input("insert>");
567 interaction = 0 + c - 'Q';
568 prints("OK, entering ");
573 print_esc("batchmode");
578 print_esc("nonstopmode");
582 print_esc("scrollmode");
595 interaction = scroll_mode;
605 prints("Type <return> to proceed, S to scroll future error messages,");
606 print_nl("R to run without stopping, Q to run quietly,");
607 print_nl("I to insert something, ");
610 prints("E to edit your file,");
612 if (deletions_allowed)
613 print_nl("1 or ... or 9 to ignore the next 1 to 9 tokens of input,");
615 print_nl("H for help, X to quit.");
621 if (error_count == 100)
623 print_nl("(That makes 100 errors; please try again.)");
624 history = fatal_error_stop;
628 if (interaction > batch_mode)
636 else while (help_ptr > 0)
639 print_nl(help_line[help_ptr] == NULL ? "" : help_line[help_ptr]);
644 if (interaction > batch_mode)
650 void fatal_error (const char * s)
652 normalize_selector();
653 print_err("Emergency stop");
658 void overflow_(const char * s, integer n)
660 normalize_selector();
661 print_err("TeX capacity exceeded, sorry [");
666 help2("If you really absolutely need more capacity,",
667 "you can ask a wizard to enlarge me.");
671 if (!strcmp(s, "pattern memory") && (n == trie_size))
672 printf("\n (Maybe use -h=... on command line in initex)\n");
673 else if (!strcmp(s, "exception dictionary") && (n == hyphen_prime))
674 printf("\n (Maybe use -e=... on command line in initex)\n");
680 void confusion (const char * s)
682 normalize_selector();
684 if (history < error_message_issued)
686 print_err("This can't happen (");
689 help1("I'm broken. Please show this to someone who can fix can fix");
693 print_err("I can't go on meeting you like this");
694 help2("One of your faux pas seems to have wounded me deeply...",
695 "in fact, I'm barely conscious. Please fix it and try again.");
701 boolean init_terminal (void)
711 while ((loc < last) && (buffer[loc]== ' '))
718 // failed to find input file name
723 flag = input_ln(stdin, true);
728 puts("! End of file on the terminal... why?\n");
734 while ((loc < last) && (buffer[loc]== ' '))
735 incr(loc); // step over intial white space
740 printf("%s\n", "Please type the name of your input file.");
744 str_number make_string (void)
746 #ifdef ALLOCATESTRING
747 if (str_ptr == current_max_strings)
748 str_start = realloc_str_start(increment_max_strings);
750 if (str_ptr == current_max_strings)
752 overflow("number of strings", current_max_strings - init_str_ptr);
756 if (str_ptr == max_strings)
758 overflow("number of strings", max_strings - init_str_ptr);
764 str_start[str_ptr] = pool_ptr;
766 return (str_ptr - 1);
769 boolean str_eq_buf_ (str_number s, integer k)
776 while (j < str_start[s + 1])
778 if (str_pool[j] != buffer[k])
794 boolean str_eq_str_ (str_number s, str_number t)
801 if (length(s) != length(t))
807 while (j < str_start[s + 1])
809 if (str_pool[j] != str_pool[k])
822 void print_two_(integer n)
825 print_char('0' + (n / 10));
826 print_char('0' + (n % 10));
829 void print_hex_(integer n)
838 dig[k] = (unsigned char) (n % 16);
847 void print_roman_int_(integer n)
850 nonnegative_integer u, v;
852 j = str_start[260]; /* m2d5c2l5x2v5i */
859 print_char(str_pool[j]);
867 u = v / (str_pool[k - 1] - '0');
869 if (str_pool[k - 1] == 50)
872 u = u / (str_pool[k - 1] - '0');
877 print_char(str_pool[k]);
883 v = v / (str_pool[j - 1] - '0');
888 void print_current_string (void)
892 j = str_start[str_ptr];
896 print_char(str_pool[j]);
902 void term_input (void)
911 flag = input_ln(stdin, true);
915 fatal_error("End of file on the terminal!");
923 for (k = first; k <= last - 1; k++)
930 void int_error_ (integer n)
938 void normalize_selector (void)
941 selector = term_and_log;
943 selector = term_only;
948 if (interaction == batch_mode)
952 void pause_for_instructions (void)
956 interaction = error_stop_mode;
958 if ((selector == log_only) || (selector == no_print))
961 print_err("Interruption");
963 "Try to insert some instructions for me (e.g.,`I\\showlists'),",
964 "unless you just want to quit by typing `X'.");
965 deletions_allowed = false;
967 deletions_allowed = true;
972 integer half_(integer x)
975 return ((x + 1) / 2);
980 scaled round_decimals_(small_number k)
989 a = (a + dig[k] * 131072L) / 10; /* 2^17 */
992 return ((a + 1) / 2);
995 void print_scaled_(scaled s)
1005 print_int(s / 65536L);
1007 s = 10 * (s % 65536L) + 5;
1013 s = s - 17232; /* 2^15 - 50000 - rounding */
1015 print_char('0' + (s / 65536L));
1016 s = 10 * (s % 65536L);
1019 while (!(s <= delta));
1022 scaled mult_and_add_(integer n, scaled x, scaled y, scaled max_answer)
1032 else if (((x <= (max_answer - y) / n) && (- (integer) x <= (max_answer + y) / n)))
1041 scaled x_over_n_(scaled x, integer n)
1043 register scaled Result;
1066 tex_remainder = x % n;
1070 Result = - (integer) ((- (integer) x)/ n);
1071 tex_remainder = - (integer) ((- (integer) x)% n);
1076 tex_remainder = - (integer) tex_remainder;
1081 scaled xn_over_d_(scaled x, integer n, integer d)
1083 register scaled Result;
1085 nonnegative_integer t, u, v;
1095 t = (x % 32767L) * n;
1096 u = (x / 32768L) * n + (t / 32768L);
1097 v = (u % d) * 32768L + (t % 32768L);
1099 if (u / d >= 32768L)
1102 u = 32768L * (u / d) + (v / d);
1107 tex_remainder = v % d;
1111 Result = - (integer) u;
1112 tex_remainder = - (integer)(v % d);
1118 halfword badness_(scaled t, scaled s)
1130 else if (s >= 1663497L)
1138 return (r * r * r + 131072L) / 262144L; /* 2^17 */
1143 void print_word (memory_word w)
1147 print_scaled(w.cint);
1149 print_scaled(round(unity * w.gr));
1159 print_int(w.qqqq.b0);
1161 print_int(w.qqqq.b1);
1163 print_int(w.qqqq.b2);
1165 print_int(w.qqqq.b3);
1169 void show_token_list_(integer p, integer q, integer l)
1172 ASCII_code match_chr;
1179 while ((p != 0) && (tally < l))
1183 first_count = tally;
1184 trick_count = tally + 1 + error_line - half_error_line;
1186 if (trick_count < error_line)
1187 trick_count = error_line;
1190 if ((p < hi_mem_min) || (p > mem_end))
1192 print_esc("CLOBBERED.");
1196 if (info(p) >= cs_token_flag)
1197 print_cs(info(p) - cs_token_flag);
1228 print_char(c + '0');
1237 match_chr = (ASCII_code) c;
1266 if (scanner_status > 1)
1268 print_nl("Runaway ");
1270 switch (scanner_status)
1273 prints("definition");
1295 show_token_list(link(p), 0, error_line - 10);
1299 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1300 /* first try list of available nodes (avail != NULL) */
1301 /* then see if can go upwards (mem_end < mem_max) */
1302 /* then see if can go downwards (hi_mem_min > lo_mem_max) */
1303 /* if not, extend memory at the top and grab from there --- new */
1304 /* else fail ! paragraph 120 */
1305 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1306 pointer get_avail (void)
1313 avail = link(avail);
1314 else if (mem_end < mem_max)
1324 if (hi_mem_min <= lo_mem_max) /* have we run out in middle ? */
1327 mem = realloc_main (0, mem_top / 2); /* zzzaa = zmem = mem */
1332 if (mem_end >= mem_max)
1335 overflow("main memory size", mem_max + 1 - mem_min);
1339 incr(mem_end); /* then grab from new area */
1340 p = mem_end; /* 1993/Dec/14 */
1344 link(p) = 0; /* link(p) = null !!! */
1353 void flush_list_(pointer p)
1376 pointer get_node_(integer s)
1388 q = p + node_size(p);
1397 llink(t) = llink(q);
1398 rlink(llink(q)) = t;
1399 q = q + node_size(q);
1404 if (r > toint(p + 1))
1406 node_size(p) = r - p;
1421 node_size(p) = q - p;
1424 while (!(p == rover));
1426 if (s == 1073741824L) /* 2^30 - special case - merge adjacent */
1429 puts("Merged adjacent multi-word nodes");
1431 return max_halfword;
1434 /* maybe try downward epxansion first instead ? */
1435 if (lo_mem_max + 2 < hi_mem_min)
1436 if (lo_mem_max + 2 <= mem_bot + max_halfword) /* silly ? flush 93/Dec/16 */
1438 if (hi_mem_min - lo_mem_max >= (block_size + block_size - 2))
1439 t = lo_mem_max + block_size;
1441 t = lo_mem_max + 1 + (hi_mem_min - lo_mem_max) / 2;
1448 if (t > mem_bot + max_halfword)
1449 t = mem_bot + max_halfword; /* silly ? flush 93/Dec/16 */
1453 link(q) = empty_flag;
1454 node_size(q) = t - lo_mem_max; /* block size */
1456 link(lo_mem_max) = 0;
1457 info(lo_mem_max) = 0;
1462 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1463 /* we've run out of space in the middle for variable length blocks */
1464 /* try and add new block from below mem_bot *//* first check if space ! */
1465 if (mem_min - (block_size + 1) <= mem_start) /* extend lower memory downwards */
1467 mem = realloc_main (mem_top / 2 + block_size, 0); /* zzzaa = zmem = mem */
1475 if (mem_min - (block_size + 1) <= mem_start) /* check again */
1478 printf("mem_min %lld, mem_start %d, block_size %d\n", mem_min, mem_start, block_size);
1480 overflow("main memory size", mem_max + 1 - mem_min); /* darn: allocation failed ! */
1484 add_variable_space(block_size);
1485 goto restart; /* go try get_node again */
1491 var_used = var_used + s;
1497 void free_node_(pointer p, halfword s)
1502 link(p) = empty_flag;
1510 var_used = var_used - s;
1514 pointer new_null_box (void)
1518 p = get_node(box_node_size);
1519 type(p) = hlist_node;
1520 subtype(p) = min_quarterword;
1524 shift_amount(p) = 0;
1526 glue_sign(p) = normal;
1527 glue_order(p) = normal;
1533 pointer new_rule (void)
1537 p = get_node(rule_node_size);
1538 type(p) = rule_node;
1540 width(p) = null_flag;
1541 depth(p) = null_flag;
1542 height(p) = null_flag;
1547 pointer new_ligature_(quarterword f, quarterword c, pointer q)
1551 p = get_node(small_node_size);
1552 type(p) = ligature_node;
1553 font(lig_char(p)) = f;
1554 character(lig_char(p)) = c;
1561 pointer new_lig_item_(quarterword c)
1565 p = get_node(small_node_size);
1572 pointer new_disc (void)
1576 p = get_node(small_node_size);
1577 type(p) = disc_node;
1578 replace_count(p) = 0;
1585 pointer new_math (scaled w, small_number s)
1589 p = get_node(small_node_size);
1590 type(p) = math_node;
1597 pointer new_spec_(pointer p)
1601 q = get_node(glue_spec_size);
1603 glue_ref_count(q) = 0;
1604 width(q) = width(p);
1605 stretch(q) = stretch(p);
1606 shrink(q) = shrink(p);
1611 pointer new_param_glue (small_number n)
1616 p = get_node(small_node_size);
1617 type(p) = glue_node;
1622 incr(glue_ref_count(q));
1627 pointer new_glue (pointer q)
1631 p = get_node(small_node_size);
1632 type(p) = glue_node;
1633 subtype(p) = normal;
1636 incr(glue_ref_count(q));
1641 pointer new_skip_param (small_number n)
1645 temp_ptr = new_spec(glue_par(n));
1646 p = new_glue(temp_ptr);
1647 glue_ref_count(temp_ptr) = 0;
1653 pointer new_kern(scaled w)
1657 p = get_node(small_node_size);
1658 type(p) = kern_node;
1659 subtype(p) = normal;
1665 pointer new_penalty(integer m)
1669 p = get_node(small_node_size);
1670 type(p) = penalty_node;
1679 void check_mem (boolean print_locs)
1684 for (p = mem_min; p <= lo_mem_max; p++)
1687 for (p = hi_mem_min; p <= mem_end; p++)
1696 if ((p > mem_end) || (p < hi_mem_min))
1698 else if (freearr[p])
1703 print_nl("AVAIL list clobbered at ");
1720 if ((p >= lo_mem_max) || (p < mem_min))
1722 else if ((rlink(p) >= lo_mem_max) || (rlink(p) < mem_min))
1724 else if (!(is_empty(p)) || (node_size(p) < 2) ||
1725 (p + node_size(p) > lo_mem_max) || (llink(rlink(p)) != p))
1730 print_nl("Double-AVAIL list clobbered at ");
1735 for (q = p; q <= p + node_size(p) - 1; q++)
1739 print_nl("Doubly free location at ");
1750 while (!(p == rover));
1755 while (p <= lo_mem_max)
1759 print_nl("Bad flag at ");
1763 while ((p <= lo_mem_max) && !freearr[p])
1766 while ((p <= lo_mem_max) && freearr[p])
1772 print_nl("New busy locs:");
1774 for (p = mem_min; p <= lo_mem_max; p++)
1775 if (!freearr[p] && ((p > was_lo_max) || wasfree[p]))
1781 for (p = hi_mem_min; p <= mem_end; p++)
1782 if (!freearr[p] && ((p < was_hi_min) || (p > was_mem_end) || wasfree[p]))
1789 for (p = mem_min; p <= lo_mem_max; p++)
1790 wasfree[p] = freearr[p];
1792 for (p = hi_mem_min; p <= mem_end; p++)
1793 wasfree[p] = freearr[p];
1795 was_mem_end = mem_end;
1796 was_lo_max = lo_mem_max;
1797 was_hi_min = hi_mem_min;
1803 void search_mem_(pointer p)
1807 for (q = mem_min; q <= lo_mem_max; q++)
1824 for (q = hi_mem_min; q <= mem_end; q++)
1841 for (q = active_base; q <= box_base + 255; q++)
1850 for (q = 0; q <= save_ptr - 1; q++)
1852 if (equiv_field(save_stack[q]) == p)
1860 for (q = 0; q <= hyphen_prime; q++)
1861 if (hyph_list[q] == p)
1870 void short_display_(integer p)
1874 while (p != 0) /* want p != null here ! */
1876 if (is_char_node(p))
1880 if (font(p) != font_in_short_display)
1882 if ((font(p) > font_max))
1887 print(font_id_text(font(p)));
1891 font_in_short_display = font(p);
1894 print(character(p));
1897 else switch (type(p))
1914 if (glue_ptr(p) != 0)
1923 short_display(lig_ptr(p));
1927 short_display(pre_break(p));
1928 short_display(post_break(p));
1929 n = replace_count(p);
1948 void print_font_and_char (integer p)
1951 print_esc("CLOBBERED.");
1954 if ((font(p) > font_max))
1959 print(font_id_text(font(p)));
1963 print(character(p));
1967 void print_mark_ (integer p)
1971 if ((p < hi_mem_min) || (p > mem_end))
1972 print_esc("CLOBBERED.");
1974 show_token_list(link(p), 0, max_print_line - 10);
1979 void print_rule_dimen(scaled d)
1987 void print_glue_(scaled d, integer order, const char * s)
1991 if ((order < normal) || (order > filll))
2003 else if (*s != '\0')
2007 void print_spec_(integer p, const char * s)
2009 if ((p < mem_min) || (p >= lo_mem_max))
2013 print_scaled(width(p));
2018 if (stretch(p) != 0)
2021 print_glue(stretch(p), stretch_order(p), s);
2027 print_glue(shrink(p), shrink_order(p), s);
2032 void print_fam_and_char_(pointer p)
2037 print(character(p));
2040 void print_delimiter_(pointer p)
2044 a = small_fam(p) * 256 + small_char(p);
2045 a = a * 0x1000 + large_fam(p) * 256 + large_char(p);
2053 void print_subsidiary_data_(pointer p, ASCII_code c)
2055 if ((pool_ptr - str_start[str_ptr]) >= depth_threshold)
2057 if (math_type(p) != 0)
2065 switch (math_type(p))
2069 print_current_string();
2070 print_fam_and_char(p);
2081 print_current_string();
2096 void print_style_(integer c)
2101 print_esc("displaystyle");
2104 print_esc("textstyle");
2107 print_esc("scriptstyle");
2110 print_esc("scriptscriptstyle");
2113 prints("Unknown style!");
2118 void print_skip_param_(integer n)
2122 case line_skip_code:
2123 print_esc("lineskip");
2126 case baseline_skip_code:
2127 print_esc("baselineskip");
2131 print_esc("parskip");
2134 case above_display_skip_code:
2135 print_esc("abovedisplayskip");
2138 case below_display_skip_code:
2139 print_esc("belowdisplayskip");
2142 case above_display_short_skip_code:
2143 print_esc("abovedisplayshortskip");
2146 case below_display_short_skip_code:
2147 print_esc("belowdisplayshortskip");
2150 case left_skip_code:
2151 print_esc("leftskip");
2154 case right_skip_code:
2155 print_esc("rightskip");
2159 print_esc("topskip");
2162 case split_top_skip_code:
2163 print_esc("splittopskip");
2167 print_esc("tabskip");
2170 case space_skip_code:
2171 print_esc("spaceskip");
2174 case xspace_skip_code:
2175 print_esc("xspaceskip");
2178 case par_fill_skip_code:
2179 print_esc("parfillskip");
2182 case thin_mu_skip_code:
2183 print_esc("thinmuskip");
2186 case med_mu_skip_code:
2187 print_esc("medmuskip");
2190 case thick_mu_skip_code:
2191 print_esc("thickmuskip");
2195 prints("[unknown glue parameter!]");
2200 void show_node_list_(integer p)
2205 if (cur_length > depth_threshold)
2207 if (p != 0) /* fixed 94/Mar/23 BUG FIX NOTE: still not fixed in 3.14159 ! */
2218 print_current_string();
2222 prints("Bad link, display aborted.");
2228 if (n > breadth_max)
2234 if (is_char_node(p))
2235 print_font_and_char(p);
2236 else switch (type(p))
2242 if (type(p) == hlist_node)
2244 else if (type(p) == vlist_node)
2250 print_scaled(height(p));
2252 print_scaled(depth(p));
2254 print_scaled(width(p));
2256 if (type(p) == unset_node)
2258 if (span_count(p) != 0)
2261 print_int(span_count(p) + 1);
2262 prints(" columns)");
2265 if (glue_stretch(p) != 0)
2267 prints(", stretch ");
2268 print_glue(glue_stretch(p), glue_order(p), "");
2271 if (glue_shrink(p) != 0)
2273 prints(", shrink ");
2274 print_glue(glue_shrink(p), glue_sign(p), "");
2281 if ((g != 0.0) && (glue_sign(p) != 0))
2283 prints(", glue set ");
2285 if (glue_sign(p) == shrinking)
2288 if (fabs(g) > 20000.0)
2295 print_glue(20000 * unity, glue_order(p), "");
2298 print_glue(round(unity * g), glue_order(p), "");
2301 if (shift_amount(p) != 0)
2303 prints(", shifted ");
2304 print_scaled(shift_amount(p));
2308 node_list_display(list_ptr(p));
2315 print_rule_dimen(height(p));
2317 print_rule_dimen(depth(p));
2319 print_rule_dimen(width(p));
2325 print_esc("insert");
2326 print_int(subtype(p));
2327 prints(", natural size ");
2328 print_scaled(height(p));
2330 print_spec(split_top_ptr(p), "");
2332 print_scaled(depth(p));
2333 prints("); float cost ");
2334 print_int(float_cost(p));
2335 node_list_display(ins_ptr(p));
2344 print_write_whatsit("openout", p);
2346 print_file_name(open_name(p), open_area(p), open_ext(p));
2352 print_write_whatsit("write", p);
2353 print_mark(write_tokens(p));
2358 print_write_whatsit("closeout", p);
2363 print_esc("special");
2364 print_mark(write_tokens(p));
2370 print_esc("setlanguage");
2371 print_int(what_lang(p));
2372 prints(" (hyphenmin ");
2373 print_int(what_lhm(p));
2375 print_int(what_rhm(p));
2387 if (subtype(p) >= a_leaders)
2391 if (subtype(p) == c_leaders)
2393 else if (subtype(p) == x_leaders)
2397 print_spec(glue_ptr(p), "");
2398 node_list_display(leader_ptr(p));
2404 if (subtype(p) != normal)
2408 if (subtype(p) < cond_math_glue)
2409 print_skip_param(subtype(p) - 1);
2410 else if (subtype(p) == cond_math_glue)
2411 print_esc("nonscript");
2412 else print_esc("mskip");
2417 if (subtype(p) != cond_math_glue)
2421 if (subtype(p) < cond_math_glue)
2422 print_spec(glue_ptr(p), "");
2424 print_spec(glue_ptr(p), "mu");
2430 if (subtype(p) != mu_glue)
2434 if (subtype(p) != normal)
2437 print_scaled(width(p));
2439 if (subtype(p) == acc_kern)
2440 prints(" (for accent)");
2445 print_scaled(width(p));
2454 if (subtype(p) == before)
2461 prints(", surrounded ");
2462 print_scaled(width(p));
2469 print_font_and_char(lig_char(p));
2470 prints("(ligature ");
2475 font_in_short_display = font(lig_char(p));
2476 short_display(lig_ptr(p));
2478 if (odd(subtype(p)))
2487 print_esc("penalty ");
2488 print_int(penalty(p));
2494 print_esc("discretionary");
2496 if (replace_count(p) > 0)
2498 prints(" replacing ");
2499 print_int(replace_count(p));
2502 node_list_display(pre_break(p));
2504 show_node_list(post_break(p));
2512 print_mark(mark_ptr(p));
2518 print_esc("vadjust");
2519 node_list_display(adjust_ptr(p));
2524 print_style(subtype(p));
2529 print_esc("mathchoice");
2531 show_node_list(display_mlist(p));
2534 show_node_list(text_mlist(p));
2537 show_node_list(script_mlist(p));
2540 show_node_list(script_script_mlist(p));
2564 print_esc("mathord");
2568 print_esc("mathop");
2572 print_esc("mathbin");
2576 print_esc("mathrel");
2580 print_esc("mathopen");
2584 print_esc("mathclose");
2588 print_esc("mathpunct");
2592 print_esc("mathinner");
2596 print_esc("overline");
2600 print_esc("underline");
2604 print_esc("vcenter");
2609 print_esc("radical");
2610 print_delimiter(left_delimiter(p));
2616 print_esc("accent");
2617 print_fam_and_char(accent_chr(p));
2624 print_delimiter(delimiter(p));
2631 print_delimiter(delimiter(p));
2636 if (subtype(p) != normal)
2637 if (subtype(p) == limits)
2638 print_esc("limits");
2640 print_esc("nolimits");
2642 if (type(p) < left_noad)
2643 print_subsidiary_data(nucleus(p), '.');
2645 print_subsidiary_data(supscr(p), '^');
2646 print_subsidiary_data(subscr(p), '_');
2652 print_esc("fraction, thickness ");
2654 if (thickness(p) == 1073741824L) /* 2^30 */
2655 prints("= default");
2657 print_scaled(thickness(p));
2659 if ((small_fam(left_delimiter(p)) != 0) || (small_char(left_delimiter(p)) != 0) ||
2660 (large_fam(left_delimiter(p)) != 0) || (large_char(left_delimiter(p)) != 0))
2662 prints(", left-delimiter ");
2663 print_delimiter(left_delimiter(p));
2666 if ((small_fam(right_delimiter(p)) != 0) || (small_char(right_delimiter(p)) != 0) ||
2667 (large_fam(right_delimiter(p)) != 0) || (large_char(right_delimiter(p)) != 0))
2669 prints(", right-delimiter ");
2670 print_delimiter(right_delimiter(p));
2673 print_subsidiary_data(numerator(p), '\\');
2674 print_subsidiary_data(denominator(p), '/');
2679 prints("Unknown node type!");