/* sec 0440 */
void scan_int (void)
{
- bool negative;
+ boolean negative;
integer m;
small_number d;
- bool vacuous;
- bool OKsofar;
+ boolean vacuous;
+ boolean OKsofar;
radix = 0;
OKsofar = true;
cur_val = - (integer) cur_val;
}
/* sec 0448 */
-void scan_dimen_(bool mu, bool inf, bool shortcut)
+void scan_dimen_(boolean mu, boolean inf, boolean shortcut)
{
- bool negative;
+ boolean negative;
integer f;
integer num, denom;
small_number k, kk;
goto lab88;
if (scan_keyword("in"))
- {
- num = 7227;
- denom = 100;
- }
+ set_conversion(7227, 100);
else if (scan_keyword("pc"))
- {
- num = 12;
- denom = 1;
- }
+ set_conversion(12, 1);
else if (scan_keyword("cm"))
- {
- num = 7227;
- denom = 254;
- }
+ set_conversion(7227, 254);
else if (scan_keyword("mm"))
- {
- num = 7227;
- denom = 2540;
- }
+ set_conversion(7227, 2540);
else if (scan_keyword("bp"))
- {
- num = 7227;
- denom = 7200;
- }
+ set_conversion(7227, 7200);
else if (scan_keyword("dd"))
- {
- num = 1238;
- denom = 1157;
- }
+ set_conversion(1238, 1157);
else if (scan_keyword("cc"))
- {
- num = 14856;
- denom = 1157;
- }
+ set_conversion(14856, 1157);
else if (scan_keyword("Q"))
- {
- num = 7227;
- denom = 10160;
- }
+ set_conversion(7227, 10160);
else if (scan_keyword("H"))
- {
- num = 7227;
- denom = 10160;
- }
+ set_conversion(7227, 10160);
else if (scan_keyword("sp"))
goto lab30;
else
/* sec 0461 */
void scan_glue_(small_number level)
{
- bool negative;
+ boolean negative;
halfword q;
- bool mu;
+ boolean mu;
mu = (level == mu_val);
negative = false;
t = space_token;
else
t = other_token + t;
- {
- {
- q = avail;
- if (q == 0)
- q = get_avail();
- else
- {
- avail = mem[q].hh.v.RH;
- mem[q].hh.v.RH = 0;
-#ifdef STAT
- incr(dyn_used);
-#endif /* STAT */
- }
- }
- mem[p].hh.v.RH = q;
- mem[q].hh.v.LH = t;
- p = q;
- }
+ fast_store_new_token(t);
incr(k);
}
+
pool_ptr = b;
return p;
if (cur_val_level >= ident_val)
{
- p = temp_head;
+ p = temp_head;
link(p) = 0;
if (cur_val_level == ident_val)
- {
- q = get_avail();
- mem[p].hh.v.RH = q;
- mem[q].hh.v.LH = cs_token_flag + cur_val;
- p = q;
- }
+ store_new_token(cs_token_flag + cur_val);
else if (cur_val != 0)
{
r = link(cur_val);
- while (r != 0) { /* while r<>null do l.9178 */
- {
- {
- q = avail;
- if (q == 0)
- q = get_avail();
- else
- {
- avail = mem[q].hh.v.RH;
- mem[q].hh.v.RH = 0;
-#ifdef STAT
- incr(dyn_used);
-#endif /* STAT */
- }
- }
- mem[p].hh.v.RH = q;
- mem[q].hh.v.LH = mem[r].hh.v.LH;
- p = q;
- }
+ while (r != 0)
+ {
+ fast_store_new_token(info(r));
r = link(r);
}
}
+
Result = p;
}
else
begin_token_list(link(temp_head), 4);
}
/* sec 0473 */
-halfword scan_toks_(bool macrodef, bool xpand)
+halfword scan_toks_(boolean macrodef, boolean xpand)
{
register halfword Result;
halfword t;
if (cur_cmd == left_brace)
{
hashbrace = cur_tok;
- {
- q = get_avail();
- mem[p].hh.v.RH = q;
- mem[q].hh.v.LH = cur_tok;
- p = q;
- }
- {
- q = get_avail();
- mem[p].hh.v.RH = q;
- mem[q].hh.v.LH = end_match_token;
- p = q;
- }
+ store_new_token(cur_tok);
+ store_new_token(end_match_token);
goto lab30;
}
cur_tok = s;
}
}
- {
- q = get_avail();
- mem[p].hh.v.RH = q;
- mem[q].hh.v.LH = cur_tok;
- p = q;
- }
+
+ store_new_token(cur_tok);
}
+
lab31:
- {
- q = get_avail();
- mem[p].hh.v.RH = q;
- mem[q].hh.v.LH = end_match_token;
- p = q;
- }
+ store_new_token(end_match_token);
if (cur_cmd == right_brace)
{
else
cur_tok = out_param_token - '0' + cur_chr;
}
- {
- q = get_avail();
- mem[p].hh.v.RH = q;
- mem[q].hh.v.LH = cur_tok;
- p = q;
- }
+
+ store_new_token(cur_tok);
}
lab40:
scanner_status = 0;
if (hashbrace != 0)
- {
- q = get_avail();
- mem[p].hh.v.RH = q;
- mem[q].hh.v.LH = hashbrace;
- p = q;
- }
+ store_new_token(hashbrace);
+
Result = p;
return Result;
}
def_ref = get_avail();
token_ref_count(def_ref) = 0;
p = def_ref;
-
- {
- q = get_avail();
- mem[p].hh.v.RH = q;
- mem[q].hh.v.LH = end_match_token;
- p = q;
- }
+ store_new_token(end_match_token);
if ((n < 0) || (n > 15))
m = 16;
goto lab30;
}
- {
- q = get_avail();
- mem[p].hh.v.RH = q;
- mem[q].hh.v.LH = cur_tok;
- p = q;
- }
+ store_new_token(cur_tok);
}
lab30:
end_file_reading();
/* sec 0498 */
void conditional (void)
{
- bool b;
+ boolean b;
char r;
integer m, n;
halfword p, q;
/* sec 0515 */
void begin_name (void)
{
- area_delimiter = 0; /* index between `file area' and `file name' */
- ext_delimiter = 0; /* index between `file name' and `file extension' */
+ area_delimiter = 0;
+ ext_delimiter = 0;
}
/* This gathers up a file name and makes a string of it */
/* Also tries to break it into `file area' `file name' and `file extension' */
/* We assume tilde has been converted to pseudo_tilde and space to pseudo_space */
/* returns false if it is given a space character - end of file name */
/* sec 0516 */
-bool more_name_(ASCII_code c)
+boolean more_name_(ASCII_code c)
{
if (quoted_file_name == 0 && c == ' ')
return false;
return true; /* accept ending quote, but throw away */
}
else
- {
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
-/* convert pseudo tilde back to '~' 95/Sep/26 */ /* moved here 97/June/5 */
-/* if (pseudo_tilde != 0 && c == pseudo_tilde) c = '~'; */
-/* convert pseudo space back to ' ' 97/June/5 */ /* moved here 97/June/5 */
-/* if (pseudo_space != 0 && c == pseudo_space) c = ' '; */
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
+ {
str_room(1);
append_char(c);
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
-// if ((c == 47)) /* / */
-// for DOS/Windows
- if ((c == '/' || c == '\\' || c == ':')) /* 94/Mar/1 */
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
+ // for DOS/Windows
+ if ((c == '/' || c == '\\' || c == ':'))
{
area_delimiter = cur_length;
ext_delimiter = 0;
}
else if (c == '.')
ext_delimiter = cur_length;
+
return true;
}
}
int k, nlen = end - start;
char *s;
-// int trace_flag = 1; // debugging only
-
if (trace_flag)
{
sprintf(log_line, "\nLOOKING for string (str_ptr %d nlen %d) ", str_ptr, end - start);
if (str_ptr + 3 > current_max_strings)
{
- overflow("number of strings", current_max_strings - init_str_ptr); /* 97/Mar/7 */
+ overflow("number of strings", current_max_strings - init_str_ptr);
return; // abort_flag set
}
#else
if (str_ptr + 3 > max_strings)
{
- overflow("number of strings", max_strings - init_str_ptr); /* number of strings */
+ overflow("number of strings", max_strings - init_str_ptr);
return; // abort_flag set
}
#endif
-// if (notfirst++ == 0) show_all_strings(); // debugging only
-
if (area_delimiter == 0) // no area delimiter ':' '/' or '\' found
cur_area = 335; // "" default area
else
c = str_pool[j];
incr(k);
- if (k <= PATHMAX)
+ if (k <= PATH_MAX)
name_of_file[k] = xchr[c];
}
c = str_pool[j];
incr(k);
- if (k <= PATHMAX)
+ if (k <= PATH_MAX)
name_of_file[k] = xchr[c];
}
c = str_pool[j];
incr(k);
- if (k <= PATHMAX)
+ if (k <= PATH_MAX)
name_of_file[k] = xchr[c];
}
- if (k < PATHMAX)
+ if (k < PATH_MAX)
name_length = k;
else
- name_length = PATHMAX - 1;
+ name_length = PATH_MAX - 1;
/* pad it out with spaces ... what for ? in case we modify and forget ? */
- for (k = name_length + 1; k <= PATHMAX; k++)
+ for (k = name_length + 1; k <= PATH_MAX; k++)
name_of_file[k] = ' ';
- name_of_file[PATHMAX] = '\0'; /* paranoia 94/Mar/24 */
+ name_of_file[PATH_MAX] = '\0'; /* paranoia 94/Mar/24 */
{
name_of_file [name_length+1] = '\0';
ASCII_code c;
integer j;
- if (n + b - a + 5 > PATHMAX)
- b = a + PATHMAX - n - 5;
+ if (n + b - a + 5 > PATH_MAX)
+ b = a + PATH_MAX - n - 5;
k = 0;
c = xord[TEX_format_default[j]];
incr(k);
- if (k <= PATHMAX)
+ if (k <= PATH_MAX)
name_of_file[k] = xchr[c];
}
/* This loop kicks in when we want a specififed format name */
c = buffer[j];
incr(k);
- if (k <= PATHMAX)
+ if (k <= PATH_MAX)
name_of_file[k] = xchr[c];
}
c = xord[TEX_format_default[j]];
incr(k);
- if (k <= PATHMAX)
+ if (k <= PATH_MAX)
name_of_file[k] = xchr[c];
}
- if (k < PATHMAX)
+ if (k < PATH_MAX)
name_length = k;
else
- name_length = PATHMAX - 1;
+ name_length = PATH_MAX - 1;
/* pad it out with spaces ... what for ? */
- for (k = name_length + 1; k <= PATHMAX; k++)
+ for (k = name_length + 1; k <= PATH_MAX; k++)
name_of_file[k]= ' ';
- name_of_file[PATHMAX] = '\0'; /* paranoia 94/Mar/24 */
+ name_of_file[PATH_MAX] = '\0'; /* paranoia 94/Mar/24 */
}
/* sec 0525 */
str_number make_name_string (void)
/* sec 0537 */
void start_input(void)
{
- bool added_extension = false;
+ boolean added_extension = false;
scan_file_name();
pack_file_name(cur_name, cur_area, cur_ext);
if ((cur_ext != 335) && a_open_in(input_file[cur_input.index_field], TEXINPUTPATH))
goto lab30;
- if ((cur_ext != 785) && (name_length + 5 < PATHMAX))
+ if ((cur_ext != 785) && (name_length + 5 < PATH_MAX))
{
name_of_file[name_length + 1] = '.';
name_of_file[name_length + 2] = 't';
internal_font_number read_font_info_(halfword u, str_number nom, str_number aire, scaled s)
{
font_index k;
- bool fileopened;
-/* halfword lf, lh, bc, ec, nw, nh, nd, ni, nl, nk, ne, np; */
+ boolean file_opened;
halfword lf, lh, nw, nh, nd, ni, nl, nk, ne, np;
-/* halfword bc, ec; */
- int bc, ec; /* 95/Jan/7 */
+ int bc, ec;
internal_font_number f;
internal_font_number g;
eight_bits a, b, c, d;
- ffour_quarters qw;
+ four_quarters qw;
scaled sw;
- integer bchlabel;
+ integer bch_label;
short bchar;
scaled z;
integer alpha;
char beta;
g = 0;
- fileopened = false;
+ file_opened = false;
pack_file_name(nom, aire, 805); /* .tfm */
- if (!b_open_in(tfm_file)) /* new in C version d */
+ if (!b_open_in(tfm_file))
{
goto lab11;
}
-/* was just: goto lab11; */
- fileopened = true;
+
+ file_opened = true;
+
{
-/* tfm_temp = getc(tfm_file); */ /* done already in open_input, but why? */
- //tfm_temp = getc(tfm_file);
- {
- lf = tfm_temp;
- if (lf > 127)
- goto lab11;
- tfm_temp = getc(tfm_file);
- lf = lf * 256 + tfm_temp;
- }
+ read_sixteen(lf);
tfm_temp = getc(tfm_file);
- {
- lh = tfm_temp;
- if (lh > 127)
- goto lab11;
- tfm_temp = getc(tfm_file);
- lh = lh * 256 + tfm_temp;
- }
+ read_sixteen(lh);
tfm_temp = getc(tfm_file);
- {
- bc = tfm_temp;
- if (bc > 127)
- goto lab11;
- tfm_temp = getc(tfm_file);
- bc = bc * 256 + tfm_temp;
- }
+ read_sixteen(bc);
tfm_temp = getc(tfm_file);
- {
- ec = tfm_temp;
- if (ec > 127)
- goto lab11;
- tfm_temp = getc(tfm_file);
- ec = ec * 256 + tfm_temp;
- }
- if ((bc > ec + 1)||(ec > 255))
+ read_sixteen(ec);
+
+ if ((bc > ec + 1) || (ec > 255))
goto lab11;
+
if (bc > 255)
{
bc = 1;
ec = 0;
}
+
tfm_temp = getc(tfm_file);
- {
- nw = tfm_temp;
- if (nw > 127)
- goto lab11;
- tfm_temp = getc(tfm_file);
- nw = nw * 256 + tfm_temp;
- }
+ read_sixteen(nw);
tfm_temp = getc(tfm_file);
- {
- nh = tfm_temp;
- if (nh > 127)
- goto lab11;
- tfm_temp = getc(tfm_file);
- nh = nh * 256 + tfm_temp;
- }
+ read_sixteen(nh);
tfm_temp = getc(tfm_file);
- {
- nd = tfm_temp;
- if (nd > 127)
- goto lab11;
- tfm_temp = getc(tfm_file);
- nd = nd * 256 + tfm_temp;
- }
+ read_sixteen(nd);
tfm_temp = getc(tfm_file);
- {
- ni = tfm_temp;
- if (ni > 127)
- goto lab11;
- tfm_temp = getc(tfm_file);
- ni = ni * 256 + tfm_temp;
- }
+ read_sixteen(ni);
tfm_temp = getc(tfm_file);
- {
- nl = tfm_temp;
- if (nl > 127)
- goto lab11;
- tfm_temp = getc(tfm_file);
- nl = nl * 256 + tfm_temp;
- }
+ read_sixteen(nl);
tfm_temp = getc(tfm_file);
- {
- nk = tfm_temp;
- if (nk > 127)
- goto lab11;
- tfm_temp = getc(tfm_file);
- nk = nk * 256 + tfm_temp;
- }
+ read_sixteen(nk);
tfm_temp = getc(tfm_file);
- {
- ne = tfm_temp;
- if (ne > 127)
- goto lab11;
- tfm_temp = getc(tfm_file);
- ne = ne * 256 + tfm_temp;
- }
+ read_sixteen(ne);
tfm_temp = getc(tfm_file);
- {
- np = tfm_temp;
- if (np > 127)
- goto lab11;
- tfm_temp = getc(tfm_file);
- np = np * 256 + tfm_temp;
- }
+ read_sixteen(np);
+
if (lf != 6 + lh + (ec - bc + 1) + nw + nh + nd + ni + nl + nk + ne + np)
goto lab11;
if (np < 7)
lf = lf + 7 - np;
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
+
#ifdef ALLOCATEFONT
- if ((fmem_ptr + lf > current_font_mem_size)) /* 93/Nov/28 */
+ if ((fmem_ptr + lf > current_font_mem_size))
font_info = realloc_font_info (increment_font_mem_size + lf);
if ((font_ptr == font_max) || (fmem_ptr + lf > current_font_mem_size))
if (trace_flag)
{
sprintf(log_line, "font_ptr %d font_max %d fmem_ptr %d lf %d font_mem_size %d\n",
- font_ptr, font_max, fmem_ptr, lf, font_mem_size); /* debugging */
+ font_ptr, font_max, fmem_ptr, lf, font_mem_size);
show_line(log_line, 0);
}
{
if (lh < 2)
goto lab11;
-/* build the font checksum now */
- {
- tfm_temp = getc(tfm_file);
- a = tfm_temp;
- qw.b0 = a;
- tfm_temp = getc(tfm_file);
- b = tfm_temp;
- qw.b1 = b;
- tfm_temp = getc(tfm_file);
- c = tfm_temp;
- qw.b2 = c;
- tfm_temp = getc(tfm_file);
- d = tfm_temp;
- qw.b3 = d;
- font_check[f] = qw;
- }
-
+
+ store_four_quarters(font_check[f]);
tfm_temp = getc(tfm_file);
- {
- z = tfm_temp;
- if (z > 127)
- goto lab11;
- tfm_temp = getc(tfm_file);
- z = z * 256 + tfm_temp;
- }
-
+ read_sixteen(z);
tfm_temp = getc(tfm_file);
z = z * 256 + tfm_temp;
tfm_temp = getc(tfm_file);
for (k = fmem_ptr; k <= width_base[f] - 1; k++)
{
- {
- tfm_temp = getc(tfm_file);
- a = tfm_temp;
- qw.b0 = a;
- tfm_temp = getc(tfm_file);
- b = tfm_temp;
- qw.b1 = b;
- tfm_temp = getc(tfm_file);
- c = tfm_temp;
- qw.b2 = c;
- tfm_temp = getc(tfm_file);
- d = tfm_temp;
- qw.b3 = d;
- font_info[k].qqqq = qw;
- }
+ store_four_quarters(font_info[k].qqqq);
if ((a >= nw) || (b / 16 >= nh) || (b % 16 >= nd) || (c / 4 >= ni))
goto lab11;
switch (c % 4)
{
- case 1 :
+ case lig_tag:
if (d >= nl)
goto lab11;
break;
- case 3 :
+ case ext_tag:
if (d >= ne)
goto lab11;
break;
- case 2 :
+ case list_tag:
{
{
- if ((d < bc)||(d > ec))
+ if ((d < bc) || (d > ec))
goto lab11;
}
while (d < k + bc - fmem_ptr)
{
- qw = font_info[char_base[f]+ d].qqqq;
+ qw = char_info(f, d);
- if (((qw.b2)% 4)!= 2)
+ if (char_tag(qw) != list_tag)
goto lab45;
- d = qw.b3;
+ d = rem_byte(qw);
}
if (d == k + bc - fmem_ptr)
break;
}
}
+
{
{
alpha = 16;
if (font_info[italic_base[f]].cint != 0)
goto lab11;
}
-/* read ligature/kern program */
- bchlabel = 32767; /* '77777 */
+
+ bch_label = 32767; /* '77777 */
bchar = 256;
if (nl > 0)
{
for (k = lig_kern_base[f]; k <= kern_base[f] + 256 * (128) - 1; k++)
{
- {
- tfm_temp = getc(tfm_file);
- a = tfm_temp;
- qw.b0 = a;
- tfm_temp = getc(tfm_file);
- b = tfm_temp;
- qw.b1 = b;
- tfm_temp = getc(tfm_file);
- c = tfm_temp;
- qw.b2 = c;
- tfm_temp = getc(tfm_file);
- d = tfm_temp;
- qw.b3 = d;
- font_info[k].qqqq = qw; /* store_four_quarters(font_info[k].qqqq */
- }
+ store_four_quarters(font_info[k].qqqq);
if (a > 128)
{
}
else if (256 * (c - 128) + d >= nk)
goto lab11; /* error in TFM, abort */
+
if (a < 128)
if (k - lig_kern_base[f] + a + 1 >= nl)
goto lab11; /* error in TFM, abort */
}
if (a == 255)
- bchlabel = 256 * c + d;
+ bch_label = 256 * c + d;
}
for (k = kern_base[f] + 256 * (128); k <= exten_base[f] - 1; k++)
font_info[k].cint = sw - alpha;
else goto lab11;
}
-/* read extensible character recipes */
-/* for k:=exten_base[f] to param_base[f]-1 do */
+
+ /* read extensible character recipes */
for (k = exten_base[f]; k <= param_base[f] - 1; k++)
{
- {
- tfm_temp = getc(tfm_file);
- a = tfm_temp;
- qw.b0 = a;
- tfm_temp = getc(tfm_file);
- b = tfm_temp;
- qw.b1 = b;
- tfm_temp = getc(tfm_file);
- c = tfm_temp;
- qw.b2 = c;
- tfm_temp = getc(tfm_file);
- d = tfm_temp;
- qw.b3 = d;
-/* store_four_quarters(font_info[k].qqqq); */
- font_info[k].qqqq = qw;
- }
+ store_four_quarters(font_info[k].qqqq);
if (a != 0)
{
if (!(qw.b0 > 0))
goto lab11;
}
+
{
{
if ((d < bc) || (d > ec))
goto lab11;
}
}
+
{
for (k = 1; k <= np; k++)
if (k == 1)
hyphen_char[f] = default_hyphen_char;
skew_char[f] = default_skew_char;
- if (bchlabel < nl)
- bchar_label[f] = bchlabel + lig_kern_base[f];
+ if (bch_label < nl)
+ bchar_label[f] = bch_label + lig_kern_base[f];
else
bchar_label[f] = non_address;
print_int(- (integer) s);
}
- if (fileopened)
+ if (file_opened)
print_string(" not loadable: Bad metric (TFM) file");
else
print_string(" not loadable: Metric (TFM) file not found");
error();
lab30:
- if (fileopened)
+ if (file_opened)
b_close(tfm_file);
return g;