LibJuno 1.0.1
LibJuno is a lightweight C11 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
map_api.h File Reference

Open-addressed hash map API built on Array and Pointer traits. More...

#include "juno/ds/array_api.h"
#include "juno/macros.h"
#include "juno/memory/pointer_api.h"
#include "juno/module.h"
#include <stdbool.h>
#include <stddef.h>
#include "juno/status.h"
#include "juno/types.h"
Include dependency graph for map_api.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  JUNO_MAP_HASHABLE_POINTER_API_TAG
 Hashing and null-check operations for map keys/values. More...
 
struct  JUNO_MAP_API_TAG
 Map API vtable. More...
 

Typedefs

typedef struct JUNO_MAP_API_TAG JUNO_MAP_API_T
 Map API vtable type.
 
typedef struct JUNO_MAP_ROOT_TAG JUNO_MAP_ROOT_T
 Map root type holding state and API pointers.
 
typedef struct JUNO_MAP_HASHABLE_POINTER_API_TAG JUNO_MAP_HASHABLE_POINTER_API_T
 Hashing and null-check operations for keys/entries.
 

Functions

struct JUNO_MAP_ROOT_TAG JUNO_MODULE_ROOT (JUNO_MAP_API_T, const JUNO_MAP_HASHABLE_POINTER_API_T *ptHashablePointerApi;const JUNO_VALUE_POINTER_API_T *ptValuePointerApi;JUNO_DS_ARRAY_ROOT_T *ptHashMap;)
 Map root instance and state.
 
static JUNO_STATUS_T JunoDs_MapVerify (JUNO_MAP_ROOT_T *ptMap)
 Verify the map root, APIs, and backing array are valid.
 
JUNO_STATUS_T JunoDs_MapInit (JUNO_MAP_ROOT_T *ptMapRoot, const JUNO_MAP_HASHABLE_POINTER_API_T *ptHashablePointerApi, const JUNO_VALUE_POINTER_API_T *ptValuePointerApi, JUNO_DS_ARRAY_ROOT_T *ptArray, JUNO_FAILURE_HANDLER_T pfcnFailureHandler, JUNO_USER_DATA_T *pvUserData)
 Initialize the map root with hashing/equality APIs and backing array.
 
JUNO_RESULT_POINTER_T JunoDs_MapGet (JUNO_MAP_ROOT_T *ptJunoMap, JUNO_POINTER_T tItem)
 Retrieve an entry by key via linear probing.
 
JUNO_STATUS_T JunoDs_MapSet (JUNO_MAP_ROOT_T *ptJunoMap, JUNO_POINTER_T tItem)
 Insert or update an entry (key/value) via linear probing.
 
JUNO_STATUS_T JunoDs_MapRemove (JUNO_MAP_ROOT_T *ptJunoMap, JUNO_POINTER_T tKey)
 Remove an entry by key via linear probing.
 

Detailed Description

Open-addressed hash map API built on Array and Pointer traits.

This API has been generated by LibJuno: https://www.robinonsay.com/libjuno/

Typedef Documentation

◆ JUNO_MAP_API_T

Map API vtable type.

◆ JUNO_MAP_HASHABLE_POINTER_API_T

Hashing and null-check operations for keys/entries.

◆ JUNO_MAP_ROOT_T

typedef struct JUNO_MAP_ROOT_TAG JUNO_MAP_ROOT_T

Map root type holding state and API pointers.