+static void
+dump_source(int end, int count, int n_series, const char *name)
+{
+ const union
+ {
+ uint8_t b[8];
+ double d;
+ }
+ sysmis = {.b = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff}};
+ int n_sysmis = 0;
+ for (int i = 0; i < n_series; i++)
+ {
+ printf (" %08x: series %d: \"%s\", %d values:\n ",
+ pos, i, get_fixed_string(288), count);
+ for (int i = 0; i < count; i++)
+ {
+ double d = get_double();
+ if (d == sysmis.d)
+ {
+ printf (" .");
+ n_sysmis++;
+ }
+ else
+ printf (" %.*g", DBL_DIG, d);
+ }
+ printf ("\n");
+ }
+}
+
+static void
+dump_strings(void)
+
+{
+ if (pos >= n)
+ return;
+
+ int start = pos;
+ int offset = pos;
+ int n_maps = get_u32();
+ int max1 = -1;
+ for (int k = 0; k < n_maps; k++)
+ {
+ char *source_name = get_string();
+ printf ("%08x: %s\n", offset, source_name);
+
+ int n_series = get_u32();
+ for (int i = 0; i < n_series; i++)
+ {
+ printf ("%08x:", pos);
+ printf (" \"%s\"", get_string());
+ int n_pairs = get_u32();
+ for (int j = 0; j < n_pairs; j++)
+ {
+ int x = get_u32();
+ int y = get_u32();
+ printf (" (%d, %d)", x, y);
+ if (y > max1)
+ max1 = y;
+ }
+ printf ("\n");
+ }
+ }
+ printf ("\n%08x:", pos);
+ int n_strings = get_u32();
+ if (n_strings != max1 + 1)
+ {
+ fprintf (stderr, "n_strings=%d max1+1=%d (-s %#x -n %u)\n", n_strings, max1 + 1, start, n - start);
+ dump_raw (stderr, start, n, "\n");
+ assert(n_strings == max1 + 1);
+ }
+ printf (" %d strings\n", n_strings);
+
+ char **strings = malloc((max1 + 1) * sizeof *strings);
+ for (int i = 0; i <= max1; i++)
+ {
+ int frequency = get_u32();
+ char *s = get_string();
+ printf ("%d: \"%s\" (%d)\n", i, s, frequency);
+ strings[i] = s;
+ }
+ printf ("\n");
+
+ assert (pos == n);
+#if 0
+ pos = ofs;
+ printf("Strings:\n");
+ for (int i = 0; i < n_more_series; i++)
+ {
+ printf (" \"%s\"\n", get_string());
+ int n_pairs = get_u32();
+ for (int j = 0; j < n_pairs; j++)
+ {
+ int x = get_u32();
+ //assert (x == j);
+ int y = get_u32();
+ printf (" %d: \"%s\"\n", x, strings[y]);
+ }
+ printf ("\n");
+ }
+#endif
+}
+