/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
/* Now invert the xchr mapping to get xord mapping */
- for (i = 0; i < 255; i++) xord[xchr[i]] = (char) i;
+ for (i = 0; i <= 255; i++) xord[xchr[i]] = (char) i;
- xord[127]= 127; /* hmm, a fixed point ? why ? */
+ xord[127] = 127; /* hmm, a fixed point ? why ? */
flag = 0; /* 93/Dec/28 - bkph */
if (trace_flag != 0) {
for (k = 0; k < 256; k++) /* entries in xord / xchr */
- if (xord[k]!= k) {
+ if (xord[k] != k) {
flag = 1;
break;
}
if (flag) { /* 127 here means mapping undefined */
show_line("Inverted mapping xord[] pairs:\n", 0);
for (k = 0; k < 256; k++) {/* entries in xord / xchr */
- if (xord[k]!= 127) {
+ if (xord[k] != 127) {
sprintf(log_line, "%d => %d\n", k, xord[k]);
show_line(log_line, 0);
}
}
if (interaction < 0) /* may now set in local.c bkph */
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
- interaction = 3;
+ interaction = error_stop_mode;
deletions_allowed = true;
set_box_allowed = true;
error_count = 0;
;
/* darn, need to know mem_top, mem_max etc for the following ... */
#ifdef DEBUG
- was_mem_end = mem_min;
-/* was_lo_max = mem_min; */
- was_lo_max = mem_bot;
+ was_mem_end = mem_min;
+/* was_lo_max = mem_min; */
+ was_lo_max = mem_bot;
/* was_hi_min = mem_max; */
- was_hi_min = mem_top;
- panicking = false;
+ was_hi_min = mem_top;
+ panicking = false;
#endif /* DEBUG */
- nest_ptr = 0;
- max_nest_stack = 0;
- mode = 1;
- head = contrib_head;
+ nest_ptr = 0;
+ max_nest_stack = 0;
+ mode = 1;
+ head = contrib_head;
tail = contrib_head;
- cur_list.aux_field.cint = ignore_depth;
+ cur_list.aux_field.cint = ignore_depth;
mode_line = 0;
- prev_graf = 0;
- shown_mode = 0;
- page_contents = 0;
- page_tail = page_head;
+ prev_graf = 0;
+ shown_mode = 0;
+ page_contents = 0;
+ page_tail = page_head;
#ifdef ALLOCATEMAIN
if (is_initex) /* in iniTeX we did already allocate mem [] */
#endif
last_glue = empty_flag;
last_penalty = 0;
last_kern = 0;
- page_so_far[7]= 0;
+ page_so_far[7] = 0;
page_max_depth = 0;
-/* from int_base to eqtb_size */
- {
- register integer for_end;
- k = (hash_size + 3163);
- for_end = (hash_size + 4006);
- if (k <= for_end)
- do xeq_level[k]= 1;
- while(k++ < for_end);
- }
+ for (k = int_base; k <= eqtb_size; k++) xeq_level[k] = 1;
no_new_control_sequence = true;
hash[514].v.LH = 0; /* next(hash_base):= 0 */
hash[514].v.RH = 0; /* text(hash_base):= 0 */
/* 514 + hash_size + 266 = hashbase + hashsize + 10 + font_max */
/* for k <- hashbase+1 to undefined_control_sequence - 1 do ... p.257 */
- {
- register integer for_end;
- k = 515;
- for_end = (hash_size + 780);
- if (k <= for_end)
- do hash[k]= hash[514];
- while(k++ < for_end);
- }
- save_ptr = 0;
- cur_level = 1;
- cur_group = 0;
- cur_boundary = 0;
- max_save_stack = 0;
- mag_set = 0;
- cur_mark[0]= 0;
- cur_mark[1]= 0;
- cur_mark[2]= 0;
- cur_mark[3]= 0;
- cur_mark[4]= 0;
- cur_val = 0;
- cur_val_level = 0;
- radix = 0;
- cur_order = 0;
- {
- register integer for_end;
- k = 0;
- for_end = 16;
- if (k <= for_end)
- do read_open[k]= 2;
- while(k++ < for_end);
- }
- cond_ptr = 0;
- if_limit = 0;
- cur_if = 0;
- if_line = 0;
- {
- register integer for_end;
- k = 0;
- for_end = font_max;
- if (k <= for_end)
- do font_used[k]= false;
- while(k++ < for_end);
- }
+ for (k = hash_base + 1; k <= undefined_control_sequence - 1; k++) hash[k] = hash[hash_base];
+ save_ptr = 0;
+ cur_level = 1;
+ cur_group = 0;
+ cur_boundary = 0;
+ max_save_stack = 0;
+ mag_set = 0;
+ cur_mark[0] = 0;
+ cur_mark[1] = 0;
+ cur_mark[2] = 0;
+ cur_mark[3] = 0;
+ cur_mark[4] = 0;
+ cur_val = 0;
+ cur_val_level = 0;
+ radix = 0;
+ cur_order = 0;
+ for (k = 0; k <= 16; k++) read_open[k] = 2;
+ cond_ptr = 0;
+ if_limit = 0;
+ cur_if = 0;
+ if_line = 0;
+ for (k = 0; k <= font_max; k++) font_used[k] = false;
null_character.b0 = 0;
null_character.b1 = 0;
null_character.b2 = 0;
/* *not* OK with ALLOCATEHYPHEN, since may not be allocated yet */
#ifndef ALLOCATEHYPHEN
/* {register integer for_end; z = 0; for_end = 607; if (z <= for_end) do */
- {
- register integer for_end;
- z = 0;
- for_end = hyphen_prime;
- if (z <= for_end) do
- {
- hyph_word[z]= 0;
- hyph_list[z]= 0;
- }
- while(z++ < for_end);
- }
+ for (z = 0; z <= hyphen_prime; z++) {
+ hyph_word[z]= 0;
+ hyph_list[z]= 0;
+ }
#endif
hyph_count = 0;
output_active = false;
ins_disc = false;
after_token = 0;
long_help_seen = false;
- format_ident = 0;
- {
- register integer for_end;
- k = 0;
- for_end = 17;
- if (k <= for_end)
- do write_open[k]= false;
- while(k++ < for_end);
- }
+ format_ident = 0;
+ for (k = 0; k <= 17; k++) write_open[k]= false;
edit_name_start = 0;
;
#ifdef INITEX
/* following is new in 3.14159 */
init_cur_lang = prev_graf % 65536L;
init_l_hyf = prev_graf / 4194304L; /* 2^22 */
- init_r_hyf =(prev_graf / 65536L)% 64;
+ init_r_hyf = (prev_graf / 65536L)% 64;
/* *********************************************************************** */
pop_nest();
noshrinkerroryet = true;
if ((mem[eqtb[(hash_size + 789)].hh.v.RH].hh.b1 != 0) &&
(mem[eqtb[(hash_size + 789)].hh.v.RH + 3].cint != 0))
{
- eqtb[(hash_size + 789)].hh.v.RH =
- finite_shrink(eqtb[(hash_size + 789)].hh.v.RH);
+ eqtb[(hash_size + 789)].hh.v.RH = finite_shrink(eqtb[(hash_size + 789)].hh.v.RH);
}
if ((mem[eqtb[(hash_size + 790)].hh.v.RH].hh.b1 != 0) &&
(mem[eqtb[(hash_size + 790)].hh.v.RH + 3].cint != 0))
{
- eqtb[(hash_size + 790)].hh.v.RH =
- finite_shrink(eqtb[(hash_size + 790)].hh.v.RH);
+ eqtb[(hash_size + 790)].hh.v.RH = finite_shrink(eqtb[(hash_size + 790)].hh.v.RH);
}
q = eqtb[(hash_size + 789)].hh.v.RH;
r = eqtb[(hash_size + 790)].hh.v.RH;
- background[1]= mem[q + 1].cint + mem[r + 1].cint;
- background[2]= 0;
- background[3]= 0;
- background[4]= 0;
- background[5]= 0;
- background[2 + mem[q].hh.b0]= mem[q + 2].cint;
- background[2 + mem[r].hh.b0]= background[2 + mem[r].hh.b0]+
- mem[r + 2].cint;
- background[6]= mem[q + 3].cint + mem[r + 3].cint;
+ background[1] = mem[q + 1].cint + mem[r + 1].cint;
+ background[2] = 0;
+ background[3] = 0;
+ background[4] = 0;
+ background[5] = 0;
+ background[2 + mem[q].hh.b0] = mem[q + 2].cint;
+ background[2 + mem[r].hh.b0] = background[2 + mem[r].hh.b0] + mem[r + 2].cint;
+ background[6] = mem[q + 3].cint + mem[r + 3].cint;
minimum_demerits = 1073741823L; /* 2^30 - 1 *//* 40000000 hex - 1 */
- minimal_demerits[3]= 1073741823L;
- minimal_demerits[2]= 1073741823L;
- minimal_demerits[1]= 1073741823L;
- minimal_demerits[0]= 1073741823L;
- if (eqtb[(hash_size + 1312)].hh.v.RH == 0)
- if (eqtb[(hash_size + 3747)].cint == 0)
+ minimal_demerits[3] = 1073741823L;
+ minimal_demerits[2] = 1073741823L;
+ minimal_demerits[1] = 1073741823L;
+ minimal_demerits[0] = 1073741823L;
+ if (par_shape_ptr == 0)
+ if (hang_indent == 0)
{
last_special_line = 0;
- second_width = eqtb[(hash_size + 3733)].cint;
+ second_width = hsize;
second_indent = 0;
}
else {
- last_special_line = abs(eqtb[(hash_size + 3204)].cint);
- if (eqtb[(hash_size + 3204)].cint < 0)
+ last_special_line = abs(hang_after);
+ if (hang_after < 0)
{
- first_width = eqtb[(hash_size + 3733)].cint -
- abs(eqtb[(hash_size + 3747)].cint);
- if (eqtb[(hash_size + 3747)].cint >= 0)
- first_indent = eqtb[(hash_size + 3747)].cint;
+ first_width = hsize -
+ abs(hang_indent);
+ if (hang_indent >= 0)
+ first_indent = hang_indent;
else first_indent = 0;
- second_width = eqtb[(hash_size + 3733)].cint;
+ second_width = hsize;
second_indent = 0;
} else {
- first_width = eqtb[(hash_size + 3733)].cint;
+ first_width = hsize;
first_indent = 0;
- second_width = eqtb[(hash_size + 3733)].cint -
- abs(eqtb[(hash_size + 3747)].cint);
- if (eqtb[(hash_size + 3747)].cint >= 0)
- second_indent = eqtb[(hash_size + 3747)].cint;
+ second_width = hsize -
+ abs(hang_indent);
+ if (hang_indent >= 0)
+ second_indent = hang_indent;
else second_indent = 0;
}
}
else {
- last_special_line = mem[eqtb[(hash_size + 1312)].hh.v.RH].hh.v.LH - 1;
- second_width = mem[eqtb[(hash_size + 1312)].hh.v.RH + 2 *(last_special_line + 1)].cint;
- second_indent = mem[eqtb[(hash_size + 1312)].hh.v.RH + 2 * last_special_line + 1].cint;
+ last_special_line = mem[par_shape_ptr].hh.v.LH - 1;
+ second_width = mem[par_shape_ptr + 2 *(last_special_line + 1)].cint;
+ second_indent = mem[par_shape_ptr + 2 * last_special_line + 1].cint;
}
/* if looseness=0 then easy_line:=last_special_line */
- if (eqtb[(hash_size + 3182)].cint == 0)
+ if (looseness == 0)
easyline = last_special_line;
/* else easyline = 262143L; */ /* NO! */
else easyline = empty_flag;
/* threshold:=pretolerance; */
- threshold = eqtb[(hash_size + 3163)].cint;
+ threshold = pretolerance;
if (threshold >= 0)
{
;
#ifdef STAT
/* if tracing_paragraphs>0 then */
- if (eqtb[(hash_size + 3195)].cint > 0)
+ if (tracing_paragraphs > 0)
{
begin_diagnostic();
print_nl("@firstpass");
}
else {
/* threshold:=tolerance; second_pass:=true; */
- threshold = eqtb[(hash_size + 3164)].cint;
+ threshold = tolerance;
second_pass = true;
/* final_pass:=(emergency_stretch<=0); */
- final_pass =(eqtb[(hash_size + 3750)].cint <= 0);
+ final_pass =(emergency_stretch <= 0);
;
#ifdef STAT
- if (eqtb[(hash_size + 3195)].cint > 0)
+ if (tracing_paragraphs > 0)
begin_diagnostic();
#endif /* STAT */
}
if (eqtb[(hash_size + 2139) + c].hh.v.RH != 0)
/* signed unsigned mismatch ? (c is unsigned) */
if ((eqtb[(hash_size + 2139) + c].hh.v.RH == c)||
- (eqtb[(hash_size + 3201)].cint > 0))
+ (uc_hyph > 0))
goto lab32;
else goto lab31;
lab22: prevs = s;
s = mem[cur_p + 1].hh.v.LH;
disc_width = 0;
if (s == 0)
- try_break(eqtb[(hash_size + 3167)].cint, 1);
+ try_break(ex_hyphen_penalty, 1);
else {
-
do {
if ((s >= hi_mem_min))
{
s = mem[s].hh.v.RH;
} while(!(s == 0));
active_width[1]= active_width[1]+ disc_width;
- try_break(eqtb[(hash_size + 3166)].cint, 1);
+ try_break(hyphen_penalty, 1);
active_width[1]= active_width[1]- disc_width;
}
r = mem[cur_p].hh.b1;
} while(!(r == active));
best_line = mem[best_bet + 1].hh.v.LH;
/* if looseness=0 then goto done; */
- if (eqtb[(hash_size + 3182)].cint == 0){
+ if (looseness == 0){
/* if (final_pass && eqtb[(hash_size + 3750)].cint > 0){ */
/* paragraph_failed++; */
/* } */
);
/* if ((line_diff<actual_looseness)and(looseness<=line_diff))or@|
((line_diff>actual_looseness)and(looseness>=line_diff)) then */
- if (((line_diff < actual_looseness)&&
- (eqtb[(hash_size + 3182)].cint
- <= line_diff)) ||((line_diff > actual_looseness)&&
- (eqtb[(hash_size + 3182)].cint >= line_diff)))
+ if (((line_diff < actual_looseness) && (looseness <= line_diff)) ||
+ ((line_diff > actual_looseness) && (looseness >= line_diff)))
{
best_bet = r;
actual_looseness = line_diff;
}
/* if (actual_looseness=looseness)or final_pass then goto done; */
/* if ((actual_looseness == eqtb[(hash_size + 3182)].cint)|| final_pass)*/
- if ((actual_looseness == eqtb[(hash_size + 3182)].cint)) {
+ if ((actual_looseness == looseness)) {
goto lab30;
}
if (final_pass){
{
;
#ifdef STAT
- if (eqtb[(hash_size + 3195)].cint > 0)
- print_nl("@second_pass"); /* */
+ if (tracing_paragraphs > 0)
+ print_nl("@secondpass"); /* */
#endif /* STAT */
/* threshold:=tolerance; */
- threshold = eqtb[(hash_size + 3164)].cint;
+ threshold = tolerance;
second_pass = true;
second_pass_count++; /* 96 Feb 9 */
/* final_pass:=(emergency_stretch<=0); */
- final_pass =(eqtb[(hash_size + 3750)].cint <= 0);
+ final_pass =(emergency_stretch <= 0);
}
else {
;
#ifdef STAT
- if (eqtb[(hash_size + 3195)].cint > 0) /* tracing_paragraphs */
+ if (tracing_paragraphs > 0)
print_nl("@emergencypass"); /* */
#endif /* STAT */
/* can only get here is \emergencystretch has been set positive */
/* background[2]:=background[2]+emergency_stretch; final_pass:=true; */
- background[2]= background[2]+ eqtb[(hash_size + 3750)].cint;
+ background[2]= background[2]+ emergency_stretch;
final_pass = true;
final_pass_count++; /* 96 Feb 9 */
} /* end of if second_pass */
if (best_line == 2) singleline++;
;
#ifdef STAT
- if (eqtb[(hash_size + 3195)].cint > 0)
+ if (tracing_paragraphs > 0)
{
end_diagnostic(true);
normalize_selector();
}
pack_begin_line = 0;
}
-
+/* sec 1211 */
void prefixed_command (void)
{
small_number a;
integer n;
bool e;
a = 0;
- while(cur_cmd == 93){
- if (! odd(a / cur_chr))
- a = a + cur_chr; /* small_number a; */
+ while (cur_cmd == prefix) {
+ if (!odd(a / cur_chr))
+ a = a + cur_chr; /* small_number a; */
do {
- get_x_token();
- } while(!((cur_cmd != 10)&&(cur_cmd != 0)));
- if (cur_cmd <= 70)
- {
+ get_x_token();
+ } while(!((cur_cmd != spacer) && (cur_cmd != relax)));
+ if (cur_cmd <= max_non_prefixed_command) {
print_err("You can't use a prefix with `");
- print_cmd_chr(cur_cmd, cur_chr);
- print_char(39); /* ' */
- help1("I'll pretend you didn't say \\long or \\outer or \\global.");
- back_error();
- return;
- }
- }
- if ((cur_cmd != 97)&&(a % 4 != 0)) {
+ print_cmd_chr(cur_cmd, cur_chr);
+ print_char('\'');
+ help1("I'll pretend you didn't say \\long or \\outer or \\global.");
+ back_error();
+ return;
+ }
+ }
+ if ((cur_cmd != 97) && (a % 4 != 0)) {
print_err("You can't use `");
print_esc("long");
print_string("' or `");
print_string("' with `");
print_cmd_chr(cur_cmd, cur_chr);
print_char(39); /* ' */
- help1("I'll pretend you didn't say \\long or \\outer here.");
+ help1("I'll pretend you didn't say \\long or \\outer here.");
error();
}
- if (eqtb[(hash_size + 3206)].cint != 0)
- if (eqtb[(hash_size + 3206)].cint < 0)
+ if (global_defs != 0)
+ if (global_defs < 0)
{
if ((a >= 4))
a = a - 4;
- }
- else {
-
+ } else {
if (!(a >= 4))
a = a + 4;
}
- switch(cur_cmd){
- case 87 :
+ switch (cur_cmd) {
+ case 87:
/* set_font: define(cur_font_loc,data,cur_chr); */
if ((a >= 4))
geq_define((hash_size + 1834), 120, cur_chr);
else eq_define((hash_size + 1834), 120, cur_chr);
break;
- case 97 :
+ case 97:
{
- if (odd(cur_chr)&& !(a >= 4)&&
- (eqtb[(hash_size + 3206)].cint >= 0))
- a = a + 4;
- e =(cur_chr >= 2);
- get_r_token();
- p = cur_cs;
- q = scan_toks(true, e);
- if ((a >= 4)) geq_define(p, 111 +(a % 4), def_ref);
- else eq_define(p, 111 +(a % 4), def_ref);
- }
- break;
- case 94 :
+ if (odd(cur_chr) && !(a >= 4) && (global_defs >= 0))
+ a = a + 4;
+ e = (cur_chr >= 2);
+ get_r_token();
+ p = cur_cs;
+ q = scan_toks(true, e);
+ if ((a >= 4)) geq_define(p, 111 +(a % 4), def_ref);
+ else eq_define(p, 111 +(a % 4), def_ref);
+ }
+ break;
+ case 94:
{
- n = cur_chr;
- get_r_token();
- p = cur_cs;
- if (n == 0)
- {
- do {
- get_token();
- } while(!(cur_cmd != 10));
- if (cur_tok == 3133)
- {
- get_token();
- if (cur_cmd == 10)
- get_token();
- }
- }
- else {
-
- get_token();
- q = cur_tok;
- get_token();
- back_input();
- cur_tok = q;
- back_input();
- }
+ n = cur_chr;
+ get_r_token();
+ p = cur_cs;
+ if (n == 0) {
+ do {
+ get_token();
+ } while (!(cur_cmd != 10));
+ if (cur_tok == 3133) {
+ get_token();
+ if (cur_cmd == 10)
+ get_token();
+ }
+ } else {
+ get_token();
+ q = cur_tok;
+ get_token();
+ back_input();
+ cur_tok = q;
+ back_input();
+ }
if (cur_cmd >= 111)
- incr(mem[cur_chr].hh.v.LH);
- if ((a >= 4))
- geq_define(p, cur_cmd, cur_chr);
- else eq_define(p, cur_cmd, cur_chr);
- }
- break;
- case 95 :
+ incr(mem[cur_chr].hh.v.LH);
+ if ((a >= 4))
+ geq_define(p, cur_cmd, cur_chr);
+ else
+ eq_define(p, cur_cmd, cur_chr);
+ }
+ break;
+ case 95:
{
- n = cur_chr;
- get_r_token();
- p = cur_cs;
- if ((a >= 4)) geq_define(p, 0, 256);
- else eq_define(p, 0, 256);
- scan_optional_equals();
- switch(n){
- case 0 :
- {
- scan_char_num();
- if ((a >= 4))
- geq_define(p, 68, cur_val);
- else eq_define(p, 68, cur_val);
- }
- break;
- case 1 :
- {
- scan_fifteen_bit_int();
- if ((a >= 4))
- geq_define(p, 69, cur_val);
- else eq_define(p, 69, cur_val);
- }
- break;
- default:
- {
- scan_eight_bit_int();
+ n = cur_chr;
+ get_r_token();
+ p = cur_cs;
+ if ((a >= 4))
+ geq_define(p, 0, 256);
+ else
+ eq_define(p, 0, 256);
+ scan_optional_equals();
+ switch (n) {
+ case 0:
+ {
+ scan_char_num();
+ if ((a >= 4))
+ geq_define(p, 68, cur_val);
+ else eq_define(p, 68, cur_val);
+ }
+ break;
+ case 1:
+ {
+ scan_fifteen_bit_int();
+ if ((a >= 4))
+ geq_define(p, 69, cur_val);
+ else
+ eq_define(p, 69, cur_val);
+ }
+ break;
+ default:
+ {
+ scan_eight_bit_int();
switch(n){
case 2 :
if ((a >= 4))
break;
case 6 :
if ((a >= 4))
- geq_define(p, 72, (hash_size + 1322) + cur_val);
- else eq_define(p, 72, (hash_size + 1322) + cur_val);
+ geq_define(p, 72, toks_base + cur_val);
+ else eq_define(p, 72, toks_base + cur_val);
break;
}
}
if (cur_cmd == 71)
{
scan_eight_bit_int();
- p = (hash_size + 1322) + cur_val;
+ p = toks_base + cur_val;
}
else p = cur_chr;
scan_optional_equals();
{
scan_eight_bit_int();
cur_cmd = 72;
- cur_chr = (hash_size + 1322) + cur_val;
+ cur_chr = toks_base + cur_val;
}
if (cur_cmd == 72)
{
if (name == NULL) name = defaultname;
sprintf(log_line, "(Perhaps %s is for an older version of TeX)\n", name);
show_line(log_line, 0);
- name_of_file[name_length + 1] = '\0'; /* null terminate */
+ name_of_file[name_length + 1] = '\0';
sprintf(log_line, "(Alternatively, %s may have been corrupted)\n", name_of_file+1);
show_line(log_line, 0);
- name_of_file[name_length + 1] = ' '; /* space terminate */
+ name_of_file[name_length + 1] = ' ';
sprintf(log_line,
"(Perhaps your %s environment variable is not set correctly)\n", envvar);
show_line(log_line, 0);
}
/* sec 1303 */
bool load_fmt_file (void)
-{/* 6666 10 */
+{
register bool Result;
integer j, k;
halfword p, q;
}
for (k = 0; k < str_ptr; k++) {
if (str_start[k+1] == 0) break;
- n = str_start[k+1] - str_start[k];
+ n = length(k);
if (n < 0) break;
st = str_start[k];
flag = 0;
init_prim();
init_str_ptr = str_ptr;
init_pool_ptr = pool_ptr;
- dateandtime(eqtb[(hash_size + 3183)].cint,
- eqtb[(hash_size + 3184)].cint,
- eqtb[(hash_size + 3185)].cint,
- eqtb[(hash_size + 3186)].cint);
+ dateandtime(tex_time, day, month, year);
}
#endif /* INITEX */
ready_already = 314159L; /* magic number */
#ifdef CHECKEQTB
if (debug_flag) check_eqtb("after format"); /* debugging 94/Apr/5 */
#endif
- if ((eqtb[(hash_size + 3211)].cint < 0)||
- (eqtb[(hash_size + 3211)].cint > 255))
+ if ((end_line_char < 0)||
+ (end_line_char > 255))
decr(cur_input.limit_field);
/* long to unsigned char ... */
- else buffer[cur_input.limit_field]= eqtb[(hash_size + 3211)].cint;
- dateandtime(eqtb[(hash_size + 3183)].cint,
- eqtb[(hash_size + 3184)].cint,
- eqtb[(hash_size + 3185)].cint,
- eqtb[(hash_size + 3186)].cint);
+ else buffer[cur_input.limit_field] = end_line_char;
+ dateandtime(tex_time, day, month, year);
magic_offset = str_start[886]- 9 * 16; /* following: */
/* "0234000122*4000133**3**344*0400400*000000234000111*1111112341011" */
if (interaction == 0) selector = 16;
hi_mem_min = mem_top - 13; /* hi_mem_min <- hi_mem_stat_min */
var_used = 20; /* var_used <- lo_mem_stat_max */
dyn_used = 14; /* dyn_used <- hi_mem_stat_usage */
-/* eq_type(undefined_control_sequence) <- undefined_cs; */
-/* equiv(undefined_control_sequence) <- null; */
-/* eq_level(undefined_control_sequence) <- level_zero; */
- eqtb[(hash_size + 781)].hh.b0 = 101;
- eqtb[(hash_size + 781)].hh.v.RH = 0;
- eqtb[(hash_size + 781)].hh.b1 = 0;
-/* for k <- active_base to undefined_control_sequence -1 do */
-/* eqtb[k] <- eqtb(undefined_control_sequence); */
-/* {register integer for_end; k = 1; for_end = 10280; if (k <= for_end) do */
- {
- register integer for_end;
- k = 1;
- for_end = (hash_size + 780);
- if (k <= for_end) do
- eqtb[k]= eqtb[(hash_size + 781)];
- while(k++ < for_end);
- }
+ eq_type(undefined_control_sequence) = undefined_cs;
+ equiv(undefined_control_sequence) = 0;
+ eq_level(undefined_control_sequence) = level_zero;
+ for (k = active_base; k <= undefined_control_sequence - 1; k++) eqtb[k]= eqtb[undefined_control_sequence];
eqtb[(hash_size + 782)].hh.v.RH = 0; /* glue_base (hash_size + 782) */
- eqtb[(hash_size + 782)].hh.b1 = 1;
- eqtb[(hash_size + 782)].hh.b0 = 117;
-/* equiv(glue_base):=zero_glue; eq_level(glue_base):=level_one; */
-/* eq_type(glue_base):=glue_ref; */
-/* {register integer for_end; k = 10283; for_end = 10811; if (k <= for_end) */
- {
- register integer for_end;
- k = (hash_size + 783);
- for_end = (hash_size + 1311);
- if (k <= for_end)
- do eqtb[k]= eqtb[(hash_size + 782)];
- while(k++ < for_end);
- }
+ eq_level(glue_base) = level_one;
+ eqtb[(hash_size + 782)].hh.b0 = 117;
+ for (k = glue_base + 1; k <= local_base - 1; k++) eqtb[k]= eqtb[glue_base];
/* glue_ref_count(zero_glue):=glue_ref_count(zero_glue)+local_base-glue_base; */
/* local_base - glue_base = 530 = 17 glue_pars + 256 skip + 256 mu_skip */
mem[0].hh.v.RH = mem[0].hh.v.RH + 530; /* mem[mem_bot]? */
/* box(0):=null; eq_type(box_base):=box_ref; eq_level(box_base):=level_one; */
eqtb[(hash_size + 1312)].hh.v.RH = 0;
- eqtb[(hash_size + 1312)].hh.b0 = 118;
- eqtb[(hash_size + 1312)].hh.b1 = 1;
-/* for k:=box_base+1 to box_base+255 do eqtb[k]:=eqtb[box_base]; */
-/* {register integer for_end; k = 10813; for_end = 11077; if (k <= for_end) */
- {
- register integer for_end;
- k = (hash_size + 1313);
- for_end = (hash_size + 1577);
- if (k <= for_end)
- do eqtb[k]= eqtb[(hash_size + 781)];
- while(k++ < for_end);
- }
- eqtb[(hash_size + 1578)].hh.v.RH = 0;
- eqtb[(hash_size + 1578)].hh.b0 = 119;
- eqtb[(hash_size + 1578)].hh.b1 = 1;
-/* {register integer for_end; k = 11079; for_end = 11333; if (k <= for_end) */
- {
- register integer for_end;
- k = (hash_size + 1579);
- for_end = (hash_size + 1833);
- if (k <= for_end)
- do eqtb[k]= eqtb[(hash_size + 1578)];
- while(k++ < for_end);
- }
- eqtb[(hash_size + 1834)].hh.v.RH = 0;
- eqtb[(hash_size + 1834)].hh.b0 = 120;
- eqtb[(hash_size + 1834)].hh.b1 = 1;
-/* {register integer for_end; k = 11335; for_end = 11382; if (k <= for_end) */
- {
- register integer for_end;
- k = (hash_size + 1835);
- for_end = (hash_size + 1882);
- if (k <= for_end)
- do eqtb[k]= eqtb[(hash_size + 1834)];
- while(k++ < for_end);
- }
- eqtb[(hash_size + 1883)].hh.v.RH = 0;
- eqtb[(hash_size + 1883)].hh.b0 = 120;
- eqtb[(hash_size + 1883)].hh.b1 = 1;
-/* initialize cat_code, lc_code, uc_code, sf_code, math_code 256 * 5 */
-/* {register integer for_end; k = 11384; for_end = 12662; if (k <= for_end) */
- {
- register integer for_end;
- k = (hash_size + 1884);
- for_end = (hash_size + 3162);
- if (k <= for_end)
- do eqtb[k]= eqtb[(hash_size + 1883)];
- while(k++ < for_end);
- }
-/* cat_code(k) <- other_char; math_code(k) <- hi(k); sf_code(k) = 1000; */
- {
- register integer for_end;
- k = 0;
- for_end = 255;
- if (k <= for_end) do
- {
- eqtb[(hash_size + 1883) + k].hh.v.RH = 12;
- eqtb[(hash_size + 2907) + k].hh.v.RH = k;
- eqtb[(hash_size + 2651) + k].hh.v.RH = 1000;
- }
- while(k++ < for_end);
- }
-/* cat_base == 11383 */
-/* cat_code(carriage_return) <- car_ret; cat_code(" ") <- space */
-/* cat_code("\") <- escape; cat_code("%") <- comment; ... */
- eqtb[(hash_size + 1896)].hh.v.RH = 5;
- eqtb[(hash_size + 1915)].hh.v.RH = 10;
- eqtb[(hash_size + 1975)].hh.v.RH = 0;
- eqtb[(hash_size + 1920)].hh.v.RH = 14;
- eqtb[(hash_size + 2010)].hh.v.RH = 15;
- eqtb[(hash_size + 1883)].hh.v.RH = 9;
+ eqtb[(hash_size + 1312)].hh.b0 = 118;
+ eqtb[(hash_size + 1312)].hh.b1 = 1;
+ for (k = output_routine_loc; k <= toks_base + 255; k++) eqtb[k]= eqtb[undefined_control_sequence];
+ eqtb[(hash_size + 1578)].hh.v.RH = 0;
+ eqtb[(hash_size + 1578)].hh.b0 = 119;
+ eqtb[(hash_size + 1578)].hh.b1 = 1;
+ for (k = box_base + 1; k <= box_base + 255; k++) eqtb[k]= eqtb[box_base];
+ eqtb[(hash_size + 1834)].hh.v.RH = 0;
+ eqtb[(hash_size + 1834)].hh.b0 = 120;
+ eqtb[(hash_size + 1834)].hh.b1 = 1;
+ for (k = math_font_base; k <= math_font_base + 47; k++) eqtb[k]= eqtb[cur_font_loc];
+ eqtb[(hash_size + 1883)].hh.v.RH = 0;
+ eqtb[(hash_size + 1883)].hh.b0 = 120;
+ eqtb[(hash_size + 1883)].hh.b1 = 1;
+ for (k = cat_code_base; k <= int_base - 1; k++) eqtb[k]= eqtb[cat_code_base];
+ for (k = 0; k <= 255; k++) {
+ eqtb[(hash_size + 1883) + k].hh.v.RH = 12;
+ eqtb[(hash_size + 2907) + k].hh.v.RH = k;
+ eqtb[(hash_size + 2651) + k].hh.v.RH = 1000;
+ }
+/* cat_base == 11383 */
+ eqtb[(hash_size + 1896)].hh.v.RH = car_ret;
+ eqtb[(hash_size + 1915)].hh.v.RH = spacer;
+ eqtb[(hash_size + 1975)].hh.v.RH = escape;
+ eqtb[(hash_size + 1920)].hh.v.RH = comment;
+ eqtb[(hash_size + 2010)].hh.v.RH = invalid_char;
+ eqtb[(hash_size + 1883)].hh.v.RH = ignore;
/* for k:="0" to "9" do math_code(k):=hi(k+var_code); */
- {
- register integer for_end;
- k = 48;
- for_end = 57;
- if (k <= for_end) do
- eqtb[(hash_size + 2907) + k].hh.v.RH = k + 28672; /* '70000 */
- while(k++ < for_end);
- }
+ for (k = '0'; k <= '9'; k++) eqtb[(hash_size + 2907) + k].hh.v.RH = k + 28672;
/* cat_code of uppercase and lowercase letters ... */
- {
- register integer for_end;
- k = 65;
- for_end = 90;
- if (k <= for_end) do
- {
+ for (k = 'A'; k <= 'Z'; k++) {
/* cat_code ... */
- eqtb[(hash_size + 1883) + k].hh.v.RH = 11;
- eqtb[(hash_size + 1883) + k + 32].hh.v.RH = 11;
+ eqtb[(hash_size + 1883) + k].hh.v.RH = 11;
+ eqtb[(hash_size + 1883) + k + 32].hh.v.RH = 11;
/* mathcode(k) = hi(k + var_code + "100); */ /* '70000 + 256 */
- eqtb[(hash_size + 2907) + k].hh.v.RH =
- k + 28928; /* '70000 + 256 */
+ eqtb[(hash_size + 2907) + k].hh.v.RH = k + 28928; /* '70000 + 256 */
/* mathcode(k + "a" - "A") = hi(k + "a" - "A" + var_code + "100); */
- eqtb[(hash_size + 2907) + k + 32].hh.v.RH =
- k + 28960; /* '70000 + 256 + 32 */
+ eqtb[(hash_size + 2907) + k + 32].hh.v.RH = k + 28960; /* '70000 + 256 + 32 */
/* lc_code ... */
- eqtb[(hash_size + 2139) + k].hh.v.RH = k + 32;
- eqtb[(hash_size + 2139) + k + 32].hh.v.RH = k + 32;
+ eqtb[(hash_size + 2139) + k].hh.v.RH = k + 32;
+ eqtb[(hash_size + 2139) + k + 32].hh.v.RH = k + 32;
/* uc_code ... */
- eqtb[(hash_size + 2395) + k].hh.v.RH = k;
- eqtb[(hash_size + 2395) + k + 32].hh.v.RH = k;
+ eqtb[(hash_size + 2395) + k].hh.v.RH = k;
+ eqtb[(hash_size + 2395) + k + 32].hh.v.RH = k;
/* sf_code */
- eqtb[(hash_size + 2651) + k].hh.v.RH = 999;
- }
- while(k++ < for_end);
- }
-/* {register integer for_end; k = 12663; for_end = 12973; if (k <= for_end) */
- {
- register integer for_end;
- k = (hash_size + 3163);
- for_end = (hash_size + 3473);
- if (k <= for_end)
- do
- eqtb[k].cint = 0;
- while(k++ < for_end);
- }
- eqtb[(hash_size + 3180)].cint = 1000;
- eqtb[(hash_size + 3164)].cint = 10000;
- eqtb[(hash_size + 3204)].cint = 1;
- eqtb[(hash_size + 3203)].cint = 25;
- eqtb[(hash_size + 3208)].cint = 92;
- eqtb[(hash_size + 3211)].cint = 13;
-/* {register integer for_end; k = 13230; for_end = 13506; if (k <= for_end) */
- {
- register integer for_end;
- k = 0;
- for_end = 255;
- if (k <= for_end) do
- eqtb[(hash_size + 3474) + k].cint = -1;
- while(k++ < for_end);
- }
- eqtb[(hash_size + 3520)].cint = 0;
-/* {register integer for_end; k = 13230; for_end = 13506; if (k <= for_end) */
- {
- register integer for_end;
- k = (hash_size + 3730);
- for_end = (hash_size + 4006);
- if (k <= for_end)
- do eqtb[k].cint = 0;
- while(k++ < for_end);
- }
+ eqtb[(hash_size + 2651) + k].hh.v.RH = 999;
+ }
+ for (k = int_base; k <= del_code_base - 1; k++) eqtb[k].cint = 0;
+ mag = 1000;
+ tolerance = 10000;
+ hang_after = 1;
+ max_dead_cycles = 25;
+ escape_char = 92;
+ end_line_char = 13;
+ for (k = 0; k <= 255; k++) eqtb[(hash_size + 3474) + k].cint = -1;
+ eqtb[(hash_size + 3520)].cint = 0;
+ for (k = dimen_base; k <= eqtb_size; k++) eqtb[k].cint = 0;
/* hash_used = 10014; */ /* hash_used = frozen_control_sequence */
/* frozen_control_sequence = hashsize + hashbase p.222 */
/* hash_used = (hash_size + 514); */
/* @<Initialize table...@>= l.10750 */
font_ptr = 0; /* font_ptr:=null_font; */
fmem_ptr = 7; /* fmem_ptr:=7; */
- font_name[0]= 795; /* nullfont */
- font_area[0]= 335; /* "" */
- hyphen_char[0]= 45; /* - */
- skew_char[0]= -1;
+ font_name[0] = 795; /* nullfont */
+ font_area[0] = 335; /* "" */
+ hyphen_char[0] = 45; /* - */
+ skew_char[0] = -1;
/* ************************************************************************ */
/* bchar_label[null_font]:=non_address; */ /* 3.14159 */
/* bchar_label[0]= font_mem_size; */ /* OK ? 93/Nov/26 */
/* I have added a texpool file, but I need merge the pool to the binary */
/* lots of things updates the kpathsea sources -- Clerk Ma */
bool get_strings_started (void)
-{/* 30 10 */
+{
register bool Result;
- unsigned char k, l;
- ASCII_code m, n;
- str_number g;
- integer a;
- bool c;
+ unsigned char k, l;
+ ASCII_code m, n;
+ str_number g;
+ integer a;
+ bool c;
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
int flag; /* 95/Feb/19 */
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
- pool_ptr = 0;
- str_ptr = 0;
- str_start[0]= 0;
+ pool_ptr = 0;
+ str_ptr = 0;
+ str_start[0] = 0;
{
register integer for_end;
k = 0;
for_end = 255;
- if (k <= for_end) do
- {
- if (((k < 32)||(k > 126)))
- {
- append_char('^');
- append_char('^');
- if (k < 64) append_char(k + 64);
- else if (k < 128) append_char(k - 64);
- else {
- l = k / 16;
- if (l < 10)
- {
- str_pool[pool_ptr]= l + 48; /* '0' */
- incr(pool_ptr);
- } else {
- str_pool[pool_ptr]= l + 87; /* 'a' - 10 */
- incr(pool_ptr);
- }
- l = k % 16;
- if (l < 10)
- {
- str_pool[pool_ptr]= l + 48; /* '0' */
- incr(pool_ptr);
- } else {
- str_pool[pool_ptr]= l + 87; /* 'a' - 10 */
- incr(pool_ptr);
+ if (k <= for_end)
+ do {
+ if (((k < 32)||(k > 126))) {
+ append_char('^');
+ append_char('^');
+ if (k < 64)
+ append_char(k + 64);
+ else if (k < 128)
+ append_char(k - 64);
+ else {
+ l = k / 16;
+ if (l < 10) {
+ str_pool[pool_ptr] = l + 48; /* '0' */
+ incr(pool_ptr);
+ } else {
+ str_pool[pool_ptr] = l + 87; /* 'a' - 10 */
+ incr(pool_ptr);
+ }
+ l = k % 16;
+ if (l < 10) {
+ str_pool[pool_ptr] = l + 48; /* '0' */
+ incr(pool_ptr);
+ } else {
+ str_pool[pool_ptr] = l + 87; /* 'a' - 10 */
+ incr(pool_ptr);
+ }
}
- }
- } else append_char(k);
- g = make_string();
- }
- while(k++ < for_end);
- }
- vstrcpy((char *) name_of_file + 1, pool_name);
- name_of_file[0]= ' ';
- name_of_file[strlen(pool_name) + 1]= ' ';
- name_length = strlen(pool_name);
+ } else append_char(k);
+ g = make_string();
+ } while(k++ < for_end);
+ }
+ vstrcpy((char *) name_of_file + 1, pool_name);
+ name_of_file[0] = ' ';
+ name_of_file[strlen(pool_name) + 1] = ' ';
+ name_length = strlen(pool_name);
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
/* if (a_open_in(pool_file, TEXPOOLPATH)) */
flag = a_open_in(pool_file, TEXPOOLPATH);
if (flag == 0) { /* 95/Feb/19 */
pool_name [name_length - 1] = '\0'; /* `tex.pool' => `tex.poo' */
- vstrcpy((char *) name_of_file + 1, pool_name);
+ vstrcpy((char *) name_of_file + 1, pool_name);
name_of_file[0]= ' ';
name_of_file[strlen(pool_name)+ 1]= ' ';
name_length = strlen(pool_name);
if (flag) {
c = false;
do {
- {
+ {
/* if (eof(pool_file)) */ /* feof(pool_file)??? */
- if (test_eof(pool_file))
- {
+ if (test_eof(pool_file)) {
;
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
show_line("! string pool file has no check sum.\n", 1);
read(pool_file, n);
if (m == '*') /* last line starts with * */
{
- a = 0;
+ a = 0;
k = 1;
while (true) {
- if ((xord[n]< 48)||(xord[n]> 57))
- {
+ if ((xord[n]< 48)||(xord[n]> 57)) {
;
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
show_line("! string pool file check sum doesn't have nine digits.\n", 1);
/* added following bit of explanation 96/Jan/16 */
- if (! knuth_flag)
+ if (!knuth_flag)
bad_formator_pool(string_file, "the pool file", "TEXPOOL");
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
(void) a_close(pool_file);
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
show_line("! string pool check sum doesn't match; tangle me again.\n", 1);
/* added following bit of explanation 96/Jan/16 */
- if (! knuth_flag)
+ if (!knuth_flag)
bad_formator_pool(string_file, "the pool file", "TEXPOOL");
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
(void) a_close(pool_file);
#ifdef ALLOCATESTRING
/* can freely extend memory, so we need not be paranoid - stringvacancies */
/* if (pool_ptr + l + stringvacancies > current_pool_size)*/
- if (pool_ptr + l + stringmargin > current_pool_size){
- if (trace_flag) show_line("String margin reallocation\n", 0);
+ if (pool_ptr + l + stringmargin > current_pool_size) {
+ if (trace_flag)
+ show_line("String margin reallocation\n", 0);
/* str_pool = realloc_str_pool (pool_ptr + l + stringvacancies */
str_pool = realloc_str_pool (pool_ptr + l + stringmargin - current_pool_size + increment_pool_size);
}
if (pool_ptr + l + stringvacancies > pool_size)
#endif
{
- ;
+ ;
show_line("! You have to increase POOLSIZE.\n", 1);
- (void) a_close(pool_file);
- Result = false;
- return(Result);
- }
+ (void) a_close(pool_file);
+ Result = false;
+ return(Result);
+ }
{
register integer for_end;
k = 1;
for_end = l;
if (k <= for_end)
do {
- if (eoln(pool_file))
+ if (eoln(pool_file))
m = ' ';
else read(pool_file, m);
{
- str_pool[pool_ptr]= xord[m];
+ str_pool[pool_ptr] = xord[m];
incr(pool_ptr);
}
} while(k++ < for_end);
}
readln(pool_file); /* flush rest to end of file / end of line */
- g = make_string();
+ g = make_string();
}
- }
- } while(!(c));
- (void) a_close(pool_file);
- Result = true;
- }
- else {
- ;
+ }
+ } while (!(c));
+ (void) a_close(pool_file);
+ Result = true;
+ } else {
+ ;
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
- sprintf(log_line, "! I can't read %s.\n", pool_name);
- show_line(log_line, 1);
- if (! knuth_flag)
- show_line(" (Was unable to find tex.poo or tex.pool)\n", 0); /* extra explain */
+ sprintf(log_line, "! I can't read %s.\n", pool_name);
+ show_line(log_line, 1);
+ if (!knuth_flag)
+ show_line(" (Was unable to find tex.poo or tex.pool)\n", 0); /* extra explain */
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
- Result = false;
+ Result = false;
return(Result);
- }
- return Result;
-}
+ }
+ return Result;
+}
#endif /* INITEX */
#ifdef INITEX
void sort_avail (void)
{
- halfword p, q, r;
- halfword old_rover;
+ halfword p, q, r;
+ halfword old_rover;
p = get_node(1073741824L); /* 2^30 merge adjacent free nodes */
- p = rlink(rover);
- rlink(rover) = empty_flag;
- old_rover = rover;
+ p = rlink(rover);
+ rlink(rover) = empty_flag;
+ old_rover = rover;
while (p != old_rover)
- if (p < rover)
- {
- q = p;
- p = rlink(q);
- rlink(q) = rover;
- rover = q;
- } else {
- q = rover;
- while (rlink(q) < p) q = rlink(q);
- r = rlink(p);
- rlink(p) = rlink(q);
- rlink(q) = p;
- p = r;
- }
- p = rover;
+ if (p < rover) {
+ q = p;
+ p = rlink(q);
+ rlink(q) = rover;
+ rover = q;
+ } else {
+ q = rover;
+ while (rlink(q) < p)
+ q = rlink(q);
+ r = rlink(p);
+ rlink(p) = rlink(q);
+ rlink(q) = p;
+ p = r;
+ }
+ p = rover;
while (rlink(p) != empty_flag) {
- llink(rlink(p)) = p;
- p = rlink(p);
- }
+ llink(rlink(p)) = p;
+ p = rlink(p);
+ }
mem[p + 1].hh.v.RH = rover;
llink(rover) = p;
}
#endif /* INITEX */
#ifdef INITEX
+/*****************APTEX********************/
+/*
+str_number make_string_pool (char *s)
+{
+ while (*s != '\0') {
+ append_char(*s); incr(s);
+ }
+ return (make_string());
+}
+void primitive_s (char * s, quarterword c, halfword o)
+{
+ pool_pointer k, l;
+ small_number j;
+ str_number prim_str;
+ if (s[1] = '\0')
+ cur_val = s[0] + single_base;
+ else {
+ prim_str = make_string_pool(s);
+ k = str_start[prim_str]; l = str_start[prim_str] - k;
+ for (j = 0; j < l; incr(j)) buffer[j] = str_pool[k + j];
+ cur_val = id_lookup(0, l);
+ flush_string();
+ hash[cur_val].v.RH = prim_str;
+ }
+ eq_level(cur_val) = level_one; eq_type(cur_val) = c; equiv(cur_val) = o;
+}
+*/
+/*****************APTEX********************/
void primitive_ (str_number s, quarterword c, halfword o)
{
- pool_pointer k;
- small_number j;
+ pool_pointer k;
+ small_number j;
/* small_number l; */
- int l; /* 95/Jan/7 */
+ int l; /* 95/Jan/7 */
if (s < 256)
- cur_val = s + 257; /* cur_val <- s + single_base; p.264 */
+ cur_val = s + 257; /* cur_val <- s + single_base; p.264 */
else {
- k = str_start[s];
- l = str_start[s + 1] - k; /* small_number l */
- {
- register integer for_end;
- j = 0;
- for_end = l - 1;
- if (j <= for_end)
- do buffer[j]= str_pool[k + j];
- while(j++ < for_end);
- }
- cur_val = id_lookup(0, l);
+ k = str_start[s];
+ l = str_start[s + 1] - k; /* small_number l */
{
- decr(str_ptr);
- pool_ptr = str_start[str_ptr];
- }
-/* ********************** debugging only 96/Jan/20 should not happen */
+ register integer for_end;
+ j = 0;
+ for_end = l - 1;
+ if (j <= for_end)
+ do buffer[j]= str_pool[k + j];
+ while(j++ < for_end);
+ }
+ cur_val = id_lookup(0, l);
+ flush_string();
+/* ********************** debugging only 96/Jan/20 should not happen */
#ifdef SHORTHASH
- if (s > 65535L) show_line("ERROR: hash entry too large\n", 1);
+ if (s > 65535L)
+ show_line("ERROR: hash entry too large\n", 1);
#endif
hash[cur_val].v.RH = s;
}
- eqtb[cur_val].hh.b1 = 1;
- eqtb[cur_val].hh.b0 = c;
- eqtb[cur_val].hh.v.RH = o;
+ eqtb[cur_val].hh.b1 = 1;
+ eqtb[cur_val].hh.b0 = c;
+ eqtb[cur_val].hh.v.RH = o;
}
#endif /* INITEX */
#ifdef INITEX
trie_op_code new_trie_op_ (small_number d, small_number n, trie_op_code v)
-{/* 10 */
- register trie_op_code Result;
- integer h;
- trie_op_code u;
- integer l;
+{
+ register trie_op_code Result;
+ integer h;
+ trie_op_code u;
+ integer l;
/* the 313, 361 and 1009 are hard-wired constants here p.944 */
/* begin h:=abs(n+313*d+361*v+1009*cur_lang) mod (trie_op_size+trie_op_size) */
- h = abs(toint(n)+ 313 * toint(d)+ 361 * toint(v)+ 1009 *
- toint(cur_lang)) %(trie_op_size - neg_trie_op_size)+ neg_trie_op_size;
+ h = abs(toint(n) + 313 * toint(d) + 361 * toint(v) + 1009 *
+ toint(cur_lang)) % (trie_op_size - neg_trie_op_size) + neg_trie_op_size;
while (true) {
/* if l=0 then {empty position found for a new op} */
- l = trie_op_hash[h];
- if (l == 0)
- {
- if (trie_op_ptr == trie_op_size){
- overflow("pattern memory ops", trie_op_size); /* pattern memory ops - NOT DYNAMIC */
- return 0; // abort_flag set
- }
- u = trie_used[cur_lang];
+ l = trie_op_hash[h];
+ if (l == 0) {
+ if (trie_op_ptr == trie_op_size) {
+ overflow("pattern memory ops", trie_op_size); /* pattern memory ops - NOT DYNAMIC */
+ return 0; // abort_flag set
+ }
+ u = trie_used[cur_lang];
/* if u=max_quarterword then ??? */
- if (u == max_trie_op){
-/* overflow("pattern memory ops per language",
- max_quarterword-min_quarterword); ??? */
- overflow("pattern memory ops per language", max_trie_op - min_trie_op); /* pattern memory ops per language */
- return 0; // abort_flag set
- }
- incr(trie_op_ptr);
- incr(u);
- trie_used[cur_lang]= u;
+ if (u == max_trie_op) {
+/* overflow("pattern memory ops per language", max_quarterword-min_quarterword); ??? */
+ overflow("pattern memory ops per language", max_trie_op - min_trie_op); /* pattern memory ops per language */
+ return 0; // abort_flag set
+ }
+ incr(trie_op_ptr);
+ incr(u);
+ trie_used[cur_lang] = u;
if (u > max_op_used)
- max_op_used = u;
- hyf_distance[trie_op_ptr]= d;
- hyf_num[trie_op_ptr]= n;
- hyf_next[trie_op_ptr]= v;
- trie_op_lang[trie_op_ptr]= cur_lang;
- trie_op_hash[h]= trie_op_ptr;
- trie_op_val[trie_op_ptr]= u;
- Result = u;
- return(Result);
- }
- if ((hyf_distance[l]== d)&&(hyf_num[l]== n)&&(hyf_next[l
- ]== v)&&(trie_op_lang[l]== cur_lang))
- {
- Result = trie_op_val[l];
- return(Result);
- }
+ max_op_used = u;
+ hyf_distance[trie_op_ptr] = d;
+ hyf_num[trie_op_ptr] = n;
+ hyf_next[trie_op_ptr] = v;
+ trie_op_lang[trie_op_ptr] = cur_lang;
+ trie_op_hash[h] = trie_op_ptr;
+ trie_op_val[trie_op_ptr] = u;
+ Result = u;
+ return(Result);
+ }
+ if ((hyf_distance[l]== d) && (hyf_num[l]== n) &&
+ (hyf_next[l]== v) && (trie_op_lang[l]== cur_lang)) {
+ Result = trie_op_val[l];
+ return(Result);
+ }
if (h > - (integer) trie_op_size)
- decr(h);
- else h = trie_op_size;
- }
-/* return Result; */ /* unreachable code */
-}
+ decr(h);
+ else h = trie_op_size;
+ }
+/* return Result; */ /* unreachable code */
+}
/* what are those horrible constants there ? page 395 */
trie_pointer trie_node_ (trie_pointer p)
-{/* 10 */ register trie_pointer Result;
- trie_pointer h;
- trie_pointer q;
+{
+ register trie_pointer Result;
+ trie_pointer h;
+ trie_pointer q;
/* the 1009, 2718, 3142 are hard-wired constants here (not hyphen_prime) */
- h = abs(toint(trie_c[p])+ 1009 * toint(trie_o[p])+ 2718 *
- toint(trie_l[p])+ 3142 * toint(trie_r[p])) % trie_size;
- while(true){
- q = trie_hash[h];
- if (q == 0)
- {
- trie_hash[h]= p;
- Result = p;
- return(Result);
- }
- if ((trie_c[q]== trie_c[p])&&(trie_o[q]== trie_o[p])&&(
- trie_l[q]== trie_l[p])&&(trie_r[q]== trie_r[p]))
- {
- Result = q;
- return(Result);
- }
+ h = abs(toint(trie_c[p]) + 1009 * toint(trie_o[p]) + 2718 *
+ toint(trie_l[p]) + 3142 * toint(trie_r[p])) % trie_size;
+ while (true) {
+ q = trie_hash[h];
+ if (q == 0) {
+ trie_hash[h]= p;
+ Result = p;
+ return(Result);
+ }
+ if ((trie_c[q] == trie_c[p]) && (trie_o[q] == trie_o[p]) &&
+ (trie_l[q]== trie_l[p]) && (trie_r[q]== trie_r[p])) {
+ Result = q;
+ return(Result);
+ }
if (h > 0)
- decr(h);
- else h = trie_size;
+ decr(h);
+ else h = trie_size;
}
-/* return Result; */ /* unreachable code */
-}
+/* return Result; */ /* unreachable code */
+}
trie_pointer compress_trie_ (trie_pointer p)
-{register trie_pointer Result;
+{
+ register trie_pointer Result;
if (p == 0)
- Result = 0;
+ Result = 0;
else {
- trie_l[p]= compress_trie(trie_l[p]);
- trie_r[p]= compress_trie(trie_r[p]);
- Result = trie_node(p);
- }
- return Result;
-}
+ trie_l[p] = compress_trie(trie_l[p]);
+ trie_r[p] = compress_trie(trie_r[p]);
+ Result = trie_node(p);
+ }
+ return Result;
+}
void first_fit_ (trie_pointer p)
-{/* 45 40 */
- trie_pointer h;
- trie_pointer z;
- trie_pointer q;
- ASCII_code c;
- trie_pointer l, r;
- short ll;
- c = trie_c[p];
- z = trie_min[c];
- while(true){
- h = z - c;
- if (trie_max < h + 256)
- {
- if (trie_size <= h + 256){
- overflow("pattern memory", trie_size); /* pattern memory - NOT DYNAMIC */
+{
+ trie_pointer h;
+ trie_pointer z;
+ trie_pointer q;
+ ASCII_code c;
+ trie_pointer l, r;
+ short ll;
+ c = trie_c[p];
+ z = trie_min[c];
+ while (true) {
+ h = z - c;
+ if (trie_max < h + 256) {
+ if (trie_size <= h + 256) {
+ overflow("pattern memory", trie_size); /* pattern memory - NOT DYNAMIC */
/* not dynamic ---- but can be set -h=... from command line in ini-TeX */
- return; // abort_flag set
- }
+ return; // abort_flag set
+ }
do {
- incr(trie_max);
- trie_taken[trie_max]= false;
- trie_trl[trie_max]= trie_max + 1;
- trie_tro[trie_max]= trie_max - 1;
- } while(!(trie_max == h + 256));
- }
+ incr(trie_max);
+ trie_taken[trie_max]= false;
+ trie_trl[trie_max]= trie_max + 1;
+ trie_tro[trie_max]= trie_max - 1;
+ } while (!(trie_max == h + 256));
+ }
if (trie_taken[h])
- goto lab45;
- q = trie_r[p];
- while(q > 0){
+ goto lab45;
+ q = trie_r[p];
+ while (q > 0) {
if (trie_trl[h + trie_c[q]] == 0)
- goto lab45;
- q = trie_r[q];
- }
- goto lab40;
- lab45: z = trie_trl[z];
- }
+ goto lab45;
+ q = trie_r[q];
+ }
+ goto lab40;
+lab45:
+ z = trie_trl[z];
+ }
lab40:
- trie_taken[h]= true; /* h may be used without ... */
- trie_hash[p]= h;
- q = p;
+ trie_taken[h] = true; /* h may be used without ... */
+ trie_hash[p] = h;
+ q = p;
do {
- z = h + trie_c[q];
- l = trie_tro[z];
- r = trie_trl[z];
- trie_tro[r]= l;
- trie_trl[l]= r;
- trie_trl[z]= 0;
- if (l < 256)
- {
+ z = h + trie_c[q];
+ l = trie_tro[z];
+ r = trie_trl[z];
+ trie_tro[r]= l;
+ trie_trl[l]= r;
+ trie_trl[z]= 0;
+ if (l < 256) {
if (z < 256)
- ll = z; /* short ll */
- else ll = 256;
+ ll = z; /* short ll */
+ else
+ ll = 256;
do {
- trie_min[l]= r;
- incr(l);
- } while(!(l == ll));
- }
- q = trie_r[q];
- } while(!(q == 0));
-}
+ trie_min[l] = r;
+ incr(l);
+ } while (!(l == ll));
+ }
+ q = trie_r[q];
+ } while (!(q == 0));
+}
void trie_pack_ (trie_pointer p)
{
trie_pointer q;
/* ASCII_code c; */
int c; /* 95/Jan/7 */
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
- if (! trie_not_ready) { /* new stuff */
+ if (!trie_not_ready) { /* new stuff */
if (allow_patterns) {
if (trace_flag) show_line("Resetting patterns\n", 0);
reset_trie(); /* RESET PATTERNS - 93/Nov/26 */
}
}
/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
- if (trie_not_ready)
- {
- if (eqtb[(hash_size + 3213)].cint <= 0)
- cur_lang = 0;
- else if (eqtb[(hash_size + 3213)].cint > 255)
- cur_lang = 0;
- else cur_lang = eqtb[(hash_size + 3213)].cint;
- scan_left_brace();
- k = 0;
- hyf[0]= 0;
- digitsensed = false;
- while(true){
- get_x_token();
- switch(cur_cmd)
- {case 11 :
- case 12 :
- if (digitsensed ||(cur_chr < 48)||(cur_chr > 57))
- {
- if (cur_chr == 46) /* . */
- cur_chr = 0;
- else {
-
- cur_chr = eqtb[(hash_size + 2139) + cur_chr].hh.v.RH;
- if (cur_chr == 0)
- {
- print_err("Nonletter");
- help1("(See Appendix H.)");
- error();
- }
- }
- if (k < 63)
- {
- incr(k);
- hc[k]= cur_chr;
- hyf[k]= 0;
- digitsensed = false;
- }
- }
- else if (k < 63)
- {
- hyf[k]= cur_chr - 48;
- digitsensed = true;
- }
- break;
- case 10 :
- case 2 :
- {
- if (k > 0)
- {
- if (hc[1]== 0)
- hyf[0]= 0;
- if (hc[k]== 0)
- hyf[k]= 0;
- l = k;
- v = min_trie_op;
- while(true){
- if (hyf[l]!= 0)
- v = new_trie_op(k - l, hyf[l], v);
- if (l > 0)
- decr(l);
- else goto lab31;
- }
- lab31:;
- q = 0;
- hc[0]= cur_lang;
- while(l <= k){
- c = hc[l];
- incr(l);
- p = trie_l[q];
- firstchild = true;
- while((p > 0)&&(c > trie_c[p])) {
- q = p;
- p = trie_r[q];
- firstchild = false;
- }
- if ((p == 0)||(c < trie_c[p]))
- {
- if (trie_ptr == trie_size){
- overflow("pattern memory", trie_size); /* pattern memory - NOT DYNAMIC */
+ if (trie_not_ready) {
+ if (language <= 0)
+ cur_lang = 0;
+ else if (language > 255)
+ cur_lang = 0;
+ else cur_lang = language;
+ scan_left_brace();
+ k = 0;
+ hyf[0] = 0;
+ digitsensed = false;
+ while (true) {
+ get_x_token();
+ switch (cur_cmd) {
+ case 11:
+ case 12:
+ if (digitsensed || (cur_chr < 48) || (cur_chr > 57)) {
+ if (cur_chr == '.')
+ cur_chr = 0;
+ else {
+ cur_chr = eqtb[(hash_size + 2139) + cur_chr].hh.v.RH;
+ if (cur_chr == 0) {
+ print_err("Nonletter");
+ help1("(See Appendix H.)");
+ error();
+ }
+ }
+ if (k < 63) {
+ incr(k);
+ hc[k] = cur_chr;
+ hyf[k] = 0;
+ digitsensed = false;
+ }
+ } else if (k < 63) {
+ hyf[k] = cur_chr - 48;
+ digitsensed = true;
+ }
+ break;
+ case 10:
+ case 2:
+ {
+ if (k > 0) {
+ if (hc[1]== 0)
+ hyf[0] = 0;
+ if (hc[k]== 0)
+ hyf[k] = 0;
+ l = k;
+ v = min_trie_op;
+ while (true) {
+ if (hyf[l]!= 0)
+ v = new_trie_op(k - l, hyf[l], v);
+ if (l > 0)
+ decr(l);
+ else
+ goto lab31;
+ }
+lab31:;
+ q = 0;
+ hc[0]= cur_lang;
+ while (l <= k) {
+ c = hc[l];
+ incr(l);
+ p = trie_l[q];
+ firstchild = true;
+ while ((p > 0) && (c > trie_c[p])) {
+ q = p;
+ p = trie_r[q];
+ firstchild = false;
+ }
+ if ((p == 0) || (c < trie_c[p])) {
+ if (trie_ptr == trie_size) {
+ overflow("pattern memory", trie_size); /* pattern memory - NOT DYNAMIC */
/* not dynamic ---- but can be set -h=... from command line in ini-TeX */
- return; // abort_flag set
- }
- incr(trie_ptr);
- trie_r[trie_ptr]= p;
- p = trie_ptr;
- trie_l[p]= 0;
- if (firstchild)
- trie_l[q]= p;
- else trie_r[q]= p;
- trie_c[p]= c;
- trie_o[p]= min_trie_op;
- }
- q = p;
- }
- if (trie_o[q]!= min_trie_op)
- {
- print_err("Duplicate pattern");
- help1("(See Appendix H.)");
- error();
- }
- trie_o[q]= v;
- }
- if (cur_cmd == 2)
- goto lab30;
- k = 0;
- hyf[0]= 0;
- digitsensed = false;
- }
- break;
- default:
- {
- print_err("Bad ");
- print_esc("patterns");
- help1("(See Appendix H.)");
- error();
- }
- break;
- }
- }
- lab30:;
- }
- else {
- print_err("Too late for ");
+ return; // abort_flag set
+ }
+ incr(trie_ptr);
+ trie_r[trie_ptr] = p;
+ p = trie_ptr;
+ trie_l[p] = 0;
+ if (firstchild)
+ trie_l[q]= p;
+ else trie_r[q]= p;
+ trie_c[p] = c;
+ trie_o[p] = min_trie_op;
+ }
+ q = p;
+ }
+ if (trie_o[q]!= min_trie_op) {
+ print_err("Duplicate pattern");
+ help1("(See Appendix H.)");
+ error();
+ }
+ trie_o[q]= v;
+ }
+ if (cur_cmd == 2)
+ goto lab30;
+ k = 0;
+ hyf[0] = 0;
+ digitsensed = false;
+ }
+ break;
+ default:
+ {
+ print_err("Bad ");
+ print_esc("patterns");
+ help1("(See Appendix H.)");
+ error();
+ }
+ break;
+ }
+ }
+lab30:;
+ } else {
+ print_err("Too late for ");
print_esc("patterns");
- help1("All patterns must be given before typesetting begins.");
- error();
- mem[lig_trick].hh.v.RH = scan_toks(false, false);
- flush_list(def_ref);
- }
-}
+ help1("All patterns must be given before typesetting begins.");
+ error();
+ mem[lig_trick].hh.v.RH = scan_toks(false, false);
+ flush_list(def_ref);
+ }
+}
void init_trie (void)
{
trie_pointer p;
#ifdef INITEX
void store_fmt_file (void)
-{/* 41 42 31 32 */
+{
integer j, k, l;
halfword p, q;
integer x;
if (save_ptr != 0) {
print_err("You can't dump inside a group");
help1("`{...\\dump}' is a no-no..");
- {
- if (interaction == 3) interaction = 2;
- if (log_opened){
- error();
- }
- ;
-#ifdef DEBUG
- if (interaction > 0) debug_help();
-#endif /* DEBUG */
- history = 3;
- jump_out(); // trying to \dump inside a group
-// return; // drops through now
- }
+ succumb();
} /* end of if save_ptr != 0 */
selector = 21;
print_string(" (format=");
print(job_name);
- print_char(32); /* */
-/* print_int(eqtb[(hash_size + 3186)].cint % 100); */ /* Y2K */
- print_int(eqtb[(hash_size + 3186)].cint); /* 98/Oct/12 */
-/* {
- int n= eqtb[(hash_size + 3186)].cint;
- sprintf(log_line, "YEAR: %ld\n", n);
- show_line(log_line, 0);
- } */
- print_char(46); /* . */
- print_int(eqtb[(hash_size + 3185)].cint);
- print_char(46); /* . */
- print_int(eqtb[(hash_size + 3184)].cint);
- print_char(41); /*)*/
- if (interaction == 0)selector = 18;
+ print_char(' ');
+ print_int(year);
+ print_char('.');
+ print_int(month);
+ print_char('.');
+ print_int(day);
+ print_char(')');
+ if (interaction == 0) selector = 18;
else selector = 19;
{
#ifdef ALLOCATESTRING
if (pool_ptr + 1 > current_pool_size)
- str_pool = realloc_str_pool (increment_pool_size);
- if (pool_ptr + 1 > current_pool_size){ /* in case it failed 94/Jan/24 */
- overflow("pool size", current_pool_size - init_pool_ptr); /* 97/Mar/9 */
- return; // abort_flag set
- }
+ str_pool = realloc_str_pool (increment_pool_size);
+ if (pool_ptr + 1 > current_pool_size) { /* in case it failed 94/Jan/24 */
+ overflow("pool size", current_pool_size - init_pool_ptr); /* 97/Mar/9 */
+ return; // abort_flag set
+ }
#else
- if (pool_ptr + 1 > pool_size){
- overflow("pool size", pool_size - init_pool_ptr); /* pool size */
- return; // abort_flag set
- }
+ if (pool_ptr + 1 > pool_size) {
+ overflow("pool size", pool_size - init_pool_ptr); /* pool size */
+ return; // abort_flag set
+ }
#endif
}
format_ident = make_string();
while(! w_open_out(fmt_file)) {
prompt_file_name(1267, 780); /* format file name .fmt */
}
- print_nl(" Beginning to dump on file "); /* */
- slow_print(w_make_name_string(fmt_file));
- {
- decr(str_ptr);
- pool_ptr = str_start[str_ptr];
- }
- print_nl(""); /* */
+ print_nl(" Beginning to dump on file ");
+ slow_print(w_make_name_string(fmt_file));
+ flush_string();
+ print_nl("");
slow_print(format_ident);
dump_int(BEGINFMTCHECKSUM); /* magic FMT file start 4C 20 E6 15 hex */
/* dump_int(0); */
dump_int(hyphen_prime); /* bkph */
dump_int(pool_ptr);
dump_int(str_ptr);
- if (dumpthings(str_start[0], str_ptr + 1)
- )return;
- if (dumpthings(str_pool[0], pool_ptr)
- )return;
- print_ln();
- print_int(str_ptr);
- print_string("strings of total length ");
- print_int(pool_ptr);
- sort_avail();
- var_used = 0;
- dump_int(lo_mem_max);
- dump_int(rover);
- p = 0;
- q = rover;
- x = 0;
+ if (dumpthings(str_start[0], str_ptr + 1)) return;
+ if (dumpthings(str_pool[0], pool_ptr)) return;
+ print_ln();
+ print_int(str_ptr);
+ print_string(" strings of total length ");
+ print_int(pool_ptr);
+ sort_avail();
+ var_used = 0;
+ dump_int(lo_mem_max);
+ dump_int(rover);
+ p = 0;
+ q = rover;
+ x = 0;
do {
- if (dumpthings(mem[p], q + 2 - p)
- )return;
- x = x + q + 2 - p;
- var_used = var_used + q - p;
- p = q + mem[q].hh.v.LH;
- q = mem[q + 1].hh.v.RH;
- } while(!(q == rover));
- var_used = var_used + lo_mem_max - p;
- dyn_used = mem_end + 1 - hi_mem_min;
- if (dumpthings(mem[p], lo_mem_max + 1 - p)
- )return;
- x = x + lo_mem_max + 1 - p;
- dump_int(hi_mem_min);
- dump_int(avail);
- if (dumpthings(mem[hi_mem_min], mem_end + 1 - hi_mem_min)
- )return;
- x = x + mem_end + 1 - hi_mem_min;
- p = avail;
- while(p != 0){
- decr(dyn_used);
- p = mem[p].hh.v.RH;
- }
- dump_int(var_used);
- dump_int(dyn_used);
- print_ln();
+ if (dumpthings(mem[p], q + 2 - p))
+ return;
+ x = x + q + 2 - p;
+ var_used = var_used + q - p;
+ p = q + mem[q].hh.v.LH;
+ q = mem[q + 1].hh.v.RH;
+ } while (!(q == rover));
+ var_used = var_used + lo_mem_max - p;
+ dyn_used = mem_end + 1 - hi_mem_min;
+ if (dumpthings(mem[p], lo_mem_max + 1 - p)) return;
+ x = x + lo_mem_max + 1 - p;
+ dump_int(hi_mem_min);
+ dump_int(avail);
+ if (dumpthings(mem[hi_mem_min], mem_end + 1 - hi_mem_min)) return;
+ x = x + mem_end + 1 - hi_mem_min;
+ p = avail;
+ while (p != 0) {
+ decr(dyn_used);
+ p = mem[p].hh.v.RH;
+ }
+ dump_int(var_used);
+ dump_int(dyn_used);
+ print_ln();
print_int(x);
- print_string("memory locations dumped; current usage is ");
+ print_string(" memory locations dumped; current usage is ");
print_int(var_used);
- print_char(38); /* & */
+ print_char('&');
print_int(dyn_used);
k = 1;
do {
- j = k;
- while(j < (hash_size + 3162)){
- if ((eqtb[j].hh.v.RH == eqtb[j + 1].hh.v.RH)&&(eqtb[j
- ].hh.b0 == eqtb[j + 1].hh.b0)&&(eqtb[j].hh.b1 == eqtb[j +
- 1].hh.b1))
- goto lab41;
- incr(j);
- }
- l = (hash_size + 3163);
- goto lab31;
- lab41: incr(j);
- l = j;
- while(j < (hash_size + 3162)){
- if ((eqtb[j].hh.v.RH != eqtb[j + 1].hh.v.RH)||(eqtb[j
- ].hh.b0 != eqtb[j + 1].hh.b0)||(eqtb[j].hh.b1 != eqtb[j +
- 1].hh.b1))
- goto lab31;
- incr(j);
- }
- lab31: dump_int(l - k);
- if (dumpthings(eqtb[k], l - k)
- )return;
- k = j + 1;
- dump_int(k - l);
- } while(!(k == (hash_size + 3163)));
+ j = k;
+ while(j < (hash_size + 3162)) {
+ if ((eqtb[j].hh.v.RH == eqtb[j + 1].hh.v.RH) &&
+ (eqtb[j].hh.b0 == eqtb[j + 1].hh.b0) &&
+ (eqtb[j].hh.b1 == eqtb[j + 1].hh.b1))
+ goto lab41;
+ incr(j);
+ }
+ l = (hash_size + 3163);
+ goto lab31;
+lab41:
+ incr(j);
+ l = j;
+ while (j < (hash_size + 3162)) {
+ if ((eqtb[j].hh.v.RH != eqtb[j + 1].hh.v.RH) ||
+ (eqtb[j].hh.b0 != eqtb[j + 1].hh.b0) ||
+ (eqtb[j].hh.b1 != eqtb[j + 1].hh.b1))
+ goto lab31;
+ incr(j);
+ }
+lab31:
+ dump_int(l - k);
+ if (dumpthings(eqtb[k], l - k)) return;
+ k = j + 1;
+ dump_int(k - l);
+ } while (!(k == (hash_size + 3163)));
do {
- j = k;
- while(j < (hash_size + 4006)){
+ j = k;
+ while (j < (hash_size + 4006)) {
if (eqtb[j].cint == eqtb[j + 1].cint)
- goto lab42;
- incr(j);
- }
- l = (hash_size + 4007);
- goto lab32;
- lab42: incr(j);
- l = j;
- while(j < (hash_size + 4006)){
+ goto lab42;
+ incr(j);
+ }
+ l = (hash_size + 4007);
+ goto lab32;
+lab42:
+ incr(j);
+ l = j;
+ while (j < (hash_size + 4006)) {
if (eqtb[j].cint != eqtb[j + 1].cint)
- goto lab32;
- incr(j);
- }
- lab32: dump_int(l - k);
- if (dumpthings(eqtb[k], l - k)
- )return;
- k = j + 1;
- dump_int(k - l);
- } while(!(k > (hash_size + 4006)));
- dump_int(par_loc);
- dump_int(write_loc);
- dump_int(hash_used);
+ goto lab32;
+ incr(j);
+ }
+lab32:
+ dump_int(l - k);
+ if (dumpthings(eqtb[k], l - k)) return;
+ k = j + 1;
+ dump_int(k - l);
+ } while (!(k > (hash_size + 4006)));
+ dump_int(par_loc);
+ dump_int(write_loc);
+ dump_int(hash_used);
/* cs_count:=frozen_control_sequence-1-hash_used; */
/* cs_count = (hash_size + 513) - hash_used; */
- cs_count = (hash_size + hash_extra + 513) - hash_used;
+ cs_count = (hash_size + hash_extra + 513) - hash_used;
/* cs_count = (hash_size + 780) - hash_used; */ /* ??? */
if (trace_flag) {
- sprintf(log_line, "itex cs_count %d hash_size %d hash_extra %d hash_used %d",
- cs_count, hash_size, hash_extra, hash_used); /* debugging */
- show_line(log_line, 0);
+ sprintf(log_line, "itex cs_count %d hash_size %d hash_extra %d hash_used %d",
+ cs_count, hash_size, hash_extra, hash_used); /* debugging */
+ show_line(log_line, 0);
}
/* for p <- hash_base to hash_used do */
{
p = 514;
for_end = hash_used;
if (p <= for_end) do
- if (hash[p].v.RH != 0){
- dump_int(p);
- dump_hh(hash[p]);
- incr(cs_count);
+ if (hash[p].v.RH != 0) {
+ dump_int(p);
+ dump_hh(hash[p]);
+ incr(cs_count);
if (trace_flag) {
sprintf(log_line, "itex cs_count++ ");
show_line(log_line, 0); /* debugging */
}
- }
- while(p++ < for_end);
- }
+ } while (p++ < for_end);
+ }
/* ??? */
/* for p <- hash_used+1 to undefined_control_sequence-1 do dump_hh(hash[p]) */
- if (dumpthings(hash[hash_used + 1], (hash_size + 780) - hash_used)
- )return;
- dump_int(cs_count);
- print_ln();
- print_int(cs_count);
+ if (dumpthings(hash[hash_used + 1], (hash_size + 780) - hash_used)) return;
+ dump_int(cs_count);
+ print_ln();
+ print_int(cs_count);
print_string(" multiletter control sequences");
- dump_int(fmem_ptr);
+ dump_int(fmem_ptr);
{
if (dumpthings(font_info[0], fmem_ptr)) return;
/* frozenfontptr = font_ptr; */ /* number of fonts frozen into format */
- dump_int(font_ptr);
- if (dumpthings(font_check[0], font_ptr + 1))return;
- if (dumpthings(font_size[0], font_ptr + 1))return;
- if (dumpthings(font_dsize[0], font_ptr + 1))return;
- if (dumpthings(font_params[0], font_ptr + 1))return;
- if (dumpthings(hyphen_char[0], font_ptr + 1))return;
- if (dumpthings(skew_char[0], font_ptr + 1))return;
- if (dumpthings(font_name[0], font_ptr + 1))return;
- if (dumpthings(font_area[0], font_ptr + 1))return;
- if (dumpthings(font_bc[0], font_ptr + 1))return;
- if (dumpthings(font_ec[0], font_ptr + 1))return;
- if (dumpthings(char_base[0], font_ptr + 1))return;
- if (dumpthings(width_base[0], font_ptr + 1))return;
- if (dumpthings(height_base[0], font_ptr + 1))return;
- if (dumpthings(depth_base[0], font_ptr + 1))return;
- if (dumpthings(italic_base[0], font_ptr + 1))return;
- if (dumpthings(lig_kern_base[0], font_ptr + 1))return;
- if (dumpthings(kern_base[0], font_ptr + 1))return;
- if (dumpthings(exten_base[0], font_ptr + 1))return;
- if (dumpthings(param_base[0], font_ptr + 1))return;
- if (dumpthings(font_glue[0], font_ptr + 1))return;
- if (dumpthings(bchar_label[0], font_ptr + 1))return;
- if (dumpthings(font_bchar[0], font_ptr + 1))return;
- if (dumpthings(font_false_bchar[0], font_ptr + 1))return;
+ dump_int(font_ptr);
+ if (dumpthings(font_check[0], font_ptr + 1)) return;
+ if (dumpthings(font_size[0], font_ptr + 1)) return;
+ if (dumpthings(font_dsize[0], font_ptr + 1)) return;
+ if (dumpthings(font_params[0], font_ptr + 1)) return;
+ if (dumpthings(hyphen_char[0], font_ptr + 1)) return;
+ if (dumpthings(skew_char[0], font_ptr + 1)) return;
+ if (dumpthings(font_name[0], font_ptr + 1)) return;
+ if (dumpthings(font_area[0], font_ptr + 1)) return;
+ if (dumpthings(font_bc[0], font_ptr + 1)) return;
+ if (dumpthings(font_ec[0], font_ptr + 1)) return;
+ if (dumpthings(char_base[0], font_ptr + 1)) return;
+ if (dumpthings(width_base[0], font_ptr + 1)) return;
+ if (dumpthings(height_base[0], font_ptr + 1)) return;
+ if (dumpthings(depth_base[0], font_ptr + 1)) return;
+ if (dumpthings(italic_base[0], font_ptr + 1)) return;
+ if (dumpthings(lig_kern_base[0], font_ptr + 1)) return;
+ if (dumpthings(kern_base[0], font_ptr + 1)) return;
+ if (dumpthings(exten_base[0], font_ptr + 1)) return;
+ if (dumpthings(param_base[0], font_ptr + 1)) return;
+ if (dumpthings(font_glue[0], font_ptr + 1)) return;
+ if (dumpthings(bchar_label[0], font_ptr + 1)) return;
+ if (dumpthings(font_bchar[0], font_ptr + 1)) return;
+ if (dumpthings(font_false_bchar[0], font_ptr + 1)) return;
{
- register integer for_end;
- k = 0;
- for_end = font_ptr;
- if (k <= for_end)
- do
- {
- print_nl("\\font");
+ register integer for_end;
+ k = 0;
+ for_end = font_ptr;
+ if (k <= for_end)
+ do {
+ print_nl("\\font");
/* print_esc(hash[(hash_size + 524) + k].v.RH); */
//print_esc(hash[(hash_size + hash_extra + 524) + k].v.RH);
- print_esc("");print(hash[(hash_size + hash_extra + 524) + k].v.RH);
- print_char(61); /* = */
- print_file_name(font_name[k], font_area[k], 335);
- if (font_size[k]!= font_dsize[k])
- {
- print_string(" at ");
- print_scaled(font_size[k]);
- print_string("pt");
- }
- }
- while(k++ < for_end);
- }
- }
- print_ln();
- print_int(fmem_ptr - 7);
- print_string("words of font info for");
- print_int(font_ptr - 0);
+ print_esc("");print(hash[(hash_size + hash_extra + 524) + k].v.RH);
+ print_char('=');
+ print_file_name(font_name[k], font_area[k], 335);
+ if (font_size[k]!= font_dsize[k]) {
+ print_string(" at ");
+ print_scaled(font_size[k]);
+ print_string("pt");
+ }
+ } while (k++ < for_end);
+ }
+ }
+ print_ln();
+ print_int(fmem_ptr - 7);
+ print_string(" words of font info for ");
+ print_int(font_ptr - 0);
print_string(" preloaded font");
if (font_ptr != 1)
- print_char(115); /* s */
- dump_int(hyph_count);
+ print_char('s');
+ dump_int(hyph_count);
/* {register integer for_end; k = 0; for_end = 607; if (k <= for_end) do */
{
register integer for_end;
k = 0;
for_end = hyphen_prime;
- if (k <= for_end) do
+ if (k <= for_end) do
if (hyph_word[k]!= 0)
{
- dump_int(k);
- dump_int(hyph_word[k]);
- dump_int(hyph_list[k]);
- }
- while(k++ < for_end);
- }
- print_ln();
- print_int(hyph_count);
+ dump_int(k);
+ dump_int(hyph_word[k]);
+ dump_int(hyph_list[k]);
+ } while(k++ < for_end);
+ }
+ print_ln();
+ print_int(hyph_count);
print_string(" hyphenation exception");
if (hyph_count != 1)
- print_char(115); /* s */
+ print_char('s');
if (trie_not_ready)
- init_trie();
- dump_int(trie_max);
- if (dumpthings(trie_trl[0], trie_max + 1)
- )return;
- if (dumpthings(trie_tro[0], trie_max + 1)
- )return;
- if (dumpthings(trie_trc[0], trie_max + 1)
- )return;
- dump_int(trie_op_ptr);
- if (dumpthings(hyf_distance[1], trie_op_ptr)
- )return;
- if (dumpthings(hyf_num[1], trie_op_ptr)
- )return;
- if (dumpthings(hyf_next[1], trie_op_ptr)
- )return;
- print_nl("Hyphenation trie of length "); /* */
- print_int(trie_max);
- print_string("has");
- print_int(trie_op_ptr);
- print_string("op");
+ init_trie();
+ dump_int(trie_max);
+ if (dumpthings(trie_trl[0], trie_max + 1)) return;
+ if (dumpthings(trie_tro[0], trie_max + 1)) return;
+ if (dumpthings(trie_trc[0], trie_max + 1)) return;
+ dump_int(trie_op_ptr);
+ if (dumpthings(hyf_distance[1], trie_op_ptr)) return;
+ if (dumpthings(hyf_num[1], trie_op_ptr)) return;
+ if (dumpthings(hyf_next[1], trie_op_ptr)) return;
+ print_nl("Hyphenation trie of length ");
+ print_int(trie_max);
+ print_string(" has ");
+ print_int(trie_op_ptr);
+ print_string(" op");
if (trie_op_ptr != 1)
- print_char(115); /* s */
- print_string("out of");
+ print_char('s');
+ print_string(" out of ");
print_int(trie_op_size);
{
register integer for_end;
k = 255;
for_end = 0;
- if (k >= for_end) do
+ if (k >= for_end) do
if (trie_used[k]> 0)
{
print_nl(" ");
- print_int(trie_used[k]);
- print_string("for language");
- print_int(k);
- dump_int(k);
- dump_int(trie_used[k]);
- }
- while(k-- > for_end);
- }
- dump_int(interaction);
- dump_int(format_ident);
- dump_int(ENDFMTCHECKSUM); /* magic checksum end of FMT file --- change ??? */
- eqtb[(hash_size + 3194)].cint = 0; /* tracingstats */
+ print_int(trie_used[k]);
+ print_string(" for language ");
+ print_int(k);
+ dump_int(k);
+ dump_int(trie_used[k]);
+ } while(k-- > for_end);
+ }
+ dump_int(interaction);
+ dump_int(format_ident);
+ dump_int(ENDFMTCHECKSUM); /* magic checksum end of FMT file --- change ??? */
+ tracing_stats = 0;
w_close(fmt_file);
// return 0;
} /* end of store_fmt_file */
void init_prim (void)
{
no_new_control_sequence = false;
+ //primitive_s("lineskip", assign_glue, glue_base + line_skip_code);
primitive(373, assign_glue, glue_base + line_skip_code); /* lineskip */
primitive(374, assign_glue, glue_base + baseline_skip_code); /* baselineskip */
primitive(375, assign_glue, glue_base + par_skip_code); /* parskip */
#pragma optimize("s", off) /* 96/Sep/12 */
/* #pragma optimize("1", off) */
#pragma optimize("t", on) /* 96/Sep/12 */
-/* #pragma optimize("2", on) */
-
+/* #pragma optimize("2", on) */
\ No newline at end of file