else if ((cur_tok <= other_A_token + 5) && (cur_tok >= other_A_token))
d = cur_tok - other_A_token;
else
- goto lab30;
+ goto done;
else
- goto lab30;
+ goto done;
vacuous = false;
cur_val = cur_val * radix + d;
get_x_token();
}
-lab30:;
+done:;
if (vacuous)
{
}
if (cur_val_level == mu_val)
- goto lab89;
+ goto attach_sign;
if (cur_val_level != int_val)
mu_error();
scan_something_internal(dimen_val, false);
if (cur_val_level == dimen_val)
- goto lab89;
+ goto attach_sign;
}
}
else
get_x_token();
if ((cur_tok > zero_token + 9) || (cur_tok < zero_token))
- goto lab31;
+ goto done1;
if (k < 17)
{
incr(k);
}
}
-lab31:
+done1:
for (kk = k; kk >= 1; kk--)
{
dig[kk - 1] = info(p);
if (cur_order == filll)
{
print_err("Illegal unit of measure (");
- print_string("replaced by filll)");
+ prints("replaced by filll)");
help1("I dddon't go any higher than filll.");
error();
}
else
incr(cur_order);
}
- goto lab88;
+ goto attach_fraction;
}
}
}
v = cur_val;
- goto lab40;
+ goto found;
}
if (mu)
- goto lab45;
+ goto not_found;
if (scan_keyword("em"))
v = quad(cur_font);
else if (scan_keyword("ex"))
v = x_height(cur_font);
else
- goto lab45;
+ goto not_found;
{
get_x_token();
back_input();
}
-lab40:
+found:
cur_val = mult_and_add(savecurval, v, xn_over_d(v, f, 65536L), 1073741823L); /* 2^30 - 1 */
- goto lab89;
+ goto attach_sign;
-lab45:
+not_found:
if (mu)
{
if (scan_keyword("mu"))
- goto lab88;
+ goto attach_fraction;
else
{
print_err("Illegal unit of measure (");
- print_string("mu inserted)");
+ prints("mu inserted)");
help4("The unit of measurement in math glue must be mu.",
"To recover gracefully from this error, it's best to",
"delete the erroneous units; e.g., type `2' to delete",
"two letters. (See Chapter 27 of The TeXbook.)");
error();
- goto lab88;
+ goto attach_fraction;
}
}
}
if (scan_keyword("pt"))
- goto lab88;
+ goto attach_fraction;
if (scan_keyword("in"))
set_conversion(7227, 100);
else if (scan_keyword("H"))
set_conversion(7227, 10160);
else if (scan_keyword("sp"))
- goto lab30;
+ goto done;
else
{
print_err("Illegal unit of measure (");
- print_string("pt inserted)");
+ prints("pt inserted)");
help6("Dimensions can be in units of em, ex, in, pt, pc,",
"cm, mm, dd, cc, bp, or sp; but yours is a new one!",
"I'll assume that you meant to say pt, for printer's points.",
"delete the erroneous units; e.g., type `2' to delete",
"two letters. (See Chapter 27 of The TeXbook.)");
error();
- goto lab32;
+ goto done2;
}
cur_val = xn_over_d(cur_val, num, denom);
f = (num * f + 65536L * tex_remainder) / denom;
cur_val = cur_val +(f / 65536L);
f = f % 65536L;
-lab32:;
-lab88:
+
+done2:
+attach_fraction:
if (cur_val >= 16384) /* 2^14 */
arith_error = true;
else
cur_val = cur_val * unity + f;
-lab30:;
+
+done:
{
get_x_token();
if (cur_cmd != spacer)
back_input();
}
-lab89:
+
+attach_sign:
if (arith_error || (abs(cur_val) >= 1073741824L)) /* 2^30 */
{
print_err("Dimension too large");
depth(q) = 0;
}
-lab21:
+reswitch:
if (scan_keyword("width"))
{
scan_dimen(false, false, false);
width(q) = cur_val;
- goto lab21;
+ goto reswitch;
}
if (scan_keyword("height"))
{
scan_dimen(false, false, false);
height(q) = cur_val;
- goto lab21;
+ goto reswitch;
}
if (scan_keyword("depth"))
{
scan_dimen(false, false, false);
depth(q) = cur_val;
- goto lab21;
+ goto reswitch;
}
return q;
/* sec 0465 */
halfword the_toks (void)
{
- register halfword Result;
char old_setting;
halfword p, q, r;
pool_pointer b;
}
}
- Result = p;
+ return p;
}
else
{
case int_val:
print_int(cur_val);
break;
+
case dimen_val:
{
print_scaled(cur_val);
- print_string("pt");
+ prints("pt");
}
break;
+
case glue_val:
{
print_spec(cur_val, "pt");
delete_glue_ref(cur_val);
}
break;
+
case mu_val:
{
print_spec(cur_val, "mu");
}
break;
}
+
selector = old_setting;
- Result = str_toks(b);
+ return str_toks(b);
}
-
- return Result;
}
/* sec 0467 */
void ins_the_toks (void)
{
link(garbage) = the_toks();
- begin_token_list(link(temp_head), 4);
+ ins_list(link(temp_head));
}
/* sec 0470 */
void conv_toks (void)
if (font_size[cur_val] != font_dsize[cur_val])
{
- print_string(" at ");
+ prints(" at ");
print_scaled(font_size[cur_val]);
- print_string("pt");
+ prints("pt");
}
break;
begin_token_list(link(temp_head), 4);
}
/* sec 0473 */
-halfword scan_toks_(boolean macrodef, boolean xpand)
+halfword scan_toks_(boolean macro_def, boolean xpand)
{
- register halfword Result;
halfword t;
halfword s;
halfword p;
halfword q;
halfword unbalance;
- halfword hashbrace;
+ halfword hash_brace;
- if (macrodef)
+ if (macro_def)
scanner_status = defining;
else
scanner_status = absorbing;
def_ref = get_avail();
token_ref_count(def_ref) = 0;
p = def_ref;
- hashbrace = 0;
+ hash_brace = 0;
t = zero_token;
- if (macrodef)
+ if (macro_def)
{
while (true)
{
get_token();
if (cur_tok < right_brace_limit)
- goto lab31;
+ goto done1;
if (cur_cmd == mac_param)
{
if (cur_cmd == left_brace)
{
- hashbrace = cur_tok;
+ hash_brace = cur_tok;
store_new_token(cur_tok);
store_new_token(end_match_token);
- goto lab30;
+ goto done;
}
if (t == zero_token + 9)
"Type `1' to delete what you did use.");
back_error();
}
+
cur_tok = s;
}
}
store_new_token(cur_tok);
}
-lab31:
+done1:
store_new_token(end_match_token);
if (cur_cmd == right_brace)
help2("Where was the left brace? You said something like `\\def\\a}',",
"which I'm going to interpret as `\\def\\a{}'.");
error();
- goto lab40;
+ goto found;
}
-lab30:;
+done:;
}
else
{
get_next();
if (cur_cmd <= max_command)
- goto lab32;
+ goto done2;
if (cur_cmd != the)
{
}
}
}
-lab32:
+done2:
x_token();
}
else
decr(unbalance);
if (unbalance == 0)
- goto lab40;
+ goto found;
}
else if (cur_cmd == mac_param)
- if (macrodef)
+ if (macro_def)
{
s = cur_tok;
store_new_token(cur_tok);
}
-lab40:
+found:
scanner_status = 0;
- if (hashbrace != 0)
- store_new_token(hashbrace);
+ if (hash_brace != 0)
+ store_new_token(hash_brace);
- Result = p;
- return Result;
+ return p;
}
/* used only in ITEX.C */
/* sec 0482 */
do
{
begin_file_reading();
- cur_input.name_field = m + 1;
+ name = m + 1;
if (read_open[m] == closed)
if (interaction > nonstop_mode)
get_token();
if (cur_tok == 0)
- goto lab30;
+ goto done;
if (align_state < 1000000L)
{
while (!(cur_tok == 0));
align_state = 1000000L;
- goto lab30;
+ goto done;
}
store_new_token(cur_tok);
}
-lab30:
+done:
end_file_reading();
}
while (!(align_state == 1000000L));
if (cur_cmd == fi_or_else)
{
if (l == 0)
- goto lab30;
+ goto done;
if (cur_chr == 2)
decr(l);
else if (cur_cmd == if_test)
incr(l);
}
-lab30:
+done:
scanner_status = save_scanner_status;
}
/* sec 0497 */
integer m, n;
halfword p, q;
small_number save_scanner_status;
- halfword savecondptr;
- small_number thisif;
+ halfword save_cond_ptr;
+ small_number this_if;
{
p = get_node(if_node_size);
if_line = line;
}
- savecondptr = cond_ptr;
- thisif = cur_chr;
+ save_cond_ptr = cond_ptr;
+ this_if = cur_chr;
- switch (thisif)
+ switch (this_if)
{
case if_char_code:
case if_cat_code:
cur_chr = 256;
}
- if (thisif == if_char_code)
+ if (this_if == if_char_code)
b = (n == cur_chr);
else
b = (m == cur_cmd);
case if_int_code:
case if_dim_code:
{
- if (thisif == if_int_code)
+ if (this_if == if_int_code)
scan_int();
else
scan_dimen(false, false, false);
else
{
print_err("Missing = inserted for ");
- print_cmd_chr(if_test, thisif);
+ print_cmd_chr(if_test, this_if);
help1("I was expecting to see `<', `=', or `>'. Didn't.");
back_error();
r = '=';
}
- if (thisif == if_int_code)
+ if (this_if == if_int_code)
scan_int();
else
scan_dimen(false, false, false);
break;
case if_vmode_code:
- b = (abs(mode) == 1);
+ b = (abs(mode) == vmode);
break;
case if_hmode_code:
- b = (abs(mode) == 102);
+ b = (abs(mode) == hmode);
break;
case if_mmode_code:
- b = (abs(mode) == 203);
+ b = (abs(mode) == mmode);
break;
case if_inner_code:
scan_eight_bit_int();
p = box(cur_val);
- if (thisif == if_void_code)
+ if (this_if == if_void_code)
b = (p == 0);
else if (p == 0)
b = false;
- else if (thisif == if_hbox_code)
+ else if (this_if == if_hbox_code)
b = (type(p) == hlist_node);
else
b = (type(p) == vlist_node);
if (tracing_commands > 1)
{
begin_diagnostic();
- print_string("{case ");
+ prints("{case ");
print_int(n);
print_char('}');
end_diagnostic(false);
{
pass_text();
- if (cond_ptr == savecondptr)
+ if (cond_ptr == save_cond_ptr)
if (cur_chr == or_code)
decr(n);
else
- goto lab50;
+ goto common_ending;
else if (cur_chr == fi_code)
{
p = cond_ptr;
}
}
- change_if_limit(or_code, savecondptr);
+ change_if_limit(or_code, save_cond_ptr);
return;
}
break;
begin_diagnostic();
if (b)
- print_string("{true}");
+ prints("{true}");
else
- print_string("{false}");
+ prints("{false}");
end_diagnostic(false);
}
- if (b) /* b may be used without ... */
+ if (b)
{
- change_if_limit(else_code, savecondptr);
+ change_if_limit(else_code, save_cond_ptr);
return;
}
{
pass_text();
- if (cond_ptr == savecondptr)
+ if (cond_ptr == save_cond_ptr)
{
if (cur_chr != or_code)
- goto lab50;
+ goto common_ending;
print_err("Extra ");
print_esc("or");
}
}
-lab50:
+common_ending:
if (cur_chr == fi_code)
{
p = cond_ptr;
else // did find an extension
{
cur_name = str_ptr;
- str_start[str_ptr + 1] = str_start[str_ptr]+ ext_delimiter - area_delimiter - 1;
+ str_start[str_ptr + 1] = str_start[str_ptr] + ext_delimiter - area_delimiter - 1;
incr(str_ptr);
cur_ext = make_string();
}
if (trace_flag)
{
- sprintf(log_line, " pack_file_name `%s' (%d) ", name_of_file + 1, name_length); /* debugging */
+ sprintf(log_line, " pack_file_name `%s' (%lld) ", name_of_file + 1, name_length); /* debugging */
show_line(log_line, 0);
}
{
if (cur_chr == '"')
{
- quoted_file_name = 1;
+ quoted_file_name = true;
get_x_token();
}
}
if ((cur_cmd > other_char) || (cur_chr > 255))
{
back_input();
- goto lab30;
+ goto done;
}
if (!more_name(cur_chr)) /* up to next white space */
- goto lab30;
+ goto done;
get_x_token();
}
-lab30:
+done:
end_name();
name_in_progress = false;
}
cur_name = job_name;
pack_file_name(cur_name, cur_area, cur_ext);
}
-
-/**********************************************************************/
/* sec 0530 */
/* s - what can't be found, e - default */
void prompt_file_name_(char * s, str_number e)
{
integer k;
- if (interaction == scroll_mode);
+ if (interaction == scroll_mode)
+ do_nothing();
if (!strcmp("input file name", s))
print_err("I can't find file `");
print_err("I can't write on file `");
print_file_name(cur_name, cur_area, cur_ext);
- print_string("'.");
+ prints("'.");
if (e == 785) /* .tex */
show_context();
print_nl("Please type another ");
- print_string(s);
+ prints(s);
if (interaction < 2)
{
#else
show_line(" (or Ctrl-Z to exit)", 0);
#endif
+
prompt_input(": ");
/* should we deal with tilde and space in file name here ??? */
while (true)
{
if (k == last)
- goto lab30;
+ goto done;
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
/* convert tilde '~' to pseudo tilde */
if (pseudo_tilde != 0 && buffer[k]== '~')
buffer[k] = pseudo_space;
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
if (!more_name(buffer[k]))
- goto lab30;
+ goto done;
incr(k);
}
-lab30:
+done:
end_name();
}
if (format_ident > 0)
slow_print(format_ident);
- print_string(" ");
+ prints(" ");
if (civilize_flag)
print_int(year);
months = " JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC";
for (k = 3 * month - 2; k <= 3 * month; k++)
- (void) putc(months[k], log_file);
+ putc(months[k], log_file);
print_char(' ');
return make_string();
}
-
-void job_name_append (void)
-{
- int k, n;
-
- k = str_start[job_name];
- n = str_start[job_name + 1];
-
- while (k < n)
- more_name_copy(str_pool[k++]);
-
- k = str_start[cur_ext];
- n = str_start[cur_ext + 1];
-
- while (k < n)
- more_name_copy(str_pool[k++]);
-
- job_name = end_name_copy();
-}
-
/* sec 0537 */
void start_input(void)
{
begin_file_reading();
if (a_open_in(cur_file, TEXINPUTPATH))
- goto lab30;
+ goto done;
end_file_reading();
prompt_file_name("input file name", ".tex");
}
-lab30:
- cur_input.name_field = a_make_name_string(cur_file);
+done:
+ name = a_make_name_string(cur_file);
if (job_name == 0)
{
open_log_file();
}
- if (term_offset + length(cur_input.name_field) > max_print_line - 2)
+ if (term_offset + length(name) > max_print_line - 2)
print_ln();
else if ((term_offset > 0) || (file_offset > 0))
print_char(' ');
if (open_parens > max_open_parens)
max_open_parens = open_parens;
- slow_print(cur_input.name_field);
-
-#ifndef _WINDOWS
- fflush(stdout);
-#endif
-
+ slow_print(name);
+ update_terminal();
state = new_line;
{
line = 1;
- if (input_ln(cur_file, false));
+ if (input_ln(cur_file, false))
+ do_nothing();
firm_up_the_line();
pack_file_name(nom, aire, 805); /* .tfm */
if (!b_open_in(tfm_file))
- {
- goto lab11;
- }
+ goto bad_tfm;
- file_opened = true;
+ file_opened = true;
{
read_sixteen(lf);
read_sixteen(ec);
if ((bc > ec + 1) || (ec > 255))
- goto lab11;
+ goto bad_tfm;
if (bc > 255)
{
read_sixteen(np);
if (lf != 6 + lh + (ec - bc + 1) + nw + nh + nd + ni + nl + nk + ne + np)
- goto lab11;
+ goto bad_tfm;
if ((nw == 0) || (nh == 0) || (nd == 0) || (ni == 0))
- goto lab11;
+ goto bad_tfm;
}
lf = lf - 6 - lh;
{
if (trace_flag)
{
- sprintf(log_line, "font_ptr %d font_max %d fmem_ptr %d lf %d font_mem_size %d\n",
+ sprintf(log_line, "font_ptr %lld font_max %d fmem_ptr %lld lf %ld font_mem_size %ld\n",
font_ptr, font_max, fmem_ptr, lf, font_mem_size);
show_line(log_line, 0);
}
if (s >= 0)
{
- print_string(" at ");
+ prints(" at ");
print_scaled(s);
- print_string("pt");
+ prints("pt");
}
else if (s != -1000)
{
- print_string(" scaled ");
+ prints(" scaled ");
print_int(- (integer) s);
}
- print_string(" not loaded: Not enough room left");
+ prints(" not loaded: Not enough room left");
help4("I'm afraid I won't be able to make use of this font,",
"because my memory for character-size data is too small.",
"If you're really stuck, ask a wizard to enlarge me.",
"Or maybe try `I\\font<same font id>=<name of loaded font>'.");
error();
- goto lab30;
+ goto done;
}
f = font_ptr + 1;
{
if (lh < 2)
- goto lab11;
+ goto bad_tfm;
store_four_quarters(font_check[f]);
tfm_temp = getc(tfm_file);
z =(z * 16) + (tfm_temp / 16);
if (z < unity)
- goto lab11;
+ goto bad_tfm;
while (lh > 2)
{
store_four_quarters(font_info[k].qqqq);
if ((a >= nw) || (b / 16 >= nh) || (b % 16 >= nd) || (c / 4 >= ni))
- goto lab11;
+ goto bad_tfm;
switch (c % 4)
{
case lig_tag:
if (d >= nl)
- goto lab11;
+ goto bad_tfm;
break;
case ext_tag:
if (d >= ne)
- goto lab11;
+ goto bad_tfm;
break;
case list_tag:
{
{
if ((d < bc) || (d > ec))
- goto lab11;
+ goto bad_tfm;
}
while (d < k + bc - fmem_ptr)
qw = char_info(f, d);
if (char_tag(qw) != list_tag)
- goto lab45;
+ goto not_found;
d = rem_byte(qw);
}
if (d == k + bc - fmem_ptr)
- goto lab11;
-lab45:;
+ goto bad_tfm;
+not_found:;
}
break;
else if (a == 255)
font_info[k].cint = sw - alpha;
else
- goto lab11;
+ goto bad_tfm;
}
if (font_info[width_base[f]].cint != 0)
- goto lab11;
+ goto bad_tfm;
if (font_info[height_base[f]].cint != 0)
- goto lab11;
+ goto bad_tfm;
if (font_info[depth_base[f]].cint != 0)
- goto lab11;
+ goto bad_tfm;
if (font_info[italic_base[f]].cint != 0)
- goto lab11;
+ goto bad_tfm;
}
bch_label = 32767; /* '77777 */
if (a > 128)
{
if (256 * c + d >= nl)
- goto lab11; /* error in TFM, abort */
+ goto bad_tfm;
if (a == 255)
if (k == lig_kern_base[f])
else
{
if (b != bchar)
- {
- {
- if ((b < bc) || (b > ec)) /* check-existence(b) */
- goto lab11; /* error in TFM, abort */
- }
-
- qw = font_info[char_base[f] + b].qqqq;
-
- if (!(qw.b0 > 0))
- goto lab11; /* error in TFM, abort */
- }
+ check_existence(b);
if (c < 128)
- {
- {
- if ((d < bc) || (d > ec)) /* check-existence(d) */
- goto lab11; /* error in TFM, abort */
- }
-
- qw = font_info[char_base[f] + d].qqqq;
-
- if (!(qw.b0 > 0))
- goto lab11; /* error in TFM, abort */
- }
+ check_existence(d);
else if (256 * (c - 128) + d >= nk)
- goto lab11; /* error in TFM, abort */
+ goto bad_tfm;
if (a < 128)
if (k - lig_kern_base[f] + a + 1 >= nl)
- goto lab11; /* error in TFM, abort */
+ goto bad_tfm;
}
}
font_info[k].cint = sw;
else if (a == 255)
font_info[k].cint = sw - alpha;
- else goto lab11;
+ else
+ goto bad_tfm;
}
- /* read extensible character recipes */
for (k = exten_base[f]; k <= param_base[f] - 1; k++)
{
store_four_quarters(font_info[k].qqqq);
if (a != 0)
- {
- {
- if ((a < bc) || (a > ec))
- goto lab11;
- }
-
- qw = font_info[char_base[f] + a].qqqq;
-
- if (!(qw.b0 > 0))
- goto lab11;
- }
+ check_existence(a);
if (b != 0)
- {
- {
- if ((b < bc) || (b > ec))
- goto lab11;
- }
-
- qw = font_info[char_base[f] + b].qqqq;
-
- if (!(qw.b0 > 0))
- goto lab11;
- }
+ check_existence(b);
if (c != 0)
- {
- {
- if ((c < bc) || (c > ec))
- goto lab11;
- }
-
- qw = font_info[char_base[f] + c].qqqq;
+ check_existence(c);
- if (!(qw.b0 > 0))
- goto lab11;
- }
-
- {
- {
- if ((d < bc) || (d > ec))
- goto lab11;
- }
-
- qw = font_info[char_base[f] + d].qqqq;
-
- if (!(qw.b0 > 0))
- goto lab11;
- }
+ check_existence(d);
}
{
font_info[param_base[f] + k - 1].cint = sw;
else if (a == 255)
font_info[param_base[f] + k - 1].cint = sw - alpha;
- else goto lab11;
+ else goto bad_tfm;
}
if (feof(tfm_file))
- goto lab11;
+ goto bad_tfm;
for (k = np + 1; k <= 7; k++)
font_info[param_base[f] + k - 1].cint = 0;
fmem_ptr = fmem_ptr + lf;
font_ptr = f;
g = f;
- goto lab30;
+ goto done;
-lab11:
+bad_tfm:
print_err("Font ");
sprint_cs(u);
print_char('=');
if (s >= 0)
{
- print_string(" at ");
+ prints(" at ");
print_scaled(s);
- print_string("pt");
+ prints("pt");
}
else if (s != -1000)
{
- print_string("scaled");
- print_int(- (integer) s);
+ prints("scaled");
+ print_int(-(integer)s);
}
if (file_opened)
- print_string(" not loadable: Bad metric (TFM) file");
+ prints(" not loadable: Bad metric (TFM) file");
else
- print_string(" not loadable: Metric (TFM) file not found");
+ prints(" not loadable: Metric (TFM) file not found");
help5("I wasn't able to read the size data for this font,",
"so I will ignore the font specification.",
"e.g., type `I\\font<same font id>=<substitute font name>'.");
error();
-lab30:
+done:
if (file_opened)
b_close(tfm_file);