Wireshark  2.9.0-477-g68ec514b
The Wireshark network protocol analyzer
Typedefs | Enumerations | Functions

Typedefs

typedef enum _wmem_cb_event_t wmem_cb_event_t
 
typedef gboolean(* 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 guint 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, guint id)
 

Detailed Description

User callbacks.

Typedef Documentation

The events that can trigger a callback.

typedef gboolean(* 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().

Returns
FALSE to unregister the callback, TRUE otherwise.

Enumeration Type Documentation

The events that can trigger a callback.

Enumerator
WMEM_CB_FREE_EVENT 

wmem_free_all()

WMEM_CB_DESTROY_EVENT 

wmem_destroy_allocator()

Function Documentation

WS_DLL_PUBLIC guint wmem_register_callback ( wmem_allocator_t allocator,
wmem_user_cb_t  callback,
void *  user_data 
)

Register a callback function with the given allocator pool.

Parameters
allocatorThe allocator with which to register the callback.
callbackThe function to be called as the callback.
user_dataAn 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.
Returns
ID of this callback that can be passed back to wmem_unregister_callback().
WS_DLL_PUBLIC void wmem_unregister_callback ( wmem_allocator_t allocator,
guint  id 
)

Unregister the callback function with the given ID.

Parameters
allocatorThe allocator from which to unregister the callback.
idThe callback id as returned from wmem_register_callback().