aboutsummaryrefslogtreecommitdiffstats
path: root/epan/wmem/wmem_user_cb.h
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2013-06-16 22:37:55 +0000
committerEvan Huus <eapache@gmail.com>2013-06-16 22:37:55 +0000
commit55264582bee31014d5d5a95b877b549287695bcd (patch)
tree64a331faddc0d2bedf39d49100a38e974eb91731 /epan/wmem/wmem_user_cb.h
parentffee3af2078a1bbe8a52396d133e2d3fa5d8c308 (diff)
More callback tweaks, to permit unregistering a callback from the same place
it was originally registered. svn path=/trunk/; revision=49969
Diffstat (limited to 'epan/wmem/wmem_user_cb.h')
-rw-r--r--epan/wmem/wmem_user_cb.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/epan/wmem/wmem_user_cb.h b/epan/wmem/wmem_user_cb.h
index 0491d76b07..3477167fb1 100644
--- a/epan/wmem/wmem_user_cb.h
+++ b/epan/wmem/wmem_user_cb.h
@@ -70,11 +70,22 @@ typedef gboolean (*wmem_user_cb_t) (wmem_allocator_t*, wmem_cb_event_t, void*);
* that this pointer is not freed when a callback is finished,
* you have to do that yourself in the callback, or just
* allocate it in the appropriate wmem pool.
+ * @return ID of this callback that can be passed back to
+ * wmem_unregister_callback().
+ */
+WS_DLL_PUBLIC
+guint
+wmem_register_callback(wmem_allocator_t *allocator, wmem_user_cb_t callback,
+ void *user_data);
+
+/** Unregister the callback function with the given ID.
+ *
+ * @param allocator The allocator from which to unregister the callback.
+ * @param id The callback id as returned from wmem_register_callback().
*/
WS_DLL_PUBLIC
void
-wmem_register_cleanup_callback(wmem_allocator_t *allocator,
- wmem_user_cb_t callback, void *user_data);
+wmem_unregister_callback(wmem_allocator_t *allocator, guint id);
/** @}
* @} */