|
LibJuno 1.0.1
LibJuno is a lightweight C11 library designed specifically for embedded systems.
|
Fixed-capacity LIFO stack built on the Array API. More...
#include "juno/ds/array_api.h"#include "juno/macros.h"#include "juno/status.h"#include "juno/module.h"

Go to the source code of this file.
Data Structures | |
| struct | JUNO_DS_STACK_API_TAG |
Typedefs | |
| typedef struct JUNO_DS_STACK_ROOT_TAG | JUNO_DS_STACK_ROOT_T |
| The stack root module. | |
| typedef struct JUNO_DS_STACK_API_TAG | JUNO_DS_STACK_API_T |
Functions | |
| struct JUNO_DS_STACK_ROOT_TAG | JUNO_MODULE_ROOT (JUNO_DS_STACK_API_T, JUNO_DS_ARRAY_ROOT_T *ptStackArray;size_t zLength;) |
| Stack root instance and state. | |
| static JUNO_STATUS_T | JunoDs_StackVerify (const JUNO_DS_STACK_ROOT_T *ptStack) |
| JUNO_STATUS_T | JunoDs_StackInit (JUNO_DS_STACK_ROOT_T *ptStack, JUNO_DS_ARRAY_ROOT_T *ptStackArray, JUNO_FAILURE_HANDLER_T pfcnFailureHdlr, JUNO_USER_DATA_T *pvFailureUserData) |
| Initialize a stack over a backing array with a given capacity. | |
| JUNO_STATUS_T | JunoDs_StackPush (JUNO_DS_STACK_ROOT_T *ptStack, JUNO_POINTER_T tItem) |
| Push an item onto the top of the stack (O(1)). | |
| JUNO_STATUS_T | JunoDs_StackPop (JUNO_DS_STACK_ROOT_T *ptStack, JUNO_POINTER_T tReturn) |
| Pop the top item into tReturn (O(1)). | |
| JUNO_RESULT_POINTER_T | JunoDs_StackPeek (JUNO_DS_STACK_ROOT_T *ptStack) |
| Peek at the top item without removing it (O(1)). | |
Fixed-capacity LIFO stack built on the Array API.
This API has been generated by LibJuno: https://www.robinonsay.com/libjuno/
| typedef struct JUNO_DS_STACK_API_TAG JUNO_DS_STACK_API_T |
| typedef struct JUNO_DS_STACK_ROOT_TAG JUNO_DS_STACK_ROOT_T |
The stack root module.
| JUNO_STATUS_T JunoDs_StackInit | ( | JUNO_DS_STACK_ROOT_T * | ptStack, |
| JUNO_DS_ARRAY_ROOT_T * | ptStackArray, | ||
| JUNO_FAILURE_HANDLER_T | pfcnFailureHdlr, | ||
| JUNO_USER_DATA_T * | pvFailureUserData | ||
| ) |
Initialize a stack over a backing array with a given capacity.
| ptStack | Stack to initialize (output). |
| ptStackArray | 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 stack over a backing array with a given capacity.
| JUNO_RESULT_POINTER_T JunoDs_StackPeek | ( | JUNO_DS_STACK_ROOT_T * | ptStack | ) |
Peek at the top item without removing it (O(1)).
Peek at the next item in the queue
| JUNO_STATUS_T JunoDs_StackPop | ( | JUNO_DS_STACK_ROOT_T * | ptStack, |
| JUNO_POINTER_T | tReturn | ||
| ) |
Pop the top item into tReturn (O(1)).
Dequeue an item from the buffer
| JUNO_STATUS_T JunoDs_StackPush | ( | JUNO_DS_STACK_ROOT_T * | ptStack, |
| JUNO_POINTER_T | tItem | ||
| ) |
Push an item onto the top of the stack (O(1)).
Enqueue an item into the buffer
|
inlinestatic |