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
49 putc('\n', write_file[selector]);
54 void print_char_ (ASCII_code s)
56 if (s == new_line_char)
57 if (selector < pseudo)
68 putc(xchr[s], log_file);
71 if (term_offset == max_print_line)
77 if (file_offset == max_print_line)
79 putc ('\n', log_file);
86 putc(xchr[s], log_file);
89 if (file_offset == max_print_line)
98 if (term_offset == max_print_line)
107 if (tally < trick_count)
108 trick_buf[tally % error_line] = s;
113 #ifdef ALLOCATESTRING
114 if (pool_ptr + 1 > current_pool_size)
115 str_pool = realloc_str_pool (increment_pool_size);
117 if (pool_ptr < current_pool_size)
120 if (pool_ptr < pool_size)
126 putc(xchr[s], write_file[selector]);
133 void print_ (integer s)
148 if (selector > pseudo)
154 if (s == new_line_char)
155 if (selector < pseudo)
164 /* translate ansi to dos 850 */
165 if (!show_in_hex && s < 256 && s >= 32)
167 if (show_in_dos && s > 127)
169 if (wintodos[s - 128] > 0)
171 print_char(wintodos[s - 128]);
177 while (j < str_start[s + 1])
179 print_char(str_pool[j]);
186 print_char(s); /* don't translate to hex */
190 { /* not just a character */
193 while (j < str_start[s + 1])
195 print_char(str_pool[j]);
200 new_line_char = nl; /* restore eol */
205 /* we get here with s > 256 - i.e. not a single character */
208 while (j < str_start[s + 1])
210 print_char(str_pool[j]);
214 /* string version print. */
215 void prints_ (const char *s)
221 void slow_print_ (integer s)
225 if ((s >= str_ptr) || (s < 256))
231 while (j < str_start[s + 1])
239 void print_nl (const char * s)
241 if (((term_offset > 0) && (odd(selector))) ||
242 ((file_offset > 0) && (selector >= log_only)))
248 void print_esc (const char * s)
261 void print_the_digs_ (eight_bits k)
268 print_char('0' + dig[k]);
270 print_char('A' + dig[k]);
274 void print_int_ (integer n)
306 dig[k] = (char) (n % 10);
315 void print_cs_ (integer p)
318 if (p >= single_base)
322 print_esc("endcsname");
327 print_esc(""); print(p - single_base);
329 if (cat_code(p - single_base) == letter)
332 else if (p < active_base)
333 print_esc("IMPOSSIBLE.");
335 print(p - active_base);
336 else if (p >= undefined_control_sequence)
337 print_esc("IMPOSSIBLE.");
338 else if ((text(p) >= str_ptr))
339 print_esc("NONEXISTENT.");
348 void sprint_cs_(halfword p)
352 print(p - active_base);
353 else if (p < null_cs)
356 print(p - single_base);
361 print_esc("endcsname");
365 print_esc(""); print(text(p));
369 void print_file_name_(integer n, integer a, integer e)
376 void print_size_ (integer s)
379 print_esc("textfont");
381 print_esc("scriptfont");
383 print_esc("scriptscriptfont");
386 void print_write_whatsit_(str_number s, pointer p)
391 if (write_stream(p) < 16)
392 print_int(write_stream(p));
393 else if (write_stream(p) == 16)
395 else print_char('-');
400 close_files_and_terminate();
412 puts("EXITING at JUMPOUT");
414 if ((history != 0) && (history != 1))
423 // deal with error by asking for user response 0-9, D, E, H, I, X, Q, R, S
424 // NOTE: this may JUMPOUT either via X, or because of too many errors
428 integer s1, s2, s3, s4;
430 if (history < error_message_issued)
431 history = error_message_issued;
436 if (interaction == error_stop_mode)
440 clear_for_error_prompt();
463 if (deletions_allowed)
469 align_state = 1000000L;
470 OK_to_interrupt = false;
472 if ((last > first + 1) && (buffer[first + 1] >= '0') && (buffer[first + 1] <= '9'))
473 c = (c * 10 + buffer[first + 1] - '0' * 11);
487 OK_to_interrupt = true;
488 help2("I have just deleted some text, as you asked.",
489 "You can now delete more, or insert, or whatever.");
507 edit_name_start = str_start[input_stack[base_ptr].name_field];
508 edit_name_length = length(input_stack[base_ptr].name_field);
519 use_err_help = false;
524 help2("Sorry, I don't know how to help in this situation.",
525 "Maybe you should try asking a human?");
529 prints(help_line[help_ptr]);
532 while (!(help_ptr == 0));
535 help4("Sorry, I already gave what help I could...",
536 "Maybe you should try asking a human?",
537 "An error might have occurred before I noticed any problems.",
538 "``If all else fails, read the instructions.''");
545 begin_file_reading();
547 if (last > first + 1)
554 prompt_input("insert>");
570 interaction = 0 + c - 81; /* Q = 0, R = 1, S = 2, T = 3 */
571 prints("OK, entering ");
576 print_esc("batchmode");
581 print_esc("nonstopmode");
585 print_esc("scrollmode");
605 } /* end of switch analysing response character */
608 prints("Type <return> to proceed, S to scroll future error messages,");
609 print_nl("R to run without stopping, Q to run quietly,");
610 print_nl("I to insert something, ");
613 prints("E to edit your file,");
615 if (deletions_allowed)
616 print_nl("1 or ... or 9 to ignore the next 1 to 9 tokens of input,");
618 print_nl("H for help, X to quit.");
624 if (error_count == 100)
626 print_nl("(That makes 100 errors; please try again.)");
631 if (interaction > batch_mode)
639 else while (help_ptr > 0)
642 print_nl(help_line[help_ptr] == NULL ? "" : help_line[help_ptr]);
647 if (interaction > batch_mode)
653 void fatal_error(char * s)
655 normalize_selector();
656 print_err("Emergency stop");
661 void overflow_(char * s, integer n)
663 normalize_selector();
664 print_err("TeX capacity exceeded, sorry [");
669 help2("If you really absolutely need more capacity,",
670 "you can ask a wizard to enlarge me.");
674 if (!strcmp(s, "pattern memory") && (n == trie_size))
676 sprintf(log_line, "\n (Maybe use -h=... on command line in ini-TeX)\n");
677 show_line(log_line, 0);
679 else if (!strcmp(s, "exception dictionary") && (n == hyphen_prime))
681 sprintf(log_line, "\n (Maybe use -e=... on command line in ini-TeX)\n");
682 show_line(log_line, 0);
689 void confusion_(const char * s)
691 normalize_selector();
693 if (history < error_message_issued)
695 print_err("This can't happen (");
698 help1("I'm broken. Please show this to someone who can fix can fix");
702 print_err("I can't go on meeting you like this");
703 help2("One of your faux pas seems to have wounded me deeply...",
704 "in fact, I'm barely conscious. Please fix it and try again.");
710 boolean init_terminal (void)
720 while ((loc < last) && (buffer[loc]== ' '))
721 incr(loc); // step over initial white space
727 // failed to find input file name
732 flag = input_ln(stdin, true);
737 puts("! End of file on the terminal... why?\n");
743 while ((loc < last) && (buffer[loc]== ' '))
744 incr(loc); // step over intial white space
749 sprintf(log_line, "%s\n", "Please type the name of your input file.");
750 show_line(log_line, 1);
754 str_number make_string (void)
756 #ifdef ALLOCATESTRING
757 if (str_ptr == current_max_strings)
758 str_start = realloc_str_start(increment_max_strings);
760 if (str_ptr == current_max_strings)
762 overflow("number of strings", current_max_strings - init_str_ptr); /* 97/Mar/9 */
766 if (str_ptr == max_strings)
768 overflow("number of strings", max_strings - init_str_ptr);
774 str_start[str_ptr] = pool_ptr;
776 return (str_ptr - 1);
779 boolean str_eq_buf_ (str_number s, integer k)
786 while (j < str_start[s + 1])
788 if (str_pool[j] != buffer[k])
804 boolean str_eq_str_ (str_number s, str_number t)
811 if (length(s) != length(t))
817 while (j < str_start[s + 1])
819 if (str_pool[j] != str_pool[k])
832 void print_two_(integer n)
835 print_char('0' + (n / 10));
836 print_char('0' + (n % 10));
839 void print_hex_(integer n)
848 dig[k] = (unsigned char) (n % 16);
857 void print_roman_int_(integer n)
860 nonnegative_integer u, v;
862 j = str_start[260]; /* m2d5c2l5x2v5i */
869 print_char(str_pool[j]);
877 u = v / (str_pool[k - 1] - '0');
879 if (str_pool[k - 1] == 50)
882 u = u / (str_pool[k - 1] - '0');
887 print_char(str_pool[k]);
893 v = v / (str_pool[j - 1] - '0');
898 void print_current_string (void)
902 j = str_start[str_ptr];
906 print_char(str_pool[j]);
912 void term_input(void)
921 flag = input_ln(stdin, true);
925 fatal_error("End of file on the terminal!");
930 decr(selector); // shut off echo
933 for (k = first; k <= last - 1; k++)
937 incr(selector); // reset selector again
940 void int_error_ (integer n)
948 void normalize_selector (void)
951 selector = term_and_log;
953 selector = term_only;
958 if (interaction == batch_mode)
962 void pause_for_instructions (void)
966 interaction = error_stop_mode;
968 if ((selector == log_only) || (selector == no_print))
971 print_err("Interruption");
973 "Try to insert some instructions for me (e.g.,`I\\showlists'),",
974 "unless you just want to quit by typing `X'.");
975 deletions_allowed = false;
977 deletions_allowed = true;
982 integer half_(integer x)
985 return ((x + 1) / 2);
990 scaled round_decimals_(small_number k)
999 a = (a + dig[k] * 131072L) / 10; /* 2^17 */
1002 return ((a + 1) / 2);
1005 void print_scaled_(scaled s)
1015 print_int(s / 65536L);
1017 s = 10 * (s % 65536L) + 5;
1023 s = s - 17232; /* 2^15 - 50000 - rounding */
1025 print_char('0' + (s / 65536L));
1026 s = 10 * (s % 65536L);
1029 while (!(s <= delta));
1032 scaled mult_and_add_(integer n, scaled x, scaled y, scaled maxanswer)
1042 else if (((x <= (maxanswer - y) / n) && (- (integer) x <= (maxanswer + y) / n)))
1051 scaled x_over_n_(scaled x, integer n)
1053 register scaled Result;
1076 tex_remainder = x % n;
1080 Result = - (integer) ((- (integer) x)/ n);
1081 tex_remainder = - (integer) ((- (integer) x)% n);
1086 tex_remainder = - (integer) tex_remainder;
1091 scaled xn_over_d_(scaled x, integer n, integer d)
1093 register scaled Result;
1095 nonnegative_integer t, u, v;
1105 t = (x % 32767L) * n;
1106 u = (x / 32768L) * n + (t / 32768L);
1107 v = (u % d) * 32768L + (t % 32768L);
1109 if (u / d >= 32768L)
1112 u = 32768L * (u / d) + (v / d);
1117 tex_remainder = v % d;
1121 Result = - (integer) u;
1122 tex_remainder = - (integer)(v % d);
1128 halfword badness_(scaled t, scaled s)
1140 else if (s >= 1663497L)
1148 return (r * r * r + 131072L) / 262144L; /* 2^17 */
1153 void print_word_(memory_word w)
1157 print_scaled(w.cint);
1159 print_scaled(round(65536L * w.gr));
1169 print_int(w.qqqq.b0);
1171 print_int(w.qqqq.b1);
1173 print_int(w.qqqq.b2);
1175 print_int(w.qqqq.b3);
1177 /* need this version only if SHORTFONTINFO defined */
1178 void zprintfword(memory_word w)
1182 print_scaled(w.cint);
1184 print_scaled(round(65536L * w.gr));
1190 print_int(w .hh.b1);
1194 print_int(w.qqqq.b0);
1196 print_int(w.qqqq.b1);
1198 print_int(w.qqqq.b2);
1200 print_int(w.qqqq.b3);
1204 void show_token_list_(integer p, integer q, integer l)
1207 ASCII_code match_chr;
1214 while ((p != 0) && (tally < l))
1218 first_count = tally;
1219 trick_count = tally + 1 + error_line - half_error_line;
1221 if (trick_count < error_line)
1222 trick_count = error_line;
1225 if ((p < hi_mem_min) || (p > mem_end))
1227 print_esc("CLOBBERED.");
1231 if (info(p) >= cs_token_flag)
1232 print_cs(info(p) - cs_token_flag);
1263 print_char(c + '0');
1272 match_chr = (ASCII_code) c;
1301 if (scanner_status > 1)
1303 print_nl("Runaway ");
1305 switch (scanner_status)
1308 prints("definition");
1330 show_token_list(link(p), 0, error_line - 10);
1334 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1335 /* first try list of available nodes (avail != NULL) */
1336 /* then see if can go upwards (mem_end < mem_max) */
1337 /* then see if can go downwards (hi_mem_min > lo_mem_max) */
1338 /* if not, extend memory at the top and grab from there --- new */
1339 /* else fail ! paragraph 120 */
1340 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1341 halfword get_avail (void)
1348 avail = link(avail);
1349 else if (mem_end < mem_max)
1359 if (hi_mem_min <= lo_mem_max) /* have we run out in middle ? */
1362 mem = realloc_main (0, mem_top / 2); /* zzzaa = zmem = mem */
1367 if (mem_end >= mem_max)
1370 overflow("main memory size", mem_max + 1 - mem_min);
1374 incr(mem_end); /* then grab from new area */
1375 p = mem_end; /* 1993/Dec/14 */
1379 link(p) = 0; /* link(p) = null !!! */
1388 void flush_list_(pointer p)
1392 if (p != 0) /* null !!! */
1404 while (!(r == 0)); /* r != null */
1411 pointer get_node_(integer s)
1423 q = p + node_size(p);
1432 llink(t) = llink(q);
1433 rlink(llink(q)) = t;
1434 q = q + node_size(q);
1439 if (r > toint(p + 1))
1441 node_size(p) = r - p;
1456 node_size(p) = q - p;
1459 while (!(p == rover));
1461 if (s == 1073741824L) /* 2^30 - special case - merge adjacent */
1464 puts("Merged adjacent multi-word nodes\n");
1466 return max_halfword;
1469 /* maybe try downward epxansion first instead ? */
1470 if (lo_mem_max + 2 < hi_mem_min)
1471 if (lo_mem_max + 2 <= mem_bot + max_halfword) /* silly ? flush 93/Dec/16 */
1473 /* if (hi_mem_min - lo_mem_max >= 1998) */
1474 if (hi_mem_min - lo_mem_max >= (block_size + block_size - 2))
1475 /* t = lo_mem_max + 1000; */
1476 t = lo_mem_max + block_size;
1478 t = lo_mem_max + 1 + (hi_mem_min - lo_mem_max) / 2;
1485 if (t > mem_bot + max_halfword)
1486 t = mem_bot + max_halfword; /* silly ? flush 93/Dec/16 */
1490 link(q) = empty_flag;
1491 node_size(q) = t - lo_mem_max; /* block size */
1493 link(lo_mem_max) = 0;
1494 info(lo_mem_max) = 0;
1499 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1500 /* we've run out of space in the middle for variable length blocks */
1501 /* try and add new block from below mem_bot *//* first check if space ! */
1502 if (mem_min - (block_size + 1) <= mem_start) /* extend lower memory downwards */
1504 mem = realloc_main (mem_top/2 + block_size, 0); /* zzzaa = zmem = mem */
1512 if (mem_min - (block_size + 1) <= mem_start) /* check again */
1516 sprintf(log_line, "mem_min %lld, mem_start %ld, block_size %d\n", mem_min, mem_start, block_size);
1517 show_line(log_line, 0);
1520 overflow("main memory size", mem_max + 1 - mem_min); /* darn: allocation failed ! */
1524 add_variable_space (block_size);
1525 goto restart; /* go try get_node again */
1531 var_used = var_used + s;
1537 void free_node_(halfword p, halfword s)
1542 link(p) = empty_flag;
1550 var_used = var_used - s;
1554 pointer new_null_box (void)
1558 p = get_node(box_node_size);
1559 type(p) = hlist_node;
1560 subtype(p) = min_quarterword;
1564 shift_amount(p) = 0;
1566 glue_sign(p) = normal;
1567 glue_order(p) = normal;
1573 pointer new_rule (void)
1577 p = get_node(rule_node_size);
1578 type(p) = rule_node;
1580 width(p) = null_flag;
1581 depth(p) = null_flag;
1582 height(p) = null_flag;
1587 pointer new_ligature_(quarterword f, quarterword c, pointer q)
1591 p = get_node(small_node_size);
1592 type(p) = ligature_node;
1593 font(lig_char(p)) = f;
1594 character(lig_char(p)) = c;
1601 pointer new_lig_item_(quarterword c)
1605 p = get_node(small_node_size);
1612 pointer new_disc (void)
1616 p = get_node(small_node_size);
1617 type(p) = disc_node;
1618 replace_count(p) = 0;
1625 pointer new_math_(scaled w, small_number s)
1629 p = get_node(small_node_size);
1630 type(p) = math_node;
1637 pointer new_spec_(pointer p)
1641 q = get_node(glue_spec_size);
1643 glue_ref_count(q) = 0;
1644 width(q) = width(p);
1645 stretch(q) = stretch(p);
1646 shrink(q) = shrink(p);
1651 pointer new_param_glue_(small_number n)
1656 p = get_node(small_node_size);
1657 type(p) = glue_node;
1662 incr(glue_ref_count(q));
1667 pointer new_glue_(pointer q)
1671 p = get_node(small_node_size);
1672 type(p) = glue_node;
1673 subtype(p) = normal;
1676 incr(glue_ref_count(q));
1681 pointer new_skip_param_(small_number n)
1685 temp_ptr = new_spec(glue_par(n));
1686 p = new_glue(temp_ptr);
1687 glue_ref_count(temp_ptr) = 0;
1693 pointer new_kern(scaled w)
1697 p = get_node(small_node_size);
1698 type(p) = kern_node;
1699 subtype(p) = normal;
1705 pointer new_penalty(integer m)
1709 p = get_node(small_node_size);
1710 type(p) = penalty_node;
1719 void check_mem(boolean printlocs)
1724 for (p = mem_min; p <= lo_mem_max; p++) freearr[p] = false;
1725 for (p = hi_mem_min; p <= mem_end; p++) freearr[p] = false;
1730 if ((p > mem_end) || (p < hi_mem_min))
1732 else if (freearr[p])
1737 print_nl("AVAIL list clobbered at ");
1750 if ((p >= lo_mem_max) || (p < mem_min))
1752 else if ((rlink(p) >= lo_mem_max) || (rlink(p) < mem_min))
1754 else if (!(is_empty(p)) || (node_size(p) < 2) ||
1755 (p + node_size(p) > lo_mem_max) || (llink(rlink(p)) != p))
1760 print_nl("Double-AVAIL list clobbered at ");
1765 for (q = p; q <= p + node_size(p) - 1; q++)
1769 print_nl("Doubly free location at ");
1777 } while (!(p == rover));
1780 while (p <= lo_mem_max) {
1783 print_nl("Bad flag at ");
1786 while ((p <= lo_mem_max) && !freearr[p]) incr(p);
1787 while ((p <= lo_mem_max) && freearr[p]) incr(p);
1792 print_nl("New busy locs:");
1794 for (p = mem_min; p <= lo_mem_max; p++)
1795 if (!freearr[p] && ((p > was_lo_max) || wasfree[p]))
1801 for (p = hi_mem_min; p <= mem_end; p++)
1802 if (!freearr[p] && ((p < was_hi_min) || (p > was_mem_end) || wasfree[p]))
1809 for (p = mem_min; p <= lo_mem_max; p++) wasfree[p] = freearr[p];
1810 for (p = hi_mem_min; p <= mem_end; p++) wasfree[p] = freearr[p];
1812 was_mem_end = mem_end;
1813 was_lo_max = lo_mem_max;
1814 was_hi_min = hi_mem_min;
1820 void search_mem_(halfword p)
1824 for (q = mem_min; q <= lo_mem_max; q++)
1840 for (q = hi_mem_min; q <= mem_end; q++)
1856 for (q = active_base; q <= box_base + 255; q++)
1865 for (q = 0; q <= save_ptr - 1; q++)
1867 if (equiv_field(save_stack[q]) == p)
1875 for (q = 0; q <= hyphen_prime; q++)
1876 if (hyph_list[q] == p)
1885 void short_display_(integer p)
1889 while (p != 0) /* want p != null here ! */
1891 if (is_char_node(p))
1895 if (font(p) != font_in_short_display)
1897 if ((font(p) > font_max))
1902 print(font_id_text(font(p)));
1906 font_in_short_display = font(p);
1908 print(character(p));
1911 else switch (mem[p].hh.b0)
1926 if (glue_ptr(p) != 0)
1933 short_display(lig_ptr(p));
1936 short_display(pre_break(p));
1937 short_display(post_break(p));
1938 n = replace_count(p);
1955 void print_font_and_char (integer p)
1958 print_esc("CLOBBERED.");
1961 if ((font(p) > font_max))
1966 print(font_id_text(font(p)));
1970 print(character(p));
1974 void print_mark_ (integer p)
1978 if ((p < hi_mem_min) || (p > mem_end))
1979 print_esc("CLOBBERED.");
1981 show_token_list(link(p), 0, max_print_line - 10);
1986 void print_rule_dimen(scaled d)
1994 void print_glue_(scaled d, integer order, char * s)
1998 if ((order < normal) || (order > filll))
2010 else if (*s != '\0')
2014 void print_spec_(integer p, char * s)
2016 if ((p < mem_min) || (p >= lo_mem_max))
2020 print_scaled(width(p));
2025 if (stretch(p) != 0)
2028 print_glue(stretch(p), stretch_order(p), s);
2034 print_glue(shrink(p), shrink_order(p), s);
2039 void print_fam_and_char_(halfword p)
2044 print(character(p));
2047 void print_delimiter_(halfword p)
2051 a = small_fam(p) * 256 + small_char(p);
2052 a = a * 0x1000 + large_fam(p) * 256 + large_char(p);
2060 void print_subsidiary_data_(halfword p, ASCII_code c)
2062 if ((pool_ptr - str_start[str_ptr]) >= depth_threshold)
2064 if (math_type(p) != 0)
2072 switch (math_type(p))
2076 print_current_string();
2077 print_fam_and_char(p);
2088 print_current_string();
2103 void print_style_(integer c)
2108 print_esc("displaystyle");
2111 print_esc("textstyle");
2114 print_esc("scriptstyle");
2117 print_esc("scriptscriptstyle");
2120 prints("Unknown style!");
2125 void print_skip_param_(integer n)
2129 case line_skip_code:
2130 print_esc("lineskip");
2133 case baseline_skip_code:
2134 print_esc("baselineskip");
2138 print_esc("parskip");
2141 case above_display_skip_code:
2142 print_esc("abovedisplayskip");
2145 case below_display_skip_code:
2146 print_esc("belowdisplayskip");
2149 case above_display_short_skip_code:
2150 print_esc("abovedisplayshortskip");
2153 case below_display_short_skip_code:
2154 print_esc("belowdisplayshortskip");
2157 case left_skip_code:
2158 print_esc("leftskip");
2161 case right_skip_code:
2162 print_esc("rightskip");
2166 print_esc("topskip");
2169 case split_top_skip_code:
2170 print_esc("splittopskip");
2174 print_esc("tabskip");
2177 case space_skip_code:
2178 print_esc("spaceskip");
2181 case xspace_skip_code:
2182 print_esc("xspaceskip");
2185 case par_fill_skip_code:
2186 print_esc("parfillskip");
2189 case thin_mu_skip_code:
2190 print_esc("thinmuskip");
2193 case med_mu_skip_code:
2194 print_esc("medmuskip");
2197 case thick_mu_skip_code:
2198 print_esc("thickmuskip");
2202 prints("[unknown glue parameter!]");
2207 void show_node_list_(integer p)
2212 if (cur_length > depth_threshold)
2214 if (p != 0) /* fixed 94/Mar/23 BUG FIX NOTE: still not fixed in 3.14159 ! */
2222 while (p != 0) { /* want p != null - bkph 93/Dec/15 NOTE: still not fixed in 3.14159 ! */
2224 print_current_string();
2228 prints("Bad link, display aborted.");
2234 if (n > breadth_max)
2240 if (is_char_node(p))
2241 print_font_and_char(p);
2242 else switch (type(p))
2248 if (type(p) == hlist_node)
2250 else if (type(p) == vlist_node)
2252 else print_esc("unset");
2255 print_scaled(height(p));
2257 print_scaled(depth(p));
2259 print_scaled(width(p));
2261 if (type(p) == unset_node)
2263 if (span_count(p) != 0)
2266 print_int(span_count(p) + 1);
2267 prints(" columns)");
2270 if (glue_stretch(p) != 0)
2272 prints(", stretch ");
2273 print_glue(glue_stretch(p), glue_order(p), "");
2276 if (glue_shrink(p) != 0)
2278 prints(", shrink ");
2279 print_glue(glue_shrink(p), glue_sign(p), "");
2286 if ((g != 0.0) && (glue_sign(p) != 0))
2288 prints(", glue set ");
2290 if (glue_sign(p) == shrinking)
2293 if (fabs(g)> 20000.0)
2300 print_glue(20000 * unity, glue_order(p), "");
2303 print_glue(round(unity * g), glue_order(p), "");
2306 if (shift_amount(p) != 0)
2308 prints(", shifted ");
2309 print_scaled(shift_amount(p));
2315 str_pool[pool_ptr] = 46;
2318 show_node_list(mem[p + 5].hh.rh);
2327 print_rule_dimen(height(p));
2329 print_rule_dimen(depth(p));
2331 print_rule_dimen(width(p));
2337 print_esc("insert");
2338 print_int(subtype(p));
2339 prints(", natural size ");
2340 print_scaled(height(p));
2342 print_spec(split_top_ptr(p), "");
2344 print_scaled(depth(p));
2345 prints("); float cost ");
2346 print_int(float_cost(p));
2349 str_pool[pool_ptr] = 46;
2352 show_node_list(mem[p + 4].hh.lh);
2362 print_write_whatsit(1279, p); /* debug # (-1 to exit): */
2364 print_file_name(open_name(p), open_area(p), open_ext(p));
2370 print_write_whatsit(591, p); /* write */
2371 print_mark(write_tokens(p));
2376 print_write_whatsit(1280, p); /* closeout */
2381 print_esc("special");
2382 print_mark(write_tokens(p));
2388 print_esc("setlanguage");
2389 print_int(what_lang(p));
2390 prints(" (hyphenmin ");
2391 print_int(what_lhm(p));
2393 print_int(what_rhm(p));
2405 if (subtype(p) >= a_leaders)
2409 if (subtype(p) == c_leaders)
2411 else if (subtype(p) == x_leaders)
2416 print_spec(glue_ptr(p), "");
2419 str_pool[pool_ptr] = 46;
2422 show_node_list(mem[p + 1].hh.rh);
2430 if (subtype(p) != normal)
2434 if (subtype(p) < cond_math_glue)
2435 print_skip_param(subtype(p) - 1);
2436 else if (subtype(p) == cond_math_glue)
2437 print_esc("nonscript");
2438 else print_esc("mskip");
2443 if (subtype(p) != cond_math_glue)
2447 if (subtype(p) < cond_math_glue)
2448 print_spec(glue_ptr(p), "");
2450 print_spec(glue_ptr(p), "mu");
2456 if (subtype(p) != mu_glue)
2460 if (subtype(p) != normal)
2463 print_scaled(width(p));
2465 if (subtype(p) == acc_kern)
2466 prints(" (for accent)");
2471 print_scaled(width(p));
2480 if (subtype(p) == before)
2487 prints(", surrounded ");
2488 print_scaled(width(p));
2495 print_font_and_char(lig_char(p));
2496 prints("(ligature ");
2501 font_in_short_display = font(lig_char(p));
2502 short_display(lig_ptr(p));
2504 if (odd(subtype(p)))
2513 print_esc("penalty ");
2514 print_int(penalty(p));
2520 print_esc("discretionary");
2522 if (replace_count(p) > 0)
2524 prints(" replacing ");
2525 print_int(replace_count(p));
2530 str_pool[pool_ptr] = 46;
2533 show_node_list(mem[p + 1].hh.lh);
2537 str_pool[pool_ptr]= 124;
2540 show_node_list(mem[p + 1].hh.rh);
2548 print_mark(mark_ptr(p));
2554 print_esc("vadjust");
2557 str_pool[pool_ptr] = 46;
2560 show_node_list(mem[p + 1].cint);
2567 print_style(subtype(p));
2572 print_esc("mathchoice");
2574 show_node_list(display_mlist(p));
2577 show_node_list(text_mlist(p));
2580 show_node_list(script_mlist(p));
2583 show_node_list(script_script_mlist(p));
2607 print_esc("mathord");
2611 print_esc("mathop");
2615 print_esc("mathbin");
2619 print_esc("mathrel");
2623 print_esc("mathopen");
2627 print_esc("mathclose");
2631 print_esc("mathpunct");
2635 print_esc("mathinner");
2639 print_esc("overline");
2643 print_esc("underline");
2647 print_esc("vcenter");
2652 print_esc("radical");
2653 print_delimiter(left_delimiter(p));
2659 print_esc("accent");
2660 print_fam_and_char(accent_chr(p));
2667 print_delimiter(delimiter(p));
2674 print_delimiter(delimiter(p));
2679 if (subtype(p) != normal)
2680 if (subtype(p) == limits)
2681 print_esc("limits");
2683 print_esc("nolimits");
2685 if (type(p) < left_noad)
2686 print_subsidiary_data(nucleus(p), '.');
2688 print_subsidiary_data(supscr(p), '^');
2689 print_subsidiary_data(subscr(p), '_');
2695 print_esc("fraction, thickness ");
2697 if (thickness(p) == 1073741824L) /* 2^30 */
2698 prints("= default");
2700 print_scaled(thickness(p));
2702 if ((small_fam(left_delimiter(p)) != 0) || (small_char(left_delimiter(p)) != 0) ||
2703 (large_fam(left_delimiter(p)) != 0) || (large_char(left_delimiter(p)) != 0))
2705 prints(", left-delimiter ");
2706 print_delimiter(left_delimiter(p));
2709 if ((small_fam(right_delimiter(p)) != 0) || (small_char(right_delimiter(p)) != 0) ||
2710 (large_fam(right_delimiter(p)) != 0) || (large_char(right_delimiter(p)) != 0))
2712 prints(", right-delimiter ");
2713 print_delimiter(right_delimiter(p));
2716 print_subsidiary_data(numerator(p), '\\');
2717 print_subsidiary_data(denominator(p), '/');
2722 prints("Unknown node type!");