![]() |
O2S C Library 1.8.2
Provide high-level data-structures and other fundamental tools for C projects
|
Realtime FIFO buffer. More...
#include "o2s/deque.h"Go to the source code of this file.
Typedefs | |
| typedef deque_t | queue_t |
| A queue is First In First Out. | |
Functions | |
| void | queue_free (queue_t *self) |
| Release the allocated memory. | |
Modifiers | |
| 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. | |
| bool | queue_pop (queue_t *self, void *destination) |
| Pop the first element of the queue. | |
| bool | queue_pop_n (queue_t *self, void *destination, size_t count) |
Pop the first count elements of the queue. | |
| bool | queue_pop_into_array (queue_t *self, struct array *destination, size_t count) |
Move the count first elements at the back of destination. | |
Element access | |
| void * | queue_first (const queue_t *self) |
| Next element to be popped. | |
| void * | queue_get (const queue_t *self, size_t index) |
| Access an arbitrary queue element. | |
Capacity | |
| size_t | queue_room (const queue_t *self) |
| Number of elements that can be added. | |
| size_t | queue_count (const queue_t *self) |
| Number of elements currently in the queue. | |
| size_t | queue_capacity (const queue_t *self) |
| Number of elements that can be stored in the queue. | |
| size_t queue_capacity | ( | const queue_t * | self | ) |
Number of elements that can be stored in the queue.
| size_t queue_count | ( | const queue_t * | self | ) |
Number of elements currently in the queue.
| void * queue_first | ( | const queue_t * | self | ) |
| void queue_free | ( | queue_t * | self | ) |
| void * queue_get | ( | const queue_t * | self, |
| size_t | index ) |
| bool queue_pop | ( | queue_t * | self, |
| void * | destination ) |
| bool queue_pop_into_array | ( | queue_t * | self, |
| struct array * | destination, | ||
| size_t | count ) |
Move the count first elements at the back of destination.
| 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 ) |
| bool queue_push_n | ( | queue_t * | self, |
| const void * | elements, | ||
| size_t | count ) |
| size_t queue_room | ( | const queue_t * | self | ) |