OSDN Git Service

pdf_set_rule.
[putex/putex.git] / src / texsourc / local.c
index 3193a79..5614c6d 100644 (file)
@@ -60,7 +60,7 @@ char log_line[MAXLINE];  // used also in tex9.c
 int mem_spec_flag     = 0;    /* non-zero if `-m=...' was used */ 
 int format_spec       = 0;    /* non-zero if a format specified on command line */
 int closed_already    = 0;    /* make sure we don't try this more than once */
-bool reorder_arg_flag = true; /* put command line flags/arguments first */
+boolean reorder_arg_flag = true; /* put command line flags/arguments first */
 
 /* Mapping from Windows ANSI to DOS code page 850 96/Jan/20 */
 /* Used in tex0.c with wintodos[c-128]                      */
@@ -714,7 +714,7 @@ int allocate_tries (int trie_max)
 #endif
 
 #ifdef ALLOCATEHYPHEN
-bool prime (int); /* test function later in this file */
+boolean prime (int); /* test function later in this file */
 
 int current_prime = 0; /* remember in case reallocated later */
 
@@ -1023,9 +1023,9 @@ memory_word *realloc_main (int losize, int hisize)
 int current_font_mem_size = 0;
 
 /* fmemoryword can be either halfword or memory_word */
-fmemoryword * realloc_font_info (int size)
+memory_word * realloc_font_info (int size)
 {
-  fmemoryword *newfontinfo = NULL;
+  memory_word *newfontinfo = NULL;
   int k, minsize;
   int newsize = 0;
   int n = 0;
@@ -1061,12 +1061,12 @@ fmemoryword * realloc_font_info (int size)
       newsize = font_mem_size; /* bump against limit */
 
 /*    important + 1 since fmemoryword font_info[font_mem_size + 1]  original */
-    n = (newsize + 1) * sizeof (fmemoryword);
+    n = (newsize + 1) * sizeof (memory_word);
 
     if (trace_flag)
       trace_memory("font_info", n);
 
-    newfontinfo = (fmemoryword *) REALLOC (font_info, n);
+    newfontinfo = (memory_word *) REALLOC (font_info, n);
 
     if (newfontinfo != NULL)
       break;   /* did we get it ? */
@@ -1091,7 +1091,7 @@ fmemoryword * realloc_font_info (int size)
     show_line(log_line, 0);
   }
 
-  update_statistics ((int) font_info, n, current_font_mem_size * sizeof(fmemoryword));
+  update_statistics ((int) font_info, n, current_font_mem_size * sizeof(memory_word));
   current_font_mem_size = newsize;
 
   if (trace_flag)
@@ -1265,7 +1265,7 @@ int allocate_ini (int size)
   nh = nr = nl = (size + 1) *  sizeof(trie_pointer);
   no = (size + 1) *  sizeof(trie_op_code);
   nc = (size + 1) *  sizeof(packed_ASCII_code);
-/*    nt = (size + 1) *  sizeof(bool); */
+/*    nt = (size + 1) *  sizeof(boolean); */
   nt = (size + 1) *  sizeof(char);
   n = nl + no + nc + nr + nh + nt;
 /*    n = (size + 1) * (sizeof(packed_ASCII_code) + sizeof(trie_op_code) +
@@ -1639,7 +1639,7 @@ ASCII_code *realloc_buffer (int size)
     show_line(log_line, 0);
   }
 
-  if (current_buf_size == buf_size)  /* arbitrary limit */
+  if (current_buf_size == buf_size)
   {
 /*    memory_error ("buffer", buf_size); */
 /*    exit (1); */
@@ -1661,7 +1661,7 @@ ASCII_code *realloc_buffer (int size)
     if (newsize > buf_size)
       newsize = buf_size;
 
-    n = (newsize + 1) * sizeof(ASCII_code);  /* buffer[buf_size + 1] */
+    n = (newsize + 1) * sizeof(ASCII_code);
 
     if (trace_flag)
       trace_memory("buffer", n);
@@ -1674,7 +1674,7 @@ ASCII_code *realloc_buffer (int size)
     if (current_buf_size == 0)
       break;   /* initial allocation must work */
 
-    size = size / 2;          /* else can retry smaller */
+    size = size / 2;
   }
 
   if (newbuffer == NULL)
@@ -1878,7 +1878,7 @@ int allocate_memory (void)
   {
     trie_l = trie_r = trie_o = trie_hash = NULL; /* (trie_size + 1) * integer */
     trie_c = NULL;       /* (trie_size + 1) * char */
-    trie_taken = NULL;     /* (trie_size + 1) * bool */
+    trie_taken = NULL;     /* (trie_size + 1) * boolean */
   }
 #endif
 #ifdef PREALLOCHOLE
@@ -2047,7 +2047,7 @@ int free_memory (void)
   return 0;
 }
 
-bool prime (int x)
+boolean prime (int x)
 {
   int k;
   int sum = 1;    /* 1 + 3 + 5 + k = (k + 1) * (k + 1) / 4 */
@@ -2070,8 +2070,8 @@ bool prime (int x)
 }
 
 int quitflag  = 0;
-bool show_use = false;
-bool floating = false;
+boolean show_use = false;
+boolean floating = false;
 
 void complainarg (int c, char *s)
 {
@@ -2350,9 +2350,9 @@ void check_alloc_align (int flag)
 #endif
 }
 
-bool backwardflag       = false;              /* don't cripple all advanced features */
-bool shorten_file_name  = false;              /* don't shorten file names to 8+3 for DOS */
-bool usesourcedirectory = true;               /* use source file directory as local when WorkingDirectory is set */             /* if working directory set in ini */
+boolean backwardflag       = false;              /* don't cripple all advanced features */
+boolean shorten_file_name  = false;              /* don't shorten file names to 8+3 for DOS */
+boolean usesourcedirectory = true;               /* use source file directory as local when WorkingDirectory is set */             /* if working directory set in ini */
 
 /* cache to prevent allocating twice in a row */
 
@@ -2458,7 +2458,7 @@ static struct option long_options[] =
   {"main-memory",   1, 0, 'm'},
   {"hyph-size",     1, 0, 'e'},
   {"trie-size",     1, 0, 'h'},
-  {"output-format", 1, 0, '0'},
+  {"backend",       1, 0, '0'},
   {"tab-step",      1, 0, 'H'},
   {"percent-grow",  1, 0, 'g'},
   {"default-rule",  1, 0, 'P'},
@@ -2506,8 +2506,8 @@ int analyze_flag (int c, char *optarg)
       interaction = error_stop_mode; /* tex mode */
       break;
     case 'K':
-      backwardflag = true; /* 94/Jun/15 */
-      knuthify();         /* revert to `standard' Knuth TeX */
+      backwardflag = true;
+      knuthify(); /* revert to `standard' Knuth TeX */
       break;
     case 'L':
       c_style_flag = true; /* C style error msg 94/Mar/21 */
@@ -2515,12 +2515,6 @@ int analyze_flag (int c, char *optarg)
     case 'Z':
       show_tfm_flag = true; /* show TFM in log file 94/Jun/21 */
       break;
-    case 'c':
-      current_tfm = false; /* not look current dir for TFM */
-      break;
-    case 'C':
-      current_flag = false; /* not look current dir for files */
-      break;
     case 'M':
       show_missing = false; /* do not show missing 94/June/10 */
       break;
@@ -2844,7 +2838,6 @@ int init_commands (int ac, char **av)
   open_trace_flag   = false;
   trace_flag        = false;
   verbose_flag      = false;
-  heap_flag         = false;
   restrict_to_ascii = false;
   show_in_hex       = false; /* default is not to show as hex code ^^ 00/Jun/18 */
   show_in_dos       = false; /* default is not to translate to DOS 850 */ 
@@ -2858,8 +2851,6 @@ int init_commands (int ac, char **av)
   civilize_flag     = true;
   show_numeric      = true;
   show_missing      = true;
-  current_flag      = true;
-  current_tfm       = true;  /* search for TFMs in current dir as well */
   c_style_flag      = false; /* use c-style error output */
   show_fmt_flag     = true;  /* show format file in log */
   show_tfm_flag     = false; /* don't show metric file in log */
@@ -2874,17 +2865,18 @@ int init_commands (int ac, char **av)
   allow_quoted_names    = true;  /* allow quoted names with spaces 98/Mar/15 */
   show_cs_names         = false; /* don't show csnames on start 98/Mar/31 */
   knuth_flag            = false; /* allow extensions to TeX */
-  cache_file_flag       = true;  /* default is to cache full file names 96/Nov/16 */
   full_file_name_flag   = true;  /* new default 2000 June 18 */
   save_strings_flag     = true;
   errout                = stdout; /* as opposed to stderr say --- used ??? */
   abort_flag            = 0;      // not yet hooked up ???
   err_level             = 0;      // not yet hooked up ???
   new_hyphen_prime      = 0;
+
 #ifdef VARIABLETRIESIZE
 /*  trie_size = default_trie_size; */
   trie_size = 0;
 #endif
+
   mem_extra_high = 0;
   mem_extra_low  = 0;
   mem_initex     = 0;
@@ -2910,11 +2902,6 @@ int init_commands (int ac, char **av)
     show_line(log_line, 0);
   }
 */
-/*  if we aren't including current directory in any directory lists */
-/*  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;
 
   return 0;
 }
@@ -3188,8 +3175,9 @@ int main_init (int ac, char **av)
   int k;
 
   kpse_set_program_name(av[0], NULL);
+  xputenv("engine", "yandytex");
 
-  if (sizeof(memory_word) != sizeof(integer) * 2)
+  if (sizeof(memory_word) != sizeof(halfword) * 2)
   {
     sprintf(log_line, "ERROR: Bad word size %d!\n", sizeof(memory_word));
     show_line(log_line, 1);
@@ -3198,7 +3186,7 @@ int main_init (int ac, char **av)
   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;
@@ -3373,7 +3361,7 @@ void print_cs_name (FILE *output, int h)
 
   memset(log_line, 0, sizeof(log_line));
 
-  textof = hash[h].v.RH;
+  textof = hash[h].rh;
 
   if (textof == 0)
     return;
@@ -3406,8 +3394,8 @@ int compare_cs (const void *cp1, const void *cp2)
 
   c1 = *(int *)cp1;
   c2 = *(int *)cp2;
-  textof1 = hash[c1].v.RH;
-  textof2 = hash[c2].v.RH;
+  textof1 = hash[c1].rh;
+  textof2 = hash[c2].rh;
   l1 = length(textof1); 
   l2 = length(textof2); 
   k1 = str_start[textof1]; 
@@ -3450,7 +3438,7 @@ void print_cs_names (FILE *output, int pass)
     if (pass == 1 && csused[h])
       continue;
 
-    if (hash[h].v.RH != 0)
+    if (hash[h].rh != 0)
     {
       if (pass == 0)
         csused[h] = 1;
@@ -3488,7 +3476,7 @@ void print_cs_names (FILE *output, int pass)
       if (pass == 1 && csused[h])
         continue;
 
-      if (hash[h].v.RH != 0)
+      if (hash[h].rh != 0)
         cnumtable[ccount++] = h;
     }