diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenlib/BLI_edgehash.h | 1 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_ghash.h | 1 | ||||
-rw-r--r-- | source/blender/blenlib/intern/BLI_ghash.c | 12 | ||||
-rw-r--r-- | source/blender/blenlib/intern/edgehash.c | 8 |
4 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_edgehash.h b/source/blender/blenlib/BLI_edgehash.h index 5a5ea5ca3be..510d881f26d 100644 --- a/source/blender/blenlib/BLI_edgehash.h +++ b/source/blender/blenlib/BLI_edgehash.h @@ -62,6 +62,7 @@ EdgeHashIterator *BLI_edgehashIterator_new(EdgeHash *eh) ATTR_MALLOC ATTR_WARN void BLI_edgehashIterator_free(EdgeHashIterator *ehi); void BLI_edgehashIterator_getKey(EdgeHashIterator *ehi, unsigned int *v0_r, unsigned int *v1_r); void *BLI_edgehashIterator_getValue(EdgeHashIterator *ehi) ATTR_WARN_UNUSED_RESULT; +void **BLI_edgehashIterator_getValue_p(EdgeHashIterator *ehi) ATTR_WARN_UNUSED_RESULT; void BLI_edgehashIterator_setValue(EdgeHashIterator *ehi, void *val); void BLI_edgehashIterator_step(EdgeHashIterator *ehi); bool BLI_edgehashIterator_isDone(EdgeHashIterator *ehi) ATTR_WARN_UNUSED_RESULT; diff --git a/source/blender/blenlib/BLI_ghash.h b/source/blender/blenlib/BLI_ghash.h index 17ad47aa871..e5a93691ad0 100644 --- a/source/blender/blenlib/BLI_ghash.h +++ b/source/blender/blenlib/BLI_ghash.h @@ -86,6 +86,7 @@ void BLI_ghashIterator_free(GHashIterator *ghi); void *BLI_ghashIterator_getKey(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT; void *BLI_ghashIterator_getValue(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT; +void **BLI_ghashIterator_getValue_p(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT; void BLI_ghashIterator_step(GHashIterator *ghi); bool BLI_ghashIterator_done(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT; diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index 750202c509d..7b50e9012a8 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -602,6 +602,18 @@ void *BLI_ghashIterator_getValue(GHashIterator *ghi) } /** + * Retrieve the value from an iterator. + * + * \param ghi The iterator. + * \return The value at the current index, or NULL if the + * iterator is done. + */ +void **BLI_ghashIterator_getValue_p(GHashIterator *ghi) +{ + return ghi->curEntry ? &ghi->curEntry->val : NULL; +} + +/** * Steps the iterator to the next index. * * \param ghi The iterator. diff --git a/source/blender/blenlib/intern/edgehash.c b/source/blender/blenlib/intern/edgehash.c index 967b59cf25d..b26e007b3e6 100644 --- a/source/blender/blenlib/intern/edgehash.c +++ b/source/blender/blenlib/intern/edgehash.c @@ -484,6 +484,14 @@ void *BLI_edgehashIterator_getValue(EdgeHashIterator *ehi) } /** + * Retrieve the pointer to the value from an iterator. + */ +void **BLI_edgehashIterator_getValue_p(EdgeHashIterator *ehi) +{ + return ehi->curEntry ? &ehi->curEntry->val : NULL; +} + +/** * Set the value for an iterator. */ void BLI_edgehashIterator_setValue(EdgeHashIterator *ehi, void *val) |