#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+#include <time.h>
#include <unistd.h>
#include "u8-mbtouc.h"
return x;
}
+static unsigned long long int
+get_u64(void)
+{
+ uint64_t x;
+ memcpy(&x, &data[pos], 8);
+ pos += 8;
+ return x;
+}
+
static unsigned int
get_be32(void)
{
printf("<datafile>%s</datafile>\n", get_string());
match_u32_assert(0);
- get_u32();
+
+ time_t date = get_u32();
+ struct tm tm = *localtime(&date);
+ char s[128];
+ strftime(s, sizeof s, "%a, %d %b %Y %H:%M:%S %z", &tm);
+ printf("<date>%s</date>\n", s);
+
match_u32_assert(0);
}
}
pos++;
pos++;
- /* Offset 31.
-
- This is the tableId, e.g. -4154297861994971133 would be 0xdca00003.
- We don't have enough context to validate it. */
- pos += 4;
-
- /* Offset 35. */
- pos += 4;
+ /* Offset 31. */
+ printf("<tableid>%lld</tableid>", get_u64());
dump_title ();
dump_fonts();