+static char * WARN_UNUSED_RESULT
+dump_raw (struct zip_reader *zr, const char *member_name)
+{
+ void *data;
+ size_t size;
+ char *error = zip_member_read_all (zr, member_name, &data, &size);
+ if (!error)
+ {
+ fwrite (data, size, 1, stdout);
+ free (data);
+ }
+ return error;
+}
+
+static void
+dump_light_table (const struct output_item *item)
+{
+ char *error;
+ if (raw)
+ error = dump_raw (item->spv_info->zip_reader,
+ item->spv_info->bin_member);
+ else
+ {
+ struct spvlb_table *table;
+ error = spv_read_light_table (item->spv_info->zip_reader,
+ item->spv_info->bin_member, &table);
+ if (!error)
+ {
+ if (sort)
+ {
+ qsort (table->borders->borders, table->borders->n_borders,
+ sizeof *table->borders->borders, compare_borders);
+ qsort (table->cells->cells, table->cells->n_cells,
+ sizeof *table->cells->cells, compare_cells);
+ }
+ spvlb_print_table (item->spv_info->bin_member, 0, table);
+ spvlb_free_table (table);
+ }
+ }
+ if (error)
+ {
+ msg (ME, "%s", error);
+ free (error);
+ }
+}
+