EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
Data Structures | Macros | Typedefs | Functions
hashmap.h File Reference

File containing the definition of the hashmap utilities. More...

#include <stdbool.h>
#include <uthash.h>
Include dependency graph for hashmap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  hashmap_str_keychar
 keyd array hasmap structure definition More...
 
struct  hashmap_str_keyptr
 string hasmap structure definition More...
 

Macros

#define HASH_KEY_CHAR_SIZE   20
 

Typedefs

typedef struct hashmap_str_keychar hmap_str_keychar
 keyd array hasmap structure definition More...
 
typedef struct hashmap_str_keyptr hmap_str_keyptr
 string hasmap structure definition More...
 

Functions

const char * hmap_str_keychar_get (const hmap_str_keychar *hmap, const char *keyptr)
 Retrieves a string from string hashmap for a given key. More...
 
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. More...
 
void hmap_str_keychar_free (hmap_str_keychar **hmap)
 Deletes the string hashmap object. More...
 

Detailed Description

File containing the definition of the hashmap utilities.

Author
Alexandru Mereacre
Date
2020

Macro Definition Documentation

◆ HASH_KEY_CHAR_SIZE

#define HASH_KEY_CHAR_SIZE   20

Typedef Documentation

◆ hmap_str_keychar

keyd array hasmap structure definition

◆ hmap_str_keyptr

string hasmap structure definition

Function Documentation

◆ hmap_str_keychar_free()

void hmap_str_keychar_free ( hmap_str_keychar **  hmap)

Deletes the string hashmap object.

Parameters
hmapThe string hashmap object

◆ hmap_str_keychar_get()

const char* hmap_str_keychar_get ( const hmap_str_keychar hmap,
const char *  keyptr 
)

Retrieves a string from string hashmap for a given key.

Parameters
hmapThe string hashmap object.
keyptrThe hashmap key.
Returns
Returned string, NULL if not found. Valid until the hashmap entry is deleted.

◆ hmap_str_keychar_put()

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.

Parameters
[in,out]hmapPointer to the string hashmap object.
keyptrThe hashmap key
valueThe hashmap string value
Returns
true on succes, false if there's an insertion error