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_(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]);
505 } while(!(help_ptr == 0));
507 help4("Sorry, I already gave what help I could...",
508 "Maybe you should try asking a human?",
509 "An error might have occurred before I noticed any problems.",
510 "``If all else fails, read the instructions.''");
511 goto lab22; /* loop again */
516 begin_file_reading ();
519 cur_input.loc_field = first + 1;
525 print(276); /* insert> */
528 cur_input.loc_field = first;
531 cur_input.limit_field = last - 1;
535 case 81 : /* Q, R, S */
540 interaction = 0 + c - 81; /* Q = 0, R = 1, S = 2, T = 3 */
541 print(271); /* OK, entering */
545 print_esc("batchmode"); /* */
550 print_esc("nonstopmode"); /* */
553 print_esc("scrollmode"); /* */
556 print(275); /* ... */
568 // return; // can drop through now 99/Oct/20
574 } /* end of switch analysing response character */
576 print(265); /* Type <return> to proceed, S to scroll future error messages, */
577 print_nl("R to run without stopping, Q to run quietly,"); /* */
578 print_nl("I to insert something, "); /* */
579 if (base_ptr > 0) print(268); /* E to edit your file, */
580 if(deletions_allowed) print_nl("1 or ... or 9 to ignore the next 1 to 9 tokens of input,"); /* */
581 print_nl("H for help, X to quit."); /* */
583 } /* end of while(true) loop */
586 if(error_count == 100) {
587 print_nl("(That makes 100 errors; please try again.)");
590 // return; // can drop through now 99/Oct/20
592 if(interaction > 0) decr(selector);
597 else while(help_ptr > 0){
599 print_nl(help_line[help_ptr]);
602 if(interaction > 0)incr(selector);
606 void fatal_error_(char * s)
608 normalize_selector ();
609 print_err("Emergency stop");
612 if(interaction == 3)interaction = 2;
618 if(interaction > 0)debug_help ();
622 // return; // can drop through now 99/Oct/20
626 void overflow_(str_number s, integer n)
628 normalize_selector ();
629 print_err("TeX capacity exceeded, sorry[");
631 print_char(61); /* '=' */
633 print_char(93); /* ']' */
634 help2("If you really absolutely need more capacity,",
635 "you can ask a wizard to enlarge me.");
636 if (! knuth_flag) { /* Additional comments 98/Jan/5 */
637 if (s == 945 && n == trie_size) {
638 sprintf(log_line, "\n (Maybe use -h=... on command line in ini-TeX)\n");
639 show_line(log_line, 0);
641 else if (s == 942 && n == hyphen_prime) {
642 sprintf(log_line, "\n (Maybe use -e=... on command line in ini-TeX)\n");
643 show_line(log_line, 0);
646 if(interaction == 3)interaction = 2;
652 if(interaction > 0)debug_help ();
656 // return; // can drop through now 99/Oct/20
659 void confusion_(str_number s)
661 normalize_selector ();
663 print_err("This can't happen(");
665 print_char(41); /*)*/
666 help1("I'm broken. Please show this to someone who can fix can fix");
669 print_err("I can't go on meeting you like this");
670 help2("One of your faux pas seems to have wounded me deeply...",
671 "in fact, I'm barely conscious. Please fix it and try again.");
674 if(interaction == 3)interaction = 2;
680 if(interaction > 0)debug_help ();
684 // return; // can drop through now 99/Oct/20
688 bool init_terminal (void)
690 register bool Result;
695 cur_input.loc_field = first;
696 while((cur_input.loc_field < last) && (buffer[cur_input.loc_field]== ' '))
697 incr(cur_input.loc_field); // step over initial white space
698 if(cur_input.loc_field < last){
700 return Result; // there is an input file name
704 // failed to find input file name
708 flag = ConsoleInput("**",
709 "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;
1350 print(553); /* -> */
1353 print_esc("BAD. "); /* */
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(567); /* definition */
1379 print(568); /* argument */
1385 print(569); /* preamble */
1391 print(570); /* text */
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 */
1807 if((p > mem_end)||(p < hi_mem_min))
1813 print_nl("AVAIL list clobbered at "); /* */
1823 q = 0; /* q:=null */
1826 if((p >= lo_mem_max)||(p < mem_min))
1828 else if((mem[p + 1].hh.v.RH >= lo_mem_max)||(mem[p + 1].hh
1831 /* else if(!((mem[p].hh.v.RH == 262143L)) ||(mem[p].hh *//*NO!*/
1832 else if(!((mem[p].hh.v.RH == empty_flag)) ||(mem[p].hh
1833 .v.LH < 2)||(p + mem[p].hh.v.LH > lo_mem_max)||(mem[mem[p +
1834 1].hh.v.RH + 1].hh.v.LH != p))
1838 print_nl("Double-AVAIL list clobbered at "); /* */
1842 {register integer for_end; q = p; for_end = p + mem[p].hh.v.LH - 1
1843 ; if(q <= for_end) do
1847 print_nl("Doubly free location at "); /* */
1853 while(q++ < for_end); }
1855 p = mem[p + 1].hh.v.RH;
1856 } while(!(p == rover));
1859 while(p <= lo_mem_max){
1861 /* if((mem[p].hh.v.RH == 262143L)) */ /* NO! */
1862 if((mem[p].hh.v.RH == empty_flag))
1864 print_nl("Bad flag at "); /* */
1867 while((p <= lo_mem_max)&& ! freearr[p])incr(p);
1868 while((p <= lo_mem_max)&& freearr[p])incr(p);
1872 print_nl("New busy locs:"); /* */
1873 {register integer for_end; p = mem_min; for_end = lo_mem_max; if(p <=
1875 if(! freearr[p]&&((p > waslomax)|| wasfree[p]))
1877 print_char(32); /* */
1880 while(p++ < for_end); }
1881 {register integer for_end; p = hi_mem_min; for_end = mem_end; if(p <=
1883 if(! freearr[p]&&((p < washimin)||(p > wasmemend)||
1886 print_char(32); /* */
1889 while(p++ < for_end); }
1891 {register integer for_end; p = mem_min; for_end = lo_mem_max; if(p <=
1893 wasfree[p]= freearr[p];
1894 while(p++ < for_end); }
1895 {register integer for_end; p = hi_mem_min; for_end = mem_end; if(p <=
1897 wasfree[p]= freearr[p];
1898 while(p++ < for_end); }
1899 wasmemend = mem_end;
1900 waslomax = lo_mem_max;
1901 washimin = hi_mem_min;
1906 void search_mem_(halfword p)
1909 {register integer for_end; q = mem_min; for_end = lo_mem_max; if(q <=
1912 if(mem[q].hh.v.RH == p)
1914 print_nl("LINK("); /* */
1916 print_char(41); /*)*/
1918 if(mem[q].hh.v.LH == p)
1920 print_nl("INFO("); /* */
1922 print_char(41); /*)*/
1925 while(q++ < for_end); }
1926 {register integer for_end; q = hi_mem_min; for_end = mem_end; if(q <=
1929 if(mem[q].hh.v.RH == p)
1931 print_nl("LINK("); /* */
1933 print_char(41); /*)*/
1935 if(mem[q].hh.v.LH == p)
1937 print_nl("INFO("); /* */
1939 print_char(41); /*)*/
1942 while(q++ < for_end); }
1943 {register integer for_end; q = 1; for_end = (hash_size + 1833); if(q <= for_end) do
1945 if(eqtb[q].hh.v.RH == p)
1947 print_nl("EQUIV("); /* */
1949 print_char(41); /*)*/
1952 while(q++ < for_end); }
1954 {register integer for_end; q = 0; for_end = save_ptr - 1; if(q <=
1957 if(save_stack[q].hh.v.RH == p)
1959 print_nl("SAVE("); /* */
1961 print_char(41); /*)*/
1964 while(q++ < for_end); }
1965 /* {register integer for_end; q = 0; for_end = 607; if(q <= for_end) do */
1966 {register integer for_end; q = 0; for_end = hyphen_prime; if(q <= for_end) do
1968 if(hyph_list[q]== p)
1972 print_char(41); /*)*/
1975 while(q++ < for_end); }
1979 void short_display_(integer p)
1982 /* while(p > mem_min){ */
1983 while(p != 0){ /* want p != null here bkph 93/Dec/15 !!! */
1984 /* NOTE: still not fixed in 3.14159 ! */
1985 if((p >= hi_mem_min)) /* is_char_node(p) */
1989 if(mem[p].hh.b0 != font_in_short_display) /* font(p) */
1991 if((mem[p].hh.b0 > font_max))
1992 print_char(42); /* * */
1993 /* else print_esc(hash[(hash_size + 524) + mem[p].hh.b0].v.RH); */
1994 else //print_esc(hash[(hash_size + hash_extra + 524) + mem[p].hh.b0].v.RH);
1995 print_esc("");print(hash[(hash_size + hash_extra + 524) + mem[p].hh.b0].v.RH);
1997 print_char(32); /* */
1998 font_in_short_display = mem[p].hh.b0;
2000 print(mem[p].hh.b1); /* character(p) */
2003 else switch(mem[p].hh.b0)
2011 print(306); /* [] */
2014 print_char(124); /* | */
2017 if(mem[p + 1].hh.v.LH != 0)
2018 print_char(32); /* */
2021 print_char(36); /* $ */
2024 short_display(mem[p + 1].hh.v.RH);
2028 short_display(mem[p + 1].hh.v.LH);
2029 short_display(mem[p + 1].hh.v.RH);
2033 if(mem[p].hh.v.RH != 0) /* if link(p)<>null then */
2047 void print_font_and_char_ (integer p)
2050 print_esc("CLOBBERED.");
2052 if((mem[p].hh.b0 > font_max)) /* font(p) */
2053 print_char(42); /* * */
2054 /* else print_esc(hash[(hash_size + 524) + mem[p].hh.b0].v.RH); */
2056 //print_esc(hash[(hash_size + hash_extra + 524) + mem[p].hh.b0].v.RH); /* 96/Jan/10 */
2057 {print_esc("");print(hash[(hash_size + hash_extra + 524) + mem[p].hh.b0].v.RH);}
2058 print_char(32); /* */
2059 print(mem[p].hh.b1); /* character(p) */
2063 void print_mark_ (integer p)
2065 print_char(123); /* { */
2066 if((p < hi_mem_min)||(p > mem_end))
2067 print_esc("CLOBBERED.");
2068 else show_token_list(mem[p].hh.v.RH, 0, max_print_line - 10);
2069 print_char(125); /* } */
2072 void print_rule_dimen_ (scaled d)
2074 if((d == -1073741824L)) /* - 2^30 */
2075 print_char(42); /* * */
2080 void print_glue_(scaled d, integer order, str_number s)
2083 if((order < 0)||(order > 3))
2084 print(308); /* foul */
2087 print(309); /* fil */
2090 print_char(108); /* l */
2098 void print_spec_(integer p, str_number s)
2100 if((p < mem_min)||(p >= lo_mem_max))
2101 print_char(42); /* * */
2103 print_scaled(mem[p + 1].cint);
2106 if(mem[p + 2].cint != 0)
2108 print(310); /* plus */
2109 print_glue(mem[p + 2].cint, mem[p].hh.b0, s);
2111 if(mem[p + 3].cint != 0)
2113 print(311); /* minus */
2114 print_glue(mem[p + 3].cint, mem[p].hh.b1, s);
2119 void print_fam_and_char_(halfword p)
2122 print_int(mem[p].hh.b0);
2123 print_char(32); /* */
2124 print(mem[p].hh.b1);
2127 void print_delimiter_(halfword p)
2130 a = mem[p].qqqq.b0 * 256 + mem[p].qqqq.b1;
2131 a = a * 4096 + mem[p].qqqq.b2 * 256 + mem[p].qqqq.b3;
2137 void print_subsidiary_data_(halfword p, ASCII_code c)
2139 if((pool_ptr - str_start[str_ptr]) >= depth_threshold)
2141 if(mem[p].hh.v.RH != 0)
2142 print(312); /* [] */
2147 str_pool[pool_ptr]= c;
2151 switch(mem[p].hh.v.RH)
2155 print_current_string ();
2156 print_fam_and_char(p);
2163 if(mem[p].hh.v.LH == 0)
2166 print_current_string ();
2167 print(854); /* {} */
2179 void print_style_(integer c)
2183 print_esc("displaystyle");
2186 print_esc("textstyle");
2189 print_esc("scriptstyle");
2192 print_esc("scriptscriptstyle");
2200 void print_skip_param_(integer n)
2204 print_esc("lineskip");
2207 print_esc("baselineskip");
2210 print_esc("parskip");
2213 print_esc("abovedisplayskip");
2216 print_esc("belowdisplayskip");
2219 print_esc("abovedisplayshortskip");
2222 print_esc("belowdisplayshortskip");
2225 print_esc("leftskip");
2228 print_esc("rightskip");
2231 print_esc("topskip");
2234 print_esc("splittopskip");
2237 print_esc("tabskip");
2240 print_esc("spaceskip");
2243 print_esc("xspaceskip");
2246 print_esc("parfillskip");
2249 print_esc("thinmuskip");
2252 print_esc("medmuskip");
2255 print_esc("thickmuskip");
2258 print(391); /* [unknown glue parameter!] */
2263 void show_node_list_(integer p)
2267 /* begin if cur_length>depth_threshold then */
2268 if((pool_ptr - str_start[str_ptr])> depth_threshold)
2270 /* if(p > 0) */ /* was p>null !!! line 3662 in tex.web */
2271 if(p != 0) /* fixed 94/Mar/23 BUG FIX */
2272 /* NOTE: still not fixed in 3.14159 ! */
2273 print(312); /* [] */
2277 /* while(p > mem_min){ */ /* was p>mem_min !!! line 3667 in tex.web */
2278 while(p != 0){ /* want p != null - bkph 93/Dec/15 */
2279 /* NOTE: still not fixed in 3.14159 ! */
2281 print_current_string ();
2284 print(313); /* Bad link, display aborted. */
2290 print(314); /* etc. */
2293 if((p >= hi_mem_min))
2294 print_font_and_char(p);
2295 else switch(mem[p].hh.b0)
2300 if(mem[p].hh.b0 == 0)
2302 else if(mem[p].hh.b0 == 1)
2304 else print_esc("unset");
2305 print(317); /* box(*/
2306 print_scaled(mem[p + 3].cint);
2307 print_char(43); /* + */
2308 print_scaled(mem[p + 2].cint);
2309 print(318); /*, shifted */
2310 print_scaled(mem[p + 1].cint);
2311 if(mem[p].hh.b0 == 13)
2313 if(mem[p].hh.b1 != 0)
2316 print_int(mem[p].hh.b1 + 1);
2317 print(320); /* columns) */
2319 if(mem[p + 6].cint != 0)
2321 print(321); /*, stretch */
2322 print_glue(mem[p + 6].cint, mem[p + 5].hh.b1, 0);
2324 if(mem[p + 4].cint != 0)
2326 print(322); /*, shrink */
2327 print_glue(mem[p + 4].cint, mem[p + 5].hh.b0, 0);
2333 if((g != 0.0)&&(mem[p + 5].hh.b0 != 0))
2335 print(323); /*, glue set */
2336 if(mem[p + 5].hh.b0 == 2)
2338 if(fabs(g)> 20000.0)
2341 print_char(62); /* '>' */
2342 else print(325); /* < - */
2343 print_glue(20000 * 65536L, mem[p + 5].hh.b1, 0);
2345 else print_glue(round(65536L * g), mem[p + 5].hh.b1, 0)
2348 if(mem[p + 4].cint != 0)
2350 print(319); /* shifted */
2351 print_scaled(mem[p + 4].cint);
2356 str_pool[pool_ptr]= 46;
2359 show_node_list(mem[p + 5].hh.v.RH);
2367 print_rule_dimen(mem[p + 3].cint);
2368 print_char(43); /* '+' */
2369 print_rule_dimen(mem[p + 2].cint);
2371 print_rule_dimen(mem[p + 1].cint);
2376 print_esc("insert");
2377 print_int(mem[p].hh.b1);
2378 print(328); /*, natural size */
2379 print_scaled(mem[p + 3].cint);
2380 print(329); /*; split(*/
2381 print_spec(mem[p + 4].hh.v.RH, 0);
2382 print_char(44); /* ',' */
2383 print_scaled(mem[p + 2].cint);
2384 print(330); /* (; float cost */
2385 print_int(mem[p + 1].cint);
2388 str_pool[pool_ptr]= 46;
2391 show_node_list(mem[p + 4].hh.v.LH);
2397 switch(mem[p].hh.b1)
2400 print_write_whatsit(1279, p); /* debug # (-1 to exit): */
2401 print_char(61); /* = */
2402 print_file_name(mem[p + 1].hh.v.RH, mem[p + 2].hh.v.LH,
2403 mem[p + 2].hh.v.RH);
2408 print_write_whatsit(591, p); /* write */
2409 print_mark(mem[p + 1].hh.v.RH);
2413 print_write_whatsit(1280, p); /* closeout */
2417 print_esc("special");
2418 print_mark(mem[p + 1].hh.v.RH);
2423 print_esc("setlanguage");
2424 print_int(mem[p + 1].hh.v.RH);
2425 print(1286); /* (hyphenmin */
2426 print_int(mem[p + 1].hh.b0);
2427 print_char(44); /*, */
2428 print_int(mem[p + 1].hh.b1);
2429 print_char(41); /*)*/
2433 print(1287); /* whatsit */
2438 if(mem[p].hh.b1 >= 100)
2441 if(mem[p].hh.b1 == 101)
2442 print_char(99); /* c */
2443 else if(mem[p].hh.b1 == 102)
2444 print_char(120); /* x */
2445 print(336); /* leaders */
2446 print_spec(mem[p + 1].hh.v.LH, 0);
2449 str_pool[pool_ptr]= 46;
2452 show_node_list(mem[p + 1].hh.v.RH);
2459 if(mem[p].hh.b1 != 0)
2461 print_char(40); /*(*/
2462 if(mem[p].hh.b1 < 98)
2463 print_skip_param(mem[p].hh.b1 - 1);
2464 else if(mem[p].hh.b1 == 98)
2465 print_esc("nonscript");
2466 else print_esc("mskip");
2467 print_char(41); /*)*/
2469 if(mem[p].hh.b1 != 98)
2471 print_char(32); /* */
2472 if(mem[p].hh.b1 < 98)
2473 print_spec(mem[p + 1].hh.v.LH, 0);
2474 else print_spec(mem[p + 1].hh.v.LH, 334); /* mu */
2479 if(mem[p].hh.b1 != 99)
2482 if(mem[p].hh.b1 != 0)
2483 print_char(32); /* */
2484 print_scaled(mem[p + 1].cint);
2485 if(mem[p].hh.b1 == 2)
2486 print(338); /* (for accent) */
2490 print_scaled(mem[p + 1].cint);
2491 print(334); /* mu */
2497 if(mem[p].hh.b1 == 0)
2498 print(341); /* on */
2499 else print(342); /* off */
2500 if(mem[p + 1].cint != 0)
2502 print(343); /*, surrounded */
2503 print_scaled(mem[p + 1].cint);
2509 print_font_and_char(p + 1);
2510 print(344); /* (ligature */
2511 if(mem[p].hh.b1 > 1)
2512 print_char(124); /* | */
2513 font_in_short_display = mem[p + 1].hh.b0;
2514 short_display(mem[p + 1].hh.v.RH);
2515 if(odd(mem[p].hh.b1))
2516 print_char(124); /* | */
2517 print_char(41); /*)*/
2522 print_esc("penalty ");
2523 print_int(mem[p + 1].cint);
2528 print_esc("discretionary");
2529 if(mem[p].hh.b1 > 0)
2531 print(347); /* replacing */
2532 print_int(mem[p].hh.b1);
2536 str_pool[pool_ptr]= 46;
2539 show_node_list(mem[p + 1].hh.v.LH);
2543 str_pool[pool_ptr]= 124;
2546 show_node_list(mem[p + 1].hh.v.RH);
2553 print_mark(mem[p + 1].cint);
2558 print_esc("vadjust");
2561 str_pool[pool_ptr]= 46;
2564 show_node_list(mem[p + 1].cint);
2570 print_style(mem[p].hh.b1);
2574 print_esc("mathchoice");
2576 str_pool[pool_ptr]= 68;
2579 show_node_list(mem[p + 1].hh.v.LH);
2582 str_pool[pool_ptr]= 84;
2585 show_node_list(mem[p + 1].hh.v.RH);
2588 str_pool[pool_ptr]= 83;
2591 show_node_list(mem[p + 2].hh.v.LH);
2594 str_pool[pool_ptr]= 115;
2597 show_node_list(mem[p + 2].hh.v.RH);
2617 switch(mem[p].hh.b0)
2619 print_esc("mathord");
2622 print_esc("mathop");
2625 print_esc("mathbin");
2628 print_esc("mathrel");
2631 print_esc("mathopen");
2634 print_esc("mathclose");
2637 print_esc("mathpunct");
2640 print_esc("mathinner");
2643 print_esc("overline");
2646 print_esc("underline");
2649 print_esc("vcenter");
2653 print_esc("radical");
2654 print_delimiter(p + 4);
2659 print_esc("accent");
2660 print_fam_and_char(p + 4);
2666 print_delimiter(p + 1);
2672 print_delimiter(p + 1);
2676 if(mem[p].hh.b1 != 0)
2677 if(mem[p].hh.b1 == 1)
2678 print_esc("limits");
2679 else print_esc("nolimits");
2680 if(mem[p].hh.b0 < 30)
2681 print_subsidiary_data(p + 1, 46);
2682 print_subsidiary_data(p + 2, 94);
2683 print_subsidiary_data(p + 3, 95);
2688 print_esc("fraction");
2689 if(mem[p + 1].cint == 1073741824L) /* 2^30 */
2690 print(875); /* = default */
2691 else print_scaled(mem[p + 1].cint);
2692 if((mem[p + 4].qqqq.b0 != 0)||(mem[p + 4].qqqq.b1 !=
2693 0)||(mem[p + 4].qqqq.b2 != 0)||(mem[p + 4].qqqq.b3
2696 print(876); /*, left */
2697 print_delimiter(p + 4);
2699 if((mem[p + 5].qqqq.b0 != 0)||(mem[p + 5].qqqq.b1 !=
2700 0)||(mem[p + 5].qqqq.b2 != 0)||(mem[p + 5].qqqq.b3
2703 print(877); /*, right */
2704 print_delimiter(p + 5);
2706 print_subsidiary_data(p + 2, 92);
2707 print_subsidiary_data(p + 3, 47);
2711 print(315); /* Unknown node type! */
2718 /* NOTE: 262143L should be empty_flag */