|
LibJuno 1.0.1
LibJuno is a lightweight C11 library designed specifically for embedded systems.
|
Fixed-capacity FIFO queue built on the Array API. More...
#include "juno/ds/array_api.h"#include "juno/macros.h"#include "juno/memory/pointer_api.h"#include "juno/status.h"#include "juno/module.h"#include <stddef.h>

Go to the source code of this file.
Data Structures | |
| struct | JUNO_DS_QUEUE_API_TAG |
| Queue API vtable. More... | |
Typedefs | |
| typedef struct JUNO_DS_QUEUE_ROOT_TAG | JUNO_DS_QUEUE_ROOT_T |
| The queue root module. | |
| typedef struct JUNO_DS_QUEUE_API_TAG | JUNO_DS_QUEUE_API_T |
Functions | |
| struct JUNO_DS_QUEUE_ROOT_TAG | JUNO_MODULE_ROOT (JUNO_DS_QUEUE_API_T, JUNO_DS_ARRAY_ROOT_T *ptQueueArray;size_t iStartIndex;size_t zLength;) |
| The queue root module instance. | |
| static JUNO_STATUS_T | JunoDs_QueueApiVerify (const JUNO_DS_QUEUE_API_T *ptQueueApi) |
| Verify that the queue API provides all required functions. | |
| static JUNO_STATUS_T | JunoDs_QueueVerify (const JUNO_DS_QUEUE_ROOT_T *ptQueue) |
| Verify a queue instance and its API table. | |
| JUNO_STATUS_T | JunoDs_QueuePush (JUNO_DS_QUEUE_ROOT_T *ptQueue, JUNO_POINTER_T tItem) |
| Enqueue an item to the back of the queue (O(1)). | |
| JUNO_STATUS_T | JunoDs_QueuePop (JUNO_DS_QUEUE_ROOT_T *ptQueue, JUNO_POINTER_T tReturn) |
| Dequeue the item at the front of the queue into tReturn (O(1)). | |
| JUNO_RESULT_POINTER_T | JunoDs_QueuePeek (JUNO_DS_QUEUE_ROOT_T *ptQueue) |
| Peek at the item at the front without removing it (O(1)). | |
| JUNO_STATUS_T | JunoDs_QueueInit (JUNO_DS_QUEUE_ROOT_T *ptQueue, JUNO_DS_ARRAY_ROOT_T *ptQueueArray, JUNO_FAILURE_HANDLER_T pfcnFailureHdlr, JUNO_USER_DATA_T *pvFailureUserData) |
| Initialize a queue over a backing array with a given capacity. | |
Fixed-capacity FIFO queue built on the Array API.
This API has been generated by LibJuno: https://www.robinonsay.com/libjuno/
| typedef struct JUNO_DS_QUEUE_API_TAG JUNO_DS_QUEUE_API_T |
| typedef struct JUNO_DS_QUEUE_ROOT_TAG JUNO_DS_QUEUE_ROOT_T |
The queue root module.
|
inlinestatic |
Verify that the queue API provides all required functions.
| JUNO_STATUS_T JunoDs_QueueInit | ( | JUNO_DS_QUEUE_ROOT_T * | ptQueue, |
| JUNO_DS_ARRAY_ROOT_T * | ptQueueArray, | ||
| JUNO_FAILURE_HANDLER_T | pfcnFailureHdlr, | ||
| JUNO_USER_DATA_T * | pvFailureUserData | ||
| ) |
Initialize a queue over a backing array with a given capacity.
| ptQueue | Queue to initialize (output). |
| ptQueueArray | Backing array used for storage; defines capacity and element size. |
| pfcnFailureHdlr | Failure callback for assertions in this module. |
| pvFailureUserData | Opaque user data for the failure handler. |
Initialize a queue over a backing array with a given capacity.
| JUNO_RESULT_POINTER_T JunoDs_QueuePeek | ( | JUNO_DS_QUEUE_ROOT_T * | ptQueue | ) |
Peek at the item at the front without removing it (O(1)).
Peek at the item at the front without removing it (O(1)).
| JUNO_STATUS_T JunoDs_QueuePop | ( | JUNO_DS_QUEUE_ROOT_T * | ptQueue, |
| JUNO_POINTER_T | tReturn | ||
| ) |
Dequeue the item at the front of the queue into tReturn (O(1)).
Dequeue the item at the front of the queue into tReturn (O(1)).
| JUNO_STATUS_T JunoDs_QueuePush | ( | JUNO_DS_QUEUE_ROOT_T * | ptQueue, |
| JUNO_POINTER_T | tItem | ||
| ) |
Enqueue an item to the back of the queue (O(1)).
Enqueue an item to the back of the queue (O(1)).
|
inlinestatic |
Verify a queue instance and its API table.