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)
69 putc(xchr[s], log_file);
72 if (term_offset == max_print_line)
78 if (file_offset == max_print_line)
80 putc ('\n', log_file);
87 putc(xchr[s], log_file);
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)
396 else print_char('-');
401 close_files_and_terminate();
413 puts("EXITING at JUMPOUT");
415 if ((history != 0) && (history != 1))
424 // deal with error by asking for user response 0-9, D, E, H, I, X, Q, R, S
425 // NOTE: this may JUMPOUT either via X, or because of too many errors
429 integer s1, s2, s3, s4;
431 if (history < error_message_issued)
432 history = error_message_issued;
437 if (interaction == error_stop_mode)
441 clear_for_error_prompt();
464 if (deletions_allowed)
470 align_state = 1000000L;
471 OK_to_interrupt = false;
473 if ((last > first + 1) && (buffer[first + 1] >= '0') && (buffer[first + 1] <= '9'))
474 c = (c * 10 + buffer[first + 1] - '0' * 11);
488 OK_to_interrupt = true;
489 help2("I have just deleted some text, as you asked.",
490 "You can now delete more, or insert, or whatever.");
508 edit_name_start = str_start[input_stack[base_ptr].name_field];
509 edit_name_length = length(input_stack[base_ptr].name_field);
520 use_err_help = false;
525 help2("Sorry, I don't know how to help in this situation.",
526 "Maybe you should try asking a human?");
530 prints(help_line[help_ptr]);
533 while (!(help_ptr == 0));
536 help4("Sorry, I already gave what help I could...",
537 "Maybe you should try asking a human?",
538 "An error might have occurred before I noticed any problems.",
539 "``If all else fails, read the instructions.''");
546 begin_file_reading();
548 if (last > first + 1)
555 prompt_input("insert>");
571 interaction = 0 + c - 81; /* Q = 0, R = 1, S = 2, T = 3 */
572 prints("OK, entering ");
577 print_esc("batchmode");
582 print_esc("nonstopmode");
586 print_esc("scrollmode");
606 } /* end of switch analysing response character */
609 prints("Type <return> to proceed, S to scroll future error messages,");
610 print_nl("R to run without stopping, Q to run quietly,");
611 print_nl("I to insert something, ");
614 prints("E to edit your file,");
616 if (deletions_allowed)
617 print_nl("1 or ... or 9 to ignore the next 1 to 9 tokens of input,");
619 print_nl("H for help, X to quit.");
625 if (error_count == 100)
627 print_nl("(That makes 100 errors; please try again.)");
632 if (interaction > batch_mode)
640 else while (help_ptr > 0)
643 print_nl(help_line[help_ptr] == NULL ? "" : help_line[help_ptr]);
648 if (interaction > batch_mode)
654 void fatal_error(const char * s)
656 normalize_selector();
657 print_err("Emergency stop");
662 void overflow_(const char * s, integer n)
664 normalize_selector();
665 print_err("TeX capacity exceeded, sorry [");
670 help2("If you really absolutely need more capacity,",
671 "you can ask a wizard to enlarge me.");
675 if (!strcmp(s, "pattern memory") && (n == trie_size))
676 printf("\n (Maybe use -h=... on command line in ini-TeX)\n");
677 else if (!strcmp(s, "exception dictionary") && (n == hyphen_prime))
678 printf("\n (Maybe use -e=... on command line in ini-TeX)\n");
684 void confusion(const char * s)
686 normalize_selector();
688 if (history < error_message_issued)
690 print_err("This can't happen (");
693 help1("I'm broken. Please show this to someone who can fix can fix");
697 print_err("I can't go on meeting you like this");
698 help2("One of your faux pas seems to have wounded me deeply...",
699 "in fact, I'm barely conscious. Please fix it and try again.");
705 boolean init_terminal (void)
715 while ((loc < last) && (buffer[loc]== ' '))
716 incr(loc); // step over initial white space
722 // failed to find input file name
727 flag = input_ln(stdin, true);
732 puts("! End of file on the terminal... why?\n");
738 while ((loc < last) && (buffer[loc]== ' '))
739 incr(loc); // step over intial white space
744 printf("%s\n", "Please type the name of your input file.");
748 str_number make_string (void)
750 #ifdef ALLOCATESTRING
751 if (str_ptr == current_max_strings)
752 str_start = realloc_str_start(increment_max_strings);
754 if (str_ptr == current_max_strings)
756 overflow("number of strings", current_max_strings - init_str_ptr);
760 if (str_ptr == max_strings)
762 overflow("number of strings", max_strings - init_str_ptr);
768 str_start[str_ptr] = pool_ptr;
770 return (str_ptr - 1);
773 boolean str_eq_buf_ (str_number s, integer k)
780 while (j < str_start[s + 1])
782 if (str_pool[j] != buffer[k])
798 boolean str_eq_str_ (str_number s, str_number t)
805 if (length(s) != length(t))
811 while (j < str_start[s + 1])
813 if (str_pool[j] != str_pool[k])
826 void print_two_(integer n)
829 print_char('0' + (n / 10));
830 print_char('0' + (n % 10));
833 void print_hex_(integer n)
842 dig[k] = (unsigned char) (n % 16);
851 void print_roman_int_(integer n)
854 nonnegative_integer u, v;
856 j = str_start[260]; /* m2d5c2l5x2v5i */
863 print_char(str_pool[j]);
871 u = v / (str_pool[k - 1] - '0');
873 if (str_pool[k - 1] == 50)
876 u = u / (str_pool[k - 1] - '0');
881 print_char(str_pool[k]);
887 v = v / (str_pool[j - 1] - '0');
892 void print_current_string (void)
896 j = str_start[str_ptr];
900 print_char(str_pool[j]);
906 void term_input(void)
915 flag = input_ln(stdin, true);
919 fatal_error("End of file on the terminal!");
927 for (k = first; k <= last - 1; k++)
934 void int_error_ (integer n)
942 void normalize_selector (void)
945 selector = term_and_log;
947 selector = term_only;
952 if (interaction == batch_mode)
956 void pause_for_instructions (void)
960 interaction = error_stop_mode;
962 if ((selector == log_only) || (selector == no_print))
965 print_err("Interruption");
967 "Try to insert some instructions for me (e.g.,`I\\showlists'),",
968 "unless you just want to quit by typing `X'.");
969 deletions_allowed = false;
971 deletions_allowed = true;
976 integer half_(integer x)
979 return ((x + 1) / 2);
984 scaled round_decimals_(small_number k)
993 a = (a + dig[k] * 131072L) / 10; /* 2^17 */
996 return ((a + 1) / 2);
999 void print_scaled_(scaled s)
1009 print_int(s / 65536L);
1011 s = 10 * (s % 65536L) + 5;
1017 s = s - 17232; /* 2^15 - 50000 - rounding */
1019 print_char('0' + (s / 65536L));
1020 s = 10 * (s % 65536L);
1023 while (!(s <= delta));
1026 scaled mult_and_add_(integer n, scaled x, scaled y, scaled max_answer)
1036 else if (((x <= (max_answer - y) / n) && (- (integer) x <= (max_answer + y) / n)))
1045 scaled x_over_n_(scaled x, integer n)
1047 register scaled Result;
1070 tex_remainder = x % n;
1074 Result = - (integer) ((- (integer) x)/ n);
1075 tex_remainder = - (integer) ((- (integer) x)% n);
1080 tex_remainder = - (integer) tex_remainder;
1085 scaled xn_over_d_(scaled x, integer n, integer d)
1087 register scaled Result;
1089 nonnegative_integer t, u, v;
1099 t = (x % 32767L) * n;
1100 u = (x / 32768L) * n + (t / 32768L);
1101 v = (u % d) * 32768L + (t % 32768L);
1103 if (u / d >= 32768L)
1106 u = 32768L * (u / d) + (v / d);
1111 tex_remainder = v % d;
1115 Result = - (integer) u;
1116 tex_remainder = - (integer)(v % d);
1122 halfword badness_(scaled t, scaled s)
1134 else if (s >= 1663497L)
1142 return (r * r * r + 131072L) / 262144L; /* 2^17 */
1147 void print_word_(memory_word w)
1151 print_scaled(w.cint);
1153 print_scaled(round(unity * w.gr));
1163 print_int(w.qqqq.b0);
1165 print_int(w.qqqq.b1);
1167 print_int(w.qqqq.b2);
1169 print_int(w.qqqq.b3);
1173 void show_token_list_(integer p, integer q, integer l)
1176 ASCII_code match_chr;
1183 while ((p != 0) && (tally < l))
1187 first_count = tally;
1188 trick_count = tally + 1 + error_line - half_error_line;
1190 if (trick_count < error_line)
1191 trick_count = error_line;
1194 if ((p < hi_mem_min) || (p > mem_end))
1196 print_esc("CLOBBERED.");
1200 if (info(p) >= cs_token_flag)
1201 print_cs(info(p) - cs_token_flag);
1232 print_char(c + '0');
1241 match_chr = (ASCII_code) c;
1270 if (scanner_status > 1)
1272 print_nl("Runaway ");
1274 switch (scanner_status)
1277 prints("definition");
1299 show_token_list(link(p), 0, error_line - 10);
1303 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1304 /* first try list of available nodes (avail != NULL) */
1305 /* then see if can go upwards (mem_end < mem_max) */
1306 /* then see if can go downwards (hi_mem_min > lo_mem_max) */
1307 /* if not, extend memory at the top and grab from there --- new */
1308 /* else fail ! paragraph 120 */
1309 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1310 pointer get_avail (void)
1317 avail = link(avail);
1318 else if (mem_end < mem_max)
1328 if (hi_mem_min <= lo_mem_max) /* have we run out in middle ? */
1331 mem = realloc_main (0, mem_top / 2); /* zzzaa = zmem = mem */
1336 if (mem_end >= mem_max)
1339 overflow("main memory size", mem_max + 1 - mem_min);
1343 incr(mem_end); /* then grab from new area */
1344 p = mem_end; /* 1993/Dec/14 */
1348 link(p) = 0; /* link(p) = null !!! */
1357 void flush_list_(pointer p)
1361 if (p != 0) /* null !!! */
1373 while (!(r == 0)); /* r != null */
1380 pointer get_node_(integer s)
1392 q = p + node_size(p);
1401 llink(t) = llink(q);
1402 rlink(llink(q)) = t;
1403 q = q + node_size(q);
1408 if (r > toint(p + 1))
1410 node_size(p) = r - p;
1425 node_size(p) = q - p;
1428 while (!(p == rover));
1430 if (s == 1073741824L) /* 2^30 - special case - merge adjacent */
1433 puts("Merged adjacent multi-word nodes");
1435 return max_halfword;
1438 /* maybe try downward epxansion first instead ? */
1439 if (lo_mem_max + 2 < hi_mem_min)
1440 if (lo_mem_max + 2 <= mem_bot + max_halfword) /* silly ? flush 93/Dec/16 */
1442 if (hi_mem_min - lo_mem_max >= (block_size + block_size - 2))
1443 t = lo_mem_max + block_size;
1445 t = lo_mem_max + 1 + (hi_mem_min - lo_mem_max) / 2;
1452 if (t > mem_bot + max_halfword)
1453 t = mem_bot + max_halfword; /* silly ? flush 93/Dec/16 */
1457 link(q) = empty_flag;
1458 node_size(q) = t - lo_mem_max; /* block size */
1460 link(lo_mem_max) = 0;
1461 info(lo_mem_max) = 0;
1466 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1467 /* we've run out of space in the middle for variable length blocks */
1468 /* try and add new block from below mem_bot *//* first check if space ! */
1469 if (mem_min - (block_size + 1) <= mem_start) /* extend lower memory downwards */
1471 mem = realloc_main (mem_top / 2 + block_size, 0); /* zzzaa = zmem = mem */
1479 if (mem_min - (block_size + 1) <= mem_start) /* check again */
1482 printf("mem_min %lld, mem_start %d, block_size %d\n", mem_min, mem_start, block_size);
1484 overflow("main memory size", mem_max + 1 - mem_min); /* darn: allocation failed ! */
1488 add_variable_space (block_size);
1489 goto restart; /* go try get_node again */
1495 var_used = var_used + s;
1501 void free_node_(pointer p, halfword s)
1506 link(p) = empty_flag;
1514 var_used = var_used - s;
1518 pointer new_null_box (void)
1522 p = get_node(box_node_size);
1523 type(p) = hlist_node;
1524 subtype(p) = min_quarterword;
1528 shift_amount(p) = 0;
1530 glue_sign(p) = normal;
1531 glue_order(p) = normal;
1537 pointer new_rule (void)
1541 p = get_node(rule_node_size);
1542 type(p) = rule_node;
1544 width(p) = null_flag;
1545 depth(p) = null_flag;
1546 height(p) = null_flag;
1551 pointer new_ligature_(quarterword f, quarterword c, pointer q)
1555 p = get_node(small_node_size);
1556 type(p) = ligature_node;
1557 font(lig_char(p)) = f;
1558 character(lig_char(p)) = c;
1565 pointer new_lig_item_(quarterword c)
1569 p = get_node(small_node_size);
1576 pointer new_disc (void)
1580 p = get_node(small_node_size);
1581 type(p) = disc_node;
1582 replace_count(p) = 0;
1589 pointer new_math (scaled w, small_number s)
1593 p = get_node(small_node_size);
1594 type(p) = math_node;
1601 pointer new_spec_(pointer p)
1605 q = get_node(glue_spec_size);
1607 glue_ref_count(q) = 0;
1608 width(q) = width(p);
1609 stretch(q) = stretch(p);
1610 shrink(q) = shrink(p);
1615 pointer new_param_glue (small_number n)
1620 p = get_node(small_node_size);
1621 type(p) = glue_node;
1626 incr(glue_ref_count(q));
1631 pointer new_glue (pointer q)
1635 p = get_node(small_node_size);
1636 type(p) = glue_node;
1637 subtype(p) = normal;
1640 incr(glue_ref_count(q));
1645 pointer new_skip_param (small_number n)
1649 temp_ptr = new_spec(glue_par(n));
1650 p = new_glue(temp_ptr);
1651 glue_ref_count(temp_ptr) = 0;
1657 pointer new_kern(scaled w)
1661 p = get_node(small_node_size);
1662 type(p) = kern_node;
1663 subtype(p) = normal;
1669 pointer new_penalty(integer m)
1673 p = get_node(small_node_size);
1674 type(p) = penalty_node;
1683 void check_mem(boolean print_locs)
1688 for (p = mem_min; p <= lo_mem_max; p++)
1691 for (p = hi_mem_min; p <= mem_end; p++)
1700 if ((p > mem_end) || (p < hi_mem_min))
1702 else if (freearr[p])
1707 print_nl("AVAIL list clobbered at ");
1724 if ((p >= lo_mem_max) || (p < mem_min))
1726 else if ((rlink(p) >= lo_mem_max) || (rlink(p) < mem_min))
1728 else if (!(is_empty(p)) || (node_size(p) < 2) ||
1729 (p + node_size(p) > lo_mem_max) || (llink(rlink(p)) != p))
1734 print_nl("Double-AVAIL list clobbered at ");
1739 for (q = p; q <= p + node_size(p) - 1; q++)
1743 print_nl("Doubly free location at ");
1754 while (!(p == rover));
1759 while (p <= lo_mem_max)
1763 print_nl("Bad flag at ");
1767 while ((p <= lo_mem_max) && !freearr[p])
1770 while ((p <= lo_mem_max) && freearr[p])
1776 print_nl("New busy locs:");
1778 for (p = mem_min; p <= lo_mem_max; p++)
1779 if (!freearr[p] && ((p > was_lo_max) || wasfree[p]))
1785 for (p = hi_mem_min; p <= mem_end; p++)
1786 if (!freearr[p] && ((p < was_hi_min) || (p > was_mem_end) || wasfree[p]))
1793 for (p = mem_min; p <= lo_mem_max; p++)
1794 wasfree[p] = freearr[p];
1796 for (p = hi_mem_min; p <= mem_end; p++)
1797 wasfree[p] = freearr[p];
1799 was_mem_end = mem_end;
1800 was_lo_max = lo_mem_max;
1801 was_hi_min = hi_mem_min;
1807 void search_mem_(pointer p)
1811 for (q = mem_min; q <= lo_mem_max; q++)
1828 for (q = hi_mem_min; q <= mem_end; q++)
1845 for (q = active_base; q <= box_base + 255; q++)
1854 for (q = 0; q <= save_ptr - 1; q++)
1856 if (equiv_field(save_stack[q]) == p)
1864 for (q = 0; q <= hyphen_prime; q++)
1865 if (hyph_list[q] == p)
1874 void short_display_(integer p)
1878 while (p != 0) /* want p != null here ! */
1880 if (is_char_node(p))
1884 if (font(p) != font_in_short_display)
1886 if ((font(p) > font_max))
1891 print(font_id_text(font(p)));
1895 font_in_short_display = font(p);
1898 print(character(p));
1901 else switch (type(p))
1918 if (glue_ptr(p) != 0)
1927 short_display(lig_ptr(p));
1931 short_display(pre_break(p));
1932 short_display(post_break(p));
1933 n = replace_count(p);
1952 void print_font_and_char (integer p)
1955 print_esc("CLOBBERED.");
1958 if ((font(p) > font_max))
1963 print(font_id_text(font(p)));
1967 print(character(p));
1971 void print_mark_ (integer p)
1975 if ((p < hi_mem_min) || (p > mem_end))
1976 print_esc("CLOBBERED.");
1978 show_token_list(link(p), 0, max_print_line - 10);
1983 void print_rule_dimen(scaled d)
1991 void print_glue_(scaled d, integer order, const char * s)
1995 if ((order < normal) || (order > filll))
2007 else if (*s != '\0')
2011 void print_spec_(integer p, const char * s)
2013 if ((p < mem_min) || (p >= lo_mem_max))
2017 print_scaled(width(p));
2022 if (stretch(p) != 0)
2025 print_glue(stretch(p), stretch_order(p), s);
2031 print_glue(shrink(p), shrink_order(p), s);
2036 void print_fam_and_char_(pointer p)
2041 print(character(p));
2044 void print_delimiter_(pointer p)
2048 a = small_fam(p) * 256 + small_char(p);
2049 a = a * 0x1000 + large_fam(p) * 256 + large_char(p);
2057 void print_subsidiary_data_(pointer p, ASCII_code c)
2059 if ((pool_ptr - str_start[str_ptr]) >= depth_threshold)
2061 if (math_type(p) != 0)
2069 switch (math_type(p))
2073 print_current_string();
2074 print_fam_and_char(p);
2085 print_current_string();
2100 void print_style_(integer c)
2105 print_esc("displaystyle");
2108 print_esc("textstyle");
2111 print_esc("scriptstyle");
2114 print_esc("scriptscriptstyle");
2117 prints("Unknown style!");
2122 void print_skip_param_(integer n)
2126 case line_skip_code:
2127 print_esc("lineskip");
2130 case baseline_skip_code:
2131 print_esc("baselineskip");
2135 print_esc("parskip");
2138 case above_display_skip_code:
2139 print_esc("abovedisplayskip");
2142 case below_display_skip_code:
2143 print_esc("belowdisplayskip");
2146 case above_display_short_skip_code:
2147 print_esc("abovedisplayshortskip");
2150 case below_display_short_skip_code:
2151 print_esc("belowdisplayshortskip");
2154 case left_skip_code:
2155 print_esc("leftskip");
2158 case right_skip_code:
2159 print_esc("rightskip");
2163 print_esc("topskip");
2166 case split_top_skip_code:
2167 print_esc("splittopskip");
2171 print_esc("tabskip");
2174 case space_skip_code:
2175 print_esc("spaceskip");
2178 case xspace_skip_code:
2179 print_esc("xspaceskip");
2182 case par_fill_skip_code:
2183 print_esc("parfillskip");
2186 case thin_mu_skip_code:
2187 print_esc("thinmuskip");
2190 case med_mu_skip_code:
2191 print_esc("medmuskip");
2194 case thick_mu_skip_code:
2195 print_esc("thickmuskip");
2199 prints("[unknown glue parameter!]");
2204 void show_node_list_(integer p)
2209 if (cur_length > depth_threshold)
2211 if (p != 0) /* fixed 94/Mar/23 BUG FIX NOTE: still not fixed in 3.14159 ! */
2219 while (p != 0) /* want p != null - bkph 93/Dec/15 NOTE: still not fixed in 3.14159 ! */
2222 print_current_string();
2226 prints("Bad link, display aborted.");
2232 if (n > breadth_max)
2238 if (is_char_node(p))
2239 print_font_and_char(p);
2240 else switch (type(p))
2246 if (type(p) == hlist_node)
2248 else if (type(p) == vlist_node)
2254 print_scaled(height(p));
2256 print_scaled(depth(p));
2258 print_scaled(width(p));
2260 if (type(p) == unset_node)
2262 if (span_count(p) != 0)
2265 print_int(span_count(p) + 1);
2266 prints(" columns)");
2269 if (glue_stretch(p) != 0)
2271 prints(", stretch ");
2272 print_glue(glue_stretch(p), glue_order(p), "");
2275 if (glue_shrink(p) != 0)
2277 prints(", shrink ");
2278 print_glue(glue_shrink(p), glue_sign(p), "");
2285 if ((g != 0.0) && (glue_sign(p) != 0))
2287 prints(", glue set ");
2289 if (glue_sign(p) == shrinking)
2292 if (fabs(g) > 20000.0)
2299 print_glue(20000 * unity, glue_order(p), "");
2302 print_glue(round(unity * g), glue_order(p), "");
2305 if (shift_amount(p) != 0)
2307 prints(", shifted ");
2308 print_scaled(shift_amount(p));
2312 node_list_display(list_ptr(p));
2319 print_rule_dimen(height(p));
2321 print_rule_dimen(depth(p));
2323 print_rule_dimen(width(p));
2329 print_esc("insert");
2330 print_int(subtype(p));
2331 prints(", natural size ");
2332 print_scaled(height(p));
2334 print_spec(split_top_ptr(p), "");
2336 print_scaled(depth(p));
2337 prints("); float cost ");
2338 print_int(float_cost(p));
2339 node_list_display(ins_ptr(p));
2348 print_write_whatsit("openout", p);
2350 print_file_name(open_name(p), open_area(p), open_ext(p));
2356 print_write_whatsit("write", p);
2357 print_mark(write_tokens(p));
2362 print_write_whatsit("closeout", p);
2367 print_esc("special");
2368 print_mark(write_tokens(p));
2374 print_esc("setlanguage");
2375 print_int(what_lang(p));
2376 prints(" (hyphenmin ");
2377 print_int(what_lhm(p));
2379 print_int(what_rhm(p));
2391 if (subtype(p) >= a_leaders)
2395 if (subtype(p) == c_leaders)
2397 else if (subtype(p) == x_leaders)
2401 print_spec(glue_ptr(p), "");
2402 node_list_display(leader_ptr(p));
2408 if (subtype(p) != normal)
2412 if (subtype(p) < cond_math_glue)
2413 print_skip_param(subtype(p) - 1);
2414 else if (subtype(p) == cond_math_glue)
2415 print_esc("nonscript");
2416 else print_esc("mskip");
2421 if (subtype(p) != cond_math_glue)
2425 if (subtype(p) < cond_math_glue)
2426 print_spec(glue_ptr(p), "");
2428 print_spec(glue_ptr(p), "mu");
2434 if (subtype(p) != mu_glue)
2438 if (subtype(p) != normal)
2441 print_scaled(width(p));
2443 if (subtype(p) == acc_kern)
2444 prints(" (for accent)");
2449 print_scaled(width(p));
2458 if (subtype(p) == before)
2465 prints(", surrounded ");
2466 print_scaled(width(p));
2473 print_font_and_char(lig_char(p));
2474 prints("(ligature ");
2479 font_in_short_display = font(lig_char(p));
2480 short_display(lig_ptr(p));
2482 if (odd(subtype(p)))
2491 print_esc("penalty ");
2492 print_int(penalty(p));
2498 print_esc("discretionary");
2500 if (replace_count(p) > 0)
2502 prints(" replacing ");
2503 print_int(replace_count(p));
2506 node_list_display(pre_break(p));
2508 show_node_list(post_break(p));
2516 print_mark(mark_ptr(p));
2522 print_esc("vadjust");
2523 node_list_display(adjust_ptr(p));
2528 print_style(subtype(p));
2533 print_esc("mathchoice");
2535 show_node_list(display_mlist(p));
2538 show_node_list(text_mlist(p));
2541 show_node_list(script_mlist(p));
2544 show_node_list(script_script_mlist(p));
2568 print_esc("mathord");
2572 print_esc("mathop");
2576 print_esc("mathbin");
2580 print_esc("mathrel");
2584 print_esc("mathopen");
2588 print_esc("mathclose");
2592 print_esc("mathpunct");
2596 print_esc("mathinner");
2600 print_esc("overline");
2604 print_esc("underline");
2608 print_esc("vcenter");
2613 print_esc("radical");
2614 print_delimiter(left_delimiter(p));
2620 print_esc("accent");
2621 print_fam_and_char(accent_chr(p));
2628 print_delimiter(delimiter(p));
2635 print_delimiter(delimiter(p));
2640 if (subtype(p) != normal)
2641 if (subtype(p) == limits)
2642 print_esc("limits");
2644 print_esc("nolimits");
2646 if (type(p) < left_noad)
2647 print_subsidiary_data(nucleus(p), '.');
2649 print_subsidiary_data(supscr(p), '^');
2650 print_subsidiary_data(subscr(p), '_');
2656 print_esc("fraction, thickness ");
2658 if (thickness(p) == 1073741824L) /* 2^30 */
2659 prints("= default");
2661 print_scaled(thickness(p));
2663 if ((small_fam(left_delimiter(p)) != 0) || (small_char(left_delimiter(p)) != 0) ||
2664 (large_fam(left_delimiter(p)) != 0) || (large_char(left_delimiter(p)) != 0))
2666 prints(", left-delimiter ");
2667 print_delimiter(left_delimiter(p));
2670 if ((small_fam(right_delimiter(p)) != 0) || (small_char(right_delimiter(p)) != 0) ||
2671 (large_fam(right_delimiter(p)) != 0) || (large_char(right_delimiter(p)) != 0))
2673 prints(", right-delimiter ");
2674 print_delimiter(right_delimiter(p));
2677 print_subsidiary_data(numerator(p), '\\');
2678 print_subsidiary_data(denominator(p), '/');
2683 prints("Unknown node type!");