Lines Matching refs:wp
307 _avl_walk_init(uu_avl_walk_t *wp, uu_avl_t *ap, uint32_t flags)
314 (void) memset(wp, 0, sizeof (*wp));
315 wp->uaw_avl = ap;
316 wp->uaw_robust = robust;
317 wp->uaw_dir = direction;
320 wp->uaw_next_result = avl_first(&ap->ua_tree);
322 wp->uaw_next_result = avl_last(&ap->ua_tree);
325 wp->uaw_next = next = &ap->ua_null_walk;
326 wp->uaw_prev = prev = next->uaw_prev;
327 next->uaw_prev = wp;
328 prev->uaw_next = wp;
333 _avl_walk_advance(uu_avl_walk_t *wp, uu_avl_t *ap)
335 void *np = wp->uaw_next_result;
342 wp->uaw_next_result = (wp->uaw_dir > 0)? AVL_NEXT(t, np) :
349 _avl_walk_fini(uu_avl_walk_t *wp)
351 if (wp->uaw_next != NULL) {
352 wp->uaw_next->uaw_prev = wp->uaw_prev;
353 wp->uaw_prev->uaw_next = wp->uaw_next;
354 wp->uaw_next = NULL;
355 wp->uaw_prev = NULL;
357 wp->uaw_avl = NULL;
358 wp->uaw_next_result = NULL;
364 uu_avl_walk_t *wp;
371 wp = uu_zalloc(sizeof (*wp));
372 if (wp == NULL) {
377 _avl_walk_init(wp, ap, flags);
378 return (wp);
382 uu_avl_walk_next(uu_avl_walk_t *wp)
384 return (_avl_walk_advance(wp, wp->uaw_avl));
388 uu_avl_walk_end(uu_avl_walk_t *wp)
390 _avl_walk_fini(wp);
391 uu_free(wp);
422 uu_avl_walk_t *wp;
438 for (wp = ap->ua_null_walk.uaw_next; wp != &ap->ua_null_walk;
439 wp = wp->uaw_next) {
440 if (wp->uaw_robust) {
441 if (elem == wp->uaw_next_result)
442 (void) _avl_walk_advance(wp, ap);
443 } else if (wp->uaw_next_result != NULL) {