hex_dump (stdout, prev_end, pos - prev_end);
}
- double d = *(double *) &data[pos + cell_prefix_len - 8];
- const union
+ printf ("cell %04x %d %d %d %d %d %d ", pos,
+ data[pos + 13], data[pos + 16], data[pos + 17],
+ data[pos + 18], data[pos + 19], data[pos + 20]);
+
+ int len = cell_prefix_len;
+ if (data[pos + 19] == 0)
+ {
+ if (data[pos + 20] == 0)
+ {
+ int count = (data[pos + 22]);
+ printf ("/ %d %d %d \"%.*s\"\n",
+ data[pos + 20], data[pos + 21], data[pos + 22],
+ count, &data[pos + 23]);
+ len = 23 + count;
+ }
+ else if (data[pos + 20] == 1
+ && data[pos + 21] == 0xff
+ && data[pos + 22] == 0xff)
+ {
+ int count = 255;
+ printf ("/ \"%.*s\"\n", count, &data[pos + 24]);
+ len = 23 + count;
+ }
+ else if (data[pos + 20] == 1 )
+ {
+ int count = (data[pos + 21]);
+ printf ("/ %d %d %d \"%.*s\"\n",
+ data[pos + 20], data[pos + 21], data[pos + 22],
+ count, &data[pos + 22]);
+ len = 22 + count;
+ }
+ else
+ abort ();
+ }
+ else if (data[pos + 19] == 128)
{
- uint8_t b[8];
- double d;
+ double d = *(double *) &data[pos + cell_prefix_len - 8];
+ const union
+ {
+ uint8_t b[8];
+ double d;
+ }
+ sysmis = {.b = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff}};
+ if (d == sysmis.d)
+ printf ("sysmis\n");
+ else
+ printf ("%f\n", d);
}
- sysmis = {.b = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff}};
- if (d == sysmis.d)
- printf ("cell sysmis\n");
else
- printf ("cell %f\n", d);
- pos += cell_prefix_len - 1;
+ abort ();
+ pos += len - 1;
prev_end = pos + 1;
continue;
}
}
static const int font_prefix[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa7, 0x80, 0x00, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0xa9,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -1, 0x80, 0x00, 0x01, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, -1,
0x80, 0x00, -1, 0x00, -1, 0x00, 0xc8, 0x00, -1, -1, -1, -1, -1,
- 0x00, -1, 0x00, 0x00, 0x00, 0x01, 0x00, 0xf3,
+ 0x00, -1, 0x00, 0x00, 0x00, 0x01, 0x00, -1,
0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, -1, -1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x22,
+ 0x00, 0x00, -1 /* 12 or 22 */,
};
size_t font_prefix_len = sizeof font_prefix / sizeof *font_prefix;
if (match_bytes(pos, font_prefix, font_prefix_len))
}
static const int table_prefix[] = {
- 0x00, 0x00, 0xed, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
+ -1 /* ed or e9 */, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbc, 0x02, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x41, 0x72, 0x69,
- 0x61, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x61, 0x6c, 0x00, -1, 0x00, -1, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, -1, 0x01, 0x00,
- 0x00,
+ 0x00, 0x00, 0x00, 0x00, -1, 0x00, 0x00, 0x00, -1,
};
size_t table_prefix_len = sizeof table_prefix / sizeof *table_prefix;
if (match_bytes(pos, table_prefix, table_prefix_len))
hex_dump (stdout, prev_end, pos - prev_end);
}
- printf ("table %d\n", data[pos + 74]);
+ printf ("table %d\n", data[pos + 72]);
pos += table_prefix_len - 1;
prev_end = pos + 1;
continue;
static const int dim_prefix[] = {
0x00, 0x03, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, -1,
0x00, 0x00, 0x00, 0x00, -1, 0x80, 0x01, 0x02, -1,
- -1, -1, 0x01,
+ -1, -1, -1 /* 00 or 01 */,
};
size_t dim_prefix_len = sizeof dim_prefix / sizeof *dim_prefix;
if (match_bytes(pos, dim_prefix, dim_prefix_len))