+static void
+parse_NavOleItem(void)
+{
+ match_byte_assert(0);
+ match_byte_assert(1);
+ match_zeros_assert(2);
+ pos++;
+ match_zeros_assert(9);
+ match_byte_assert(1);
+ match_zeros_assert(10);
+ match_byte_assert(1);
+ match_zeros_assert(6);
+ match_byte_assert(1);
+ parse_weirdness();
+ match_byte_assert(0);
+ pos++;
+ match_zeros_assert(11);
+ match_byte_assert(1);
+ match_zeros_assert(3);
+ get_string4();
+ match_byte_assert(0);
+}
+
+static void
+parse_flexible(void)
+{
+ int start = pos;
+ if (data[pos] == 0xff && data[pos + 1] == 0xff)
+ {
+ match_u16_assert(0xffff);
+ match_u16_assert(0);
+ char *heading = get_string2();
+ if (!strcmp(heading, "DspCell"))
+ parse_DspCell();
+ else if (!strcmp(heading, "DspNumber"))
+ parse_DspNumber();
+ else if (!strcmp(heading, "DspString"))
+ parse_DspString();
+ else if (!strcmp(heading, "NavHead"))
+ parse_NavHead();
+ else if (!strcmp(heading, "IndexedCollection"))
+ match_zeros_assert(14);
+ else if (!strcmp(heading, "NavOleItem"))
+ parse_NavOleItem();
+ else
+ {
+ fprintf(stderr, "don't know %s at offset 0x%x: ", heading, start);
+ hex_dump(stderr, pos, 64);
+ assert(0);
+ }
+ }
+ else if (data[pos + 1] == 0x80)
+ {
+ if (data[pos] == 0x2a && data[pos + 1] == 0x80)
+ match_DspNumber();
+ else if (data[pos] == 0x27 && data[pos + 1] == 0x80)
+ match_DspCell();
+ else if (data[pos] == 0x5 && data[pos + 1] == 0x80)
+ match_DspString();
+ else if (data[pos] == 0x7 && data[pos + 1] == 0x80)
+ match_NavTreeViewItem();
+ else if (data[pos] == 0x3 && data[pos + 1] == 0x80)
+ match_DspSimpleText();
+ 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 if (data[pos] == 0x9 && data[pos + 1] == 0x80)
+ {
+ match_NavLog();
+ }
+ else
+ {
+ fprintf (stderr, "bad record 0x%02x at offset %x\n",
+ data[pos], pos);
+ hex_dump (stderr, pos, 64);
+ assert(0);
+ }
+ }
+ else if (match_byte(0xa))
+ {
+ match_zeros_assert(5);
+ assert(pos == n);
+ exit (0);
+ }
+ else
+ {
+ fprintf (stderr, "bad record start at offset %x: ", pos);
+ hex_dump (stderr, pos, 64);
+ assert(0);
+ }
+}
+
+
+