This repository has been archived on 2026-04-17. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
bhlib/include/BH/Hashmap.h

91 lines
1.3 KiB
C
Raw Normal View History

2025-01-18 17:24:36 +03:00
#ifndef BH_HASHMAP_H
#define BH_HASHMAP_H
#include "Common.h"
2025-01-18 17:24:36 +03:00
typedef struct BH_Hashmap BH_Hashmap;
2025-01-18 17:24:36 +03:00
BH_Hashmap *BH_HashmapNew(BH_EqualCallback equal,
BH_HashCallback hash);
2025-01-18 17:24:36 +03:00
void BH_HashmapFree(BH_Hashmap *hashmap);
2025-01-18 17:24:36 +03:00
void BH_HashmapClear(BH_Hashmap *hashmap);
2025-01-18 17:24:36 +03:00
int BH_HashmapReserve(BH_Hashmap *hashmap,
size_t size);
2025-01-18 17:24:36 +03:00
int BH_HashmapInsert(BH_Hashmap *hashmap,
void *key,
void *value);
2025-01-18 17:24:36 +03:00
void BH_HashmapRemove(BH_Hashmap *hashmap,
void *key);
2025-01-18 17:24:36 +03:00
int BH_HashmapAt(BH_Hashmap *hashmap,
void *key,
void **value);
2025-01-18 17:24:36 +03:00
int BH_HashmapEmpty(BH_Hashmap *hashmap);
2025-01-18 17:24:36 +03:00
size_t BH_HashmapSize(BH_Hashmap *hashmap);
2025-01-18 17:24:36 +03:00
size_t BH_HashmapCapacity(BH_Hashmap *hashmap);
2025-01-18 17:24:36 +03:00
float BH_HashmapFactor(BH_Hashmap *hashmap);
2025-01-18 17:24:36 +03:00
void BH_HashmapSetFactor(BH_Hashmap *hashmap,
float factor);
2025-01-18 17:24:36 +03:00
void *BH_HashmapIterAt(BH_Hashmap *hashmap,
void *key);
2025-01-18 17:24:36 +03:00
void *BH_HashmapIterNext(BH_Hashmap *hashmap,
void *iter);
2025-01-18 17:24:36 +03:00
void BH_HashmapIterRemove(BH_Hashmap *hashmap,
void *iter);
2025-01-18 17:24:36 +03:00
void *BH_HashmapIterKey(void *iter);
2025-01-18 17:24:36 +03:00
void *BH_HashmapIterValue(void *iter);
2025-01-18 17:24:36 +03:00
#endif /* BH_HASHMAP_H */