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

Functions

void * cdc_list_get (struct cdc_list *l, size_t index)
 Returns an element at index position index in the list. More...
 
enum cdc_stat cdc_list_at (struct cdc_list *l, size_t index, void **elem)
 Writes to pointer an element from specified position in the list. Bounds checking is performed. More...
 
static void * cdc_list_front (struct cdc_list *l)
 Returns a first element in the list. More...
 
static void * cdc_list_back (struct cdc_list *l)
 Returns a last element in the list. More...
 

Detailed Description

Function Documentation

◆ cdc_list_get()

void* cdc_list_get ( struct cdc_list l,
size_t  index 
)

Returns an element at index position index in the list.

Parameters
[in]l- cdc_list
[in]index- index of an element to return
Returns
element from |index| position.

◆ cdc_list_at()

enum cdc_stat cdc_list_at ( struct cdc_list l,
size_t  index,
void **  elem 
)

Writes to pointer an element from specified position in the list. Bounds checking is performed.

Parameters
[in]l- cdc_list
[in]index- index of an element to write at elem
[out]elem- pointer where an element will be written
Returns
DC_STATUS_OK in a successful case or CDC_STATUS_OUT_OF_RANGE if the index is incorrect.

◆ cdc_list_front()

static void* cdc_list_front ( struct cdc_list l)
inlinestatic

Returns a first element in the list.

Parameters
[in]l- cdc_list
Returns
first element in the list.

◆ cdc_list_back()

static void* cdc_list_back ( struct cdc_list l)
inlinestatic

Returns a last element in the list.

Parameters
[in]l- cdc_list
Returns
last element in the list.