LibJuno 0.1.0
LibJuno is a lightweight C99 library designed specifically for embedded systems.
|
#include "juno/hash/hash_api.h"
#include "juno/macros.h"
#include "juno/map/map.h"
#include "juno/map/map_api.h"
#include "juno/map/map_types.h"
#include "juno/memory/memory_types.h"
#include "juno/status.h"
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
Functions | |
JUNO_STATUS_T | Juno_MapInit (JUNO_MAP_T *ptMap, const JUNO_HASH_API_T *ptHashApi, JUNO_MEMORY_T *ptKeyTable, JUNO_MEMORY_T *ptValueTable, size_t zCapacity, JUNO_MAP_KEY_EQUAL_FCN_T pfcnIsEqual, JUNO_FAILURE_HANDLER_T pfcnFailureHandler, JUNO_USER_DATA_T *pvFailureUserData) |
JUNO_STATUS_T | Juno_MapSet (JUNO_MAP_T *ptMap, JUNO_MEMORY_T tKey, JUNO_MEMORY_T tValue) |
JUNO_STATUS_T | Juno_MapRemove (JUNO_MAP_T *ptMap, JUNO_MEMORY_T tKey) |
JUNO_STATUS_T | Juno_MapGet (JUNO_MAP_T *ptMap, JUNO_MEMORY_T tKey, JUNO_MEMORY_T *ptRetValue) |
const JUNO_MAP_API_T * | Juno_MapApi (void) |
const JUNO_MAP_API_T * Juno_MapApi | ( | void | ) |
JUNO_STATUS_T Juno_MapGet | ( | JUNO_MAP_T * | ptMap, |
JUNO_MEMORY_T | tKey, | ||
JUNO_MEMORY_T * | ptRetValue | ||
) |
Get a value from the map using the key
ptMap | A pointer to the map |
tKey | The key to use |
ptRetVal | The return value retrieved using the key |
JUNO_STATUS_DNE_ERROR
if the key is not in the map JUNO_STATUS_T Juno_MapInit | ( | JUNO_MAP_T * | ptMap, |
const JUNO_HASH_API_T * | ptHashApi, | ||
JUNO_MEMORY_T * | ptKeyTable, | ||
JUNO_MEMORY_T * | ptValueTable, | ||
size_t | zCapacity, | ||
JUNO_MAP_KEY_EQUAL_FCN_T | pfcnIsEqual, | ||
JUNO_FAILURE_HANDLER_T | pfcnFailureHandler, | ||
JUNO_USER_DATA_T * | pvFailureUserData | ||
) |
Initialize a Juno Map
ptMap | A pointer to the map to initalize |
ptKeyTable | The allocated memory for the keys |
ptValueTable | The allocated memory for the values |
zKeySize | The size of the key |
zCapacity | The capacity of the map table |
pfcnIsEqual | A function to determine if two keys are equal |
pfcnFailureHandler | The failure handler |
pvFailureUserData | User data to provide to the failure handler |
JUNO_STATUS_T Juno_MapRemove | ( | JUNO_MAP_T * | ptMap, |
JUNO_MEMORY_T | tKey | ||
) |
Remove a key,value pair from the map
ptMap | A pointer to the map |
tKey | The key to remove |
JUNO_STATUS_T Juno_MapSet | ( | JUNO_MAP_T * | ptMap, |
JUNO_MEMORY_T | tKey, | ||
JUNO_MEMORY_T | tValue | ||
) |
Add a key,value pair to the map
ptMap | A pointer to the map |
ptKey | A key to add |
pvValue | A value to add |