|
Veritable Lasagna
An Allocator & Data Structure Library for C.
|
Include dependency graph for vl_deque.c:Functions | |
| void | vlDequeInit (vl_deque *deq, vl_uint16_t elementSize) |
| Initializes the specified instance of vl_deque with specific element size. | |
| void | vlDequeFree (vl_deque *deq) |
| De-initializes and frees the internal resources of the specified deque. | |
| vl_deque * | vlDequeNew (vl_uint16_t elementSize) |
| Allocates on the heap, initializes, and returns a new deque instance. | |
| void | vlDequeDelete (vl_deque *deq) |
| De-initializes and deletes the specified deque and its resources. | |
| void | vlDequeClear (vl_deque *deq) |
| Clears the specified deque. | |
| void | vlDequeReserve (vl_deque *deque, vl_dsidx_t numElems) |
| Reserves space for n-many elements in the underlying buffer of the specified deque. | |
| vl_deque * | vlDequeClone (const vl_deque *src, vl_deque *dest) |
| Clones the specified source deque to another. | |
| void | vlDequePushFront (vl_deque *deq, const void *val) |
| Adds and copies an element to the front of the deque. | |
| int | vlDequePopFront (vl_deque *deq, void *val) |
| Copies and removes an element from the front of the deque. | |
| void | vlDequePushBack (vl_deque *deq, const void *val) |
| Adds and copies an element to the end of the deque. | |
| int | vlDequePopBack (vl_deque *deq, void *val) |
| Copies and removes an element from the end of the deque. | |
| void vlDequeClear | ( | vl_deque * | deq | ) |
Clears the specified deque.
Resets the head and tail iterators and clears the internal node pool.
deq must not be NULL.| deq | pointer |
Here is the call graph for this function:| vl_deque * vlDequeClone | ( | const vl_deque * | src, |
| vl_deque * | dest | ||
| ) |
Clones the specified source deque to another.
Clones the entirety of the src deque to the dest deque, including all elements and order.
The 'src' deque pointer must be non-null and initialized. The 'dest' deque pointer may be null, but if it is not null it must be initialized.
If the 'dest' deque pointer is null, a new deque is created via vlDequeNew. Otherwise, its element size is set to the source's and all of its existing data is replaced.
dest is NULL, the caller owns the returned vl_deque. If dest is provided, ownership remains with the caller.src must not be NULL. dest can be NULL.NULL if allocation fails.NULL on failure.| src | pointer |
| dest | pointer |
Here is the call graph for this function:| void vlDequeDelete | ( | vl_deque * | deq | ) |
De-initializes and deletes the specified deque and its resources.
The deque should have been initialized via vlDequeNew.
vl_deque struct.deq is NULL.| deq | pointer |
Here is the call graph for this function:| void vlDequeFree | ( | vl_deque * | deq | ) |
De-initializes and frees the internal resources of the specified deque.
The deque should have been initialized via vlDequeInit.
deq struct itself.deq must not be NULL.| deq | pointer |
Here is the call graph for this function:
Here is the caller graph for this function:| void vlDequeInit | ( | vl_deque * | deq, |
| vl_uint16_t | elementSize | ||
| ) |
Initializes the specified instance of vl_deque with specific element size.
The deque should later be de-initialized via vlDequeFree.
deq struct. The function initializes the internal node pool.vlDequeFree or vlDequeDelete.deq must not be NULL.vlDequeFree (causes memory leak).vl_pool which allocates management structures.| deq | pointer |
| elementSize | size of each element, in bytes. |
Here is the caller graph for this function:| vl_deque * vlDequeNew | ( | vl_uint16_t | elementSize | ) |
Allocates on the heap, initializes, and returns a new deque instance.
The deque should later be deleted via vlDequeDelete.
vl_deque pointer and is responsible for calling vlDequeDelete.vlDequeDelete.NULL if heap allocation for the deque struct fails.NULL on allocation failure.vl_deque struct and its internal node pool.NULL.| elementSize | size of each element, in bytes. |
Here is the call graph for this function:
Here is the caller graph for this function:| int vlDequePopBack | ( | vl_deque * | deq, |
| void * | val | ||
| ) |
Copies and removes an element from the end of the deque.
If specified pointer val is NULL, the element is not copied, but the element is still removed.
val.deq must not be NULL. val can be NULL.| deq | pointer |
| val | pointer where the element will be copied to. |
Here is the call graph for this function:| int vlDequePopFront | ( | vl_deque * | deq, |
| void * | val | ||
| ) |
Copies and removes an element from the front of the deque.
If specified pointer val is NULL, the element is not copied, but the element is still removed.
val.deq must not be NULL. val can be NULL.| deq | pointer |
| val | pointer where the element will be copied to. |
Here is the call graph for this function:| void vlDequePushBack | ( | vl_deque * | deq, |
| const void * | val | ||
| ) |
Adds and copies an element to the end of the deque.
deq must not be NULL. val should not be NULL.| deq | pointer |
| val | element data pointer |
Here is the call graph for this function:| void vlDequePushFront | ( | vl_deque * | deq, |
| const void * | val | ||
| ) |
Adds and copies an element to the front of the deque.
deq must not be NULL. val should not be NULL.| deq | pointer |
| val | element data pointer |
Here is the call graph for this function:| void vlDequeReserve | ( | vl_deque * | deque, |
| vl_dsidx_t | n | ||
| ) |
Reserves space for n-many elements in the underlying buffer of the specified deque.
deque must not be NULL.| deque | pointer |
| n | total number of elements to reserve space for. |
Here is the call graph for this function: