OSDN Git Service

version 2.3.0-final.
[putex/putex.git] / src / texsourc / yandytex.c
index 60dd334..9a0400a 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright 1992 Karl Berry\r
+/*\r
+   Copyright 1992 Karl Berry\r
    Copyright 2007 TeX Users Group\r
    Copyright 2014 Clerk Ma\r
 \r
@@ -15,7 +16,8 @@
    You should have received a copy of the GNU General Public License\r
    along with this program; if not, write to the Free Software\r
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA\r
-   02110-1301 USA.  */\r
+   02110-1301 USA.\r
+*/\r
 \r
 #define EXTERN\r
 \r
@@ -101,13 +103,11 @@ void t_open_in (void)
   for (last = first; buffer[last]; ++last)\r
     do_nothing();\r
 \r
-  for (--last; last >= first && ISBLANK (buffer[last]) && buffer[last] != '\r'; --last)\r
+  for (--last; last >= first && ISBLANK(buffer[last]) && buffer[last] != '\r'; --last)\r
     do_nothing();\r
 \r
   last++;\r
 \r
-/* One more time, this time converting to TeX's internal character\r
-   representation.  */ /* for command line input in this case */\r
   if (non_ascii)\r
   {\r
     for (i = first; i < last; i++)\r
@@ -310,13 +310,7 @@ boolean input_line_finish (void)
 \r
   return true;\r
 }\r
-\r
-/* Read a line of input into buffer as efficiently as possible (ha ha)\r
-   while still looking like Pascal.\r
-   We set `last' to `first' and return `false' if we get to eof.\r
-   Otherwise, we return `true' and set last = first +\r
-   length(line except trailing whitespace).  */\r
-\r
+/* sec 0031 */\r
 boolean input_line (FILE * f)\r
 {\r
   char * u;        /* 1994/July/3 for key_replace */\r
@@ -414,15 +408,15 @@ boolean input_line (FILE * f)
     }\r
   }\r
 \r
-  if (return_flag)    /* let return terminate line as well as newline */\r
+  if (return_flag)  /* let return terminate line as well as newline */\r
   {\r
-    if (i == '\r')      /* see whether return followed by newline */\r
+    if (i == '\r')  /* see whether return followed by newline */\r
     {\r
-      i = getc (f);       /* in which case throw away the newline */\r
+      i = getc(f);  /* in which case throw away the newline */\r
 \r
       if (i != '\n')\r
       {\r
-        ungetc (i, f);\r
+        ungetc(i, f);\r
         i = '\r';\r
       }\r
 /*      else  buffer[last-1] = (ASCII_code) i; */\r
@@ -466,10 +460,12 @@ boolean input_line (FILE * f)
 \r
 static char * edit_value = "c:\\yandy\\WinEdt\\WinEdt.exe [Open('%s');SelLine(%d,7)]";\r
 \r
+#ifdef WIN32\r
 static inline int Isspace (char c)\r
 {\r
   return (c == ' ' || c == '\t');\r
 }\r
+#endif\r
 \r
 void call_edit (ASCII_code * filename, pool_pointer fnstart, integer fnlength, integer linenumber)\r
 {\r
@@ -486,12 +482,12 @@ void call_edit (ASCII_code * filename, pool_pointer fnstart, integer fnlength, i
   sdone = ddone = 0;\r
   filename += fnstart;\r
 \r
-  /* Close any open input files, since we're going to kill the job.  */\r
+  /* Close any open input files, since we're going to kill the job. */\r
   for (i = 1; i <= in_open; i++)\r
 #ifdef XeTeX\r
-    xfclose (input_file[i]->f, "inputfile");\r
+    xfclose(input_file[i]->f, "inputfile");\r
 #else\r
-    xfclose (input_file[i], "inputfile");\r
+    xfclose(input_file[i], "inputfile");\r
 #endif\r
 \r
   /* Replace the default with the value of the appropriate environment\r
@@ -619,15 +615,6 @@ void call_edit (ASCII_code * filename, pool_pointer fnstart, integer fnlength, i
 \r
 \r
 #if !defined (WORDS_BIGENDIAN) && !defined (NO_FMTBASE_SWAP)\r
-\r
-/* We don't REALLY care what `endian' the machine is after all ! */\r
-\r
-// #ifdef MYDEBUG\r
-// char swapmarkerstring="ERROR: SWAPPING - NOT BigEndian AND NOT NoFmtBaseSwap";\r
-// #endif\r
-\r
-/* This macro is always invoked as a statement.  It assumes a variable\r
-   `temp'.  */\r
    \r
 #define SWAP(x, y) temp = (x); (x) = (y); (y) = temp;\r
 \r
@@ -736,36 +723,4 @@ int do_undump (char *p, int item_size, int nitems, FILE *in_file)
 #endif\r
 \r
   return 0;\r
-}\r
-\r
-#ifdef FUNNY_CORE_DUMP\r
-\r
-void funny_core_dump (void)\r
-{\r
-  int pid, w;\r
-  union wait status;\r
-\r
-  switch (pid = vfork ())\r
-  {\r
-    case -1:\r
-      perrormod ("vfork");\r
-      exit (-1);\r
-\r
-    case 0:\r
-       (void) signal (SIGQUIT, SIG_DFL);\r
-       (void) kill (getpid (), SIGQUIT);\r
-       (void) write (2, "how did we get here?\n", 21);\r
-       exit (1);\r
-\r
-    default:\r
-      while ((w = wait (&status)) != pid && w != -1)\r
-        ;\r
-\r
-      if (status.w_coredump)\r
-        exit (0);\r
-\r
-      (void) write (2, "attempt to dump core failed\n", 28);\r
-      exit (1);\r
-  }\r
-}\r
-#endif /* FUNNY_CORE_DUMP */
\ No newline at end of file
+}
\ No newline at end of file