Changeset 7 in kStuff for trunk/include/k/kAvlTmpl/kAvlGetWithParent.h
- Timestamp:
- Feb 4, 2008 2:08:02 AM (17 years ago)
- File:
-
- 1 edited
-
trunk/include/k/kAvlTmpl/kAvlGetWithParent.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/k/kAvlTmpl/kAvlGetWithParent.h
r2 r7 37 37 * The tree remains unchanged. 38 38 * 39 * @returns Pointer to the node holding the given key.40 * @param ppTree Pointer to the AVL-tree root node pointer.41 * @param ppParentPointer to a variable which will hold the pointer to the partent node on39 * @returns Pointer to the node holding the given key. 40 * @param pRoot Pointer to the AVL-tree root structure. 41 * @param ppParent Pointer to a variable which will hold the pointer to the partent node on 42 42 * return. When no node is found, this will hold the last searched node. 43 * @param KeyKey value of the node which is to be found.43 * @param Key Key value of the node which is to be found. 44 44 */ 45 KAVL_DECL(KAVLNODE *) KAVL_FN(GetWithParent)(KAVL TREEPTR *ppTree, KAVLNODE **ppParent, KAVLKEY Key)45 KAVL_DECL(KAVLNODE *) KAVL_FN(GetWithParent)(KAVLROOT *pRoot, KAVLNODE **ppParent, KAVLKEY Key) 46 46 { 47 register KAVLNODE *pNode = KAVL_GET_POINTER_NULL(ppTree);48 register KAVLNODE *pParent = NULL;47 register KAVLNODE *pNode; 48 register KAVLNODE *pParent; 49 49 50 KAVL_READ_LOCK(pRoot); 51 52 pParent = NULL; 53 pNode = KAVL_GET_POINTER_NULL(&pRoot->mpRoot); 50 54 while ( pNode != NULL 51 55 && KAVL_NE(pNode->mKey, Key)) … … 58 62 } 59 63 64 KAVL_UNLOCK(pRoot); 65 60 66 *ppParent = pParent; 61 67 return pNode;
Note:
See TracChangeset
for help on using the changeset viewer.

