51#ifndef JUNO_DS_QUEUE_API_H
52#define JUNO_DS_QUEUE_API_H
Abstract fixed-capacity array interface for DS modules.
struct JUNO_DS_ARRAY_ROOT_TAG JUNO_DS_ARRAY_ROOT_T
Opaque array root carrying capacity and API pointer.
Definition array_api.h:58
static JUNO_STATUS_T JunoDs_ArrayVerify(const JUNO_DS_ARRAY_ROOT_T *ptArray)
Verify an array instance's capacity and API.
Definition array_api.h:117
#define JUNO_ASSERT_EXISTS(ptr)
Returns JUNO_STATUS_NULLPTR_ERROR if the expression is falsy.
Definition macros.h:50
#define JUNO_ASSERT_SUCCESS(tStatus,...)
Execute the provided failure operation(s) if status is not success.
Definition macros.h:87
#define JUNO_MODULE_ROOT(API_T,...)
Implement a module root struct containing ptApi and failure fields.
Definition module.h:126
#define JUNO_STATUS_SUCCESS
Operation completed successfully.
Definition status.h:56
void(* JUNO_FAILURE_HANDLER_T)(JUNO_STATUS_T tStatus, const char *pcCustomMessage, JUNO_USER_DATA_T *pvUserData)
Failure handler callback signature.
Definition status.h:104
int32_t JUNO_STATUS_T
Canonical status type for LibJuno functions.
Definition status.h:49
void JUNO_USER_DATA_T
Opaque user data type for failure callbacks.
Definition status.h:96
Common assertion and helper macros for LibJuno modules.
Module system and dependency injection primitives for LibJuno.
Pointer trait and helpers for memory operations.
struct JUNO_POINTER_TAG JUNO_POINTER_T
Definition pointer_api.h:49
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.
Definition juno_buff_queue.c:103
static JUNO_STATUS_T JunoDs_QueueApiVerify(const JUNO_DS_QUEUE_API_T *ptQueueApi)
Verify that the queue API provides all required functions.
Definition queue_api.h:104
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)).
Definition juno_buff_queue.c:49
struct JUNO_DS_QUEUE_ROOT_TAG JUNO_DS_QUEUE_ROOT_T
The queue root module.
Definition queue_api.h:65
static JUNO_STATUS_T JunoDs_QueueVerify(const JUNO_DS_QUEUE_ROOT_T *ptQueue)
Verify a queue instance and its API table.
Definition queue_api.h:116
JUNO_RESULT_POINTER_T JunoDs_QueuePeek(JUNO_DS_QUEUE_ROOT_T *ptQueue)
Peek at the item at the front without removing it (O(1)).
Definition juno_buff_queue.c:76
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)).
Definition juno_buff_queue.c:24
Status codes and failure-handling helpers for LibJuno.
Queue API vtable.
Definition queue_api.h:84
JUNO_STATUS_T(* Enqueue)(JUNO_DS_QUEUE_ROOT_T *ptQueue, JUNO_POINTER_T tItem)
Enqueue an item to the back of the queue.
Definition queue_api.h:89
JUNO_RESULT_POINTER_T(* Peek)(JUNO_DS_QUEUE_ROOT_T *ptQueue)
Peek at the item at the front without removing it.
Definition queue_api.h:98
JUNO_STATUS_T(* Dequeue)(JUNO_DS_QUEUE_ROOT_T *ptQueue, JUNO_POINTER_T tReturn)
Dequeue the item at the front of the queue.
Definition queue_api.h:94