|
| #define | NewAVLCompareItemsUPP(userRoutine) |
| |
| #define | NewAVLItemSizeUPP(userRoutine) |
| |
| #define | NewAVLDisposeItemUPP(userRoutine) |
| |
| #define | NewAVLWalkUPP(userRoutine) |
| |
|
#define | DisposeAVLCompareItemsUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| |
|
#define | DisposeAVLItemSizeUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| |
|
#define | DisposeAVLDisposeItemUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| |
|
#define | DisposeAVLWalkUPP(userUPP) DisposeRoutineDescriptor(userUPP) |
| |
| #define | InvokeAVLCompareItemsUPP(tree, i1, i2, nd_typ, userUPP) |
| |
| #define | InvokeAVLItemSizeUPP(tree, itemPtr, userUPP) |
| |
|
#define | InvokeAVLDisposeItemUPP(tree, dataP, userUPP) CALL_TWO_PARAMETER_UPP((userUPP), uppAVLDisposeItemProcInfo, (tree), (dataP)) |
| |
| #define | InvokeAVLWalkUPP(tree, dataP, visitStage, node, level, balance, refCon, userUPP) |
| |
| #define | NewAVLCompareItemsProc(userRoutine) NewAVLCompareItemsUPP(userRoutine) |
| |
|
#define | NewAVLItemSizeProc(userRoutine) NewAVLItemSizeUPP(userRoutine) |
| |
|
#define | NewAVLDisposeItemProc(userRoutine) NewAVLDisposeItemUPP(userRoutine) |
| |
|
#define | NewAVLWalkProc(userRoutine) NewAVLWalkUPP(userRoutine) |
| |
|
#define | CallAVLCompareItemsProc(userRoutine, tree, i1, i2, nd_typ) InvokeAVLCompareItemsUPP(tree, i1, i2, nd_typ, userRoutine) |
| |
|
#define | CallAVLItemSizeProc(userRoutine, tree, itemPtr) InvokeAVLItemSizeUPP(tree, itemPtr, userRoutine) |
| |
|
#define | CallAVLDisposeItemProc(userRoutine, tree, dataP) InvokeAVLDisposeItemUPP(tree, dataP, userRoutine) |
| |
| #define | CallAVLWalkProc(userRoutine, tree, dataP, visitStage, node, level, balance, refCon) |
| |
|
| enum | { kAVLFlagUseHandleForDataStorageMask = 0x00000001
} |
| |
| enum | { kAVLPreOrder = 0
, kAVLInOrder = 1
, kAVLPostOrder = 2
} |
| |
| enum | { kAVLLeftToRight = 0
, kAVLRightToLeft = 1
} |
| |
| enum | {
kAVLIsTree = 0
, kAVLIsLeftBranch = 1
, kAVLIsRightBranch = 2
, kAVLIsLeaf = 3
,
kAVLNullNode = 4
} |
| |
| enum | {
errItemAlreadyInTree = -960
, errNotValidTree = -961
, errItemNotFoundInTree = -962
, errCanNotInsertWhileWalkProcInProgress = -963
,
errTreeIsLocked = -964
, errTreeIsCorrupt = -965
} |
| |
| enum | { uppAVLCompareItemsProcInfo = 0x00002FF0
} |
| |
| enum | { uppAVLItemSizeProcInfo = 0x000003F0
} |
| |
| enum | { uppAVLDisposeItemProcInfo = 0x000003C0
} |
| |
| enum | { uppAVLWalkProcInfo = 0x000FEBE0
} |
| |
|
| typedef | CALLBACK_API (SInt32, AVLCompareItemsProcPtr)(AVLTreePtr tree |
| |
| typedef | CALLBACK_API (UInt32, AVLItemSizeProcPtr)(AVLTreePtr tree |
| |
| typedef | CALLBACK_API (void, AVLDisposeItemProcPtr)(AVLTreePtr tree |
| |
| typedef | CALLBACK_API (OSErr, AVLWalkProcPtr)(AVLTreePtr tree |
| |
|
typedef | STACK_UPP_TYPE (AVLCompareItemsProcPtr) AVLCompareItemsUPP |
| |
|
typedef | STACK_UPP_TYPE (AVLItemSizeProcPtr) AVLItemSizeUPP |
| |
|
typedef | STACK_UPP_TYPE (AVLDisposeItemProcPtr) AVLDisposeItemUPP |
| |
|
typedef | STACK_UPP_TYPE (AVLWalkProcPtr) AVLWalkUPP |
| |
| AVLCompareItemsUPP | NewAVLCompareItemsUPP (AVLCompareItemsProcPtr userRoutine) |
| |
| AVLItemSizeUPP | NewAVLItemSizeUPP (AVLItemSizeProcPtr userRoutine) |
| |
| AVLDisposeItemUPP | NewAVLDisposeItemUPP (AVLDisposeItemProcPtr userRoutine) |
| |
| AVLWalkUPP | NewAVLWalkUPP (AVLWalkProcPtr userRoutine) |
| |
| void | DisposeAVLCompareItemsUPP (AVLCompareItemsUPP userUPP) |
| |
| void | DisposeAVLItemSizeUPP (AVLItemSizeUPP userUPP) |
| |
| void | DisposeAVLDisposeItemUPP (AVLDisposeItemUPP userUPP) |
| |
| void | DisposeAVLWalkUPP (AVLWalkUPP userUPP) |
| |
| SInt32 | InvokeAVLCompareItemsUPP (AVLTreePtr tree, const void *i1, const void *i2, AVLNodeType nd_typ, AVLCompareItemsUPP userUPP) |
| |
| UInt32 | InvokeAVLItemSizeUPP (AVLTreePtr tree, const void *itemPtr, AVLItemSizeUPP userUPP) |
| |
| void | InvokeAVLDisposeItemUPP (AVLTreePtr tree, const void *dataP, AVLDisposeItemUPP userUPP) |
| |
| OSErr | InvokeAVLWalkUPP (AVLTreePtr tree, const void *dataP, AVLVisitStage visitStage, AVLNodeType node, UInt32 level, SInt32 balance, void *refCon, AVLWalkUPP userUPP) |
| |
| OSErr | AVLInit (UInt32 flags, AVLCompareItemsUPP compareItemsProc, AVLItemSizeUPP sizeItemProc, AVLDisposeItemUPP disposeItemProc, void *refCon, AVLTreePtr *tree) |
| |
| OSErr | AVLDispose (AVLTreePtr *tree, AVLOrder order) |
| |
| OSErr | AVLWalk (AVLTreePtr tree, AVLWalkUPP walkProc, AVLOrder order, void *walkRefCon) |
| |
| OSErr | AVLCount (AVLTreePtr tree, UInt32 *count) |
| |
| OSErr | AVLGetIndItem (AVLTreePtr tree, UInt32 index, void *dataPtr, UInt32 *itemSize) |
| |
| OSErr | AVLInsert (AVLTreePtr tree, const void *data) |
| |
| OSErr | AVLRemove (AVLTreePtr tree, const void *key, void *dataPtr, UInt32 *itemSize) |
| |
| OSErr | AVLFind (AVLTreePtr tree, const void *key, void *dataPtr, UInt32 *itemSize) |
| |
| OSErr | AVLGetRefcon (AVLTreePtr tree, void **refCon) |
| |
| OSErr | AVLLockTree (AVLTreePtr tree) |
| |
| OSErr | AVLUnlockTree (AVLTreePtr tree) |
| |
| OSErr | AVLCheckTree (AVLTreePtr tree) |
| |
Prototypes for routines which create, destroy, allow for.
Version: Universal Interfaces 3.4.1
- Copyright: � 1999-2001 by Apple Computer, Inc., all rights reserved.
For bug reports, consult the following page on the World Wide Web:
http://developer.apple.com/bugreporter/
Iterate across all of the items in the tree, in the order specified. kLeftToRight is basically lowest-to-highest order, kRightToLeft is highest-to-lowest order. For each node in the tree, it will call the walkProc with three messages ( at the appropriate time ). First, with kAVLPreOrder when the walking gets to this node in the tree, before handling either the left or right subtree, secondly, with kAVLInOrder after handling one subtree but before handling the other, and lastly with kAVLPostOrder after handling both subtrees. If you want to handle items in order, then only do something if the visit stage is kAVLInOrder. You can only call AVLRemove() from inside a walkProc if visit stage is kAVLPostOrder ( because if you remove a node during the pre or in order stages you will corrupt the list ) OR if you return a non-zero result from the walkProc call which called AVLRemove() to immediately terminate the walkProc. Do not call AVLInsert() to insert a node into the tree from inside a walkProc. The walkProc function gets called with the AVLTreePtr, a pointer to the data for the current node ( which you can change in place as long as you do not affect the order within the tree ), the visit stage, the type of the current node ( leaf node, right or left branch, or full tree ), the level within the tree ( the root is level 1 ), the balance for the current node, and the refCon passed to AVLWalk(). This refCon is different from the one passed into AVLInit(); use AVLGetRefCon() to get that refCon if you want it inside a walkProc. ( Most walkProcs will not care about the values for node type, level, or balance. ) AVLWalk()
- Non-Carbon CFM: in InterfaceLib 9.0 and later
- Carbon Lib: in CarbonLib 1.0 and later
- Mac OS X: in version 10.0 and later
| typedef CALLBACK_API |
( |
OSErr |
, |
|
|
AVLWalkProcPtr |
|
|
) |
| |
The common way to iterate across all of the items in a tree is via AVLWalk(), which takes a walkProcPtr. This function will get called for every item in the tree three times, as the tree is being walked across. First, the walkProc will get called with visitStage == kAVLPreOrder, at which point internally the node of the tree for the given data has just been reached. Later, this function will get called with visitStage == kAVLInOrder, and lastly this function will get called with visitStage == kAVLPostOrder. The 'minimum' item in the tree will get called with visitStage == kInOrder first, followed by the 'next' item in the tree, up until the last item in the tree structure is called. In general, you'll only care about calls to this function when visitStage == kAVLInOrder.
| typedef CALLBACK_API |
( |
SInt32 |
, |
|
|
AVLCompareItemsProcPtr |
|
|
) |
| |
Every tree must have a function which compares the data for two items and returns < 0, 0, or >0 for the items - < 0 if the first item is 'before' the second item according to some criteria, == 0 if the two items are identical according to the criteria, or > 0 if the first item is 'after' the second item according to the criteria. The comparison function is also passed the node type, but most of the time this can be ignored.