-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhashtable.h
More file actions
38 lines (32 loc) · 1.03 KB
/
hashtable.h
File metadata and controls
38 lines (32 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <windows.h>
#include <stdio.h>
#include <stdint.h>
#include <stddef.h>
#include <math.h>
typedef struct _HASH_ENTRY
{
void* pKey;
SIZE_T nKeyLength;
void* pValue;
BOOL bIsFull;
struct _HASH_ENTRY* pNext;
}HASH_ENTRY, *PHASH_ENTRY;
typedef struct _HASH_TABLE
{
PVOID pInternal;
BOOL (*DeleteEntry)(struct _HASH_TABLE* self, PVOID pKey, SIZE_T nKeyLength, BOOL bFreeKey, BOOL bFreeValue);
BOOL (*SetEntry)(struct _HASH_TABLE** self, PVOID pKey, SIZE_T nKeyLength, PVOID pValue);
PVOID (*GetValue)(struct _HASH_TABLE* self, PVOID pKey, SIZE_T nKeyLength);
SIZE_T (*GetNumberOfEntries)(struct _HASH_TABLE* self);
HANDLE (*GetFirstEntry)(struct _HASH_TABLE* self, PHASH_ENTRY *pHashEntry);
BOOL (*GetNextEntry)(HANDLE hIterator, PHASH_ENTRY *pHashEntry);
}HASH_TABLE, * PHASH_TABLE;
BOOL
FreeHashTable(
PHASH_TABLE* pHashTable,
BOOL bFreeKey,
BOOL bFreeValue);
PHASH_TABLE
CreateHashTable(
SIZE_T nNumberOfInitalSlots,
DOUBLE dLoadFactor);