#define PATH_SEP '/'
#define PATH_SEP_STRING "/"
-#define BUILDNAMEDIRECT /* avoid malloc for string concat */
+#define BUILDNAMEDIRECT /* avoid malloc for string concat */
extern int shorten_file_name; /* in local.c bkph */
#ifdef FUNNY_CORE_DUMP
- extern void funny_core_dump();
+ extern void funny_core_dump(void);
#endif
if (buffer == s2)
{
- memmove (buffer + n1, buffer, n2 + 1);
- strncpy (buffer, s1, n1);
+ memmove(buffer + n1, buffer, n2 + 1);
+ strncpy(buffer, s1, n1);
}
else
{
if (buffer == s3)
{
- memmove (buffer + n1 + n2, buffer, n3 + 1);
- strncpy (buffer, s1, n1);
- strncpy (buffer + n1, s2, n2);
+ memmove(buffer + n1 + n2, buffer, n3 + 1);
+ strncpy(buffer, s1, n1);
+ strncpy(buffer + n1, s2, n2);
}
else
{
if (qualified(name))
return 0;
- if (strstr((char *)name, ext) == NULL)
+ if (strstr((char *) name, ext) == NULL)
return 0;
patch_in_path(buffer, name, path);
return 1;
}
-
// Following works on null-terminated strings
void check_short_name (unsigned char *s)
{
/* kpathsea/tilde.c */
void retwiddle (unsigned char *s)
{
-/* assumes null terminated - 97/June/5 */
-/* while (*s != '\0' && *s != ' ') { */
while (*s != '\0')
{
if (*s == (unsigned char) pseudo_tilde)
#if defined (FUNNY_CORE_DUMP) && !defined (BibTeX)
if (path_index == TEXINPUTPATH &&
- strncmp (name_of_file + 1, "HackyInputFileNameForCoreDump.tex", 33) == 0)
+ strncmp(name_of_file + 1, "HackyInputFileNameForCoreDump.tex", 33) == 0)
funny_core_dump();
#endif
name_of_file[name_length + 1] = '\0';
-/* reinsert '~' and ' ' in file names - 95/June/5 */
-/* done late to prevent problems with null_terminate / space_terminate */
+ /* reinsert '~' and ' ' in file names - 95/June/5 */
+ /* done late to prevent problems with null_terminate / space_terminate */
if (pseudo_tilde != 0 || pseudo_space != 0)
retwiddle(name_of_file + 1);
if (path_index == TFMFILEPATH)
{
- tfm_temp = getc (*f);
+ tfm_temp = getc(*f);
}
if (strstr((char *) name_of_file + 1, ".fmt") != NULL)
gz_fmt_file = gzdopen(fileno(*f), "rb9");
#endif
}
- else if (strstr((char *)name_of_file+1, ".tfm") != NULL)
+ else if (strstr((char *)name_of_file + 1, ".tfm") != NULL)
{
if (show_tfm_flag && log_opened)
{
retwiddle(name_of_file + 1);
}
-/* 8 + 3 file names on Windows NT 95/Feb/20 */
+ /* 8 + 3 file names on Windows NT 95/Feb/20 */
if (shorten_file_name)
{
check_short_name(name_of_file + 1);
}
- if (prepend_path_if (name_of_file + 1, name_of_file + 1, ".dvi", (unsigned char *) dvi_directory) ||
- prepend_path_if (name_of_file + 1, name_of_file + 1, ".log", (unsigned char *) log_directory) ||
- prepend_path_if (name_of_file + 1, name_of_file + 1, ".aux", (unsigned char *) aux_directory) ||
- prepend_path_if (name_of_file + 1, name_of_file + 1, ".fmt", (unsigned char *) fmt_directory) ||
- prepend_path_if (name_of_file + 1, name_of_file + 1, ".pdf", (unsigned char *) pdf_directory))
+ if (prepend_path_if(name_of_file + 1, name_of_file + 1, ".dvi", (unsigned char *) dvi_directory) ||
+ prepend_path_if(name_of_file + 1, name_of_file + 1, ".log", (unsigned char *) log_directory) ||
+ prepend_path_if(name_of_file + 1, name_of_file + 1, ".aux", (unsigned char *) aux_directory) ||
+ prepend_path_if(name_of_file + 1, name_of_file + 1, ".fmt", (unsigned char *) fmt_directory) ||
+ prepend_path_if(name_of_file + 1, name_of_file + 1, ".pdf", (unsigned char *) pdf_directory))
{
if (open_trace_flag)
{
prev_r = active;
old_l = 0;
do_all_six(copy_to_cur_active);
-/*
- cur_active_width[1] = active_width[1];
- cur_active_width[2] = active_width[2];
- cur_active_width[3] = active_width[3];
- cur_active_width[4] = active_width[4];
- cur_active_width[5] = active_width[5];
- cur_active_width[6] = active_width[6];
-*/
+
while (true)
{
lab22:
if (type(r) == delta_node)
{
do_all_six(update_width);
-/*
- cur_active_width[1] = cur_active_width[1] + mem[r + 1].cint;
- cur_active_width[2] = cur_active_width[2] + mem[r + 2].cint;
- cur_active_width[3] = cur_active_width[3] + mem[r + 3].cint;
- cur_active_width[4] = cur_active_width[4] + mem[r + 4].cint;
- cur_active_width[5] = cur_active_width[5] + mem[r + 5].cint;
- cur_active_width[6] = cur_active_width[6] + mem[r + 6].cint;
-*/
prev_prev_r = prev_r;
prev_r = r;
goto lab22;
{
no_break_yet = false;
do_all_six(set_break_width_to_background);
-/*
- break_width[1] = background[1];
- break_width[2] = background[2];
- break_width[3] = background[3];
- break_width[4] = background[4];
- break_width[5] = background[5];
- break_width[6] = background[6];
-*/
s = cur_p;
if (break_type > unhyphenated)
if (type(prev_r) == delta_node)
{
do_all_six(convert_to_break_width);
-/*
- mem[prev_r + 1].cint = mem[prev_r + 1].cint - cur_active_width[1] + break_width[1];
- mem[prev_r + 2].cint = mem[prev_r + 2].cint - cur_active_width[2] + break_width[2];
- mem[prev_r + 3].cint = mem[prev_r + 3].cint - cur_active_width[3] + break_width[3];
- mem[prev_r + 4].cint = mem[prev_r + 4].cint - cur_active_width[4] + break_width[4];
- mem[prev_r + 5].cint = mem[prev_r + 5].cint - cur_active_width[5] + break_width[5];
- mem[prev_r + 6].cint = mem[prev_r + 6].cint - cur_active_width[6] + break_width[6];
-*/
}
else if (prev_r == active)
{
do_all_six(store_break_width);
-/*
- active_width[1] = break_width[1];
- active_width[2] = break_width[2];
- active_width[3] = break_width[3];
- active_width[4] = break_width[4];
- active_width[5] = break_width[5];
- active_width[6] = break_width[6];
-*/
}
else
{
type(q) = delta_node;
subtype(q) = 0;
do_all_six(new_delta_to_break_width);
-/*
- mem[q + 1].cint = break_width[1]- cur_active_width[1];
- mem[q + 2].cint = break_width[2]- cur_active_width[2];
- mem[q + 3].cint = break_width[3]- cur_active_width[3];
- mem[q + 4].cint = break_width[4]- cur_active_width[4];
- mem[q + 5].cint = break_width[5]- cur_active_width[5];
- mem[q + 6].cint = break_width[6]- cur_active_width[6];
-*/
link(prev_r) = q;
prev_prev_r = prev_r;
prev_r = q;
type(q) = delta_node;
subtype(q) = 0;
do_all_six(new_delta_from_break_width);
-/*
- mem[q + 1].cint = cur_active_width[1] - break_width[1];
- mem[q + 2].cint = cur_active_width[2] - break_width[2];
- mem[q + 3].cint = cur_active_width[3] - break_width[3];
- mem[q + 4].cint = cur_active_width[4] - break_width[4];
- mem[q + 5].cint = cur_active_width[5] - break_width[5];
- mem[q + 6].cint = cur_active_width[6] - break_width[6];
-*/
link(prev_r) = q;
prev_prev_r = prev_r;
prev_r = q;
{
do_all_six(update_active);
do_all_six(copy_to_cur_active);
-/*
- active_width[1] = active_width[1] + mem[r + 1].cint;
- active_width[2] = active_width[2] + mem[r + 2].cint;
- active_width[3] = active_width[3] + mem[r + 3].cint;
- active_width[4] = active_width[4] + mem[r + 4].cint;
- active_width[5] = active_width[5] + mem[r + 5].cint;
- active_width[6] = active_width[6] + mem[r + 6].cint;
- cur_active_width[1] = active_width[1];
- cur_active_width[2] = active_width[2];
- cur_active_width[3] = active_width[3];
- cur_active_width[4] = active_width[4];
- cur_active_width[5] = active_width[5];
- cur_active_width[6] = active_width[6];
-*/
link(active) = link(r);
free_node(r, delta_node_size);
}
if (r == active)
{
do_all_six(downdate_width);
-/*
- cur_active_width[1] = cur_active_width[1] - mem[prev_r + 1].cint;
- cur_active_width[2] = cur_active_width[2] - mem[prev_r + 2].cint;
- cur_active_width[3] = cur_active_width[3] - mem[prev_r + 3].cint;
- cur_active_width[4] = cur_active_width[4] - mem[prev_r + 4].cint;
- cur_active_width[5] = cur_active_width[5] - mem[prev_r + 5].cint;
- cur_active_width[6] = cur_active_width[6] - mem[prev_r + 6].cint;
-*/
link(prev_prev_r) = active;
free_node(prev_r, delta_node_size);
prev_r = prev_prev_r;
{
do_all_six(update_width);
do_all_six(combine_two_deltas);
-/*
- cur_active_width[1] = cur_active_width[1] + mem[r + 1].cint;
- cur_active_width[2] = cur_active_width[2] + mem[r + 2].cint;
- cur_active_width[3] = cur_active_width[3] + mem[r + 3].cint;
- cur_active_width[4] = cur_active_width[4] + mem[r + 4].cint;
- cur_active_width[5] = cur_active_width[5] + mem[r + 5].cint;
- cur_active_width[6] = cur_active_width[6] + mem[r + 6].cint;
- mem[prev_r + 1].cint = mem[prev_r + 1].cint + mem[r + 1].cint;
- mem[prev_r + 2].cint = mem[prev_r + 2].cint + mem[r + 2].cint;
- mem[prev_r + 3].cint = mem[prev_r + 3].cint + mem[r + 3].cint;
- mem[prev_r + 4].cint = mem[prev_r + 4].cint + mem[r + 4].cint;
- mem[prev_r + 5].cint = mem[prev_r + 5].cint + mem[r + 5].cint;
- mem[prev_r + 6].cint = mem[prev_r + 6].cint + mem[r + 6].cint;
-*/
link(prev_r) = link(r);
free_node(r, delta_node_size);
}
}
}
#endif /* STAT */
-/* must exit here, there are no internal return - except for confusion */
-/* savedbadness = b; */ /* 96/Feb/9 - for test in itex.c */
}
/* end of the old tex5.c here */
/* sec 0877 */
{
k = bchar_label[hf];
- if (k == non_address) /* i.e. 0 --- 96/Jan/15 */
+ if (k == non_address)
goto lab30;
else
q = font_info[k].qqqq;
q = font_info[k].qqqq;
}
}
+
if (cur_rh < non_char)
test_char = cur_rh;
else
while (s != 0)
{
- hyf[mem[s].hh.v.LH] = 1;
- s = mem[s].hh.v.RH;
+ hyf[info(s)] = 1;
+ s = link(s);
}
decr(hn);
goto lab40;
}
+
lab30:;
if (h > 0)
decr(h);
init_lig = false;
}
- free_node(ha, small_node_size);
+ free_node(ha, small_node_size);
}
else
{
least_cost = awful_bad;
do_all_six(set_height_zero);
-/*
- active_width[1] = 0;
- active_width[2] = 0;
- active_width[3] = 0;
- active_width[4] = 0;
- active_width[5] = 0;
- active_width[6] = 0;
-*/
prev_dp = 0;
while (true)
b = 0;
else
b = badness(h - cur_height, active_width[2]);
- else if (active_width[1] - h > active_width[6])
- b = awful_bad;
else
- b = badness(cur_height - h, active_width[6]);
+ if (active_width[1] - h > active_width[6])
+ b = awful_bad;
+ else
+ b = badness(cur_height - h, active_width[6]);
if (b < awful_bad)
if (pi <= eject_penalty)
b = pi;
- else if (b < inf_bad)
- b = b + pi;
else
- b = deplorable;
+ if (b < inf_bad)
+ b = b + pi;
+ else
+ b = deplorable;
if (b <= least_cost)
{
prev_p = p;
p = link(prev_p);
}
+
lab30:
return best_place;
}
page_max_depth = max_depth;
page_depth = 0;
do_all_six(set_page_so_far_zero);
-/*
- page_so_far[1] = 0;
- page_so_far[2] = 0;
- page_so_far[3] = 0;
- page_so_far[4] = 0;
- page_so_far[5] = 0;
- page_so_far[6] = 0;
-*/
least_page_cost = awful_bad;
+
#ifdef STAT
if (tracing_pages > 0)
{
#include "texd.h"
-
#define dump_default_var TEX_format_default
#define dump_default " plain.fmt"
#define dump_ext_length 4
#define dump_default_length format_default_length
#define main_program texbody
#define edit_value tex_edit_value
-#define edit_var "UFYFEJU"
-
extern char * replacement[];
-#ifdef FUNNY_CORE_DUMP
- void funny_core_dump (void);
-#endif
-
/* The main program, etc. */
/* What we were invoked as and with. */
}
/* Find the end of the buffer. */
- for (last = first; buffer[last]; ++last) ;
+ for (last = first; buffer[last]; ++last)
+ ;
+
+ for (--last; last >= first && ISBLANK (buffer[last]) && buffer[last] != '\r'; --last)
+ ;
- for (--last; last >= first
- && ISBLANK (buffer[last]) && buffer[last] != '\r'; --last)
- ;
last++;
/* One more time, this time converting to TeX's internal character
}
tmptr = localtime (&clock);
-/* MS C runtime library has trouble for clock >= 2^31 !!! */
- if (tmptr == NULL) /* debugging 95/Dec/30*/
+
+ if (tmptr == NULL)
{
sprintf(log_line, "Cannot convert time (%0ld)!\n", clock);
show_line(log_line, 1);
/* What about control-Z that gets read in binary mode ? - bkph */
// #ifdef MYDEBUG
/* while (last > first && buffer[last - 1] <= ' ') --last; */
- while (last > first) {
+ while (last > first)
+ {
i = buffer[last - 1];
+
if (i == ' ' || i == '\t')
--last;
/* else if (trimeof && i == 26) --last; */ /* 93/Nov/24 */
show_line(log_line, 0);
}
- s = kpse_var_value(edit_var);
+ s = kpse_var_value(edit_value);
if (s != NULL)
edit_value = s;
TeX from virtex, and is triggered by a magic file name requested as
input (see `open_input', above). */
-void funny_core_dump ()
+void funny_core_dump (void)
{
int pid, w;
union wait status;