OSDN Git Service

code clean.
authormaqiyuan <maqiyuan@users.sourceforge.jp>
Sun, 11 May 2014 18:19:25 +0000 (02:19 +0800)
committermaqiyuan <maqiyuan@users.sourceforge.jp>
Sun, 11 May 2014 18:19:25 +0000 (02:19 +0800)
13 files changed:
src/texsourc/Makefile.gcc
src/texsourc/coerce.h
src/texsourc/itex.c
src/texsourc/local.c
src/texsourc/openinou.c
src/texsourc/tex3.c
src/texsourc/tex5.c
src/texsourc/tex6.c
src/texsourc/tex7.c
src/texsourc/tex8.c
src/texsourc/texd.h
src/texsourc/yandytex.c
src/texsourc/yandytex.h

index 18811eb..22297e1 100644 (file)
@@ -35,7 +35,7 @@ itex.o: itex.c $(headers)
 openinou.o: openinou.c $(headers)
        $(CC) -c $(CFLAGS) openinou.c
 
-subroute.o: subroute.o $(headers)
+subroute.o: subroute.c $(headers)
        $(CC) -c $(CFLAGS) subroute.c
 
 local.o: local.c $(headers)
index 65285ea..956cddf 100644 (file)
@@ -26,7 +26,7 @@
 /* WARNING: with dynamic allocation cannot use memory_word *mem=zmem */
 /* in this case, just let mem be alias for zmem */
 /* BUT: allow continued use of register for eqtb at least ! */
-#define mem zmem
+//#define mem zmem
 
 void print_err (const char * s);
 void initialize (void);
index 9ce9672..12d5111 100644 (file)
 
 #include "texd.h"
 
-#pragma warning(disable:4244) /* 96/Jan/10 */
-
-#include <time.h>
-
 #define BEGINFMTCHECKSUM 367403084L
 #define ENDFMTCHECKSUM   69069L
 
@@ -45,13 +41,11 @@ void initialize (void)
   hyph_pointer z;
 #endif
 
-/* We already initialized xchr if we are using non_ascii setup */
-/* Normally, there is no translation of character code numbers */
   if (!non_ascii)
   {
     for (i = 0; i <= 255; i++)
       xchr[i] = (char) i;
-/* This is a kind of joke, since the characters are given as numeric codes ! */
+
 #ifdef JOKE
     xchr[32] = ' ';  xchr[33] = '!';  xchr[34] = '"';  xchr[35] = '#';
     xchr[36] = '$';  xchr[37] = '%';  xchr[38] = '&';  xchr[39] = '\'';
@@ -83,10 +77,9 @@ void initialize (void)
 
     for (i = 127; i <= 255; i++)
       xchr[i]= chr(i);
-#endif /* end of JOKE */
+#endif
   }
-/* end of plain ASCII case (otherwise have read in xchr vector before) */
-/* Fill in background of `delete' for inverse mapping                  */
+
   for (i = 0; i <= 255; i++)
     xord[chr(i)] = 127;
 
@@ -97,33 +90,29 @@ void initialize (void)
   for (i = 0; i <= 126; i++)
     xord[xchr[i]] = i;
 #endif
-  
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
-/* Now invert the xchr mapping to get xord mapping */
+
   for (i = 0; i <= 255; i++)
     xord[xchr[i]] = (char) i;
 
-  xord[127] = 127; /* hmm, a fixed point ? why ? */
+  xord[127] = 127;
 
-  flag = 0; /* 93/Dec/28 - bkph */
+  flag = 0;
 
   if (trace_flag != 0)
   {
-/*  entries in xord / xchr */
     for (k = 0; k < 256; k++)
       if (xord[k] != k)
       {
         flag = 1;
         break;
       }
-/* 127 here means mapping undefined */
+
     if (flag)
     {
       show_line("Inverted mapping xord[] pairs:\n", 0);
 
       for (k = 0; k < 256; k++)
       {
-/*  entries in xord / xchr */
         if (xord[k] != 127)
         {
           sprintf(log_line, "%d => %d\n", k, xord[k]);
@@ -132,8 +121,8 @@ void initialize (void)
       }
     }
   }
-/* may now set in local.c bkph */
-  if (interaction < 0)
+
+  if (interaction < batch_mode)
     interaction = error_stop_mode;
 
   deletions_allowed = true;
@@ -143,7 +132,7 @@ void initialize (void)
   use_err_help = false;
   interrupt = 0;
   OK_to_interrupt = true;
-/* darn, need to know mem_top, mem_max etc for the following ... */
+
 #ifdef DEBUG
   was_mem_end = mem_min;
 /*  was_lo_max = mem_min; */
@@ -151,7 +140,8 @@ void initialize (void)
 /*  was_hi_min = mem_max; */
   was_hi_min = mem_top;
   panicking = false;
-#endif /* DEBUG */
+#endif
+
   nest_ptr = 0;
   max_nest_stack = 0;
   mode = 1;
@@ -165,10 +155,10 @@ void initialize (void)
   page_tail = page_head;
 
 #ifdef ALLOCATEMAIN
-  if (is_initex) /* in iniTeX we did already allocate mem [] */
+  if (is_initex)
 #endif
     mem[page_head].hh.v.RH = 0;
-/*  last_glue = 262143L;  */ /* NO! */
+
   last_glue = empty_flag;
   last_penalty = 0;
   last_kern = 0;
@@ -983,7 +973,7 @@ lab30:                /* common exit point */
 
   q = passive;
 
-  while (q != 0) /* while q<>null do l.16979 */
+  while (q != 0)
   {
     cur_p = link(q);
     free_node(q, 2);
@@ -1579,7 +1569,7 @@ void prefixed_command (void)
         return;       // abort_flag set
       }
       break;
-  } /* end of cur_cmd switch */
+  }
 
 lab30:
   if (after_token != 0)
@@ -1605,7 +1595,7 @@ void bad_formator_pool (char *name, char *defaultname, char *envvar)
   show_line(log_line, 0);
 
   {
-    char *s;            /* extra info 99/April/28 */
+    char *s;
 
     if ((s = grabenv(envvar)) != NULL)
     {
@@ -1618,6 +1608,7 @@ void bad_formator_pool (char *name, char *defaultname, char *envvar)
       show_line(log_line, 0);
     }
   }
+
 #ifndef _WINDOWS
   fflush(stdout);
 #endif
@@ -1625,7 +1616,6 @@ void bad_formator_pool (char *name, char *defaultname, char *envvar)
 /* sec 1303 */
 bool load_fmt_file (void)
 {
-  register bool Result;
   integer j, k;
   halfword p, q;
   integer x;
@@ -2178,22 +2168,20 @@ bool load_fmt_file (void)
       format_ident = x;
   }
   undump_int(x);
-/*  test_eof(fmt_file)? */
   
-  if ((x != ENDFMTCHECKSUM) || feof(fmt_file)) /* magic checksum --- change ? */
+  if ((x != ENDFMTCHECKSUM) || feof(fmt_file))
     goto lab6666;
 
-  Result = true;
-  return(Result);
+  return true;
 
 lab6666:;
   sprintf(log_line, "(Fatal format file error; I'm stymied)\n");
   show_line(log_line, 1);
-/* added following bit of explanation 96/Jan/10 */
+
   if (!knuth_flag)
     bad_formator_pool(format_file, "the format file", "TEXFORMATS");
-  Result = false;
-  return Result;
+
+  return false;
 }
 /* sec 1335 */
 void final_cleanup (void)
@@ -2275,8 +2263,9 @@ void final_cleanup (void)
         delete_glue_ref(last_glue);
       store_fmt_file(); // returns a value ?
     }
-#endif /* INITEX */
-    if (!is_initex)       /* 2000/March/3 */
+#endif
+
+    if (!is_initex)
       print_nl("(\\dump is performed only by INITEX)");
   }
 }
@@ -2307,20 +2296,13 @@ void show_frozen (void)
   fprintf(log_file, ") ");
 }
 
-/* Main entry point called from texmf.c int main(int ac, char *av[]) */
-/* call from main_program in texmf.c */
-/* This in turn calls initialize() */
-
-#pragma warning(disable:4127)   // conditional expression is constant
-
 int texbody (void)
 {
-  history = 3;
+  history = fatal_error_stop;
 
   if (ready_already == 314159L)
     goto lab1;
 
-  /*  These tests are almost all compile time tests and so could be eliminated */
   bad = 0;
 
   if ((half_error_line < 30) || (half_error_line > error_line - 15))
@@ -2332,17 +2314,17 @@ int texbody (void)
   if (dvi_buf_size % 8 != 0)
     bad = 3;
 
-  if (1100 > mem_top)
-    bad = 4;   /* not compile time */
+  if (mem_bot + 1100 > mem_top)
+    bad = 4;
 
   if (hash_prime > (hash_size + hash_extra))
     bad = 5;
 
   if (max_in_open >= 128)
-    bad = 6;   /* p.14 */
+    bad = 6;
 
-  if (mem_top < 267)
-    bad = 7;    /* where from ? *//* not compile time */
+  if (mem_top < 256 + 11)
+    bad = 7;
 
 #ifdef INITEX
   if (is_initex)
@@ -2366,15 +2348,15 @@ int texbody (void)
 
   if ((mem_min < min_halfword) || (mem_max >= max_halfword) || (mem_bot - mem_min >= max_halfword))
     bad = 14;
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
-  if (mem_max > mem_top + mem_extra_high)     /* not compile time */
-    bad = 14;       /* ha ha */
 
-  if ((0 < min_quarterword) || (font_max > max_quarterword))  /* 93/Dec/3 */
+  if (mem_max > mem_top + mem_extra_high)
+    bad = 14;
+
+  if ((0 < min_quarterword) || (font_max > max_quarterword))
     bad = 15;
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
+
 #ifdef INCREASEFONTS
-  if (font_max > 1024)                /* 96/Jan/17 */
+  if (font_max > 1024)
 #else
   if (font_max > 256)
 #endif
@@ -2407,7 +2389,7 @@ int texbody (void)
     if (!knuth_flag)
       bad_formator_pool(format_file, "the format file", "TEXFORMATS");
 
-    goto lab9999;     // abort
+    goto lab9999;
   }
 
   initialize();
@@ -2416,7 +2398,7 @@ int texbody (void)
   if (is_initex)
   {
     if (!get_strings_started())
-      goto lab9999;   // abort
+      goto lab9999;
 
     init_prim();
     init_str_ptr = str_ptr;
@@ -2425,7 +2407,7 @@ int texbody (void)
   }
 #endif
 
-  ready_already = 314159L; /* magic number */
+  ready_already = 314159L;
 
 lab1:
   selector = term_only;
@@ -2434,11 +2416,17 @@ lab1:
   file_offset = 0;
   show_line(tex_version, 0);
 
-#ifdef _WIN64
-  sprintf(log_line, " (%s %s/Windows 64bit)", application, yandyversion);
+  {
+#ifdef _WIN32
+  #ifdef _WIN64
+    sprintf(log_line, " (%s %s/Windows 64bit)", application, yandyversion);
+  #else
+    sprintf(log_line, " (%s %s/Windows 32bit)", application, yandyversion);
+  #endif
 #else
-  sprintf(log_line, " (%s %s/Windows 32bit)", application, yandyversion);
+    sprintf(log_line, " (%s %s/Linux)", application, yandyversion);
 #endif
+  }
 
   show_line(log_line, 0);
 
@@ -2461,9 +2449,9 @@ lab1:
       input_ptr = 0;
       max_in_stack = 0;
       in_open = 0;
-      high_in_open = 0; /* max_in_open name already used 1999 Jan 17 */
+      high_in_open = 0;
       open_parens = 0;
-      max_open_parens = 0;  /* max_open_parens */
+      max_open_parens = 0;
       max_buf_stack = 0;
       param_ptr = 0;
       max_param_stack = 0;
@@ -2474,9 +2462,9 @@ lab1:
       memset (buffer, 0, buf_size);
 #endif
 
-      first = 0;              /* 1999/Jan/22 */
+      first = 0;
       scanner_status = 0;
-      warning_index = 0; /* warning_index:=null; l.7068 */
+      warning_index = 0;
       first = 1;
       cur_input.state_field = 33;
       cur_input.start_field = 1;
@@ -2487,13 +2475,12 @@ lab1:
       align_state = 1000000L;
 
       if (!init_terminal())
-        goto lab9999; // abort
+        goto lab9999;
 
       cur_input.limit_field = last;
       first = last + 1;
     }
-
-/*    For Windows NT, lets allow + instead of & for format specification */
+    
     if ((format_ident == 0) ||
         (buffer[cur_input.loc_field] == '&') ||
         (buffer[cur_input.loc_field] == '+'))
@@ -2502,12 +2489,12 @@ lab1:
         initialize();
 
       if (!open_fmt_file ())
-        goto lab9999; // abort
+        goto lab9999;
 
       if (!load_fmt_file ())
       {
         w_close(fmt_file);
-        goto lab9999; // abort
+        goto lab9999;
       }
 
       w_close(fmt_file);
@@ -2523,9 +2510,7 @@ lab1:
       buffer[cur_input.limit_field] = end_line_char;
 
     fix_date_and_time();
-
     magic_offset = str_start[886] - 9 * ord_noad;
-    /* "0234000122*4000133**3**344*0400400*000000234000111*1111112341011" */
 
     if (interaction == batch_mode)
       selector = no_print;
@@ -2537,21 +2522,19 @@ lab1:
       start_input();
   }
 
-/*  show font TFMs frozen into format file */
-/*  moved here after start_input to ensure the log file is open */
-  if (show_tfm_flag && log_opened && font_ptr > 0)    /* 98/Sep/28 */
+  if (show_tfm_flag && log_opened && font_ptr > 0)
     show_frozen();
 
   main_time = clock();
   history = 0;
 
   if (show_cs_names)
-    print_cs_names(stdout, 0);    /* 98/Mar/31 */
+    print_cs_names(stdout, 0);
 
-  main_control();     /* read-eval-print loop :-) in tex8.c */
+  main_control();
 
   if (show_cs_names)
-    print_cs_names(stdout, 1);    /* 98/Mar/31 */
+    print_cs_names(stdout, 1);
 
   final_cleanup();
 
index b2eb5df..56cff3f 100644 (file)
@@ -99,7 +99,7 @@ void show_usage (void)
       "        be verbose (show implementation version number)\n"
       "    -n    do not allow `non ASCII' characters in input files (complain instead)\n"
       "    --showhex -w\n"
-      "         do not show `non ASCII' characters in hexadecimal (show as is)\n"
+      "        do not show `non ASCII' characters in hexadecimal (show as is)\n"
       "    -d    do not allow DOS style file names - i.e. do not convert \\ to /\n"
       "    -r    do not allow Mac style termination - i.e. do not convert \\r to \\n\n"
       "    --patterns    -p\n"
@@ -560,7 +560,7 @@ void *ourrealloc (void *old, size_t new_size)
   if (old == NULL)
     return malloc (new_size);  /* no old block - use malloc */
 
-#ifdef MSDOS
+#ifdef _WIN32
   old_size = _msize (old);
 #else
   old_size = malloc_usable_size (old);
@@ -569,7 +569,7 @@ void *ourrealloc (void *old, size_t new_size)
   if (old_size >= new_size && old_size < new_size + 4)
     return old;
 
-#ifdef MSDOS
+#ifdef _WIN32
   mnew = _expand (old, new_size); /* first try and expand in place MSVC */
 #else
   mnew = realloc (old, new_size);
@@ -827,7 +827,7 @@ memory_word *allocate_main_memory (int size)
 /*  Could we avoid this by detecting presence of & before allocating ? */
 /*  Also, if its already large enough, maybe we can avoid this ? */
 /*  don't bother if current_mem_size == mem_max - mem_start ? */
-  if (mainmemory != NULL)
+  if (main_memory != NULL)
   {
     if (trace_flag)
       show_line("Reallocating initial memory allocation\n", 1);
@@ -843,11 +843,11 @@ memory_word *allocate_main_memory (int size)
   if (trace_flag)
     trace_memory("main memory", n);
 
-/*  mainmemory = (memory_word *) malloc (n); */  /* 94/March/24 */
-/*  normally mainmemory == NULL here so acts like malloc ... */
-  mainmemory = (memory_word *) REALLOC (mainmemory, n);
+/*  main_memory = (memory_word *) malloc (n); */  /* 94/March/24 */
+/*  normally main_memory == NULL here so acts like malloc ... */
+  main_memory = (memory_word *) REALLOC (main_memory, n);
 
-  if (mainmemory == NULL)
+  if (main_memory == NULL)
   {
     memory_error("initial main memory", n);
 //    exit (1);             /* serious error */
@@ -856,29 +856,29 @@ memory_word *allocate_main_memory (int size)
 
   if (trace_flag)
   {
-    sprintf(log_line, "Address main memory == %d\n", mainmemory);
+    sprintf(log_line, "Address main memory == %d\n", main_memory);
     show_line(log_line, 0);
   }
 
-  zzzaa = mainmemory;
+  mem = main_memory;
 
   if (mem_start != 0 && !is_initex)
-    zzzaa = mainmemory - mem_start;
+    mem = main_memory - mem_start;
 
   if (trace_flag)
   {
-    sprintf(log_line, "Offset address main memory == %d\n", zzzaa);
+    sprintf(log_line, "Offset address main memory == %d\n", mem);
     show_line(log_line, 0);
   }
 
-  update_statistics ((int) mainmemory, n, (current_mem_size + 1) * sizeof (memory_word));
+  update_statistics ((int) main_memory, n, (current_mem_size + 1) * sizeof (memory_word));
 /*  current_mem_size = (mem_max - mem_start + 1); */
   current_mem_size = mem_max - mem_start;   /* total number of words - 1 */
 
   if (trace_flag)
     probe_show();     /* 94/Mar/25 */
 
-  return zzzaa; /* same as zmem, mem 94/Jan/24 */
+  return mem;
 }
 #endif
 
@@ -914,7 +914,7 @@ memory_word *realloc_main (int losize, int hisize)
 
   if (trace_flag)
   {
-    sprintf(log_line, "Old Address %s == %d\n", "main memory", mainmemory);
+    sprintf(log_line, "Old Address %s == %d\n", "main memory", main_memory);
     show_line(log_line, 0);
   }
 
@@ -973,7 +973,7 @@ memory_word *realloc_main (int losize, int hisize)
     if (trace_flag)
       trace_memory("main memory", n);
 
-    newmemory = (memory_word *) REALLOC (mainmemory, n);
+    newmemory = (memory_word *) REALLOC (main_memory, n);
 
     if (newmemory != NULL)
       break; /* did we get it ? */
@@ -987,7 +987,7 @@ memory_word *realloc_main (int losize, int hisize)
   if (newmemory == NULL)
   {
     memory_error("main memory", n);
-    return zzzaa;           /* try and continue with TeX !!! */
+    return mem;
   }
 
   if (trace_flag)
@@ -1009,7 +1009,7 @@ memory_word *realloc_main (int losize, int hisize)
       (current_mem_size + 1) * sizeof(memory_word));
 /*  could reduce words moved by (mem_max - mem_end) */
   }
-  mainmemory = newmemory;       /* remember for free later */
+  main_memory = newmemory;       /* remember for free later */
 
   if (losize > 0)
     mem_start = mem_start - losize; /* update lower limit */
@@ -1017,7 +1017,7 @@ memory_word *realloc_main (int losize, int hisize)
   if (hisize > 0)
     mem_max = mem_max + hisize;   /* update upper limit */
 
-  update_statistics ((int) mainmemory, n,
+  update_statistics ((int) main_memory, n,
     (current_mem_size + 1) * sizeof (memory_word));
   current_mem_size = newsize;
 
@@ -1027,14 +1027,14 @@ memory_word *realloc_main (int losize, int hisize)
   }
 
   if (mem_start != 0)
-    zzzaa = mainmemory - mem_start; /* ??? sign ??? */
+    mem = main_memory - mem_start;
   else
-    zzzaa = mainmemory;
+    mem = main_memory;
 
   if (trace_flag)
-    probe_show();     /* 94/Mar/25 */
+    probe_show();
 
-  return zzzaa;
+  return mem;
 }
 #endif
 
@@ -1782,25 +1782,25 @@ int allocate_memory (void)
 #endif
 
 #ifdef ALLOCATEINPUTSTACK
-  input_stack = NULL;        /* new 1999/Jan/21 */
+  input_stack = NULL;
   current_stack_size = 0;
   input_stack = realloc_input_stack (initial_stack_size);  /* + 1 */
 #endif
 
 #ifdef ALLOCATENESTSTACK
-  nest = NULL;          /* new 1999/Jan/21 */
+  nest = NULL;
   current_nest_size = 0;
   nest = realloc_nest_stack (initial_nest_size);  /* + 1 */
 #endif
 
 #ifdef ALLOCATEPARAMSTACK
-  param_stack = NULL;          /* new 1999/Jan/21 */
+  param_stack = NULL;
   current_param_size = 0;
   param_stack = realloc_param_stack (initial_param_size); /* + 1 */
 #endif
 
 #ifdef ALLOCATESAVESTACK
-  save_stack = NULL;       /* new 1999/Jan/7 */
+  save_stack = NULL;
   current_save_size = 0;
   save_stack = realloc_save_stack (initial_save_size);
 #endif
@@ -1821,7 +1821,9 @@ int allocate_memory (void)
 /*  maybe taylor allocations to actual pool file 1300 strings 27000 bytes ? */
   if (is_initex)
   {
-    if (trace_flag) show_line("ini TeX pool and string allocation\n", 0);
+    if (trace_flag)
+      show_line("ini TeX pool and string allocation\n", 0);
+
     str_pool = realloc_str_pool (initial_pool_size); 
     str_start = realloc_str_start (initial_max_strings);
   }
@@ -1833,12 +1835,13 @@ int allocate_memory (void)
   current_font_mem_size = 0;
 /*  if not iniTeX, then do initial allocation on fmt file read in itex.c */
 /*  if ini-TeX we need to do it here - no format file read later */
-  if (is_initex) font_info = realloc_font_info (initial_font_mem_size);
+  if (is_initex)
+    font_info = realloc_font_info (initial_font_mem_size);
 #endif
-    
+
 #ifdef ALLOCATEMAIN
-  mainmemory = NULL;
-  zzzaa = NULL;
+  main_memory = NULL;
+  mem = NULL;
   mem_min = mem_bot;        /* just to avoid complaints in texbody */
   mem_top = mem_initex;
   mem_max = mem_top;
@@ -1866,6 +1869,7 @@ int allocate_memory (void)
   {
     if (new_hyphen_prime)
       hyphen_prime = new_hyphen_prime;
+
     if (realloc_hyphen(hyphen_prime)) /* allocate just in case no format */
       return -1;
   }
@@ -1906,7 +1910,7 @@ int allocate_memory (void)
 /* free in reverse order 93/Nov/26 */
 int free_memory (void)
 {
-  unsigned heap_total = 0;
+  unsigned int heap_total = 0;
 
   if (trace_flag)
     show_line("free_memory ", 0);
@@ -1988,10 +1992,10 @@ int free_memory (void)
 
 #ifdef ALLOCATEMAIN
 /*  if (zzzaa != NULL) free(zzzaa); */  /* NO: zzzaa may be offset ! */
-  if (mainmemory != NULL)
-    free(mainmemory);
+  if (main_memory != NULL)
+    free(main_memory);
 
-  mainmemory = NULL;
+  main_memory = NULL;
 #endif
 
 #ifdef ALLOCATEFONT
@@ -2043,13 +2047,10 @@ int free_memory (void)
   if (format_file != NULL)
     free(format_file);
 
-  if (string_file != NULL)
-    free(string_file);
-
   if (source_direct != NULL)
     free(source_direct);
 
-  format_file = string_file = source_direct = NULL;
+  format_file = source_direct = NULL;
 
   if (dvi_file_name != NULL)
     free(dvi_file_name);
@@ -2100,74 +2101,90 @@ void complainarg (int c, char *s)
 
 /* following is list of allowed command line flags and args */
 
-/* only  01234567.9 still left to take ... maybe recycle u */
-
 char *allowedargs = "+bcdfijnpqrstvwyzABCDFGIJKLMNOPQRSTVWXYZ023456789?a=e=g=h=k=l=m=o=u=x=E=H=P=U=";
 
-/* char takeargs="gmueoazhluEH"; */ /* subset that takes args! needed here */
-
 void reorderargs (int ac, char **av)
 {
   int n, m;
   char *s, *t;
-//  char takeargs[128];   /* large enough for all command line arg chars */
   char takeargs[256];   /* large enough for all command line arg chars */
 
-/*  assumes arg pointers av[] are writeable */
-/*  for (n = 1; n < ac; n++) sprintf(log_line, "%s ", av[n]); */
-
-  if (ac < 3) { /* need more than one arg to reorder anything 94/Feb/25 */
-/*    show_line("No arguments?\n", 0); */  /* debugging */
-    return;             /* no args ! */
+  if (ac < 3)
+  {
+    return; /* no args ! */
   }
 
   s = allowedargs;
   t = takeargs;   /* list of those that take args */
-  while (*s != '\0' && *(s+1) != '\0') {
-    if (*(s+1) == '=') *t++ = *s++;   /* copy over --- without the = */
+
+  while (*s != '\0' && *(s+1) != '\0')
+  {
+    if (*(s+1) == '=')
+      *t++ = *s++;   /* copy over --- without the = */
+
     s++;
   }
+
   *t = '\0';
-  if (trace_flag) {
+
+  if (trace_flag)
+  {
     show_line(takeargs, 0);
     show_char('\n');
   }
   
   n = 1;
-  for (;;) {              /* scan to end of command line args */
-    if (*av[n] != '-') break;
-/*    does it take an argument ? and is this argument next ? */
-    if (n+1 < ac &&
-      *(av[n]+2) == '\0' &&
-/*        strchr("gmuhleoxE", *(av[n]+1)) != NULL) */
-        strchr(takeargs, *(av[n]+1)) != NULL)
-          n += 2; /* step over it */
-    else n++;
-    if (n == ac) break;
-  }
-
-  for (;;) {              /* look for more command line args */
-    if (n == ac) break;
+
+  for (;;)
+  {
+    if (*av[n] != '-')
+      break;
+
+    if (n + 1 < ac && *(av[n] + 2) == '\0' &&
+      strchr(takeargs, *(av[n]+1)) != NULL)
+      n += 2; /* step over it */
+    else
+      n++;
+
+    if (n == ac)
+      break;
+  }
+
+  for (;;)
+  {
+    if (n == ac)
+      break;
+
     m = n;
-/*    while (*av[m] != '-' && m < ac) m++; */ /* first command */
-    while (m < ac && *av[m] != '-') m++;  /* first command */
-    if (m == ac) break;
+
+    while (m < ac && *av[m] != '-')
+      m++;  /* first command */
+
+    if (m == ac)
+      break;
 /* does it take an argument ? and is this argument next ? */
 /* check first whether the `-x' is isolated, or arg follows directly */
 /* then check whether this is one of those that takes an argument */
-    if (m+1 < ac &&
-      *(av[m]+2) == '\0' &&
-        strchr(takeargs, *(av[m]+1)) != NULL) {
+    if (m+1 < ac && *(av[m]+2) == '\0' &&
+      strchr(takeargs, *(av[m]+1)) != NULL)
+    {
       s = av[m];      /*  move command down before non-command */
-      t = av[m+1];
-      for (; m > n; m--)  av[m+1] = av[m-1];
+      t = av[m + 1];
+
+      for (; m > n; m--)
+        av[m + 1] = av[m - 1];
+
       av[n] = s;
-      av[n+1] = t;
+      av[n + 1] = t;
       n += 2;       /* step over moved args */
     }
-    else {
+    else
+    {
       s = av[m];      /*  move command down before non-command */
-      for (; m > n; m--)  av[m] = av[m-1];
+
+      for (; m > n; m--)
+        av[m] = av[m - 1];
+
       av[n] = s;
       n++;        /* step over moved args */
     }
@@ -2361,7 +2378,6 @@ bool workingdirectory   = false;              /* if working directory set in ini
 
 char *lastname = NULL, *lastvalue = NULL;
 
-/* get value of env var - try first in dviwindo.ini then DOS env */
 /* returns allocated string -- these strings are not freed again */
 /* is it safe to do that now ? 98/Jan/31 */
 char *grabenv (char *varname)
@@ -2455,7 +2471,7 @@ void knuthify (void)
 char * xchrfile = NULL;
 char * replfile = NULL;
 
-char * short_options = "m:e:h:0:H:g:P:wvpiKLZMdp2t?uo:l:a:";
+char * short_options = "m:e:h:0:H:g:P:o:l:a:wvpiKLZMdp2t?u";
 
 static struct option long_options[] =
 {
@@ -2466,7 +2482,9 @@ static struct option long_options[] =
   {"tab-step",      1, 0, 'H'},
   {"percent-grow",  1, 0, 'g'},
   {"default-rule",  1, 0, 'P'},
-  //{"interaction",   1, 0, 0},
+  {"dvi-dir",       1, 0, 'o'},
+  {"log-dir",       1, 0, 'l'},
+  {"aux-dir",       1, 0, 'a'},
   {"showhex",       0, 0, 'w'},
   {"verbose",       0, 0, 'v'},
   {"patterns",      0, 0, 'p'},
@@ -2481,9 +2499,6 @@ static struct option long_options[] =
   {"trace",         0, 0, 't'},
   {"help",          0, 0, '?'},
   {"usage",         0, 0, 'u'},
-  {"dvi-dir",       1, 0, 'o'},
-  {"log-dir",       1, 0, 'l'},
-  {"aux-dir",       1, 0, 'a'},
   {NULL,            0, 0, 0}
 };
 
@@ -2687,6 +2702,7 @@ int analyze_flag (int c, char *optarg)
         xchrfile = xstrdup("xchr.map");
       else
         xchrfile = xstrdup(optarg);
+
       if (xchrfile == NULL || *xchrfile == '\0')
         complainarg(c, optarg);
       break;
@@ -2695,15 +2711,16 @@ int analyze_flag (int c, char *optarg)
         replfile = xstrdup("repl.key");
       else
         replfile = xstrdup(optarg);
+
       if (replfile == NULL || *replfile == '\0')
         complainarg(c, optarg);
       break;
-/* more obscure stuff - ppssibly recycle */
     case 'P':
       if (optarg == 0)
-        default_rule = 26214; /* 95/Oct/9 */
+        default_rule = 26214;
       else
-        default_rule = atoi(optarg); /* 95/Oct/9 */
+        default_rule = atoi(optarg);
+
       if (default_rule == 0)
         complainarg(c, optarg);
       break;
@@ -2771,19 +2788,18 @@ void strip_name (char *pathname)
 {
   char *s;
 
-  if ((s = strrchr(pathname, '\\')) != NULL);
-  else if ((s = strrchr(pathname, '/')) != NULL);
-  else if ((s = strrchr(pathname, ':')) != NULL) s++;
-  else s = pathname;
+  if ((s = strrchr(pathname, '\\')) != NULL)
+    ;
+  else if ((s = strrchr(pathname, '/')) != NULL)
+    ;
+  else if ((s = strrchr(pathname, ':')) != NULL)
+    s++;
+  else
+    s = pathname;
 
   *s = '\0';
 }
 
-char *programpath = ""; /* pathname of program */
-
-/* The following does not deslashify arguments ? Do we need to ? */
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
-/* try and read commands on command line */
 int read_command_line (int ac, char **av)
 { 
   int c;
@@ -2805,9 +2821,9 @@ int read_command_line (int ac, char **av)
 
   if (show_use || quitflag == 3)
   {
-    //stamp_it(log_line);
-    //strcat(log_line, "\n");
-    //show_line(log_line, 0);
+    stamp_it(log_line);
+    strcat(log_line, "\n");
+    show_line(log_line, 0);
     //stampcopy(log_line);
     //strcat(log_line, "\n");
     //show_line(log_line, 0);
@@ -2908,10 +2924,8 @@ int init_commands (int ac, char **av)
   mem_extra_low  = 0;
   mem_initex     = 0;
 
-  programpath = xstrdup(av[0]); /* extract path executable */
-  strip_name(programpath);      /* strip off yandytex.exe */
-
-  format_name = "plain"; /* format name if specified on command line */
+  //format_name = xstrdup(av[0]);
+  format_name = "plain";
 
   encoding_name = "";
 
@@ -2935,7 +2949,7 @@ int init_commands (int ac, char **av)
 /*  then makes no sense to avoid them separately for TFM files ... */
 /*  (that is, the ./ is already omitted from the dir list in that case */
   if (!current_flag && !current_tfm)
-    current_tfm = true; /* 94/Jan/24 */
+    current_tfm = true;
 
   return 0;
 }
@@ -3211,9 +3225,6 @@ int main_init (int ac, char **av)
 
   kpse_set_program_name(av[0], NULL);
 
-  // compile time test
-  // MSVC: __int64 8bytes
-  // GCC:  long    8bytes
   if (sizeof(memory_word) != sizeof(integer) * 2)
   {
     sprintf(log_line, "ERROR: Bad word size %d!\n", sizeof(memory_word));
@@ -3226,7 +3237,7 @@ int main_init (int ac, char **av)
   initbuffer[0] = '\0';         /* paranoia 94/Apr/10 */
 
 /*  reset all allocatable memory pointers to NULL - in case we drop out */
-  mainmemory = NULL;
+  main_memory = NULL;
   font_info = NULL;
   str_pool = NULL;
   str_start = NULL;
@@ -3236,7 +3247,7 @@ int main_init (int ac, char **av)
 #endif
 
 #ifdef ALLOCATEBUFFER
-  buffer = NULL;        /* new 1999/Jan/7 need to do early */
+  buffer = NULL;
   current_buf_size = 0;
   buffer = realloc_buffer (initial_buf_size);
 #endif
@@ -3268,12 +3279,11 @@ int main_init (int ac, char **av)
     reorderargs(ac, av);  
 
   if (init_commands(ac, av))
-    return -1;          // failure
+    return -1;
 
-  check_fixed_align(trace_flag);       /* sanity check 1994/Jan/8 */
+  check_fixed_align(trace_flag);
 
   format_file   = NULL;
-  string_file   = NULL;
   source_direct = NULL;
   dvi_file_name = NULL;
   log_file_name = NULL;
@@ -3289,7 +3299,7 @@ int main_init (int ac, char **av)
   overfull_vbox     = 0;
   underfull_vbox    = 0;
 
-  closed_already=0;        // so can only do once
+  closed_already = 0;
 
   if (trace_flag)
     show_line("Entering init (local)\n", 0);
@@ -3314,13 +3324,13 @@ int main_init (int ac, char **av)
   if (allocate_memory() != 0)   /* NOW, try and ALLOCATE MEMORY if needed */
     return -1;         // if failed to allocate
 
-/*   following is more or less useless since most all things not yet alloc */
-   check_alloc_align(trace_flag);    /* sanity check 1994/Jan/8 */
+  /* following is more or less useless since most all things not yet alloc */
+  check_alloc_align(trace_flag);    /* sanity check 1994/Jan/8 */
 
   if (trace_flag)
     show_line("Leaving init (local)\n", 0);
 
-  return 0;         // success
+  return 0;
 }
 
 #define CLK_TCK  CLOCKS_PER_SEC
@@ -3356,12 +3366,9 @@ void show_inter_val (clock_t interval)
         show_line(log_line, 0);
       }
       else
-        show_line("0", 0);          /* 95/Mar/1 */
+        show_line("0", 0);
 }
 
-/* final cleanup opportunity */
-/* flag is non-zero if error exit */
-/* shows various times, warning about missing chars */
 int endit (int flag)
 {
   finish_time = clock();
@@ -3399,8 +3406,6 @@ int endit (int flag)
     show_line("\n", 0);
   }
 
-  //checkpause(flag);
-
   return flag;
 }
 // printf control sequences' name
@@ -3435,7 +3440,7 @@ void print_cs_name (FILE *output, int h)
 
 }
 // prototype
-int compare_strn (int, int, int, int); /* in tex9.c */
+int compare_strn (int, int, int, int);
 /* compare two csnames in qsort */
 int compare_cs (const void *cp1, const void *cp2)
 {
@@ -3457,7 +3462,7 @@ char * csused = NULL;
 
 /* Allocate table of indeces to allow sorting on csname */
 /* Allocate flags to remember which ones already listed at start */
-/* pass = 0 --> fmt */
+/* pass = 0 --> fmt   */
 /* pass = 1 --> after */
 void print_cs_names (FILE *output, int pass)
 {
@@ -3511,7 +3516,7 @@ void print_cs_names (FILE *output, int pass)
       fprintf(output, log_line);
   }
 
-  if (ccount > 0) /* don't bother to get into trouble */
+  if (ccount > 0)
   {
     cnumtable = (int *) malloc (ccount * sizeof(int));
 
@@ -3519,7 +3524,7 @@ void print_cs_names (FILE *output, int pass)
       return;
 
     ccount = 0;
-/*    for (h = 515; h < (hash_size + 780); h++) { */
+
     for (h = hash_base + 1; h < nfcs; h++)
     {
       if (pass == 1 && csused[h])
@@ -3670,8 +3675,8 @@ int decode_fourty (unsigned long checksum, char *codingvector)
       }
       codingvector[6] = '\0';
     }
-/*  sprintf(log_line, "Reconstructed vector %s\n", codingvector); */
-  return 0;         /* encoding info returned in codingvector */
+
+  return 0;
 }
 
 double sclpnt (long x)
@@ -3774,26 +3779,4 @@ void show_font_info (void)
   }
 
   free((void *)fnumtable);
-}
-
-/*  NOTE: current_tfm = false (-c)
-  not checking for TFM in current directory saves 0.1 sec
-  (0.2 if file_method = false (-G) */
-
-/*  NOTE: test_dir_access = false (-b):
-  not checking whether readable file is a directory saves maybe 0.5 sec
-  BUT only if file_method = false (-G) - otherwise its irrelevant */
-
-/*  NOTE: dir_method = false (-D) --- method for checking whether directory
-  using fopen instead of _findfirst in dir_p slows job maybe 0.05 sec
-  BUT not if current_tfm = false (-c) */
-
-/*  NOTE: file_method = false (-G) --- method for checking file accessible
-  using _access (readable) instead of _findfirst (file_p) costs 0.5 sec */
-
-/*  Fast flag combinations: nothing, bG, bcG, bcDG */
-
-/* buffercopy no longer used */
-
-/* To Knuthian reset right when command line interpreted */
-
+}
\ No newline at end of file
index 1b78c00..4b5ee16 100644 (file)
@@ -230,7 +230,7 @@ bool open_input (FILE **f, path_constant_type path_index, char *fopen_mode)
     strcpy ((char *) name_of_file + 1, file_name);
     *f = xfopen((char *) file_name, fopen_mode);
 
-#ifdef MSDOS
+#ifdef _WIN32
     if (name_of_file[1] == '.' && (name_of_file[2] == PATH_SEP || name_of_file[2] == '\\'))
 #else
     if (name_of_file[1] == '.' && name_of_file[2] == PATH_SEP)
index df2b9ea..89e2e21 100644 (file)
@@ -2118,7 +2118,7 @@ void open_log_file (void)
   old_setting = selector;
 
   if (job_name == 0)
-    job_name = 790;   /* default:  texput */
+    job_name = 790;
 
   pack_job_name(".log");
 
@@ -2133,31 +2133,29 @@ void open_log_file (void)
   log_opened = true;
 
   {
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
-  if (want_version)
-  {
-    stamp_it(log_line);         // ??? use log_line ???
-    strcat(log_line, "\n");
-    (void) fputs(log_line, log_file);
-    stampcopy(log_line);
-    strcat(log_line, "\n");
-    (void) fputs(log_line, log_file);
-  }
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
-/*  also change following in itex.c - bkph */
-  (void) fputs(tex_version, log_file); 
-  (void) fprintf(log_file, " (%s %s)", application, yandyversion);
+    if (want_version)
+    {
+      stamp_it(log_line);
+      strcat(log_line, "\n");
+      (void) fputs(log_line, log_file);
+      stampcopy(log_line);
+      strcat(log_line, "\n");
+      (void) fputs(log_line, log_file);
+    }
+    
+    (void) fputs(tex_version, log_file); 
+    (void) fprintf(log_file, " (%s %s)", application, yandyversion);
 
-  if (format_ident > 0)
-    slow_print(format_ident);     /* bkph */
+    if (format_ident > 0)
+      slow_print(format_ident);
+
+    print_string("  ");
+
+    if (civilize_flag)
+      print_int(year);
+    else
+      print_int(day);
 
-  print_string("  ");
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
-  if (civilize_flag)
-    print_int(year);
-  else
-    print_int(day);
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
     print_char(' ');
     months = " JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC";
 
@@ -2165,16 +2163,16 @@ void open_log_file (void)
       (void) putc(months[k],  log_file);
 
     print_char(' ');
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
+
     if (civilize_flag)
       print_int(day);
     else
       print_int(year);
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
+
     print_char(' ');
-    print_two(tex_time / 60);  /* hour */
+    print_two(tex_time / 60);
     print_char(':');
-    print_two(tex_time % 60);  /* minute */
+    print_two(tex_time % 60);
   }
 
   input_stack[input_ptr] = cur_input;
@@ -2188,122 +2186,107 @@ void open_log_file (void)
     print(buffer[k]);
 
   print_ln(); 
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
-/* a good place to show the fmt file name or pool file name ? 94/June/21 */
+
   if (show_fmt_flag)
   {
-    if (string_file != NULL)
-    {
-      fprintf(log_file, "(%s)\n", string_file);
-      free(string_file);  /* this was allocated by strdup in openinou */
-      string_file = NULL;   /* for safety */
-    }
-
     if (format_file != NULL)
     {
       fprintf(log_file, "(%s)\n", format_file);
-      free(format_file);  /* this was allocated by strdup in openinou */
-      format_file = NULL;   /* for safety */
+      free(format_file);
+      format_file = NULL;
     }
   }
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
+
   selector = old_setting + 2;
 }
 
 /**************************** start of insertion 98/Feb/7 **************/
-
 // Attempt to deal with foo.bar.tex given as foo.bar on command line
 // Makes copy of job_name with extension
 
-void morenamecopy(ASCII_code c)
+void more_name_copy(ASCII_code c)
 {
 #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 */
+  if (pool_ptr + 1 > current_pool_size)
   {
-    overflow("pool size", current_pool_size - init_pool_ptr); /* 97/Mar/7 */
-    return;     // abort_flag set
+    overflow("pool size", current_pool_size - init_pool_ptr);
+    return;
   }
 #else
   if (pool_ptr + 1 > pool_size)
   {
-    overflow("pool size", pool_size - init_pool_ptr); /* pool size */
-    return;     // abort_flag set
+    overflow("pool size", pool_size - init_pool_ptr);
+    return;
   }
 #endif
+
   str_pool[pool_ptr] = c; 
   incr(pool_ptr);
 }
 
-int endnamecopy(void)
+int end_name_copy(void)
 {
 #ifdef ALLOCATESTRING
-    if (str_ptr + 1 > current_max_strings)
-      str_start = realloc_str_start(increment_max_strings + 1);
+  if (str_ptr + 1 > current_max_strings)
+    str_start = realloc_str_start(increment_max_strings + 1);
 
-    if (str_ptr + 1 > current_max_strings) /* in case it failed 94/Jan/24 */
-    {
-      overflow("number of strings", current_max_strings - init_str_ptr);  /* 97/Mar/7 */
-      return 0;     // abort_flag set
-    }
+  if (str_ptr + 1 > current_max_strings)
+  {
+    overflow("number of strings", current_max_strings - init_str_ptr);
+    return 0;
+  }
 #else
-    if (str_ptr + 1 > max_strings)
-    {
-      overflow("number of strings", max_strings - init_str_ptr); /* number of strings */
-      return 0;     // abort_flag set
-    }
+  if (str_ptr + 1 > max_strings)
+  {
+    overflow("number of strings", max_strings - init_str_ptr);
+    return 0;
+  }
 #endif
-    return make_string();
+
+  return make_string();
 }
 
-/* add extension to job_name */
-void jobnameappend (void)
+void job_name_append (void)
 { 
   int k, n;
-/*  copy job_name */
+
   k = str_start[job_name];
   n = str_start[job_name + 1];
 
   while (k < n)
-    morenamecopy(str_pool[k++]);
-/*  copy `extension' */
+    more_name_copy(str_pool[k++]);
+
   k = str_start[cur_ext];
   n = str_start[cur_ext + 1];
 
   while (k < n)
-    morenamecopy(str_pool[k++]);
+    more_name_copy(str_pool[k++]);
 
-  job_name = endnamecopy();
+  job_name = end_name_copy();
 }
 
 /**************************** end of insertion 98/Feb/7 **************/
 /* sec 0537 */
-void start_input (void)
+void start_input(void)
 {
-  bool addedextension = false;
+  bool added_extension = false;
 
   scan_file_name();
   pack_file_name(cur_name, cur_area, cur_ext); 
 
-  while (true)        /* loop until we get a valid file name */
+  while (true)
   {
-    addedextension = false;
+    added_extension = false;
     begin_file_reading(); 
-/* *** *** *** *** *** following is new in 3.14159 *** *** *** *** *** *** */
-/*  if current extension is *not* empty, try to open using name as is */
-/*  string 335 is "" the empty string */
-/*  should be updated to current Kpathsea. */
+
     if ((cur_ext != 335) && a_open_in(input_file[cur_input.index_field], TEXINPUTPATH))
       goto lab30;
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
-/*  we get here if extension is "", or file with extension failed to open */
-/*  if current extension is not `tex,' and `tex' is not irrelevant, try it */
-/*  string 785 is .tex */
+
     if ((cur_ext != 785) && (name_length + 5 < PATHMAX))
     {
-      //strcpy(name_of_file + name_length + 1, ".tex ");
       name_of_file[name_length + 1] = '.';
       name_of_file[name_length + 2] = 't';
       name_of_file[name_length + 3] = 'e';
@@ -2311,57 +2294,53 @@ void start_input (void)
       name_of_file[name_length + 5] = ' ';
       name_length = name_length + 4;
 
-      addedextension = true;
+      added_extension = true;
 
       if (a_open_in(input_file[cur_input.index_field], TEXINPUTPATH))
         goto lab30;
 
-      name_length = name_length - 4;      /* strip extension again */
-      name_of_file[name_length + 1] = ' ';  /* ' ' */
-      addedextension = false;
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
+      name_length = name_length - 4;
+      name_of_file[name_length + 1] = ' ';
+      added_extension = false;
     }
-/* *** *** *** *** major changes here in 3.14159 *** *** *** *** *** *** */
-/*  string 335 is "" the empty string */
+
     if ((cur_ext == 335) && a_open_in(input_file[cur_input.index_field], TEXINPUTPATH))
       goto lab30;
 
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
     end_file_reading();
     prompt_file_name("input file name", ".tex");
-  }   /* end of while(true)trying to get valid file name */
+  }
 
-/* maybe set  pseudo_tilde = 0  at this point ? 95/Sep/26 */
 lab30: 
   cur_input.name_field = a_make_name_string(input_file[cur_input.index_field]);
 
-  if (job_name == 0)       /* only the first time */
+  if (job_name == 0)
   {
-    job_name = cur_name;        /* here we set the job_name */
-/*  did file name have an `extension' already and we added ".tex" ? */
-    if (cur_ext != 335 && addedextension)     /* 98/Feb/7 */
-      jobnameappend();   /* append `extension' to job_name */
+    job_name = cur_name;
+
+    if (cur_ext != 335 && added_extension)
+      job_name_append();
 
     open_log_file();
   }
 
-  if (term_offset + length(cur_input.name_field) > max_print_line - 2) /* was 3 ? */
+  if (term_offset + length(cur_input.name_field) > max_print_line - 2)
     print_ln();
   else if ((term_offset > 0) || (file_offset > 0))
     print_char(' ');
 
   print_char('(');
-//  print_char('@');       // debugging only marker
   incr(open_parens);
 
   if (open_parens > max_open_parens)
-    max_open_parens = open_parens;    /* 1999/Jan/17 */
+    max_open_parens = open_parens;
 
   slow_print(cur_input.name_field);
-//  print_char('@');       // debugging only marker
+
 #ifndef _WINDOWS
   fflush(stdout);
 #endif
+
   cur_input.state_field = new_line;
 
   {
@@ -2385,7 +2364,7 @@ lab30:
 /* show TEXFONTS=... or format specific  */
 /* only show this if name was not fully qualified ? */
 void show_tex_fonts (void)
-{     /* 98/Jan/28 */
+{
   char *s, *t, *v, *u;
   int n;
 
@@ -2425,9 +2404,6 @@ void show_tex_fonts (void)
 
   print_char(')');
 }
-
-/**********************************************************************/
-/* called only from tex8.c */
 /* sec 0560 */
 internal_font_number read_font_info_(halfword u, str_number nom, str_number aire, scaled s)
 {
@@ -2987,14 +2963,14 @@ lab45:;
           font_info[param_base[f] + k - 1].cint = sw - alpha;
         else goto lab11;
       }
-/*  use test_eof() here instead ? */
+
     if (feof(tfm_file))
       goto lab11;
 
     for (k = np + 1; k <= 7; k++)
       font_info[param_base[f] + k - 1].cint = 0;
   }
-/* @<Make final adjustments...@>= l.11174 */
+
   if (np >= 7)
     font_params[f] = np;
   else
@@ -3006,7 +2982,7 @@ lab45:;
   if (bchlabel < nl)
     bchar_label[f] = bchlabel + lig_kern_base[f];
   else
-    bchar_label[f]= non_address; /* i.e. 0 --- 96/Jan/15 */
+    bchar_label[f] = non_address;
 
   font_bchar[f] = bchar;
   font_false_bchar[f] = bchar;
@@ -3024,7 +3000,7 @@ lab45:;
   font_area[f] = aire;
   font_bc[f] = bc;
   font_ec[f] = ec;
-  font_glue[f] = 0;  /* font_glue[f]:=null; l.11184 */
+  font_glue[f] = 0;
   char_base[f] = char_base[f];
   width_base[f] = width_base[f];
   lig_kern_base[f] = lig_kern_base[f];
@@ -3035,11 +3011,12 @@ lab45:;
   font_ptr = f;
   g = f;
   goto lab30;
+
 lab11:
   print_err("Font ");
   sprint_cs(u); 
   print_char('=');
-  print_file_name(nom, aire, 335);  /* "" */
+  print_file_name(nom, aire, 335);
 
   if (s >= 0)
   {
@@ -3058,10 +3035,10 @@ lab11:
   else
     print_string(" not loadable: Metric (TFM) file not found");
 
-  if (aire == 335) /* "" only if path not specified */
+  if (aire == 335)
   {
     if (show_texinput_flag)
-      show_tex_fonts();   /* 98/Jan/31 */
+      show_tex_fonts();
   }
 
   help5("I wasn't able to read the size data for this font,",
@@ -3070,6 +3047,7 @@ lab11:
       "You might try inserting a different font spec;",
       "e.g., type `I\\font<same font id>=<substitute font name>'.");
   error();
+
 lab30:
   if (fileopened)
     b_close(tfm_file);
index ebe4d68..56f15c2 100644 (file)
@@ -527,7 +527,6 @@ void make_fraction_(halfword q)
   new_hlist(q) = hpack(x, 0, 1);
 }
 /***************************************************************************/
-/* moved to end to avoid questions about pragma optimize 96/Sep/12 */
 scaled make_op_ (halfword);
 /***************************************************************************/
 /* sec 0752 */
@@ -639,7 +638,6 @@ lab20:
       }
 }
 /***************************************************************************/
-/* moved to end to avoid questions about pragma optimize 96/Sep/12 */
 void make_scripts_ (halfword, scaled);
 /***************************************************************************/
 /* sec 0762 */
@@ -1461,8 +1459,6 @@ void init_col (void)
     begin_token_list(u_part(cur_align), u_template);
   }
 }
-/* fin_col() moved to end to hide in pragma (g, "off") */
-/* may need to move more ? everything calling new_null_box() ? */
 /* sec 0799 */
 void fin_row (void)
 {
@@ -2078,10 +2074,6 @@ bool fin_col (void)
 
   return false;
 }
-/* #pragma optimize ("g", on) */        /* for MC VS compiler */
-/* #pragma optimize ("g",) */         /* 94/Jan/25 */
-/* #pragma optimize ("", on) */           /* 96/Sep/12 */
-/* #pragma optimize("g", off) */          /* for MC VS compiler */
 /* sec 0749 */
 scaled make_op_(halfword q)
 {
@@ -2190,10 +2182,6 @@ scaled make_op_(halfword q)
 
   return delta;
 }
-/* #pragma optimize ("g", on) */        /* for MC VS compiler */
-/* #pragma optimize ("g",) */         /* 94/Jan/25 */
-/* #pragma optimize ("", on) */           /* 96/Sep/12 */
-/* #pragma optimize ("g", off) */
 /* sec 0756 */
 void make_scripts_(halfword q, scaled delta)
 {
@@ -2304,7 +2292,4 @@ void make_scripts_(halfword q, scaled delta)
 
     link(p) = x;
   }
-}
-/* #pragma optimize ("g", on) */        /* 96/Sep/12 */
-/* #pragma optimize ("g") */          /* 94/Jan/25 */
-/* #pragma optimize ("", on) */           /* 96/Sep/12 */
\ No newline at end of file
+}
\ No newline at end of file
index 6b3d0fb..f4c93a0 100644 (file)
@@ -52,7 +52,6 @@ lab20:
     init_col();
   }
 }
-/* used in itex.c only */
 /* sec 0826 */
 halfword finite_shrink_(halfword p)
 {
@@ -903,7 +902,6 @@ lab31:
 
   prev_graf = best_line - 1;
 }
-/* Reconstitute ligatures during hyphenation pass */
 /* sec 0906 */
 small_number reconstitute_(small_number j, small_number n, halfword bchar, halfword hchar)
 {
@@ -1167,7 +1165,6 @@ lab30:
 
   return j;
 }
-/* #pragma optimize ("g", off) */ /* not needed for MSVC it seems ... */
 /* sec 0895 */
 void hyphenate (void)
 {
@@ -1507,8 +1504,6 @@ lab50:
   link(s) = q;
   flush_list(init_list);
 }
-/* #pragma optimize ("g", off) */ /* not needed for MSVC it seems ... */
-/* used only in itex.c */
 /* sec 0934 */
 void new_hyph_exceptions (void)
 {
@@ -1881,7 +1876,6 @@ lab45:
 lab30:
   return best_place;
 }
-/* called only from tex7.c */
 /* sec 0977 */
 halfword vsplit_(eight_bits n, scaled h)
 {
@@ -2052,7 +2046,6 @@ void ensure_vbox_(eight_bits n)
       box_error(n);
     }
 }
-/* called only from tex7.c */
 /* sec 1012 */
 void fire_up_(halfword c)
 {
@@ -2325,5 +2318,4 @@ void fire_up_(halfword c)
     ship_out(box(255));
     box(255) = 0;
   }
-}
-/* used to continue here with build_page etc in tex6.c */
\ No newline at end of file
+}
\ No newline at end of file
index f51e18d..e4a40a2 100644 (file)
@@ -19,7 +19,6 @@
 
 #include "texd.h"
 
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
 /* sec 0994 */
 void build_page (void)
 {
@@ -437,7 +436,6 @@ void app_space (void)
   link(tail) = q;
   tail = q;
 }
-/* called from tex8.c only */
 /* sec 1047 */
 void insert_dollar_sign (void)
 {
@@ -615,7 +613,6 @@ void off_save (void)
     error();
   }
 }
-/* only called from tex8.c */
 /* sec 1069 */
 void extra_right_brace (void)
 {
@@ -738,7 +735,6 @@ void box_end_(integer box_context)
     else
       ship_out(cur_box);
 }
-/* called only from tex8.c */
 /* sec 1079 */
 void begin_box_(integer box_context)
 {
@@ -950,7 +946,6 @@ void new_graf_(bool indented)
   if (nest_ptr == 1)
     build_page();
 }
-/* procedure indent_in_hmode; l.21058 */
 /* sec 1093 */
 void indent_in_hmode (void)
 {
@@ -974,7 +969,6 @@ void indent_in_hmode (void)
     tail_append(p);
   }
 }
-/* only called from tex8.c */
 /* sec 1095 */
 void head_for_vmode (void)
 {
@@ -1014,7 +1008,6 @@ void end_graf (void)
     error_count = 0;
   }
 }
-/* only called form tex8.c */
 /* sec 1099 */
 void begin_insert_or_adjust (void)
 {
@@ -1066,7 +1059,6 @@ void append_penalty (void)
   if (mode == vmode)
     build_page();
 }
-/* only called from tex8.c */
 /* sec 1105 */
 void delete_last (void)
 {
@@ -1119,8 +1111,6 @@ void delete_last (void)
       }
   }
 }
-/* only called from tex8.c */
-/* procedure unpackage; l.21256 */
 /* sec 1110 */
 void unpackage (void)
 {
@@ -1203,7 +1193,6 @@ void append_discretionary (void)
     space_factor = 1000;
   }
 }
-/* only called form tex8.c */
 /* sec 1119 */
 void build_discretionary (void)
 {
@@ -1294,7 +1283,6 @@ lab30:
   mode = -hmode;
   space_factor = 1000;
 }
-/* called only from tex8.c */
 /* sec 1123 */
 void make_accent (void)
 {
@@ -1416,7 +1404,6 @@ void noalign_error (void)
       "an alignment. Proceed, and I'll ignore this case.");
   error();
 }
-/* only called from tex8.c */
 /* sec 1129 */
 void omit_error (void)
 {
@@ -1452,7 +1439,6 @@ void do_endv (void)
   else
     off_save();
 }
-/* only called form tex8.c */
 /* sec 1135 */
 void cs_error (void)
 {
@@ -1997,9 +1983,6 @@ void sub_sup (void)
   }
   scan_math(p);
 }
-/* used to continue here with math_fraction etc in tex7.c */
-/*****************************************************************************/
-/* moved down here to avoid pragma optimize questions 96/Sep/12 */
 /* sec 1086 */
 void package_(small_number c)
 {
@@ -2030,7 +2013,7 @@ void package_(small_number c)
       height(cur_box) = h;
     }
   }
+
   pop_nest();
   box_end(saved(0));
-}
-//#pragma optimize ("", on)           /* 96/Sep/12 */
\ No newline at end of file
+}
\ No newline at end of file
index c4b894f..2537658 100644 (file)
@@ -62,7 +62,7 @@ void math_fraction (void)
       scan_delimiter(right_delimiter(incompleat_noad), false);
     }
 
-    switch(c % delimited_code)
+    switch (c % delimited_code)
     {
       case above_code:
         scan_dimen(false, false, false);
@@ -291,7 +291,8 @@ void after_math (void)
 
     if (w + q > z)
     {
-      if ((e != 0) && ((w - total_shrink[normal] + q <= z) || (total_shrink[fil] != 0) || (total_shrink[fill] != 0) || (total_shrink[filll] != 0)))
+      if ((e != 0) && ((w - total_shrink[normal] + q <= z) || (total_shrink[fil] != 0) ||
+        (total_shrink[fill] != 0) || (total_shrink[filll] != 0)))
       {
         free_node(b, box_node_size);
         b = hpack(p, z - q, 0);
@@ -428,7 +429,7 @@ lab20:
     {
       get_token();
     }
-    while (!(cur_tok != space_token));
+  while (!(cur_tok != space_token));
 
   if ((cur_cs == 0) || (cur_cs > frozen_control_sequence))
   {
@@ -492,7 +493,7 @@ void do_register_command_ (small_number a)
     p = cur_chr;
     scan_eight_bit_int();
 
-    switch(p)
+    switch (p)
     {
       case int_val:
         l = cur_val + count_base;
@@ -511,8 +512,8 @@ void do_register_command_ (small_number a)
         break;
     }
   }
-lab40:;
 
+lab40:
   if (q == tex_register)
     scan_optional_equals();
   else
@@ -629,7 +630,6 @@ lab40:;
       eq_define(l, glue_ref, cur_val);
   }
 }
-/* called only from itex.c */
 /* sec 1243 */
 void alter_aux (void)
 {
@@ -672,7 +672,7 @@ void alter_prev_graf (void)
   nest[nest_ptr] = cur_list;
   p = nest_ptr;
 
-  while(abs(nest[p].mode_field) != vmode)
+  while (abs(nest[p].mode_field) != vmode)
     decr(p);
 
   scan_optional_equals();
@@ -756,7 +756,7 @@ void new_font_(small_number a)
   else
   {
     old_setting = selector;
-    selector = 21;
+    selector = new_string;
     print_string("FONT");
     print(u - active_base);
     selector = old_setting;
@@ -787,7 +787,7 @@ void new_font_(small_number a)
       help2("I can only handle fonts at positive sizes that are",
         "less than 2048pt, so I've changed what you said to 10pt.");
       error();
-      s = 10 * 65536L;    /* 10pt */
+      s = 10 * 65536L;
     }
   }
   else if (scan_keyword("scaled"))
@@ -810,7 +810,7 @@ void new_font_(small_number a)
 
   flushable_string = str_ptr - 1;
 
-  if (trace_flag) /* debugging stuff only 98/Oct/5 */
+  if (trace_flag)
   {
     int i, k1, k2, l1, l2;
     char *sch = log_line;
@@ -863,7 +863,7 @@ void new_font_(small_number a)
       }
       else if (font_size[f] == xn_over_d(font_dsize[f], - (integer) s, 1000))
       {
-        if (ignore_frozen == 0 || f > frozen_font_ptr) /* 99/Mar/26 */
+        if (ignore_frozen == 0 || f > frozen_font_ptr)
         {
           if (trace_flag)
           {
@@ -955,30 +955,24 @@ void open_or_close_in (void)
     scan_file_name();
     pack_file_name(cur_name, cur_area, cur_ext);
 
-/* *** some changes in following in 3.14159 *** */
-/*  if current extension is *not* empty, try to open using name as is */
-/*  string 335 is "" the empty string */
     if ((cur_ext != 335) && a_open_in(read_file[n], TEXINPUTPATH))
       read_open[n] = 1;
-/*  we get here if extension is "", or file with extension failed to open */
-/*  if current extension is not `tex,' and `tex' is not irrelevant, try it */
-/*  string 785 is  .tex */
     else if ((cur_ext != 785) && (name_length + 5 < PATHMAX))
-      {
-        strncpy((char *) name_of_file + name_length + 1, ".tex ", 5);
-        name_length = name_length + 4;
+    {
+      strncpy((char *) name_of_file + name_length + 1, ".tex ", 5);
+      name_length = name_length + 4;
 
-        if (a_open_in(read_file[n], TEXINPUTPATH))
-          read_open[n] = just_open;
-        else
-        {
-          name_length = name_length - 4;      /* remove ".tex" again */
-          name_of_file[name_length + 1] = ' ';
+      if (a_open_in(read_file[n], TEXINPUTPATH))
+        read_open[n] = just_open;
+      else
+      {
+        name_length = name_length - 4;
+        name_of_file[name_length + 1] = ' ';
 
-          if ((cur_ext == 335) && a_open_in(read_file[n], TEXINPUTPATH))
-            read_open[n] = 1;
-        }
+        if ((cur_ext == 335) && a_open_in(read_file[n], TEXINPUTPATH))
+          read_open[n] = 1;
       }
+    }
   }
 }
 /* sec 1279 */
@@ -1072,7 +1066,7 @@ void show_whatever (void)
 {
   halfword p;
 
-  switch(cur_chr)
+  switch (cur_chr)
   {
     case show_lists:
       {
@@ -1201,9 +1195,7 @@ void new_write_whatsit_(small_number w)
 /* sec 1348 */
 void do_extension (void)
 {
-/*  integer i, j, k;  */
   integer k;
-/*  halfword p, q, r;  */
   halfword p;
 
   switch(cur_chr)
index c62eedd..aa5e665 100644 (file)
@@ -122,7 +122,7 @@ EXTERN integer max_buf_stack;
 /* free the limit on font memory ! */ /* (2^32 - 1) / sizeof(memory_word) */
 #ifdef ALLOCATEFONT
 /* #define font_mem_size 262140L */
-  #define font_mem_size (max_halfword / sizeof(memory_word) -1)
+  #define font_mem_size (max_halfword / sizeof(memory_word) - 1)
 #else
   #define font_mem_size 100000L
 #endif
@@ -325,9 +325,8 @@ EXTERN halfword temp_ptr;
 
 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
 #ifdef ALLOCATEMAIN
-  EXTERN memory_word * mainmemory;   /* remembered so can be free() later */
-  EXTERN memory_word * zzzaa;
-  #define zmem zzzaa
+  EXTERN memory_word * main_memory;   /* remembered so can be free() later */
+  EXTERN memory_word * mem;
 #else
   /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
   EXTERN memory_word 
@@ -1043,8 +1042,7 @@ EXTERN int pseudo_space;
 EXTERN int allow_quoted_names;
 EXTERN int default_rule;
 EXTERN char * format_file;
-EXTERN char * source_direct;     /* 1998/Sep/29 */
-EXTERN char * string_file;
+EXTERN char * source_direct;
 EXTERN char * format_name;
 EXTERN char * encoding_name;
 EXTERN bool format_specific;
index b7d2113..be5c2d3 100644 (file)
@@ -118,7 +118,6 @@ void t_open_in (void)
   buffer[first] = 0;  /* In case there are no arguments.  */
 
 #ifdef MSDOS
-/* command line arguments? 94/Apr/10 */
   if (gargc > optind && optind > 0)
   {
     for (i = optind; i < gargc; i++)
@@ -634,31 +633,28 @@ void call_edit (ASCII_code *stringpool, pool_pointer fnstart, integer fnlength,
   unsigned int commandlen;
   ASCII_code *texfilename;
   ASCII_code *log_file_name;
-  pool_pointer lgstart;         /* 1994/Jan/94 */
-  integer lglength;           /* 1994/Jan/94 */
+  pool_pointer lgstart;
+  integer lglength;
 
-  if (log_opened)           /* 1994/Aug/10 */
+  if (log_opened)
   {
     lgstart = str_start[texmf_log_name];
     lglength = length(texmf_log_name);
     log_file_name = stringpool + lgstart;
   }
-  else                /* 1994/Aug/10 */
+  else
   {
     lglength = 0;
     log_file_name = (unsigned char *) "";
   }
 
   sdone = ddone = ldone = 0;
-/*  filename += fnstart; */
   texfilename = stringpool + fnstart;
 
-/*  Close any open input files, since we're going to kill the job.  */
-/*  and since the editor will need access to them... */
   for (i = 1; i <= in_open; i++)
     (void) fclose (input_file[i]);
 
-  n = fcloseall();            /* paranoia 1994/Aug/10 */
+  n = fcloseall();
 
   if (n > 0 && verbose_flag)
   {
@@ -666,12 +662,10 @@ void call_edit (ASCII_code *stringpool, pool_pointer fnstart, integer fnlength,
     show_line(log_line, 0);
   }
 
-/*  Replace the default with the value of the appropriate environment
-    variable, if it's set.  */
-/*  s = getenv (edit_var);   */   /* 93/Nov/20 */
   s = get_env_shroud (edit_var);  
+
   if (s != NULL)
-    edit_value = s;  /* OK, replace wired in default */
+    edit_value = s;
 
 /*  Construct the command string.  */
 /*  The `11' is the maximum length a 32 bit integer might be, plus one for null.  */
@@ -687,14 +681,17 @@ void call_edit (ASCII_code *stringpool, pool_pointer fnstart, integer fnlength,
 /*  remove quotes around [...] string for WinEdt ? */
 
   u = edit_value;
-  while ((c = *u++) != 0) {
-    if (c == '%') {         /* handle special codes */
+
+  while ((c = *u++) != 0)
+  {
+    if (c == '%')
+    {
       switch (c = *u++)
       {
         case 'd':
           if (ddone)
           {
-#ifdef MSDOS
+#ifdef _WIN32
             sprintf(log_line, "! bad command syntax (%c).\n", 'd');
             show_line(log_line, 1);
 #else
@@ -703,16 +700,19 @@ void call_edit (ASCII_code *stringpool, pool_pointer fnstart, integer fnlength,
 #endif
             uexit(1); 
           }
+
           (void) sprintf (s, "%d", linenumber);
+
           while (*s != '\0')
             s++;
-          ddone = 1;      /* indicate already used %d */
+
+          ddone = 1;
           break;
 
         case 's':
           if (sdone)
           {
-#ifdef MSDOS
+#ifdef __WIN32
             sprintf(log_line, "! bad command syntax (%c).\n", 's'); 
             show_line(log_line, 1);
 #else
@@ -721,25 +721,24 @@ void call_edit (ASCII_code *stringpool, pool_pointer fnstart, integer fnlength,
 #endif
             uexit(1); 
           }
+
           t = (char *) texfilename;
           n = fnlength;
 
-/* following modified to allow non ASCII - bkph */ /* for file names */
           if (non_ascii)
-/*        for (i = 0; i < fnlength; i++)  *s++ = xchr [filename[i]]; */
             for (i = 0; i < n; i++)
               *s++ = xchr [*t++];
           else
-/*        for (i = 0; i < fnlength; i++)  *s++ = (char) filename[i]; */
             for (i = 0; i < n; i++)
               *s++ = (char) *t++;
-          sdone = 1;      /* indicate already used %s */
+
+          sdone = 1;
           break;
 
-        case 'l':           /* 1994/Jan/28 */
+        case 'l':
           if (ldone)
           {
-#ifdef MSDOS
+#ifdef __WIN32
             sprintf(log_line, "! bad command syntax (%c).\n", 'l'); 
             show_line(log_line, 1);
 #else
@@ -748,38 +747,38 @@ void call_edit (ASCII_code *stringpool, pool_pointer fnstart, integer fnlength,
 #endif
             uexit(1); 
           }
+
           t = (char *) log_file_name;
-          n = lglength;       /* 1994/Jan/28 */
+          n = lglength;
 
-/* following modified to allow non ASCII - bkph */ /* for file names */
           if (non_ascii)
-/*      for (i = 0; i < fnlength; i++)  *s++ = xchr [filename[i]]; */
             for (i = 0; i < n; i++)
               *s++ = xchr [*t++];
           else
-/*      for (i = 0; i < fnlength; i++)  *s++ = (char) filename[i]; */
             for (i = 0; i < n; i++)
               *s++ = (char) *t++;
-          ldone = 1;      /* indicate already used %l */
+
+          ldone = 1;
           break;
 
-        case '\0':      /*  '%'  at end of line */
+        case '\0':
           *s++ = '%'; 
-          u--;  /* Back up to the null to force termination.  */
+          u--;
           break;
 
-        default:      /* something other than 's', 'd', 'l' follows */
+        default:
           *s++ = '%';
           *s++ = c;
           break;
       }
     }
-    else *s++ = c;      /* ordinary character pass it through */
+    else
+      *s++ = c;
   }
 
-  *s = 0;         /* terminate the command string */
+  *s = 0; /* terminate the command string */
 
-  if (strlen(command) + 1 >= commandlen) /* should not happen! */
+  if (strlen(command) + 1 >= commandlen)
   {
     sprintf(log_line, "Command too long (%d > %d)\n", strlen(command) + 1, commandlen);
     show_line(log_line, 1);
@@ -788,26 +787,25 @@ void call_edit (ASCII_code *stringpool, pool_pointer fnstart, integer fnlength,
 
   //flushall();
   fflush(NULL);
-/*  Try and execute the command.  */
-/*  There may be problem here with long names and spaces ??? */
-/*  Use _exec or _spawn instead ??? */
 
   if (system (command) != 0)
   {
     show_line("\n", 0);
-    sprintf(log_line, "! Error in call: %s\n", command); /* shroud ? */
+    sprintf(log_line, "! Error in call: %s\n", command);
     show_line(log_line, 1);
-/*    errno seems to be 0 typically, so perror says "no error" */
-#ifdef MSDOS
+
+#ifdef __WIN32
     if (errno != 0)
-      perrormod("! DOS says");      /* 94/Aug/10 - bkph */
+      perrormod("! DOS says");
 #endif
+
     sprintf(log_line, "  (TEXEDIT=%s)\n", edit_value);
     show_line(log_line, 0);
     show_line("  (Editor specified may be missing or path may be wrong)\n", 0);
     show_line("  (or there may be missing -- or extraneous -- quotation signs)\n", 0);
   }
-  uexit(1);       /*  Quit, since we found an error.  */
+
+  uexit(1);
 }
 
 \f
index 6afbede..886122e 100644 (file)
 #include <setjmp.h>
 #include <time.h>
 #include <signal.h>
-#ifdef MSDOS
-#include <kpathsea/win32lib.h>
-#include <conio.h>
-#define getch _getch
+#ifdef _WIN32
+  #include <kpathsea/win32lib.h>
 #else
-#include <unistd.h>
+  #include <unistd.h>
 #endif
 #include "hpdf.h"
 #include "hpdf_utils.h"