2 .\" This file and its contents are supplied under the terms of the
3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 .\" You may only use this file in accordance with the terms of version
7 .\" A full copy of the text of the CDDL should have accompanied this
8 .\" source. A copy of the CDDL is also available via the Internet at
9 .\" http://www.illumos.org/license/CDDL.
12 .\" Copyright 2015 Joyent, Inc.
19 .Nd find a node in an AVL tree
25 .Fa "avl_tree_t *tree"
26 .Fa "const void *node"
27 .Fa "avl_index_t *where"
32 function is used to look up a node in the tree rooted at
35 To perform a lookup, a caller should construct an instance of the data
36 structure, the argument
39 searches through the tree for a node which compares equal to the passed
42 using the comparison function specified when the tree was created with
46 that need to be initialized are those that the comparison function will
47 use, the others may remain uninitialized.
49 If a match exists in the tree, then that entry will be returned.
56 does not match anything in the tree and the value of
62 will be updated to a value that can be used with both
65 .Xr avl_nearest 3AVL .
66 This value is only valid as long as the tree is not modified.
67 If anything is added or removed from the tree, then the value of
70 This is commonly used as part of a pattern to see if something that should be
71 added to the tree already exists, and if not, insert it.
72 For more information, see the examples in
75 If the lookup is successful, then the contents of
81 matches an entry in the tree, the matching entry is returned.
88 it is updated to point to a location in the tree.
94 .Sh INTERFACE STABILITY
102 .Xr avl_create 3AVL ,
103 .Xr avl_insert 3AVL ,
104 .Xr avl_nearest 3AVL ,