OSDN Git Service

PATH_MAX -> file_name_size
[putex/putex.git] / src / texsourc / tex4.c
index f9d6249..78b48d8 100644 (file)
@@ -141,7 +141,7 @@ void dvi_four_(integer x)
   dvi_out(x % 0400); // dvi_out(x & 255);
 }
 /* sec 0601 */
-void zdvipop(integer l)
+void dvi_pop_(integer l)
 {
   if ((l == dvi_offset + dvi_ptr) && (dvi_ptr > 0))
     decr(dvi_ptr);
@@ -406,7 +406,7 @@ lab30:
   }
 }
 /* sec 1368 */
-void special_out_(halfword p)
+void special_out_(pointer p)
 {
   char old_setting;
   pool_pointer k;
@@ -419,23 +419,16 @@ void special_out_(halfword p)
 #ifdef ALLOCATESTRING
   if (pool_ptr + 32000 > current_pool_size)
     str_pool = realloc_str_pool (increment_pool_size);
-/* We don't bother to check whether this worked - will catch later */
-#endif
-/* Potential problem here if current_pool_size is not much more than pool_ptr! */
-/* Fixed 97/Mar/9 in version 2.0.3 */
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
-#ifdef ALLOCATESTRING
+
   show_token_list(link(write_tokens(p)), 0, 10000000L);
-/*  Above is safe, since print/print_char/print_esc will extend string space */
 #else
-/* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
   show_token_list(link(write_tokens(p)), 0, pool_size - pool_ptr);
 #endif
 
   selector = old_setting;
   str_room(1);
 
-  if (cur_length < 256)  /* can use xxx1 ? */
+  if (cur_length < 256)
   {
     dvi_out(xxx1);
     dvi_out(cur_length);
@@ -452,7 +445,7 @@ void special_out_(halfword p)
   pool_ptr = str_start[str_ptr];
 }
 /* sec 1370 */
-void write_out_(halfword p)
+void write_out_(pointer p)
 {
   char old_setting;
 /*  integer oldmode;  */
@@ -488,7 +481,7 @@ void write_out_(halfword p)
       {
         get_token();
       }
-    while(!(cur_tok == end_write_token)); /*1996/Jan/10*/
+    while (!(cur_tok == end_write_token));
   }
 
   mode = oldmode;
@@ -512,7 +505,7 @@ void write_out_(halfword p)
   selector = old_setting;
 }
 /* sec 1373 */
-void out_what_(halfword p)
+void out_what_(pointer p)
 {
 /*  small_number j;  */
   int j;            /* 1995/Jan/7 */
@@ -548,7 +541,7 @@ void out_what_(halfword p)
 
             pack_file_name(cur_name, cur_area, cur_ext);
 
-            while(! a_open_out(write_file[j]))
+            while (! a_open_out(write_file[j]))
             {
               prompt_file_name("output file name", ".tex");
             }
@@ -591,7 +584,7 @@ void hlist_out (void)
   halfword leader_box;
   scaled leader_wd;
   scaled lx;
-  bool outer_doing_leaders;
+  boolean outer_doing_leaders;
   scaled edge;
   real glue_temp;
   real cur_glue;
@@ -674,7 +667,7 @@ lab21:
           cur_h = cur_h + char_width(f, char_info(f, c));
           p = link(p);
         }
-      while(!(!(p >= hi_mem_min)));
+      while (!(!is_char_node(p)));
 
       dvi_h = cur_h;
   }
@@ -898,7 +891,7 @@ void vlist_out (void)
   halfword leader_box;
   scaled leader_ht;
   scaled lx;
-  bool outer_doing_leaders;
+  boolean outer_doing_leaders;
   scaled edge;
   real glue_temp;
   real cur_glue;
@@ -925,7 +918,7 @@ void vlist_out (void)
 
   while (p != 0)
   {
-    if ((p >= hi_mem_min))
+    if (is_char_node(p))
     {
       confusion("vlistout");
       return;       // abort_flag set
@@ -1146,7 +1139,7 @@ void dvi_ship_out_(halfword p)
   print_char('[');
   j = 9;
 
-  while((count(j) == 0) && (j > 0))
+  while ((count(j) == 0) && (j > 0))
     decr(j);
 
   for (k = 0; k <= j; k++)
@@ -1207,7 +1200,7 @@ void dvi_ship_out_(halfword p)
 
     pack_job_name(".dvi");
 
-    while(!b_open_out(dvi_file))
+    while (!b_open_out(dvi_file))
     {
       prompt_file_name("file name for output", ".dvi");
     }
@@ -1300,13 +1293,19 @@ lab30:;
 }
 void ship_out_(halfword p)
 {
-  if (pdf_output_flag)
-    pdf_ship_out(p);
-  else
-    dvi_ship_out_(p);
+  switch (shipout_flag)
+  {
+    case out_pdf_flag:
+      pdf_ship_out(p);
+      break;
+    case out_dvi_flag:
+    case out_xdv_flag:
+      dvi_ship_out_(p);
+      break;
+  }
 }
 /* sec 0645 */
-void scan_spec_(group_code c, bool three_codes)
+void scan_spec_(group_code c, boolean three_codes)
 {
   integer s;
   char spec_code;
@@ -1351,7 +1350,7 @@ halfword hpack_(halfword p, scaled w, small_number m)
 /*  glue_ord o;  */
   int o;              /* 95/Jan/7 */
   internal_font_number f;
-  ffourquarters i;
+  four_quarters i;
   eight_bits hd;
 
   last_badness = 0;
@@ -1376,7 +1375,7 @@ halfword hpack_(halfword p, scaled w, small_number m)
   while (p != 0)
   {
 lab21:
-    while ((p >= hi_mem_min))
+    while (is_char_node(p))
     {
       f = font(p);
       i = char_info(f, character(p));
@@ -1431,7 +1430,7 @@ lab21:
             {
               link(adjust_tail) = adjust_ptr(p);
 
-              while (link(adjust_tail)!= 0)
+              while (link(adjust_tail) != 0)
                 adjust_tail = link(adjust_tail);
 
               p = link(p);
@@ -1591,7 +1590,7 @@ lab21:
       {
           if ((overfull_rule > 0) && (- (integer) x - total_shrink[0] > hfuzz))
           {
-              while(link(q) != 0)
+              while (link(q) != 0)
                 q = link(q);
  
               link(q) = new_rule();
@@ -1684,7 +1683,7 @@ halfword vpackage_(halfword p, scaled h, small_number m, scaled l)
 
   while (p != 0)
   {
-    if ((p >= hi_mem_min))
+    if (is_char_node(p))
     {
       confusion("vpack");
       return 0;       // abort_flag set
@@ -1992,7 +1991,7 @@ halfword overbar_(halfword b, scaled k, scaled t)
 /* sec 0709 */
 halfword char_box_(internal_font_number f, quarterword c)
 {
-  ffourquarters q;
+  four_quarters q;
   eight_bits hd;
   halfword b, p;
 
@@ -2020,9 +2019,9 @@ void stack_into_box_(halfword b, internal_font_number f, quarterword c)
   height(b) = height(p);
 }
 /* sec 0712 */
-scaled height_plus_depth_(internal_font_number f, fquarterword c)
+scaled height_plus_depth_(internal_font_number f, quarterword c)
 {
-  ffourquarters q;
+  four_quarters q;
   eight_bits hd;
 
   q = char_info(f, c);
@@ -2038,12 +2037,12 @@ halfword var_delimiter_(halfword d, small_number s, scaled v)
   integer m, n;
   scaled u;
   scaled w;
-  ffourquarters q;
-  ffourquarters r;
+  four_quarters q;
+  four_quarters r;
   eight_bits hd;
 /*  small_number z;  */
   int z;                  /* 95/Jan/7 */
-/*  bool large_attempt;  */
+/*  boolean large_attempt;  */
   int large_attempt;           /* 95/Jan/7 */
 
   f = null_font;
@@ -2143,7 +2142,7 @@ lab40:
       n = 0;
 
       if (u > 0)
-        while(w < v)
+        while (w < v)
         {
           w = w + u;
           incr(n);