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

Functions

static enum cdc_stat cdc_map_get (struct cdc_map *m, void *key, void **value)
 Returns a value that is mapped to a key. If the key does not exist, then NULL will return. More...
 
static size_t cdc_map_count (struct cdc_map *m, void *key)
 Returns the number of elements with key that compares equal to the specified argument key, which is either 1 or 0 since this container does not allow duplicates. More...
 
static void cdc_map_find (struct cdc_map *m, void *key, struct cdc_map_iter *it)
 Finds an element with key equivalent to key. More...
 

Detailed Description

Function Documentation

◆ cdc_map_get()

static enum cdc_stat cdc_map_get ( struct cdc_map m,
void *  key,
void **  value 
)
inlinestatic

Returns a value that is mapped to a key. If the key does not exist, then NULL will return.

Parameters
[in]m- cdc_map
[in]key- key of the element to find
[out]value- pinter to the value that is mapped to a key.
Returns
CDC_STATUS_OK if the key is found, CDC_STATUS_NOT_FOUND otherwise.

◆ cdc_map_count()

static size_t cdc_map_count ( struct cdc_map m,
void *  key 
)
inlinestatic

Returns the number of elements with key that compares equal to the specified argument key, which is either 1 or 0 since this container does not allow duplicates.

Parameters
[in]m- cdc_map
[in]key- key value of the elements to count
Returns
number of elements with key key, that is either 1 or 0.

◆ cdc_map_find()

static void cdc_map_find ( struct cdc_map m,
void *  key,
struct cdc_map_iter it 
)
inlinestatic

Finds an element with key equivalent to key.

Parameters
[in]m- cdc_map
[in]key- key value of the element to search for
[out]it- pointer will be recorded iterator to an element with key equivalent to key. If no such element is found, past-the-end iterator is returned.