LibJuno 1.0.1
LibJuno is a lightweight C11 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
Array API

Data Structures

struct  JUNO_DS_ARRAY_API_TAG
 Array API vtable. More...
 

Functions

struct JUNO_DS_ARRAY_ROOT_TAG JUNO_MODULE_ROOT (JUNO_DS_ARRAY_API_T, size_t zCapacity;)
 Array root with capacity.
 
static JUNO_STATUS_T JunoDs_ArrayVerify (const JUNO_DS_ARRAY_ROOT_T *ptArray)
 Verify an array instance's capacity and API.
 
static JUNO_STATUS_T JunoDs_ArrayVerifyIndex (const JUNO_DS_ARRAY_ROOT_T *ptArray, size_t iIndex)
 Verify an index is within array capacity.
 
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.
 

Detailed Description

A minimal, deterministic array abstraction used by higher-level data structures (heaps, maps, queues, stacks). The array provides three core operations — SetAt, GetAt, RemoveAt — and verification helpers to ensure capacity and API validity.

Characteristics

Invariants and requirements

Function Documentation

◆ JUNO_MODULE_ROOT()

struct JUNO_DS_ARRAY_ROOT_TAG JUNO_MODULE_ROOT ( JUNO_DS_ARRAY_API_T  ,
size_t zCapacity;   
)

Array root with capacity.

◆ JunoDs_ArrayInit()

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 
)
inlinestatic

Initialize an array root with capacity and API.

Parameters
ptArrayArray instance to initialize (output).
ptArrayApiArray vtable with SetAt/GetAt/RemoveAt implementations.
iCapacityFixed capacity for this array (must be > 0).
pfcnFailureHdlrOptional failure handler for assertions (can be NULL).
pvUserDataOptional user data passed to the failure handler (can be NULL).
Returns
Result of JunoDs_ArrayVerify on the configured array.

◆ JunoDs_ArrayVerify()

static JUNO_STATUS_T JunoDs_ArrayVerify ( const JUNO_DS_ARRAY_ROOT_T ptArray)
inlinestatic

Verify an array instance's capacity and API.

Ensures ptArray is non-NULL, capacity is non-zero, and required vtable entries are present.

◆ JunoDs_ArrayVerifyIndex()

static JUNO_STATUS_T JunoDs_ArrayVerifyIndex ( const JUNO_DS_ARRAY_ROOT_T ptArray,
size_t  iIndex 
)
inlinestatic

Verify an index is within array capacity.

Parameters
ptArrayArray instance.
iIndexIndex to check.
Returns
JUNO_STATUS_SUCCESS when 0 <= iIndex < zCapacity; otherwise JUNO_STATUS_OOB_ERROR (and invokes the failure handler, if provided).