aboutsummaryrefslogtreecommitdiffstats
path: root/router/router.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-06-28 19:09:38 -0700
committerChris Robinson <[email protected]>2017-06-28 19:09:38 -0700
commitb88b57868ab37453980170896070631714fdc1fa (patch)
tree4b34806dfb6f73ff72b208b88d051766f16b0c6c /router/router.h
parent9fd7349220223c90e4476030f55a033eb3a37dbd (diff)
Add a ptr-to-int map
Diffstat (limited to 'router/router.h')
-rw-r--r--router/router.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/router/router.h b/router/router.h
index 57a32d9a..7cd776f4 100644
--- a/router/router.h
+++ b/router/router.h
@@ -8,6 +8,7 @@
#include "AL/alc.h"
#include "AL/al.h"
#include "atomic.h"
+#include "rwlock.h"
typedef struct DriverIface {
@@ -116,4 +117,21 @@ extern int DriverListSize;
extern ATOMIC(DriverIface*) CurrentCtxDriver;
+typedef struct PtrIntMap {
+ ALvoid **keys;
+ /* Shares memory with keys. */
+ ALint *values;
+
+ ALsizei size;
+ ALsizei capacity;
+ RWLock lock;
+} PtrIntMap;
+#define PTRINTMAP_STATIC_INITIALIZE { NULL, NULL, 0, 0, RWLOCK_STATIC_INITIALIZE }
+
+void InitPtrIntMap(PtrIntMap *map);
+void ResetPtrIntMap(PtrIntMap *map);
+ALenum InsertPtrIntMapEntry(PtrIntMap *map, ALvoid *key, ALint value);
+ALint RemovePtrIntMapKey(PtrIntMap *map, ALvoid *key);
+ALint LookupPtrIntMapKey(PtrIntMap *map, ALvoid *key);
+
#endif /* ROUTER_ROUTER_H */