* Author José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Author José Bollo <jose.bollo@iot.bzh>
*
* Licensed under the Apache License, Version 2.0 (the "License");
.broadcast = (void*)afb_evt_evtid_hooked_broadcast,
.push = (void*)afb_evt_evtid_hooked_push,
.unref = (void*)afb_evt_evtid_hooked_unref,
.name = (void*)afb_evt_evtid_hooked_name,
.addref = (void*)afb_evt_evtid_hooked_addref
};
.broadcast = (void*)afb_evt_evtid_hooked_broadcast,
.push = (void*)afb_evt_evtid_hooked_push,
.unref = (void*)afb_evt_evtid_hooked_unref,
.name = (void*)afb_evt_evtid_hooked_name,
.addref = (void*)afb_evt_evtid_hooked_addref
};
/* head of the list of listeners */
static pthread_rwlock_t listeners_rwlock = PTHREAD_RWLOCK_INITIALIZER;
/* head of the list of listeners */
static pthread_rwlock_t listeners_rwlock = PTHREAD_RWLOCK_INITIALIZER;
{
return hooked_broadcast(evtid->fullname, object, evtid->id, evtid->hookflags);
}
{
return hooked_broadcast(evtid->fullname, object, evtid->id, evtid->hookflags);
}
return hooked_broadcast(event, object, 0, -1);
return hooked_broadcast(event, object, 0, -1);
evtid->id = event_id_counter;
pthread_rwlock_init(&evtid->rwlock, NULL);
evtids = evtid;
evtid->id = event_id_counter;
pthread_rwlock_init(&evtid->rwlock, NULL);
evtids = evtid;
if (evtid->hookflags & afb_hook_flag_evt_create)
afb_hook_evt_create(evtid->fullname, evtid->id);
if (evtid->hookflags & afb_hook_flag_evt_create)
afb_hook_evt_create(evtid->fullname, evtid->id);
afb_hook_evt_addref(evtid->fullname, evtid->id);
return afb_evt_evtid_addref(evtid);
}
afb_hook_evt_addref(evtid->fullname, evtid->id);
return afb_evt_evtid_addref(evtid);
}
afb_hook_evt_unref(evtid->fullname, evtid->id);
afb_evt_evtid_unref(evtid);
}
afb_hook_evt_unref(evtid->fullname, evtid->id);
afb_evt_evtid_unref(evtid);
}
pthread_rwlock_rdlock(&events_rwlock);
for (evtid = evtids ; evtid ; evtid = evtid->next) {
evtid->hookflags = afb_hook_flags_evt(evtid->fullname);
pthread_rwlock_rdlock(&events_rwlock);
for (evtid = evtids ; evtid ; evtid = evtid->next) {
evtid->hookflags = afb_hook_flags_evt(evtid->fullname);
- ? (struct afb_event_x1){ .itf = &afb_evt_hooked_eventid_itf, .closure = &evtid->eventid }
+#if WITH_AFB_HOOK
+ ? (struct afb_event_x1){ .itf = &afb_evt_hooked_event_x2_itf, .closure = &evtid->eventid }
+#else
+ ? (struct afb_event_x1){ .itf = &afb_evt_event_x2_itf, .closure = &evtid->eventid }
+#endif