LibJuno 0.42.0
LibJuno is a lightweight C99 library designed specifically for embedded systems.
Loading...
Searching...
No Matches
map_api.h
Go to the documentation of this file.
1/*
2 MIT License
3
4 Copyright (c) 2025 Robin A. Onsay
5
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files
8 (the "Software"), to deal in the Software without restriction,
9 including without limitation the rights to use, copy, modify, merge,
10 publish, distribute, sublicense, and/or sell copies of the Software,
11 and to permit persons to whom the Software is furnished to do so,
12 subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be
15 included in all copies or substantial portions of the Software.
16*/
17
27#ifndef JUNO_MAP_API_H
28#define JUNO_MAP_API_H
29#include "juno/hash/hash_api.h"
31#include "juno/status.h"
32#include "juno/module.h"
33#include <stdbool.h>
34#ifdef __cplusplus
35extern "C"
36{
37#endif
38
41
42typedef union JUNO_MAP_TAG JUNO_MAP_T;
43typedef struct JUNO_MAP_ROOT_TAG JUNO_MAP_ROOT_T;
44
45struct JUNO_MAP_ROOT_TAG JUNO_MODULE_ROOT(JUNO_MAP_API_T,
46 JUNO_HASH_T *ptHash;
47 JUNO_MEMORY_T *ptMapKeys;
48 JUNO_MEMORY_T *ptMapValues;
49 size_t zCapacity;
50 size_t zLenHashTable;
51 JUNO_MAP_KEY_EQUAL_FCN_T pfcnIsEqual;
52);
53
77
78#ifdef __cplusplus
79}
80#endif
81#endif // JUNO_MAP_API_H
union JUNO_HASH_TAG JUNO_HASH_T
Definition hash_api.h:39
bool(* JUNO_MAP_KEY_EQUAL_FCN_T)(JUNO_MEMORY_T ptKey1, JUNO_MEMORY_T ptKey2)
Definition map_api.h:40
union JUNO_MAP_TAG JUNO_MAP_T
Definition map_api.h:42
struct JUNO_MAP_ROOT_TAG JUNO_MAP_ROOT_T
Definition map_api.h:43
#define JUNO_MODULE_ROOT(API_T,...)
Definition module.h:182
int32_t JUNO_STATUS_T
Definition status.h:23
Definition map_api.h:55
JUNO_STATUS_T(* Remove)(JUNO_MAP_T *ptMap, JUNO_MEMORY_T tKey)
Definition map_api.h:67
JUNO_STATUS_T(* Set)(JUNO_MAP_T *ptMap, JUNO_MEMORY_T tKey, JUNO_MEMORY_T tValue)
Definition map_api.h:61
JUNO_STATUS_T(* Get)(JUNO_MAP_T *ptMap, JUNO_MEMORY_T tKey, JUNO_MEMORY_T *ptRetValue)
Definition map_api.h:75
Structure for an allocated memory segment. Describes the allocated memory with a pointer to the start...
Definition memory_api.h:52