LibJuno 1.0.1
LibJuno is a lightweight C11 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
JUNO_DS_STACK_API_TAG Struct Reference

#include <stack_api.h>

Data Fields

JUNO_STATUS_T(* Push )(JUNO_DS_STACK_ROOT_T *ptStack, JUNO_POINTER_T tItem)
 Push an item onto the top of the stack (O(1)).
 
JUNO_STATUS_T(* Pop )(JUNO_DS_STACK_ROOT_T *ptStack, JUNO_POINTER_T tReturn)
 Pop the top item into tReturn (O(1)).
 
JUNO_RESULT_POINTER_T(* Peek )(JUNO_DS_STACK_ROOT_T *ptStack)
 Peek at the top item without removing it (O(1)).
 

Field Documentation

◆ Peek

JUNO_RESULT_POINTER_T(* JUNO_DS_STACK_API_TAG::Peek) (JUNO_DS_STACK_ROOT_T *ptStack)

Peek at the top item without removing it (O(1)).

Parameters
ptStackStack instance.
Returns
Result with pointer descriptor to the top element; JUNO_STATUS_INVALID_SIZE_ERROR if empty.

◆ Pop

JUNO_STATUS_T(* JUNO_DS_STACK_API_TAG::Pop) (JUNO_DS_STACK_ROOT_T *ptStack, JUNO_POINTER_T tReturn)

Pop the top item into tReturn (O(1)).

Parameters
ptStackStack instance.
tReturnPointer trait receiving the popped item (copied out).
Returns
JUNO_STATUS_SUCCESS on success; JUNO_STATUS_INVALID_SIZE_ERROR if empty; or pointer/array errors.

◆ Push

JUNO_STATUS_T(* JUNO_DS_STACK_API_TAG::Push) (JUNO_DS_STACK_ROOT_T *ptStack, JUNO_POINTER_T tItem)

Push an item onto the top of the stack (O(1)).

Parameters
ptStackStack instance.
tItemPointer trait describing the item to copy into the stack.
Returns
JUNO_STATUS_SUCCESS on success; JUNO_STATUS_INVALID_SIZE_ERROR if full; or pointer/array errors.

The documentation for this struct was generated from the following file: