lib-event-private.h revision ddd5a0932db39f7336123f5089fdd77f6a38bce6
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen /* linked list of all events, newest first */
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen /* Call callbacks with EVENT_CALLBACK_TYPE_FREE for this event. */
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen/* Fields that are exported & imported: */
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen /* This is the event's name while it's being sent. It'll be removed
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen after the event is sent. */
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen /* Event is being sent */
4ece61edd7c266a4b8f3b290a7f0a3cb3d13ca0fTimo Sirainen /* Event with call_free=TRUE is being freed */
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen/* Returns TRUE if the event should continue to the next handler. Unless
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen stopped, the final handler logs the event if it matches the log filter. */
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainentypedef bool event_callback_t(struct event *event,
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen/* Called when category is registered or unregistered. The parent category
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen is always already registered. */
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainentypedef void event_category_callback_t(struct event_category *category);
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainenvoid event_send(struct event *event, struct failure_context *ctx,
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainenvoid event_vsend(struct event *event, struct failure_context *ctx,
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen const char *fmt, va_list args) ATTR_FORMAT(3, 0);
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen/* Find event category by name. This only finds registered categories. */
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainenstruct event_category *event_category_find_registered(const char *name);
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainen/* Return all registered categories. */
3b49aee9ced3b0370a3be396aca53acd5f21418cTimo Sirainenevent_get_registered_categories(unsigned int *count_r);
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen/* Register callback to be called whenever events are sent. */
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainenvoid event_register_callback(event_callback_t *callback);
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainenvoid event_unregister_callback(event_callback_t *callback);
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen/* Register callback to be called whenever categories are registered or
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainen unregistered. */
24e5e4526d8f5cbc056ab97fd0d154d0936d7a5eTimo Sirainenvoid event_category_register_callback(event_category_callback_t *callback);