-#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);
-#endif
- return 1;
- }
- }while ( isamb_pp_find_next_leaf(pp));
- return 0; /* could not find at all */
- }
- else { /* no untilbuf, a straight read */
- /* FIXME - this should be moved
- * directly into the pp_read */
- /* keeping here now, to keep same
- * interface as the old fwd */
- if (isamb_pp_read_on_leaf( pp, buf)) {
-#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_forward (read) returning (D) "
- "at level %d node %d ofs=%d sz=%d",
- pp->level, p->pos, p->offset, p->size);
-#endif
- return 1;
- }
- if (isamb_pp_find_next_leaf(pp)) {
-#if ISAMB_DEBUG
- logf(LOG_DEBUG,"isamb_pp_forward (read) returning (E) "
- "at level %d node %d ofs=%d sz=%d",
- pp->level, p->pos, p->offset, p->size);
-#endif
- return isamb_pp_read_on_leaf(pp, buf);
- }
- else
- return 0;
- }
-} /* isam_pp_forward (new version) */