![]() |
reactor-c 1.0
C Runtime for Lingua Franca
|
Implementation of a double-ended queue. More...
#include <stddef.h>#include <stdbool.h>#include <stdlib.h>Go to the source code of this file.
Data Structures | |
| struct | deque_t |
| A double-ended queue data structure. More... | |
Typedefs | |
| typedef struct deque_t | deque_t |
| A double-ended queue data structure. | |
Functions | |
| void | deque_initialize (deque_t *d) |
| Initialize the specified deque to an empty deque. | |
| bool | deque_is_empty (deque_t *d) |
| Return true if the queue is empty. | |
| void * | deque_peek_back (deque_t *d) |
| Peek at the value on the front of the queue, leaving it on 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_pop_front (deque_t *d) |
| Pop a value from the front 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. | |
| void | deque_push_front (deque_t *d, void *value) |
| Push a value to the front of the queue. | |
| size_t | deque_size (deque_t *d) |
| Return the size of the queue. | |
Implementation of a double-ended queue.
This is the header file for an implementation of a double-ended queue. Each node in the queue contains a void* pointer.
To use this, include the following in your target properties:
In addition, you need this in your Lingua Franca file:
To create a deque, use calloc to ensure that it gets initialized with null pointers and zero size:
Alternatively, you can call initialize: