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 print_string_ (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.");
334 else print(p - active_base);
335 else if (p >= undefined_control_sequence)
336 print_esc("IMPOSSIBLE.");
337 else if ((text(p) >= str_ptr))
338 print_esc("NONEXISTENT.");
347 void sprint_cs_(halfword p)
351 print(p - active_base);
352 else if (p < null_cs)
355 print(p - single_base);
360 print_esc("endcsname");
364 print_esc(""); print(text(p));
368 void print_file_name_(integer n, integer a, integer e)
375 void print_size_ (integer s)
378 print_esc("textfont");
380 print_esc("scriptfont");
382 print_esc("scriptscriptfont");
385 void print_write_whatsit_(str_number s, pointer p)
390 if (write_stream(p) < 16)
391 print_int(write_stream(p));
392 else if (write_stream(p) == 16)
394 else print_char('-');
399 close_files_and_terminate();
411 puts("EXITING at JUMPOUT");
413 if ((history != 0) && (history != 1))
422 // deal with error by asking for user response 0-9, D, E, H, I, X, Q, R, S
423 // NOTE: this may JUMPOUT either via X, or because of too many errors
427 integer s1, s2, s3, s4;
429 if (history < error_message_issued)
430 history = error_message_issued;
435 if (interaction == error_stop_mode)
439 clear_for_error_prompt();
462 if (deletions_allowed)
468 align_state = 1000000L;
469 OK_to_interrupt = false;
471 if ((last > first + 1) && (buffer[first + 1] >= '0') && (buffer[first + 1] <= '9'))
472 c = (c * 10 + buffer[first + 1] - '0' * 11);
486 OK_to_interrupt = true;
487 help2("I have just deleted some text, as you asked.",
488 "You can now delete more, or insert, or whatever.");
506 edit_name_start = str_start[input_stack[base_ptr].name_field];
507 edit_name_length = length(input_stack[base_ptr].name_field);
518 use_err_help = false;
523 help2("Sorry, I don't know how to help in this situation.",
524 "Maybe you should try asking a human?");
528 print_string(help_line[help_ptr]);
531 while (!(help_ptr == 0));
534 help4("Sorry, I already gave what help I could...",
535 "Maybe you should try asking a human?",
536 "An error might have occurred before I noticed any problems.",
537 "``If all else fails, read the instructions.''");
544 begin_file_reading();
546 if (last > first + 1)
553 prompt_input("insert>");
569 interaction = 0 + c - 81; /* Q = 0, R = 1, S = 2, T = 3 */
570 print_string("OK, entering ");
575 print_esc("batchmode");
580 print_esc("nonstopmode");
584 print_esc("scrollmode");
604 } /* end of switch analysing response character */
607 print_string("Type <return> to proceed, S to scroll future error messages,");
608 print_nl("R to run without stopping, Q to run quietly,");
609 print_nl("I to insert something, ");
612 print_string("E to edit your file,");
614 if (deletions_allowed)
615 print_nl("1 or ... or 9 to ignore the next 1 to 9 tokens of input,");
617 print_nl("H for help, X to quit.");
623 if (error_count == 100)
625 print_nl("(That makes 100 errors; please try again.)");
630 if (interaction > batch_mode)
638 else while (help_ptr > 0)
641 print_nl(help_line[help_ptr] == NULL ? "" : help_line[help_ptr]);
646 if (interaction > batch_mode)
652 void fatal_error(char * s)
654 normalize_selector();
655 print_err("Emergency stop");
660 void overflow_(char * s, integer n)
662 normalize_selector();
663 print_err("TeX capacity exceeded, sorry [");
668 help2("If you really absolutely need more capacity,",
669 "you can ask a wizard to enlarge me.");
673 if (!strcmp(s, "pattern memory") && (n == trie_size))
675 sprintf(log_line, "\n (Maybe use -h=... on command line in ini-TeX)\n");
676 show_line(log_line, 0);
678 else if (!strcmp(s, "exception dictionary") && (n == hyphen_prime))
680 sprintf(log_line, "\n (Maybe use -e=... on command line in ini-TeX)\n");
681 show_line(log_line, 0);
688 void confusion_(const char * s)
690 normalize_selector();
692 if (history < error_message_issued)
694 print_err("This can't happen (");
697 help1("I'm broken. Please show this to someone who can fix can fix");
701 print_err("I can't go on meeting you like this");
702 help2("One of your faux pas seems to have wounded me deeply...",
703 "in fact, I'm barely conscious. Please fix it and try again.");
709 boolean init_terminal (void)
719 while ((loc < last) && (buffer[loc]== ' '))
720 incr(loc); // step over initial white space
726 // failed to find input file name
731 flag = input_ln(stdin, true);
736 puts("! End of file on the terminal... why?\n");
742 while ((loc < last) && (buffer[loc]== ' '))
743 incr(loc); // step over intial white space
748 sprintf(log_line, "%s\n", "Please type the name of your input file.");
749 show_line(log_line, 1);
753 str_number make_string (void)
755 #ifdef ALLOCATESTRING
756 if (str_ptr == current_max_strings)
757 str_start = realloc_str_start(increment_max_strings);
759 if (str_ptr == current_max_strings)
761 overflow("number of strings", current_max_strings - init_str_ptr); /* 97/Mar/9 */
765 if (str_ptr == max_strings)
767 overflow("number of strings", max_strings - init_str_ptr);
773 str_start[str_ptr] = pool_ptr;
775 return (str_ptr - 1);
778 boolean str_eq_buf_ (str_number s, integer k)
785 while (j < str_start[s + 1])
787 if (str_pool[j] != buffer[k])
803 boolean str_eq_str_ (str_number s, str_number t)
810 if (length(s) != length(t))
816 while (j < str_start[s + 1])
818 if (str_pool[j] != str_pool[k])
831 void print_two_(integer n)
834 print_char('0' + (n / 10));
835 print_char('0' + (n % 10));
838 void print_hex_(integer n)
847 dig[k] = (unsigned char) (n % 16);
856 void print_roman_int_(integer n)
859 nonnegative_integer u, v;
861 j = str_start[260]; /* m2d5c2l5x2v5i */
868 print_char(str_pool[j]);
876 u = v / (str_pool[k - 1] - '0');
878 if (str_pool[k - 1] == 50)
881 u = u / (str_pool[k - 1] - '0');
886 print_char(str_pool[k]);
892 v = v / (str_pool[j - 1] - '0');
897 void print_current_string (void)
901 j = str_start[str_ptr];
905 print_char(str_pool[j]);
911 void term_input(void)
920 flag = input_ln(stdin, true);
924 fatal_error("End of file on the terminal!");
929 decr(selector); // shut off echo
932 for (k = first; k <= last - 1; k++)
936 incr(selector); // reset selector again
939 void int_error_ (integer n)
947 void normalize_selector (void)
950 selector = term_and_log;
952 selector = term_only;
957 if (interaction == batch_mode)
961 void pause_for_instructions (void)
965 interaction = error_stop_mode;
967 if ((selector == log_only) || (selector == no_print))
970 print_err("Interruption");
972 "Try to insert some instructions for me (e.g.,`I\\showlists'),",
973 "unless you just want to quit by typing `X'.");
974 deletions_allowed = false;
976 deletions_allowed = true;
981 integer half_(integer x)
984 return ((x + 1) / 2);
989 scaled round_decimals_(small_number k)
998 a = (a + dig[k] * 131072L) / 10; /* 2^17 */
1001 return ((a + 1) / 2);
1004 void print_scaled_(scaled s)
1014 print_int(s / 65536L);
1016 s = 10 * (s % 65536L) + 5;
1022 s = s - 17232; /* 2^15 - 50000 - rounding */
1024 print_char('0' + (s / 65536L));
1025 s = 10 * (s % 65536L);
1028 while (!(s <= delta));
1031 scaled mult_and_add_(integer n, scaled x, scaled y, scaled maxanswer)
1041 else if (((x <= (maxanswer - y) / n) && (- (integer) x <= (maxanswer + y) / n)))
1050 scaled x_over_n_(scaled x, integer n)
1052 register scaled Result;
1075 tex_remainder = x % n;
1079 Result = - (integer) ((- (integer) x)/ n);
1080 tex_remainder = - (integer) ((- (integer) x)% n);
1085 tex_remainder = - (integer) tex_remainder;
1090 scaled xn_over_d_(scaled x, integer n, integer d)
1092 register scaled Result;
1094 nonnegative_integer t, u, v;
1104 t = (x % 32767L) * n;
1105 u = (x / 32768L) * n + (t / 32768L);
1106 v = (u % d) * 32768L + (t % 32768L);
1108 if (u / d >= 32768L)
1111 u = 32768L * (u / d) + (v / d);
1116 tex_remainder = v % d;
1120 Result = - (integer) u;
1121 tex_remainder = - (integer)(v % d);
1127 halfword badness_(scaled t, scaled s)
1139 else if (s >= 1663497L)
1147 return (r * r * r + 131072L) / 262144L; /* 2^17 */
1152 void print_word_(memory_word w)
1156 print_scaled(w.cint);
1158 print_scaled(round(65536L * w.gr));
1168 print_int(w.qqqq.b0);
1170 print_int(w.qqqq.b1);
1172 print_int(w.qqqq.b2);
1174 print_int(w.qqqq.b3);
1176 /* need this version only if SHORTFONTINFO defined */
1177 void zprintfword(memory_word w)
1181 print_scaled(w.cint);
1183 print_scaled(round(65536L * w.gr));
1189 print_int(w .hh.b1);
1193 print_int(w.qqqq.b0);
1195 print_int(w.qqqq.b1);
1197 print_int(w.qqqq.b2);
1199 print_int(w.qqqq.b3);
1203 void show_token_list_(integer p, integer q, integer l)
1206 ASCII_code match_chr;
1213 while ((p != 0) && (tally < l))
1217 first_count = tally;
1218 trick_count = tally + 1 + error_line - half_error_line;
1220 if (trick_count < error_line)
1221 trick_count = error_line;
1224 if ((p < hi_mem_min) || (p > mem_end))
1226 print_esc("CLOBBERED.");
1230 if (info(p) >= cs_token_flag)
1231 print_cs(info(p) - cs_token_flag);
1262 print_char(c + '0');
1271 match_chr = (ASCII_code) c;
1300 if (scanner_status > 1)
1302 print_nl("Runaway ");
1304 switch (scanner_status)
1307 print_string("definition");
1312 print_string("argument");
1317 print_string("preamble");
1322 print_string("text");
1329 show_token_list(link(p), 0, error_line - 10);
1333 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1334 /* first try list of available nodes (avail != NULL) */
1335 /* then see if can go upwards (mem_end < mem_max) */
1336 /* then see if can go downwards (hi_mem_min > lo_mem_max) */
1337 /* if not, extend memory at the top and grab from there --- new */
1338 /* else fail ! paragraph 120 */
1339 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1340 halfword get_avail (void)
1347 avail = link(avail);
1348 else if (mem_end < mem_max)
1358 if (hi_mem_min <= lo_mem_max) /* have we run out in middle ? */
1361 mem = realloc_main (0, mem_top / 2); /* zzzaa = zmem = mem */
1366 if (mem_end >= mem_max)
1369 overflow("main memory size", mem_max + 1 - mem_min);
1373 incr(mem_end); /* then grab from new area */
1374 p = mem_end; /* 1993/Dec/14 */
1378 link(p) = 0; /* link(p) = null !!! */
1387 void flush_list_(pointer p)
1391 if (p != 0) /* null !!! */
1403 while (!(r == 0)); /* r != null */
1410 pointer get_node_(integer s)
1422 q = p + node_size(p);
1424 while ((mem[q].hh.rh == empty_flag))
1431 llink(t) = llink(q);
1432 rlink(llink(q)) = t;
1433 q = q + node_size(q);
1438 if (r > toint(p + 1))
1440 node_size(p) = r - p;
1455 node_size(p) = q - p;
1458 while (!(p == rover));
1460 if (s == 1073741824L) /* 2^30 - special case - merge adjacent */
1463 puts("Merged adjacent multi-word nodes\n");
1465 return max_halfword;
1468 /* maybe try downward epxansion first instead ? */
1469 if (lo_mem_max + 2 < hi_mem_min)
1470 if (lo_mem_max + 2 <= mem_bot + max_halfword) /* silly ? flush 93/Dec/16 */
1472 /* if (hi_mem_min - lo_mem_max >= 1998) */
1473 if (hi_mem_min - lo_mem_max >= (block_size + block_size - 2))
1474 /* t = lo_mem_max + 1000; */
1475 t = lo_mem_max + block_size;
1477 t = lo_mem_max + 1 + (hi_mem_min - lo_mem_max) / 2;
1484 if (t > mem_bot + max_halfword)
1485 t = mem_bot + max_halfword; /* silly ? flush 93/Dec/16 */
1489 link(q) = empty_flag;
1490 node_size(q) = t - lo_mem_max; /* block size */
1492 link(lo_mem_max) = 0;
1493 info(lo_mem_max) = 0;
1498 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1499 /* we've run out of space in the middle for variable length blocks */
1500 /* try and add new block from below mem_bot *//* first check if space ! */
1501 if (mem_min - (block_size + 1) <= mem_start) /* extend lower memory downwards */
1503 mem = realloc_main (mem_top/2 + block_size, 0); /* zzzaa = zmem = mem */
1511 if (mem_min - (block_size + 1) <= mem_start) /* check again */
1515 sprintf(log_line, "mem_min %d, mem_start %d, block_size %d\n", mem_min, mem_start, block_size);
1516 show_line(log_line, 0);
1519 overflow("main memory size", mem_max + 1 - mem_min); /* darn: allocation failed ! */
1523 add_variable_space (block_size); /* now to be found in itex.c */
1524 goto restart; /* go try get_node again */
1530 var_used = var_used + s;
1536 void free_node_(halfword p, halfword s)
1541 link(p) = empty_flag;
1549 var_used = var_used - s;
1553 pointer new_null_box (void)
1557 p = get_node(box_node_size);
1558 type(p) = hlist_node;
1559 subtype(p) = min_quarterword;
1563 shift_amount(p) = 0;
1565 glue_sign(p) = normal;
1566 glue_order(p) = normal;
1572 pointer new_rule (void)
1576 p = get_node(rule_node_size);
1577 type(p) = rule_node;
1579 width(p) = null_flag;
1580 depth(p) = null_flag;
1581 height(p) = null_flag;
1586 pointer new_ligature_(quarterword f, quarterword c, pointer q)
1590 p = get_node(small_node_size);
1591 type(p) = ligature_node;
1592 font(lig_char(p)) = f;
1593 character(lig_char(p)) = c;
1600 pointer new_lig_item_(quarterword c)
1604 p = get_node(small_node_size);
1611 pointer new_disc (void)
1615 p = get_node(small_node_size);
1616 type(p) = disc_node;
1617 replace_count(p) = 0;
1624 pointer new_math_(scaled w, small_number s)
1628 p = get_node(small_node_size);
1629 type(p) = math_node;
1636 pointer new_spec_(pointer p)
1640 q = get_node(glue_spec_size);
1642 glue_ref_count(q) = 0;
1643 width(q) = width(p);
1644 stretch(q) = stretch(p);
1645 shrink(q) = shrink(p);
1650 pointer new_param_glue_(small_number n)
1655 p = get_node(small_node_size);
1656 type(p) = glue_node;
1661 incr(glue_ref_count(q));
1666 pointer new_glue_(pointer q)
1670 p = get_node(small_node_size);
1671 type(p) = glue_node;
1672 subtype(p) = normal;
1675 incr(glue_ref_count(q));
1680 pointer new_skip_param_(small_number n)
1684 temp_ptr = new_spec(glue_par(n));
1685 p = new_glue(temp_ptr);
1686 glue_ref_count(temp_ptr) = 0;
1692 pointer new_kern(scaled w)
1696 p = get_node(small_node_size);
1697 type(p) = kern_node;
1698 subtype(p) = normal;
1704 pointer new_penalty(integer m)
1708 p = get_node(small_node_size);
1709 type(p) = penalty_node;
1718 void check_mem(boolean printlocs)
1723 for (p = mem_min; p <= lo_mem_max; p++) freearr[p] = false;
1724 for (p = hi_mem_min; p <= mem_end; p++) freearr[p] = false;
1729 if ((p > mem_end) || (p < hi_mem_min))
1731 else if (freearr[p])
1736 print_nl("AVAIL list clobbered at ");
1749 if ((p >= lo_mem_max) || (p < mem_min))
1751 else if ((rlink(p) >= lo_mem_max) || (rlink(p) < mem_min))
1753 else if (!(is_empty(p)) || (node_size(p) < 2) ||
1754 (p + node_size(p) > lo_mem_max) || (llink(rlink(p)) != p))
1759 print_nl("Double-AVAIL list clobbered at ");
1764 for (q = p; q <= p + node_size(p) - 1; q++)
1768 print_nl("Doubly free location at ");
1776 } while (!(p == rover));
1779 while (p <= lo_mem_max) {
1782 print_nl("Bad flag at ");
1785 while ((p <= lo_mem_max) && !freearr[p]) incr(p);
1786 while ((p <= lo_mem_max) && freearr[p]) incr(p);
1791 print_nl("New busy locs:");
1793 for (p = mem_min; p <= lo_mem_max; p++)
1794 if (!freearr[p] && ((p > was_lo_max) || wasfree[p]))
1800 for (p = hi_mem_min; p <= mem_end; p++)
1801 if (!freearr[p] && ((p < was_hi_min) || (p > was_mem_end) || wasfree[p]))
1808 for (p = mem_min; p <= lo_mem_max; p++) wasfree[p] = freearr[p];
1809 for (p = hi_mem_min; p <= mem_end; p++) wasfree[p] = freearr[p];
1811 was_mem_end = mem_end;
1812 was_lo_max = lo_mem_max;
1813 was_hi_min = hi_mem_min;
1819 void search_mem_(halfword p)
1823 for (q = mem_min; q <= lo_mem_max; q++)
1839 for (q = hi_mem_min; q <= mem_end; q++)
1855 for (q = active_base; q <= box_base + 255; q++)
1864 for (q = 0; q <= save_ptr - 1; q++)
1866 if (equiv_field(save_stack[q]) == p)
1874 for (q = 0; q <= hyphen_prime; q++)
1875 if (hyph_list[q] == p)
1884 void short_display_(integer p)
1888 while (p != 0) /* want p != null here ! */
1890 if (is_char_node(p))
1894 if (font(p) != font_in_short_display)
1896 if ((font(p) > font_max))
1901 print(font_id_text(font(p)));
1905 font_in_short_display = font(p);
1907 print(character(p));
1910 else switch (mem[p].hh.b0)
1925 if (glue_ptr(p) != 0)
1932 short_display(lig_ptr(p));
1935 short_display(pre_break(p));
1936 short_display(post_break(p));
1937 n = replace_count(p);
1954 void print_font_and_char (integer p)
1957 print_esc("CLOBBERED.");
1960 if ((font(p) > font_max))
1965 print(font_id_text(font(p)));
1969 print(character(p));
1973 void print_mark_ (integer p)
1977 if ((p < hi_mem_min) || (p > mem_end))
1978 print_esc("CLOBBERED.");
1980 show_token_list(link(p), 0, max_print_line - 10);
1985 void print_rule_dimen(scaled d)
1987 if ((d == -1073741824L)) /* - 2^30 */
1993 void print_glue_(scaled d, integer order, char * s)
1997 if ((order < normal) || (order > filll))
1998 print_string("foul");
2001 print_string("fil");
2009 else if (*s != '\0')
2013 void print_spec_(integer p, char * s)
2015 if ((p < mem_min) || (p >= lo_mem_max))
2019 print_scaled(width(p));
2024 if (stretch(p) != 0)
2026 print_string("plus");
2027 print_glue(stretch(p), stretch_order(p), s);
2032 print_string("minus");
2033 print_glue(shrink(p), shrink_order(p), s);
2038 void print_fam_and_char_(halfword p)
2043 print(character(p));
2046 void print_delimiter_(halfword p)
2050 a = small_fam(p) * 256 + small_char(p);
2051 a = a * 0x1000 + large_fam(p) * 256 + large_char(p);
2059 void print_subsidiary_data_(halfword p, ASCII_code c)
2061 if ((pool_ptr - str_start[str_ptr]) >= depth_threshold)
2063 if (math_type(p) != 0)
2064 print_string(" []");
2071 switch (math_type(p))
2075 print_current_string();
2076 print_fam_and_char(p);
2087 print_current_string();
2102 void print_style_(integer c)
2107 print_esc("displaystyle");
2110 print_esc("textstyle");
2113 print_esc("scriptstyle");
2116 print_esc("scriptscriptstyle");
2119 print_string("Unknown style!");
2124 void print_skip_param_(integer n)
2128 case line_skip_code:
2129 print_esc("lineskip");
2132 case baseline_skip_code:
2133 print_esc("baselineskip");
2137 print_esc("parskip");
2140 case above_display_skip_code:
2141 print_esc("abovedisplayskip");
2144 case below_display_skip_code:
2145 print_esc("belowdisplayskip");
2148 case above_display_short_skip_code:
2149 print_esc("abovedisplayshortskip");
2152 case below_display_short_skip_code:
2153 print_esc("belowdisplayshortskip");
2156 case left_skip_code:
2157 print_esc("leftskip");
2160 case right_skip_code:
2161 print_esc("rightskip");
2165 print_esc("topskip");
2168 case split_top_skip_code:
2169 print_esc("splittopskip");
2173 print_esc("tabskip");
2176 case space_skip_code:
2177 print_esc("spaceskip");
2180 case xspace_skip_code:
2181 print_esc("xspaceskip");
2184 case par_fill_skip_code:
2185 print_esc("parfillskip");
2188 case thin_mu_skip_code:
2189 print_esc("thinmuskip");
2192 case med_mu_skip_code:
2193 print_esc("medmuskip");
2196 case thick_mu_skip_code:
2197 print_esc("thickmuskip");
2201 print_string("[unknown glue parameter!]");
2206 void show_node_list_(integer p)
2211 if (cur_length > depth_threshold)
2213 if (p != 0) /* fixed 94/Mar/23 BUG FIX NOTE: still not fixed in 3.14159 ! */
2214 print_string(" []");
2221 while (p != 0) { /* want p != null - bkph 93/Dec/15 NOTE: still not fixed in 3.14159 ! */
2223 print_current_string();
2227 print_string("Bad link, display aborted.");
2233 if (n > breadth_max)
2235 print_string("etc.");
2239 if (is_char_node(p))
2240 print_font_and_char(p);
2241 else switch (type(p))
2247 if (type(p) == hlist_node)
2249 else if (type(p) == vlist_node)
2251 else print_esc("unset");
2253 print_string("box(");
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 print_string(" columns)");
2269 if (glue_stretch(p) != 0)
2271 print_string(", stretch ");
2272 print_glue(glue_stretch(p), glue_order(p), "");
2275 if (glue_shrink(p) != 0)
2277 print_string(", shrink ");
2278 print_glue(glue_shrink(p), glue_sign(p), "");
2285 if ((g != 0.0) && (glue_sign(p) != 0))
2287 print_string(", glue set ");
2289 if (glue_sign(p) == shrinking)
2292 if (fabs(g)> 20000.0)
2297 print_string("< -");
2299 print_glue(20000 * unity, glue_order(p), "");
2302 print_glue(round(unity * g), glue_order(p), "");
2305 if (shift_amount(p) != 0)
2307 print_string(", shifted ");
2308 print_scaled(shift_amount(p));
2314 str_pool[pool_ptr] = 46;
2317 show_node_list(mem[p + 5].hh.rh);
2326 print_rule_dimen(height(p));
2328 print_rule_dimen(depth(p));
2330 print_rule_dimen(width(p));
2336 print_esc("insert");
2337 print_int(subtype(p));
2338 print_string(", natural size ");
2339 print_scaled(height(p));
2340 print_string("; split(");
2341 print_spec(split_top_ptr(p), "");
2343 print_scaled(depth(p));
2344 print_string("); float cost ");
2345 print_int(float_cost(p));
2348 str_pool[pool_ptr] = 46;
2351 show_node_list(mem[p + 4].hh.lh);
2361 print_write_whatsit(1279, p); /* debug # (-1 to exit): */
2363 print_file_name(open_name(p), open_area(p), open_ext(p));
2369 print_write_whatsit(591, p); /* write */
2370 print_mark(write_tokens(p));
2375 print_write_whatsit(1280, p); /* closeout */
2380 print_esc("special");
2381 print_mark(write_tokens(p));
2387 print_esc("setlanguage");
2388 print_int(what_lang(p));
2389 print_string(" (hyphenmin ");
2390 print_int(what_lhm(p));
2392 print_int(what_rhm(p));
2398 print_string("whatsit?");
2404 if (subtype(p) >= a_leaders)
2408 if (subtype(p) == c_leaders)
2410 else if (subtype(p) == x_leaders)
2413 print_string("leaders ");
2415 print_spec(glue_ptr(p), "");
2418 str_pool[pool_ptr] = 46;
2421 show_node_list(mem[p + 1].hh.rh);
2429 if (subtype(p) != normal)
2433 if (subtype(p) < cond_math_glue)
2434 print_skip_param(subtype(p) - 1);
2435 else if (subtype(p) == cond_math_glue)
2436 print_esc("nonscript");
2437 else print_esc("mskip");
2442 if (subtype(p) != cond_math_glue)
2446 if (subtype(p) < cond_math_glue)
2447 print_spec(glue_ptr(p), "");
2449 print_spec(glue_ptr(p), "mu");
2455 if (subtype(p) != mu_glue)
2459 if (subtype(p) != normal)
2462 print_scaled(width(p));
2464 if (subtype(p) == acc_kern)
2465 print_string(" (for accent)");
2470 print_scaled(width(p));
2479 if (subtype(p) == before)
2482 print_string("off");
2486 print_string(", surrounded ");
2487 print_scaled(width(p));
2494 print_font_and_char(lig_char(p));
2495 print_string("(ligature ");
2500 font_in_short_display = font(lig_char(p));
2501 short_display(lig_ptr(p));
2503 if (odd(subtype(p)))
2512 print_esc("penalty ");
2513 print_int(penalty(p));
2519 print_esc("discretionary");
2521 if (replace_count(p) > 0)
2523 print_string(" replacing ");
2524 print_int(replace_count(p));
2529 str_pool[pool_ptr] = 46;
2532 show_node_list(mem[p + 1].hh.lh);
2536 str_pool[pool_ptr]= 124;
2539 show_node_list(mem[p + 1].hh.rh);
2547 print_mark(mark_ptr(p));
2553 print_esc("vadjust");
2556 str_pool[pool_ptr] = 46;
2559 show_node_list(mem[p + 1].cint);
2566 print_style(subtype(p));
2571 print_esc("mathchoice");
2573 show_node_list(display_mlist(p));
2576 show_node_list(text_mlist(p));
2579 show_node_list(script_mlist(p));
2582 show_node_list(script_script_mlist(p));
2606 print_esc("mathord");
2610 print_esc("mathop");
2614 print_esc("mathbin");
2618 print_esc("mathrel");
2622 print_esc("mathopen");
2626 print_esc("mathclose");
2630 print_esc("mathpunct");
2634 print_esc("mathinner");
2638 print_esc("overline");
2642 print_esc("underline");
2646 print_esc("vcenter");
2651 print_esc("radical");
2652 print_delimiter(left_delimiter(p));
2658 print_esc("accent");
2659 print_fam_and_char(accent_chr(p));
2666 print_delimiter(delimiter(p));
2673 print_delimiter(delimiter(p));
2678 if (subtype(p) != normal)
2679 if (subtype(p) == limits)
2680 print_esc("limits");
2682 print_esc("nolimits");
2684 if (type(p) < left_noad)
2685 print_subsidiary_data(nucleus(p), '.');
2687 print_subsidiary_data(supscr(p), '^');
2688 print_subsidiary_data(subscr(p), '_');
2694 print_esc("fraction, thickness ");
2696 if (thickness(p) == 1073741824L) /* 2^30 */
2697 print_string("= default");
2699 print_scaled(thickness(p));
2701 if ((small_fam(left_delimiter(p)) != 0) || (small_char(left_delimiter(p)) != 0) ||
2702 (large_fam(left_delimiter(p)) != 0) || (large_char(left_delimiter(p)) != 0))
2704 print_string(", left-delimiter ");
2705 print_delimiter(left_delimiter(p));
2708 if ((small_fam(right_delimiter(p)) != 0) || (small_char(right_delimiter(p)) != 0) ||
2709 (large_fam(right_delimiter(p)) != 0) || (large_char(right_delimiter(p)) != 0))
2711 print_string(", right-delimiter ");
2712 print_delimiter(right_delimiter(p));
2715 print_subsidiary_data(numerator(p), '\\');
2716 print_subsidiary_data(denominator(p), '/');
2721 print_string("Unknown node type!");