Lines Matching defs:wp
308 _avl_walk_init(uu_avl_walk_t *wp, uu_avl_t *ap, uint32_t flags)
315 (void) memset(wp, 0, sizeof (*wp));
316 wp->uaw_avl = ap;
317 wp->uaw_robust = robust;
318 wp->uaw_dir = direction;
321 wp->uaw_next_result = avl_first(&ap->ua_tree);
323 wp->uaw_next_result = avl_last(&ap->ua_tree);
326 wp->uaw_next = next = &ap->ua_null_walk;
327 wp->uaw_prev = prev = next->uaw_prev;
328 next->uaw_prev = wp;
329 prev->uaw_next = wp;
334 _avl_walk_advance(uu_avl_walk_t *wp, uu_avl_t *ap)
336 void *np = wp->uaw_next_result;
343 wp->uaw_next_result = (wp->uaw_dir > 0)? AVL_NEXT(t, np) :
350 _avl_walk_fini(uu_avl_walk_t *wp)
352 if (wp->uaw_next != NULL) {
353 wp->uaw_next->uaw_prev = wp->uaw_prev;
354 wp->uaw_prev->uaw_next = wp->uaw_next;
355 wp->uaw_next = NULL;
356 wp->uaw_prev = NULL;
358 wp->uaw_avl = NULL;
359 wp->uaw_next_result = NULL;
365 uu_avl_walk_t *wp;
372 wp = uu_zalloc(sizeof (*wp));
373 if (wp == NULL) {
378 _avl_walk_init(wp, ap, flags);
379 return (wp);
383 uu_avl_walk_next(uu_avl_walk_t *wp)
385 return (_avl_walk_advance(wp, wp->uaw_avl));
389 uu_avl_walk_end(uu_avl_walk_t *wp)
391 _avl_walk_fini(wp);
392 uu_free(wp);
423 uu_avl_walk_t *wp;
439 for (wp = ap->ua_null_walk.uaw_next; wp != &ap->ua_null_walk;
440 wp = wp->uaw_next) {
441 if (wp->uaw_robust) {
442 if (elem == wp->uaw_next_result)
443 (void) _avl_walk_advance(wp, ap);
444 } else if (wp->uaw_next_result != NULL) {