+ int skips = 0;
+ yaz_log(YLOG_DEBUG, "isamb_pp_forward_unode starting "
+ "at level %d node %d ofs=%di sz=%d",
+ pp->level, p->pos, p->offset, p->size);
+#endif
+ assert(!p->leaf);
+ assert(p->offset <= p->size);
+ if (p->offset == p->size)
+ {
+#if ISAMB_DEBUG
+ yaz_log(YLOG_DEBUG, "isamb_pp_forward_unode returning at end "
+ "at level %d node %d ofs=%di sz=%d",
+ pp->level, p->pos, p->offset, p->size);
+#endif
+ return pos; /* already at the end of it */
+ }
+ 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);
+ cmp = (*b->method->compare_item)(untilbuf, file_item_buf);
+#else
+ zint item_len;
+ decode_item_len(&src, &item_len);
+ cmp = (*b->method->compare_item)(untilbuf, src);
+ src += item_len;
+#endif
+ decode_ptr(&src, &nxtpos);
+ if (cmp<pp->scope) /* cmp<2 */
+ {
+#if ISAMB_DEBUG
+ yaz_log(YLOG_DEBUG, "isamb_pp_forward_unode returning a hit "
+ "at level %d node %d ofs=%d sz=%d",
+ pp->level, p->pos, p->offset, p->size);
+#endif
+ return pos;
+ } /* found one */
+ pos = nxtpos;
+ p->offset = src-(char*)p->bytes;
+ (pp->skipped_nodes[pp->maxlevel - pp->level -1])++;
+#if ISAMB_DEBUG
+ skips++;
+#endif
+ }
+#if ISAMB_DEBUG
+ yaz_log(YLOG_DEBUG, "isamb_pp_forward_unode returning at tail "
+ "at level %d node %d ofs=%d sz=%d skips=%d",
+ pp->level, p->pos, p->offset, p->size, skips);
+#endif
+ return pos; /* that's the last one in the line */