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

Functions

void cdc_list_set (struct cdc_list *l, size_t index, void *value)
 Sets an element at index position to the value. The function is not called to free memory. More...
 
enum cdc_stat cdc_list_push_back (struct cdc_list *l, void *value)
 Inserts an element at the end of the list. More...
 
void cdc_list_pop_back (struct cdc_list *l)
 Removes a last element in the list. More...
 
enum cdc_stat cdc_list_push_front (struct cdc_list *l, void *value)
 Inserts an element at the beginning of the list. More...
 
void cdc_list_pop_front (struct cdc_list *l)
 Removes a first element in the list. More...
 
enum cdc_stat cdc_list_insert (struct cdc_list *l, size_t index, void *value)
 Inserts an element at |index| position in the list. If index is 0, the value is prepended to the list. If index is cdc_list_size(), the value is appended to the list. More...
 
enum cdc_stat cdc_list_iinsert (struct cdc_list_iter *before, void *value)
 Inserts an element in front of the item pointed to by the iterator before. More...
 
void cdc_list_erase (struct cdc_list *l, size_t index)
 Removes an element at index position in the circular arrray. More...
 
void cdc_list_ierase (struct cdc_list_iter *pos)
 Removes an element associated with the iterator pos from the list. More...
 
void cdc_list_clear (struct cdc_list *l)
 Removes all the elements from the list. More...
 
void cdc_list_swap (struct cdc_list *a, struct cdc_list *b)
 Swaps lists a and b. This operation is very fast and never fails. More...
 

Detailed Description

Function Documentation

◆ cdc_list_set()

void cdc_list_set ( struct cdc_list l,
size_t  index,
void *  value 
)

Sets an element at index position to the value. The function is not called to free memory.

Parameters
[in]l- cdc_list
[in]index- index position where the value will be written
[in]value- value

◆ cdc_list_push_back()

enum cdc_stat cdc_list_push_back ( struct cdc_list l,
void *  value 
)

Inserts an element at the end of the list.

Parameters
[in]l- cdc_list
[in]value- value
Returns
CDC_STATUS_OK in a successful case or other value indicating an error.

◆ cdc_list_pop_back()

void cdc_list_pop_back ( struct cdc_list l)

Removes a last element in the list.

Parameters
[in]l- cdc_list

◆ cdc_list_push_front()

enum cdc_stat cdc_list_push_front ( struct cdc_list l,
void *  value 
)

Inserts an element at the beginning of the list.

Parameters
[in]l- cdc_list
[in]value- value
Returns
CDC_STATUS_OK in a successful case or other value indicating an error.

◆ cdc_list_pop_front()

void cdc_list_pop_front ( struct cdc_list l)

Removes a first element in the list.

Parameters
[in]l- cdc_list

◆ cdc_list_insert()

enum cdc_stat cdc_list_insert ( struct cdc_list l,
size_t  index,
void *  value 
)

Inserts an element at |index| position in the list. If index is 0, the value is prepended to the list. If index is cdc_list_size(), the value is appended to the list.

Parameters
[in]l- cdc_list
[in]index- index position where an element will be inserted
[in]value- value
Returns
CDC_STATUS_OK in a successful case or other value indicating an error.

◆ cdc_list_iinsert()

enum cdc_stat cdc_list_iinsert ( struct cdc_list_iter before,
void *  value 
)

Inserts an element in front of the item pointed to by the iterator before.

Parameters
[in]before- iterator position before which an element will be inserted
[in]value- value
Returns
CDC_STATUS_OK in a successful case or other value indicating an error.

◆ cdc_list_erase()

void cdc_list_erase ( struct cdc_list l,
size_t  index 
)

Removes an element at index position in the circular arrray.

Parameters
[in]l- cdc_list
[in]index- index position where an element will be removed

◆ cdc_list_ierase()

void cdc_list_ierase ( struct cdc_list_iter pos)

Removes an element associated with the iterator pos from the list.

Parameters
[in]pos- iterator

◆ cdc_list_clear()

void cdc_list_clear ( struct cdc_list l)

Removes all the elements from the list.

Parameters
[in]l- cdc_list

◆ cdc_list_swap()

void cdc_list_swap ( struct cdc_list a,
struct cdc_list b 
)

Swaps lists a and b. This operation is very fast and never fails.

Parameters
[in,out]a- cdc_list
[in,out]b- cdc_list