Baseer 0.2.0
Baseer is an advanced binary analysis tool designed to provide deep insights into any file.
Loading...
Searching...
No Matches
b_hashmap.h
1#ifndef B_HASHMAP_H
2#define B_HASHMAP_H
3
4#include "stdlib.h"
5#include "string.h"
6#define TABLE_SIZE 200
7
8typedef struct bht_node {
9 char *name;
10 void *bht_node_p;
11 struct bht_node *next;
12} bht_node_t;
13
14typedef struct {
15 bht_node_t *buckets[TABLE_SIZE];
16} hashmap_t;
17
18
19unsigned int hash(const char *key);
21void insert(hashmap_t *map, const char *name, void *bht_node_p);
22void* get(hashmap_t *map, const char *name);
23void free_map(hashmap_t *map);
24
25#endif
hashmap_t * create_map(void)
Allocate and initialize a new hashmap.
Definition b_hashmap.c:36
void insert(hashmap_t *map, const char *name, void *bht_node_p)
Insert a key-value pair into the hashmap.
Definition b_hashmap.c:55
unsigned int hash(const char *key)
Compute hash value of a string key.
Definition b_hashmap.c:20
void * get(hashmap_t *map, const char *name)
Retrieve a value from the hashmap by key.
Definition b_hashmap.c:75
void free_map(hashmap_t *map)
Free all memory used by the hashmap.
Definition b_hashmap.c:96
Definition b_hashmap.h:8
Definition b_hashmap.h:14