Remove an unused function
[openal-soft.git] / common / uintmap.h
blob32cd1eaab93cc9de1b614cf77c47259c2b0fa3cf
1 #ifndef AL_UINTMAP_H
2 #define AL_UINTMAP_H
4 #include <limits.h>
6 #include "AL/al.h"
7 #include "rwlock.h"
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
13 typedef struct UIntMap {
14 ALuint *keys;
15 /* Shares memory with keys. */
16 ALvoid **values;
18 ALsizei size;
19 ALsizei capacity;
20 ALsizei limit;
21 RWLock lock;
22 } UIntMap;
23 #define UINTMAP_STATIC_INITIALIZE_N(_n) { NULL, NULL, 0, 0, (_n), RWLOCK_STATIC_INITIALIZE }
24 #define UINTMAP_STATIC_INITIALIZE UINTMAP_STATIC_INITIALIZE_N(INT_MAX)
26 void InitUIntMap(UIntMap *map, ALsizei limit);
27 void ResetUIntMap(UIntMap *map);
28 ALenum InsertUIntMapEntry(UIntMap *map, ALuint key, ALvoid *value);
29 ALenum InsertUIntMapEntryNoLock(UIntMap *map, ALuint key, ALvoid *value);
30 ALvoid *RemoveUIntMapKey(UIntMap *map, ALuint key);
31 ALvoid *RemoveUIntMapKeyNoLock(UIntMap *map, ALuint key);
32 ALvoid *LookupUIntMapKey(UIntMap *map, ALuint key);
33 ALvoid *LookupUIntMapKeyNoLock(UIntMap *map, ALuint key);
35 inline void LockUIntMapRead(UIntMap *map)
36 { ReadLock(&map->lock); }
37 inline void UnlockUIntMapRead(UIntMap *map)
38 { ReadUnlock(&map->lock); }
39 inline void LockUIntMapWrite(UIntMap *map)
40 { WriteLock(&map->lock); }
41 inline void UnlockUIntMapWrite(UIntMap *map)
42 { WriteUnlock(&map->lock); }
44 #ifdef __cplusplus
46 #endif
48 #endif /* AL_UINTMAP_H */