EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
hashmap.h
Go to the documentation of this file.
1 
11 #ifndef HASHMAP_H_
12 #define HASHMAP_H_
13 
14 #include <stdbool.h>
15 #include <uthash.h>
16 
17 #define HASH_KEY_CHAR_SIZE 20
18 
23 typedef struct hashmap_str_keychar {
25  char *value;
26  UT_hash_handle hh;
28 
33 typedef struct hashmap_str_keyptr {
34  char *key;
35  char *value;
36  UT_hash_handle hh;
38 
47 const char *hmap_str_keychar_get(const hmap_str_keychar *hmap,
48  const char *keyptr);
49 
58 bool hmap_str_keychar_put(hmap_str_keychar **hmap, const char *keyptr,
59  const char *value);
60 
67 
68 #endif
struct hashmap_str_keyptr hmap_str_keyptr
string hasmap structure definition
void hmap_str_keychar_free(hmap_str_keychar **hmap)
Deletes the string hashmap object.
Definition: hashmap.c:87
struct hashmap_str_keychar hmap_str_keychar
keyd array hasmap structure definition
const char * hmap_str_keychar_get(const hmap_str_keychar *hmap, const char *keyptr)
Retrieves a string from string hashmap for a given key.
Definition: hashmap.c:30
bool hmap_str_keychar_put(hmap_str_keychar **hmap, const char *keyptr, const char *value)
Inserts a string into a string hashmap for a given key.
Definition: hashmap.c:46
#define HASH_KEY_CHAR_SIZE
Definition: hashmap.h:17
keyd array hasmap structure definition
Definition: hashmap.h:23
char key[HASH_KEY_CHAR_SIZE]
Definition: hashmap.h:24
UT_hash_handle hh
Definition: hashmap.h:26
char * value
Definition: hashmap.h:25
string hasmap structure definition
Definition: hashmap.h:33
char * key
Definition: hashmap.h:34
char * value
Definition: hashmap.h:35
UT_hash_handle hh
Definition: hashmap.h:36