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
24 #pragma warning(disable:4244) /* 96/Jan/10 */
26 /* #pragma optimize("a", off) */ /* 98/Dec/10 experiment */
28 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
30 void char_warning_(internal_font_number f, eight_bits c)
32 if (eqtb[(hash_size + 3198)].cint > 0)
34 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
35 if (show_missing == 0) /* show on screen 94/June/10 */
36 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
38 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
39 if (show_missing) { /* add ! before 94/June/10 */
41 print_string("Missing character: there is no ");
44 print_nl("Missing character: there is no ");
46 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
47 if (show_numeric) { /* bkph 93/Dec/21 */
51 print_char(48 + c / 100);
53 c = c - (c / 100) * 100; /* ? */
54 print_char(48 + c / 10);
58 c = c - (c / 100) * 100; /* ? */
59 if (c / 10 > 0) print_char(48 + c / 10);
61 print_char(48 + c % 10);
65 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
66 print_string("in font");
67 slow_print(font_name[f]);
69 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
70 /* if (show_missing) show_context(); */ /* in tex2.c 94/June/10 */
72 if (f != 0) show_context(); /* not if its the nullfont */
74 if (show_missing == 0) /* show on screen 94/June/10 */
75 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
76 end_diagnostic(false);
77 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
78 missing_characters++; /* bkph 93/Dec/16 */
79 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
82 halfword new_character_(internal_font_number f, eight_bits c)
84 register halfword Result;
88 if ((font_info[char_base[f]+ c].qqqq.b0 > 0))
96 char_warning(f, c); /* char_warning(f,c); l.11283 */
97 Result = 0; /* new_character:=null */
100 /* following needs access to dvi_buf=zdvibuf see coerce.h */
103 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
106 sprintf(log_line, "dvi_swap %d", dvi_gone);
107 show_line(log_line, 0);
109 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
110 if (dvi_limit == dvi_buf_size) {
111 writedvi(0, half_buf - 1);
112 dvi_limit = half_buf;
113 dvi_offset = dvi_offset + dvi_buf_size;
116 writedvi(half_buf, dvi_buf_size - 1);
117 dvi_limit = dvi_buf_size;
119 dvi_gone = dvi_gone + half_buf;
121 /* following needs access to dvi_buf=zdvibuf see coerce.h */
122 void dvi_four_(integer x) /* attempt at speeding up bkph - is compiler smart ? */
126 /* dvi_buf[dvi_ptr]= x / 16777216L; */ /* 2^24 */
127 /* dvi_buf[dvi_ptr]=(x >> 24); */
128 dvi_buf[dvi_ptr]= (unsigned char)(x >> 24);
130 if (dvi_ptr == dvi_limit)dvi_swap ();
133 x = x + 1073741824L; /* 2^30 40000000 hex */
136 /* dvi_buf[dvi_ptr]=(x / 16777216L)+ 128; */ /* 2^24 */
137 dvi_buf[dvi_ptr]=(x >> 24)+ 128; /* set sign bit */
139 if (dvi_ptr == dvi_limit)dvi_swap ();
142 /* x = x % 16777216L; */ /* % 2^24 */
145 /* dvi_buf[dvi_ptr]= x / 65536L; */
146 /* dvi_buf[dvi_ptr]=(x >> 16); */
147 dvi_buf[dvi_ptr]= (unsigned char)(x >> 16);
149 if (dvi_ptr == dvi_limit)dvi_swap ();
151 /* x = x % 65536L; */ /* % 2^16 */
154 /* dvi_buf[dvi_ptr]= x / 256; */
155 /* dvi_buf[dvi_ptr]=(x >> 8); */
156 dvi_buf[dvi_ptr]= (unsigned char)(x >> 8);
158 if (dvi_ptr == dvi_limit)dvi_swap ();
161 /* dvi_buf[dvi_ptr]= x % 256; */ /* % 2^8 */
162 dvi_buf[dvi_ptr]= x & 255;
164 if (dvi_ptr == dvi_limit)dvi_swap ();
167 /* following needs access to dvi_buf=zdvibuf see coerce.h */
168 void zdvipop(integer l)
170 if ((l == dvi_offset + dvi_ptr)&&(dvi_ptr > 0))
174 dvi_buf[dvi_ptr]= 142;
176 if (dvi_ptr == dvi_limit)dvi_swap ();
179 /* following needs access to dvi_buf=zdvibuf see coerce.h */
180 void dvi_font_def_(internal_font_number f)
183 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
187 dvi_buf[dvi_ptr]= 243;
189 if (dvi_ptr == dvi_limit)dvi_swap ();
192 dvi_buf[dvi_ptr]= f - 1;
194 if (dvi_ptr == dvi_limit)dvi_swap ();
199 dvi_buf[dvi_ptr]= 244;
201 if (dvi_ptr == dvi_limit)dvi_swap ();
204 dvi_buf[dvi_ptr]= (f - 1) >> 8; /* top byte */
206 if (dvi_ptr == dvi_limit)dvi_swap ();
209 dvi_buf[dvi_ptr]= (f - 1) & 255; /* bottom byte */
211 if (dvi_ptr == dvi_limit)dvi_swap ();
216 dvi_buf[dvi_ptr]= 243;
218 if (dvi_ptr == dvi_limit)dvi_swap ();
221 dvi_buf[dvi_ptr]= f - 1;
223 if (dvi_ptr == dvi_limit)dvi_swap ();
226 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
227 /* spit out the font checksum now */
229 dvi_buf[dvi_ptr]= font_check[f].b0;
231 if (dvi_ptr == dvi_limit)dvi_swap ();
234 dvi_buf[dvi_ptr]= font_check[f].b1;
236 if (dvi_ptr == dvi_limit)dvi_swap ();
239 dvi_buf[dvi_ptr]= font_check[f].b2;
241 if (dvi_ptr == dvi_limit)dvi_swap ();
244 dvi_buf[dvi_ptr]= font_check[f].b3;
246 if (dvi_ptr == dvi_limit)dvi_swap ();
248 dvi_four(font_size[f]);
249 dvi_four(font_dsize[f]);
251 /* long to unsigned char ... */
253 (str_start[font_area[f]+ 1]- str_start[font_area[f]]);
255 if (dvi_ptr == dvi_limit)dvi_swap ();
258 /* long to unsigned char ... */
260 (str_start[font_name[f]+ 1]- str_start[font_name[f]]);
262 if (dvi_ptr == dvi_limit)dvi_swap ();
265 register integer for_end;
266 k = str_start[font_area[f]];
267 for_end = str_start[font_area[f]+ 1]- 1;
270 dvi_buf[dvi_ptr]= str_pool[k];
272 if (dvi_ptr == dvi_limit)dvi_swap ();
274 while(k++ < for_end);
277 register integer for_end;
278 k = str_start[font_name[f]];
279 for_end = str_start[font_name[f]+ 1]- 1;
282 dvi_buf[dvi_ptr]= str_pool[k];
284 if (dvi_ptr == dvi_limit)dvi_swap ();
286 while(k++ < for_end);
289 /* following needs access to dvi_buf=zdvibuf see coerce.h */
290 void zmovement(scaled w, eight_bits o)
297 mem[q + 2].cint = dvi_offset + dvi_ptr;
298 if (o == 157) /* 157 == down1 */
300 mem[q].hh.v.RH = down_ptr;
303 else { /* 143 == right1 */
305 mem[q].hh.v.RH = right_ptr;
310 while(p != 0){ /* while p<>null do l.12153 */
311 if (mem[p + 1].cint == w)
312 switch(mstate + mem[p].hh.v.LH)
317 if (mem[p + 2].cint < dvi_gone)
321 k = mem[p + 2].cint - dvi_offset;
323 k = k + dvi_buf_size;
324 dvi_buf[k]= dvi_buf[k]+ 5;
332 if (mem[p + 2].cint < dvi_gone)
336 k = mem[p + 2].cint - dvi_offset;
338 k = k + dvi_buf_size;
339 dvi_buf[k]= dvi_buf[k]+ 10;
354 else switch(mstate + mem[p].hh.v.LH)
373 if (abs(w)>= 8388608L) /* 2^23 */
376 dvi_buf[dvi_ptr]= o + 3;
378 if (dvi_ptr == dvi_limit)dvi_swap ();
386 dvi_buf[dvi_ptr]= o + 2;
388 if (dvi_ptr == dvi_limit)dvi_swap ();
391 w = w + 16777216L; /* 2^24 */
393 /* dvi_buf[dvi_ptr]= w / 65536L; */
394 /* dvi_buf[dvi_ptr]=(w >> 16); */
395 dvi_buf[dvi_ptr]= (unsigned char)(w >> 16);
397 if (dvi_ptr == dvi_limit)dvi_swap ();
399 /* w = w % 65536L; */
406 dvi_buf[dvi_ptr]= o + 1;
408 if (dvi_ptr == dvi_limit)dvi_swap ();
417 if (dvi_ptr == dvi_limit)dvi_swap ();
423 /* dvi_buf[dvi_ptr]= w / 256; */
424 /* dvi_buf[dvi_ptr]=(w >> 8); */
425 dvi_buf[dvi_ptr]= (unsigned char)(w >> 8);
427 if (dvi_ptr == dvi_limit)dvi_swap ();
430 /* dvi_buf[dvi_ptr]= w % 256; */
431 dvi_buf[dvi_ptr]= w & 255;
433 if (dvi_ptr == dvi_limit)dvi_swap ();
436 lab40: mem[q].hh.v.LH = mem[p].hh.v.LH;
437 if (mem[q].hh.v.LH == 1)
440 dvi_buf[dvi_ptr]= o + 4;
442 if (dvi_ptr == dvi_limit)dvi_swap ();
444 while(mem[q].hh.v.RH != p){
447 switch(mem[q].hh.v.LH)
461 dvi_buf[dvi_ptr]= o + 9;
463 if (dvi_ptr == dvi_limit)dvi_swap ();
465 while(mem[q].hh.v.RH != p){
468 switch(mem[q].hh.v.LH)
482 void prune_movements_(integer l)
485 while(down_ptr != 0){ /* while down_ptr<>null do l.12206 */
487 if (mem[down_ptr + 2].cint < l)
490 down_ptr = mem[p].hh.v.RH;
493 lab30: while(right_ptr != 0){ /* done: while right_ptr<>null do */
494 if (mem[right_ptr + 2].cint < l)
497 right_ptr = mem[p].hh.v.RH;
501 /* following needs access to dvi_buf=zdvibuf see coerce.h */
502 void special_out_(halfword p)
508 movement(cur_h - dvi_h, 143); /* 143 == right1 */
513 movement(cur_v - dvi_v, 157); /* 157 == down1 */
516 old_setting = selector;
518 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
519 /* About output \special{...} make some space in string pool 97/Mar/9 */
520 #ifdef ALLOCATESTRING
521 if (pool_ptr + 32000 > current_pool_size)
522 str_pool = realloc_str_pool (increment_pool_size);
523 /* We don't bother to check whether this worked - will catch later */
525 /* Potential problem here if current_pool_size is not much more than pool_ptr! */
526 /* Fixed 97/Mar/9 in version 2.0.3 */
527 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
528 #ifdef ALLOCATESTRING
529 /* show_token_list(mem[mem[p + 1].hh.v.RH].hh.v.RH, 0,
530 current_pool_size - pool_ptr); */
531 show_token_list(mem[mem[p + 1].hh.v.RH].hh.v.RH, 0, 10000000L);
532 /* Above is safe, since print/print_char/print_esc will extend string space */
534 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
535 show_token_list(mem[mem[p + 1].hh.v.RH].hh.v.RH, 0,
536 pool_size - pool_ptr);
539 selector = old_setting;
541 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
542 /* str_room(1) - is there space for one more character in string pool ? */
543 #ifdef ALLOCATESTRING
544 if (pool_ptr + 1 > current_pool_size)
545 str_pool = realloc_str_pool (increment_pool_size);
546 if (pool_ptr + 1 > current_pool_size) { /* in case it failed 94/Jan/24 */
547 overflow("pool size", current_pool_size - init_pool_ptr); /* 97/Mar/7 */
548 return; // abort_flag set
551 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
552 if (pool_ptr + 1 > pool_size){
553 overflow("pool size", pool_size - init_pool_ptr); /* pool size */
554 return; // abort_flag set
558 if ((pool_ptr - str_start[str_ptr])< 256) /* can use xxx1 ? */
561 dvi_buf[dvi_ptr]= 239; /* xxx1 */
563 if (dvi_ptr == dvi_limit)dvi_swap ();
566 /* long to unsigned char ... */
567 dvi_buf[dvi_ptr]=(pool_ptr - str_start[str_ptr]);
569 if (dvi_ptr == dvi_limit)dvi_swap ();
572 else { /* use xxx4 instead */
574 dvi_buf[dvi_ptr]= 242; /* xxx4 */
576 if (dvi_ptr == dvi_limit)dvi_swap ();
578 dvi_four((pool_ptr - str_start[str_ptr]));
582 /* debugging code for \special{src: ... } 98/Nov/11 */
584 int k = str_start[str_ptr];
587 if (str_pool [k] == 's' &&
588 str_pool [k+1] == 'r' &&
589 str_pool [k+2] == 'c' &&
590 str_pool [k+3] == ':') { /* \special{src: ... } */
594 *s++ = str_pool[k++];
598 show_line(log_line, 0)
602 if (cur_input.name_field > 17) { /* redundant ? */
603 print(cur_input.name_field);
605 print_int(line); /* line number */
618 register integer for_end;
619 k = str_start[str_ptr];
620 for_end = pool_ptr - 1;
623 dvi_buf[dvi_ptr]= str_pool[k];
625 if (dvi_ptr == dvi_limit)dvi_swap ();
627 while(k++ < for_end);
629 pool_ptr = str_start[str_ptr];
631 /* noew returns -1 if it fails */
632 void write_out_(halfword p)
635 /* integer oldmode; */
636 int oldmode; /* 1995/Jan/7 */
637 /* small_number j; */
638 int j; /* 1995/Jan/7 */
640 /* q:=get_avail; info(q):=right_brace_token+"}";@/ */
643 /* r:=get_avail; link(q):=r; info(r):=end_write_token; ins_list(q);@/ */
644 /* @d end_write_token==cs_token_flag+end_write */
647 /* mem[r].hh.v.LH = (hash_size + 4617); */
648 /* mem[r].hh.v.LH = (hash_size + 4095 + 522); */
649 info(r) = (hash_size + hash_extra + 4095 + 522);
650 begin_token_list(q, 4);
651 begin_token_list(mem[p + 1].hh.v.RH, 15);
653 mem[q].hh.v.LH = 379;
654 begin_token_list(q, 4);
658 q = scan_toks(false, true);
660 /* if (cur_tok != (hash_size + 4617)) */
661 /* if (cur_tok != (hash_size + 4095 + 522)) */
662 if (cur_tok != (hash_size + hash_extra + 4095 + 522))
664 print_err("Unbalanced write command");
665 help2("On this page there's a \\write with fewer real {'s than }'s.",
666 "I can't handle that very well; good luck.");
670 /* } while(!(cur_tok == (hash_size + 4617))); */
671 /* } while(!(cur_tok == (hash_size + 4095 + 522))); */
672 } while(!(cur_tok == (hash_size + hash_extra + 4095 + 522))); /*1996/Jan/10*/
676 old_setting = selector;
677 j = mem[p + 1].hh.v.LH;
678 if (write_open[j])selector = j;
680 if ((j == 17)&&(selector == 19))
687 selector = old_setting;
689 void out_what_(halfword p)
691 /* small_number j; */
692 int j; /* 1995/Jan/7 */
697 if (!doing_leaders) {
698 j = mem[p + 1].hh.v.LH;
699 if (mem[p].hh.b1 == 1){
703 (void) a_close(write_file[j]);
704 if (mem[p].hh.b1 == 2)
705 write_open[j]= false;
707 cur_name = mem[p + 1].hh.v.RH;
708 cur_area = mem[p + 2].hh.v.LH;
709 cur_ext = mem[p + 2].hh.v.RH;
710 if (cur_ext == 335) /* "" */
711 cur_ext = 785; /* => ".tex" */
712 pack_file_name(cur_name, cur_area, cur_ext);
713 while(! a_open_out(write_file[j])) {
714 prompt_file_name(1294, 785); /* output file name .tex */
730 return; // abort_flag set
735 /* following needs access to dvi_buf=zdvibuf see coerce.h */
736 void hlist_out (void)
742 /* glue_ord gorder; */
743 int gorder; /* 95/Jan/7 */
745 int gsign; /* 95/Jan/7 */
751 bool outerdoingleaders;
753 /* ********************************************************************* */
754 real gluetemp; /* new in 3.14159 */
755 /* ********************************************************************* */
757 gorder = mem[thisbox + 5].hh.b1;
758 gsign = mem[thisbox + 5].hh.b0;
759 p = mem[thisbox + 5].hh.v.RH;
763 dvi_buf[dvi_ptr]= 141;
765 if (dvi_ptr == dvi_limit)dvi_swap ();
767 if (cur_s > max_push)
769 saveloc = dvi_offset + dvi_ptr;
772 /* while p<>null do l.12314 */
774 lab21: if ((p >= hi_mem_min))
778 movement(cur_h - dvi_h, 143); /* 143 == right1 */
783 movement(cur_v - dvi_v, 157); /* 157 == down1 */
797 { /* fnt_num_0 --- fnt_num_63 */
798 dvi_buf[dvi_ptr]= f + 170;
800 if (dvi_ptr == dvi_limit)dvi_swap ();
802 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
804 else if (f <= 256){ /* if we allow greater than 256 fonts */
806 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
807 else { /* normal TeX 82 case */
809 { /* fnt1 followed by f */
810 dvi_buf[dvi_ptr]= 235;
812 if (dvi_ptr == dvi_limit)dvi_swap ();
815 dvi_buf[dvi_ptr]= f - 1;
817 if (dvi_ptr == dvi_limit)dvi_swap ();
820 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
822 else { /* fnt2 followed by f / 256, f % 256 */
824 dvi_buf[dvi_ptr]= 236;
826 if (dvi_ptr == dvi_limit)dvi_swap ();
829 dvi_buf[dvi_ptr]= (f - 1) >> 8; /* top byte */
831 if (dvi_ptr == dvi_limit)dvi_swap ();
834 dvi_buf[dvi_ptr]= (f - 1) & 255; /* bottom byte */
836 if (dvi_ptr == dvi_limit)dvi_swap ();
840 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
845 dvi_buf[dvi_ptr]= 128;
847 if (dvi_ptr == dvi_limit)dvi_swap ();
852 if (dvi_ptr == dvi_limit)dvi_swap ();
854 cur_h = cur_h + font_info[width_base[f]+ font_info[char_base[f]+ c
857 } while(!(!(p >= hi_mem_min)));
865 /* if list_ptr(p)=null then cur_h:=cur_h+width(p) l.12371 */
866 if (mem[p + 5].hh.v.RH == 0)
867 cur_h = cur_h + mem[p + 1].cint;
872 cur_v = baseline + mem[p + 4].cint;
875 if (mem[p].hh.b0 == 1)vlist_out ();
879 cur_h = edge + mem[p + 1].cint;
885 rule_ht = mem[p + 3].cint;
886 rule_dp = mem[p + 2].cint;
887 rule_wd = mem[p + 1].cint;
896 g = mem[p + 1].hh.v.LH;
897 rule_wd = mem[g + 1].cint;
902 if (mem[g].hh.b0 == gorder)
903 /* *********************************************************************** */
904 /* rule_wd = rule_wd + round(mem[thisbox + 6].gr * mem[g + 2].cint); */
905 /* ******************** 3.14159 ******************************************* */
907 gluetemp = mem[thisbox + 6].gr * mem[g + 2].cint;
908 if (gluetemp > 1000000000.0)
909 gluetemp = 1000000000.0;
910 else if (gluetemp < -1000000000.0)
911 gluetemp = -1000000000.0;
912 rule_wd = rule_wd + round(gluetemp);
914 /* ************************************************************************* */
917 /* if (mem[g].hh.b1 == gorder)*/
918 /* rule_wd = rule_wd - round(mem[thisbox + 6].gr * mem[g + 3].cint); */
920 /* ******************** 3.14159 ******************************************* */
921 else if (mem[g].hh.b1 == gorder)
923 gluetemp = mem[thisbox + 6].gr * mem[g + 3].cint;
924 if (gluetemp > 1000000000.0)
925 gluetemp = 1000000000.0;
926 else if (gluetemp < -1000000000.0)
927 gluetemp = -1000000000.0;
928 rule_wd = rule_wd - round(gluetemp);
930 /* ************************************************************************* */
932 if (mem[p].hh.b1 >= 100)
934 leaderbox = mem[p + 1].hh.v.RH;
935 if (mem[leaderbox].hh.b0 == 2)
937 rule_ht = mem[leaderbox + 3].cint;
938 rule_dp = mem[leaderbox + 2].cint;
941 leaderwd = mem[leaderbox + 1].cint;
942 if ((leaderwd > 0)&&(rule_wd > 0))
944 rule_wd = rule_wd + 10;
945 edge = cur_h + rule_wd;
947 if (mem[p].hh.b1 == 100)
950 cur_h = leftedge + leaderwd *((cur_h - leftedge)/ leaderwd)
953 cur_h = cur_h + leaderwd;
957 lq = rule_wd / leaderwd;
958 lr = rule_wd % leaderwd;
959 if (mem[p].hh.b1 == 101)
960 cur_h = cur_h +(lr / 2);
963 lx =(2 * lr + lq + 1)/(2 * lq + 2);
964 cur_h = cur_h +((lr -(lq - 1)* lx)/ 2);
967 while(cur_h + leaderwd <= edge){
969 cur_v = baseline + mem[leaderbox + 4].cint;
972 movement(cur_v - dvi_v, 157); /* 157 == down1 */
978 movement(cur_h - dvi_h, 143); /* 143 == right1 */
982 temp_ptr = leaderbox;
983 outerdoingleaders = doing_leaders;
984 doing_leaders = true;
985 if (mem[leaderbox].hh.b0 == 1)vlist_out ();
987 doing_leaders = outerdoingleaders;
990 /* ****************************************************************** */
992 cur_v = baseline; /* changed in 3.1415 */
993 /* ****************************************************************** */
994 cur_h = saveh + leaderwd + lx;
1005 cur_h = cur_h + mem[p + 1].cint;
1009 mem[lig_trick]= mem[p + 1];
1010 mem[lig_trick].hh.v.RH = mem[p].hh.v.RH;
1020 lab14: if ((rule_ht == -1073741824L)) /* - 2^30 */
1021 rule_ht = mem[thisbox + 3].cint;
1022 if ((rule_dp == -1073741824L)) /* - 2^30 */
1023 rule_dp = mem[thisbox + 2].cint;
1024 rule_ht = rule_ht + rule_dp;
1025 if ((rule_ht > 0)&&(rule_wd > 0))
1029 movement(cur_h - dvi_h, 143); /* 143 == right1 */
1032 cur_v = baseline + rule_dp;
1035 movement(cur_v - dvi_v, 157); /* 157 == down1 */
1039 dvi_buf[dvi_ptr]= 132;
1041 if (dvi_ptr == dvi_limit)dvi_swap ();
1046 dvi_h = dvi_h + rule_wd;
1048 lab13: cur_h = cur_h + rule_wd;
1049 lab15: p = mem[p].hh.v.RH;
1051 prune_movements(saveloc);
1056 /* following needs access to dvi_buf=zdvibuf see coerce.h */
1057 void vlist_out (void)
1061 scaled saveh, savev;
1063 /* glue_ord gorder; */
1064 int gorder; /* 95/Jan/7 */
1066 int gsign; /* 95/Jan/7 */
1072 bool outerdoingleaders;
1074 /* ************************************************************************ */
1075 real gluetemp; /* new in 3.14159 */
1076 /* ************************************************************************ */
1078 gorder = mem[thisbox + 5].hh.b1;
1079 gsign = mem[thisbox + 5].hh.b0;
1080 p = mem[thisbox + 5].hh.v.RH;
1084 dvi_buf[dvi_ptr]= 141;
1086 if (dvi_ptr == dvi_limit)dvi_swap ();
1088 if (cur_s > max_push)
1090 saveloc = dvi_offset + dvi_ptr;
1092 cur_v = cur_v - mem[thisbox + 3].cint;
1094 while(p != 0){ /* while p<>null do l.12494 OK */
1095 if ((p >= hi_mem_min)) {
1096 confusion("vlistout");
1097 return; // abort_flag set
1100 switch(mem[p].hh.b0)
1103 /* if list_ptr(p)=null then cur_v:=cur_v+height(p)+depth(p) l.12529 */
1104 if (mem[p + 5].hh.v.RH == 0)
1105 cur_v = cur_v + mem[p + 3].cint + mem[p + 2].cint;
1108 cur_v = cur_v + mem[p + 3].cint;
1111 movement(cur_v - dvi_v, 157); /* 157 == down1 */
1116 cur_h = leftedge + mem[p + 4].cint;
1118 if (mem[p].hh.b0 == 1)vlist_out ();
1122 cur_v = savev + mem[p + 2].cint;
1128 rule_ht = mem[p + 3].cint;
1129 rule_dp = mem[p + 2].cint;
1130 rule_wd = mem[p + 1].cint;
1139 g = mem[p + 1].hh.v.LH;
1140 rule_ht = mem[g + 1].cint;
1145 if (mem[g].hh.b0 == gorder)
1146 /* ************************************************************************ */
1147 /* rule_ht = rule_ht + round(mem[thisbox + 6].gr * mem[g + 2].cint); */
1148 /* ************************ 3.14159 **************************************** */
1150 gluetemp = mem[thisbox + 6].gr * mem[g + 2].cint;
1151 if (gluetemp > 1000000000.0)
1152 gluetemp = 1000000000.0;
1153 else if (gluetemp < -1000000000.0)
1154 gluetemp = -1000000000.0;
1155 rule_ht = rule_ht + round(gluetemp);
1157 /* ************************************************************************* */
1159 /* ************************************************************************* */
1161 /* if (mem[g].hh.b1 == gorder) */
1162 /* rule_ht = rule_ht - round(mem[thisbox + 6].gr * mem[g + 3].cint); */
1164 else if (mem[g].hh.b1 == gorder) /* BUG FIX !!! */
1166 gluetemp = mem[thisbox + 6].gr * mem[g + 3].cint;
1167 if (gluetemp > 1000000000.0)
1168 gluetemp = 1000000000.0;
1169 else if (gluetemp < -1000000000.0)
1170 gluetemp = -1000000000.0;
1171 rule_ht = rule_ht - round(gluetemp);
1173 /* ************************************************************************* */
1175 if (mem[p].hh.b1 >= 100)
1177 leaderbox = mem[p + 1].hh.v.RH;
1178 if (mem[leaderbox].hh.b0 == 2)
1180 rule_wd = mem[leaderbox + 1].cint;
1184 leaderht = mem[leaderbox + 3].cint + mem[leaderbox + 2]
1186 if ((leaderht > 0)&&(rule_ht > 0))
1188 rule_ht = rule_ht + 10;
1189 edge = cur_v + rule_ht;
1191 if (mem[p].hh.b1 == 100)
1194 cur_v = topedge + leaderht *((cur_v - topedge)/ leaderht)
1197 cur_v = cur_v + leaderht;
1201 lq = rule_ht / leaderht;
1202 lr = rule_ht % leaderht;
1203 if (mem[p].hh.b1 == 101)
1204 cur_v = cur_v +(lr / 2);
1207 lx =(2 * lr + lq + 1)/(2 * lq + 2);
1208 cur_v = cur_v +((lr -(lq - 1)* lx)/ 2);
1211 while(cur_v + leaderht <= edge){
1213 cur_h = leftedge + mem[leaderbox + 4].cint;
1216 movement(cur_h - dvi_h, 143); /* 143 == right1 */
1220 cur_v = cur_v + mem[leaderbox + 3].cint;
1223 movement(cur_v - dvi_v, 157); /* 157 == down1 */
1227 temp_ptr = leaderbox;
1228 outerdoingleaders = doing_leaders;
1229 doing_leaders = true;
1230 if (mem[leaderbox].hh.b0 == 1)vlist_out ();
1232 doing_leaders = outerdoingleaders;
1235 /* ************************************************************************ */
1236 /* cur_h = saveh; */
1237 cur_h = leftedge; /* 3.1415 */
1238 /* ************************************************************************ */
1239 cur_v = savev - mem[leaderbox + 3].cint + leaderht + lx;
1249 cur_v = cur_v + mem[p + 1].cint;
1256 lab14: if ((rule_wd == -1073741824L)) /* -2^30 */
1257 rule_wd = mem[thisbox + 1].cint;
1258 rule_ht = rule_ht + rule_dp;
1259 cur_v = cur_v + rule_ht;
1260 if ((rule_ht > 0)&&(rule_wd > 0))
1264 movement(cur_h - dvi_h, 143); /* 143 == right1 */
1269 movement(cur_v - dvi_v, 157); /* 157 == down1 */
1273 dvi_buf[dvi_ptr]= 137;
1275 if (dvi_ptr == dvi_limit)dvi_swap ();
1281 lab13: cur_v = cur_v + rule_ht;
1283 lab15: p = mem[p].hh.v.RH;
1285 prune_movements(saveloc);
1290 /* following needs access to dvi_buf=zdvibuf see coerce.h */
1291 void ship_out_(halfword p)
1297 if (eqtb[(hash_size + 3197)].cint > 0)
1301 print_string("Completed box being shipped out");
1303 if (term_offset > max_print_line - 9)
1305 else if ((term_offset > 0)||(file_offset > 0))
1309 while((eqtb[(hash_size + 3218) + j].cint == 0)&&(j > 0)) decr(j);
1311 register integer for_end;
1314 if (k <= for_end) do
1316 print_int(eqtb[(hash_size + 3218) + k].cint);
1320 while(k++ < for_end);
1325 if (eqtb[(hash_size + 3197)].cint > 0)
1328 begin_diagnostic ();
1330 end_diagnostic(true);
1332 if ((mem[p + 3].cint > 1073741823L)|| /* 2^30 - 1 */
1333 (mem[p + 2].cint > 1073741823L)||
1334 (mem[p + 3].cint + mem[p + 2].cint +
1335 eqtb[(hash_size + 3749)].cint > 1073741823L)||
1336 (mem[p + 1].cint + eqtb[(hash_size + 3748)].cint > 1073741823L))
1338 print_err("Huge page cannot be shipped out");
1339 help2("The page just created is more than 18 feet tall or",
1340 "more than 18 feet wide, so I suspect something went wrong.");
1342 if (eqtb[(hash_size + 3197)].cint <= 0)
1344 begin_diagnostic ();
1345 print_nl("The following box has been deleted:");
1347 end_diagnostic(true);
1351 if (mem[p + 3].cint + mem[p + 2].cint + eqtb[(hash_size + 3749)].cint > max_v
1353 max_v = mem[p + 3].cint + mem[p + 2].cint + eqtb[(hash_size + 3749)].cint;
1354 if (mem[p + 1].cint + eqtb[(hash_size + 3748)].cint > max_h)
1355 max_h = mem[p + 1].cint + eqtb[(hash_size + 3748)].cint;
1358 cur_h = eqtb[(hash_size + 3748)].cint;
1360 if (output_file_name == 0)
1362 if (job_name == 0)open_log_file ();
1363 pack_job_name(788); /* .dvi */
1364 while(! b_open_out(dvi_file)) {
1365 prompt_file_name(789, 788); /* file name for output .dvi */
1367 output_file_name = b_make_name_string(dvi_file);
1370 if (total_pages == 0)
1373 dvi_buf[dvi_ptr]= 247;
1375 if (dvi_ptr == dvi_limit)dvi_swap ();
1378 dvi_buf[dvi_ptr]= 2;
1380 if (dvi_ptr == dvi_limit)dvi_swap ();
1382 dvi_four(25400000L); /* magic DVI scale factor */
1383 dvi_four(473628672L); /* 7227 * 65536 */
1385 dvi_four(eqtb[(hash_size + 3180)].cint);
1386 old_setting = selector;
1388 print_string(" TeX output ");
1389 print_int(eqtb[(hash_size + 3186)].cint);
1391 print_two(eqtb[(hash_size + 3185)].cint);
1393 print_two(eqtb[(hash_size + 3184)].cint);
1395 print_two(eqtb[(hash_size + 3183)].cint / 60);
1396 print_two(eqtb[(hash_size + 3183)].cint % 60);
1397 selector = old_setting;
1399 /* long to unsigned char ... */
1400 dvi_buf[dvi_ptr]=(pool_ptr - str_start[str_ptr]);
1402 if (dvi_ptr == dvi_limit)dvi_swap ();
1405 register integer for_end;
1406 s = str_start[str_ptr];
1407 for_end = pool_ptr - 1;
1408 if (s <= for_end) do
1410 dvi_buf[dvi_ptr]= str_pool[s];
1412 if (dvi_ptr == dvi_limit)dvi_swap ();
1414 while(s++ < for_end);
1416 pool_ptr = str_start[str_ptr];
1417 } // end of if total_pages == 0
1419 pageloc = dvi_offset + dvi_ptr;
1421 dvi_buf[dvi_ptr]= 139;
1423 if (dvi_ptr == dvi_limit)dvi_swap ();
1426 register integer for_end;
1429 if (k <= for_end) do
1430 dvi_four(eqtb[(hash_size + 3218) + k].cint);
1431 while(k++ < for_end);
1435 cur_v = mem[p + 3].cint + eqtb[(hash_size + 3749)].cint;
1437 if (mem[p].hh.b0 == 1)vlist_out ();
1440 dvi_buf[dvi_ptr]= 140;
1442 if (dvi_ptr == dvi_limit)dvi_swap ();
1447 if (eqtb[(hash_size + 3197)].cint <= 0)
1455 if (eqtb[(hash_size + 3194)].cint > 1)
1457 print_nl("Memory usage before: ");
1458 print_int(var_used);
1460 print_int(dyn_used);
1467 if (eqtb[(hash_size + 3194)].cint > 1)
1469 print_string("after");
1470 print_int(var_used);
1472 print_int(dyn_used);
1473 print_string("still utouched");
1474 print_int(hi_mem_min - lo_mem_max - 1); /* somewhat inaccurate free mem */
1479 void scan_spec_(group_code c, bool threecodes)
1484 s = save_stack[save_ptr + 0].cint;
1485 if (scan_keyword("to")) /* to */
1487 else if (scan_keyword("spread")) /* spread */
1494 scan_dimen(false, false, false);
1495 lab40: if (threecodes)
1497 save_stack[save_ptr + 0].cint = s; /* s may be used without ... */
1500 save_stack[save_ptr + 0].cint = speccode;
1501 save_stack[save_ptr + 1].cint = cur_val;
1502 save_ptr = save_ptr + 2;
1506 halfword hpack_(halfword p, scaled w, small_number m)
1507 {/* 21 50 10 */ register halfword Result;
1514 int o; /* 95/Jan/7 */
1515 internal_font_number f;
1522 mem[r + 4].cint = 0;
1536 while(p != 0){ /* while p<>null do l.12862 */
1537 lab21: while((p >= hi_mem_min)) {
1539 i = font_info[char_base[f]+ mem[p].hh.b1].qqqq;
1541 x = x + font_info[width_base[f]+ i.b0].cint;
1542 s = font_info[height_base[f]+(hd)/ 16].cint;
1545 s = font_info[depth_base[f]+(hd)% 16].cint;
1550 if (p != 0) /* if p<>null then l.12886 */
1552 switch(mem[p].hh.b0)
1558 x = x + mem[p + 1].cint;
1559 if (mem[p].hh.b0 >= 2)
1561 else s = mem[p + 4].cint;
1562 if (mem[p + 3].cint - s > h)
1563 h = mem[p + 3].cint - s;
1564 if (mem[p + 2].cint + s > d)
1565 d = mem[p + 2].cint + s;
1571 /* if adjust_tail<>null then link(adjust_tail):=null; l.12865 / 12891 */
1572 if (adjust_tail != 0)
1574 while(mem[q].hh.v.RH != p)q = mem[q].hh.v.RH;
1575 if (mem[p].hh.b0 == 5)
1577 mem[adjust_tail].hh.v.RH = mem[p + 1].cint;
1578 while(mem[adjust_tail].hh.v.RH != 0)adjust_tail = mem[
1579 adjust_tail].hh.v.RH;
1581 free_node(mem[q].hh.v.RH, 2);
1585 mem[adjust_tail].hh.v.RH = p;
1598 g = mem[p + 1].hh.v.LH;
1599 x = x + mem[g + 1].cint;
1601 totalstretch[o]= totalstretch[o]+ mem[g + 2].cint;
1603 totalshrink[o]= totalshrink[o]+ mem[g + 3].cint;
1604 if (mem[p].hh.b1 >= 100)
1606 g = mem[p + 1].hh.v.RH;
1607 if (mem[g + 3].cint > h)
1608 h = mem[g + 3].cint;
1609 if (mem[g + 2].cint > d)
1610 d = mem[g + 2].cint;
1616 x = x + mem[p + 1].cint;
1620 mem[lig_trick]= mem[p + 1];
1621 mem[lig_trick].hh.v.RH = mem[p].hh.v.RH;
1633 if (adjust_tail != 0)
1634 mem[adjust_tail].hh.v.RH = 0;
1635 mem[r + 3].cint = h;
1636 mem[r + 2].cint = d;
1639 mem[r + 1].cint = w;
1643 mem[r + 5].hh.b0 = 0;
1644 mem[r + 5].hh.b1 = 0;
1645 mem[r + 6].gr = 0.0;
1650 if (totalstretch[3]!= 0)
1652 else if (totalstretch[2]!= 0)
1654 else if (totalstretch[1]!= 0)
1657 mem[r + 5].hh.b1 = o;
1658 mem[r + 5].hh.b0 = 1;
1659 /* if total_stretch[o]<>0 then glue_set(r):=... l.12982 */
1660 if (totalstretch[o]!= 0)
1661 mem[r + 6].gr = x / ((double) totalstretch[o]);
1664 mem[r + 5].hh.b0 = 0;
1665 mem[r + 6].gr = 0.0;
1667 /* if o=normal then if list_ptr(r)<>null then l.12987 */
1669 if (mem[r + 5].hh.v.RH != 0)
1671 last_badness = badness(x, totalstretch[0]);
1672 if (last_badness > eqtb[(hash_size + 3189)].cint)
1675 if (last_badness > 100)
1676 print_nl("Underfull");
1677 else print_nl("Loose");
1678 print_string("\\hbox (badness ");
1679 print_int(last_badness);
1680 if (last_badness > 100) underfull_hbox++; /* 1996/Feb/9 */
1687 if (totalshrink[3]!= 0)
1689 else if (totalshrink[2]!= 0)
1691 else if (totalshrink[1]!= 0)
1694 mem[r + 5].hh.b1 = o;
1695 mem[r + 5].hh.b0 = 2;
1696 if (totalshrink[o]!= 0)
1697 mem[r + 6].gr =(- (integer) x) / ((double) totalshrink[o]);
1700 mem[r + 5].hh.b0 = 0;
1701 mem[r + 6].gr = 0.0;
1703 /* if (total_shrink[o]<-x)and(o=normal)and(list_ptr(r)<>null) then l.13946 */
1704 if ((totalshrink[o]< - (integer) x)&&(o == 0)&&(mem[r + 5].hh.v.RH != 0))
1706 last_badness = 1000000L;
1707 /* set_glue_ratio_one(glue_set(r)); {use the maximum shrinkage} */
1708 mem[r + 6].gr = 1.0;
1709 /* if (-x-total_shrink[normal]>hfuzz)or(hbadness<100) then */
1710 if ((- (integer) x - totalshrink[0]> eqtb[(hash_size + 3738)].cint)||(
1711 eqtb[(hash_size + 3189)].cint < 100))
1713 if ((eqtb[(hash_size + 3746)].cint > 0)&&(- (integer) x - totalshrink[0
1714 ] > eqtb[(hash_size + 3738)].cint))
1716 while(mem[q].hh.v.RH != 0)q = mem[q].hh.v.RH;
1717 mem[q].hh.v.RH = new_rule ();
1718 mem[mem[q].hh.v.RH + 1].cint = eqtb[(hash_size + 3746)].cint;
1721 print_nl("Overfull \\hbox("); /* */
1722 print_scaled(- (integer) x - totalshrink[0]);
1723 print_string("pt too wide");
1724 overfull_hbox++; /* 1996/Feb/9 */
1729 if (mem[r + 5].hh.v.RH != 0)
1731 last_badness = badness(- (integer) x, totalshrink[0]);
1732 if (last_badness > eqtb[(hash_size + 3189)].cint)
1735 print_nl("Tight \\hbox (badness "); /* */
1736 print_int(last_badness);
1742 lab50: if (output_active)
1743 print_string(")has occurred while \\output is active");
1746 if (pack_begin_line != 0)
1748 if (pack_begin_line > 0)
1749 print_string(")in paragraph at lines ");
1750 else print_string(")in alignment at lines ");
1751 print_int(abs(pack_begin_line));
1754 else print_string(")detected at line ");
1758 font_in_short_display = 0;
1759 short_display(mem[r + 5].hh.v.RH);
1761 begin_diagnostic ();
1763 end_diagnostic(true);
1767 halfword vpackage_(halfword p, scaled h, small_number m, scaled l)
1768 {/* 50 10 */ register halfword Result;
1774 int o; /* 95/Jan/7 */
1779 mem[r + 4].cint = 0;
1780 mem[r + 5].hh.v.RH = p;
1793 if ((p >= hi_mem_min)) {
1795 return 0; // abort_flag set
1797 else switch(mem[p].hh.b0)
1803 x = x + d + mem[p + 3].cint;
1804 d = mem[p + 2].cint;
1805 if (mem[p].hh.b0 >= 2)
1807 else s = mem[p + 4].cint;
1808 if (mem[p + 1].cint + s > w)
1809 w = mem[p + 1].cint + s;
1819 g = mem[p + 1].hh.v.LH;
1820 x = x + mem[g + 1].cint;
1822 totalstretch[o]= totalstretch[o]+ mem[g + 2].cint;
1824 totalshrink[o]= totalshrink[o]+ mem[g + 3].cint;
1825 if (mem[p].hh.b1 >= 100)
1827 g = mem[p + 1].hh.v.RH;
1828 if (mem[g + 1].cint > w)
1829 w = mem[g + 1].cint;
1835 x = x + d + mem[p + 1].cint;
1845 mem[r + 1].cint = w;
1849 mem[r + 2].cint = l;
1851 else mem[r + 2].cint = d;
1854 mem[r + 3].cint = h;
1858 mem[r + 5].hh.b0 = 0;
1859 mem[r + 5].hh.b1 = 0;
1860 mem[r + 6].gr = 0.0;
1865 if (totalstretch[3]!= 0)
1867 else if (totalstretch[2]!= 0)
1869 else if (totalstretch[1]!= 0)
1872 mem[r + 5].hh.b1 = o;
1873 mem[r + 5].hh.b0 = 1;
1874 if (totalstretch[o]!= 0)
1875 mem[r + 6].gr = x / ((double) totalstretch[o]);
1878 mem[r + 5].hh.b0 = 0;
1879 mem[r + 6].gr = 0.0;
1882 if (mem[r + 5].hh.v.RH != 0)
1884 last_badness = badness(x, totalstretch[0]);
1885 if (last_badness > eqtb[(hash_size + 3190)].cint)
1888 if (last_badness > 100)
1889 print_nl("Underfull"); /* */
1890 else print_nl("Loose"); /* */
1891 print_string("\\vbox (badness");
1892 print_int(last_badness);
1893 if (last_badness > 100)underfull_vbox++; /* 1996/Feb/9 */
1901 if (totalshrink[3]!= 0)
1903 else if (totalshrink[2]!= 0)
1905 else if (totalshrink[1]!= 0)
1908 mem[r + 5].hh.b1 = o;
1909 mem[r + 5].hh.b0 = 2;
1910 if (totalshrink[o]!= 0)
1911 mem[r + 6].gr =(- (integer) x)/ ((double) totalshrink[o]);
1914 mem[r + 5].hh.b0 = 0;
1915 mem[r + 6].gr = 0.0;
1917 /* if (total_shrink[o]<-x)and(o=normal)and(list_ptr(r)<>null) then l.13046 */
1918 if ((totalshrink[o]< - (integer) x)&&(o == 0)&&(mem[r + 5
1921 last_badness = 1000000L;
1922 mem[r + 6].gr = 1.0;
1923 if ((- (integer) x - totalshrink[0]> eqtb[(hash_size + 3739)].cint)||(
1924 eqtb[(hash_size + 3190)].cint < 100))
1927 print_nl("Overfull \\vbox("); /* */
1928 print_scaled(- (integer) x - totalshrink[0]);
1929 print_string("pt too high");
1930 overfull_vbox++; /* 1996/Feb/9 */
1934 /* else if o=normal then if list_ptr(r)<>null then l.13052 */
1936 if (mem[r + 5].hh.v.RH != 0)
1938 last_badness = badness(- (integer) x, totalshrink[0]);
1939 if (last_badness > eqtb[(hash_size + 3190)].cint)
1942 print_nl("Tight \\vbox (badness "); /* */
1943 print_int(last_badness);
1949 lab50: if (output_active)
1950 print_string(")has occurred while \\output is active");
1952 if (pack_begin_line != 0)
1954 print_string(")in alignment at lines ");
1955 print_int(abs(pack_begin_line));
1958 else print_string(")detected at line ");
1962 begin_diagnostic ();
1964 end_diagnostic(true);
1968 void append_to_vlist_(halfword b)
1972 if (cur_list.aux_field.cint > ignore_depth)
1974 d = mem[eqtb[(hash_size + 783)].hh.v.RH + 1].cint - cur_list.aux_field.cint -
1976 if (d < eqtb[(hash_size + 3732)].cint)
1977 p = new_param_glue(0);
1979 p = new_skip_param(1);
1980 mem[temp_ptr + 1].cint = d;
1982 mem[tail].hh.v.RH = p;
1985 mem[tail].hh.v.RH = b;
1987 cur_list.aux_field.cint = mem[b + 2].cint;
1989 halfword new_noad (void)
1990 {register halfword Result;
1995 mem[p + 1].hh = empty_field;
1996 mem[p + 3].hh = empty_field;
1997 mem[p + 2].hh = empty_field;
2001 halfword new_style_(small_number s)
2002 {register halfword Result;
2007 mem[p + 1].cint = 0;
2008 mem[p + 2].cint = 0;
2012 halfword new_choice (void)
2014 register halfword Result;
2019 mem[p + 1].hh.v.LH = 0;
2020 mem[p + 1].hh.v.RH = 0;
2021 mem[p + 2].hh.v.LH = 0;
2022 mem[p + 2].hh.v.RH = 0;
2026 void show_info (void)
2028 show_node_list(mem[temp_ptr].hh.v.LH);
2030 halfword fraction_rule_(scaled t)
2032 register halfword Result;
2035 mem[p + 3].cint = t;
2036 mem[p + 2].cint = 0;
2040 halfword overbar_(halfword b, scaled k, scaled t)
2042 register halfword Result;
2046 q = fraction_rule(t);
2050 Result = vpackage(p, 0, 1, 1073741823L); /* 2^30 - 1 */
2053 halfword char_box_(internal_font_number f, quarterword c)
2055 register halfword Result;
2059 q = font_info[char_base[f]+ c].qqqq;
2061 b = new_null_box ();
2062 mem[b + 1].cint = font_info[width_base[f]+ q.b0].cint + font_info
2063 [italic_base[f]+(q.b2)/ 4].cint;
2064 mem[b + 3].cint = font_info[height_base[f]+(hd)/ 16].cint;
2065 mem[b + 2].cint = font_info[depth_base[f]+(hd)% 16].cint;
2066 /* long to unsigned short ... */
2070 mem[b + 5].hh.v.RH = p;
2074 void stack_into_box_(halfword b, internal_font_number f, quarterword c)
2078 mem[p].hh.v.RH = mem[b + 5].hh.v.RH;
2079 mem[b + 5].hh.v.RH = p;
2080 mem[b + 3].cint = mem[p + 3].cint;
2082 scaled height_plus_depth_(internal_font_number f, fquarterword c)
2084 register scaled Result;
2087 q = font_info[char_base[f]+ c].qqqq;
2089 Result = font_info[height_base[f]+(hd)/ 16].cint + font_info[
2090 depth_base[f]+(hd)% 16].cint;
2093 halfword var_delimiter_(halfword d, small_number s, scaled v)
2095 register halfword Result;
2097 internal_font_number f, g;
2098 quarterword c, x, y;
2105 /* small_number z; */
2106 int z; /* 95/Jan/7 */
2107 /* bool largeattempt; */
2108 int largeattempt; /* 95/Jan/7 */
2111 largeattempt = false;
2115 if ((z != 0)||(x != 0))
2120 g = eqtb[(hash_size + 1835) + z].hh.v.RH;
2124 if ((y >= font_bc[g])&&(y <= font_ec[g]))
2126 lab22: q = font_info[char_base[g]+ y].qqqq;
2129 if (((q.b2)% 4)== 3)
2136 u = font_info[height_base[g]+(hd)/ 16].cint + font_info
2137 [depth_base[g]+(hd)% 16].cint;
2146 if (((q.b2)% 4)== 2)
2158 largeattempt = true;
2163 if (((q.b2)% 4)== 3) /* q may be used without ... */
2165 b = new_null_box ();
2167 r = font_info[exten_base[f]+ q.b3].qqqq;
2169 u = height_plus_depth(f, c);
2171 q = font_info[char_base[f]+ c].qqqq;
2172 mem[b + 1].cint = font_info[width_base[f]+ q.b0].cint +
2173 font_info[italic_base[f]+(q.b2)/ 4].cint;
2176 w = w + height_plus_depth(f, c);
2179 w = w + height_plus_depth(f, c);
2182 w = w + height_plus_depth(f, c);
2194 stack_into_box(b, f, c);
2197 register integer for_end;
2200 if (m <= for_end) do
2201 stack_into_box(b, f, c);
2202 while(m++ < for_end);
2207 stack_into_box(b, f, c);
2210 register integer for_end;
2213 if (m <= for_end) do
2214 stack_into_box(b, f, c);
2215 while(m++ < for_end);
2220 stack_into_box(b, f, c);
2221 mem[b + 2].cint = w - mem[b + 3].cint;
2223 else b = char_box(f, c);
2224 else { /* c may be used without ... */
2225 b = new_null_box ();
2226 mem[b + 1].cint = eqtb[(hash_size + 3741)].cint;
2228 mem[b + 4].cint = half(mem[b + 3].cint - mem[b + 2].cint)-
2229 font_info[22 + param_base[eqtb[(hash_size + 1837) + s].hh.v.RH]].cint;
2233 /* rebox_ etc used to follow here in tex4.c */