+static struct afb_hook_ditf_itf hook_ditf_default_itf = {
+ .hook_ditf_event_broadcast_before = hook_ditf_event_broadcast_before_cb,
+ .hook_ditf_event_broadcast_after = hook_ditf_event_broadcast_after_cb,
+ .hook_ditf_get_event_loop = hook_ditf_get_event_loop_cb,
+ .hook_ditf_get_user_bus = hook_ditf_get_user_bus_cb,
+ .hook_ditf_get_system_bus = hook_ditf_get_system_bus_cb,
+ .hook_ditf_vverbose = hook_ditf_vverbose_cb,
+ .hook_ditf_event_make = hook_ditf_event_make_cb,
+ .hook_ditf_rootdir_get_fd = hook_ditf_rootdir_get_fd_cb,
+ .hook_ditf_rootdir_open_locale = hook_ditf_rootdir_open_locale_cb,
+ .hook_ditf_queue_job = hook_ditf_queue_job
+};
+
+/******************************************************************************
+ * section: hooks for tracing requests
+ *****************************************************************************/
+
+#define _HOOK_DITF_(what,...) \
+ struct afb_hook_ditf *hook; \
+ pthread_rwlock_rdlock(&rwlock); \
+ hook = list_of_ditf_hooks; \
+ while (hook) { \
+ if (hook->itf->hook_ditf_##what \
+ && (hook->flags & afb_hook_flag_ditf_##what) != 0 \
+ && (!hook->api || !strcasecmp(hook->api, ditf->prefix))) { \
+ hook->itf->hook_ditf_##what(hook->closure, __VA_ARGS__); \
+ } \
+ hook = hook->next; \
+ } \
+ pthread_rwlock_unlock(&rwlock);
+
+void afb_hook_ditf_event_broadcast_before(const struct afb_ditf *ditf, const char *name, struct json_object *object)