Add changes to allow compiled code to appear in PSB files.
authorChris Hanson <org/chris-hanson/cph>
Mon, 4 Jan 1988 18:55:54 +0000 (18:55 +0000)
committerChris Hanson <org/chris-hanson/cph>
Mon, 4 Jan 1988 18:55:54 +0000 (18:55 +0000)
v7/src/microcode/psbtobin.c
v8/src/microcode/psbtobin.c

index 4b0099de1e1209255686d9ea5f81e59a40e6cfde..a4d5ad173ca3725d63801ffca24a7c6faccd0d53 100644 (file)
@@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising,
 promotional, or sales literature without prior written consent from
 MIT in each case. */
 
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/psbtobin.c,v 9.30 1987/11/23 05:11:58 cph Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/psbtobin.c,v 9.31 1988/01/04 18:55:54 cph Rel $
  *
  * This File contains the code to translate portable format binary
  * files to internal format.
@@ -44,6 +44,10 @@ MIT in each case. */
 
 #include "psbmap.h"
 
+static Boolean
+  allow_compiled_p = false,
+  allow_nmv_p = false;
+
 static long
   Dumped_Object_Addr,
   Dumped_Heap_Base, Heap_Objects, Heap_Count,
@@ -846,7 +850,9 @@ Read_Header_and_Allocate()
   READ_HEADER("Flags", "%ld", Flags);
   READ_FLAGS(Flags);
 
-  if ((compiled_p || nmv_p) && (Machine != FASL_INTERNAL_FORMAT))
+  if (((compiled_p && (! allow_compiled_p)) ||
+       (nmv_p && (! allow_nmv_p))) &&
+      (Machine != FASL_INTERNAL_FORMAT))
   {
     if (compiled_p)
     {
@@ -925,6 +931,7 @@ do_it()
   Boolean result;
   long Size;
 
+  allow_nmv_p = (allow_nmv_p || allow_compiled_p);
   Size = Read_Header_and_Allocate();
 
   Stack_Top = &Heap[Size];
@@ -1074,12 +1081,11 @@ do_it()
 \f
 /* Top level */
 
-/* C does not usually like empty initialized arrays, so ... */
-
 static struct Option_Struct Options[] =
-  {{"dummy", true, NULL}};
+    {{"Allow_Compiled", true, &allow_compiled_p},
+     {"Allow_NMVs", true, &allow_nmv_p}};
 
-static int Noptions = 0;
+static int Noptions = 2;
 
 main(argc, argv)
      int argc;
index b9dac36432c6975c0a72f7a58bdb683f90bea0fc..64daed2ddce11446e57f913b6d5edaca7cc47ee8 100644 (file)
@@ -30,7 +30,7 @@ Technology nor of any adaptation thereof in any advertising,
 promotional, or sales literature without prior written consent from
 MIT in each case. */
 
-/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/psbtobin.c,v 9.30 1987/11/23 05:11:58 cph Exp $
+/* $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v8/src/microcode/psbtobin.c,v 9.31 1988/01/04 18:55:54 cph Rel $
  *
  * This File contains the code to translate portable format binary
  * files to internal format.
@@ -44,6 +44,10 @@ MIT in each case. */
 
 #include "psbmap.h"
 
+static Boolean
+  allow_compiled_p = false,
+  allow_nmv_p = false;
+
 static long
   Dumped_Object_Addr,
   Dumped_Heap_Base, Heap_Objects, Heap_Count,
@@ -846,7 +850,9 @@ Read_Header_and_Allocate()
   READ_HEADER("Flags", "%ld", Flags);
   READ_FLAGS(Flags);
 
-  if ((compiled_p || nmv_p) && (Machine != FASL_INTERNAL_FORMAT))
+  if (((compiled_p && (! allow_compiled_p)) ||
+       (nmv_p && (! allow_nmv_p))) &&
+      (Machine != FASL_INTERNAL_FORMAT))
   {
     if (compiled_p)
     {
@@ -925,6 +931,7 @@ do_it()
   Boolean result;
   long Size;
 
+  allow_nmv_p = (allow_nmv_p || allow_compiled_p);
   Size = Read_Header_and_Allocate();
 
   Stack_Top = &Heap[Size];
@@ -1074,12 +1081,11 @@ do_it()
 \f
 /* Top level */
 
-/* C does not usually like empty initialized arrays, so ... */
-
 static struct Option_Struct Options[] =
-  {{"dummy", true, NULL}};
+    {{"Allow_Compiled", true, &allow_compiled_p},
+     {"Allow_NMVs", true, &allow_nmv_p}};
 
-static int Noptions = 0;
+static int Noptions = 2;
 
 main(argc, argv)
      int argc;