diff options
Diffstat (limited to 'source/blender/blenlib/BLI_smallhash.h')
-rw-r--r-- | source/blender/blenlib/BLI_smallhash.h | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/source/blender/blenlib/BLI_smallhash.h b/source/blender/blenlib/BLI_smallhash.h index ec7b27f6651..07bd9975467 100644 --- a/source/blender/blenlib/BLI_smallhash.h +++ b/source/blender/blenlib/BLI_smallhash.h @@ -42,29 +42,31 @@ typedef struct { /*how much stack space to use before dynamically allocating memory*/ #define SMSTACKSIZE 64 typedef struct SmallHash { - SmallHashEntry *table; - SmallHashEntry _stacktable[SMSTACKSIZE]; - SmallHashEntry _copytable[SMSTACKSIZE]; - SmallHashEntry *stacktable, *copytable; - unsigned int used; - unsigned int curhash; - unsigned int size; + SmallHashEntry *buckets; + SmallHashEntry *buckets_stack; + SmallHashEntry *buckets_copy; + SmallHashEntry _buckets_stack[SMSTACKSIZE]; + SmallHashEntry _buckets_copy[SMSTACKSIZE]; + unsigned int nbuckets; + unsigned int nentries; + unsigned int cursize; } SmallHash; typedef struct { - SmallHash *hash; + SmallHash *sh; unsigned int i; } SmallHashIter; -void BLI_smallhash_init(SmallHash *hash) ATTR_NONNULL(1); -void BLI_smallhash_release(SmallHash *hash) ATTR_NONNULL(1); -void BLI_smallhash_insert(SmallHash *hash, uintptr_t key, void *item) ATTR_NONNULL(1); -void BLI_smallhash_remove(SmallHash *hash, uintptr_t key) ATTR_NONNULL(1); -void *BLI_smallhash_lookup(SmallHash *hash, uintptr_t key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; -bool BLI_smallhash_haskey(SmallHash *hash, uintptr_t key) ATTR_NONNULL(1); -int BLI_smallhash_count(SmallHash *hash) ATTR_NONNULL(1); +void BLI_smallhash_init(SmallHash *sh) ATTR_NONNULL(1); +void BLI_smallhash_release(SmallHash *sh) ATTR_NONNULL(1); +void BLI_smallhash_insert(SmallHash *sh, uintptr_t key, void *item) ATTR_NONNULL(1); +bool BLI_smallhash_remove(SmallHash *sh, uintptr_t key) ATTR_NONNULL(1); +void *BLI_smallhash_lookup(SmallHash *sh, uintptr_t key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; +void **BLI_smallhash_lookup_p(SmallHash *sh, uintptr_t key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; +bool BLI_smallhash_haskey(SmallHash *sh, uintptr_t key) ATTR_NONNULL(1); +int BLI_smallhash_count(SmallHash *sh) ATTR_NONNULL(1); void *BLI_smallhash_iternext(SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; -void *BLI_smallhash_iternew(SmallHash *hash, SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; -/* void BLI_smallhash_print(SmallHash *hash); */ /* UNUSED */ +void *BLI_smallhash_iternew(SmallHash *sh, SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; +/* void BLI_smallhash_print(SmallHash *sh); */ /* UNUSED */ #endif /* __BLI_SMALLHASH_H__ */ |