for (k = 0; k < 256; k++)
{
if (xord[k] != 127)
- {
- sprintf(log_line, "%d => %d\n", k, xord[k]);
- show_line(log_line, 0);
- }
+ printf("%d => %d\n", k, xord[k]);
}
}
}
mode = 1;
head = contrib_head;
tail = contrib_head;
- cur_list.aux_field.cint = ignore_depth;
+ prev_depth = ignore_depth;
mode_line = 0;
prev_graf = 0;
/* shown_mode = 0; */
int j; /* 95/Jan/7 */
/* unsigned char c; */
unsigned int c; /* 95/Jan/7 */
-/* savedbadness = 0; */ /* 96/Feb/9 */
pack_begin_line = mode_line;
link(temp_head) = link(head);
no_shrink_error_yet = true;
if ((shrink_order(left_skip) != normal) && (shrink(left_skip) != 0))
- {
left_skip = finite_shrink(left_skip);
- }
if ((shrink_order(right_skip) != normal) && (shrink(right_skip) != 0))
- {
right_skip = finite_shrink(right_skip);
- }
q = left_skip;
r = right_skip;
background[2 + stretch_order(q)] = stretch(q);
background[2 + stretch_order(r)] = background[2 + stretch_order(r)] + stretch(r);
background[6] = shrink(q) + shrink(r);
-
minimum_demerits = 1073741823L; /* 2^30 - 1 *//* 40000000 hex - 1 */
minimal_demerits[tight_fit] = 1073741823L;
minimal_demerits[decent_fit] = 1073741823L;
if (threshold >= 0)
{
-
#ifdef STAT
if (tracing_paragraphs > 0)
{
begin_diagnostic();
print_nl("@firstpass");
}
-#endif /* STAT */
+#endif
second_pass = false;
final_pass = false;
#ifdef STAT
if (tracing_paragraphs > 0)
begin_diagnostic();
-#endif /* STAT */
+#endif
}
while (true)
case rule_node:
active_width[1] = active_width[1] + width(cur_p);
break;
+
case whatsit_node:
if (subtype(cur_p) == language_node)
{
rhyf = what_rhm(cur_p);
}
break;
+
case glue_node:
{
if (auto_breaking)
#ifdef STAT
if (tracing_paragraphs > 0)
print_nl("@emergencypass");
-#endif /* STAT */
-/* can only get here is \emergencystretch has been set positive */
+#endif
+
background[2] = background[2] + emergency_stretch;
final_pass = true;
++final_pass_count; /* 96 Feb 9 */
- } /* end of if second_pass */
- } /* end of while (true)do */
-/* cannot drop through from above loop */
-lab30: /* common exit point */
+ }
+ }
+
+lab30:
if (best_line == 2)
single_line++;
end_diagnostic(true);
normalize_selector();
}
-#endif /* STAT */
+#endif
post_line_break(final_widow_penalty);
q = link(active);
switch (cur_cmd)
{
case set_font:
- if ((a >= 4))
- geq_define(cur_font_loc, data, cur_chr);
- else
- eq_define(cur_font_loc, data, cur_chr);
+ define(cur_font_loc, data, cur_chr);
break;
case def:
get_r_token();
p = cur_cs;
q = scan_toks(true, e);
-
- if ((a >= 4))
- geq_define(p, call + (a % 4), def_ref);
- else
- eq_define(p, call + (a % 4), def_ref);
+ define(p, call + (a % 4), def_ref);
}
break;
}
if (cur_cmd >= call)
- incr(mem[cur_chr].hh.lh);
+ add_token_ref(cur_chr);
- if ((a >= 4))
- geq_define(p, cur_cmd, cur_chr);
- else
- eq_define(p, cur_cmd, cur_chr);
+ define(p, cur_cmd, cur_chr);
}
break;
n = cur_chr;
get_r_token();
p = cur_cs;
-
- if ((a >= 4))
- geq_define(p, relax, 256);
- else
- eq_define(p, relax, 256);
-
+ define(p, relax, 256);
scan_optional_equals();
switch (n)
case char_def_code:
{
scan_char_num();
-
- if ((a >= 4))
- geq_define(p, char_given, cur_val);
- else
- eq_define(p, char_given, cur_val);
+ define(p, char_given, cur_val);
}
break;
case math_char_def_code:
{
scan_fifteen_bit_int();
-
- if ((a >= 4))
- geq_define(p, math_given, cur_val);
- else
- eq_define(p, math_given, cur_val);
+ define(p, math_given, cur_val);
}
break;
switch (n)
{
case count_def_code:
- if ((a >= 4))
- geq_define(p, assign_int, count_base + cur_val);
- else
- eq_define(p, assign_int, count_base + cur_val);
+ define(p, assign_int, count_base + cur_val);
break;
case dimen_def_code:
- if ((a >= 4))
- geq_define(p, assign_dimen, scaled_base + cur_val);
- else
- eq_define(p, assign_dimen, scaled_base + cur_val);
+ define(p, assign_dimen, scaled_base + cur_val);
break;
case skip_def_code:
- if ((a >= 4))
- geq_define(p, assign_glue, skip_base + cur_val);
- else
- eq_define(p, assign_glue, skip_base + cur_val);
+ define(p, assign_glue, skip_base + cur_val);
break;
case mu_skip_def_code:
- if ((a >= 4))
- geq_define(p, assign_mu_glue, mu_skip_base + cur_val);
- else
- eq_define(p, assign_mu_glue, mu_skip_base + cur_val);
+ define(p, assign_mu_glue, mu_skip_base + cur_val);
break;
case toks_def_code:
- if ((a >= 4))
- geq_define(p, assign_toks, toks_base + cur_val);
- else
- eq_define(p, assign_toks, toks_base + cur_val);
+ define(p, assign_toks, toks_base + cur_val);
break;
}
}
scan_int();
n = cur_val;
- if (! scan_keyword("to"))
+ if (!scan_keyword("to"))
{
print_err("Missing `to' inserted");
help2("You should have said `\\read<number> to \\cs'.",
get_r_token();
p = cur_cs;
read_toks(n, p);
-
- if ((a >= 4))
- geq_define(p, call, cur_val);
- else
- eq_define(p, call, cur_val);
+ define(p, call, cur_val);
}
break;
q = equiv(cur_chr);
if (q == 0)
- if ((a >= 4))
- geq_define(p, undefined_cs, 0);
- else
- eq_define(p, undefined_cs, 0);
+ define(p, undefined_cs, 0);
else
{
- incr(mem[q].hh.lh);
-
- if ((a >= 4))
- geq_define(p, call, q);
- else
- eq_define(p, call, q);
+ add_token_ref(q);
+ define(p, call, q);
}
goto lab30;
}
if (link(def_ref) == 0)
{
- if ((a >= 4))
- geq_define(p, undefined_cs, 0);
- else
- eq_define(p, undefined_cs, 0);
-
+ define(p, undefined_cs, 0);
free_avail(def_ref);
}
else
link(def_ref) = q;
}
- if ((a >= 4))
- geq_define(p, call, def_ref);
- else
- eq_define(p, call, def_ref);
+ define(p, call, def_ref);
}
}
break;
p = cur_chr;
scan_optional_equals();
scan_int();
-
- if ((a >= 4))
- geq_word_define(p, cur_val);
- else
- eq_word_define(p, cur_val);
+ word_define(p, cur_val);
}
break;
p = cur_chr;
scan_optional_equals();
scan_dimen(false, false, false);
-
- if ((a >= 4))
- geq_word_define(p, cur_val);
- else
- eq_word_define(p, cur_val);
+ word_define(p, cur_val);
}
break;
scan_glue(glue_val);
trap_zero_glue();
-
- if ((a >= 4))
- geq_define(p, glue_ref, cur_val);
- else
- eq_define(p, glue_ref, cur_val);
+ define(p, glue_ref, cur_val);
}
break;
else if (cur_chr == del_code_base)
n = 16777215L; /* 2^24 - 1 */
else
- n = 255; /* 2^8 - 1 */
+ n = 255;
p = cur_chr;
scan_char_num();
}
if (p < math_code_base)
- if ((a >= 4))
- geq_define(p, data, cur_val);
- else
- eq_define(p, data, cur_val);
+ define(p, data, cur_val);
else if (p < del_code_base)
- if ((a >= 4))
- geq_define(p, data, cur_val);
- else
- eq_define(p, data, cur_val);
+ define(p, data, cur_val);
else
- if ((a >= 4))
- geq_word_define(p, cur_val);
- else
- eq_word_define(p, cur_val);
+ word_define(p, cur_val);
}
break;
p = p + cur_val;
scan_optional_equals();
scan_font_ident();
-
- if ((a >= 4))
- geq_define(p, data, cur_val);
- else
- eq_define(p, data, cur_val);
+ define(p, data, cur_val);
}
break;
scan_optional_equals();
if (set_box_allowed)
- {
scan_box(box_flag + n);
- }
else
{
print_err("Improper ");
}
}
- if ((a >= 4))
- geq_define(par_shape_loc, shape_ref, p);
- else
- eq_define(par_shape_loc, shape_ref, p);
+ define(par_shape_loc, shape_ref, p);
}
break;
new_patterns();
goto lab30;
}
-#endif /* INITEX */
+#endif
print_err("Patterns can be loaded only by INITEX");
help_ptr = 0;
error();
#ifdef ALLOCATEMAIN
/* we already read this once earlier to grab mem_top */
if (trace_flag)
- {
- sprintf(log_line, "Read from fmt file mem_top = %d TeX words\n", x);
- show_line(log_line, 0);
- }
+ printf("Read from fmt file mem_top = %d TeX words\n", x);
mem = allocate_main_memory(x); /* allocate main memory at this point */
undump_int(x); /* eqtb_size */
- if (x != (eqtb_size))
+ if (x != eqtb_size)
goto lab_bad_fmt;
undump_int(x); /* hash_prime */
#ifdef ALLOCATEHYPHEN
/* allow format files dumped with arbitrary (prime) hyphenation exceptions */
- realloc_hyphen(x); /* reset_hyphen(); */
+ realloc_hyphen(x);
hyphen_prime = x;
#endif
if (x > current_pool_size)
{
if (trace_flag)
- {
- sprintf(log_line, "undump string pool reallocation (%d > %d)\n", x, current_pool_size);
- show_line(log_line, 0);
- }
+ printf("undump string pool reallocation (%d > %d)\n", x, current_pool_size);
str_pool = realloc_str_pool (x - current_pool_size + increment_pool_size);
}
- if (x > current_pool_size) /* 94/Jan/24 */
+ if (x > current_pool_size)
#else
if (x > pool_size)
#endif
{
- sprintf(log_line, "%s%s\n", "---! Must increase the ", "string pool size");
- show_line(log_line, 0);
+ printf("%s%s\n", "---! Must increase the ", "string pool size");
goto lab_bad_fmt;
}
else
if (x > current_max_strings)
{
if (trace_flag)
- {
- sprintf(log_line, "undump string pointer reallocation (%d > %d)\n", x, current_max_strings);
- show_line(log_line, 0);
- }
+ printf("undump string pointer reallocation (%d > %d)\n", x, current_max_strings);
str_start = realloc_str_start(x - current_max_strings + increment_max_strings);
}
if (x > max_strings)
#endif
{
- sprintf(log_line, "%s%s\n", "---! Must increase the ", "max strings");
- show_line(log_line, 0);
+ printf("%s%s\n", "---! Must increase the ", "max strings");
goto lab_bad_fmt;
}
else
undump_int(cs_count);
if (trace_flag)
- {
- sprintf(log_line, "itex undump cs_count %d ", cs_count);
- show_line(log_line, 0);
- }
+ printf("itex undump cs_count %d ", cs_count);
{
- undump_int(x); /* font_mem_size */
+ undump_int(x); /* font_mem_size */
if (x < 7)
goto lab_bad_fmt;
#ifdef ALLOCATEFONT
if (trace_flag)
- {
- sprintf(log_line, "Read from fmt fmem_ptr = %d\n", x);
- show_line(log_line, 0);
- }
+ printf("Read from fmt fmem_ptr = %d\n", x);
- if (x > current_font_mem_size) /* 93/Nov/28 dynamic allocate font_info */
+ if (x > current_font_mem_size)
{
if (trace_flag)
- {
- sprintf(log_line, "Undump realloc font_info (%d > %d)\n", x, current_font_mem_size);
- show_line(log_line, 0);
- }
+ printf("Undump realloc font_info (%d > %d)\n", x, current_font_mem_size);
font_info = realloc_font_info (x - current_font_mem_size + increment_font_mem_size);
}
- if (x > current_font_mem_size) /* in case allocation failed 94/Jan/24 */
+ if (x > current_font_mem_size)
#else
if (x > font_mem_size)
#endif
{
- sprintf(log_line, "%s%s\n", "---! Must increase the ", "font mem size");
- show_line(log_line, 0);
+ puts("---! Must increase the font mem size\n");
goto lab_bad_fmt;
}
else
if (x > font_max)
{
- sprintf(log_line, "%s%s\n", "---! Must increase the ", "font max");
- show_line(log_line, 0);
+ puts("---! Must increase the font max\n");
goto lab_bad_fmt;
}
else
font_ptr = x;
}
- frozen_font_ptr = font_ptr; /* remember number of fonts frozen into format */
+ frozen_font_ptr = font_ptr;
if (undumpthings(font_check[0], font_ptr + 1))
return -1;
/* non_address from font_mem_size to 0 96/Jan/15 ??? */
#ifdef ALLOCATEFONT
-/* deal with fmt files dumped with *different* font_mem_size 93/Nov/29 */
{
int count = 0, oldfont_mem_size = 0;
if (bchar_label[x] > oldfont_mem_size)
oldfont_mem_size = bchar_label[x];
}
-
- /* somewhat arbitrary sanity check ... */
- if (oldfont_mem_size != non_address && oldfont_mem_size > font_max) /* 96/Jan/16 */
+
+ if (oldfont_mem_size != non_address && oldfont_mem_size > font_max)
{
for (x = 0; x <= font_ptr; x++)
{
if (bchar_label[x] == oldfont_mem_size)
{
- /* bchar_label[x] = font_mem_size; */
- bchar_label[x] = non_address; /* 96/Jan/16 */
+ bchar_label[x] = non_address;
count++;
}
}
if (trace_flag)
- {
- sprintf(log_line, "oldfont_mem_size is %d --- hit %d times. Using non_address %d\n",
+ printf("oldfont_mem_size is %d --- hit %d times. Using non_address %d\n",
oldfont_mem_size, count, non_address);
- show_line(log_line, 0);
- }
}
}
#endif
if (x > trie_size)
{
- sprintf(log_line, "%s%s\n", "---! Must increase the ", "trie size");
- show_line(log_line, 0);
+ puts("---! Must increase the trie size\n");
goto lab_bad_fmt;
}
else
if (x > trie_op_size)
{
- sprintf(log_line, "%s%s\n", "---! Must increase the ", "trie op size");
- show_line(log_line, 0);
+ puts("---! Must increase the trie op size\n");
goto lab_bad_fmt;
}
else
return true;
lab_bad_fmt:;
- sprintf(log_line, "(Fatal format file error; I'm stymied)\n");
- show_line(log_line, 1);
+ puts("(Fatal format file error; I'm stymied)\n");
return false;
}
if (bad > 0)
{
- sprintf(log_line, "%s%s%ld\n", "Ouch---my internal constants have been clobbered!",
+ printf("%s%s%ld\n", "Ouch---my internal constants have been clobbered!",
"---case ", (long) bad);
- show_line(log_line, 1);
goto lab9999;
}
file_offset = 0;
show_line(tex_version, 0);
- {
#ifdef _WIN32
#ifdef _WIN64
- sprintf(log_line, " (%s %s/Windows 64bit)", application, yandyversion);
+ printf(log_line, " (%s %s/Windows 64bit)", application, yandyversion);
#else
- sprintf(log_line, " (%s %s/Windows 32bit)", application, yandyversion);
+ printf(log_line, " (%s %s/Windows 32bit)", application, yandyversion);
#endif
#else
- sprintf(log_line, " (%s %s/Linux)", application, yandyversion);
+ printf(log_line, " (%s %s/Linux)", application, yandyversion);
#endif
- }
-
- show_line(log_line, 0);
if (format_ident > 0)
slow_print(format_ident);
cs_count = frozen_control_sequence - 1 - hash_used;
if (trace_flag)
- {
- sprintf(log_line, "itex cs_count %d hash_size %d hash_extra %d hash_used %d",
+ printf("itex cs_count %d hash_size %d hash_extra %d hash_used %d",
cs_count, hash_size, hash_extra, hash_used);
- show_line(log_line, 0);
- }
for (p = hash_base; p <= hash_used; p++)
{
incr(cs_count);
if (trace_flag)
- {
- sprintf(log_line, "itex cs_count++ ");
- show_line(log_line, 0);
- }
+ puts("itex cs_count++ ");
}
}
error();
}
else
- {
off_save();
- }
}
else
{
l = false;
p = fin_mlist(0);
- if (mode == - (integer) m)
+ if (mode == -m)
{
{
get_x_token();
if (cur_group != math_shift_group)
{
confusion("display");
- return; // abort_flag set
+ return;
}
unsave();
}
if (nest_ptr == 1)
- {
build_page();
- }
}
/* sec 1215 */
void get_r_token (void)
}
if (p < glue_val)
- {
- if ((a >= 4))
- geq_word_define(l, cur_val);
- else
- eq_word_define(l, cur_val);
- }
+ word_define(l, cur_val);
else
{
trap_zero_glue();
-
- if ((a >= 4))
- geq_define(l, glue_ref, cur_val);
- else
- eq_define(l, glue_ref, cur_val);
+ define(l, glue_ref, cur_val);
}
}
/* sec 1243 */
halfword c;
if (cur_chr != abs(mode))
- {
report_illegal_case();
- }
else
{
c = cur_chr;
t = make_string();
}
- if ((a >= 4))
- geq_define(u, set_font, 0);
- else
- eq_define(u, set_font, 0);
-
+ define(u, set_font, null_font);
scan_optional_equals();
scan_file_name();
else if (scan_keyword("scaled"))
{
scan_int();
- s = - (integer) cur_val;
+ s = -cur_val;
if ((cur_val <= 0) || (cur_val > 32768L))
{
if (read_open[n] != closed)
{
- (void) a_close(read_file[n]);
+ a_close(read_file[n]);
read_open[n] = closed;
}
decr(error_count);
}
else if (tracing_online > 0)
- {
help3("This isn't an error message; I'm just \\showing something.",
"Type `I\\show...' to show more (e.g., \\show\\cs,",
"\\showthe\\count10, \\showbox255, \\showlists).");
- }
else
- {
help5("This isn't an error message; I'm just \\showing something.",
"Type `I\\show...' to show more (e.g., \\show\\cs,",
"\\showthe\\count10, \\showbox255, \\showlists).",
"And type `I\\tracingonline=1\\show...' to show boxes and",
"lists on your terminal as well as in the transcript file.");
- }
error();
}
default:
{
confusion("ext1");
- return; // abort_flag set
+ return;
}
break;
}
void fix_language (void)
{
/* ASCII_code l; */
- int l; /* 95/Jan/7 */
+ int l;
if (language <= 0)
l = 0;
free_node(p, box_node_size);
if (nest_ptr == 0)
- {
build_page();
- }
}
break;
+
case output_group:
{
if ((loc != 0) || ((token_type != output_text) && (token_type != backed_up)))
link(page_head) = 0;
page_tail = page_head;
}
+
pop_nest();
build_page();
}
default:
{
confusion("rightbrace");
- return; // abort_flag set
+ return;
}
break;
}
if (every_job != 0)
begin_token_list(every_job, every_job_text);
-lab60:
+big_switch:
get_x_token(); /* big_switch */
-lab21:
+reswitch:
if (interrupt != 0)
if (OK_to_interrupt)
{
back_input();
- {
- if (interrupt != 0)
- {
- pause_for_instructions();
- }
- }
- goto lab60;
+ check_interrupt();
+ goto big_switch;
}
#ifdef DEBUG
if (tracing_commands > 0)
show_cur_cmd_chr();
-/* the big switch --- don't bother to test abort_flag ??? */
switch(abs(mode) + cur_cmd)
{
case hmode + letter:
case hmode + other_char:
case hmode + char_given:
- goto lab70;
+ goto main_loop;
break;
case hmode + char_num:
{
scan_char_num();
cur_chr = cur_val;
- goto lab70;
+ goto main_loop;
}
break;
if ((cur_cmd == letter) || (cur_cmd == other_char) ||
(cur_cmd == char_given) || (cur_cmd == char_num))
cancel_boundary = true;
- goto lab21;
+ goto reswitch;
}
break;
case hmode + spacer:
if (space_factor == 1000)
- goto lab120;
+ goto append_normal_space;
else
app_space();
break;
case hmode + ex_space:
case mmode + ex_space:
- goto lab120;
+ goto append_normal_space;
break;
case any_mode(relax):
get_x_token();
}
while (!(cur_cmd != spacer));
- goto lab21;
+ goto reswitch;
}
break;
case any_mode(extension):
do_extension();
break;
- } /* end of big switch */
- goto lab60; /* main_loop */
+ }
+
+ goto big_switch;
-lab70:
+main_loop:
adjust_space_factor();
main_f = cur_font;
bchar = font_bchar[main_f];
main_k = bchar_label[main_f];
if (main_k == non_address)
- goto lab92;
+ goto main_loop_move_2;
cur_r = cur_l;
cur_l = non_char;
- goto lab111;
+ goto main_lig_loop_1;
-lab80:
+main_loop_wrapup:
wrapup(rt_hit);
-/* main_loop_move */
-lab90:
+main_loop_move:
if (lig_stack == 0)
- goto lab21;
+ goto reswitch;
cur_q = tail;
cur_l = character(lig_stack);
-lab91:
+main_loop_move_1:
if (!is_char_node(lig_stack))
- goto lab95;
+ goto main_loop_move_lig;
-lab92:
+main_loop_move_2:
if ((cur_chr < font_bc[main_f]) || (cur_chr > font_ec[main_f]))
{
char_warning(main_f, cur_chr);
free_avail(lig_stack);
- goto lab60;
+ goto big_switch;
}
main_i = char_info(main_f, cur_l);
{
char_warning(main_f, cur_chr);
free_avail(lig_stack);
- goto lab60;
+ goto big_switch;
}
{
link(tail) = lig_stack;
tail = lig_stack;
}
-/* main_loop_lookahead */
-lab100:
+main_loop_lookahead:
get_next();
if (cur_cmd == letter)
- goto lab101;
+ goto main_loop_lookahead_1;
if (cur_cmd == other_char)
- goto lab101;
+ goto main_loop_lookahead_1;
if (cur_cmd == char_given)
- goto lab101;
+ goto main_loop_lookahead_1;
x_token();
if (cur_cmd == letter)
- goto lab101;
+ goto main_loop_lookahead_1;
if (cur_cmd == other_char)
- goto lab101;
+ goto main_loop_lookahead_1;
if (cur_cmd == char_given)
- goto lab101;
+ goto main_loop_lookahead_1;
if (cur_cmd == char_num)
{
scan_char_num();
cur_chr = cur_val;
- goto lab101;
+ goto main_loop_lookahead_1;
}
if (cur_cmd == no_boundary)
cur_r = bchar;
lig_stack = 0;
- goto lab110;
+ goto main_lig_loop;
-lab101:
+main_loop_lookahead_1:
adjust_space_factor();
fast_get_avail(lig_stack);
font(lig_stack) = main_f;
if (cur_r == false_bchar)
cur_r = non_char;
-// main_lig_loop:@<If there's a ligature/kern command relevant to |cur_l| and
-// |cur_r|, adjust the text appropriately; exit to |main_loop_wrapup|@>;
-lab110:
-
+main_lig_loop:
if (char_tag(main_i) != lig_tag)
- goto lab80;
+ goto main_loop_wrapup;
if (cur_r == non_char)
- goto lab80;
+ goto main_loop_wrapup;
main_k = lig_kern_start(main_f, main_i);
main_j = font_info[main_k].qqqq;
if (skip_byte(main_j) <= stop_flag)
- goto lab112;
+ goto main_lig_loop_2;
main_k = lig_kern_restart(main_f, main_j);
-/* main_lig_loop+1:main_j:=font_info[main_k].qqqq; */
-lab111:
+main_lig_loop_1:
main_j = font_info[main_k].qqqq;
-lab112:
-/* provide for suppression of f-ligatures 99/Jan/5 */
+main_lig_loop_2:
bSuppress = 0;
if (suppress_f_ligs && next_char(main_j) == cur_r && op_byte(main_j) == no_tag)
{
wrapup(rt_hit);
tail_append(new_kern(char_kern(main_f, main_j)));
- goto lab90;
+ goto main_loop_move;
}
if (cur_l == non_char)
else if (lig_stack == 0)
rt_hit = true;
- {
- if (interrupt != 0)
- {
- pause_for_instructions();
- }
- }
+ check_interrupt();
switch (op_byte(main_j))
{
ligature_present = true;
if (lig_stack == 0)
- goto lab80;
+ goto main_loop_wrapup;
else
- goto lab91;
+ goto main_loop_move_1;
}
break;
}
if (op_byte(main_j) > 4)
if (op_byte(main_j) != 7)
- goto lab80;
+ goto main_loop_wrapup;
if (cur_l < non_char)
- goto lab110;
+ goto main_lig_loop;
main_k = bchar_label[main_f];
- goto lab111;
+ goto main_lig_loop_1;
}
if (skip_byte(main_j) == 0)
else
{
if (skip_byte(main_j) >= stop_flag)
- goto lab80;
+ goto main_loop_wrapup;
main_k = main_k + skip_byte(main_j) + 1;
}
- goto lab111;
+ goto main_lig_loop_1;
-/* main_move_log */
-lab95:
+main_loop_move_lig:
main_p = lig_ptr(lig_stack);
if (main_p != 0) /* BUG FIX */
if (lig_stack == 0)
if (main_p != 0) /* BUG FIX */
- goto lab100;
+ goto main_loop_lookahead;
else
cur_r = bchar;
else
cur_r = character(lig_stack);
- goto lab110;
+ goto main_lig_loop;
-/* append_normal_space */
-lab120:
+append_normal_space:
if (space_skip == 0)
{
{
link(tail) = temp_ptr;
tail = temp_ptr;
- goto lab60;
-}
-/* give_err_help etc followed here in the old tex8.c */
\ No newline at end of file
+
+ goto big_switch;
+}
\ No newline at end of file
+++ /dev/null
-/* Copyright 1992 Karl Berry
- Copyright 2007 TeX Users Group
- Copyright 2014 Clerk Ma
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301 USA. */
-
-#define EXTERN extern
-
-#include "texd.h"
-
-boolean check_kanji(integer c)
-{
- return is_char_kanji(c);
-}
-
-boolean is_char_ascii(integer c)
-{
- return (0 <= c && c < 0x100);
-}
-
-boolean is_char_kanji(integer c)
-{
- return (iskanji1(Hi(c)) && iskanji2(Lo(c)));
-}
-
-boolean ismultiprn(integer c)
-{
- if (iskanji1(c) || iskanji2(c))
- return true;
-
- return false;
-}
-
-integer calc_pos(integer c)
-{
- unsigned char c1, c2;
-
- if(c>=0 && c<=255)
- return(c);
-
- c1 = (c >> 8) & 0xff;
- c2 = c & 0xff;
-
- if(iskanji1(c1))
- {
- if (is_internalSJIS())
- {
- c1 = ((c1 - 0x81) % 4) * 64; /* c1 = 0, 64, 128, 192 */
- c2 = c2 % 64; /* c2 = 0..63 */
- }
- else
- {
- c1 = ((c1 - 0xa1) % 4) * 64; /* c1 = 0, 64, 128, 192 */
- c2 = c2 % 64; /* c2 = 0..63 */
- }
-
- return(c1 + c2); /* ret = 0..255 */
- } else
- return(c2);
-}
-
-integer kcatcodekey(integer c)
-{
- return Hi(toDVI(c));
-}
-
-void init_default_kanji (const_string file_str, const_string internal_str)
-{
- char *p;
-
- enable_UPTEX (false); /* disable */
-
- if (!set_enc_string (file_str, internal_str))
- {
- fprintf (stderr, "Bad kanji encoding \"%s\" or \"%s\".\n",
- file_str ? file_str : "NULL",
- internal_str ? internal_str : "NULL");
- uexit(1);
- }
-
- p = getenv ("PTEX_KANJI_ENC");
-
- if (p)
- {
- if (!set_enc_string (p, NULL))
- fprintf (stderr, "Ignoring bad kanji encoding \"%s\".\n", p);
- }
-
-#ifdef WIN32
- p = kpse_var_value ("guess_input_kanji_encoding");
-
- if (p)
- {
- if (*p == '1' || *p == 'y' || *p == 't')
- infile_enc_auto = 1;
-
- free(p);
- }
-#endif
-}
-/* Routines needed by pTeX */
-/*
-void print_kanji(KANJI_code s)
-{
- if (s > 255)
- {
- print_char(Hi(s));
- print_char(Lo(s));
- }
- else
- print_char(s);
-}
-
-void print_kansuji(integer n)
-{
- int k;
- KANJI_code cx;
-
- k = 0;
-
- if (n < 0)
- return;
-
- do
- {
- dig[k] = n % 10;
- n = n / 10;
- incr(k);
- }
- while (!(n = 0));
-
- while (k > 0)
- {
- decr(k);
- cx = kansuji_char(dig[k]);
- print_kanji(fromDVI(cx));
- }
-}
-
-void print_dir(eight_bits dir)
-{
- if (dir == dir_yoko)
- print_char('Y');
- else if (dir == dir_tate)
- print_char('T');
- else if (dir == dir_dtou)
- print_char('D');
-}
-
-void print_direction(integer d)
-{
- switch (d)
- {
- case dir_yoko:
- print_string("yoko");
- break;
-
- case dir_tate:
- print_string("tate");
- break;
-
- case dir_dtou:
- print_string("dtou");
- break;
- }
-
- if (d < 0)
- print_string("(math)");
- else
- print_string(" direction");
-}
-
-eight_bits get_jfm_pos(KANJI_code kcode, internal_font_number f)
-{
- KANJI_code jc;
- pointer sp, mp, ep;
-
- if (f == null_font)
- {
- return kchar_type(null_font, 0);
- }
-
- jc = toDVI(kcode);
- sp = 1;
- ep = font_num_ext[f] - 1;
-
- if (ep >= 1 && kchar_code(f, sp) <= jc && jc <= kchar_code(f, ep))
- {
- while (sp <= ep)
- {
- mp = sp + (ep - sp) / 2;
-
- if (jc < kchar_code(f, mp))
- ep = mp - 1;
- else if (jc > kchar_code(f, mp))
- sp = mp + 1;
- else
- {
- return kchar_typ(f, mp);
- }
- }
- }
-
- return kchar_type(f, 0);
-}
-
-pointer get_inhibit_pos(KANJI_code c, small_number n)
-{
- pointer p, s;
-
- s = calc_pos(c);
- p = s;
-
- if (n == new_pos)
- {
- do
- {
- if (inhibit_xsp_code(p) == 0 || inhibit_xsp_code(p) == c)
- goto done;
-
- incr(p);
-
- if (p > 255)
- p = 0;
- }
- while (!(s == p));
-
- p = no_entry;
- }
- else
- {
- do
- {
- if (inhibit_xsp_code(p) == 0)
- goto done1;
-
- if (inhibit_xsp_code(p) == c)
- goto done;
-
- incr(p);
-
- if (p > 255)
- p = 0;
- }
- while (!(s == p));
-
-done1:
- p = no_entry;
- }
-
-done:
- return p;
-}
-
-void set_math_kchar(integer c)
-{
- pointer p;
-
- p = new_noad();
- math_type(nucleus(p)) = math_jchar;
- inhibit_glue_flag = false;
- character(nucleus(p)) = 0;
- math_kcode(p) = c;
- fam(nucleus) = cur_jfam;
-
- if (font_dir[fam_fnt(fam(nucleus(p)) + cur_size)] == dir_default)
- {
- print_err("Not two-byte family");
- help1("IGNORE.");
- error();
- }
-
- type(p) = ord_noad;
- link(tail) = p;
- tail = p;
-}
-
-void synch_dir(void)
-{
- scaled tmp;
-
- switch (cur_dir_hv)
- {
- case dir_yoko:
- if (dvi_dir != cur_dir_hv)
- {
- synch_h();
- synch_v();
- dvi_out(dir_chg);
- dvi_out(dvi_yoko);
- dir_used = true;
-
- switch ()
- {
- case dir_tate:
- tmp = cur_h;
- cur_h = -cur_v;
- cur_v = tmp;
- break;
-
- case dir_dtou:
- tmp = cur_h;
- cur_h = cur_v;
- cur_v = -tmp;
- break
- }
-
- dvi_h = cur_h;
- dvi_v = cur_v;
- dvi_dir = cur_dir_hv;
- }
- break;
-
- case dir_tate:
- if (dvi_dir != cur_dir_hv)
- {
- synch_h();
- synch_v();
- dvi_out(dirchg);
- dvi_out(dvi_tate);
- dir_used = true;
-
- switch (dvi_dir)
- {
- case dir_yoko:
- tmp = cur_h;
- cur_h = cur_v;
- cur_v = -tmp;
- break;
-
- case dir_dtou:
- cur_v = -cur_v;
- cur_h = -cur_h;
- break;
- }
-
- dvi_h = cur_h;
- dvi_v = cur_v;
- dvi_dir = cur_dir_hv;
- }
- break;
-
- case dir_dtou:
- if (dvi_dir != cur_dir_hv)
- {
- synch_h();
- synch_v();
- dvi_out(dir_chg);
- dvi_out(dvi_dtou);
- dir_used = true;
-
- switch (dvi_dir)
- {
- case dir_yoko:
- tmp = cur_h;
- cur_h = -cur_v;
- cur_v = tmp;
- break;
-
- case dir_tate:
- cur_v = -cur_v;
- cur_h = -cur_h;
- break;
- }
-
- dvi_h = cur_h;
- dvi_v = cur_v;
- dvi_dir = cur_dir_hv;
- }
- break;
-
- default:
- confusion("synch_dir");
- break;
- }
-}
-
-void dir_out(void)
-{
- pointer this_box;
-
- this_box = temp_ptr;
- temp_ptr = list_ptr(this_box);
-
- if (type(temp_ptr) != hlist_node && type(temp_ptr) != vlist_out)
- confusion("dir_out");
-
- switch (box_dir(this_box))
- {
- case dir_yoko:
- switch (box_dir(temp_ptr))
- {
- case dir_tate:
- cur_v = cur_v - height(this_box);
- cur_h = cur_h + depth(temp_ptr);
- break;
-
- case dir_dtou:
- cur_v = cur_v + depth(this_box);
- cur_h = cur_h + height(temp_ptr);
- break;
- }
- break;
-
- case dir_tate:
- switch (box_dir(temp_ptr))
- {
- case dir_yoko:
- cur_v = cur_v + depth(this_box);
- cur_h = cur_h + height(temp_ptr);
- break;
-
- case dir_dtou:
- cur_v = cur_v + depth(this_box) - height(temp_ptr);
- cur_h = cur_h + width(temp_ptr);
- break;
- }
- break;
-
- case dir_dtou:
- switch (box_dir(temp_ptr))
- {
- case dir_yoko:
- cur_v = cur_v - height(this_box);
- cur_h = cur_h + depth(temp_ptr);
- break;
-
- case dir_tate:
- cur_v = cur_v + depth(this_box) - height(temp_ptr);
- cur_h = cur_h + width(temp_ptr);
- break;
- }
- break;
- }
-
- cur_dir_hv = box_dir(temp_ptr);
-
- if (type(temp_ptr) == vlist_node)
- vlist_out();
- else
- hlist_out();
-}
-*/
\ No newline at end of file