71 size_t first_pass_size;
77 memcpy(self->
back, elements, first_pass_size);
78 self->
back += first_pass_size;
79 self->
count += first_pass;
80 if (first_pass < count)
bool deque_is_full(const deque_t *self)
True if the queue reached its maximum capacity.
Realtime double-ended queues.
size_t deque_distance(const deque_t *self, const void *one, const void *two)
Number of elements in the range delimited by the two provided elements.
size_t deque_offset(const deque_t *self, size_t count)
The size in memory of count elements.
void * deque_pointer_before(const deque_t *self, void *pointer)
The previous slot.
void * deque_begin(const deque_t *self)
Pointer to the start of the underlying storage.
void * deque_end(const deque_t *self)
Pointer one-past-the-end of the underlying storage.
size_t deque_room(const deque_t *self)
The remaining number of elements that can be added.
#define min(a, b)
Evaluates as the smallest of the two parameters.
bool deque_push_front(deque_t *self, const void *element)
Inserts an element to the front of the queue.
bool deque_push_back(deque_t *self, const void *element)
Inserts an element to the back of the queue.
bool deque_push_front_n(deque_t *self, const void *elements, size_t count)
Inserts count elements to the front 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.
Dynamic string implementation.
void * back
Pointer past-the-end of the queue.
void * front
Pointer to the front of the queue.
size_t count
Number of elements currently stored.