The BBTreeNode_ structure implements the BBTree tree nodes.

struct BBTreeNode_ {
  //@args
  void *LTKID;
  void *RTKID;
};

The BBTree

memory
Where the BBTree nodes are allocated.
struct BBTree_ {
  //@args       Memory memory
  Memory MEMORY;
  void* ROOT;           // The root node.
  int32_t COUNT;        // Current count of entries.
};
BBTree_count— This BBTree count of entries.
static inline int32_t
BBTree_count(const_BBTree this)
{
  return BBTree_COUNT(this);
}
BBTree_setRoot— Set the BBTree root.
new_root
New root to be set.
static inline void
BBTree_setRoot(BBTree this, void* new_root)
{
  *BBTree__ROOT(this) = new_root;
}
BBTree_getRoot— Set the BBTree root.
Return
The tree root.
static inline void*
BBTree_getRoot(const_BBTree this)
{
  return (BBTree_ROOT(this));
}
BBTreeNode_getLTKID— Get left kid.
static inline void *
BBTreeNode_getLTKID(void *node)
{
    unsigned char* header = ((unsigned char*)node) - sizeof(BBTreeNode_);
    return BBTreeNode_LTKID((BBTreeNode)((void*)header));
}
BBTreeNode_getRTKID— Get right kid.
static inline void *
BBTreeNode_getRTKID(void *node)
{
    unsigned char* header = ((unsigned char*)node) - sizeof(BBTreeNode_);
    return BBTreeNode_RTKID((BBTreeNode)((void*)header));
}
BBTree_insert— Insert in the BBTree tree.
size
The size of the element to add
Return
value.
void *
BBTree_createNode(BBTree this,int32_t size);
BBTreeNode_attachKids— Connect two kids to a node. If kids already existed they are just overwritten.
left
Left kid
right
Right kid
void
BBTreeNode_attachKids(void* node,void* left,void* right);
BBTreeNode_attachLeftKid— Connect a kid to a node as left child. If kid already existed it is just overwritten.
left
Left kid
void
BBTreeNode_attachLeftKid(void* node,void* left);
BBTreeNode_attachRightKid— Connect a kid to a node as right child. If kid already existed it is just overwritten.
right
Right kid
void
BBTreeNode_attachRightKid(void* node,void* right);
BBTree_attachTree— Connect two trees as kids of a node. If kids already existed they are just overwritten. Please note that the trees to be connected are no longer valid after this call and they cannot be used any longer, but the object deallocation must be performed by the client.
left
Left tree
right
Right tree
void
BBTree_attachTrees(BBTree this, void* node,BBTree left,BBTree right);
BBTree_attachLeftTree— Connect a tree as left kid of a node. If kid already existed they are just overwritten. Please note that the trees to be connected are no longer valid after this call and they cannot be used any longer, but the object deallocation must be performed by the client.
left
Left Tree
void
BBTree_attachLeftTree(BBTree this, void* node,BBTree left);
BBTree_attachRightTree— Connect a tree as right kid of a node.If kid already existed they are just overwritten. Please note that the trees to be connected are no longer valid after this call and they cannot be used any longer, but the object deallocation must be performed by the client.
right
Right Tree
void
BBTree_attachRightTree(BBTree this, void* node,BBTree right);
BBTree_dfs— DFS walk of the BBTree entries using the supplied map function.
void
BBTree_dfs(BBTree this, void (*map)(void *, va_list), ...);