cdcontainers  0.1.1
Library of data containers and collections for C programming language.
Functions

Functions

enum cdc_stat cdc_avl_tree_ctor (struct cdc_avl_tree **t, struct cdc_data_info *info)
 Constructs an empty avl tree. More...
 
enum cdc_stat cdc_avl_tree_ctorl (struct cdc_avl_tree **t, struct cdc_data_info *info,...)
 Constructs an avl tree, initialized by an variable number of pointers on cdc_pair's(first - key, and the second - value). The last item must be CDC_END. More...
 
enum cdc_stat cdc_avl_tree_ctorv (struct cdc_avl_tree **t, struct cdc_data_info *info, va_list args)
 Constructs an avl tree, initialized by args. The last item must be CDC_END. More...
 
void cdc_avl_tree_dtor (struct cdc_avl_tree *t)
 Destroys the avl tree. More...
 

Detailed Description

Function Documentation

◆ cdc_avl_tree_ctor()

enum cdc_stat cdc_avl_tree_ctor ( struct cdc_avl_tree **  t,
struct cdc_data_info info 
)

Constructs an empty avl tree.

Parameters
[out]t- cdc_avl_tree
[in]info- cdc_data_info
Returns
CDC_STATUS_OK in a successful case or other value indicating an error.

◆ cdc_avl_tree_ctorl()

enum cdc_stat cdc_avl_tree_ctorl ( struct cdc_avl_tree **  t,
struct cdc_data_info info,
  ... 
)

Constructs an avl tree, initialized by an variable number of pointers on cdc_pair's(first - key, and the second - value). The last item must be CDC_END.

Parameters
[out]t- cdc_avl_tree
[in]info- cdc_data_info
Returns
CDC_STATUS_OK in a successful case or other value indicating an error.

Example:

struct cdc_avl_tree *tree = NULL;
...
if (cdc_avl_tree_ctorl(&tree, info, &value1, &value2, CDC_END) != CDC_STATUS_OK) {
// handle error
}

◆ cdc_avl_tree_ctorv()

enum cdc_stat cdc_avl_tree_ctorv ( struct cdc_avl_tree **  t,
struct cdc_data_info info,
va_list  args 
)

Constructs an avl tree, initialized by args. The last item must be CDC_END.

Parameters
[out]t- cdc_avl_tree
[in]info- cdc_data_info
Returns
CDC_STATUS_OK in a successful case or other value indicating an error.

◆ cdc_avl_tree_dtor()

void cdc_avl_tree_dtor ( struct cdc_avl_tree t)

Destroys the avl tree.

Parameters
[in]t- cdc_avl_tree