|
LibJuno 1.0.1
LibJuno is a lightweight C11 library designed specifically for embedded systems.
|
#include "engine_app/engine_cmd_msg.h"#include "juno/ds/array_api.h"#include "juno/macros.h"#include "juno/memory/pointer_api.h"#include "juno/status.h"
Macros | |
| #define | ENGINE_CMD_MSG_PIPE_ASSERT_API(ptArray, ...) if(ptArray->ptApi != >EngineCmdMsgPipeApi) { __VA_ARGS__; } |
| Asserts the api is for the pipe. | |
Functions | |
| static JUNO_STATUS_T | EngineCmdMsg_Copy (JUNO_POINTER_T tDest, const JUNO_POINTER_T tSrc) |
| static JUNO_STATUS_T | EngineCmdMsg_Reset (JUNO_POINTER_T tPointer) |
| static JUNO_STATUS_T | SetAt (JUNO_DS_ARRAY_ROOT_T *ptArray, JUNO_POINTER_T tItem, size_t iIndex) |
| Set the value at an index. | |
| static JUNO_RESULT_POINTER_T | GetAt (JUNO_DS_ARRAY_ROOT_T *ptArray, size_t iIndex) |
| Get the value at an index. | |
| static JUNO_STATUS_T | RemoveAt (JUNO_DS_ARRAY_ROOT_T *ptArray, size_t iIndex) |
| Remove a value at an index. | |
| JUNO_STATUS_T | EngineCmdMsg_ArrayInit (ENGINE_CMD_MSG_ARRAY_T *ptEngineCmdMsgPipe, ENGINE_CMD_MSG_T *ptArrEngineCmdMsgBuffer, size_t iCapacity, JUNO_FAILURE_HANDLER_T pfcnFailureHdlr, JUNO_USER_DATA_T *pvUserData) |
Variables | |
| const JUNO_POINTER_API_T | gtEngineCmdMsgPointerApi |
| static const JUNO_DS_ARRAY_API_T | gtEngineCmdMsgPipeApi |
| #define ENGINE_CMD_MSG_PIPE_ASSERT_API | ( | ptArray, | |
| ... | |||
| ) | if(ptArray->ptApi != >EngineCmdMsgPipeApi) { __VA_ARGS__; } |
| JUNO_STATUS_T EngineCmdMsg_ArrayInit | ( | ENGINE_CMD_MSG_ARRAY_T * | ptEngineCmdMsgPipe, |
| ENGINE_CMD_MSG_T * | ptArrEngineCmdMsgBuffer, | ||
| size_t | iCapacity, | ||
| JUNO_FAILURE_HANDLER_T | pfcnFailureHdlr, | ||
| JUNO_USER_DATA_T * | pvUserData | ||
| ) |
|
static |
DOC
In .c source file we will need to implement the following functions for the pointer and queue api:
DOC
The pointer copy function is responsible for copy memory from one pointer of the same type to another. We verify the pointers are implemented and are of the same type by checking the alignment, size, and api pointer. We then dereference the pointer and copy the values since we have verified the type
|
static |
|
static |
Get the value at an index.
|
static |
Remove a value at an index.
|
static |
|
static |
| const JUNO_POINTER_API_T gtEngineCmdMsgPointerApi |
DOC These function will provide an interface to our specific message type and enable users to write type-safe code within LibJuno.
We need to forward-declare these API functions so we can use the API pointer to verify the type of the queue and pointer.
Below we will instantiate the pointer and pipe API tables.