+ struct ISAMB_block *p = pp->block[pp->level];
+ logf(LOG_DEBUG,"isamb_pp_climb_desc starting "
+ "at level %d node %d ofs=%d sz=%d",
+ pp->level, p->pos, p->offset, p->size);
+#endif
+ if (!isamb_pp_climb_level(pp,&pos))
+ return 0;
+ /* see if it would pay to climb one higher */
+ if (!isamb_pp_on_right_node(pp, pp->level, untilbuf))
+ if (!isamb_pp_climb_level(pp,&pos))
+ return 0;
+ isamb_pp_descend_to_leaf(pp, pos,untilbuf);
+#if ISAMB_DEBUG
+ p = pp->block[pp->level];
+ logf(LOG_DEBUG,"isamb_pp_climb_desc done "
+ "at level %d node %d ofs=%d sz=%d",
+ pp->level, p->pos, p->offset, p->size);
+#endif
+ return 1;
+} /* climb_desc */
+
+int isamb_pp_forward (ISAMB_PP pp, void *buf, const void *untilbuf)
+{
+#if ISAMB_DEBUG
+ struct ISAMB_block *p = pp->block[pp->level];
+ assert(p->leaf);
+ logf(LOG_DEBUG,"isamb_pp_forward starting "
+ "at level %d node %d ofs=%d sz=%d u=%p sc=%d",
+ pp->level, p->pos, p->offset, p->size,untilbuf, scope);
+#endif
+ if (untilbuf) {
+ if (isamb_pp_forward_on_leaf( pp, buf, untilbuf)) {
+#if ISAMB_DEBUG
+ logf(LOG_DEBUG,"isamb_pp_forward (f) returning (A) "
+ "at level %d node %d ofs=%d sz=%d",
+ pp->level, p->pos, p->offset, p->size);
+#endif
+ return 1;
+ }
+ if (! isamb_pp_climb_desc( pp, untilbuf)) {
+#if ISAMB_DEBUG
+ logf(LOG_DEBUG,"isamb_pp_forward (f) returning notfound (B) "
+ "at level %d node %d ofs=%d sz=%d",
+ pp->level, p->pos, p->offset, p->size);
+#endif
+ return 0; /* could not find a leaf */
+ }
+ do{
+ if (isamb_pp_forward_on_leaf( pp, buf, untilbuf)) {
+#if ISAMB_DEBUG
+ logf(LOG_DEBUG,"isamb_pp_forward (f) returning (C) "
+ "at level %d node %d ofs=%d sz=%d",
+ pp->level, p->pos, p->offset, p->size);