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

Functions

static void * cdc_array_get (struct cdc_array *v, size_t index)
 Returns an element at index position in the array. More...
 
enum cdc_stat cdc_array_at (struct cdc_array *v, size_t index, void **elem)
 Writes to pointer an element from specified position in the array. Bounds checking is performed. More...
 
static void * cdc_array_front (struct cdc_array *v)
 Returns a first element in the array. More...
 
static void * cdc_array_back (struct cdc_array *v)
 Returns a last element in the array. More...
 
static void ** cdc_array_data (struct cdc_array *v)
 Returns a pointer to the data stored in the array. More...
 

Detailed Description

Function Documentation

◆ cdc_array_get()

static void* cdc_array_get ( struct cdc_array v,
size_t  index 
)
inlinestatic

Returns an element at index position in the array.

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

◆ cdc_array_at()

enum cdc_stat cdc_array_at ( struct cdc_array v,
size_t  index,
void **  elem 
)

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

Parameters
[in]v- cdc_array
[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_array_front()

static void* cdc_array_front ( struct cdc_array v)
inlinestatic

Returns a first element in the array.

Parameters
[in]v- cdc_array
Returns
first element in the array.

◆ cdc_array_back()

static void* cdc_array_back ( struct cdc_array v)
inlinestatic

Returns a last element in the array.

Parameters
[in]v- cdc_array
Returns
last element in the array.

◆ cdc_array_data()

static void** cdc_array_data ( struct cdc_array v)
inlinestatic

Returns a pointer to the data stored in the array.

Parameters
[in]v- cdc_array
Returns
pointer to the data stored in the array.