Provides a callback-with-argument event type. More...
Provides a callback-with-argument event type.
Example:
Event Callback API
Definition in file callback.h.
Go to the source code of this file.
Data Structures | |
struct | event_callback_t |
Callback Event structure definition. More... | |
#define | EVENT_CALLBACK_INIT(_cb, _arg) |
Callback Event static initializer. | |
void | event_callback_init (event_callback_t *event_callback, void(*callback)(void *), void *arg) |
event callback initialization function | |
static void | event_callback_post (event_queue_t *queue, event_callback_t *event) |
Queue an event. | |
static void | event_callback_oneshot (event_callback_t *event, event_queue_t *queue, void(*callback)(void *), void *arg) |
Generate a one-shot callback event on queue . | |
void | _event_callback_handler (event_t *event) |
event callback handler function (used internally) | |
#define EVENT_CALLBACK_INIT | ( | _cb, | |
_arg | |||
) |
Callback Event static initializer.
[in] | _cb | callback function to set |
[in] | _arg | arguments to set |
Definition at line 116 of file callback.h.
void event_callback_init | ( | event_callback_t * | event_callback, |
void(*)(void *) | callback, | ||
void * | arg | ||
) |
event callback initialization function
[out] | event_callback | object to initialize |
[in] | callback | callback to set up |
[in] | arg | callback argument to set up |
|
inlinestatic |
Generate a one-shot callback event on queue
.
This will initialize event
and post it immediately
[in] | event | event_callback object to initialize |
[in] | queue | queue that the event will be added to |
[in] | callback | callback to set up |
[in] | arg | callback argument to set up |
Definition at line 93 of file callback.h.
|
inlinestatic |
Queue an event.
The given event will be posted on the given queue
. If the event is already queued when calling this function, the event will not be touched and remain in the previous position on the queue. So reposting an event while it is already on the queue will have no effect.
[in] | queue | event queue to queue event in |
[in] | event | event to queue in event queue |
Definition at line 77 of file callback.h.