reactor-c 1.0
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
deque.h
Go to the documentation of this file.
1
40
41#ifndef DEQUE_H
42#define DEQUE_H
43
44#include <stddef.h> // Defines size_t
45#include <stdbool.h> // Defines bool
46#include <stdlib.h> // Defines malloc and free
47
52typedef struct deque_t {
53 struct deque_node_t* front;
54 struct deque_node_t* back;
55 size_t size;
57
65
73
82
90void deque_push_front(deque_t* d, void* value);
91
99void deque_push_back(deque_t* d, void* value);
100
109
118
127
136
137#endif // DEQUE_H
void deque_initialize(deque_t *d)
Initialize the specified deque to an empty deque.
void deque_push_front(deque_t *d, void *value)
Push a value to the front of the queue.
void * deque_peek_back(deque_t *d)
Peek at the value on the front of the queue, leaving it on the queue.
void * deque_pop_front(deque_t *d)
Pop a value from the front of the queue, removing it from the queue.
void * deque_peek_front(deque_t *d)
Peek at the value on the back of the queue, leaving it on the queue.
void * deque_pop_back(deque_t *d)
Pop a value from the back of the queue, removing it from the queue.
void deque_push_back(deque_t *d, void *value)
Push a value to the back of the queue.
bool deque_is_empty(deque_t *d)
Return true if the queue is empty.
size_t deque_size(deque_t *d)
Return the size of the queue.
A double-ended queue data structure.
Definition deque.h:52
struct deque_node_t * back
Definition deque.h:54
size_t size
Definition deque.h:55
struct deque_node_t * front
Definition deque.h:53