diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/SDK/OS/hashtable.h | 14 | ||||
-rw-r--r-- | include/darray.h | 25 | ||||
-rw-r--r-- | include/hashtable.h | 36 |
3 files changed, 61 insertions, 14 deletions
diff --git a/include/SDK/OS/hashtable.h b/include/SDK/OS/hashtable.h deleted file mode 100644 index 1893d1d..0000000 --- a/include/SDK/OS/hashtable.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef POKEREVO_HASHTABLE_H
-#define POKEREVO_HASHTABLE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif //POKEREVO_HASHTABLE_H
diff --git a/include/darray.h b/include/darray.h new file mode 100644 index 0000000..09c9db8 --- /dev/null +++ b/include/darray.h @@ -0,0 +1,25 @@ +#ifndef POKEREVO_DARRAY_H
+#define POKEREVO_DARRAY_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// size is at least 0x18 bytes
+typedef struct unkStruct2 {
+ s32 unk0; // TODO: number of elements in array
+ s32 unk4;
+ u32 unk8; // TODO: size of each element
+ s32 unkC;
+ s32 unk10;
+ char *unk14; // TODO: pointer to start of array
+} unkStruct2;
+
+
+void *ArrayNth(unkStruct2 *p1, s32 p2);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //POKEREVO_DARRAY_H
diff --git a/include/hashtable.h b/include/hashtable.h new file mode 100644 index 0000000..f2a9f22 --- /dev/null +++ b/include/hashtable.h @@ -0,0 +1,36 @@ +#ifndef POKEREVO_HASHTABLE_H
+#define POKEREVO_HASHTABLE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "darray.h"
+
+typedef s32 (*HashFunction)(void *, s32);
+
+// size 0x14
+// hashtable
+typedef struct unkStruct {
+ unkStruct2 **unk0;
+ s32 unk4; // TODO: number of elements in unk0
+ 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);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //POKEREVO_HASHTABLE_H
|