+/* Copyright 2014 Clerk Ma
-#pragma warning(disable:4996)
-#pragma warning(disable:4131) // old style declarator
-#pragma warning(disable:4135) // conversion between different integral types
-#pragma warning(disable:4127) // conditional expression is constant
+ 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
{
dvi_buf[dvi_ptr] = op;
incr(dvi_ptr);
+
if (dvi_ptr == dvi_limit)
dvi_swap();
}
{
error();
}
+
#ifdef DEBUG
if (interaction > 0)
debug_help();
#endif
+
history = 3;
jump_out();
}
if (s >= str_ptr)
s = 259; /* ??? */
- else
+ else
{
if (s < 256)
{
incr(j);
}
}
+
new_line_char = nl; /* restore eol */
return;
}
print_char(*s++);
}
/* sec 0060 */
-// print string number s from string pool by calling print_
void slow_print_ (integer s)
{
pool_pointer j;
}
}
/* sec 0062 */
-// print newline followed by string number s (unless at start of line)
void print_nl_ (const char * s)
{
if (((term_offset > 0) && (odd(selector))) ||
print_string(s);
}
/* sec 0063 */
-// print string number s preceded by escape character
void print_esc_ (const char * s)
{
integer c;
print_esc("NONEXISTENT.");
else
{
- print_esc(""); print(text(p));
+ print_esc("");
+ print(text(p));
print_char(' ');
}
}
print(p - active_base);
else if (p < null_cs)
{
- print_esc(""); print(p - single_base);
+ print_esc("");
+ print(p - single_base);
}
else
{
}
}
/* sec 0518 */
-/* ! I can't find file ` c:/foo/ accents .tex '. */
void print_file_name_(integer n, integer a, integer e)
{
slow_print(a);
print_esc("scriptscriptfont");
}
/* sec 1355 */
-void print_write_whatsit_(str_number s, halfword p)
+void print_write_whatsit_(str_number s, pointer p)
{
- print_esc(""); print(s);
+ print_esc("");
+ print(s);
+
if (write_stream(p) < 16)
print_int(write_stream(p));
else if (write_stream(p) == 16)
else print_char('-');
}
/* sec 0081 */
-// called from itex.c and tex0.c only NASTY NASTY!
-// now uses uses non-local goto (longjmp) 1999/Nov/7
void jump_out (void)
{
close_files_and_terminate();
succumb();
}
/* sec 0037 */
-bool init_terminal (void)
+boolean init_terminal (void)
{
int flag;
}
}
/* sec 0043 */
-// Make string from str_start[str_ptr] to pool_ptr
str_number make_string (void)
{
#ifdef ALLOCATESTRING
return (str_ptr - 1);
}
/* sec 0044 */
-bool str_eq_buf_ (str_number s, integer k)
+boolean str_eq_buf_ (str_number s, integer k)
{
- register bool Result;
+ register boolean Result;
pool_pointer j;
- bool result;
+ boolean result;
j = str_start[s];
return Result;
}
/* sec 0045 */
-bool str_eq_str_ (str_number s, str_number t)
+boolean str_eq_str_ (str_number s, str_number t)
{
- register bool Result;
+ register boolean Result;
pool_pointer j, k;
- bool result;
+ boolean result;
result = false;
s += n;
strcpy(s, "\r\n");
s += 2;
+
return s;
}
// free(helpstring);
// }
show_line("\n", 0); // force it to show what may be buffered up ???
- helpstring = NULL;
+ helpstring = NULL;
#ifdef _WINDOWS
if (term_str != NULL)
return ((a + 1) / 2);
}
/* sec 0103 */
-/* This has some minor speedup changes - no real advantage probably ... */
void print_scaled_(scaled s)
{
scaled delta;
scaled x_over_n_(scaled x, integer n)
{
register scaled Result;
- bool negative;
+ boolean negative;
negative = false;
scaled xn_over_d_(scaled x, integer n, integer d)
{
register scaled Result;
- bool positive;
+ boolean positive;
nonnegative_integer t, u, v;
if (x >= 0)
positive = false;
}
- t =(x % 32767L) * n;
- u =(x / 32768L)* n +(t / 32768L);
- v =(u % d)* 32768L +(t % 32768L);
+ t = (x % 32767L) * n;
+ u = (x / 32768L) * n + (t / 32768L);
+ v = (u % d) * 32768L + (t % 32768L);
if (u / d >= 32768L)
arith_error = true;
print_char(' ');
print_scaled(round(65536L * w.gr));
print_ln();
- print_int(w.hh.v.LH);
+ print_int(w.hh.lh);
print_char('=');
print_int(w.hh.b0);
print_char(':');
print_int(w.hh.b1);
print_char(';');
- print_int(w.hh.v.RH);
+ print_int(w.hh.rh);
print_char(' ');
print_int(w.qqqq.b0);
print_char(':');
print_int(w.qqqq.b3);
}
/* need this version only if SHORTFONTINFO defined */
-void zprintfword(fmemoryword w)
+void zprintfword(memory_word w)
{
print_int(w.cint);
print_char(' ');
print_char(' ');
print_scaled(round(65536L * w.gr));
print_ln();
- print_int(w.hh.v.LH);
+ print_int(w.hh.lh);
print_char('=');
print_int(w.hh.b0);
print_char(':');
print_int(w .hh.b1);
print_char(';');
- print_int(w.hh.v.RH);
+ print_int(w.hh.rh);
print_char(' ');
print_int(w.qqqq.b0);
print_char(':');
overflow("main memory size", mem_max + 1 - mem_min);
return 0; // abort_flag set
}
+
incr(mem_end); /* then grab from new area */
p = mem_end; /* 1993/Dec/14 */
}
{
q = p + node_size(p);
- while ((mem[q].hh.v.RH == empty_flag))
+ while ((mem[q].hh.rh == empty_flag))
{
t = rlink(q);
overflow("main memory size", mem_max + 1 - mem_min); /* darn: allocation failed ! */
return 0; // abort_flag set
}
-/* avoid function call in following ? */
+
add_variable_space (block_size); /* now to be found in itex.c */
goto lab20; /* go try get_node again */
#ifdef DEBUG
/* sec 0167 */
-void check_mem_(bool printlocs)
+void check_mem_(boolean printlocs)
{
halfword p, q;
- bool clobbered;
+ boolean clobbered;
for (p = mem_min; p <= lo_mem_max; p++) freearr[p] = false;
for (p = hi_mem_min; p <= mem_end; p++) freearr[p] = false;
{
print_char('{');
- if ((p < hi_mem_min)||(p > mem_end))
+ if ((p < hi_mem_min) || (p > mem_end))
print_esc("CLOBBERED.");
else
show_token_list(link(p), 0, max_print_line - 10);
/* sec 0178 */
void print_spec_(integer p, char * s)
{
- if ((p < mem_min)||(p >= lo_mem_max))
+ if ((p < mem_min) || (p >= lo_mem_max))
print_char('*');
else
{
integer a;
a = small_fam(p) * 256 + small_char(p);
- a = a * 4096 + large_fam(p) * 256 + large_char(p);
+ a = a * 0x1000 + large_fam(p) * 256 + large_char(p);
if (a < 0)
print_int(a);
if (cur_length > depth_threshold)
{
-/* if (p > 0) */ /* was p>null !!! line 3662 in tex.web */
if (p != 0) /* fixed 94/Mar/23 BUG FIX NOTE: still not fixed in 3.14159 ! */
- print_string(" []");
+ print_string(" []");
+
return;
}
str_pool[pool_ptr] = 46;
incr(pool_ptr);
}
- show_node_list(mem[p + 5].hh.v.RH);
+ show_node_list(mem[p + 5].hh.rh);
decr(pool_ptr);
}
}
str_pool[pool_ptr] = 46;
incr(pool_ptr);
}
- show_node_list(mem[p + 4].hh.v.LH);
+ show_node_list(mem[p + 4].hh.lh);
decr(pool_ptr);
}
}
str_pool[pool_ptr] = 46;
incr(pool_ptr);
}
- show_node_list(mem[p + 1].hh.v.RH);
+ show_node_list(mem[p + 1].hh.rh);
decr(pool_ptr);
}
}
str_pool[pool_ptr] = 46;
incr(pool_ptr);
}
- show_node_list(mem[p + 1].hh.v.LH);
+ show_node_list(mem[p + 1].hh.lh);
decr(pool_ptr);
}
{
str_pool[pool_ptr]= 124;
incr(pool_ptr);
}
- show_node_list(mem[p + 1].hh.v.RH);
+ show_node_list(mem[p + 1].hh.rh);
decr(pool_ptr);
}
break;
}
if ((small_fam(right_delimiter(p)) != 0) || (small_char(right_delimiter(p)) != 0) ||
- (large_fam(right_delimiter(p)) != 0)||(large_char(right_delimiter(p)) != 0))
+ (large_fam(right_delimiter(p)) != 0) || (large_char(right_delimiter(p)) != 0))
{
print_string(", right-delimiter ");
print_delimiter(right_delimiter(p));
}
p = link(p);
}
-}
+}
\ No newline at end of file