diff options
Diffstat (limited to 'include/hashtable.h')
-rw-r--r-- | include/hashtable.h | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/include/hashtable.h b/include/hashtable.h index 93d27cd..0502273 100644 --- a/include/hashtable.h +++ b/include/hashtable.h @@ -9,25 +9,24 @@ extern "C" { typedef s32 (*HashFunction)(void *, s32);
-// size 0x14
-// hashtable
-typedef struct unkStruct {
- unkStruct2 **unk0;
- s32 unk4; // TODO: number of elements in unk0
+
+typedef struct HashTable {
+ DArray **chains;
+ s32 size;
s32 unk8;
- HashFunction unkC; // TODO: callback to hashing function
- s32 unk10;
-} unkStruct;
-
-unkStruct *TableNew(s32 p1, s32 p2, HashFunction p3, s32 p4, s32 p5);
-unkStruct *TableNew2(s32 p1, s32 p2, s32 p3, HashFunction p4, s32 p5, s32 p6);
-void TableFree(unkStruct *p1);
-s32 TableCount(unkStruct *p1);
-void TableEnter(unkStruct *p1, void *p2);
-BOOL TableRemove(unkStruct *p1, void *p2);
-void *TableLookup(unkStruct *p1, void *p2);
-void TableMapSafe(unkStruct *p1, s32 p2, s32 p3);
-void *TableMapSafe2(unkStruct *p1, s32 p2, s32 p3);
+ HashFunction hashFunc;
+ s32 unk10; // comparison callback?
+} HashTable;
+
+HashTable *TableNew(s32 p1, s32 p2, HashFunction hf, s32 p4, s32 p5);
+HashTable *TableNew2(s32 p1, s32 size, s32 p3, HashFunction hf, s32 p5, s32 p6);
+void TableFree(HashTable *table);
+s32 TableCount(HashTable *table);
+void TableEnter(HashTable *table, void *elem);
+BOOL TableRemove(HashTable *table, void *elem);
+void *TableLookup(HashTable *table, void *elem);
+void TableMapSafe(HashTable *table, s32 p2, s32 p3);
+void *TableMapSafe2(HashTable *table, s32 p2, s32 p3);
#ifdef __cplusplus
}
|