#define EXTERN extern
-#include "texd.h"
+#include "yandytex.h"
/* sec 0715 */
-halfword rebox_(halfword b, scaled w)
+pointer rebox (pointer b, scaled w)
{
- halfword p;
+ pointer p;
internal_font_number f;
scaled v;
return b;
}
}
-/* This is to be the start of tex5.c */
/* sec 0716 */
-halfword math_glue_(halfword g, scaled m)
+pointer math_glue (pointer g, scaled m)
{
- halfword p;
+ pointer p;
integer n;
scaled f;
}
p = get_node(glue_spec_size);
- width(p) = mult_and_add(n, width(g), xn_over_d(width(g), f, 65536L), 1073741823L); /* 2^30 - 1 */
+ width(p) = mu_mult(width(g));
stretch_order(p) = stretch_order(g);
if (stretch_order(p) == normal)
- stretch(p) = mult_and_add(n, stretch(g), xn_over_d(stretch(g), f, 65536L), 1073741823L); /* 2^30 - 1 */
+ stretch(p) = mu_mult(stretch(g));
else
stretch(p) = stretch(g);
shrink_order(p) = shrink_order(g);
if (shrink_order(p) == normal)
- shrink(p) = mult_and_add(n, shrink(g), xn_over_d(shrink(g), f, 65536L), 1073741823L); /* 2^30 - 1 */
+ shrink(p) = mu_mult(shrink(g));
else
shrink(p) = shrink(g);
return p;
}
/* sec 0717 */
-void math_kern_ (halfword p, scaled m)
+void math_kern (pointer p, scaled m)
{
integer n;
scaled f;
f = f + 65536L;
}
- width(p) = mult_and_add(n, width(p), xn_over_d(width(p), f, 65536L), 1073741823L); /* 2^30 - 1 */
+ width(p) = mu_mult(width(p));
subtype(p) = explicit;
}
}
incompleat_noad = 0;
}
/* sec 0720 */
-halfword clean_box_(halfword p, small_number s)
+pointer clean_box (pointer p, small_number s)
{
- halfword q;
+ pointer q;
small_number save_style;
- halfword x;
- halfword r;
+ pointer x;
+ pointer r;
switch (math_type(p))
{
cur_mu = x_over_n(math_quad(cur_size), 18);
}
+
found:
if (is_char_node(q) || (q == 0))
x = hpack(q, 0, 1);
return x;
}
/* sec 0722 */
-void fetch_(halfword a)
+void fetch_(pointer a)
{
cur_c = character(a);
cur_f = fam_fnt(fam(a) + cur_size);
else
cur_i = null_character;
- if (!((cur_i.b0 > 0)))
+ if (!char_exists(cur_i))
{
char_warning(cur_f, cur_c);
math_type(a) = 0;
}
}
/* sec 0734 */
-void make_over_(halfword q)
+void make_over (pointer q)
{
info(nucleus(q)) = overbar(clean_box(nucleus(q), 2 * (cur_style / 2) + 1),
3 * default_rule_thickness, default_rule_thickness);
math_type(nucleus(q)) = sub_box;
}
/* sec 0735 */
-void make_under_(halfword q)
+void make_under (pointer q)
{
- halfword p, x, y;
+ pointer p, x, y;
scaled delta;
x = clean_box(nucleus(q), cur_style);
p = new_kern(3 * default_rule_thickness);
link(x) = p;
link(p) = fraction_rule(default_rule_thickness);
- y = vpackage(x, 0, 1, 1073741823L); /* 2^30 - 1 */
+ y = vpackage(x, 0, 1, max_dimen);
delta = height(y) + depth(y) + default_rule_thickness;
height(y) = height(x);
depth(y) = delta - height(y);
math_type(nucleus(q)) = sub_box;
}
/* sec 0736 */
-void make_vcenter_(halfword q)
+void make_vcenter (pointer q)
{
- halfword v;
+ pointer v;
scaled delta;
v = info(nucleus(q));
depth(v) = delta - height(v);
}
/* sec 0737 */
-void make_radical_(halfword q)
+void make_radical (pointer q)
{
- halfword x, y;
+ pointer x, y;
scaled delta, clr;
x = clean_box(nucleus(q), 2 * (cur_style / 2) + 1);
math_type(nucleus(q)) = sub_box;
}
/* sec 0738 */
-void make_math_accent_(halfword q)
+void make_math_accent (pointer q)
{
- halfword p, x, y;
+ pointer p, x, y;
integer a;
quarterword c;
internal_font_number f;
fetch(accent_chr(q));
- if ((cur_i.b0 > 0))
+ if (char_exists(cur_i))
{
i = cur_i;
c = cur_c;
if (op_byte(cur_i) >= kern_flag)
if (skip_byte(cur_i) <= stop_flag)
s = char_kern(cur_f, cur_i);
+
goto done1;
}
}
}
}
-done1:;
+
+done1:
x = clean_box(nucleus(q), cramped_style(cur_style));
w = width(x);
h = height(x);
y = rem_byte(i);
i = char_info(f, y);
- if (!(i.b0 > 0))
+ if (!char_exists(i))
goto done;
if (char_width(f, i) > w)
c = y;
}
-done:;
+
+done:
if (h < x_height(f))
delta = h;
else
{
flush_node_list(x);
x = new_noad();
- mem[nucleus(x)]= mem[nucleus(q)];
- mem[supscr(x)]= mem[supscr(q)];
- mem[subscr(x)]= mem[subscr(q)];
+ mem[nucleus(x)] = mem[nucleus(q)];
+ mem[supscr(x)] = mem[supscr(q)];
+ mem[subscr(x)] = mem[subscr(q)];
mem[supscr(q)].hh = empty_field;
mem[subscr(q)].hh = empty_field;
math_type(nucleus(q)) = sub_mlist;
y = char_box(f, c);
shift_amount(y) = s + half(w - width(y));
width(y) = 0;
- p = new_kern(- (integer) delta);
+ p = new_kern(-(integer) delta);
link(p) = x;
link(y) = p;
- y = vpackage(y, 0, 1, 1073741823L); /* 2^30 - 1 */
+ y = vpackage(y, 0, 1, max_dimen);
width(y) = width(x);
if (height(y) < h)
}
}
/* sec 0743 */
-void make_fraction_(halfword q)
+void make_fraction (pointer q)
{
- halfword p, v, x, y, z;
+ pointer p, v, x, y, z;
scaled delta, delta1, delta2, shift_up, shift_down, clr;
- if (thickness(q) == default_code) /* 2^30 */
+ if (thickness(q) == default_code)
thickness(q) = default_rule_thickness;
x = clean_box(numerator(q), num_style(cur_style));
delta = half(thickness(q));
delta1 = clr - ((shift_up - depth(x)) - (axis_height(cur_size) + delta));
- delta2 = clr -((axis_height(cur_size) - delta) - (height(z) - shift_down));
+ delta2 = clr - ((axis_height(cur_size) - delta) - (height(z) - shift_down));
if (delta1 > 0)
shift_up = shift_up + delta1;
link(v) = z;
new_hlist(q) = hpack(x, 0, 1);
}
-/***************************************************************************/
-scaled make_op_ (halfword);
-/***************************************************************************/
/* sec 0752 */
-void make_ord_(halfword q)
+void make_ord (pointer q)
{
integer a;
- halfword p, r;
+ pointer p, r;
restart:
if (math_type(subscr(q)) == 0)
}
else
{
- {
- if (interrupt != 0)
- {
- pause_for_instructions();
- }
- }
+ check_interrupt();
switch (op_byte(cur_i))
{
}
}
}
-/***************************************************************************/
-void make_scripts_ (halfword, scaled);
-/***************************************************************************/
/* sec 0762 */
-small_number make_left_right_(halfword q, small_number style, scaled max_d, scaled max_h)
+small_number make_left_right (pointer q, small_number style, scaled max_d, scaled max_h)
{
scaled delta, delta1, delta2;
delta = delta2;
new_hlist(q) = var_delimiter(delimiter(q), cur_size, delta);
+
return type(q) - (left_noad - open_noad);
}
/* sec 0726 */
void mlist_to_hlist (void)
{
- halfword mlist;
+ pointer mlist;
boolean penalties;
small_number style;
small_number save_style;
- halfword q;
- halfword r;
-/* small_number r_type; */
- int r_type; /* 95/Jan/7 */
-/* small_number t; */
- int t; /* 95/Jan/7 */
- halfword p, x, y, z;
+ pointer q;
+ pointer r;
+ /* small_number r_type; */
+ int r_type;
+ /* small_number t; */
+ int t;
+ pointer p, x, y, z;
integer pen;
small_number s;
scaled max_h, max_d;
break;
default:
- ;
+ do_nothing();
break;
}
break;
case open_noad:
case inner_noad:
- ;
+ do_nothing();
break;
case radical_noad:
switch (cur_style / 2)
{
case 0:
- {
- p = display_mlist(q);
- display_mlist(q) = 0;
- }
+ choose_mlist(display_mlist);
break;
case 1:
- {
- p = text_mlist(q);
- text_mlist(q) = 0;
- }
+ choose_mlist(text_mlist);
break;
case 2:
- {
- p = script_mlist(q);
- script_mlist(q) = 0;
- }
+ choose_mlist(script_mlist);
break;
case 3:
- {
- p = script_script_mlist(q);
- script_script_mlist(q) = 0;
- }
+ choose_mlist(script_script_mlist);
break;
}
link(p) = z;
}
+
goto done_with_node;
}
break;
flush_node_list(p);
}
}
+
goto done_with_node;
}
break;
{
fetch(nucleus(q));
- if ((cur_i.b0 > 0))
+ if (char_exists(cur_i))
{
delta = char_italic(cur_f, cur_i);
p = new_character(cur_f, cur_c);
goto check_dimensions;
make_scripts(q, delta);
+
check_dimensions:
z = hpack(new_hlist(q), 0, 1);
max_d = depth(z);
free_node(z, box_node_size);
+
done_with_noad:
r = q;
r_type = type(r);
+
done_with_node:
q = link(q);
}
case vcenter_noad:
case over_noad:
case under_noad:
- ;
+ do_nothing();
break;
case radical_noad:
}
r_type = t;
+
delete_q:
r = q;
q = link(q);
/* sec 0772 */
void push_alignment (void)
{
- halfword p;
+ pointer p;
p = get_node(align_stack_node_size);
link(p) = align_ptr;
/* sec 0772 */
void pop_alignment (void)
{
- halfword p;
+ pointer p;
free_avail(cur_head);
p = align_ptr;
/* sec 0774 */
void init_align (void)
{
- halfword save_cs_ptr;
- halfword p;
+ pointer save_cs_ptr;
+ pointer p;
save_cs_ptr = cur_cs;
push_alignment();
align_state = -1000000L;
- if ((mode == mmode) && ((tail != cur_list.head_field) || (incompleat_noad != 0)))
+ if ((mode == mmode) && ((tail != head) || (incompleat_noad != 0)))
{
print_err("Improper ");
print_esc("halign");
link(cur_align) = new_null_box();
cur_align = link(cur_align);
info(cur_align) = end_span;
- width(cur_align) = null_flag; /* - 2^30 */
+ width(cur_align) = null_flag;
u_part(cur_align) = link(hold_head);
p = hold_head;
link(p) = 0;
if (every_cr != 0)
begin_token_list(every_cr, every_cr_text);
+
align_peek();
}
/* sec 0787 */
-void init_span_ (halfword p)
+void init_span (pointer p)
{
push_nest();
/* sec 0799 */
void fin_row (void)
{
- halfword p;
+ pointer p;
if (mode == -hmode)
{
}
else
{
- p = vpackage(link(head), 0, 1, 1073741823L); /* 2^30 - 1 */
+ p = vpackage(link(head), 0, 1, max_dimen);
pop_nest();
link(tail) = p;
tail = p;
/* sec 0800 */
void fin_align (void)
{
- halfword p, q, r, s, u, v;
+ pointer p, q, r, s, u, v;
scaled t, w;
scaled o;
halfword n;
flush_list(v_part(q));
p = link(link(q));
- if (width(q) == null_flag) /* - 2^30 */
+ if (width(q) == null_flag)
{
width(q) = 0;
r = link(q);
}
while (!(q == 0));
- p = vpackage(preamble, saved(1), saved(0), 1073741823L); /* 2^30 - 1 */
+ p = vpackage(preamble, saved(1), saved(0), max_dimen);
q = link(preamble);
do
/* sec 0791 */
boolean fin_col (void)
{
- halfword p;
- halfword q, r;
- halfword s;
- halfword u;
+ pointer p;
+ pointer q, r;
+ pointer s;
+ pointer u;
scaled w;
glue_ord o;
halfword n;
return false;
}
/* sec 0749 */
-scaled make_op_(halfword q)
+scaled make_op (pointer q)
{
scaled delta;
- halfword p, v, x, y, z;
+ pointer p, v, x, y, z;
quarterword c;
four_quarters i;
scaled shift_up, shift_down;
c = rem_byte(cur_i);
i = char_info(cur_f, c);
- if ((i.b0 > 0))
+ if (char_exists(i))
{
cur_c = c;
cur_i = i;
return delta;
}
/* sec 0756 */
-void make_scripts_(halfword q, scaled delta)
+void make_scripts (pointer q, scaled delta)
{
- halfword p, x, y, z;
+ pointer p, x, y, z;
scaled shift_up, shift_down, clr;
small_number t;
p = new_kern((shift_up - depth(x)) - (height(y) - shift_down));
link(x) = p;
link(p) = y;
- x = vpackage(x, 0, 1, 1073741823L); /* 2^30 - 1 */
+ x = vpackage(x, 0, 1, max_dimen);
shift_amount(x) = shift_down;
}
}