core: rename btree to bst
This commit is contained in:
@@ -10,8 +10,8 @@
|
||||
|
||||
FX_DECLS_BEGIN;
|
||||
|
||||
#define FX_BTREE_INIT {0}
|
||||
#define FX_TYPE_BTREE_ITERATOR (fx_bst_iterator_get_type())
|
||||
#define FX_BST_INIT {0}
|
||||
#define FX_TYPE_BST_ITERATOR (fx_bst_iterator_get_type())
|
||||
|
||||
FX_DECLARE_TYPE(fx_bst_iterator);
|
||||
|
||||
@@ -33,7 +33,7 @@ FX_TYPE_CLASS_DECLARATION_END(fx_bst_iterator)
|
||||
You would use the following call to generate an insert function for a tree
|
||||
with this node type:
|
||||
|
||||
BTREE_DEFINE_SIMPLE_INSERT(
|
||||
BST_DEFINE_SIMPLE_INSERT(
|
||||
struct my_tree_node,
|
||||
base,
|
||||
key,
|
||||
@@ -51,7 +51,7 @@ FX_TYPE_CLASS_DECLARATION_END(fx_bst_iterator)
|
||||
custom type.
|
||||
@param function_name the name of the function to generate.
|
||||
*/
|
||||
#define FX_BTREE_DEFINE_SIMPLE_INSERT( \
|
||||
#define FX_BST_DEFINE_SIMPLE_INSERT( \
|
||||
node_type, container_node_member, container_key_member, function_name) \
|
||||
void function_name(fx_bst *tree, node_type *node) \
|
||||
{ \
|
||||
@@ -122,7 +122,7 @@ FX_TYPE_CLASS_DECLARATION_END(fx_bst_iterator)
|
||||
You would use the following call to generate an insert function for a tree
|
||||
with this node type:
|
||||
|
||||
BTREE_DEFINE_INSERT(struct my_tree_node, base, key, my_tree_node_insert,
|
||||
BST_DEFINE_INSERT(struct my_tree_node, base, key, my_tree_node_insert,
|
||||
my_comparator);
|
||||
|
||||
Which would emit a function defined like:
|
||||
@@ -139,7 +139,7 @@ FX_TYPE_CLASS_DECLARATION_END(fx_bst_iterator)
|
||||
@param comparator the name of a comparator function or functional-macro that
|
||||
conforms to the requirements listed above.
|
||||
*/
|
||||
#define FX_BTREE_DEFINE_INSERT( \
|
||||
#define FX_BST_DEFINE_INSERT( \
|
||||
node_type, container_node_member, container_key_member, function_name, \
|
||||
comparator) \
|
||||
void function_name(fx_bst *tree, node_type *node) \
|
||||
@@ -200,7 +200,7 @@ FX_TYPE_CLASS_DECLARATION_END(fx_bst_iterator)
|
||||
You would use the following call to generate a search function for a tree
|
||||
with this node type:
|
||||
|
||||
BTREE_DEFINE_SIMPLE_GET(struct my_tree_node, int, base, key,
|
||||
BST_DEFINE_SIMPLE_GET(struct my_tree_node, int, base, key,
|
||||
my_tree_node_get);
|
||||
|
||||
Which would emit a function defined like:
|
||||
@@ -217,7 +217,7 @@ FX_TYPE_CLASS_DECLARATION_END(fx_bst_iterator)
|
||||
custom type.
|
||||
@param function_name the name of the function to generate.
|
||||
*/
|
||||
#define FX_BTREE_DEFINE_SIMPLE_GET( \
|
||||
#define FX_BST_DEFINE_SIMPLE_GET( \
|
||||
node_type, key_type, container_node_member, container_key_member, \
|
||||
function_name) \
|
||||
node_type *function_name(const fx_bst *tree, key_type key) \
|
||||
@@ -263,7 +263,7 @@ FX_API fx_type fx_bst_iterator_get_type(void);
|
||||
|
||||
/* re-balance a binary tree after an insertion operation.
|
||||
|
||||
NOTE that, if you define an insertion function using BTREE_DEFINE_INSERT or
|
||||
NOTE that, if you define an insertion function using BST_DEFINE_INSERT or
|
||||
similar, this function will automatically called for you.
|
||||
|
||||
@param tree the tree to re-balance.
|
||||
Reference in New Issue
Block a user