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 = n - 1; i >= 0; 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_(str_number s)
246 c = eqtb[(hash_size + 3208)].cint;
248 if(c < 256) print(c);
252 void print_the_digs_(eight_bits k)
257 print_char(48 + dig[k]);
259 print_char(55 + dig[k]);
263 void print_int_(integer n)
270 print_char(45); /* - */
279 /* dig[0]= m; */ /* keep compiler happy */
288 /* dig[k]= n % 10; */ /* keep compiler happy */
289 dig[k]= (char) (n % 10);
296 void print_cs_(integer p)
298 if(p < 514) /* if p < hash_base then ... p.262 */
299 if(p >= 257) /* if p > single_base then ... p.262 */
300 if(p == 513) /* if p = null_cs then ... p.262 */
302 print_esc(501); /* csname */
303 print_esc(502); /* endcsname */
306 print_esc(p - 257); /* p - single_base */
307 /* if cat_code(p - single_base) = letter then ... p.262 */
308 if(eqtb[(hash_size + 1883) + p - 257].hh.v.RH == 11)
309 print_char(32); /* */
312 print_esc(503); /* IMPOSSIBLE */
314 else if(p >= (hash_size + 781)) /* undefined_control_sequence */
315 print_esc(503); /* IMPOSSIBLE */
316 else if((hash[p].v.RH >= str_ptr))
317 print_esc(504); /* NONEXISTENT */
319 print_esc(hash[p].v.RH);
320 print_char(32); /* */
324 void sprint_cs_(halfword p)
326 if(p < 514) /* if p < hash_base then ... p.263 */
327 if(p < 257) /* if p < single_base then ... p.263 */
328 print(p - 1); /* print (p - active_base); */
329 else if(p < 513) /* else if p < null_cs then ... */
330 print_esc(p - 257); /* print (p - single_base); */
332 print_esc(501); /* csname */
333 print_esc(502); /* endcsname */
335 else print_esc(hash[p].v.RH);
338 /* ! I can't find file ` c:/foo/ accents .tex '. */
339 void print_file_name_(integer n, integer a, integer e)
341 /* sprintf(log_line, "\na %d n %d e %d\n", a, n, e); */
342 /* show_line(log_line, 0); */
343 // print_char(33); // debugging only
345 // print_char(33); // debugging only
347 // print_char(33); // debugging only
349 // print_char(33); // debugging only
352 void print_size_(integer s)
355 print_esc(409); /* textfont */
357 print_esc(410); /* scriptfont */
359 print_esc(411); /* scriptscriptfont */
362 void print_write_whatsit_(str_number s, halfword p)
365 if(mem[p + 1].hh.v.LH < 16)
366 print_int(mem[p + 1].hh.v.LH);
367 else if(mem[p + 1].hh.v.LH == 16)
368 print_char(42); /* * */
369 else print_char(45); /* - */
374 // called from itex.c and tex0.c only NASTY NASTY!
375 // now uses uses non-local goto (longjmp) 1999/Nov/7
378 close_files_and_terminate ();
386 if (trace_flag) show_line("EXITING at JUMPOUT\n", 0);
388 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
389 // if (endit(history) != 0) history = 2; /* 93/Dec/26 in local.c */
390 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
392 // abort_flag++; // TURN OFF THE POWER ???
394 if((history != 0)&&(history != 1)) code = 1;
397 // longjmp(jumpbuffer, code+1);
401 // deal with error by asking for user response 0-9, D, E, H, I, X, Q, R, S
402 // NOTE: this may JUMPOUT either via X, or because of too many errors
406 integer s1, s2, s3, s4;
407 if(history < 2) history = 2;
409 print_char(46); /* . */
415 clear_for_error_prompt ();
419 term_input(264, help_ptr);
421 if(last == first)return; // no input
422 c = buffer[first]; // analyze first letter typed
423 if(c >= 97) // uppercase letter first
424 /* c = c - 32; */ /* keep compiler happy */
425 c = (unsigned char) (c - 32);
437 if(deletions_allowed) {
442 align_state = 1000000L;
443 OK_to_interrupt = false;
444 if((last > first + 1)&&(buffer[first + 1]>= 48)&&
445 (buffer[first + 1]<= 57))
446 c = (unsigned char) (c * 10 + buffer[first + 1]- 48 * 11);
447 else c = (unsigned char) (c - 48);
456 OK_to_interrupt = true;
457 help2("I have just deleted some text, as you asked.",
458 "You can now delete more, or insert, or whatever.");
460 goto lab22; /* loop again */
468 goto lab22; /* loop again */
474 edit_name_start = str_start[input_stack[base_ptr].name_field];
475 edit_name_length = str_start[input_stack[base_ptr].name_field + 1]-
476 str_start[input_stack[base_ptr].name_field];
479 // return; // can drop through now 99/Oct/20
487 use_err_help = false;
491 help2("Sorry, I don't know how to help in this situation.",
492 "Maybe you should try asking a human?");
495 print(help_line[help_ptr]);
497 } while(!(help_ptr == 0));
499 help4("Sorry, I already gave what help I could...",
500 "Maybe you should try asking a human?",
501 "An error might have occurred before I noticed any problems.",
502 "``If all else fails, read the instructions.''");
503 goto lab22; /* loop again */
508 begin_file_reading ();
511 cur_input.loc_field = first + 1;
517 print(276); /* insert> */
520 cur_input.loc_field = first;
523 cur_input.limit_field = last - 1;
527 case 81 : /* Q, R, S */
532 interaction = 0 + c - 81; /* Q = 0, R = 1, S = 2, T = 3 */
533 print(271); /* OK, entering */
537 print_esc(272); /* batchmode */
542 print_esc(273); /* nonstopmode */
545 print_esc(274); /* scrollmode */
548 print(275); /* ... */
560 // return; // can drop through now 99/Oct/20
566 } /* end of switch analysing response character */
568 print(265); /* Type <return> to proceed, S to scroll future error messages, */
569 print_nl("R to run without stopping, Q to run quietly,"); /* */
570 print_nl("I to insert something, "); /* */
571 if (base_ptr > 0) print(268); /* E to edit your file, */
572 if(deletions_allowed) print_nl("1 or ... or 9 to ignore the next 1 to 9 tokens of input,"); /* */
573 print_nl("H for help, X to quit."); /* */
575 } /* end of while(true) loop */
578 if(error_count == 100) {
579 print_nl("(That makes 100 errors; please try again.)");
582 // return; // can drop through now 99/Oct/20
584 if(interaction > 0) decr(selector);
589 else while(help_ptr > 0){
591 print_nl(help_line[help_ptr]);
594 if(interaction > 0)incr(selector);
598 void fatal_error_(str_number s)
600 normalize_selector ();
601 print_err("Emergency stop");
605 help_line[0] = ""; //s; // given string goes into help line
608 if(interaction == 3)interaction = 2;
614 if(interaction > 0)debug_help ();
618 // return; // can drop through now 99/Oct/20
622 void overflow_(str_number s, integer n)
624 normalize_selector ();
625 print_err("TeX capacity exceeded, sorry[");
627 print_char(61); /* '=' */
629 print_char(93); /* ']' */
630 help2("If you really absolutely need more capacity,",
631 "you can ask a wizard to enlarge me.");
632 if (! knuth_flag) { /* Additional comments 98/Jan/5 */
633 if (s == 945 && n == trie_size) {
634 sprintf(log_line, "\n (Maybe use -h=... on command line in ini-TeX)\n");
635 show_line(log_line, 0);
637 else if (s == 942 && n == hyphen_prime) {
638 sprintf(log_line, "\n (Maybe use -e=... on command line in ini-TeX)\n");
639 show_line(log_line, 0);
642 if(interaction == 3)interaction = 2;
648 if(interaction > 0)debug_help ();
652 // return; // can drop through now 99/Oct/20
655 void confusion_(str_number s)
657 normalize_selector ();
659 print_err("This can't happen(");
661 print_char(41); /*)*/
662 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.");
670 if(interaction == 3)interaction = 2;
676 if(interaction > 0)debug_help ();
680 // return; // can drop through now 99/Oct/20
684 bool init_terminal (void)
686 register bool Result;
691 cur_input.loc_field = first;
692 while((cur_input.loc_field < last) && (buffer[cur_input.loc_field]== ' '))
693 incr(cur_input.loc_field); // step over initial white space
694 if(cur_input.loc_field < last){
696 return Result; // there is an input file name
700 // failed to find input file name
704 flag = ConsoleInput("**",
705 "Please type a file name or a control sequence\r\n(or ^z to exit)",
706 (char *) &buffer[first]);
707 last = first + strlen((char *) &buffer[first]); /* -1 ? */
708 // may need to be more elaborate see input_line in texmf.c
710 (void) fputs("**", stdout); /* ** PROMPT */
712 flag = input_ln(stdin, true);
716 show_line("! End of file on the terminal... why?\n", 1);
721 cur_input.loc_field = first;
722 while((cur_input.loc_field < last)&&
723 (buffer[cur_input.loc_field]== ' '))
724 incr(cur_input.loc_field); // step over intial white space
725 if(cur_input.loc_field < last){
727 return Result; // there is an input file name
729 sprintf(log_line, "%s\n", "Please type the name of your input file.");
730 show_line(log_line, 1);
735 // Make string from str_start[str_ptr]to pool_ptr
736 str_number make_string (void)
738 register str_number Result;
739 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
740 #ifdef ALLOCATESTRING
741 if(str_ptr == current_max_strings)
742 str_start = realloc_str_start(increment_max_strings);
743 if(str_ptr == current_max_strings){ /* 94/Jan/24 */
744 // printf("**********MAKESTRING**********"); // debugging only
745 overflow(258, current_max_strings - init_str_ptr); /* 97/Mar/9 */
746 return 0; // abort_flag set
749 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
750 if(str_ptr == max_strings){
751 overflow(258, max_strings - init_str_ptr); /* number of strings */
752 return 0; // abort_flag set
756 str_start[str_ptr] = pool_ptr;
757 Result = str_ptr - 1;
761 bool str_eq_buf_(str_number s, integer k)
763 register bool Result;
767 while(j < str_start[s + 1]) {
768 if(str_pool[j]!= buffer[k])
777 lab45: Result = result;
781 bool str_eq_str_(str_number s, str_number t)
783 register bool Result;
787 if((str_start[s + 1]- str_start[s])!=(str_start[t + 1]-
792 while(j < str_start[s + 1]){
793 if(str_pool[j]!= str_pool[k])
799 lab45: Result = result;
803 void print_two_(integer n)
806 print_char(48 +(n / 10));
807 print_char(48 +(n % 10));
810 void print_hex_(integer n)
814 print_char(34); /* " */
816 dig[k]= (unsigned char) (n % 16);
823 void print_roman_int_(integer n)
826 nonnegative_integer u, v;
827 j = str_start[260]; /* m2d5c2l5x2v5i */
831 print_char(str_pool[j]);
837 u = v /(str_pool[k - 1]- 48);
838 if(str_pool[k - 1]== 50)
841 u = u /(str_pool[k - 1]- 48);
845 print_char(str_pool[k]);
850 v = v /(str_pool[j - 1]- 48);
855 void print_current_string(void)
858 j = str_start[str_ptr];
859 while(j < pool_ptr) {
860 print_char(str_pool[j]);
865 int stringlength (int str_ptr)
868 nstart = str_start[ str_ptr];
869 nnext = str_start[ str_ptr + 1];
870 return (nnext - nstart) + 2;
873 char * add_string (char *s, int str_ptr)
875 int nstart, nnext, n;
876 nstart = str_start[ str_ptr];
877 nnext = str_start[ str_ptr + 1];
879 memcpy(s, &str_pool[nstart], n);
888 // make one long \r\n separated string out of help lines
889 // str_pool is packed_ASCII_code *
891 char * make_up_help_string (int nhelplines)
893 char *helpstring, *s;
896 // get length of help for this specific message
897 for (k = nhelplines-1; k >= 0; k--) {
898 nlen += stringlength(help_line[k]);
900 nlen += 2; // for blank line separator
902 nlen += stringlength(265);
903 nlen += stringlength(266);
904 nlen += stringlength(267);
905 if(base_ptr > 0)nlen += stringlength(268);
906 if(deletions_allowed)nlen += stringlength(269);
907 nlen += stringlength(270);
909 helpstring = (char *) malloc(nlen+1);
911 for (k = nhelplines-1; k >= 0; k--) {
912 s = add_string(s, help_line[k]);
917 s = add_string(s, 265); /* Type <return> to proceed, S to scroll future error messages, */
918 s = add_string(s, 266); /* R to run without stopping, Q to run quietly, */
919 s = add_string(s, 267); /* I to insert something, */
920 if(base_ptr > 0)s = add_string(s, 268); /* E to edit your file, */
921 if(deletions_allowed)s = add_string(s, 269); /* 1 or ... or 9 to ignore the next 1 to 9 tokens of input, */
922 s = add_string(s, 270); /* H for help, X to quit. */
927 char * make_up_query_string (int promptstr)
930 int nstart, nnext, n;
932 nstart = str_start[ promptstr];
933 nnext = str_start[ promptstr + 1];
935 querystr = (char *) malloc(n + 1);
937 memcpy(s, &str_pool[nstart], n);
943 // abort_flag set if input_line / ConsoleInput returns non-zero
944 // should set interrupt instead ???
945 // called from tex0.c, tex2.c, tex3.c
947 // void term_input(void)
948 void term_input (int promptstr, int nhelplines)
952 char *helpstring = NULL;
953 char *querystring = NULL;
954 // if (nhelplines != 0) {
955 // helpstring = make_up_help_string (nhelplines);
956 // printf(helpstring);
959 show_line("\n", 0); // force it to show what may be buffered up ???
962 if (promptstr != 0) querystring = make_up_query_string (promptstr);
963 if (nhelplines != 0) helpstring = make_up_help_string (nhelplines);
964 if (helpstring == NULL && querystring != NULL) {
965 if (strcmp(querystring, ": ") == 0)
966 helpstring = xstrdup("Please type another file name (or ^z to exit):");
967 else if (strcmp(querystring, "=>") == 0) // from firm_up_the_line
968 helpstring = xstrdup("Please type <enter> to accept this line\r\nor type a replacement line");
969 else if (strcmp(querystring, "insert>") == 0) // from error() after "I"
970 helpstring = xstrdup("Please type something to insert here");
971 else if (strcmp(querystring, "") == 0) // from read_toks
972 helpstring = xstrdup("Please type a control sequence");
973 else if (strcmp(querystring, "= ") == 0) // from read_toks
974 helpstring = xstrdup("Please type a token");
975 else if (strcmp(querystring, "*") == 0) // get_next
976 helpstring = xstrdup("Please type a control sequence\r\n(or ^z to exit)");
977 // else if (strcmp(querystring, "**") == 0) // init_terminal
978 // helpstring = xstrdup("Please type a control sequence or a file name\r\n(or ^z to exit)");
979 // else if (strcmp(querystring, "? ") == 0) // from error()
980 // helpstring = xstrdup("Please type a character to select an action");
982 flag = ConsoleInput(querystring, helpstring, (char *) &buffer[first]); // ???
983 // flag == 0 means trouble --- EOF on terminal
984 if (querystring != NULL) free(querystring);
985 if (helpstring != NULL) free(helpstring);
986 helpstring = querystring = NULL;
988 last = first + strlen((char *) &buffer[first]); /* -1 ? */
989 // flag = (last > first);
990 // may need to be more elaborate see input_line in texmf.c ???
991 // sprintf(log_line, "first %d last %d flag %d - %s",
992 // first, last, flag, (char *) &buffer[first]);
993 // winerror(log_line);
996 flag = input_ln(stdin, true);
999 fatal_error(261); /* End of file on the terminal! */
1000 return; // abort_flag set
1004 // echo what was typed into Console buffer also
1006 {register integer for_end; k = first; for_end = last - 1;
1009 while(k++ < for_end);
1013 decr(selector); // shut off echo
1015 {register integer for_end; k = first; for_end = last - 1;
1018 while(k++ < for_end);
1021 incr(selector); // reset selector again
1025 void int_error_ (integer n)
1029 print_char(41); /*)*/
1033 void normalize_selector (void)
1041 if (interaction == 0)
1045 void pause_for_instructions (void)
1047 if (OK_to_interrupt) {
1049 if((selector == 18)||(selector == 16))
1051 print_err("Interruption");
1053 "Try to insert some instructions for me (e.g.,`I\showlists'),",
1054 "unless you just want to quit by typing `X'.");
1055 deletions_allowed = false;
1057 deletions_allowed = true;
1062 integer half_(integer x)
1064 register integer Result;
1067 else Result = x / 2;
1071 scaled round_decimals_(small_number k)
1073 register scaled Result;
1078 a =(a + dig[k]* 131072L)/ 10; /* 2^17 */
1084 /* This has some minor speedup changes - no real advantage probably ... */
1085 void print_scaled_(scaled s)
1090 print_char(45); /* '-' */
1093 print_int(s / 65536L);
1094 print_char(46); /* '.' */
1095 s = 10 *(s % 65536L)+ 5;
1099 s = s - 17232; /* 2^15 - 50000 - rounding */
1100 print_char(48 +(s / 65536L)); /* '0' + */
1101 s = 10 *(s % 65536L);
1103 } while(!(s <= delta));
1106 scaled mult_and_add_(integer n, scaled x, scaled y, scaled maxanswer)
1108 register scaled Result;
1116 else if(((x <=(maxanswer - y)/ n)&&(- (integer) x <=(maxanswer + y)/ n)))
1125 scaled x_over_n_(scaled x, integer n)
1127 register scaled Result;
1147 tex_remainder = x % n;
1151 Result = - (integer)((- (integer) x)/ n);
1152 tex_remainder = - (integer)((- (integer) x)% n);
1156 tex_remainder = - (integer) tex_remainder;
1160 scaled xn_over_d_(scaled x, integer n, integer d)
1162 register scaled Result;
1164 nonnegative_integer t, u, v;
1172 /* t =(x % 32768L)* n; */
1174 /* u =(x / 32768L)* n +(t / 32768L); */
1175 u =(x >> 15)* n +(t >> 15);
1176 /* v =(u % d)* 32768L +(t % 32768L); */
1177 v =((u % d)<< 15)+(t & 32767L);
1180 /* else u = 32768L *(u / d)+(v / d); */
1181 else u =((u / d)<< 15)+(v / d);
1185 tex_remainder = v % d;
1189 Result = - (integer) u;
1190 tex_remainder = - (integer)(v % d);
1195 halfword badness_(scaled t, scaled s)
1197 register halfword Result;
1206 else if(s >= 1663497L)
1211 /* safe to assume that r is positive ? */
1212 /* else Result =(r * r * r + 131072L)/ 262144L; */
1213 else Result =(r * r * r + 131072L)>> 18; /* 2^17 */
1219 void print_word_(memory_word w)
1222 print_char(32); /* */
1223 print_scaled(w.cint);
1224 print_char(32); /* */
1225 print_scaled(round(65536L * w.gr));
1227 print_int(w.hh.v.LH);
1228 print_char(61); /* = */
1230 print_char(58); /* : */
1232 print_char(59); /*; */
1233 print_int(w.hh.v.RH);
1234 print_char(32); /* */
1235 print_int(w.qqqq.b0);
1236 print_char(58); /* : */
1237 print_int(w.qqqq.b1);
1238 print_char(58); /* : */
1239 print_int(w.qqqq.b2);
1240 print_char(58); /* : */
1241 print_int(w.qqqq.b3);
1244 /* need this version only if SHORTFONTINFO defined */
1246 void zprintfword(fmemoryword w)
1249 print_char(32); /* */
1250 print_scaled(w.cint);
1251 print_char(32); /* */
1252 print_scaled(round(65536L * w.gr));
1254 print_int(w.hh.v.LH);
1255 print_char(61); /* = */
1257 print_char(58); /* : */
1258 print_int(w .hh.b1);
1259 print_char(59); /*; */
1260 print_int(w.hh.v.RH);
1261 print_char(32); /* */
1262 print_int(w.qqqq.b0);
1263 print_char(58); /* : */
1264 print_int(w.qqqq.b1);
1265 print_char(58); /* : */
1266 print_int(w.qqqq.b2);
1267 print_char(58); /* : */
1268 print_int(w.qqqq.b3);
1272 void show_token_list_(integer p, integer q, integer l)
1275 ASCII_code matchchr;
1280 /* while (p<>null) and (tally<l) do l.6239 */
1281 while((p != 0)&&(tally < l)) {
1285 first_count = tally;
1286 trick_count = tally + 1 + error_line - half_error_line;
1287 if(trick_count < error_line)
1288 trick_count = error_line;
1290 if((p < hi_mem_min)||(p > mem_end))
1292 print_esc(307); /* CLOBBERED. */
1295 if(mem[p].hh.v.LH >= 4095)
1296 print_cs(mem[p].hh.v.LH - 4095);
1299 m = mem[p].hh.v.LH / 256;
1300 /* m = mem[p].hh.v.LH >> 8; */
1301 c = mem[p].hh.v.LH % 256;
1302 /* c = mem[p].hh.v.LH & 255; */
1303 if(mem[p].hh.v.LH < 0)
1304 print_esc(552); /* BAD. */
1329 print_char(33); /* ! */
1336 /* matchchr = c; */ /* keep compiler happy */
1337 matchchr = (ASCII_code) c;
1346 print(553); /* -> */
1349 print_esc(552); /* BAD. */
1355 /* if p<>null then print_esc("ETC."); l.6244 */
1357 print_esc(551); /* ETC. */
1363 if(scanner_status > 1)
1365 print_nl("Runaway "); /* */
1366 switch(scanner_status)
1369 print(567); /* definition */
1375 print(568); /* argument */
1381 print(569); /* preamble */
1387 print(570); /* text */
1392 print_char(63); /* ? */
1394 /* p may be used without being initialized -- OK */
1395 show_token_list(mem[p].hh.v.RH, 0, error_line - 10);
1399 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1400 /* first try list of available nodes (avail != NULL) */
1401 /* then see if can go upwards (mem_end < mem_max) */
1402 /* then see if can go downwards (hi_mem_min > lo_mem_max) */
1403 /* if not, extend memory at the top and grab from there --- new */
1404 /* else fail ! */ /* paragraph 120 */
1405 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1406 halfword get_avail (void)
1408 register halfword Result;
1411 if(p != 0) /* while p<>null do */
1412 avail = mem[avail].hh.v.RH;
1413 else if(mem_end < mem_max) /* mem_end + 1 < mem_max ? NO */
1421 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1422 if(hi_mem_min <= lo_mem_max){ /* have we run out in middle ? */
1423 incr(hi_mem_min); /* undo the change */
1424 /* realloc_main (0, mem_top/2); */ /* extend main memory at hi end */
1425 mem = realloc_main (0, mem_top/2); /* zzzaa = zmem = mem */
1429 /* presumably now mem_end < mem_max - but need test in case allocation fails */
1430 if (mem_end >= mem_max) {
1432 overflow(298, mem_max + 1 - mem_min); /* main memory size */
1433 return 0; // abort_flag set
1435 incr(mem_end); /* then grab from new area */
1436 p = mem_end; /* 1993/Dec/14 */
1438 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1440 mem[p].hh.v.RH = 0; /* link(p) = null !!! */
1449 void flush_list_(halfword p) /* paragraph 123 */
1452 if(p != 0) /* null !!! */
1462 } while(!(r == 0)); /* r != null */
1463 mem[q].hh.v.RH = avail;
1468 halfword get_node_(integer s)
1470 register halfword Result;
1477 q = p + mem[p].hh.v.LH;
1478 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1479 /* while((mem[q].hh.v.RH == 262143L)) { */ /* NO! */
1480 while((mem[q].hh.v.RH == empty_flag)) {
1481 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1484 /* should never happen, since this field is reference count for zeroglue */
1485 } /* debugging code 93/DEC/15 */ /* eventually remove */
1487 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1488 t = mem[q + 1].hh.v.RH;
1491 mem[t + 1].hh.v.LH = mem[q + 1].hh.v.LH;
1492 mem[mem[q + 1].hh.v.LH + 1].hh.v.RH = t;
1493 q = q + mem[q].hh.v.LH;
1496 if(r > toint(p + 1))
1498 mem[p].hh.v.LH = r - p;
1503 if(mem[p + 1].hh.v.RH != p)
1505 rover = mem[p + 1].hh.v.RH;
1506 t = mem[p + 1].hh.v.LH;
1507 mem[rover + 1].hh.v.LH = t;
1508 mem[t + 1].hh.v.RH = rover;
1511 mem[p].hh.v.LH = q - p;
1512 p = mem[p + 1].hh.v.RH;
1513 } while(!(p == rover));
1514 if(s == 1073741824L) /* 2^30 - special case - merge adjacent */
1516 /* Result = 262143L; */ /* NO ! */
1517 Result = empty_flag;
1518 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1519 if (trace_flag) show_line("Merged adjacent multi-word nodes\n", 0);
1520 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1523 /* maybe try downward epxansion first instead ? */
1524 if(lo_mem_max + 2 < hi_mem_min)
1526 /* if(lo_mem_max + 2 <= 262143L) */ /* NO! */
1527 if(lo_mem_max + 2 <= mem_bot + max_halfword) /* silly ? flush 93/Dec/16 */
1530 /* if(hi_mem_min - lo_mem_max >= 1998) */
1531 if(hi_mem_min - lo_mem_max >= (block_size + block_size - 2))
1532 /* t = lo_mem_max + 1000; */
1533 t = lo_mem_max + block_size;
1534 else t = lo_mem_max + 1 +(hi_mem_min - lo_mem_max)/ 2;
1535 p = mem[rover + 1].hh.v.LH;
1537 mem[p + 1].hh.v.RH = q;
1538 mem[rover + 1].hh.v.LH = q;
1540 /* if(t > 262143L) t = 262143L; */ /* NO! */
1541 if(t > mem_bot + max_halfword)
1542 t = mem_bot + max_halfword; /* silly ? flush 93/Dec/16 */
1544 mem[q + 1].hh.v.RH = rover;
1545 mem[q + 1].hh.v.LH = p;
1546 /* mem[q].hh.v.RH = 262143L; */ /* NO! */
1547 mem[q].hh.v.RH = empty_flag;
1548 mem[q].hh.v.LH = t - lo_mem_max; /* block size */
1550 mem[lo_mem_max].hh.v.RH = 0;
1551 mem[lo_mem_max].hh.v.LH = 0;
1555 /* overflow(298, mem_max + 1 - mem_min); */ /* what used to happen! */
1556 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1557 /* we've run out of space in the middle for variable length blocks */
1558 /* try and add new block from below mem_bot *//* first check if space ! */
1559 if (mem_min - (block_size + 1) <= mem_start) {/* extend lower memory downwards */
1560 /* realloc_main (mem_top/2, 0); */
1561 mem = realloc_main (mem_top/2 + block_size, 0); /* zzzaa = zmem = mem */
1566 /* if (trace_flag) show_line("Extending downwards by %d\n", block_size, 0); */
1567 if (mem_min - (block_size + 1) <= mem_start) { /* check again */
1569 sprintf(log_line, "mem_min %d, mem_start %d, block_size %d\n", mem_min, mem_start, block_size);
1570 show_line(log_line, 0);
1572 overflow(298, mem_max + 1 - mem_min); /* darn: allocation failed ! */
1573 return 0; // abort_flag set
1575 /* avoid function call in following ? */
1576 add_variable_space (block_size); /* now to be found in itex.c */
1577 goto lab20; /* go try get_node again */
1578 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1580 lab40: mem[r].hh.v.RH = 0;
1583 var_used = var_used + s;
1586 /* if (trace_flag) {
1587 if (r == 0) show_line("r IS ZERO in ZGETNODE!\n", 0);
1588 } */ /* debugging code 93/dec/15 */
1594 void free_node_(halfword p, halfword s)
1598 /* mem[p].hh.v.RH = 262143L; */ /* NO! */
1599 mem[p].hh.v.RH = empty_flag;
1600 q = mem[rover + 1].hh.v.LH;
1601 mem[p + 1].hh.v.LH = q;
1602 mem[p + 1].hh.v.RH = rover;
1603 mem[rover + 1].hh.v.LH = p;
1604 mem[q + 1].hh.v.RH = p;
1607 var_used = var_used - s;
1611 halfword new_null_box (void)
1613 register halfword Result;
1618 mem[p + 1].cint = 0;
1619 mem[p + 2].cint = 0;
1620 mem[p + 3].cint = 0;
1621 mem[p + 4].cint = 0;
1622 mem[p + 5].hh.v.RH = 0;
1623 mem[p + 5].hh.b0 = 0;
1624 mem[p + 5].hh.b1 = 0;
1625 mem[p + 6].gr = 0.0;
1630 // @ A new rule node is delivered by the |new_rule| function. It
1631 // makes all the dimensions ``running,'' so you have to change the
1632 // ones that are not allowed to run.
1634 halfword new_rule (void)
1636 register halfword Result;
1638 p = get_node(4); /* rule_node_size */
1639 mem[p].hh.b0 = 2; /* rule_node type */
1640 mem[p].hh.b1 = 0; /* sub_type zero */
1641 mem[p + 1].cint = -1073741824L; /* -2^30 null_flag width */
1642 mem[p + 2].cint = -1073741824L; /* -2^30 null_flag depth */
1643 mem[p + 3].cint = -1073741824L; /* -2^30 null_flag height */
1648 // @ The |new_ligature| function creates a ligature node having given
1649 // contents of the |font|, |character|, and |lig_ptr| fields.
1651 halfword new_ligature_(quarterword f, quarterword c, halfword q)
1653 register halfword Result;
1655 p = get_node(2); /* small_node_size */
1656 mem[p].hh.b0 = 6; /* ligature_node type */
1657 mem[p + 1].hh.b0 = f; /* font */
1658 mem[p + 1].hh.b1 = c; /* character */
1659 mem[p + 1].hh.v.RH = q; /* pointer */
1660 mem[p].hh.b1 = 0; /* subtype zero */
1665 // We also have a |new_lig_item| function, which returns a two-word
1666 // node having a given |character| field. Such nodes are used for
1667 // temporary processing as ligatures are being created.
1669 halfword new_lig_item_(quarterword c)
1671 register halfword Result;
1673 p = get_node(2); /* small_node_size */
1674 mem[p].hh.b1 = c; /* character */
1675 mem[p + 1].hh.v.RH = 0; /* lig_ptr(p):=null; */
1680 halfword new_disc (void)
1682 register halfword Result;
1687 mem[p + 1].hh.v.LH = 0; /* pre_break(p):=null; */
1688 mem[p + 1].hh.v.RH = 0; /* post_break(p):=null; */
1693 halfword new_math_(scaled w, small_number s)
1695 register halfword Result;
1700 mem[p + 1].cint = w;
1705 halfword new_spec_(halfword p)
1707 register halfword Result;
1712 mem[q + 1].cint = mem[p + 1].cint;
1713 mem[q + 2].cint = mem[p + 2].cint;
1714 mem[q + 3].cint = mem[p + 3].cint;
1719 halfword new_param_glue_(small_number n)
1721 register halfword Result;
1726 mem[p].hh.b1 = n + 1; /* conversion int to unsigned short */
1727 mem[p + 1].hh.v.RH = 0;
1728 q = eqtb[(hash_size + 782) + n].hh.v.RH; /* gluebase + n */
1729 mem[p + 1].hh.v.LH = q;
1730 incr(mem[q].hh.v.RH);
1735 halfword new_glue_(halfword q)
1737 register halfword Result;
1742 mem[p + 1].hh.v.RH = 0;
1743 mem[p + 1].hh.v.LH = q;
1744 incr(mem[q].hh.v.RH);
1749 halfword new_skip_param_(small_number n)
1751 register halfword Result;
1753 temp_ptr = new_spec(eqtb[(hash_size + 782) + n].hh.v.RH); /* gluebase + n */
1754 p = new_glue(temp_ptr);
1755 mem[temp_ptr].hh.v.RH = 0;
1756 mem[p].hh.b1 = n + 1; /* conversion int to unsigned short */
1761 halfword new_kern_(scaled w)
1763 register halfword Result;
1768 mem[p + 1].cint = w;
1773 halfword new_penalty_(integer m)
1775 register halfword Result;
1780 mem[p + 1].cint = m;
1786 void check_mem_(bool printlocs)
1790 {register integer for_end; p = mem_min; for_end = lo_mem_max; if(p <=
1793 while(p++ < for_end); }
1794 {register integer for_end; p = hi_mem_min; for_end = mem_end; if(p <=
1797 while(p++ < for_end); }
1801 while(p != 0){ /* while p<>null do */
1803 if((p > mem_end)||(p < hi_mem_min))
1809 print_nl("AVAIL list clobbered at "); /* */
1819 q = 0; /* q:=null */
1822 if((p >= lo_mem_max)||(p < mem_min))
1824 else if((mem[p + 1].hh.v.RH >= lo_mem_max)||(mem[p + 1].hh
1827 /* else if(!((mem[p].hh.v.RH == 262143L)) ||(mem[p].hh *//*NO!*/
1828 else if(!((mem[p].hh.v.RH == empty_flag)) ||(mem[p].hh
1829 .v.LH < 2)||(p + mem[p].hh.v.LH > lo_mem_max)||(mem[mem[p +
1830 1].hh.v.RH + 1].hh.v.LH != p))
1834 print_nl("Double-AVAIL list clobbered at "); /* */
1838 {register integer for_end; q = p; for_end = p + mem[p].hh.v.LH - 1
1839 ; if(q <= for_end) do
1843 print_nl("Doubly free location at "); /* */
1849 while(q++ < for_end); }
1851 p = mem[p + 1].hh.v.RH;
1852 } while(!(p == rover));
1855 while(p <= lo_mem_max){
1857 /* if((mem[p].hh.v.RH == 262143L)) */ /* NO! */
1858 if((mem[p].hh.v.RH == empty_flag))
1860 print_nl("Bad flag at "); /* */
1863 while((p <= lo_mem_max)&& ! freearr[p])incr(p);
1864 while((p <= lo_mem_max)&& freearr[p])incr(p);
1868 print_nl("New busy locs:"); /* */
1869 {register integer for_end; p = mem_min; for_end = lo_mem_max; if(p <=
1871 if(! freearr[p]&&((p > waslomax)|| wasfree[p]))
1873 print_char(32); /* */
1876 while(p++ < for_end); }
1877 {register integer for_end; p = hi_mem_min; for_end = mem_end; if(p <=
1879 if(! freearr[p]&&((p < washimin)||(p > wasmemend)||
1882 print_char(32); /* */
1885 while(p++ < for_end); }
1887 {register integer for_end; p = mem_min; for_end = lo_mem_max; if(p <=
1889 wasfree[p]= freearr[p];
1890 while(p++ < for_end); }
1891 {register integer for_end; p = hi_mem_min; for_end = mem_end; if(p <=
1893 wasfree[p]= freearr[p];
1894 while(p++ < for_end); }
1895 wasmemend = mem_end;
1896 waslomax = lo_mem_max;
1897 washimin = hi_mem_min;
1902 void search_mem_(halfword p)
1905 {register integer for_end; q = mem_min; for_end = lo_mem_max; if(q <=
1908 if(mem[q].hh.v.RH == p)
1910 print_nl("LINK("); /* */
1912 print_char(41); /*)*/
1914 if(mem[q].hh.v.LH == p)
1916 print_nl("INFO("); /* */
1918 print_char(41); /*)*/
1921 while(q++ < for_end); }
1922 {register integer for_end; q = hi_mem_min; for_end = mem_end; if(q <=
1925 if(mem[q].hh.v.RH == p)
1927 print_nl("LINK("); /* */
1929 print_char(41); /*)*/
1931 if(mem[q].hh.v.LH == p)
1933 print_nl("INFO("); /* */
1935 print_char(41); /*)*/
1938 while(q++ < for_end); }
1939 {register integer for_end; q = 1; for_end = (hash_size + 1833); if(q <= for_end) do
1941 if(eqtb[q].hh.v.RH == p)
1943 print_nl("EQUIV("); /* */
1945 print_char(41); /*)*/
1948 while(q++ < for_end); }
1950 {register integer for_end; q = 0; for_end = save_ptr - 1; if(q <=
1953 if(save_stack[q].hh.v.RH == p)
1955 print_nl("SAVE("); /* */
1957 print_char(41); /*)*/
1960 while(q++ < for_end); }
1961 /* {register integer for_end; q = 0; for_end = 607; if(q <= for_end) do */
1962 {register integer for_end; q = 0; for_end = hyphen_prime; if(q <= for_end) do
1964 if(hyph_list[q]== p)
1968 print_char(41); /*)*/
1971 while(q++ < for_end); }
1975 void short_display_(integer p)
1978 /* while(p > mem_min){ */
1979 while(p != 0){ /* want p != null here bkph 93/Dec/15 !!! */
1980 /* NOTE: still not fixed in 3.14159 ! */
1981 if((p >= hi_mem_min)) /* is_char_node(p) */
1985 if(mem[p].hh.b0 != font_in_short_display) /* font(p) */
1987 if((mem[p].hh.b0 > font_max))
1988 print_char(42); /* * */
1989 /* else print_esc(hash[(hash_size + 524) + mem[p].hh.b0].v.RH); */
1990 else print_esc(hash[(hash_size + hash_extra + 524) + mem[p].hh.b0].v.RH);
1992 print_char(32); /* */
1993 font_in_short_display = mem[p].hh.b0;
1995 print(mem[p].hh.b1); /* character(p) */
1998 else switch(mem[p].hh.b0)
2006 print(306); /* [] */
2009 print_char(124); /* | */
2012 if(mem[p + 1].hh.v.LH != 0)
2013 print_char(32); /* */
2016 print_char(36); /* $ */
2019 short_display(mem[p + 1].hh.v.RH);
2023 short_display(mem[p + 1].hh.v.LH);
2024 short_display(mem[p + 1].hh.v.RH);
2028 if(mem[p].hh.v.RH != 0) /* if link(p)<>null then */
2042 void print_font_and_char_ (integer p)
2045 print_esc(307); /* CLOBBERED. */
2047 if((mem[p].hh.b0 > font_max)) /* font(p) */
2048 print_char(42); /* * */
2049 /* else print_esc(hash[(hash_size + 524) + mem[p].hh.b0].v.RH); */
2051 print_esc(hash[(hash_size + hash_extra + 524) + mem[p].hh.b0].v.RH); /* 96/Jan/10 */
2052 print_char(32); /* */
2053 print(mem[p].hh.b1); /* character(p) */
2057 void print_mark_ (integer p)
2059 print_char(123); /* { */
2060 if((p < hi_mem_min)||(p > mem_end))
2061 print_esc(307); /* CLOBBERED. */
2062 else show_token_list(mem[p].hh.v.RH, 0, max_print_line - 10);
2063 print_char(125); /* } */
2066 void print_rule_dimen_ (scaled d)
2068 if((d == -1073741824L)) /* - 2^30 */
2069 print_char(42); /* * */
2074 void print_glue_(scaled d, integer order, str_number s)
2077 if((order < 0)||(order > 3))
2078 print(308); /* foul */
2081 print(309); /* fil */
2084 print_char(108); /* l */
2092 void print_spec_(integer p, str_number s)
2094 if((p < mem_min)||(p >= lo_mem_max))
2095 print_char(42); /* * */
2097 print_scaled(mem[p + 1].cint);
2100 if(mem[p + 2].cint != 0)
2102 print(310); /* plus */
2103 print_glue(mem[p + 2].cint, mem[p].hh.b0, s);
2105 if(mem[p + 3].cint != 0)
2107 print(311); /* minus */
2108 print_glue(mem[p + 3].cint, mem[p].hh.b1, s);
2113 void print_fam_and_char_(halfword p)
2115 print_esc(461); /* fam */
2116 print_int(mem[p].hh.b0);
2117 print_char(32); /* */
2118 print(mem[p].hh.b1);
2121 void print_delimiter_(halfword p)
2124 a = mem[p].qqqq.b0 * 256 + mem[p].qqqq.b1;
2125 a = a * 4096 + mem[p].qqqq.b2 * 256 + mem[p].qqqq.b3;
2131 void print_subsidiary_data_(halfword p, ASCII_code c)
2133 if((pool_ptr - str_start[str_ptr]) >= depth_threshold)
2135 if(mem[p].hh.v.RH != 0)
2136 print(312); /* [] */
2141 str_pool[pool_ptr]= c;
2145 switch(mem[p].hh.v.RH)
2149 print_current_string ();
2150 print_fam_and_char(p);
2157 if(mem[p].hh.v.LH == 0)
2160 print_current_string ();
2161 print(854); /* {} */
2173 void print_style_(integer c)
2177 print_esc(855); /* displaystyle */
2180 print_esc(856); /* textstyle */
2183 print_esc(857); /* scriptstyle */
2186 print_esc(858); /* scriptscriptstyle */
2189 print(859); /* Unknown */
2194 void print_skip_param_(integer n)
2198 print_esc(373); /* lineskip */
2201 print_esc(374); /* baselineskip */
2204 print_esc(375); /* parskip */
2207 print_esc(376); /* abovedisplayskip */
2210 print_esc(377); /* belowdisplayskip */
2213 print_esc(378); /* abovedisplayshortskip */
2216 print_esc(379); /* belowdisplayshortskip */
2219 print_esc(380); /* leftskip */
2222 print_esc(381); /* rightskip */
2225 print_esc(382); /* topskip */
2228 print_esc(383); /* splittopskip */
2231 print_esc(384); /* tabskip */
2234 print_esc(385); /* spaceskip */
2237 print_esc(386); /* xspaceskip */
2240 print_esc(387); /* parfillskip */
2243 print_esc(388); /* thinmuskip */
2246 print_esc(389); /* medmuskip */
2249 print_esc(390); /* thickmuskip */
2252 print(391); /* [unknown glue parameter!] */
2257 void show_node_list_(integer p)
2261 /* begin if cur_length>depth_threshold then */
2262 if((pool_ptr - str_start[str_ptr])> depth_threshold)
2264 /* if(p > 0) */ /* was p>null !!! line 3662 in tex.web */
2265 if(p != 0) /* fixed 94/Mar/23 BUG FIX */
2266 /* NOTE: still not fixed in 3.14159 ! */
2267 print(312); /* [] */
2271 /* while(p > mem_min){ */ /* was p>mem_min !!! line 3667 in tex.web */
2272 while(p != 0){ /* want p != null - bkph 93/Dec/15 */
2273 /* NOTE: still not fixed in 3.14159 ! */
2275 print_current_string ();
2278 print(313); /* Bad link, display aborted. */
2284 print(314); /* etc. */
2287 if((p >= hi_mem_min))
2288 print_font_and_char(p);
2289 else switch(mem[p].hh.b0)
2294 if(mem[p].hh.b0 == 0)
2295 print_esc(104); /* h */
2296 else if(mem[p].hh.b0 == 1)
2297 print_esc(118); /* v */
2298 else print_esc(316); /* unset */
2299 print(317); /* box(*/
2300 print_scaled(mem[p + 3].cint);
2301 print_char(43); /* + */
2302 print_scaled(mem[p + 2].cint);
2303 print(318); /*, shifted */
2304 print_scaled(mem[p + 1].cint);
2305 if(mem[p].hh.b0 == 13)
2307 if(mem[p].hh.b1 != 0)
2310 print_int(mem[p].hh.b1 + 1);
2311 print(320); /* columns) */
2313 if(mem[p + 6].cint != 0)
2315 print(321); /*, stretch */
2316 print_glue(mem[p + 6].cint, mem[p + 5].hh.b1, 0);
2318 if(mem[p + 4].cint != 0)
2320 print(322); /*, shrink */
2321 print_glue(mem[p + 4].cint, mem[p + 5].hh.b0, 0);
2327 if((g != 0.0)&&(mem[p + 5].hh.b0 != 0))
2329 print(323); /*, glue set */
2330 if(mem[p + 5].hh.b0 == 2)
2332 if(fabs(g)> 20000.0)
2335 print_char(62); /* '>' */
2336 else print(325); /* < - */
2337 print_glue(20000 * 65536L, mem[p + 5].hh.b1, 0);
2339 else print_glue(round(65536L * g), mem[p + 5].hh.b1, 0)
2342 if(mem[p + 4].cint != 0)
2344 print(319); /* shifted */
2345 print_scaled(mem[p + 4].cint);
2350 str_pool[pool_ptr]= 46;
2353 show_node_list(mem[p + 5].hh.v.RH);
2360 print_esc(326); /* rule(*/
2361 print_rule_dimen(mem[p + 3].cint);
2362 print_char(43); /* '+' */
2363 print_rule_dimen(mem[p + 2].cint);
2365 print_rule_dimen(mem[p + 1].cint);
2370 print_esc(327); /* insert */
2371 print_int(mem[p].hh.b1);
2372 print(328); /*, natural size */
2373 print_scaled(mem[p + 3].cint);
2374 print(329); /*; split(*/
2375 print_spec(mem[p + 4].hh.v.RH, 0);
2376 print_char(44); /* ',' */
2377 print_scaled(mem[p + 2].cint);
2378 print(330); /* (; float cost */
2379 print_int(mem[p + 1].cint);
2382 str_pool[pool_ptr]= 46;
2385 show_node_list(mem[p + 4].hh.v.LH);
2391 switch(mem[p].hh.b1)
2394 print_write_whatsit(1279, p); /* debug # (-1 to exit): */
2395 print_char(61); /* = */
2396 print_file_name(mem[p + 1].hh.v.RH, mem[p + 2].hh.v.LH,
2397 mem[p + 2].hh.v.RH);
2402 print_write_whatsit(591, p); /* write */
2403 print_mark(mem[p + 1].hh.v.RH);
2407 print_write_whatsit(1280, p); /* closeout */
2411 print_esc(1281); /* special */
2412 print_mark(mem[p + 1].hh.v.RH);
2417 print_esc(1283); /* setlanguage */
2418 print_int(mem[p + 1].hh.v.RH);
2419 print(1286); /* (hyphenmin */
2420 print_int(mem[p + 1].hh.b0);
2421 print_char(44); /*, */
2422 print_int(mem[p + 1].hh.b1);
2423 print_char(41); /*)*/
2427 print(1287); /* whatsit */
2432 if(mem[p].hh.b1 >= 100)
2434 print_esc(335); /* */
2435 if(mem[p].hh.b1 == 101)
2436 print_char(99); /* c */
2437 else if(mem[p].hh.b1 == 102)
2438 print_char(120); /* x */
2439 print(336); /* leaders */
2440 print_spec(mem[p + 1].hh.v.LH, 0);
2443 str_pool[pool_ptr]= 46;
2446 show_node_list(mem[p + 1].hh.v.RH);
2452 print_esc(331); /* glue */
2453 if(mem[p].hh.b1 != 0)
2455 print_char(40); /*(*/
2456 if(mem[p].hh.b1 < 98)
2457 print_skip_param(mem[p].hh.b1 - 1);
2458 else if(mem[p].hh.b1 == 98)
2459 print_esc(332); /* nonscript */
2460 else print_esc(333); /* mskip */
2461 print_char(41); /*)*/
2463 if(mem[p].hh.b1 != 98)
2465 print_char(32); /* */
2466 if(mem[p].hh.b1 < 98)
2467 print_spec(mem[p + 1].hh.v.LH, 0);
2468 else print_spec(mem[p + 1].hh.v.LH, 334); /* mu */
2473 if(mem[p].hh.b1 != 99)
2475 print_esc(337); /* kern */
2476 if(mem[p].hh.b1 != 0)
2477 print_char(32); /* */
2478 print_scaled(mem[p + 1].cint);
2479 if(mem[p].hh.b1 == 2)
2480 print(338); /* (for accent) */
2483 print_esc(339); /* mkern */
2484 print_scaled(mem[p + 1].cint);
2485 print(334); /* mu */
2490 print_esc(340); /* math */
2491 if(mem[p].hh.b1 == 0)
2492 print(341); /* on */
2493 else print(342); /* off */
2494 if(mem[p + 1].cint != 0)
2496 print(343); /*, surrounded */
2497 print_scaled(mem[p + 1].cint);
2503 print_font_and_char(p + 1);
2504 print(344); /* (ligature */
2505 if(mem[p].hh.b1 > 1)
2506 print_char(124); /* | */
2507 font_in_short_display = mem[p + 1].hh.b0;
2508 short_display(mem[p + 1].hh.v.RH);
2509 if(odd(mem[p].hh.b1))
2510 print_char(124); /* | */
2511 print_char(41); /*)*/
2516 print_esc(345); /* penalty */
2517 print_int(mem[p + 1].cint);
2522 print_esc(346); /* discretionary */
2523 if(mem[p].hh.b1 > 0)
2525 print(347); /* replacing */
2526 print_int(mem[p].hh.b1);
2530 str_pool[pool_ptr]= 46;
2533 show_node_list(mem[p + 1].hh.v.LH);
2537 str_pool[pool_ptr]= 124;
2540 show_node_list(mem[p + 1].hh.v.RH);
2546 print_esc(348); /* mark */
2547 print_mark(mem[p + 1].cint);
2552 print_esc(349); /* vadjust */
2555 str_pool[pool_ptr]= 46;
2558 show_node_list(mem[p + 1].cint);
2564 print_style(mem[p].hh.b1);
2568 print_esc(522); /* mathchoice */
2570 str_pool[pool_ptr]= 68;
2573 show_node_list(mem[p + 1].hh.v.LH);
2576 str_pool[pool_ptr]= 84;
2579 show_node_list(mem[p + 1].hh.v.RH);
2582 str_pool[pool_ptr]= 83;
2585 show_node_list(mem[p + 2].hh.v.LH);
2588 str_pool[pool_ptr]= 115;
2591 show_node_list(mem[p + 2].hh.v.RH);
2611 switch(mem[p].hh.b0)
2613 print_esc(860); /* mathord */
2616 print_esc(861); /* mathop */
2619 print_esc(862); /* mathbin */
2622 print_esc(863); /* mathrel */
2625 print_esc(864); /* mathopen */
2628 print_esc(865); /* mathclose */
2631 print_esc(866); /* mathpunct */
2634 print_esc(867); /* mathinner */
2637 print_esc(868); /* overline */
2640 print_esc(869); /* underline */
2643 print_esc(536); /* vcenter */
2647 print_esc(530); /* radical */
2648 print_delimiter(p + 4);
2653 print_esc(505); /* accent */
2654 print_fam_and_char(p + 4);
2659 print_esc(870); /* left */
2660 print_delimiter(p + 1);
2665 print_esc(871); /* right */
2666 print_delimiter(p + 1);
2670 if(mem[p].hh.b1 != 0)
2671 if(mem[p].hh.b1 == 1)
2672 print_esc(872); /* limits */
2673 else print_esc(873); /* nolimits */
2674 if(mem[p].hh.b0 < 30)
2675 print_subsidiary_data(p + 1, 46);
2676 print_subsidiary_data(p + 2, 94);
2677 print_subsidiary_data(p + 3, 95);
2682 print_esc(874); /* fraction */
2683 if(mem[p + 1].cint == 1073741824L) /* 2^30 */
2684 print(875); /* = default */
2685 else print_scaled(mem[p + 1].cint);
2686 if((mem[p + 4].qqqq.b0 != 0)||(mem[p + 4].qqqq.b1 !=
2687 0)||(mem[p + 4].qqqq.b2 != 0)||(mem[p + 4].qqqq.b3
2690 print(876); /*, left */
2691 print_delimiter(p + 4);
2693 if((mem[p + 5].qqqq.b0 != 0)||(mem[p + 5].qqqq.b1 !=
2694 0)||(mem[p + 5].qqqq.b2 != 0)||(mem[p + 5].qqqq.b3
2697 print(877); /*, right */
2698 print_delimiter(p + 5);
2700 print_subsidiary_data(p + 2, 92);
2701 print_subsidiary_data(p + 3, 47);
2705 print(315); /* Unknown node type! */
2712 /* NOTE: 262143L should be empty_flag */