6 #pragma warning(disable:4115) // kill rpcasync.h complaint
8 #define MYLIBAPI __declspec(dllexport)
13 #pragma warning(disable:4996)
14 #pragma warning(disable:4131) // old style declarator
15 #pragma warning(disable:4135) // conversion between different integral types
16 #pragma warning(disable:4127) // conditional expression is constant
25 static void winerror (char * message)
27 (void) MessageBox(NULL, message, "YandYTeX.DLL", MB_ICONSTOP | MB_OK);
31 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
32 void append_char (ASCII_code c)
34 str_pool[pool_ptr] = c;
39 if (interaction == error_stop_mode)
40 interaction = scroll_mode;
51 void dvi_out_ (ASCII_code op)
53 dvi_buf[dvi_ptr] = op;
55 if (dvi_ptr == dvi_limit)
58 void flush_string (void)
61 pool_ptr = str_start[str_ptr];
63 void print_err (const char * s)
65 if (interaction == error_stop_mode);
69 void tex_help (unsigned int n, ...)
76 va_start(help_arg, n);
77 for (i = n - 1; i > n - 1; --i)
78 help_line[i] = va_arg(help_arg, char *);
81 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
83 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
93 (void) putc ('\n', log_file);
99 (void) putc ('\n', log_file);
115 (void) putc ('\n', write_file[selector]);
120 void print_char_ (ASCII_code s)
122 if (s == new_line_char)
123 if (selector < pseudo) {
130 (void) show_char(Xchr(s));
132 (void) putc(Xchr(s), log_file);
134 if (term_offset == max_print_line) {
138 if (file_offset == max_print_line) {
139 (void) putc ('\n', log_file);
146 (void) putc(Xchr(s), log_file);
148 if (file_offset == max_print_line) print_ln();
153 (void) show_char(Xchr(s));
155 if (term_offset == max_print_line) print_ln();
162 if (tally < trick_count)
163 trick_buf[tally % error_line]= s;
167 #ifdef ALLOCATESTRING
168 if (pool_ptr + 1 > current_pool_size) {
169 str_pool = realloc_str_pool (increment_pool_size);
171 if (pool_ptr < current_pool_size) {
172 str_pool[pool_ptr]= s;
176 if (pool_ptr < pool_size) {
177 str_pool[pool_ptr]= s;
184 (void) putc(Xchr(s), write_file[selector]);
190 /* This could be made more efficient using fputs ? ... bkph */
191 void print_ (integer s)
195 if (s >= str_ptr) s = 259; /* ??? */
197 if (s < 0) s = 259; /* ??? */
199 if (selector > pseudo){
203 if ((s == new_line_char))
208 nl = new_line_char; /* save eol */
210 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
211 /* if (!show_in_hex && s < 256) */ /* show control chars also ?? */
212 if (!show_in_hex && s < 256 && s >= 32) { /* 94/Jan/26 */
213 /* following added 1996/Jan/20 */
214 if (show_in_dos && s > 127) { /* translate ANSI to DOS 850 */
215 if (wintodos[s-128] > 0) print_char (wintodos[s-128]);
216 else { /* print in hex after all */
218 while(j < str_start[s + 1]){
219 print_char(str_pool[j]);
223 } else print_char(s); /* don't translate to hex */
224 } else { /* not just a character */
225 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
227 while(j < str_start[s + 1]){
228 print_char(str_pool[j]);
232 new_line_char = nl; /* restore eol */
235 /* we get here with s > 256 - i.e. not a single character */
237 while(j < str_start[s + 1]){
238 print_char(str_pool[j]);
242 void print_string_ (unsigned char *s)
244 while (*s > 0) print_char(*s++);
247 // print string number s from string pool by calling print_
248 void slow_print_ (integer s)
251 if ((s >= str_ptr) || (s < 256)) print(s);
254 while (j < str_start[s + 1]) {
255 // if (str_pool[j]>= 128) print(str_pool[j]-128); // debugging only
256 // if (str_pool[j]== 0) print(36); // debugging only
263 // print newline followed by string number s (unless at start of line)
264 void print_nl_ (char * s)
266 if (((term_offset > 0) && (odd(selector))) ||
267 ((file_offset > 0) && (selector >= log_only)))
272 // print string number s preceded by escape character
273 void print_esc_ (char * s)
278 if (c < 256) print(c);
283 void print_the_digs_ (eight_bits k)
288 print_char('0' + dig[k]);
290 print_char('A' + dig[k]);
294 void print_int_ (integer n)
317 dig[k]= (char) (n % 10);
324 void print_cs_ (integer p)
326 if (p < 514) /* if p < hash_base then ... p.262 */
327 if (p >= 257) /* if p > single_base then ... p.262 */
328 if (p == 513) /* if p = null_cs then ... p.262 */
331 print_esc("endcsname");
334 //print_esc(p - 257); /* p - single_base */
335 print_esc("");print(p - 257);
336 /* if cat_code(p - single_base) = letter then ... p.262 */
337 if (eqtb[(hash_size + 1883) + p - 257].hh.v.RH == 11)
341 print_esc("IMPOSSIBLE.");
343 else if (p >= (hash_size + 781)) /* undefined_control_sequence */
344 print_esc("IMPOSSIBLE.");
345 else if ((hash[p].v.RH >= str_ptr))
346 print_esc("NONEXISTENT.");
348 //print_esc(hash[p].v.RH);
349 print_esc(""); print(hash[p].v.RH);
350 print_char(32); /* */
354 void sprint_cs_(halfword p)
356 if (p < 514) /* if p < hash_base then ... p.263 */
357 if (p < 257) /* if p < single_base then ... p.263 */
358 print(p - 1); /* print (p - active_base); */
359 else if (p < 513) /* else if p < null_cs then ... */
360 //print_esc(p - 257); /* print (p - single_base); */
361 {print_esc(""); print(p-257);}
364 print_esc("endcsname");
366 else //print_esc(hash[p].v.RH);
368 print_esc(""); print(hash[p].v.RH);
372 /* ! I can't find file ` c:/foo/ accents .tex '. */
373 void print_file_name_(integer n, integer a, integer e)
375 /* sprintf(log_line, "\na %d n %d e %d\n", a, n, e); */
376 /* show_line(log_line, 0); */
377 // print_char(33); // debugging only
379 // print_char(33); // debugging only
381 // print_char(33); // debugging only
383 // print_char(33); // debugging only
386 void print_size_(integer s)
389 print_esc("textfont");
391 print_esc("scriptfont");
393 print_esc("scriptscriptfont");
396 void print_write_whatsit_(str_number s, halfword p)
399 print_esc(""); print(s);
400 if (mem[p + 1].hh.v.LH < 16)
401 print_int(mem[p + 1].hh.v.LH);
402 else if (mem[p + 1].hh.v.LH == 16)
404 else print_char('-');
409 // called from itex.c and tex0.c only NASTY NASTY!
410 // now uses uses non-local goto (longjmp) 1999/Nov/7
413 close_files_and_terminate();
422 show_line("EXITING at JUMPOUT\n", 0);
424 if ((history != 0) && (history != 1))
431 // deal with error by asking for user response 0-9, D, E, H, I, X, Q, R, S
432 // NOTE: this may JUMPOUT either via X, or because of too many errors
436 integer s1, s2, s3, s4;
444 if (interaction == error_stop_mode)
447 clear_for_error_prompt();
451 term_input(264, help_ptr);
453 if (last == first) return; // no input
454 c = buffer[first]; // analyze first letter typed
455 if (c >= 97) // uppercase letter first
456 c = (unsigned char) (c - 32);
468 if (deletions_allowed) {
473 align_state = 1000000L;
474 OK_to_interrupt = false;
475 if ((last > first + 1) && (buffer[first + 1]>= 48) && (buffer[first + 1]<= 57))
476 c = (unsigned char) (c * 10 + buffer[first + 1]- 48 * 11);
478 c = (unsigned char) (c - 48);
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.");
491 goto lab22; /* loop again */
499 goto lab22; /* loop again */
505 edit_name_start = str_start[input_stack[base_ptr].name_field];
506 edit_name_length = str_start[input_stack[base_ptr].name_field + 1] -
507 str_start[input_stack[base_ptr].name_field];
517 use_err_help = false;
520 help2("Sorry, I don't know how to help in this situation.",
521 "Maybe you should try asking a human?");
524 print_string(help_line[help_ptr]);
526 } while (!(help_ptr == 0));
528 help4("Sorry, I already gave what help I could...",
529 "Maybe you should try asking a human?",
530 "An error might have occurred before I noticed any problems.",
531 "``If all else fails, read the instructions.''");
532 goto lab22; /* loop again */
537 begin_file_reading();
538 if (last > first + 1)
540 cur_input.loc_field = first + 1;
545 print_string("insert>");
548 cur_input.loc_field = first;
551 cur_input.limit_field = last - 1;
560 interaction = 0 + c - 81; /* Q = 0, R = 1, S = 2, T = 3 */
561 print_string("OK, entering ");
565 print_esc("batchmode"); /* */
570 print_esc("nonstopmode"); /* */
573 print_esc("scrollmode"); /* */
586 interaction = scroll_mode;
593 } /* end of switch analysing response character */
595 print_string("Type <return> to proceed, S to scroll future error messages,");
596 print_nl("R to run without stopping, Q to run quietly,"); /* */
597 print_nl("I to insert something, "); /* */
598 if (base_ptr > 0) print_string("E to edit your file,");
599 if (deletions_allowed) print_nl("1 or ... or 9 to ignore the next 1 to 9 tokens of input,"); /* */
600 print_nl("H for help, X to quit."); /* */
602 } /* end of while(true) loop */
605 if (error_count == 100) {
606 print_nl("(That makes 100 errors; please try again.)");
609 // return; // can drop through now 99/Oct/20
611 if (interaction > 0) decr(selector);
616 else while(help_ptr > 0) {
618 print_nl(help_line[help_ptr]);
626 void fatal_error_(char * s)
628 normalize_selector();
629 print_err("Emergency stop");
634 void overflow_(char * s, integer n)
636 normalize_selector();
637 print_err("TeX capacity exceeded, sorry [");
642 help2("If you really absolutely need more capacity,",
643 "you can ask a wizard to enlarge me.");
644 if (! knuth_flag) { /* Additional comments 98/Jan/5 */
645 if (!strcmp(s, "pattern memory") && n == trie_size) {
646 sprintf(log_line, "\n (Maybe use -h=... on command line in ini-TeX)\n");
647 show_line(log_line, 0);
648 } else if (!strcmp(s, "exception dictionary") && n == hyphen_prime) {
649 sprintf(log_line, "\n (Maybe use -e=... on command line in ini-TeX)\n");
650 show_line(log_line, 0);
656 void confusion_(char * s)
658 normalize_selector();
660 print_err("This can't happen(");
663 help1("I'm broken. Please show this to someone who can fix can fix");
665 print_err("I can't go on meeting you like this");
666 help2("One of your faux pas seems to have wounded me deeply...",
667 "in fact, I'm barely conscious. Please fix it and try again.");
672 bool init_terminal (void)
674 register bool Result;
679 cur_input.loc_field = first;
680 while((cur_input.loc_field < last) && (buffer[cur_input.loc_field]== ' '))
681 incr(cur_input.loc_field); // step over initial white space
682 if (cur_input.loc_field < last){
684 return Result; // there is an input file name
688 // failed to find input file name
692 flag = ConsoleInput("**", "Please type a file name or a control sequence\r\n(or ^z to exit)", (char *) &buffer[first]);
693 last = first + strlen((char *) &buffer[first]); /* -1 ? */
694 // may need to be more elaborate see input_line in texmf.c
696 (void) fputs("**", stdout);
698 flag = input_ln(stdin, true);
702 show_line("! End of file on the terminal... why?\n", 1);
707 cur_input.loc_field = first;
708 while ((cur_input.loc_field < last) && (buffer[cur_input.loc_field]== ' '))
709 incr(cur_input.loc_field); // step over intial white space
710 if (cur_input.loc_field < last) {
712 return Result; // there is an input file name
714 sprintf(log_line, "%s\n", "Please type the name of your input file.");
715 show_line(log_line, 1);
719 // Make string from str_start[str_ptr]to pool_ptr
720 str_number make_string (void)
722 register str_number Result;
723 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
724 #ifdef ALLOCATESTRING
725 if (str_ptr == current_max_strings)
726 str_start = realloc_str_start(increment_max_strings);
727 if (str_ptr == current_max_strings) {
728 // printf("**********MAKESTRING**********"); // debugging only
729 overflow("number of strings", current_max_strings - init_str_ptr); /* 97/Mar/9 */
730 return 0; // abort_flag set
733 if (str_ptr == max_strings) {
734 overflow("number of strings", max_strings - init_str_ptr); /* number of strings */
735 return 0; // abort_flag set
739 str_start[str_ptr] = pool_ptr;
740 Result = str_ptr - 1;
744 bool str_eq_buf_ (str_number s, integer k)
746 register bool Result;
750 while (j < str_start[s + 1]) {
751 if (str_pool[j]!= buffer[k])
760 lab45: Result = result;
764 bool str_eq_str_ (str_number s, str_number t)
766 register bool Result;
770 if (length(s) != length(t))
774 while (j < str_start[s + 1]) {
775 if (str_pool[j] != str_pool[k])
781 lab45: Result = result;
785 void print_two_(integer n)
788 print_char('0' + (n / 10));
789 print_char('0' + (n % 10));
792 void print_hex_(integer n)
798 dig[k] = (unsigned char) (n % 16);
805 void print_roman_int_(integer n)
808 nonnegative_integer u, v;
809 j = str_start[260]; /* m2d5c2l5x2v5i */
813 print_char(str_pool[j]);
819 u = v / (str_pool[k - 1]- 48);
820 if (str_pool[k - 1]== 50)
823 u = u / (str_pool[k - 1]- 48);
827 print_char(str_pool[k]);
831 v = v / (str_pool[j - 1]- 48);
836 void print_current_string (void)
839 j = str_start[str_ptr];
840 while (j < pool_ptr) {
841 print_char(str_pool[j]);
846 int stringlength (int str_ptr)
849 nstart = str_start[str_ptr];
850 nnext = str_start[str_ptr + 1];
851 return (nnext - nstart) + 2;
854 char * add_string (char *s, int str_ptr)
856 int nstart, nnext, n;
857 nstart = str_start[str_ptr];
858 nnext = str_start[str_ptr + 1];
860 memcpy(s, &str_pool[nstart], n);
869 // make one long \r\n separated string out of help lines
870 // str_pool is packed_ASCII_code *
872 char * make_up_help_string (int nhelplines)
874 char * helpstring, *s;
877 // get length of help for this specific message
878 for (k = nhelplines-1; k >= 0; k--) {
879 //nlen += stringlength(help_line[k]);
880 nlen += strlen(help_line[k]);
882 nlen += 2; // for blank line separator
884 nlen += stringlength(265);
885 nlen += stringlength(266);
886 nlen += stringlength(267);
887 if (base_ptr > 0)nlen += stringlength(268);
888 if (deletions_allowed)nlen += stringlength(269);
889 nlen += stringlength(270);
891 helpstring = (char *) malloc(nlen+1);
893 for (k = nhelplines-1; k >= 0; k--) {
894 s = add_string(s, help_line[k]);
899 s = add_string(s, 265); /* Type <return> to proceed, S to scroll future error messages, */
900 s = add_string(s, 266); /* R to run without stopping, Q to run quietly, */
901 s = add_string(s, 267); /* I to insert something, */
902 if (base_ptr > 0)s = add_string(s, 268); /* E to edit your file, */
903 if (deletions_allowed)s = add_string(s, 269); /* 1 or ... or 9 to ignore the next 1 to 9 tokens of input, */
904 s = add_string(s, 270); /* H for help, X to quit. */
909 char * make_up_query_string (int promptstr)
912 int nstart, nnext, n;
914 nstart = str_start[ promptstr];
915 nnext = str_start[ promptstr + 1];
917 querystr = (char *) malloc(n + 1);
919 memcpy(s, &str_pool[nstart], n);
925 // abort_flag set if input_line / ConsoleInput returns non-zero
926 // should set interrupt instead ???
927 // called from tex0.c, tex2.c, tex3.c
929 // void term_input(void)
930 void term_input (int promptstr, int nhelplines)
934 char * helpstring = NULL;
935 char * querystring = NULL;
936 // if (nhelplines != 0) {
937 // helpstring = make_up_help_string (nhelplines);
938 // printf(helpstring);
941 show_line("\n", 0); // force it to show what may be buffered up ???
944 if (promptstr != 0) querystring = make_up_query_string (promptstr);
945 if (nhelplines != 0) helpstring = make_up_help_string (nhelplines);
946 if (helpstring == NULL && querystring != NULL) {
947 if (strcmp(querystring, ": ") == 0)
948 helpstring = xstrdup("Please type another file name (or ^z to exit):");
949 else if (strcmp(querystring, "=>") == 0) // from firm_up_the_line
950 helpstring = xstrdup("Please type <enter> to accept this line\r\nor type a replacement line");
951 else if (strcmp(querystring, "insert>") == 0) // from error() after "I"
952 helpstring = xstrdup("Please type something to insert here");
953 else if (strcmp(querystring, "") == 0) // from read_toks
954 helpstring = xstrdup("Please type a control sequence");
955 else if (strcmp(querystring, "= ") == 0) // from read_toks
956 helpstring = xstrdup("Please type a token");
957 else if (strcmp(querystring, "*") == 0) // get_next
958 helpstring = xstrdup("Please type a control sequence\r\n(or ^z to exit)");
959 // else if (strcmp(querystring, "**") == 0) // init_terminal
960 // helpstring = xstrdup("Please type a control sequence or a file name\r\n(or ^z to exit)");
961 // else if (strcmp(querystring, "? ") == 0) // from error()
962 // helpstring = xstrdup("Please type a character to select an action");
964 flag = ConsoleInput(querystring, helpstring, (char *) &buffer[first]); // ???
965 // flag == 0 means trouble --- EOF on terminal
966 if (querystring != NULL) free(querystring);
967 if (helpstring != NULL) free(helpstring);
968 helpstring = querystring = NULL;
970 last = first + strlen((char *) &buffer[first]); /* -1 ? */
971 // flag = (last > first);
972 // may need to be more elaborate see input_line in texmf.c ???
973 // sprintf(log_line, "first %d last %d flag %d - %s",
974 // first, last, flag, (char *) &buffer[first]);
975 // winerror(log_line);
978 flag = input_ln(stdin, true);
981 fatal_error("End of file on the terminal!"); /* */
982 return; // abort_flag set
986 // echo what was typed into Console buffer also
988 {register integer for_end; k = first; for_end = last - 1;
991 while(k++ < for_end);
995 decr(selector); // shut off echo
997 {register integer for_end; k = first; for_end = last - 1;
1000 while(k++ < for_end);
1003 incr(selector); // reset selector again
1007 void int_error_ (integer n)
1015 void normalize_selector (void)
1023 if (interaction == batch_mode)
1027 void pause_for_instructions (void)
1029 if (OK_to_interrupt) {
1030 interaction = error_stop_mode;
1031 if ((selector == 18)||(selector == 16))
1033 print_err("Interruption");
1035 "Try to insert some instructions for me (e.g.,`I\\showlists'),",
1036 "unless you just want to quit by typing `X'.");
1037 deletions_allowed = false;
1039 deletions_allowed = true;
1044 integer half_(integer x)
1046 register integer Result;
1049 else Result = x / 2;
1053 scaled round_decimals_(small_number k)
1055 register scaled Result;
1060 a = (a + dig[k]* 131072L) / 10; /* 2^17 */
1066 /* This has some minor speedup changes - no real advantage probably ... */
1067 void print_scaled_(scaled s)
1075 print_int(s / 65536L);
1077 s = 10 * (s % 65536L) + 5;
1081 s = s - 17232; /* 2^15 - 50000 - rounding */
1082 print_char('0' + (s / 65536L));
1083 s = 10 * (s % 65536L);
1085 } while (!(s <= delta));
1088 scaled mult_and_add_(integer n, scaled x, scaled y, scaled maxanswer)
1090 register scaled Result;
1098 else if (((x <= (maxanswer - y) / n) && (- (integer) x <= (maxanswer + y) / n)))
1107 scaled x_over_n_(scaled x, integer n)
1109 register scaled Result;
1127 tex_remainder = x % n;
1129 Result = - (integer) ((- (integer) x)/ n);
1130 tex_remainder = - (integer) ((- (integer) x)% n);
1134 tex_remainder = - (integer) tex_remainder;
1138 scaled xn_over_d_(scaled x, integer n, integer d)
1140 register scaled Result;
1142 nonnegative_integer t, u, v;
1149 /* t =(x % 32768L)* n; */
1150 t =(x & 32767L) * n;
1151 /* u =(x / 32768L)* n +(t / 32768L); */
1152 u =(x >> 15) * n + (t >> 15);
1153 /* v =(u % d)* 32768L +(t % 32768L); */
1154 v =((u % d) << 15) + (t & 32767L);
1155 if (u / d >= 32768L)
1157 /* else u = 32768L *(u / d)+(v / d); */
1158 else u =((u / d) << 15) + (v / d);
1162 tex_remainder = v % d;
1164 Result = - (integer) u;
1165 tex_remainder = - (integer)(v % d);
1170 halfword badness_(scaled t, scaled s)
1172 register halfword Result;
1181 else if (s >= 1663497L)
1187 /* safe to assume that r is positive ? */
1188 /* else Result =(r * r * r + 131072L)/ 262144L; */
1189 else Result = (r * r * r + 131072L) >> 18; /* 2^17 */
1195 void print_word_(memory_word w)
1199 print_scaled(w.cint);
1201 print_scaled(round(65536L * w.gr));
1203 print_int(w.hh.v.LH);
1209 print_int(w.hh.v.RH);
1211 print_int(w.qqqq.b0);
1213 print_int(w.qqqq.b1);
1215 print_int(w.qqqq.b2);
1217 print_int(w.qqqq.b3);
1219 /* need this version only if SHORTFONTINFO defined */
1220 void zprintfword(fmemoryword w)
1224 print_scaled(w.cint);
1226 print_scaled(round(65536L * w.gr));
1228 print_int(w.hh.v.LH);
1232 print_int(w .hh.b1);
1234 print_int(w.hh.v.RH);
1236 print_int(w.qqqq.b0);
1238 print_int(w.qqqq.b1);
1240 print_int(w.qqqq.b2);
1242 print_int(w.qqqq.b3);
1246 void show_token_list_(integer p, integer q, integer l)
1249 ASCII_code matchchr;
1254 /* while (p<>null) and (tally<l) do l.6239 */
1255 while ((p != 0) && (tally < l)) {
1258 first_count = tally;
1259 trick_count = tally + 1 + error_line - half_error_line;
1260 if (trick_count < error_line)
1261 trick_count = error_line;
1263 if ((p < hi_mem_min) || (p > mem_end))
1265 print_esc("CLOBBERED.");
1268 if (mem[p].hh.v.LH >= 4095)
1269 print_cs(mem[p].hh.v.LH - 4095);
1271 m = mem[p].hh.v.LH / 256;
1272 c = mem[p].hh.v.LH % 256;
1273 if (mem[p].hh.v.LH < 0)
1299 print_char(c + '0');
1308 matchchr = (ASCII_code) c;
1326 /* if p<>null then print_esc("ETC."); l.6244 */
1334 if (scanner_status > 1)
1336 print_nl("Runaway ");
1337 switch (scanner_status)
1341 print_string("definition");
1347 print_string("argument");
1353 print_string("preamble");
1359 print_string("text");
1366 /* p may be used without being initialized -- OK */
1367 show_token_list(mem[p].hh.v.RH, 0, error_line - 10);
1371 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1372 /* first try list of available nodes (avail != NULL) */
1373 /* then see if can go upwards (mem_end < mem_max) */
1374 /* then see if can go downwards (hi_mem_min > lo_mem_max) */
1375 /* if not, extend memory at the top and grab from there --- new */
1376 /* else fail ! paragraph 120 */
1377 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1378 halfword get_avail (void)
1380 register halfword Result;
1383 if (p != 0) /* while p<>null do */
1384 avail = link(avail);
1385 else if (mem_end < mem_max) /* mem_end + 1 < mem_max ? NO */
1392 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1393 if (hi_mem_min <= lo_mem_max) { /* have we run out in middle ? */
1394 incr(hi_mem_min); /* undo the change */
1395 /* realloc_main (0, mem_top/2); */ /* extend main memory at hi end */
1396 mem = realloc_main (0, mem_top / 2); /* zzzaa = zmem = mem */
1400 /* presumably now mem_end < mem_max - but need test in case allocation fails */
1401 if (mem_end >= mem_max) {
1403 overflow("main memory size", mem_max + 1 - mem_min); /* main memory size */
1404 return 0; // abort_flag set
1406 incr(mem_end); /* then grab from new area */
1407 p = mem_end; /* 1993/Dec/14 */
1409 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1411 mem[p].hh.v.RH = 0; /* link(p) = null !!! */
1420 void flush_list_(halfword p) /* paragraph 123 */
1423 if (p != 0) /* null !!! */
1433 } while (!(r == 0)); /* r != null */
1439 halfword get_node_(integer s)
1441 register halfword Result;
1448 q = p + mem[p].hh.v.LH;
1449 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1450 /* while((mem[q].hh.v.RH == 262143L)) { */ /* NO! */
1451 while ((mem[q].hh.v.RH == empty_flag)) {
1452 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1454 /* should never happen, since this field is reference count for zeroglue */
1455 } /* debugging code 93/DEC/15 */ /* eventually remove */
1456 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1457 t = mem[q + 1].hh.v.RH;
1460 mem[t + 1].hh.v.LH = mem[q + 1].hh.v.LH;
1461 mem[mem[q + 1].hh.v.LH + 1].hh.v.RH = t;
1462 q = q + mem[q].hh.v.LH;
1465 if (r > toint(p + 1))
1467 mem[p].hh.v.LH = r - p;
1472 if (mem[p + 1].hh.v.RH != p)
1474 rover = mem[p + 1].hh.v.RH;
1475 t = mem[p + 1].hh.v.LH;
1476 mem[rover + 1].hh.v.LH = t;
1477 mem[t + 1].hh.v.RH = rover;
1480 mem[p].hh.v.LH = q - p;
1481 p = mem[p + 1].hh.v.RH;
1482 } while (!(p == rover));
1483 if (s == 1073741824L) /* 2^30 - special case - merge adjacent */
1485 Result = empty_flag;
1486 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1488 show_line("Merged adjacent multi-word nodes\n", 0);
1489 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1492 /* maybe try downward epxansion first instead ? */
1493 if (lo_mem_max + 2 < hi_mem_min)
1494 /* if (lo_mem_max + 2 <= 262143L) */ /* NO! */
1495 if (lo_mem_max + 2 <= mem_bot + max_halfword) /* silly ? flush 93/Dec/16 */
1497 /* if (hi_mem_min - lo_mem_max >= 1998) */
1498 if (hi_mem_min - lo_mem_max >= (block_size + block_size - 2))
1499 /* t = lo_mem_max + 1000; */
1500 t = lo_mem_max + block_size;
1502 t = lo_mem_max + 1 +(hi_mem_min - lo_mem_max) / 2;
1503 p = mem[rover + 1].hh.v.LH;
1505 mem[p + 1].hh.v.RH = q;
1506 mem[rover + 1].hh.v.LH = q;
1507 /* if (t > 262143L) t = 262143L; */ /* NO! */
1508 if (t > mem_bot + max_halfword)
1509 t = mem_bot + max_halfword; /* silly ? flush 93/Dec/16 */
1510 mem[q + 1].hh.v.RH = rover;
1511 mem[q + 1].hh.v.LH = p;
1512 mem[q].hh.v.RH = empty_flag;
1513 mem[q].hh.v.LH = t - lo_mem_max; /* block size */
1515 mem[lo_mem_max].hh.v.RH = 0;
1516 mem[lo_mem_max].hh.v.LH = 0;
1520 /* overflow("main memory size", mem_max + 1 - mem_min); */ /* what used to happen! */
1521 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1522 /* we've run out of space in the middle for variable length blocks */
1523 /* try and add new block from below mem_bot *//* first check if space ! */
1524 if (mem_min - (block_size + 1) <= mem_start) {/* extend lower memory downwards */
1525 /* realloc_main (mem_top/2, 0); */
1526 mem = realloc_main (mem_top/2 + block_size, 0); /* zzzaa = zmem = mem */
1531 /* if (trace_flag) show_line("Extending downwards by %d\n", block_size, 0); */
1532 if (mem_min - (block_size + 1) <= mem_start) { /* check again */
1534 sprintf(log_line, "mem_min %d, mem_start %d, block_size %d\n", mem_min, mem_start, block_size);
1535 show_line(log_line, 0);
1537 overflow("main memory size", mem_max + 1 - mem_min); /* darn: allocation failed ! */
1538 return 0; // abort_flag set
1540 /* avoid function call in following ? */
1541 add_variable_space (block_size); /* now to be found in itex.c */
1542 goto lab20; /* go try get_node again */
1543 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1545 lab40: mem[r].hh.v.RH = 0;
1548 var_used = var_used + s;
1551 /* if (trace_flag) {
1552 if (r == 0) show_line("r IS ZERO in ZGETNODE!\n", 0);
1553 } */ /* debugging code 93/dec/15 */
1559 void free_node_(halfword p, halfword s)
1563 mem[p].hh.v.RH = empty_flag;
1564 q = mem[rover + 1].hh.v.LH;
1565 mem[p + 1].hh.v.LH = q;
1566 mem[p + 1].hh.v.RH = rover;
1567 mem[rover + 1].hh.v.LH = p;
1568 mem[q + 1].hh.v.RH = p;
1571 var_used = var_used - s;
1575 halfword new_null_box (void)
1577 register halfword Result;
1582 mem[p + 1].cint = 0;
1583 mem[p + 2].cint = 0;
1584 mem[p + 3].cint = 0;
1585 mem[p + 4].cint = 0;
1586 mem[p + 5].hh.v.RH = 0;
1587 mem[p + 5].hh.b0 = 0;
1588 mem[p + 5].hh.b1 = 0;
1589 mem[p + 6].gr = 0.0;
1594 // @ A new rule node is delivered by the |new_rule| function. It
1595 // makes all the dimensions ``running,'' so you have to change the
1596 // ones that are not allowed to run.
1598 halfword new_rule (void)
1600 register halfword Result;
1602 p = get_node(4); /* rule_node_size */
1603 mem[p].hh.b0 = 2; /* rule_node type */
1604 mem[p].hh.b1 = 0; /* sub_type zero */
1605 mem[p + 1].cint = -1073741824L; /* -2^30 null_flag width */
1606 mem[p + 2].cint = -1073741824L; /* -2^30 null_flag depth */
1607 mem[p + 3].cint = -1073741824L; /* -2^30 null_flag height */
1612 // @ The |new_ligature| function creates a ligature node having given
1613 // contents of the |font|, |character|, and |lig_ptr| fields.
1615 halfword new_ligature_(quarterword f, quarterword c, halfword q)
1617 register halfword Result;
1619 p = get_node(2); /* small_node_size */
1620 mem[p].hh.b0 = 6; /* ligature_node type */
1621 mem[p + 1].hh.b0 = f; /* font */
1622 mem[p + 1].hh.b1 = c; /* character */
1623 mem[p + 1].hh.v.RH = q; /* pointer */
1624 mem[p].hh.b1 = 0; /* subtype zero */
1629 // We also have a |new_lig_item| function, which returns a two-word
1630 // node having a given |character| field. Such nodes are used for
1631 // temporary processing as ligatures are being created.
1633 halfword new_lig_item_(quarterword c)
1635 register halfword Result;
1637 p = get_node(2); /* small_node_size */
1638 mem[p].hh.b1 = c; /* character */
1639 mem[p + 1].hh.v.RH = 0; /* lig_ptr(p):=null; */
1644 halfword new_disc (void)
1646 register halfword Result;
1651 mem[p + 1].hh.v.LH = 0; /* pre_break(p):=null; */
1652 mem[p + 1].hh.v.RH = 0; /* post_break(p):=null; */
1657 halfword new_math_(scaled w, small_number s)
1659 register halfword Result;
1664 mem[p + 1].cint = w;
1669 halfword new_spec_(halfword p)
1671 register halfword Result;
1676 mem[q + 1].cint = mem[p + 1].cint;
1677 mem[q + 2].cint = mem[p + 2].cint;
1678 mem[q + 3].cint = mem[p + 3].cint;
1683 halfword new_param_glue_(small_number n)
1685 register halfword Result;
1690 mem[p].hh.b1 = n + 1; /* conversion int to unsigned short */
1691 mem[p + 1].hh.v.RH = 0;
1692 q = eqtb[(hash_size + 782) + n].hh.v.RH; /* gluebase + n */
1693 mem[p + 1].hh.v.LH = q;
1694 incr(mem[q].hh.v.RH);
1699 halfword new_glue_(halfword q)
1701 register halfword Result;
1706 mem[p + 1].hh.v.RH = 0;
1707 mem[p + 1].hh.v.LH = q;
1708 incr(mem[q].hh.v.RH);
1713 halfword new_skip_param_(small_number n)
1715 register halfword Result;
1717 temp_ptr = new_spec(eqtb[(hash_size + 782) + n].hh.v.RH); /* gluebase + n */
1718 p = new_glue(temp_ptr);
1719 mem[temp_ptr].hh.v.RH = 0;
1720 mem[p].hh.b1 = n + 1; /* conversion int to unsigned short */
1725 halfword new_kern_(scaled w)
1727 register halfword Result;
1732 mem[p + 1].cint = w;
1737 halfword new_penalty_(integer m)
1739 register halfword Result;
1744 mem[p + 1].cint = m;
1750 void check_mem_(bool printlocs)
1755 register integer for_end;
1757 for_end = lo_mem_max;
1758 if (p <= for_end) do
1760 while (p++ < for_end);
1763 register integer for_end;
1766 if (p <= for_end) do
1768 while (p++ < for_end);
1773 while (p != 0) { /* while p<>null do */
1774 if ((p > mem_end) || (p < hi_mem_min))
1776 else if (freearr[p])
1780 print_nl("AVAIL list clobbered at ");
1790 q = 0; /* q:=null */
1793 if ((p >= lo_mem_max) || (p < mem_min))
1795 else if ((mem[p + 1].hh.v.RH >= lo_mem_max) || (mem[p + 1].hh.v.RH < mem_min))
1797 /* else if (!((mem[p].hh.v.RH == 262143L)) ||(mem[p].hh *//*NO!*/
1798 else if (!((mem[p].hh.v.RH == empty_flag)) ||
1799 (mem[p].hh .v.LH < 2) ||
1800 (p + mem[p].hh.v.LH > lo_mem_max) ||
1801 (mem[mem[p + 1].hh.v.RH + 1].hh.v.LH != p))
1805 print_nl("Double-AVAIL list clobbered at ");
1810 register integer for_end;
1812 for_end = p + mem[p].hh.v.LH - 1;
1813 if (q <= for_end) do
1817 print_nl("Doubly free location at ");
1822 } while (q++ < for_end);
1825 p = mem[p + 1].hh.v.RH;
1826 } while (!(p == rover));
1829 while (p <= lo_mem_max) {
1830 if ((mem[p].hh.v.RH == empty_flag))
1832 print_nl("Bad flag at ");
1835 while ((p <= lo_mem_max) && !freearr[p]) incr(p);
1836 while ((p <= lo_mem_max) && freearr[p]) incr(p);
1840 print_nl("New busy locs:");
1842 register integer for_end;
1844 for_end = lo_mem_max;
1845 if (p <= for_end) do
1846 if (!freearr[p] && ((p > was_lo_max) || wasfree[p]))
1850 } while (p++ < for_end);
1853 register integer for_end;
1856 if (p <= for_end) do
1857 if (!freearr[p] && ((p < was_hi_min) || (p > was_mem_end) || wasfree[p]))
1861 } while (p++ < for_end);
1865 register integer for_end;
1867 for_end = lo_mem_max;
1868 if (p <= for_end) do
1869 wasfree[p]= freearr[p];
1870 while (p++ < for_end);
1873 register integer for_end;
1876 if (p <= for_end) do
1877 wasfree[p] = freearr[p];
1878 while (p++ < for_end);
1880 was_mem_end = mem_end;
1881 was_lo_max = lo_mem_max;
1882 was_hi_min = hi_mem_min;
1887 void search_mem_(halfword p)
1891 register integer for_end;
1893 for_end = lo_mem_max;
1894 if (q <= for_end) do
1908 } while (q++ < for_end);
1911 register integer for_end;
1914 if (q <= for_end) do
1928 } while (q++ < for_end);
1931 register integer for_end;
1933 for_end = (hash_size + 1833);
1934 if (q <= for_end) do
1936 if (eqtb[q].hh.v.RH == p)
1942 } while(q++ < for_end);
1946 register integer for_end;
1948 for_end = save_ptr - 1;
1949 if (q <= for_end) do
1951 if (save_stack[q].hh.v.RH == p)
1957 } while (q++ < for_end);
1959 /* {register integer for_end; q = 0; for_end = 607; if (q <= for_end) do */
1961 register integer for_end;
1963 for_end = hyphen_prime;
1964 if (q <= for_end) do
1966 if (hyph_list[q]== p)
1972 } while(q++ < for_end);
1977 void short_display_(integer p)
1980 /* while(p > mem_min){ */
1981 while (p != 0) { /* want p != null here bkph 93/Dec/15 !!! */
1982 /* NOTE: still not fixed in 3.14159 ! */
1983 if ((p >= hi_mem_min)) /* is_char_node(p) */
1987 if (mem[p].hh.b0 != font_in_short_display) /* font(p) */
1989 if ((mem[p].hh.b0 > font_max))
1991 /* else print_esc(hash[(hash_size + 524) + mem[p].hh.b0].v.RH); */
1992 else //print_esc(hash[(hash_size + hash_extra + 524) + mem[p].hh.b0].v.RH);
1993 {print_esc("");print(hash[(hash_size + hash_extra + 524) + mem[p].hh.b0].v.RH);}
1996 font_in_short_display = mem[p].hh.b0;
1998 print(mem[p].hh.b1); /* character(p) */
2000 } else switch (mem[p].hh.b0)
2015 if (mem[p + 1].hh.v.LH != 0)
2022 short_display(mem[p + 1].hh.v.RH);
2026 short_display(mem[p + 1].hh.v.LH);
2027 short_display(mem[p + 1].hh.v.RH);
2030 if (link(p) != 0) /* if link(p)<>null then */
2044 void print_font_and_char_ (integer p)
2047 print_esc("CLOBBERED.");
2049 if ((mem[p].hh.b0 > font_max)) /* font(p) */
2050 print_char(42); /* * */
2051 /* else print_esc(hash[(hash_size + 524) + mem[p].hh.b0].v.RH); */
2053 //print_esc(hash[(hash_size + hash_extra + 524) + mem[p].hh.b0].v.RH); /* 96/Jan/10 */
2054 {print_esc("");print(hash[(hash_size + hash_extra + 524) + mem[p].hh.b0].v.RH);}
2056 print(mem[p].hh.b1); /* character(p) */
2060 void print_mark_ (integer p)
2063 if ((p < hi_mem_min)||(p > mem_end))
2064 print_esc("CLOBBERED.");
2066 show_token_list(mem[p].hh.v.RH, 0, max_print_line - 10);
2070 void print_rule_dimen_ (scaled d)
2072 if ((d == -1073741824L)) /* - 2^30 */
2078 void print_glue_(scaled d, integer order, char * s)
2081 if ((order < 0) || (order > 3))
2082 print_string("foul");
2083 else if (order > 0) {
2084 print_string("fil");
2093 void print_spec_(integer p, char * s)
2095 if ((p < mem_min) || (p >= lo_mem_max))
2098 print_scaled(mem[p + 1].cint);
2101 if (mem[p + 2].cint != 0) {
2102 print_string(" plus ");
2103 print_glue(mem[p + 2].cint, mem[p].hh.b0, s);
2105 if (mem[p + 3].cint != 0) {
2106 print_string(" minus ");
2107 print_glue(mem[p + 3].cint, mem[p].hh.b1, s);
2112 void print_fam_and_char_(halfword p)
2115 print_int(mem[p].hh.b0);
2117 print(mem[p].hh.b1);
2120 void print_delimiter_(halfword p)
2123 a = mem[p].qqqq.b0 * 256 + mem[p].qqqq.b1;
2124 a = a * 4096 + mem[p].qqqq.b2 * 256 + mem[p].qqqq.b3;
2131 void print_subsidiary_data_(halfword p, ASCII_code c)
2133 if (cur_length >= depth_threshold)
2135 if (mem[p].hh.v.RH != 0)
2140 switch (mem[p].hh.v.RH)
2145 print_current_string();
2146 print_fam_and_char(p);
2155 print_current_string();
2167 void print_style_(integer c)
2172 print_esc("displaystyle");
2175 print_esc("textstyle");
2178 print_esc("scriptstyle");
2181 print_esc("scriptscriptstyle");
2184 print_string("Unknown style!");
2189 void print_skip_param_(integer n)
2193 case line_skip_code:
2194 print_esc("lineskip");
2196 case baseline_skip_code:
2197 print_esc("baselineskip");
2200 print_esc("parskip");
2202 case above_display_skip_code:
2203 print_esc("abovedisplayskip");
2205 case below_display_skip_code:
2206 print_esc("belowdisplayskip");
2208 case above_display_short_skip_code:
2209 print_esc("abovedisplayshortskip");
2211 case below_display_short_skip_code:
2212 print_esc("belowdisplayshortskip");
2214 case left_skip_code:
2215 print_esc("leftskip");
2217 case right_skip_code:
2218 print_esc("rightskip");
2221 print_esc("topskip");
2223 case split_top_skip_code:
2224 print_esc("splittopskip");
2227 print_esc("tabskip");
2229 case space_skip_code:
2230 print_esc("spaceskip");
2232 case xspace_skip_code:
2233 print_esc("xspaceskip");
2235 case par_fill_skip_code:
2236 print_esc("parfillskip");
2238 case thin_mu_skip_code:
2239 print_esc("thinmuskip");
2241 case med_mu_skip_code:
2242 print_esc("medmuskip");
2244 case thick_mu_skip_code:
2245 print_esc("thickmuskip");
2248 print_string("[unknown glue parameter!]");
2253 void show_node_list_(integer p)
2258 if (cur_length > depth_threshold)
2260 /* if (p > 0) */ /* was p>null !!! line 3662 in tex.web */
2261 if (p != 0) /* fixed 94/Mar/23 BUG FIX *//* NOTE: still not fixed in 3.14159 ! */
2266 /* while(p > mem_min){ */ /* was p>mem_min !!! line 3667 in tex.web */
2267 while (p != 0) { /* want p != null - bkph 93/Dec/15 *//* NOTE: still not fixed in 3.14159 ! */
2269 print_current_string();
2271 print_string("Bad link, display aborted.");
2275 if (n > breadth_max) {
2276 print_string("etc.");
2279 if ((p >= hi_mem_min))
2280 print_font_and_char(p);
2281 else switch (mem[p].hh.b0)
2287 if (mem[p].hh.b0 == 0)
2289 else if (mem[p].hh.b0 == 1)
2291 else print_esc("unset");
2292 print_string("box(");
2293 print_scaled(mem[p + 3].cint);
2295 print_scaled(mem[p + 2].cint);
2296 print_string(", shifted ");
2297 print_scaled(mem[p + 1].cint);
2298 if (mem[p].hh.b0 == 13)
2300 if (mem[p].hh.b1 != 0)
2303 print_int(mem[p].hh.b1 + 1);
2304 print_string(" columns)");
2306 if (mem[p + 6].cint != 0)
2308 print_string(", stretch");
2309 print_glue(mem[p + 6].cint, mem[p + 5].hh.b1, 0);
2311 if (mem[p + 4].cint != 0)
2313 print_string(", shrink");
2314 print_glue(mem[p + 4].cint, mem[p + 5].hh.b0, 0);
2318 if ((g != 0.0)&&(mem[p + 5].hh.b0 != 0))
2320 print_string(", glue set");
2321 if (mem[p + 5].hh.b0 == 2)
2323 if (fabs(g)> 20000.0)
2328 print_string("< -");
2329 print_glue(20000 * 65536L, mem[p + 5].hh.b1, 0);
2330 } else print_glue(round(65536L * g), mem[p + 5].hh.b1, 0);
2332 if (mem[p + 4].cint != 0)
2334 print_string("shifted");
2335 print_scaled(mem[p + 4].cint);
2340 str_pool[pool_ptr]= 46;
2343 show_node_list(mem[p + 5].hh.v.RH);
2351 print_rule_dimen(mem[p + 3].cint);
2353 print_rule_dimen(mem[p + 2].cint);
2355 print_rule_dimen(mem[p + 1].cint);
2360 print_esc("insert");
2361 print_int(mem[p].hh.b1);
2362 print_string(",natural size ");
2363 print_scaled(mem[p + 3].cint);
2364 print_string("; split(");
2365 print_spec(mem[p + 4].hh.v.RH, "");
2367 print_scaled(mem[p + 2].cint);
2368 print_string("(; float cost");
2369 print_int(mem[p + 1].cint);
2372 str_pool[pool_ptr]= 46;
2375 show_node_list(mem[p + 4].hh.v.LH);
2381 switch (mem[p].hh.b1)
2385 print_write_whatsit(1279, p); /* debug # (-1 to exit): */
2387 print_file_name(mem[p + 1].hh.v.RH, mem[p + 2].hh.v.LH, mem[p + 2].hh.v.RH);
2392 print_write_whatsit(591, p); /* write */
2393 print_mark(mem[p + 1].hh.v.RH);
2397 print_write_whatsit(1280, p); /* closeout */
2401 print_esc("special");
2402 print_mark(mem[p + 1].hh.v.RH);
2407 print_esc("setlanguage");
2408 print_int(mem[p + 1].hh.v.RH);
2409 print_string(" (hyphenmin");
2410 print_int(mem[p + 1].hh.b0);
2412 print_int(mem[p + 1].hh.b1);
2417 print_string("whatsit");
2422 if (mem[p].hh.b1 >= 100)
2425 if (mem[p].hh.b1 == 101)
2427 else if (mem[p].hh.b1 == 102)
2429 print_string("leaders ");
2430 print_spec(mem[p + 1].hh.v.LH, "");
2433 str_pool[pool_ptr]= 46;
2436 show_node_list(mem[p + 1].hh.v.RH);
2441 if (mem[p].hh.b1 != 0)
2444 if (mem[p].hh.b1 < 98)
2445 print_skip_param(mem[p].hh.b1 - 1);
2446 else if (mem[p].hh.b1 == 98)
2447 print_esc("nonscript");
2448 else print_esc("mskip");
2451 if (mem[p].hh.b1 != 98)
2454 if (mem[p].hh.b1 < 98)
2455 print_spec(mem[p + 1].hh.v.LH, "");
2457 print_spec(mem[p + 1].hh.v.LH, "mu");
2462 if (mem[p].hh.b1 != 99)
2465 if (mem[p].hh.b1 != 0)
2467 print_scaled(mem[p + 1].cint);
2468 if (mem[p].hh.b1 == 2)
2469 print_string(" (for accent)");
2472 print_scaled(mem[p + 1].cint);
2479 if (mem[p].hh.b1 == 0)
2481 else print_string("off");
2482 if (mem[p + 1].cint != 0)
2484 print_string(", surrounded");
2485 print_scaled(mem[p + 1].cint);
2491 print_font_and_char(p + 1);
2492 print_string("(ligature");
2493 if (mem[p].hh.b1 > 1)
2495 font_in_short_display = mem[p + 1].hh.b0;
2496 short_display(mem[p + 1].hh.v.RH);
2497 if (odd(mem[p].hh.b1))
2504 print_esc("penalty ");
2505 print_int(mem[p + 1].cint);
2510 print_esc("discretionary");
2511 if (mem[p].hh.b1 > 0)
2513 print_string(" replacing ");
2514 print_int(mem[p].hh.b1);
2518 str_pool[pool_ptr]= 46;
2521 show_node_list(mem[p + 1].hh.v.LH);
2525 str_pool[pool_ptr]= 124;
2528 show_node_list(mem[p + 1].hh.v.RH);
2535 print_mark(mem[p + 1].cint);
2540 print_esc("vadjust");
2543 str_pool[pool_ptr]= 46;
2546 show_node_list(mem[p + 1].cint);
2552 print_style(mem[p].hh.b1);
2556 print_esc("mathchoice");
2558 str_pool[pool_ptr]= 68;
2561 show_node_list(mem[p + 1].hh.v.LH);
2564 str_pool[pool_ptr]= 84;
2567 show_node_list(mem[p + 1].hh.v.RH);
2570 str_pool[pool_ptr]= 83;
2573 show_node_list(mem[p + 2].hh.v.LH);
2576 str_pool[pool_ptr]= 115;
2579 show_node_list(mem[p + 2].hh.v.RH);
2599 switch (mem[p].hh.b0)
2602 print_esc("mathord");
2605 print_esc("mathop");
2608 print_esc("mathbin");
2611 print_esc("mathrel");
2614 print_esc("mathopen");
2617 print_esc("mathclose");
2620 print_esc("mathpunct");
2623 print_esc("mathinner");
2626 print_esc("overline");
2629 print_esc("underline");
2632 print_esc("vcenter");
2636 print_esc("radical");
2637 print_delimiter(p + 4);
2642 print_esc("accent");
2643 print_fam_and_char(p + 4);
2649 print_delimiter(p + 1);
2655 print_delimiter(p + 1);
2659 if (mem[p].hh.b1 != 0)
2660 if (mem[p].hh.b1 == 1)
2661 print_esc("limits");
2662 else print_esc("nolimits");
2663 if (mem[p].hh.b0 < 30)
2664 print_subsidiary_data(p + 1, 46);
2665 print_subsidiary_data(p + 2, 94);
2666 print_subsidiary_data(p + 3, 95);
2671 print_esc("fraction");
2672 if (mem[p + 1].cint == 1073741824L) /* 2^30 */
2673 print_string("= default");
2674 else print_scaled(mem[p + 1].cint);
2675 if ((mem[p + 4].qqqq.b0 != 0) || (mem[p + 4].qqqq.b1 != 0) ||
2676 (mem[p + 4].qqqq.b2 != 0) || (mem[p + 4].qqqq.b3 != 0))
2678 print_string(", left");
2679 print_delimiter(p + 4);
2681 if ((mem[p + 5].qqqq.b0 != 0) || (mem[p + 5].qqqq.b1 != 0) ||
2682 (mem[p + 5].qqqq.b2 != 0)||(mem[p + 5].qqqq.b3 != 0))
2684 print_string(", right");
2685 print_delimiter(p + 5);
2687 print_subsidiary_data(p + 2, 92);
2688 print_subsidiary_data(p + 3, 47);
2692 print_string("Unknown node type!");
2698 /* NOTE: 262143L should be empty_flag */