#define get_string() get_string(WHERE)
static void
-dump_nested(void)
+dump_empty_nested(void)
{
- int subn = get_u32 ();
-#if 0
- fprintf (stderr, "nested %d bytes: ", subn);
- dump_raw(stderr, pos, pos + subn, "");
- putc('\n', stderr);
-#endif
- pos += subn;
+ int outer_end = pos + get_u32();
+ int inner_end = pos + get_u32();
+ if (pos != inner_end)
+ {
+ match_u32_assert(0);
+ match_byte_assert(0x58);
+ if (pos != inner_end)
+ {
+ fprintf(stderr, "inner end discrepancy\n");
+ exit(1);
+ }
+ }
+ match_byte_assert(0x58);
+ match_byte_assert(0x58);
+ if (pos != outer_end)
+ {
+ fprintf(stderr, "outer end discrepancy\n");
+ exit(1);
+ }
}
static void
get_string();
else
match_u32_assert (0);
- dump_nested();
+
+ int outer_end = pos + get_u32();
+ int inner_end = pos + get_u32();
+ match_u32_assert(0);
+ if (match_byte(0x31))
+ get_string();
+ else
+ match_byte_assert(0x58);
+ if (pos != inner_end)
+ {
+ fprintf(stderr, "inner end discrepancy\n");
+ exit(1);
+ }
+
+ if (match_byte(0x31))
+ {
+ match_byte(0);
+ match_byte(0);
+ match_byte(0);
+ match_byte_assert(1);
+ get_string(); /* foreground */
+ get_string(); /* background */
+ get_string(); /* font */
+ match_byte_assert(12); /* size? */
+ }
+ else
+ match_byte_assert(0x58);
+ match_byte_assert(0x58);
+ if (pos != outer_end)
+ {
+ fprintf(stderr, "outer end discrepancy\n");
+ exit(1);
+ }
}
else if (match_u32 (1))
{
printf("(footnote %d) ", get_u32());
match_byte_assert (0);
match_byte_assert (0);
- dump_nested();
+
+ int outer_end = pos + get_u32();
+ int inner_end = pos + get_u32();
+ if (pos != inner_end)
+ {
+ match_u32_assert(0);
+ if (match_byte(0x31))
+ get_string();
+ else
+ match_byte_assert(0x58);
+ if (pos != inner_end)
+ {
+ fprintf(stderr, "inner end discrepancy\n");
+ exit(1);
+ }
+ }
+ match_byte_assert(0x58);
+ match_byte_assert(0x58);
+ if (pos != outer_end)
+ {
+ fprintf(stderr, "outer end discrepancy\n");
+ exit(1);
+ }
}
else if (match_u32 (2))
{
match_u32_assert(1);
match_byte_assert(0);
match_byte_assert(0);
- dump_nested();
+ dump_empty_nested();
}
else
{
match_byte_assert(0);
match_byte_assert(1);
match_byte_assert(0);
- dump_nested();
- dump_nested();
+ match_u32_assert(2);
+ match_byte_assert(0);
+ match_byte_assert(0);
+ dump_empty_nested();
}
}
else