Make setup_io take mode arguments to prevent text translation on
authorHenry M. Wu <edu/mit/csail/zurich/mhwu>
Tue, 11 Feb 1992 21:15:00 +0000 (21:15 +0000)
committerHenry M. Wu <edu/mit/csail/zurich/mhwu>
Tue, 11 Feb 1992 21:15:00 +0000 (21:15 +0000)
non-Unix systems.

v7/src/microcode/bintopsb.c
v7/src/microcode/ppband.c
v7/src/microcode/psbmap.h
v7/src/microcode/psbtobin.c
v8/src/microcode/bintopsb.c
v8/src/microcode/ppband.c
v8/src/microcode/psbmap.h
v8/src/microcode/psbtobin.c

index 960c2a84d1ae9e8e1f61569f0f8bf3124258614d..ad093e818dddcfc73ab63897537aa8b1344fa994 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bintopsb.c,v 9.49 1992/02/03 22:38:18 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/bintopsb.c,v 9.50 1992/02/11 21:14:38 mhwu Exp $
 
 Copyright (c) 1987-1992 Massachusetts Institute of Technology
 
@@ -37,7 +37,6 @@ MIT in each case. */
 \f
 /* IO definitions */
 
-#include "ansidecl.h"
 #include "psbmap.h"
 #include "trap.h"
 #include "limits.h"
@@ -1798,7 +1797,7 @@ DEFUN (main, (argc, argv),
     quit (1);
   }
 
-  setup_io ();
+  setup_io ("rb", "w");
   do_it ();
   quit (0);
 }
index 8dd82dc3351b8d9a372344ccdc67def12d75ff22..8b7c1dbad9a10d7fed80058ac12aa095c1fdb95d 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/ppband.c,v 9.42 1990/11/21 21:07:33 jinx Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/ppband.c,v 9.43 1992/02/11 21:15:00 mhwu Exp $
 
-Copyright (c) 1987, 1989, 1990 Massachusetts Institute of Technology
+Copyright (c) 1987-1992 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -47,6 +47,23 @@ MIT in each case. */
 
 #define fast register
 
+/* These are needed when there is no compiler support. */
+
+extern void EXFUN (gc_death,
+                  (long code, char *, SCHEME_OBJECT *, SCHEME_OBJECT *));
+
+extern char
+  gc_death_message_buffer[];
+
+void
+DEFUN (gc_death, (code, message, scan, free),
+       long code AND char * message
+       AND SCHEME_OBJECT * scan AND SCHEME_OBJECT * free)
+{
+  fprintf (stderr, "gc_death: %s.\n", message);
+  exit (1);
+}
+
 /* These are needed by load.c */
 
 static SCHEME_OBJECT * memory_base;
@@ -155,7 +172,11 @@ DEFUN (print_long_as_string, (string), char *string)
          printf ("     ");
          break;
 
+#ifdef __STDC__
        case '\a':
+#else
+       case '\007':
+#endif
          printf ("   \\a");
          break;
 
index 17811a8efb168160fd417aa5939ff7c9a059859d..6eff63d80ee393e2f1172bb253708db67c990475 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/psbmap.h,v 9.34 1992/01/15 17:31:41 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/psbmap.h,v 9.35 1992/02/11 21:14:07 mhwu Exp $
 
-Copyright (c) 1987-92 Massachusetts Institute of Technology
+Copyright (c) 1987-1992 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -45,6 +45,7 @@ MIT in each case. */
 #define fast register
 
 #include <stdio.h>
+#include "ansidecl.h"
 #include "config.h"
 #include "types.h"
 #include "object.h"
@@ -179,8 +180,7 @@ static char
 FILE *input_file, *output_file;
 
 Boolean
-strequal(s1, s2)
-     register char *s1, *s2;
+DEFUN (strequal, (s1, s2), register char * s1 AND register char * s2)
 {
   for ( ; *s1 != '\0'; s1++, s2++)
   {
@@ -193,44 +193,44 @@ strequal(s1, s2)
 }
 \f
 void
-setup_io()
+DEFUN (setup_io, (input_mode, output_mode),
+       CONST char * input_mode AND CONST char * output_mode)
 {
-  if (strequal(input_file_name, "-"))
+  if (strequal (input_file_name, "-"))
   {
     input_file = stdin;
   }
   else
   {
-    input_file = fopen(input_file_name, "r");
+    input_file = (fopen (input_file_name, input_mode));
     if (input_file == ((FILE *) NULL))
     {
-      fprintf(stderr, "%s: failed to open %s for input.\n",
-             input_file_name);
-      exit(1);
+      fprintf (stderr, "%s: failed to open %s for input.\n",
+              input_file_name);
+      exit (1);
     }
   }
 
-  if (strequal(output_file_name, "-"))
+  if (strequal (output_file_name, "-"))
   {
     output_file = stdout;
   }
   else
   {
-    output_file = fopen(output_file_name, "w");
+    output_file = (fopen (output_file_name, output_mode));
     if (output_file == ((FILE *) NULL))
     {
-      fprintf(stderr, "%s: failed to open %s for output.\n",
-             output_file_name);
-      fclose(input_file);
-      exit(1);
+      fprintf (stderr, "%s: failed to open %s for output.\n",
+              output_file_name);
+      fclose (input_file);
+      exit (1);
     }
   }
   return;
 }
 
 void
-quit(code)
-     int code;
+DEFUN (quit, (code), int code)
 {
   fclose(input_file);
   fclose(output_file);
index 0b0ba44762d02e711343ae07876b97abd89b6ab8..dd51b76ca6902c627345229f40d6204e1bd8df04 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/psbtobin.c,v 9.46 1992/02/03 22:39:43 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/psbtobin.c,v 9.47 1992/02/11 21:14:23 mhwu Exp $
 
-Copyright (c) 1987-92 Massachusetts Institute of Technology
+Copyright (c) 1987-1992 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -37,7 +37,6 @@ MIT in each case. */
 \f
 /* Cheap renames */
 
-#include "ansidecl.h"
 #include "psbmap.h"
 #include "float.h"
 #include "limits.h"
@@ -1249,7 +1248,7 @@ DEFUN (main, (argc, argv),
   }
   allow_nmv_p = (allow_nmv_p || allow_compiled_p);
 
-  setup_io ();
+  setup_io ("r", "wb");
   do_it ();
   quit (0);
 }
index 2160b0cd6a75fd5dce5c94b18f580a90f0929cd0..ea726cdbf866af67fa88b7141d0f01ee4b72d7b0 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/bintopsb.c,v 9.49 1992/02/03 22:38:18 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/bintopsb.c,v 9.50 1992/02/11 21:14:38 mhwu Exp $
 
 Copyright (c) 1987-1992 Massachusetts Institute of Technology
 
@@ -37,7 +37,6 @@ MIT in each case. */
 \f
 /* IO definitions */
 
-#include "ansidecl.h"
 #include "psbmap.h"
 #include "trap.h"
 #include "limits.h"
@@ -1798,7 +1797,7 @@ DEFUN (main, (argc, argv),
     quit (1);
   }
 
-  setup_io ();
+  setup_io ("rb", "w");
   do_it ();
   quit (0);
 }
index 84ce7d1b4a332593a2a21be35c13a47e5a96bcef..c58eae8ca61bed6dc3557d1fe35dd09c8b619dd7 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/ppband.c,v 9.42 1990/11/21 21:07:33 jinx Rel $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/ppband.c,v 9.43 1992/02/11 21:15:00 mhwu Exp $
 
-Copyright (c) 1987, 1989, 1990 Massachusetts Institute of Technology
+Copyright (c) 1987-1992 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -47,6 +47,23 @@ MIT in each case. */
 
 #define fast register
 
+/* These are needed when there is no compiler support. */
+
+extern void EXFUN (gc_death,
+                  (long code, char *, SCHEME_OBJECT *, SCHEME_OBJECT *));
+
+extern char
+  gc_death_message_buffer[];
+
+void
+DEFUN (gc_death, (code, message, scan, free),
+       long code AND char * message
+       AND SCHEME_OBJECT * scan AND SCHEME_OBJECT * free)
+{
+  fprintf (stderr, "gc_death: %s.\n", message);
+  exit (1);
+}
+
 /* These are needed by load.c */
 
 static SCHEME_OBJECT * memory_base;
@@ -155,7 +172,11 @@ DEFUN (print_long_as_string, (string), char *string)
          printf ("     ");
          break;
 
+#ifdef __STDC__
        case '\a':
+#else
+       case '\007':
+#endif
          printf ("   \\a");
          break;
 
index 312b0249a18607ec8926f549af7688812c65ae7b..aa1ad0aad662f2d0721a7ab0a684d6899c2508ca 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/psbmap.h,v 9.34 1992/01/15 17:31:41 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/psbmap.h,v 9.35 1992/02/11 21:14:07 mhwu Exp $
 
-Copyright (c) 1987-92 Massachusetts Institute of Technology
+Copyright (c) 1987-1992 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -45,6 +45,7 @@ MIT in each case. */
 #define fast register
 
 #include <stdio.h>
+#include "ansidecl.h"
 #include "config.h"
 #include "types.h"
 #include "object.h"
@@ -179,8 +180,7 @@ static char
 FILE *input_file, *output_file;
 
 Boolean
-strequal(s1, s2)
-     register char *s1, *s2;
+DEFUN (strequal, (s1, s2), register char * s1 AND register char * s2)
 {
   for ( ; *s1 != '\0'; s1++, s2++)
   {
@@ -193,44 +193,44 @@ strequal(s1, s2)
 }
 \f
 void
-setup_io()
+DEFUN (setup_io, (input_mode, output_mode),
+       CONST char * input_mode AND CONST char * output_mode)
 {
-  if (strequal(input_file_name, "-"))
+  if (strequal (input_file_name, "-"))
   {
     input_file = stdin;
   }
   else
   {
-    input_file = fopen(input_file_name, "r");
+    input_file = (fopen (input_file_name, input_mode));
     if (input_file == ((FILE *) NULL))
     {
-      fprintf(stderr, "%s: failed to open %s for input.\n",
-             input_file_name);
-      exit(1);
+      fprintf (stderr, "%s: failed to open %s for input.\n",
+              input_file_name);
+      exit (1);
     }
   }
 
-  if (strequal(output_file_name, "-"))
+  if (strequal (output_file_name, "-"))
   {
     output_file = stdout;
   }
   else
   {
-    output_file = fopen(output_file_name, "w");
+    output_file = (fopen (output_file_name, output_mode));
     if (output_file == ((FILE *) NULL))
     {
-      fprintf(stderr, "%s: failed to open %s for output.\n",
-             output_file_name);
-      fclose(input_file);
-      exit(1);
+      fprintf (stderr, "%s: failed to open %s for output.\n",
+              output_file_name);
+      fclose (input_file);
+      exit (1);
     }
   }
   return;
 }
 
 void
-quit(code)
-     int code;
+DEFUN (quit, (code), int code)
 {
   fclose(input_file);
   fclose(output_file);
index f860961bb8a6991f568d0c47874b6e05fa9049e9..9b29ebf55e7ef545ad1f6ad3fae3148b600ba893 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/psbtobin.c,v 9.46 1992/02/03 22:39:43 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/psbtobin.c,v 9.47 1992/02/11 21:14:23 mhwu Exp $
 
-Copyright (c) 1987-92 Massachusetts Institute of Technology
+Copyright (c) 1987-1992 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -37,7 +37,6 @@ MIT in each case. */
 \f
 /* Cheap renames */
 
-#include "ansidecl.h"
 #include "psbmap.h"
 #include "float.h"
 #include "limits.h"
@@ -1249,7 +1248,7 @@ DEFUN (main, (argc, argv),
   }
   allow_nmv_p = (allow_nmv_p || allow_compiled_p);
 
-  setup_io ();
+  setup_io ("r", "wb");
   do_it ();
   quit (0);
 }