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

Functions

static void cdc_deque_set (struct cdc_deque *d, size_t index, void *value)
 Sets the deque at index position to the value. The function is not called to free memory. More...
 
static enum cdc_stat cdc_deque_insert (struct cdc_deque *d, size_t index, void *value)
 Inserts value at index position in the deque. If index is 0, the value is prepended to the deque. If index is cdc_deque_size(), the value is appended to the deque. More...
 
static void cdc_deque_erase (struct cdc_deque *d, size_t index)
 Removes the element at index position. Index must be a valid index position in the deque. More...
 
static void cdc_deque_clear (struct cdc_deque *d)
 Removes all the elements from the deque. More...
 
static enum cdc_stat cdc_deque_push_back (struct cdc_deque *d, void *value)
 Inserts value at the end of the deque. More...
 
static void cdc_deque_pop_back (struct cdc_deque *d)
 Removes the last item in the deque. More...
 
static enum cdc_stat cdc_deque_push_front (struct cdc_deque *d, void *value)
 Inserts value at the beginning of the deque. More...
 
static void cdc_deque_pop_front (struct cdc_deque *d)
 Removes the first item in the deque. More...
 
void cdc_deque_swap (struct cdc_deque *a, struct cdc_deque *b)
 Swaps deques a and b. This operation is very fast and never fails. More...
 

Detailed Description

Function Documentation

◆ cdc_deque_set()

static void cdc_deque_set ( struct cdc_deque d,
size_t  index,
void *  value 
)
inlinestatic

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

Parameters
d- cdc_deque
index- index position where the value will be written
value

◆ cdc_deque_insert()

static enum cdc_stat cdc_deque_insert ( struct cdc_deque d,
size_t  index,
void *  value 
)
inlinestatic

Inserts value at index position in the deque. If index is 0, the value is prepended to the deque. If index is cdc_deque_size(), the value is appended to the deque.

Parameters
d- cdc_deque
index- index position where the value will be inserted
value
Returns
CDC_STATUS_OK in a successful case or other value indicating an error

◆ cdc_deque_erase()

static void cdc_deque_erase ( struct cdc_deque d,
size_t  index 
)
inlinestatic

Removes the element at index position. Index must be a valid index position in the deque.

Parameters
d- cdc_deque
index- index position where the item will be removed

◆ cdc_deque_clear()

static void cdc_deque_clear ( struct cdc_deque d)
inlinestatic

Removes all the elements from the deque.

Parameters
d- cdc_deque

◆ cdc_deque_push_back()

static enum cdc_stat cdc_deque_push_back ( struct cdc_deque d,
void *  value 
)
inlinestatic

Inserts value at the end of the deque.

Parameters
d- cdc_deque
value
Returns
CDC_STATUS_OK in a successful case or other value indicating an error

◆ cdc_deque_pop_back()

static void cdc_deque_pop_back ( struct cdc_deque d)
inlinestatic

Removes the last item in the deque.

Parameters
d- cdc_deque

◆ cdc_deque_push_front()

static enum cdc_stat cdc_deque_push_front ( struct cdc_deque d,
void *  value 
)
inlinestatic

Inserts value at the beginning of the deque.

Parameters
d- cdc_deque
value
Returns
CDC_STATUS_OK in a successful case or other value indicating an error

◆ cdc_deque_pop_front()

static void cdc_deque_pop_front ( struct cdc_deque d)
inlinestatic

Removes the first item in the deque.

Parameters
d- cdc_deque

◆ cdc_deque_swap()

void cdc_deque_swap ( struct cdc_deque a,
struct cdc_deque b 
)

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

Parameters
a- cdc_deque
b- cdc_deque