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

Functions

enum cdc_stat cdc_hash_table_ctor (struct cdc_hash_table **t, struct cdc_data_info *info)
 Constructs an empty hash table. More...
 
enum cdc_stat cdc_hash_table_ctorl (struct cdc_hash_table **t, struct cdc_data_info *info,...)
 Constructs a hash table, 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_hash_table_ctorv (struct cdc_hash_table **t, struct cdc_data_info *info, va_list args)
 Constructs a hash table, initialized by args. The last item must be CDC_END. More...
 
enum cdc_stat cdc_hash_table_ctor1 (struct cdc_hash_table **t, struct cdc_data_info *info, float load_factor)
 Constructs an empty hash table. More...
 
enum cdc_stat cdc_hash_table_ctorl1 (struct cdc_hash_table **t, struct cdc_data_info *info, float load_factor,...)
 Constructs a hash table, 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_hash_table_ctorv1 (struct cdc_hash_table **t, struct cdc_data_info *info, float load_factor, va_list args)
 Constructs a hash table, initialized by args. The last item must be CDC_END. More...
 
void cdc_hash_table_dtor (struct cdc_hash_table *t)
 Destroys the hash table. More...
 

Detailed Description

Function Documentation

◆ cdc_hash_table_ctor()

enum cdc_stat cdc_hash_table_ctor ( struct cdc_hash_table **  t,
struct cdc_data_info info 
)

Constructs an empty hash table.

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

◆ cdc_hash_table_ctorl()

enum cdc_stat cdc_hash_table_ctorl ( struct cdc_hash_table **  t,
struct cdc_data_info info,
  ... 
)

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

Example:

struct cdc_hash_table *table = NULL;
...
if (cdc_hash_table_ctorl(&table, info, &value1, &value2, CDC_END) != CDC_STATUS_OK) {
// handle error
}

◆ cdc_hash_table_ctorv()

enum cdc_stat cdc_hash_table_ctorv ( struct cdc_hash_table **  t,
struct cdc_data_info info,
va_list  args 
)

Constructs a hash table, initialized by args. The last item must be CDC_END.

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

◆ cdc_hash_table_ctor1()

enum cdc_stat cdc_hash_table_ctor1 ( struct cdc_hash_table **  t,
struct cdc_data_info info,
float  load_factor 
)

Constructs an empty hash table.

Parameters
[out]t- cdc_hash_table
[in]info- cdc_data_info
[in]load_factor- maximum load factor
Returns
CDC_STATUS_OK in a successful case or other value indicating an error.

◆ cdc_hash_table_ctorl1()

enum cdc_stat cdc_hash_table_ctorl1 ( struct cdc_hash_table **  t,
struct cdc_data_info info,
float  load_factor,
  ... 
)

Constructs a hash table, 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_hash_table
[in]info- cdc_data_info
[in]load_factor- maximum load factor
Returns
CDC_STATUS_OK in a successful case or other value indicating an error.

◆ cdc_hash_table_ctorv1()

enum cdc_stat cdc_hash_table_ctorv1 ( struct cdc_hash_table **  t,
struct cdc_data_info info,
float  load_factor,
va_list  args 
)

Constructs a hash table, initialized by args. The last item must be CDC_END.

Parameters
[out]t- cdc_hash_table
[in]info- cdc_data_info
[in]load_factor- maximum load factor
Returns
CDC_STATUS_OK in a successful case or other value indicating an error.

◆ cdc_hash_table_dtor()

void cdc_hash_table_dtor ( struct cdc_hash_table t)

Destroys the hash table.

Parameters
[in]t- cdc_hash_table