void deque_free(deque_t *self)
Frees properly the deque.
size_t deque_capacity(const deque_t *self)
The maximum number of elements that can be stored.
void * deque_first(const deque_t *self)
The current first element in the queue.
size_t deque_count(const deque_t *self)
The number of elements currently held in the queue.
void * deque_get(const deque_t *self, size_t index)
The element of the element at an arbitrary index.
bool deque_pop_front(deque_t *self, void *destination)
Pops the front-most element of the queue, copying it to destination.
bool deque_pop_front_n(deque_t *self, void *destination, size_t count)
Pops the count first elements of the queue.
size_t deque_room(const deque_t *self)
The remaining number of elements that can be added.
bool deque_pop_front_into_array(deque_t *self, struct array *destination, size_t count)
Move the count first elements at the back of destination.
bool deque_push_back(deque_t *self, const void *element)
Inserts an element to the back of the queue.
bool deque_push_back_n(deque_t *self, const void *elements, size_t count)
Inserts count elements to the back of the queue.
void * queue_get(const queue_t *self, size_t index)
Access an arbitrary queue element.
bool queue_pop(queue_t *self, void *destination)
Pop the first element of the queue.
size_t queue_capacity(const queue_t *self)
Number of elements that can be stored in the queue.
bool queue_pop_n(queue_t *self, void *destination, size_t count)
Pop the first count elements of the queue.
bool queue_push(queue_t *self, const void *element)
Add a single element to the queue.
bool queue_push_n(queue_t *self, const void *elements, size_t count)
Add count elements to the queue.
size_t queue_count(const queue_t *self)
Number of elements currently in the queue.
size_t queue_room(const queue_t *self)
Number of elements that can be added.
bool queue_pop_into_array(queue_t *self, struct array *destination, size_t count)
Move the count first elements at the back of destination.
void queue_free(queue_t *self)
Release the allocated memory.
void * queue_first(const queue_t *self)
Next element to be popped.
deque_t queue_t
A queue is First In First Out.