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

Functions

enum cdc_stat cdc_splay_tree_ctor (struct cdc_splay_tree **t, struct cdc_data_info *info)
 Constructs an empty splay tree. More...
 
enum cdc_stat cdc_splay_tree_ctorl (struct cdc_splay_tree **t, struct cdc_data_info *info,...)
 Constructs a splay 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_splay_tree_ctorv (struct cdc_splay_tree **t, struct cdc_data_info *info, va_list args)
 Constructs a splay tree, initialized by args. The last item must be CDC_END. More...
 
void cdc_splay_tree_dtor (struct cdc_splay_tree *t)
 Destroys the splay tree. More...
 

Detailed Description

Function Documentation

◆ cdc_splay_tree_ctor()

enum cdc_stat cdc_splay_tree_ctor ( struct cdc_splay_tree **  t,
struct cdc_data_info info 
)

Constructs an empty splay tree.

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

◆ cdc_splay_tree_ctorl()

enum cdc_stat cdc_splay_tree_ctorl ( struct cdc_splay_tree **  t,
struct cdc_data_info info,
  ... 
)

Constructs a splay 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_splay_tree
[in]info- cdc_data_info
Returns
CDC_STATUS_OK in a successful case or other value indicating an error.

Example:

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

◆ cdc_splay_tree_ctorv()

enum cdc_stat cdc_splay_tree_ctorv ( struct cdc_splay_tree **  t,
struct cdc_data_info info,
va_list  args 
)

Constructs a splay tree, initialized by args. The last item must be CDC_END.

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

◆ cdc_splay_tree_dtor()

void cdc_splay_tree_dtor ( struct cdc_splay_tree t)

Destroys the splay tree.

Parameters
[in]t- cdc_splay_tree