25 # define TBBT_INTERNALS 41 # define Parent link[PARENT] 42 # define Lchild link[LEFT] 43 # define Rchild link[RIGHT] 44 # define TBBT_FLAG unsigned long 45 # define TBBT_LEAF unsigned long 47 # define TBBT_HEAVY(s) s 48 # define TBBT_DOUBLE 4 49 # define TBBT_INTERN 8 50 # define TBBT_UNBAL ( TBBT_HEAVY(LEFT) | TBBT_HEAVY(RIGHT) ) 51 # define TBBT_FLAGS ( TBBT_UNBAL | TBBT_INTERN | TBBT_DOUBLE ) 52 # define TBBT_CHILD(s) ( TBBT_INTERN | TBBT_HEAVY(s) ) 55 # define LeftCnt(node) ( (node)->lcnt ) 56 # define RightCnt(node) ( (node)->rcnt ) 57 #if defined macintosh || defined MAC || defined SYMANTEC_C 58 # define Cnt(node,s) ( 1==(s) ? LeftCnt(node) : RightCnt(node) ) 60 # define Cnt(node,s) ( LEFT==(s) ? LeftCnt(node) : RightCnt(node) ) 62 # define HasChild(n,s) ( Cnt(n,s)>0 ) 63 # define Heavy(n,s) ( (s) & (LeftCnt(n)>RightCnt(n) ? LEFT : \ 64 LeftCnt(n)==RightCnt(n) ? 0 : RIGHT)) 65 # define Intern(n) ( LeftCnt(n) && RightCnt(n) ) 66 # define UnBal(n) ( LeftCnt(n)>RightCnt(n) ? LEFT : \ 67 LeftCnt(n)==RightCnt(n) ? 0 : RIGHT) 68 # define Double(n) ( TBBT_DOUBLE & (n)->flags ) 69 # define Other(side) ( LEFT + RIGHT - (side) ) 70 # define Delta(n,s) ( ( Heavy(n,s) ? 1 : -1 ) \ 71 * ( Double(n) ? 2 : UnBal(n) ? 1 : 0 ) ) 72 # define SetFlags(n,s,b,i) ( ( -2<(b) && (b)<2 ? 0 : TBBT_DOUBLE ) \ 73 | ( 0>(b) ? TBBT_HEAVY(s) : (b)>0 ? TBBT_HEAVY(Other(s)) : 0 ) \ 74 | ( (i) ? TBBT_INTERN : 0 ) ) 87 intn (*compar) (VOIDP k1, VOIDP k2, intn cmparg);
93 #define TBBT_FAST_UINT16_COMPARE 1 94 #define TBBT_FAST_INT32_COMPARE 2 96 #ifndef TBBT_INTERNALS 101 #define Max(a,b) ( (a) > (b) ? (a) : (b) ) 150 #if defined c_plusplus || defined __cplusplus 156 (intn (*compar) (VOIDP, VOIDP, intn), intn
arg, uintn fast_compare);
220 (
TBBT_NODE * root, VOIDP key, intn (*cmp) (VOIDP, VOIDP, intn),
225 (
TBBT_NODE * root, VOIDP key, intn (*cmp) (VOIDP, VOIDP, intn),
250 (
TBBT_TREE * tree, VOIDP item, VOIDP key);
252 (
TBBT_NODE ** root, VOIDP item, VOIDP key, intn (*cmp) (VOIDP, VOIDP, intn), intn arg);
292 (
TBBT_TREE * tree, VOID(*fd) (VOIDP), VOID(*fk) (VOIDP));
294 (
TBBT_NODE ** root, VOID(*fd) (VOIDP), VOID(*fk) (VOIDP));
326 #if defined c_plusplus || defined __cplusplus HDFFCLIBAPI intf intf intf * count
HDFLIBAPI TBBT_NODE * tbbtnext(TBBT_NODE *node)
HDFLIBAPI TBBT_NODE * tbbtprev(TBBT_NODE *node)
HDFLIBAPI TBBT_NODE * tbbtlast(TBBT_NODE *root)
HDFLIBAPI TBBT_NODE * tbbtless(TBBT_NODE *root, VOIDP key, intn(*cmp)(VOIDP, VOIDP, intn), intn arg, TBBT_NODE **pp)
HDFLIBAPI TBBT_NODE * tbbtindx(TBBT_NODE *root, int32 indx)
HDFLIBAPI TBBT_NODE * tbbtdfind(TBBT_TREE *tree, VOIDP key, TBBT_NODE **pp)
HDFLIBAPI TBBT_NODE * tbbtins(TBBT_NODE **root, VOIDP item, VOIDP key, intn(*cmp)(VOIDP, VOIDP, intn), intn arg)
HDFLIBAPI VOIDP tbbtrem(TBBT_NODE **root, TBBT_NODE *node, VOIDP *kp)
HDFLIBAPI TBBT_NODE * tbbtfirst(TBBT_NODE *root)
HDFLIBAPI TBBT_NODE * tbbtdless(TBBT_TREE *tree, VOIDP key, TBBT_NODE **pp)
HDFLIBAPI VOID tbbtprint(TBBT_NODE *node)
HDFLIBAPI long tbbtcount(TBBT_TREE *tree)
HDFPUBLIC intn tbbt_shutdown(void)
HDFLIBAPI TBBT_TREE * tbbtdmake(intn(*compar)(VOIDP, VOIDP, intn), intn arg, uintn fast_compare)
HDFLIBAPI TBBT_NODE * tbbtfind(TBBT_NODE *root, VOIDP key, intn(*cmp)(VOIDP, VOIDP, intn), intn arg, TBBT_NODE **pp)
HDFLIBAPI VOID tbbtdump(TBBT_TREE *tree, intn method)
HDFFCLIBAPI intf intf * flags
HDFLIBAPI TBBT_NODE * tbbtdins(TBBT_TREE *tree, VOIDP item, VOIDP key)
HDFLIBAPI TBBT_TREE * tbbtdfree(TBBT_TREE *tree, VOID(*fd)(VOIDP), VOID(*fk)(VOIDP))
HDFLIBAPI VOID tbbtfree(TBBT_NODE **root, VOID(*fd)(VOIDP), VOID(*fk)(VOIDP))