sbio_add_event_callback
int sbio_add_event_callback(
sbio_channel_handle_t *handle,
const char *event_name,
sbio_event_callback_t callback_function,
void *user_data);
Adds a callback to a receive channel. The event name can be specified as a pattern.
* - Any event
event_name - Exact match to 'event_name'
*event_name* - Anything containing 'event_name'
The sbio_event_callback_t structure has the following definition:
typedef void (*sbio_event_callback_t)(
const char *event_name,
char *event_format,
void *event_data,
int event_data_size,
void *user_data);
Parameters
| Parameter | Type | Description |
|---|---|---|
handle | sbio_channel_handle_t * | The receive handle to add the callback to. |
event_name | const char * | The name of the event to listen for, or NULL for all events. |
callback_function | sbio_event_callback_t | The function to call when the event is received. |
user_data | void * | Data that should be passed to the callback. |
Returns
| Type | Description |
|---|---|
int | 0 on success and non-zero on failure. |