start_time = clock();
main_time = start_time;
-/* reset all allocatable memory pointers to NULL - in case we drop out */
+/* reset all allocatable memory pointers to NULL - in case we drop out */
main_memory = NULL;
font_info = NULL;
str_pool = NULL;
#define PATH_SEP '/'
#define PATH_SEP_STRING "/"
-#define BUILDNAMEDIRECT /* avoid malloc for string concat */
+#define BUILDNAMEDIRECT
extern int shorten_file_name; /* in local.c bkph */
t = s;
do
{
- {
- q = get_avail();
- mem[p].hh.rh = q;
- mem[q].hh.lh = mem[t].hh.lh;
- p = q;
- }
-
+ store_new_token(info(t));
incr(m);
u = link(t);
v = s;
while (true)
{
- {
- {
- q = avail;
-
- if (q == 0)
- q = get_avail();
- else
- {
- avail = mem[q].hh.rh;
- mem[q].hh.rh = 0;
-#ifdef STAT
- incr(dyn_used);
-#endif /* STAT */
- }
- }
-
- mem[p].hh.rh = q;
- mem[q].hh.lh = cur_tok;
- p = q;
- }
-
+ fast_store_new_token(cur_tok);
get_token();
if (cur_tok == par_token)
}
lab31:
rbraceptr = p;
-
- {
- q = get_avail();
- mem[p].hh.rh = q;
- mem[q].hh.lh = cur_tok;
- p = q;
- }
+ store_new_token(cur_tok);
}
else
{
if (info(r) >= match_token)
goto lab22;
- {
- q = get_avail();
- mem[p].hh.rh = q; /* p may be used without having ... */
- mem[q].hh.lh = cur_tok;
- p = q;
- }
+ store_new_token(cur_tok);
}
incr(m); /* m may be used without having been ... */
get_x_token();
if (cur_cs == 0)
- {
- q = get_avail();
- mem[p].hh.rh = q;
- mem[q].hh.lh = cur_tok;
- p = q;
- }
+ store_new_token(cur_tok);
}
while(!(cur_cs != 0));
if ((cur_cs == 0) && ((cur_chr == (*k)) || (cur_chr == (*k) - 'a' + 'A')))
{
- {
- q = get_avail();
- mem[p].hh.rh = q;
- mem[q].hh.lh = cur_tok;
- p = q;
- }
-
+ store_new_token(cur_tok);
incr(k);
}
else if ((cur_cmd != spacer) || (p != backup_head))
goto lab88;
if (scan_keyword("in"))
- {
- num = 7227;
- denom = 100;
- }
+ set_conversion(7227, 100);
else if (scan_keyword("pc"))
- {
- num = 12;
- denom = 1;
- }
+ set_conversion(12, 1);
else if (scan_keyword("cm"))
- {
- num = 7227;
- denom = 254;
- }
+ set_conversion(7227, 254);
else if (scan_keyword("mm"))
- {
- num = 7227;
- denom = 2540;
- }
+ set_conversion(7227, 2540);
else if (scan_keyword("bp"))
- {
- num = 7227;
- denom = 7200;
- }
+ set_conversion(7227, 7200);
else if (scan_keyword("dd"))
- {
- num = 1238;
- denom = 1157;
- }
+ set_conversion(1238, 1157);
else if (scan_keyword("cc"))
- {
- num = 14856;
- denom = 1157;
- }
+ set_conversion(14856, 1157);
else if (scan_keyword("Q"))
- {
- num = 7227;
- denom = 10160;
- }
+ set_conversion(7227, 10160);
else if (scan_keyword("H"))
- {
- num = 7227;
- denom = 10160;
- }
+ set_conversion(7227, 10160);
else if (scan_keyword("sp"))
goto lab30;
else
t = space_token;
else
t = other_token + t;
- {
- {
- q = avail;
- if (q == 0)
- q = get_avail();
- else
- {
- avail = mem[q].hh.rh;
- mem[q].hh.rh = 0;
-#ifdef STAT
- incr(dyn_used);
-#endif /* STAT */
- }
- }
- mem[p].hh.rh = q;
- mem[q].hh.lh = t;
- p = q;
- }
+ fast_store_new_token(t);
incr(k);
}
+
pool_ptr = b;
return p;
link(p) = 0;
if (cur_val_level == ident_val)
- {
- q = get_avail();
- mem[p].hh.rh = q;
- mem[q].hh.lh = cs_token_flag + cur_val;
- p = q;
- }
+ store_new_token(cs_token_flag + cur_val);
else if (cur_val != 0)
{
r = link(cur_val);
- while (r != 0) { /* while r<>null do l.9178 */
- {
- {
- q = avail;
- if (q == 0)
- q = get_avail();
- else
- {
- avail = mem[q].hh.rh;
- mem[q].hh.rh = 0;
-#ifdef STAT
- incr(dyn_used);
-#endif /* STAT */
- }
- }
- mem[p].hh.rh = q;
- mem[q].hh.lh = mem[r].hh.lh;
- p = q;
- }
+ while (r != 0) /* while r<>null do l.9178 */
+ {
+ fast_store_new_token(info(r));
r = link(r);
}
}
+
Result = p;
}
else
if (cur_cmd == left_brace)
{
hashbrace = cur_tok;
- {
- q = get_avail();
- mem[p].hh.rh = q;
- mem[q].hh.lh = cur_tok;
- p = q;
- }
- {
- q = get_avail();
- mem[p].hh.rh = q;
- mem[q].hh.lh = end_match_token;
- p = q;
- }
+ store_new_token(cur_tok);
+ store_new_token(end_match_token);
goto lab30;
}
cur_tok = s;
}
}
- {
- q = get_avail();
- mem[p].hh.rh = q;
- mem[q].hh.lh = cur_tok;
- p = q;
- }
+
+ store_new_token(cur_tok);
}
+
lab31:
- {
- q = get_avail();
- mem[p].hh.rh = q;
- mem[q].hh.lh = end_match_token;
- p = q;
- }
+ store_new_token(end_match_token);
if (cur_cmd == right_brace)
{
else
cur_tok = out_param_token - '0' + cur_chr;
}
- {
- q = get_avail();
- mem[p].hh.rh = q;
- mem[q].hh.lh = cur_tok;
- p = q;
- }
+
+ store_new_token(cur_tok);
}
lab40:
scanner_status = 0;
if (hashbrace != 0)
- {
- q = get_avail();
- mem[p].hh.rh = q;
- mem[q].hh.lh = hashbrace;
- p = q;
- }
+ store_new_token(hashbrace);
+
Result = p;
return Result;
}
def_ref = get_avail();
token_ref_count(def_ref) = 0;
p = def_ref;
-
- {
- q = get_avail();
- mem[p].hh.rh = q;
- mem[q].hh.lh = end_match_token;
- p = q;
- }
+ store_new_token(end_match_token);
if ((n < 0) || (n > 15))
m = 16;
goto lab30;
}
- {
- q = get_avail();
- mem[p].hh.rh = q;
- mem[q].hh.lh = cur_tok;
- p = q;
- }
+ store_new_token(cur_tok);
}
lab30:
end_file_reading();
{
font_index k;
bool file_opened;
-/* halfword lf, lh, bc, ec, nw, nh, nd, ni, nl, nk, ne, np; */
halfword lf, lh, nw, nh, nd, ni, nl, nk, ne, np;
-/* halfword bc, ec; */
- int bc, ec; /* 95/Jan/7 */
+ int bc, ec;
internal_font_number f;
internal_font_number g;
eight_bits a, b, c, d;
tfm_temp = getc(tfm_file);
read_sixteen(ec);
- if ((bc > ec + 1)||(ec > 255))
+ if ((bc > ec + 1) || (ec > 255))
goto lab11;
if (bc > 255)
if (trace_flag)
{
sprintf(log_line, "font_ptr %d font_max %d fmem_ptr %d lf %d font_mem_size %d\n",
- font_ptr, font_max, fmem_ptr, lf, font_mem_size); /* debugging */
+ font_ptr, font_max, fmem_ptr, lf, font_mem_size);
show_line(log_line, 0);
}
if (lh < 2)
goto lab11;
- /* build the font checksum now */
store_four_quarters(font_check[f]);
tfm_temp = getc(tfm_file);
read_sixteen(z);
if (mode > 0)
if (language != clang)
fix_language();
- {
- lig_stack = avail;
-
- if (lig_stack == 0)
- lig_stack = get_avail();
- else
- {
- avail = mem[lig_stack].hh.rh;
- mem[lig_stack].hh.rh = 0;
-#ifdef STAT
- incr(dyn_used);
-#endif /* STAT */
- }
- }
+ fast_get_avail(lig_stack);
font(lig_stack) = main_f;
cur_l = cur_chr;
character(lig_stack) = cur_l;
lab101:
adjust_space_factor();
-
- {
- lig_stack = avail;
-
- if (lig_stack == 0)
- lig_stack = get_avail();
- else
- {
- avail = mem[lig_stack].hh.rh;
- mem[lig_stack].hh.rh = 0;
-#ifdef STAT
- incr(dyn_used);
-#endif /* STAT */
- }
- }
-
+ fast_get_avail(lig_stack);
font(lig_stack) = main_f;
cur_r = cur_chr;
character(lig_stack) = cur_r;
/* sec 0118 */
#define link(p) mem[(p)].hh.rh
#define info(p) mem[(p)].hh.lh
+/* sec 0122 */
+#ifdef STAT
+#define fast_get_avail(a) \
+ do \
+ { \
+ a = avail; \
+ \
+ if (a == 0) \
+ a = get_avail(); \
+ else \
+ { \
+ avail = link(a); \
+ link(a) = 0; \
+ incr(dyn_used); \
+ } \
+ } \
+ while (0)
+#else
+#define fast_get_avail(a) \
+ do \
+ { \
+ a = avail; \
+ \
+ if (a == 0) \
+ a = get_avail(); \
+ else \
+ { \
+ avail = link(a); \
+ link(a) = 0; \
+ } \
+ } \
+ while (0)
+#endif
/* sec 0124 */
#define empty_flag max_halfword
#define is_empty(a) (link(a) = empty_flag)
#define set_interaction 100
#define max_command 100
/* sec 0210 */
-#define undefined_cs (max_command + 1)
-#define expand_after (max_command + 2)
-#define no_expand (max_command + 3)
-#define input (max_command + 4)
-#define if_test (max_command + 5)
-#define fi_or_else (max_command + 6)
-#define cs_name (max_command + 7)
-#define convert (max_command + 8)
-#define the (max_command + 9)
+#define undefined_cs (max_command + 1 )
+#define expand_after (max_command + 2 )
+#define no_expand (max_command + 3 )
+#define input (max_command + 4 )
+#define if_test (max_command + 5 )
+#define fi_or_else (max_command + 6 )
+#define cs_name (max_command + 7 )
+#define convert (max_command + 8 )
+#define the (max_command + 9 )
#define top_bot_mark (max_command + 10)
#define call (max_command + 11)
#define long_call (max_command + 12)
case (a) + letter: \
case (a) + other_char
/* sec 0358 */
+/* sec 0371 */
+#define store_new_token(a) \
+ do \
+ { \
+ q = get_avail(); \
+ link(p) = q; \
+ info(q) = a; \
+ p = q; \
+ } \
+ while (0)
+#define fast_store_new_token(a) \
+ do \
+ { \
+ fast_get_avail(q); \
+ link(p) = q; \
+ info(q) = a; \
+ p = q; \
+ } \
+ while (0)
#define no_expand_flag 257
/* sec 0382 */
#define top_mark_code 0
#define point_token (other_token + '.' ) // 3118
#define continental_point_token (other_token + ',' ) // 3116
/* sec 0445 */
-#define zero_token (other_token + '0') // 3120
+#define zero_token (other_token + '0') // 3120
#define A_token (letter_token + 'A') // 2881
-#define other_A_token (other_token + 'A') // 3137
+#define other_A_token (other_token + 'A') // 3137
+/* sec 0458 */
+#define set_conversion(a, b) \
+ do \
+ { \
+ num = a; \
+ denom = b; \
+ } while (0)
/* sec 0468 */
#define number_code 0
#define roman_numeral_code 1
switch (pid = vfork ())
{
- case -1: /* failed */
+ case -1:
perrormod ("vfork");
- exit (-1); /* NOTREACHED */
+ exit (-1);
- case 0: /* child */
+ case 0:
(void) signal (SIGQUIT, SIG_DFL);
(void) kill (getpid (), SIGQUIT);
(void) write (2, "how did we get here?\n", 21);
- exit (1); /* NOTREACHED */
+ exit (1);
- default: /* parent */
+ default:
while ((w = wait (&status)) != pid && w != -1)
;
+
if (status.w_coredump)
exit (0);
+
(void) write (2, "attempt to dump core failed\n", 28);
exit (1);
}
//#pragma warning(disable:4032)
#pragma warning(disable:4201)
-#pragma warning(disable:4996) //
-#pragma warning(disable:4701) //
+#pragma warning(disable:4996)
+#pragma warning(disable:4701)
//#pragma warning(disable:4100)
//#pragma warning(disable:4244)
#pragma warning(disable:4131) // old style declarator
typedef boolean bool;
typedef double real;
typedef FILE * alpha_file;
-typedef unsigned char ASCII_code;
+typedef unsigned char ASCII_code;
typedef unsigned short KANJI_code;
-typedef unsigned char eight_bits;
+typedef unsigned char eight_bits;
typedef unsigned short sixteen_bits;
typedef integer pool_pointer;
typedef integer str_number;
TEXFORMATPATH,
TEXINPUTPATH,
TFMFILEPATH,
- LAST_PATH
} path_constant_type;
-#define TEXFORMATPATHBIT (1 << TEXFORMATPATH)
-#define TEXINPUTPATHBIT (1 << TEXINPUTPATH)
-#define TFMFILEPATHBIT (1 << TFMFILEPATH)
-
#ifdef link
#undef link
#endif
#define chr(x) (x)
#define ord(x) (x)
#define odd(x) ((x) % 2)
-#define round(x) zround ((double) (x))
+#define round(x) zround((double) (x))
#define decr(x) --(x)
#define incr(x) ++(x)
#define fabs(x) ((x) >= 0.0 ? (x) : -(x))
#define MAXLINE 256
-extern bool trace_flag;
-extern bool open_trace_flag;
extern integer zround (double);
extern bool eoln (FILE * file);
extern bool open_input (FILE **f, path_constant_type path_index, char *fopen_mode);