GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > LDT / V0-4-0
Constituent: encdec     Tag: rad750
#include <stdlib.h>
#include "LDT/BTREE.h"

Functions | |
| void | BTREE_init (BTREE *tree, BTREE_destroy destroy) |
| Initializes the context control structure. | |
| void | BTREE_free (BTREE *tree) |
| Frees all the data associated with the specified tree. | |
| int | BTREE_insertL (BTREE *tree, BTREE_node *node, const void *data) |
| Inserts the data as the left node of the specified node. | |
| int | BTREE_insertR (BTREE *tree, BTREE_node *node, const void *data) |
| Inserts the data as the right node of the specified node. | |
| void | BTREE_removeL (BTREE *tree, BTREE_node *node) |
| Removes the left node and all its branches. | |
| void | BTREE_removeR (BTREE *tree, BTREE_node *node) |
| Removes the right node and all its branches. | |
| int | BTREE_merge (BTREE *merge, BTREE *left, BTREE *right, const void *data) |
| Merges two trees into a single parent tree, adding the data of the merged tree. | |
CVS $Id
| void BTREE_free | ( | BTREE * | tree | ) |
Frees all the data associated with the specified tree.
| tree | The root of the tree to free |
| void BTREE_init | ( | BTREE * | tree, | |
| BTREE_destroy | destroy | |||
| ) |
Initializes the context control structure.
| tree | The binary tree context to initialize | |
| destroy | Callback function to free the nodes in a binary tree, may be NULL. |
| int BTREE_insertL | ( | BTREE * | tree, | |
| BTREE_node * | node, | |||
| const void * | data | |||
| ) |
Inserts the data as the left node of the specified node.
| 0,if | successful | |
| -1,if | failure |
| tree | The binary tree | |
| node | The parent node, may be NULL if this is the first node | |
| data | Pointer to the data to be inserted |
| int BTREE_insertR | ( | BTREE * | tree, | |
| BTREE_node * | node, | |||
| const void * | data | |||
| ) |
Inserts the data as the right node of the specified node.
| 0,if | successful | |
| -1,if | failure |
| tree | The binary tree | |
| node | The parent node, may be NULL if this is the first node | |
| data | Pointer to the data to be inserted |
Merges two trees into a single parent tree, adding the data of the merged tree.
| merge | The merged tree | |
| left | The left tree to merge | |
| right | The right tree to merge | |
| data | The data to add |
| void BTREE_removeL | ( | BTREE * | tree, | |
| BTREE_node * | node | |||
| ) |
Removes the left node and all its branches.
| tree | The binary tree | |
| node | The parent node |
| void BTREE_removeR | ( | BTREE * | tree, | |
| BTREE_node * | node | |||
| ) |
Removes the right node and all its branches.
| tree | The binary tree | |
| node | The parent node |
1.5.3