Wireshark 4.5.0
The Wireshark network protocol analyzer
|
Typedefs | |
typedef enum _wmem_cb_event_t | wmem_cb_event_t |
typedef bool(* | wmem_user_cb_t) (wmem_allocator_t *, wmem_cb_event_t, void *) |
Enumerations | |
enum | _wmem_cb_event_t { WMEM_CB_FREE_EVENT , WMEM_CB_DESTROY_EVENT } |
Functions | |
WS_DLL_PUBLIC unsigned | wmem_register_callback (wmem_allocator_t *allocator, wmem_user_cb_t callback, void *user_data) |
WS_DLL_PUBLIC void | wmem_unregister_callback (wmem_allocator_t *allocator, unsigned id) |
User callbacks.
typedef enum _wmem_cb_event_t wmem_cb_event_t |
The events that can trigger a callback.
typedef bool(* wmem_user_cb_t) (wmem_allocator_t *, wmem_cb_event_t, void *) |
Function signature for registered user callbacks.
allocator The allocator that triggered this callback. event The event type that triggered this callback. user_data Whatever user_data was originally passed to the call to wmem_register_callback().
enum _wmem_cb_event_t |
WS_DLL_PUBLIC unsigned wmem_register_callback | ( | wmem_allocator_t * | allocator, |
wmem_user_cb_t | callback, | ||
void * | user_data | ||
) |
Register a callback function with the given allocator pool.
allocator | The allocator with which to register the callback. |
callback | The function to be called as the callback. |
user_data | An arbitrary data pointer that is passed to the callback as a way to specify extra parameters or store extra data. Note 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. |
WS_DLL_PUBLIC void wmem_unregister_callback | ( | wmem_allocator_t * | allocator, |
unsigned | id | ||
) |
Unregister the callback function with the given ID.
allocator | The allocator from which to unregister the callback. |
id | The callback id as returned from wmem_register_callback(). |