lots more acceptable files
[pspp] / dump-spo2.c
index f416bf696210382b4abb676d5f27893b58309265..847dcac45c96ebb568ad515d3429edce9f2c018d 100644 (file)
@@ -501,16 +501,22 @@ put_safe(const char *s)
 static void
 parse_DspString(void)
 {
-  match_byte_assert(1);
-  match_byte_assert(2);
-  match_byte_assert(40);
-  if (!match_byte(0))
-    match_byte_assert(5);
-  match_byte_assert(0);
-  match_byte_assert(1);
-  printf ("DspString(\"");
-  put_safe(get_string1());
-  printf("\")\n");
+  if (match_byte(2))
+    {
+      printf("DspString(%f, \"", get_double());
+      printf("%s\")\n", get_string1());
+    }
+  else
+    {
+      match_byte_assert(1);
+      printf ("DspString(");
+      parse_format();
+      printf(" \"");
+      match_byte_assert(0);
+      match_byte_assert(1);
+      put_safe(get_string1());
+      printf("\")\n");
+    }
 }
 
 static void
@@ -647,8 +653,32 @@ parse_flexible(void)
     match_DspCell();
   else if (data[pos] == 0x5 && data[pos + 1] == 0x80)
     match_DspString();
+  else if ((data[pos] == 0x3c || data[pos] == 0x39)
+            && data[pos + 1] == 0x80)
+    {
+      /* 3c 80 */
+      /* 39 80 */
+      pos += 2;
+      parse_format();
+/*      match_byte_assert(0x01);
+      match_byte_assert(0x02);
+      match_byte_assert(0x0d); */
+    }
+  else if (data[pos] == 0x15 && data[pos + 1] == 0x80)
+    {
+      /* 15 80 */
+      data += 2;
+      match_byte_assert(2);
+      printf ("15 80(%f", get_double());
+      printf (" %s)\n", get_string1());
+    }
   else
-    assert(0);
+    {
+      fprintf (stderr, "bad data cell 0x%02x at offset %x\n",
+               data[pos], pos);
+      hex_dump (stderr, pos, 64);
+      assert(0);
+    }
 }
 
 int