+void isamb_pp_close(ISAMB_PP pp)
+{
+ isamb_pp_close_x(pp, 0, 0);
+}
+
+/* simple recursive dumper .. */
+static void isamb_dump_r(ISAMB b, ISAM_P pos, void (*pr)(const char *str),
+ int level)
+{
+ char buf[1024];
+ char prefix_str[1024];
+ if (pos)
+ {
+ struct ISAMB_block *p = open_block(b, pos);
+ sprintf(prefix_str, "%*s " ZINT_FORMAT " cat=%d size=%d max=%d items="
+ ZINT_FORMAT, level*2, "",
+ pos, p->cat, p->size, b->file[p->cat].head.block_max,
+ p->no_items);
+ (*pr)(prefix_str);
+ sprintf(prefix_str, "%*s " ZINT_FORMAT, level*2, "", pos);
+ if (p->leaf)
+ {
+ while (p->offset < p->size)
+ {
+ const char *src = p->bytes + p->offset;
+ char *dst = buf;
+ (*b->method->codec.decode)(p->decodeClientData, &dst, &src);
+ (*b->method->log_item)(YLOG_DEBUG, buf, prefix_str);
+ p->offset = src - (char*) p->bytes;
+ }
+ assert(p->offset == p->size);
+ }
+ else
+ {
+ const char *src = p->bytes + p->offset;
+ ISAM_P sub;
+
+ decode_ptr(&src, &sub);
+ p->offset = src - (char*) p->bytes;
+
+ isamb_dump_r(b, sub, pr, level+1);
+
+ while (p->offset < p->size)
+ {
+#if INT_ENCODE
+ char file_item_buf[DST_ITEM_MAX];
+ char *file_item = file_item_buf;
+ void *c1 = (*b->method->codec.start)();
+ (*b->method->codec.decode)(c1, &file_item, &src);
+ (*b->method->codec.stop)(c1);
+ (*b->method->log_item)(YLOG_DEBUG, file_item_buf, prefix_str);
+#else
+ zint item_len;
+ decode_item_len(&src, &item_len);
+ (*b->method->log_item)(YLOG_DEBUG, src, prefix_str);
+ src += item_len;
+#endif
+ decode_ptr(&src, &sub);
+
+ p->offset = src - (char*) p->bytes;
+
+ isamb_dump_r(b, sub, pr, level+1);
+ }
+ }
+ close_block(b, p);
+ }
+}
+
+void isamb_dump(ISAMB b, ISAM_P pos, void (*pr)(const char *str))
+{
+ isamb_dump_r(b, pos, pr, 0);
+}
+
+int isamb_pp_read(ISAMB_PP pp, void *buf)