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 print_err (const char * s)
34 if (interaction == error_stop_mode);
38 void tex_help (unsigned int n, ...)
45 va_start(help_arg, n);
46 for (i = 0; i <= n - 1; i++)
47 help_line[i] = va_arg(help_arg, char *);
50 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
61 (void) putc ('\n', log_file);
67 (void) putc ('\n', log_file);
82 (void) putc ('\n', write_file[selector]);
87 void print_char_(ASCII_code s)
89 if(s == eqtb[(hash_size + 3212)].cint)
90 if(selector < pseudo){
97 (void) show_char(Xchr(s));
99 (void) putc(Xchr(s), log_file);
101 if(term_offset == max_print_line){
105 if(file_offset == max_print_line){
106 (void) putc ('\n', log_file);
113 (void) putc(Xchr(s), log_file);
115 if(file_offset == max_print_line)print_ln ();
120 (void) show_char(Xchr(s));
122 if(term_offset == max_print_line)print_ln ();
129 if(tally < trick_count)
130 trick_buf[tally % error_line]= s;
134 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
135 #ifdef ALLOCATESTRING
136 if(pool_ptr + 1 > current_pool_size) {
137 str_pool = realloc_str_pool (increment_pool_size); /* 94/Jan/24 */
139 if(pool_ptr < current_pool_size) /* 94/Jan/24 */
141 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
142 if(pool_ptr < pool_size)
145 str_pool[pool_ptr]= s;
151 (void) putc(Xchr(s), write_file[selector]);
153 } /* end of switch(selector) */
157 /* This could be made more efficient using fputs ? ... bkph */
158 void print_(integer s)
162 if(s >= str_ptr) s = 259; /* ??? */
164 if(s < 0) s = 259; /* ??? */
166 if(selector > pseudo){
170 if((s == eqtb[(hash_size + 3212)].cint))
175 nl = eqtb[(hash_size + 3212)].cint; /* save eol */
176 eqtb[(hash_size + 3212)].cint = -1;
177 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
178 /* if (!show_in_hex && s < 256) */ /* show control chars also ?? */
179 if (! show_in_hex && s < 256 && s >= 32) { /* 94/Jan/26 */
180 /* following added 1996/Jan/20 */
181 if (show_in_dos && s > 127) { /* translate ANSI to DOS 850 */
182 if (wintodos[s-128] > 0) print_char (wintodos[s-128]);
183 else { /* print in hex after all */
185 while(j < str_start[s + 1]){
186 print_char(str_pool[j]);
191 else print_char(s); /* don't translate to hex */
193 else { /* not just a character */
194 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
196 while(j < str_start[s + 1]){
197 print_char(str_pool[j]);
201 eqtb[(hash_size + 3212)].cint = nl; /* restore eol */
204 /* we get here with s > 256 - i.e. not a single character */
206 while(j < str_start[s + 1]){
207 print_char(str_pool[j]);
211 void print_string_ (unsigned char *s)
214 while (*s > 0) print_char(*s++);
217 // print string number s from string pool by calling print_
218 void slow_print_(integer s)
221 if((s >= str_ptr)||(s < 256)) print(s);
224 while(j < str_start[s + 1]){
225 // if (str_pool[j]>= 128) print(str_pool[j]-128); // debugging only
226 // if (str_pool[j]== 0) print(36); // debugging only
233 // print newline followed by string number s (unless at start of line)
234 void print_nl_(char * s)
236 if(((term_offset > 0) && (odd(selector)))||
237 ((file_offset > 0) && (selector >= log_only)))
242 // print string number s preceded by escape character
243 void print_esc_(char * s)
246 c = eqtb[(hash_size + 3208)].cint;
248 if(c < 256) print(c);
253 void print_the_digs_(eight_bits k)
258 print_char(48 + dig[k]);
260 print_char(55 + dig[k]);
264 void print_int_(integer n)
271 print_char(45); /* - */
280 /* dig[0]= m; */ /* keep compiler happy */
289 /* dig[k]= n % 10; */ /* keep compiler happy */
290 dig[k]= (char) (n % 10);
297 void print_cs_(integer p)
299 if(p < 514) /* if p < hash_base then ... p.262 */
300 if(p >= 257) /* if p > single_base then ... p.262 */
301 if(p == 513) /* if p = null_cs then ... p.262 */
304 print_esc("endcsname");
307 //print_esc(p - 257); /* p - single_base */
308 print_esc("");print(p-257);
309 /* if cat_code(p - single_base) = letter then ... p.262 */
310 if(eqtb[(hash_size + 1883) + p - 257].hh.v.RH == 11)
311 print_char(32); /* */
314 print_esc("IMPOSSIBLE");
316 else if(p >= (hash_size + 781)) /* undefined_control_sequence */
317 print_esc("IMPOSSIBLE");
318 else if((hash[p].v.RH >= str_ptr))
319 print_esc("NONEXISTENT");
321 //print_esc(hash[p].v.RH);
322 print_esc(""); print(hash[p].v.RH);
323 print_char(32); /* */
327 void sprint_cs_(halfword p)
329 if(p < 514) /* if p < hash_base then ... p.263 */
330 if(p < 257) /* if p < single_base then ... p.263 */
331 print(p - 1); /* print (p - active_base); */
332 else if(p < 513) /* else if p < null_cs then ... */
333 //print_esc(p - 257); /* print (p - single_base); */
334 {print_esc(""); print(p-257);}
336 print_esc("csname"); /* */
337 print_esc("endcsname"); /* */
339 else //print_esc(hash[p].v.RH);
341 print_esc(""); print(hash[p].v.RH);
345 /* ! I can't find file ` c:/foo/ accents .tex '. */
346 void print_file_name_(integer n, integer a, integer e)
348 /* sprintf(log_line, "\na %d n %d e %d\n", a, n, e); */
349 /* show_line(log_line, 0); */
350 // print_char(33); // debugging only
352 // print_char(33); // debugging only
354 // print_char(33); // debugging only
356 // print_char(33); // debugging only
359 void print_size_(integer s)
362 print_esc("textfont");
364 print_esc("scriptfont");
366 print_esc("scriptscriptfont");
369 void print_write_whatsit_(str_number s, halfword p)
372 print_esc(""); print(s);
373 if(mem[p + 1].hh.v.LH < 16)
374 print_int(mem[p + 1].hh.v.LH);
375 else if(mem[p + 1].hh.v.LH == 16)
376 print_char(42); /* * */
377 else print_char(45); /* - */
382 // called from itex.c and tex0.c only NASTY NASTY!
383 // now uses uses non-local goto (longjmp) 1999/Nov/7
386 close_files_and_terminate ();
394 if (trace_flag) show_line("EXITING at JUMPOUT\n", 0);
396 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
397 // if (endit(history) != 0) history = 2; /* 93/Dec/26 in local.c */
398 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
400 // abort_flag++; // TURN OFF THE POWER ???
402 if((history != 0)&&(history != 1)) code = 1;
405 // longjmp(jumpbuffer, code+1);
409 // deal with error by asking for user response 0-9, D, E, H, I, X, Q, R, S
410 // NOTE: this may JUMPOUT either via X, or because of too many errors
414 integer s1, s2, s3, s4;
415 if(history < 2) history = 2;
417 print_char(46); /* . */
423 clear_for_error_prompt ();
427 term_input(264, help_ptr);
429 if(last == first)return; // no input
430 c = buffer[first]; // analyze first letter typed
431 if(c >= 97) // uppercase letter first
432 /* c = c - 32; */ /* keep compiler happy */
433 c = (unsigned char) (c - 32);
445 if(deletions_allowed) {
450 align_state = 1000000L;
451 OK_to_interrupt = false;
452 if((last > first + 1)&&(buffer[first + 1]>= 48)&&
453 (buffer[first + 1]<= 57))
454 c = (unsigned char) (c * 10 + buffer[first + 1]- 48 * 11);
455 else c = (unsigned char) (c - 48);
464 OK_to_interrupt = true;
465 help2("I have just deleted some text, as you asked.",
466 "You can now delete more, or insert, or whatever.");
468 goto lab22; /* loop again */
476 goto lab22; /* loop again */
482 edit_name_start = str_start[input_stack[base_ptr].name_field];
483 edit_name_length = str_start[input_stack[base_ptr].name_field + 1]-
484 str_start[input_stack[base_ptr].name_field];
487 // return; // can drop through now 99/Oct/20
495 use_err_help = false;
499 help2("Sorry, I don't know how to help in this situation.",
500 "Maybe you should try asking a human?");
503 //print(help_line[help_ptr]);
504 print_string(help_line[help_ptr]);
506 } while(!(help_ptr == 0));
508 help4("Sorry, I already gave what help I could...",
509 "Maybe you should try asking a human?",
510 "An error might have occurred before I noticed any problems.",
511 "``If all else fails, read the instructions.''");
512 goto lab22; /* loop again */
517 begin_file_reading ();
520 cur_input.loc_field = first + 1;
526 print_string("insert>");
529 cur_input.loc_field = first;
532 cur_input.limit_field = last - 1;
536 case 81 : /* Q, R, S */
541 interaction = 0 + c - 81; /* Q = 0, R = 1, S = 2, T = 3 */
542 print_string("OK, entering ");
546 print_esc("batchmode"); /* */
551 print_esc("nonstopmode"); /* */
554 print_esc("scrollmode"); /* */
569 // return; // can drop through now 99/Oct/20
575 } /* end of switch analysing response character */
577 print_string("Type <return> to proceed, S to scroll future error messages,");
578 print_nl("R to run without stopping, Q to run quietly,"); /* */
579 print_nl("I to insert something, "); /* */
580 if (base_ptr > 0) print_string("E to edit your file,");
581 if(deletions_allowed) print_nl("1 or ... or 9 to ignore the next 1 to 9 tokens of input,"); /* */
582 print_nl("H for help, X to quit."); /* */
584 } /* end of while(true) loop */
587 if(error_count == 100) {
588 print_nl("(That makes 100 errors; please try again.)");
591 // return; // can drop through now 99/Oct/20
593 if(interaction > 0) decr(selector);
598 else while(help_ptr > 0){
600 print_nl(help_line[help_ptr]);
603 if(interaction > 0)incr(selector);
607 void fatal_error_(char * s)
609 normalize_selector ();
610 print_err("Emergency stop");
613 if(interaction == 3)interaction = 2;
619 if(interaction > 0)debug_help ();
623 // return; // can drop through now 99/Oct/20
627 void overflow_(str_number s, integer n)
629 normalize_selector ();
630 print_err("TeX capacity exceeded, sorry[");
635 help2("If you really absolutely need more capacity,",
636 "you can ask a wizard to enlarge me.");
637 if (! knuth_flag) { /* Additional comments 98/Jan/5 */
638 if (s == 945 && n == trie_size) {
639 sprintf(log_line, "\n (Maybe use -h=... on command line in ini-TeX)\n");
640 show_line(log_line, 0);
642 else if (s == 942 && n == hyphen_prime) {
643 sprintf(log_line, "\n (Maybe use -e=... on command line in ini-TeX)\n");
644 show_line(log_line, 0);
647 if(interaction == 3)interaction = 2;
653 if(interaction > 0)debug_help ();
657 // return; // can drop through now 99/Oct/20
660 void confusion_(str_number s)
662 normalize_selector ();
664 print_err("This can't happen(");
666 print_char(41); /*)*/
667 help1("I'm broken. Please show this to someone who can fix can fix");
670 print_err("I can't go on meeting you like this");
671 help2("One of your faux pas seems to have wounded me deeply...",
672 "in fact, I'm barely conscious. Please fix it and try again.");
675 if(interaction == 3)interaction = 2;
681 if(interaction > 0)debug_help ();
685 // return; // can drop through now 99/Oct/20
689 bool init_terminal (void)
691 register bool Result;
696 cur_input.loc_field = first;
697 while((cur_input.loc_field < last) && (buffer[cur_input.loc_field]== ' '))
698 incr(cur_input.loc_field); // step over initial white space
699 if(cur_input.loc_field < last){
701 return Result; // there is an input file name
705 // failed to find input file name
709 flag = ConsoleInput("**", "Please type a file name or a control sequence\r\n(or ^z to exit)",
710 (char *) &buffer[first]);
711 last = first + strlen((char *) &buffer[first]); /* -1 ? */
712 // may need to be more elaborate see input_line in texmf.c
714 (void) fputs("**", stdout); /* ** PROMPT */
716 flag = input_ln(stdin, true);
720 show_line("! End of file on the terminal... why?\n", 1);
725 cur_input.loc_field = first;
726 while((cur_input.loc_field < last)&&
727 (buffer[cur_input.loc_field]== ' '))
728 incr(cur_input.loc_field); // step over intial white space
729 if(cur_input.loc_field < last){
731 return Result; // there is an input file name
733 sprintf(log_line, "%s\n", "Please type the name of your input file.");
734 show_line(log_line, 1);
739 // Make string from str_start[str_ptr]to pool_ptr
740 str_number make_string (void)
742 register str_number Result;
743 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
744 #ifdef ALLOCATESTRING
745 if(str_ptr == current_max_strings)
746 str_start = realloc_str_start(increment_max_strings);
747 if(str_ptr == current_max_strings){ /* 94/Jan/24 */
748 // printf("**********MAKESTRING**********"); // debugging only
749 overflow(258, current_max_strings - init_str_ptr); /* 97/Mar/9 */
750 return 0; // abort_flag set
753 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
754 if(str_ptr == max_strings){
755 overflow(258, max_strings - init_str_ptr); /* number of strings */
756 return 0; // abort_flag set
760 str_start[str_ptr] = pool_ptr;
761 Result = str_ptr - 1;
765 bool str_eq_buf_(str_number s, integer k)
767 register bool Result;
771 while(j < str_start[s + 1]) {
772 if(str_pool[j]!= buffer[k])
781 lab45: Result = result;
785 bool str_eq_str_(str_number s, str_number t)
787 register bool Result;
791 if((str_start[s + 1]- str_start[s])!=(str_start[t + 1]-
796 while(j < str_start[s + 1]){
797 if(str_pool[j]!= str_pool[k])
803 lab45: Result = result;
807 void print_two_(integer n)
810 print_char(48 +(n / 10));
811 print_char(48 +(n % 10));
814 void print_hex_(integer n)
818 print_char(34); /* " */
820 dig[k]= (unsigned char) (n % 16);
827 void print_roman_int_(integer n)
830 nonnegative_integer u, v;
831 j = str_start[260]; /* m2d5c2l5x2v5i */
835 print_char(str_pool[j]);
841 u = v /(str_pool[k - 1]- 48);
842 if(str_pool[k - 1]== 50)
845 u = u /(str_pool[k - 1]- 48);
849 print_char(str_pool[k]);
854 v = v /(str_pool[j - 1]- 48);
859 void print_current_string(void)
862 j = str_start[str_ptr];
863 while(j < pool_ptr) {
864 print_char(str_pool[j]);
869 int stringlength (int str_ptr)
872 nstart = str_start[ str_ptr];
873 nnext = str_start[ str_ptr + 1];
874 return (nnext - nstart) + 2;
877 char * add_string (char *s, int str_ptr)
879 int nstart, nnext, n;
880 nstart = str_start[ str_ptr];
881 nnext = str_start[ str_ptr + 1];
883 memcpy(s, &str_pool[nstart], n);
892 // make one long \r\n separated string out of help lines
893 // str_pool is packed_ASCII_code *
895 char * make_up_help_string (int nhelplines)
897 char *helpstring, *s;
900 // get length of help for this specific message
901 for (k = nhelplines-1; k >= 0; k--) {
902 nlen += stringlength(help_line[k]);
904 nlen += 2; // for blank line separator
906 nlen += stringlength(265);
907 nlen += stringlength(266);
908 nlen += stringlength(267);
909 if(base_ptr > 0)nlen += stringlength(268);
910 if(deletions_allowed)nlen += stringlength(269);
911 nlen += stringlength(270);
913 helpstring = (char *) malloc(nlen+1);
915 for (k = nhelplines-1; k >= 0; k--) {
916 s = add_string(s, help_line[k]);
921 s = add_string(s, 265); /* Type <return> to proceed, S to scroll future error messages, */
922 s = add_string(s, 266); /* R to run without stopping, Q to run quietly, */
923 s = add_string(s, 267); /* I to insert something, */
924 if(base_ptr > 0)s = add_string(s, 268); /* E to edit your file, */
925 if(deletions_allowed)s = add_string(s, 269); /* 1 or ... or 9 to ignore the next 1 to 9 tokens of input, */
926 s = add_string(s, 270); /* H for help, X to quit. */
931 char * make_up_query_string (int promptstr)
934 int nstart, nnext, n;
936 nstart = str_start[ promptstr];
937 nnext = str_start[ promptstr + 1];
939 querystr = (char *) malloc(n + 1);
941 memcpy(s, &str_pool[nstart], n);
947 // abort_flag set if input_line / ConsoleInput returns non-zero
948 // should set interrupt instead ???
949 // called from tex0.c, tex2.c, tex3.c
951 // void term_input(void)
952 void term_input (int promptstr, int nhelplines)
956 char *helpstring = NULL;
957 char *querystring = NULL;
958 // if (nhelplines != 0) {
959 // helpstring = make_up_help_string (nhelplines);
960 // printf(helpstring);
963 show_line("\n", 0); // force it to show what may be buffered up ???
966 if (promptstr != 0) querystring = make_up_query_string (promptstr);
967 if (nhelplines != 0) helpstring = make_up_help_string (nhelplines);
968 if (helpstring == NULL && querystring != NULL) {
969 if (strcmp(querystring, ": ") == 0)
970 helpstring = xstrdup("Please type another file name (or ^z to exit):");
971 else if (strcmp(querystring, "=>") == 0) // from firm_up_the_line
972 helpstring = xstrdup("Please type <enter> to accept this line\r\nor type a replacement line");
973 else if (strcmp(querystring, "insert>") == 0) // from error() after "I"
974 helpstring = xstrdup("Please type something to insert here");
975 else if (strcmp(querystring, "") == 0) // from read_toks
976 helpstring = xstrdup("Please type a control sequence");
977 else if (strcmp(querystring, "= ") == 0) // from read_toks
978 helpstring = xstrdup("Please type a token");
979 else if (strcmp(querystring, "*") == 0) // get_next
980 helpstring = xstrdup("Please type a control sequence\r\n(or ^z to exit)");
981 // else if (strcmp(querystring, "**") == 0) // init_terminal
982 // helpstring = xstrdup("Please type a control sequence or a file name\r\n(or ^z to exit)");
983 // else if (strcmp(querystring, "? ") == 0) // from error()
984 // helpstring = xstrdup("Please type a character to select an action");
986 flag = ConsoleInput(querystring, helpstring, (char *) &buffer[first]); // ???
987 // flag == 0 means trouble --- EOF on terminal
988 if (querystring != NULL) free(querystring);
989 if (helpstring != NULL) free(helpstring);
990 helpstring = querystring = NULL;
992 last = first + strlen((char *) &buffer[first]); /* -1 ? */
993 // flag = (last > first);
994 // may need to be more elaborate see input_line in texmf.c ???
995 // sprintf(log_line, "first %d last %d flag %d - %s",
996 // first, last, flag, (char *) &buffer[first]);
997 // winerror(log_line);
1000 flag = input_ln(stdin, true);
1003 fatal_error("End of file on the terminal!"); /* */
1004 return; // abort_flag set
1008 // echo what was typed into Console buffer also
1010 {register integer for_end; k = first; for_end = last - 1;
1013 while(k++ < for_end);
1017 decr(selector); // shut off echo
1019 {register integer for_end; k = first; for_end = last - 1;
1022 while(k++ < for_end);
1025 incr(selector); // reset selector again
1029 void int_error_ (integer n)
1033 print_char(41); /*)*/
1037 void normalize_selector (void)
1045 if (interaction == 0)
1049 void pause_for_instructions (void)
1051 if (OK_to_interrupt) {
1053 if((selector == 18)||(selector == 16))
1055 print_err("Interruption");
1057 "Try to insert some instructions for me (e.g.,`I\\showlists'),",
1058 "unless you just want to quit by typing `X'.");
1059 deletions_allowed = false;
1061 deletions_allowed = true;
1066 integer half_(integer x)
1068 register integer Result;
1071 else Result = x / 2;
1075 scaled round_decimals_(small_number k)
1077 register scaled Result;
1082 a =(a + dig[k]* 131072L)/ 10; /* 2^17 */
1088 /* This has some minor speedup changes - no real advantage probably ... */
1089 void print_scaled_(scaled s)
1094 print_char(45); /* '-' */
1097 print_int(s / 65536L);
1098 print_char(46); /* '.' */
1099 s = 10 *(s % 65536L)+ 5;
1103 s = s - 17232; /* 2^15 - 50000 - rounding */
1104 print_char(48 +(s / 65536L)); /* '0' + */
1105 s = 10 *(s % 65536L);
1107 } while(!(s <= delta));
1110 scaled mult_and_add_(integer n, scaled x, scaled y, scaled maxanswer)
1112 register scaled Result;
1120 else if(((x <=(maxanswer - y)/ n)&&(- (integer) x <=(maxanswer + y)/ n)))
1129 scaled x_over_n_(scaled x, integer n)
1131 register scaled Result;
1151 tex_remainder = x % n;
1155 Result = - (integer)((- (integer) x)/ n);
1156 tex_remainder = - (integer)((- (integer) x)% n);
1160 tex_remainder = - (integer) tex_remainder;
1164 scaled xn_over_d_(scaled x, integer n, integer d)
1166 register scaled Result;
1168 nonnegative_integer t, u, v;
1176 /* t =(x % 32768L)* n; */
1178 /* u =(x / 32768L)* n +(t / 32768L); */
1179 u =(x >> 15)* n +(t >> 15);
1180 /* v =(u % d)* 32768L +(t % 32768L); */
1181 v =((u % d)<< 15)+(t & 32767L);
1184 /* else u = 32768L *(u / d)+(v / d); */
1185 else u =((u / d)<< 15)+(v / d);
1189 tex_remainder = v % d;
1193 Result = - (integer) u;
1194 tex_remainder = - (integer)(v % d);
1199 halfword badness_(scaled t, scaled s)
1201 register halfword Result;
1210 else if(s >= 1663497L)
1215 /* safe to assume that r is positive ? */
1216 /* else Result =(r * r * r + 131072L)/ 262144L; */
1217 else Result =(r * r * r + 131072L)>> 18; /* 2^17 */
1223 void print_word_(memory_word w)
1226 print_char(32); /* */
1227 print_scaled(w.cint);
1228 print_char(32); /* */
1229 print_scaled(round(65536L * w.gr));
1231 print_int(w.hh.v.LH);
1232 print_char(61); /* = */
1234 print_char(58); /* : */
1236 print_char(59); /*; */
1237 print_int(w.hh.v.RH);
1238 print_char(32); /* */
1239 print_int(w.qqqq.b0);
1240 print_char(58); /* : */
1241 print_int(w.qqqq.b1);
1242 print_char(58); /* : */
1243 print_int(w.qqqq.b2);
1244 print_char(58); /* : */
1245 print_int(w.qqqq.b3);
1248 /* need this version only if SHORTFONTINFO defined */
1250 void zprintfword(fmemoryword w)
1253 print_char(32); /* */
1254 print_scaled(w.cint);
1255 print_char(32); /* */
1256 print_scaled(round(65536L * w.gr));
1258 print_int(w.hh.v.LH);
1259 print_char(61); /* = */
1261 print_char(58); /* : */
1262 print_int(w .hh.b1);
1263 print_char(59); /*; */
1264 print_int(w.hh.v.RH);
1265 print_char(32); /* */
1266 print_int(w.qqqq.b0);
1267 print_char(58); /* : */
1268 print_int(w.qqqq.b1);
1269 print_char(58); /* : */
1270 print_int(w.qqqq.b2);
1271 print_char(58); /* : */
1272 print_int(w.qqqq.b3);
1276 void show_token_list_(integer p, integer q, integer l)
1279 ASCII_code matchchr;
1284 /* while (p<>null) and (tally<l) do l.6239 */
1285 while((p != 0)&&(tally < l)) {
1289 first_count = tally;
1290 trick_count = tally + 1 + error_line - half_error_line;
1291 if(trick_count < error_line)
1292 trick_count = error_line;
1294 if((p < hi_mem_min)||(p > mem_end))
1296 print_esc("CLOBBERED."); /* */
1299 if(mem[p].hh.v.LH >= 4095)
1300 print_cs(mem[p].hh.v.LH - 4095);
1303 m = mem[p].hh.v.LH / 256;
1304 /* m = mem[p].hh.v.LH >> 8; */
1305 c = mem[p].hh.v.LH % 256;
1306 /* c = mem[p].hh.v.LH & 255; */
1307 if(mem[p].hh.v.LH < 0)
1308 print_esc("BAD."); /* */
1333 print_char(33); /* ! */
1340 /* matchchr = c; */ /* keep compiler happy */
1341 matchchr = (ASCII_code) c;
1359 /* if p<>null then print_esc("ETC."); l.6244 */
1361 print_esc("ETC."); /* */
1367 if(scanner_status > 1)
1369 print_nl("Runaway "); /* */
1370 switch(scanner_status)
1373 print_string("definition");
1379 print_string("argument");
1385 print_string("preamble");
1396 print_char(63); /* ? */
1398 /* p may be used without being initialized -- OK */
1399 show_token_list(mem[p].hh.v.RH, 0, error_line - 10);
1403 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1404 /* first try list of available nodes (avail != NULL) */
1405 /* then see if can go upwards (mem_end < mem_max) */
1406 /* then see if can go downwards (hi_mem_min > lo_mem_max) */
1407 /* if not, extend memory at the top and grab from there --- new */
1408 /* else fail ! */ /* paragraph 120 */
1409 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1410 halfword get_avail (void)
1412 register halfword Result;
1415 if(p != 0) /* while p<>null do */
1416 avail = mem[avail].hh.v.RH;
1417 else if(mem_end < mem_max) /* mem_end + 1 < mem_max ? NO */
1425 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1426 if(hi_mem_min <= lo_mem_max){ /* have we run out in middle ? */
1427 incr(hi_mem_min); /* undo the change */
1428 /* realloc_main (0, mem_top/2); */ /* extend main memory at hi end */
1429 mem = realloc_main (0, mem_top/2); /* zzzaa = zmem = mem */
1433 /* presumably now mem_end < mem_max - but need test in case allocation fails */
1434 if (mem_end >= mem_max) {
1436 overflow(298, mem_max + 1 - mem_min); /* main memory size */
1437 return 0; // abort_flag set
1439 incr(mem_end); /* then grab from new area */
1440 p = mem_end; /* 1993/Dec/14 */
1442 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1444 mem[p].hh.v.RH = 0; /* link(p) = null !!! */
1453 void flush_list_(halfword p) /* paragraph 123 */
1456 if(p != 0) /* null !!! */
1466 } while(!(r == 0)); /* r != null */
1467 mem[q].hh.v.RH = avail;
1472 halfword get_node_(integer s)
1474 register halfword Result;
1481 q = p + mem[p].hh.v.LH;
1482 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1483 /* while((mem[q].hh.v.RH == 262143L)) { */ /* NO! */
1484 while((mem[q].hh.v.RH == empty_flag)) {
1485 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1488 /* should never happen, since this field is reference count for zeroglue */
1489 } /* debugging code 93/DEC/15 */ /* eventually remove */
1491 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1492 t = mem[q + 1].hh.v.RH;
1495 mem[t + 1].hh.v.LH = mem[q + 1].hh.v.LH;
1496 mem[mem[q + 1].hh.v.LH + 1].hh.v.RH = t;
1497 q = q + mem[q].hh.v.LH;
1500 if(r > toint(p + 1))
1502 mem[p].hh.v.LH = r - p;
1507 if(mem[p + 1].hh.v.RH != p)
1509 rover = mem[p + 1].hh.v.RH;
1510 t = mem[p + 1].hh.v.LH;
1511 mem[rover + 1].hh.v.LH = t;
1512 mem[t + 1].hh.v.RH = rover;
1515 mem[p].hh.v.LH = q - p;
1516 p = mem[p + 1].hh.v.RH;
1517 } while(!(p == rover));
1518 if(s == 1073741824L) /* 2^30 - special case - merge adjacent */
1520 /* Result = 262143L; */ /* NO ! */
1521 Result = empty_flag;
1522 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1523 if (trace_flag) show_line("Merged adjacent multi-word nodes\n", 0);
1524 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1527 /* maybe try downward epxansion first instead ? */
1528 if(lo_mem_max + 2 < hi_mem_min)
1530 /* if(lo_mem_max + 2 <= 262143L) */ /* NO! */
1531 if(lo_mem_max + 2 <= mem_bot + max_halfword) /* silly ? flush 93/Dec/16 */
1534 /* if(hi_mem_min - lo_mem_max >= 1998) */
1535 if(hi_mem_min - lo_mem_max >= (block_size + block_size - 2))
1536 /* t = lo_mem_max + 1000; */
1537 t = lo_mem_max + block_size;
1538 else t = lo_mem_max + 1 +(hi_mem_min - lo_mem_max)/ 2;
1539 p = mem[rover + 1].hh.v.LH;
1541 mem[p + 1].hh.v.RH = q;
1542 mem[rover + 1].hh.v.LH = q;
1544 /* if(t > 262143L) t = 262143L; */ /* NO! */
1545 if(t > mem_bot + max_halfword)
1546 t = mem_bot + max_halfword; /* silly ? flush 93/Dec/16 */
1548 mem[q + 1].hh.v.RH = rover;
1549 mem[q + 1].hh.v.LH = p;
1550 /* mem[q].hh.v.RH = 262143L; */ /* NO! */
1551 mem[q].hh.v.RH = empty_flag;
1552 mem[q].hh.v.LH = t - lo_mem_max; /* block size */
1554 mem[lo_mem_max].hh.v.RH = 0;
1555 mem[lo_mem_max].hh.v.LH = 0;
1559 /* overflow(298, mem_max + 1 - mem_min); */ /* what used to happen! */
1560 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1561 /* we've run out of space in the middle for variable length blocks */
1562 /* try and add new block from below mem_bot *//* first check if space ! */
1563 if (mem_min - (block_size + 1) <= mem_start) {/* extend lower memory downwards */
1564 /* realloc_main (mem_top/2, 0); */
1565 mem = realloc_main (mem_top/2 + block_size, 0); /* zzzaa = zmem = mem */
1570 /* if (trace_flag) show_line("Extending downwards by %d\n", block_size, 0); */
1571 if (mem_min - (block_size + 1) <= mem_start) { /* check again */
1573 sprintf(log_line, "mem_min %d, mem_start %d, block_size %d\n", mem_min, mem_start, block_size);
1574 show_line(log_line, 0);
1576 overflow(298, mem_max + 1 - mem_min); /* darn: allocation failed ! */
1577 return 0; // abort_flag set
1579 /* avoid function call in following ? */
1580 add_variable_space (block_size); /* now to be found in itex.c */
1581 goto lab20; /* go try get_node again */
1582 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1584 lab40: mem[r].hh.v.RH = 0;
1587 var_used = var_used + s;
1590 /* if (trace_flag) {
1591 if (r == 0) show_line("r IS ZERO in ZGETNODE!\n", 0);
1592 } */ /* debugging code 93/dec/15 */
1598 void free_node_(halfword p, halfword s)
1602 /* mem[p].hh.v.RH = 262143L; */ /* NO! */
1603 mem[p].hh.v.RH = empty_flag;
1604 q = mem[rover + 1].hh.v.LH;
1605 mem[p + 1].hh.v.LH = q;
1606 mem[p + 1].hh.v.RH = rover;
1607 mem[rover + 1].hh.v.LH = p;
1608 mem[q + 1].hh.v.RH = p;
1611 var_used = var_used - s;
1615 halfword new_null_box (void)
1617 register halfword Result;
1622 mem[p + 1].cint = 0;
1623 mem[p + 2].cint = 0;
1624 mem[p + 3].cint = 0;
1625 mem[p + 4].cint = 0;
1626 mem[p + 5].hh.v.RH = 0;
1627 mem[p + 5].hh.b0 = 0;
1628 mem[p + 5].hh.b1 = 0;
1629 mem[p + 6].gr = 0.0;
1634 // @ A new rule node is delivered by the |new_rule| function. It
1635 // makes all the dimensions ``running,'' so you have to change the
1636 // ones that are not allowed to run.
1638 halfword new_rule (void)
1640 register halfword Result;
1642 p = get_node(4); /* rule_node_size */
1643 mem[p].hh.b0 = 2; /* rule_node type */
1644 mem[p].hh.b1 = 0; /* sub_type zero */
1645 mem[p + 1].cint = -1073741824L; /* -2^30 null_flag width */
1646 mem[p + 2].cint = -1073741824L; /* -2^30 null_flag depth */
1647 mem[p + 3].cint = -1073741824L; /* -2^30 null_flag height */
1652 // @ The |new_ligature| function creates a ligature node having given
1653 // contents of the |font|, |character|, and |lig_ptr| fields.
1655 halfword new_ligature_(quarterword f, quarterword c, halfword q)
1657 register halfword Result;
1659 p = get_node(2); /* small_node_size */
1660 mem[p].hh.b0 = 6; /* ligature_node type */
1661 mem[p + 1].hh.b0 = f; /* font */
1662 mem[p + 1].hh.b1 = c; /* character */
1663 mem[p + 1].hh.v.RH = q; /* pointer */
1664 mem[p].hh.b1 = 0; /* subtype zero */
1669 // We also have a |new_lig_item| function, which returns a two-word
1670 // node having a given |character| field. Such nodes are used for
1671 // temporary processing as ligatures are being created.
1673 halfword new_lig_item_(quarterword c)
1675 register halfword Result;
1677 p = get_node(2); /* small_node_size */
1678 mem[p].hh.b1 = c; /* character */
1679 mem[p + 1].hh.v.RH = 0; /* lig_ptr(p):=null; */
1684 halfword new_disc (void)
1686 register halfword Result;
1691 mem[p + 1].hh.v.LH = 0; /* pre_break(p):=null; */
1692 mem[p + 1].hh.v.RH = 0; /* post_break(p):=null; */
1697 halfword new_math_(scaled w, small_number s)
1699 register halfword Result;
1704 mem[p + 1].cint = w;
1709 halfword new_spec_(halfword p)
1711 register halfword Result;
1716 mem[q + 1].cint = mem[p + 1].cint;
1717 mem[q + 2].cint = mem[p + 2].cint;
1718 mem[q + 3].cint = mem[p + 3].cint;
1723 halfword new_param_glue_(small_number n)
1725 register halfword Result;
1730 mem[p].hh.b1 = n + 1; /* conversion int to unsigned short */
1731 mem[p + 1].hh.v.RH = 0;
1732 q = eqtb[(hash_size + 782) + n].hh.v.RH; /* gluebase + n */
1733 mem[p + 1].hh.v.LH = q;
1734 incr(mem[q].hh.v.RH);
1739 halfword new_glue_(halfword q)
1741 register halfword Result;
1746 mem[p + 1].hh.v.RH = 0;
1747 mem[p + 1].hh.v.LH = q;
1748 incr(mem[q].hh.v.RH);
1753 halfword new_skip_param_(small_number n)
1755 register halfword Result;
1757 temp_ptr = new_spec(eqtb[(hash_size + 782) + n].hh.v.RH); /* gluebase + n */
1758 p = new_glue(temp_ptr);
1759 mem[temp_ptr].hh.v.RH = 0;
1760 mem[p].hh.b1 = n + 1; /* conversion int to unsigned short */
1765 halfword new_kern_(scaled w)
1767 register halfword Result;
1772 mem[p + 1].cint = w;
1777 halfword new_penalty_(integer m)
1779 register halfword Result;
1784 mem[p + 1].cint = m;
1790 void check_mem_(bool printlocs)
1794 {register integer for_end; p = mem_min; for_end = lo_mem_max; if(p <=
1797 while(p++ < for_end); }
1798 {register integer for_end; p = hi_mem_min; for_end = mem_end; if(p <=
1801 while(p++ < for_end); }
1805 while(p != 0){ /* while p<>null do */
1806 if((p > mem_end)||(p < hi_mem_min))
1812 print_nl("AVAIL list clobbered at "); /* */
1822 q = 0; /* q:=null */
1825 if((p >= lo_mem_max)||(p < mem_min))
1827 else if((mem[p + 1].hh.v.RH >= lo_mem_max)||(mem[p + 1].hh.v.RH < mem_min))
1829 /* else if(!((mem[p].hh.v.RH == 262143L)) ||(mem[p].hh *//*NO!*/
1830 else if(!((mem[p].hh.v.RH == empty_flag)) ||
1831 (mem[p].hh .v.LH < 2) ||
1832 (p + mem[p].hh.v.LH > lo_mem_max) ||
1833 (mem[mem[p + 1].hh.v.RH + 1].hh.v.LH != p))
1837 print_nl("Double-AVAIL list clobbered at "); /* */
1841 {register integer for_end; q = p; for_end = p + mem[p].hh.v.LH - 1
1842 ; if(q <= for_end) do
1846 print_nl("Doubly free location at "); /* */
1852 while(q++ < for_end); }
1854 p = mem[p + 1].hh.v.RH;
1855 } while(!(p == rover));
1858 while(p <= lo_mem_max){sss
1859 /* if((mem[p].hh.v.RH == 262143L)) */ /* NO! */
1860 if((mem[p].hh.v.RH == empty_flag))
1862 print_nl("Bad flag at "); /* */
1865 while((p <= lo_mem_max)&& ! freearr[p])incr(p);
1866 while((p <= lo_mem_max)&& freearr[p])incr(p);
1870 print_nl("New busy locs:"); /* */
1871 {register integer for_end; p = mem_min; for_end = lo_mem_max; if(p <=
1873 if(! freearr[p]&&((p > waslomax)|| wasfree[p]))
1875 print_char(32); /* */
1878 while(p++ < for_end); }
1879 {register integer for_end; p = hi_mem_min; for_end = mem_end; if(p <=
1881 if(! freearr[p]&&((p < washimin)||(p > wasmemend)||
1884 print_char(32); /* */
1887 while(p++ < for_end); }
1889 {register integer for_end; p = mem_min; for_end = lo_mem_max; if(p <=
1891 wasfree[p]= freearr[p];
1892 while(p++ < for_end); }
1893 {register integer for_end; p = hi_mem_min; for_end = mem_end; if(p <=
1895 wasfree[p]= freearr[p];
1896 while(p++ < for_end); }
1897 wasmemend = mem_end;
1898 waslomax = lo_mem_max;
1899 washimin = hi_mem_min;
1904 void search_mem_(halfword p)
1907 {register integer for_end; q = mem_min; for_end = lo_mem_max; if(q <=
1910 if(mem[q].hh.v.RH == p)
1912 print_nl("LINK("); /* */
1914 print_char(41); /*)*/
1916 if(mem[q].hh.v.LH == p)
1918 print_nl("INFO("); /* */
1920 print_char(41); /*)*/
1923 while(q++ < for_end); }
1924 {register integer for_end; q = hi_mem_min; for_end = mem_end; if(q <=
1927 if(mem[q].hh.v.RH == p)
1929 print_nl("LINK("); /* */
1931 print_char(41); /*)*/
1933 if(mem[q].hh.v.LH == p)
1935 print_nl("INFO("); /* */
1937 print_char(41); /*)*/
1940 while(q++ < for_end); }
1941 {register integer for_end; q = 1; for_end = (hash_size + 1833); if(q <= for_end) do
1943 if(eqtb[q].hh.v.RH == p)
1945 print_nl("EQUIV("); /* */
1947 print_char(41); /*)*/
1950 while(q++ < for_end); }
1952 {register integer for_end; q = 0; for_end = save_ptr - 1; if(q <=
1955 if(save_stack[q].hh.v.RH == p)
1957 print_nl("SAVE("); /* */
1959 print_char(41); /*)*/
1962 while(q++ < for_end); }
1963 /* {register integer for_end; q = 0; for_end = 607; if(q <= for_end) do */
1964 {register integer for_end; q = 0; for_end = hyphen_prime; if(q <= for_end) do
1966 if(hyph_list[q]== p)
1970 print_char(41); /*)*/
1973 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))
1990 print_char(42); /* * */
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);}
1995 print_char(32); /* */
1996 font_in_short_display = mem[p].hh.b0;
1998 print(mem[p].hh.b1); /* character(p) */
2001 else switch(mem[p].hh.b0)
2012 print_char(124); /* | */
2015 if(mem[p + 1].hh.v.LH != 0)
2016 print_char(32); /* */
2019 print_char(36); /* $ */
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(mem[p].hh.v.RH != 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);}
2055 print_char(32); /* */
2056 print(mem[p].hh.b1); /* character(p) */
2060 void print_mark_ (integer p)
2062 print_char(123); /* { */
2063 if((p < hi_mem_min)||(p > mem_end))
2064 print_esc("CLOBBERED.");
2065 else show_token_list(mem[p].hh.v.RH, 0, max_print_line - 10);
2066 print_char(125); /* } */
2069 void print_rule_dimen_ (scaled d)
2071 if((d == -1073741824L)) /* - 2^30 */
2072 print_char(42); /* * */
2077 void print_glue_(scaled d, integer order, str_number s)
2080 if((order < 0)||(order > 3))
2081 print_string("foul");
2084 print_string("fil");
2086 print_char(108); /* l */
2094 void print_spec_(integer p, str_number s)
2096 if((p < mem_min)||(p >= lo_mem_max))
2097 print_char(42); /* * */
2099 print_scaled(mem[p + 1].cint);
2102 if(mem[p + 2].cint != 0)
2104 print_string("plus");
2105 print_glue(mem[p + 2].cint, mem[p].hh.b0, s);
2107 if(mem[p + 3].cint != 0)
2109 print_string("minus");
2110 print_glue(mem[p + 3].cint, mem[p].hh.b1, s);
2115 void print_fam_and_char_(halfword p)
2118 print_int(mem[p].hh.b0);
2119 print_char(32); /* */
2120 print(mem[p].hh.b1);
2123 void print_delimiter_(halfword p)
2126 a = mem[p].qqqq.b0 * 256 + mem[p].qqqq.b1;
2127 a = a * 4096 + mem[p].qqqq.b2 * 256 + mem[p].qqqq.b3;
2133 void print_subsidiary_data_(halfword p, ASCII_code c)
2135 if((pool_ptr - str_start[str_ptr]) >= depth_threshold)
2137 if(mem[p].hh.v.RH != 0)
2142 str_pool[pool_ptr]= c;
2146 switch(mem[p].hh.v.RH)
2150 print_current_string ();
2151 print_fam_and_char(p);
2158 if(mem[p].hh.v.LH == 0)
2161 print_current_string ();
2174 void print_style_(integer c)
2179 print_esc("displaystyle");
2182 print_esc("textstyle");
2185 print_esc("scriptstyle");
2188 print_esc("scriptscriptstyle");
2191 print_string("Unknown style!");
2196 void print_skip_param_(integer n)
2200 case line_skip_code:
2201 print_esc("lineskip");
2203 case baseline_skip_code:
2204 print_esc("baselineskip");
2207 print_esc("parskip");
2209 case above_display_skip_code:
2210 print_esc("abovedisplayskip");
2212 case below_display_skip_code:
2213 print_esc("belowdisplayskip");
2215 case above_display_short_skip_code:
2216 print_esc("abovedisplayshortskip");
2218 case below_display_short_skip_code:
2219 print_esc("belowdisplayshortskip");
2221 case left_skip_code:
2222 print_esc("leftskip");
2224 case right_skip_code:
2225 print_esc("rightskip");
2228 print_esc("topskip");
2230 case split_top_skip_code:
2231 print_esc("splittopskip");
2234 print_esc("tabskip");
2236 case space_skip_code:
2237 print_esc("spaceskip");
2239 case xspace_skip_code:
2240 print_esc("xspaceskip");
2242 case par_fill_skip_code:
2243 print_esc("parfillskip");
2245 case thin_mu_skip_code:
2246 print_esc("thinmuskip");
2248 case med_mu_skip_code:
2249 print_esc("medmuskip");
2251 case thick_mu_skip_code:
2252 print_esc("thickmuskip");
2255 print_string("[unknown glue parameter!]");
2260 void show_node_list_(integer p)
2264 /* begin if cur_length>depth_threshold then */
2265 if((pool_ptr - str_start[str_ptr])> depth_threshold)
2267 /* if(p > 0) */ /* was p>null !!! line 3662 in tex.web */
2268 if(p != 0) /* fixed 94/Mar/23 BUG FIX */
2269 /* NOTE: still not fixed in 3.14159 ! */
2274 /* while(p > mem_min){ */ /* was p>mem_min !!! line 3667 in tex.web */
2275 while(p != 0){ /* want p != null - bkph 93/Dec/15 */
2276 /* NOTE: still not fixed in 3.14159 ! */
2278 print_current_string ();
2281 print_string("Bad link, display aborted.");
2287 print_string("etc.");
2290 if((p >= hi_mem_min))
2291 print_font_and_char(p);
2292 else switch(mem[p].hh.b0)
2297 if(mem[p].hh.b0 == 0)
2299 else if(mem[p].hh.b0 == 1)
2301 else print_esc("unset");
2302 print_string("box(");
2303 print_scaled(mem[p + 3].cint);
2304 print_char(43); /* + */
2305 print_scaled(mem[p + 2].cint);
2306 print_string(", shifted ");
2307 print_scaled(mem[p + 1].cint);
2308 if(mem[p].hh.b0 == 13)
2310 if(mem[p].hh.b1 != 0)
2313 print_int(mem[p].hh.b1 + 1);
2314 print_string(" columns)");
2316 if(mem[p + 6].cint != 0)
2318 print_string(", stretch");
2319 print_glue(mem[p + 6].cint, mem[p + 5].hh.b1, 0);
2321 if(mem[p + 4].cint != 0)
2323 print_string(", shrink");
2324 print_glue(mem[p + 4].cint, mem[p + 5].hh.b0, 0);
2330 if((g != 0.0)&&(mem[p + 5].hh.b0 != 0))
2332 print_string(", glue set");
2333 if(mem[p + 5].hh.b0 == 2)
2335 if(fabs(g)> 20000.0)
2338 print_char(62); /* '>' */
2339 else print_string("< -");
2340 print_glue(20000 * 65536L, mem[p + 5].hh.b1, 0);
2342 else print_glue(round(65536L * g), mem[p + 5].hh.b1, 0)
2345 if(mem[p + 4].cint != 0)
2347 print_string("shifted");
2348 print_scaled(mem[p + 4].cint);
2353 str_pool[pool_ptr]= 46;
2356 show_node_list(mem[p + 5].hh.v.RH);
2364 print_rule_dimen(mem[p + 3].cint);
2365 print_char(43); /* '+' */
2366 print_rule_dimen(mem[p + 2].cint);
2368 print_rule_dimen(mem[p + 1].cint);
2373 print_esc("insert");
2374 print_int(mem[p].hh.b1);
2375 print_string(",natural size ");
2376 print_scaled(mem[p + 3].cint);
2377 print_string("; split(");
2378 print_spec(mem[p + 4].hh.v.RH, 0);
2379 print_char(44); /* ',' */
2380 print_scaled(mem[p + 2].cint);
2381 print_string("(; float cost");
2382 print_int(mem[p + 1].cint);
2385 str_pool[pool_ptr]= 46;
2388 show_node_list(mem[p + 4].hh.v.LH);
2394 switch(mem[p].hh.b1)
2397 print_write_whatsit(1279, p); /* debug # (-1 to exit): */
2398 print_char(61); /* = */
2399 print_file_name(mem[p + 1].hh.v.RH, mem[p + 2].hh.v.LH,
2400 mem[p + 2].hh.v.RH);
2405 print_write_whatsit(591, p); /* write */
2406 print_mark(mem[p + 1].hh.v.RH);
2410 print_write_whatsit(1280, p); /* closeout */
2414 print_esc("special");
2415 print_mark(mem[p + 1].hh.v.RH);
2420 print_esc("setlanguage");
2421 print_int(mem[p + 1].hh.v.RH);
2422 print_string(" (hyphenmin");
2423 print_int(mem[p + 1].hh.b0);
2424 print_char(44); /*, */
2425 print_int(mem[p + 1].hh.b1);
2426 print_char(41); /*)*/
2430 print_string("whatsit");
2435 if(mem[p].hh.b1 >= 100)
2438 if(mem[p].hh.b1 == 101)
2439 print_char(99); /* c */
2440 else if(mem[p].hh.b1 == 102)
2441 print_char(120); /* x */
2442 print_string("leaders ");
2443 print_spec(mem[p + 1].hh.v.LH, 0);
2446 str_pool[pool_ptr]= 46;
2449 show_node_list(mem[p + 1].hh.v.RH);
2456 if(mem[p].hh.b1 != 0)
2458 print_char(40); /*(*/
2459 if(mem[p].hh.b1 < 98)
2460 print_skip_param(mem[p].hh.b1 - 1);
2461 else if(mem[p].hh.b1 == 98)
2462 print_esc("nonscript");
2463 else print_esc("mskip");
2464 print_char(41); /*)*/
2466 if(mem[p].hh.b1 != 98)
2468 print_char(32); /* */
2469 if(mem[p].hh.b1 < 98)
2470 print_spec(mem[p + 1].hh.v.LH, 0);
2471 else print_spec(mem[p + 1].hh.v.LH, 334); /* mu */
2476 if(mem[p].hh.b1 != 99)
2479 if(mem[p].hh.b1 != 0)
2480 print_char(32); /* */
2481 print_scaled(mem[p + 1].cint);
2482 if(mem[p].hh.b1 == 2)
2483 print_string(" (for accent)");
2487 print_scaled(mem[p + 1].cint);
2494 if(mem[p].hh.b1 == 0)
2496 else print_string("off");
2497 if(mem[p + 1].cint != 0)
2499 print_string(", surrounded");
2500 print_scaled(mem[p + 1].cint);
2506 print_font_and_char(p + 1);
2507 print_string("(ligature");
2508 if(mem[p].hh.b1 > 1)
2509 print_char(124); /* | */
2510 font_in_short_display = mem[p + 1].hh.b0;
2511 short_display(mem[p + 1].hh.v.RH);
2512 if(odd(mem[p].hh.b1))
2513 print_char(124); /* | */
2514 print_char(41); /*)*/
2519 print_esc("penalty ");
2520 print_int(mem[p + 1].cint);
2525 print_esc("discretionary");
2526 if(mem[p].hh.b1 > 0)
2528 print_string(" replacing ");
2529 print_int(mem[p].hh.b1);
2533 str_pool[pool_ptr]= 46;
2536 show_node_list(mem[p + 1].hh.v.LH);
2540 str_pool[pool_ptr]= 124;
2543 show_node_list(mem[p + 1].hh.v.RH);
2550 print_mark(mem[p + 1].cint);
2555 print_esc("vadjust");
2558 str_pool[pool_ptr]= 46;
2561 show_node_list(mem[p + 1].cint);
2567 print_style(mem[p].hh.b1);
2571 print_esc("mathchoice");
2573 str_pool[pool_ptr]= 68;
2576 show_node_list(mem[p + 1].hh.v.LH);
2579 str_pool[pool_ptr]= 84;
2582 show_node_list(mem[p + 1].hh.v.RH);
2585 str_pool[pool_ptr]= 83;
2588 show_node_list(mem[p + 2].hh.v.LH);
2591 str_pool[pool_ptr]= 115;
2594 show_node_list(mem[p + 2].hh.v.RH);
2614 switch(mem[p].hh.b0)
2616 print_esc("mathord");
2619 print_esc("mathop");
2622 print_esc("mathbin");
2625 print_esc("mathrel");
2628 print_esc("mathopen");
2631 print_esc("mathclose");
2634 print_esc("mathpunct");
2637 print_esc("mathinner");
2640 print_esc("overline");
2643 print_esc("underline");
2646 print_esc("vcenter");
2650 print_esc("radical");
2651 print_delimiter(p + 4);
2656 print_esc("accent");
2657 print_fam_and_char(p + 4);
2663 print_delimiter(p + 1);
2669 print_delimiter(p + 1);
2673 if(mem[p].hh.b1 != 0)
2674 if(mem[p].hh.b1 == 1)
2675 print_esc("limits");
2676 else print_esc("nolimits");
2677 if(mem[p].hh.b0 < 30)
2678 print_subsidiary_data(p + 1, 46);
2679 print_subsidiary_data(p + 2, 94);
2680 print_subsidiary_data(p + 3, 95);
2685 print_esc("fraction");
2686 if(mem[p + 1].cint == 1073741824L) /* 2^30 */
2687 print_string("= default");
2688 else print_scaled(mem[p + 1].cint);
2689 if((mem[p + 4].qqqq.b0 != 0)||(mem[p + 4].qqqq.b1 !=
2690 0)||(mem[p + 4].qqqq.b2 != 0)||(mem[p + 4].qqqq.b3
2693 print_string(", left");
2694 print_delimiter(p + 4);
2696 if((mem[p + 5].qqqq.b0 != 0)||(mem[p + 5].qqqq.b1 !=
2697 0)||(mem[p + 5].qqqq.b2 != 0)||(mem[p + 5].qqqq.b3
2700 print_string(", right");
2701 print_delimiter(p + 5);
2703 print_subsidiary_data(p + 2, 92);
2704 print_subsidiary_data(p + 3, 47);
2708 print_string("Unknown node type!");
2715 /* NOTE: 262143L should be empty_flag */