diff options
author | Michael Mann <mmann78@netscape.net> | 2017-02-09 10:14:46 -0500 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2017-02-09 22:03:01 +0000 |
commit | e3128d98060017bd08ec6bcb17290c7ffa7784ed (patch) | |
tree | be4ad8c0b0fe85ec25c6d63ba22d19e2cc6d6547 /epan/wmem/wmem_map.h | |
parent | cd3855225935c13e8db71ca73688aadd6445a710 (diff) |
Add wmem_map_steal
Mimic functionality of g_hash_table_steal
Change-Id: Iaf4aeef951b60934569143b2d119f782aeefe380
Reviewed-on: https://code.wireshark.org/review/20038
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/wmem/wmem_map.h')
-rw-r--r-- | epan/wmem/wmem_map.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/epan/wmem/wmem_map.h b/epan/wmem/wmem_map.h index 1ea4cf3350..8c3e90972d 100644 --- a/epan/wmem/wmem_map.h +++ b/epan/wmem/wmem_map.h @@ -120,6 +120,17 @@ WS_DLL_PUBLIC void * wmem_map_remove(wmem_map_t *map, const void *key); +/** Remove a key and value from the map but does not destroy (free) them. If no + * value is stored at that key, nothing happens. + * + * @param map The map to remove from. + * @param key The key of the value to remove. + * @return TRUE if key is found FALSE if not. + */ +WS_DLL_PUBLIC +gboolean +wmem_map_steal(wmem_map_t *map, const void *key); + /** Run a function against all key/value pairs in the map. The order * of the calls is unpredictable, since it is based on the internal * storage of data. |