Changeset 96 in vbox
- Timestamp:
- Jan 17, 2007 1:22:21 PM (18 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
- 1 copied
-
include/iprt/avl.h (modified) (1 diff)
-
src/VBox/Runtime/Makefile (modified) (2 diffs)
-
src/VBox/Runtime/table/avlgcptr.cpp (copied) (copied from trunk/src/VBox/Runtime/table/avlpv.cpp ) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/avl.h
r92 r96 260 260 261 261 262 /** AVL tree of RTGCPTRs. 263 * @{ 264 */ 265 266 /** 267 * AVL Core node. 268 */ 269 typedef struct _AVLGCPtrNodeCore 270 { 271 /** Key value. */ 272 RTGCPTR Key; 273 /** Pointer to the left node. */ 274 struct _AVLGCPtrNodeCore *pLeft; 275 /** Pointer to the right node. */ 276 struct _AVLGCPtrNodeCore *pRight; 277 /** Height of this tree: max(height(left), height(right)) + 1 */ 278 unsigned char uchHeight; 279 } AVLGCPTRNODECORE, *PAVLGCPTRNODECORE, **PPAVLGCPTRNODECORE; 280 281 /** A tree of RTGCPTR keys. */ 282 typedef PAVLGCPTRNODECORE AVLGCPTRTREE; 283 /** Pointer to a tree of RTGCPTR keys. */ 284 typedef PPAVLGCPTRNODECORE PAVLGCPTRTREE; 285 286 /** Callback function for RTAvlroGCPtrDoWithAll(). */ 287 typedef DECLCALLBACK(int) AVLGCPTRCALLBACK(PAVLGCPTRNODECORE pNode, void *pvUser); 288 /** Pointer to callback function for RTAvlroGCPtrDoWithAll(). */ 289 typedef AVLGCPTRCALLBACK *PAVLGCPTRCALLBACK; 290 291 RTDECL(bool) RTAvlGCPtrInsert(PAVLGCPTRTREE pTree, PAVLGCPTRNODECORE pNode); 292 RTDECL(PAVLGCPTRNODECORE) RTAvlGCPtrRemove(PAVLGCPTRTREE pTree, RTGCPTR Key); 293 RTDECL(PAVLGCPTRNODECORE) RTAvlGCPtrGet(PAVLGCPTRTREE pTree, RTGCPTR Key); 294 RTDECL(int) RTAvlGCPtrDoWithAll(PAVLGCPTRTREE pTree, int fFromLeft, PAVLGCPTRCALLBACK pfnCallBack, void *pvParam); 295 RTDECL(PAVLGCPTRNODECORE) RTAvlGCPtrGetBestFit(PAVLGCPTRTREE ppTree, RTGCPTR Key, bool fAbove); 296 RTDECL(PAVLGCPTRNODECORE) RTAvlGCPtrRemoveBestFit(PAVLGCPTRTREE ppTree, RTGCPTR Key, bool fAbove); 297 RTDECL(int) RTAvlGCPtrDestroy(PAVLGCPTRTREE pTree, PAVLGCPTRCALLBACK pfnCallBack, void *pvParam); 298 299 /** @} */ 300 301 262 302 /** AVL tree of RTGCPTRs - using relative offsets internally. 263 303 * @{ -
trunk/src/VBox/Runtime/Makefile
r26 r96 123 123 assert.cpp \ 124 124 table/avlhcphys.cpp \ 125 table/avlgcptr.cpp \ 125 126 table/avlogcphys.cpp \ 126 127 table/avlogcptr.cpp \ … … 465 466 assert.cpp \ 466 467 table/avlhcphys.cpp \ 468 table/avlgcptr.cpp \ 467 469 table/avlogcphys.cpp \ 468 470 table/avlohcphys.cpp \ -
trunk/src/VBox/Runtime/table/avlgcptr.cpp
r23 r96 1 1 /* $Id$ */ 2 2 /** @file 3 * InnoTek Portable Runtime - AVL tree, void *, unique keys.3 * InnoTek Portable Runtime - AVL tree, RTGCPTR, unique keys. 4 4 */ 5 5 … … 30 30 * AVL configuration. 31 31 */ 32 #define KAVL_FN(a) RTAvl PV##a32 #define KAVL_FN(a) RTAvlGCPtr##a 33 33 #define KAVL_MAX_STACK 27 /* Up to 2^24 nodes. */ 34 34 #define KAVL_CHECK_FOR_EQUAL_INSERT 1 /* No duplicate keys! */ 35 #define KAVLNODECORE AVL PVNODECORE36 #define PKAVLNODECORE PAVL PVNODECORE37 #define PPKAVLNODECORE PPAVL PVNODECORE38 #define KAVLKEY AVLPVKEY39 #define PKAVLKEY P AVLPVKEY40 #define KAVLENUMDATA AVL PVENUMDATA41 #define PKAVLENUMDATA PAVL PVENUMDATA42 #define PKAVLCALLBACK PAVL PVCALLBACK35 #define KAVLNODECORE AVLGCPTRNODECORE 36 #define PKAVLNODECORE PAVLGCPTRNODECORE 37 #define PPKAVLNODECORE PPAVLGCPTRNODECORE 38 #define KAVLKEY RTGCPTR 39 #define PKAVLKEY PRTGCPTR 40 #define KAVLENUMDATA AVLGCPTRENUMDATA 41 #define PKAVLENUMDATA PAVLGCPTRENUMDATA 42 #define PKAVLCALLBACK PAVLGCPTRCALLBACK 43 43 44 44 … … 46 46 * AVL Compare macros 47 47 */ 48 #define KAVL_G(key1, key2) ( ( const char*)(key1) > (const char*)(key2) )49 #define KAVL_E(key1, key2) ( ( const char*)(key1) == (const char*)(key2) )50 #define KAVL_NE(key1, key2) ( ( const char*)(key1) != (const char*)(key2) )48 #define KAVL_G(key1, key2) ( (RTGCUINTPTR)(key1) > (RTGCUINTPTR)(key2) ) 49 #define KAVL_E(key1, key2) ( (RTGCUINTPTR)(key1) == (RTGCUINTPTR)(key2) ) 50 #define KAVL_NE(key1, key2) ( (RTGCUINTPTR)(key1) != (RTGCUINTPTR)(key2) ) 51 51 52 52
Note:
See TracChangeset
for help on using the changeset viewer.

