45#ifndef JUNO_DS_ARRAY_API_H
46#define JUNO_DS_ARRAY_API_H
140 if(iIndex >= ptArray->zCapacity)
161 ptArray->ptApi = ptArrayApi;
162 ptArray->zCapacity = iCapacity;
163 ptArray->_pfcnFailureHandler = pfcnFailureHdlr;
164 ptArray->_pvFailureUserData = pvUserData;
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_ArrayApiVerify(const JUNO_DS_ARRAY_API_T *ptArrayApi)
Verify that the array API provides all required functions.
Definition array_api.h:100
static JUNO_STATUS_T JunoDs_ArrayInit(JUNO_DS_ARRAY_ROOT_T *ptArray, const JUNO_DS_ARRAY_API_T *ptArrayApi, size_t iCapacity, JUNO_FAILURE_HANDLER_T pfcnFailureHdlr, JUNO_USER_DATA_T *pvUserData)
Initialize an array root with capacity and API.
Definition array_api.h:158
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
static JUNO_STATUS_T JunoDs_ArrayVerifyIndex(const JUNO_DS_ARRAY_ROOT_T *ptArray, size_t iIndex)
Verify an index is within array capacity.
Definition array_api.h:136
#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
#define JUNO_STATUS_OOB_ERROR
Index or pointer was out of bounds.
Definition status.h:90
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
#define JUNO_FAIL_ROOT(tStatus, ptMod, pcMessage)
Invoke a module root's failure handler if available.
Definition status.h:149
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
Status codes and failure-handling helpers for LibJuno.
Array API vtable.
Definition array_api.h:75
JUNO_STATUS_T(* SetAt)(JUNO_DS_ARRAY_ROOT_T *ptArray, JUNO_POINTER_T tItem, size_t iIndex)
Set the value at an index.
Definition array_api.h:82
JUNO_RESULT_POINTER_T(* GetAt)(JUNO_DS_ARRAY_ROOT_T *ptArray, size_t iIndex)
Get the value at an index.
Definition array_api.h:88
JUNO_STATUS_T(* RemoveAt)(JUNO_DS_ARRAY_ROOT_T *ptArray, size_t iIndex)
Remove a value at an index.
Definition array_api.h:94