#include <pthread.h>
#include <json-c/json.h>
-#include <afb/afb-binding-v2.h>
+#define AFB_BINDING_VERSION 0
+#include <afb/afb-binding.h>
#include "afb-hook.h"
#include "afb-cred.h"
*/
static struct event *trace_get_event(struct afb_trace *trace, const char *name, int alloc)
{
+ struct afb_event e;
struct event *event;
/* search the event */
if (!event && alloc) {
event = malloc(sizeof * event);
if (event) {
- event->evtid = afb_evt_to_evtid(trace->daemon->itf->event_make(trace->daemon->closure, name).closure);
+ e = afb_daemon_make_event_v1(*trace->daemon, name);
+ event->evtid = afb_evt_to_evtid(afb_event_to_eventid(e));
if (event->evtid) {
event->next = trace->events;
trace->events = event;
static int xreq_subscribe_eventid_cb(struct afb_request *closure, struct afb_eventid *eventid);
static int xreq_subscribe_cb(struct afb_request *closure, struct afb_event event)
{
- return xreq_subscribe_eventid_cb(closure, event.closure);
+ return xreq_subscribe_eventid_cb(closure, afb_event_to_eventid(event));
}
static int xreq_subscribe_eventid_cb(struct afb_request *closure, struct afb_eventid *eventid)
static int xreq_unsubscribe_eventid_cb(struct afb_request *closure, struct afb_eventid *eventid);
static int xreq_unsubscribe_cb(struct afb_request *closure, struct afb_event event)
{
- return xreq_unsubscribe_eventid_cb(closure, event.closure);
+ return xreq_unsubscribe_eventid_cb(closure, afb_event_to_eventid(event));
}
static int xreq_unsubscribe_eventid_cb(struct afb_request *closure, struct afb_eventid *eventid)
static int xreq_hooked_subscribe_eventid_cb(struct afb_request *closure, struct afb_eventid *eventid);
static int xreq_hooked_subscribe_cb(struct afb_request *closure, struct afb_event event)
{
- return xreq_hooked_subscribe_eventid_cb(closure, event.closure);
+ return xreq_hooked_subscribe_eventid_cb(closure, afb_event_to_eventid(event));
}
static int xreq_hooked_subscribe_eventid_cb(struct afb_request *closure, struct afb_eventid *eventid)
static int xreq_hooked_unsubscribe_eventid_cb(struct afb_request *closure, struct afb_eventid *eventid);
static int xreq_hooked_unsubscribe_cb(struct afb_request *closure, struct afb_event event)
{
- return xreq_hooked_unsubscribe_eventid_cb(closure, event.closure);
+ return xreq_hooked_unsubscribe_eventid_cb(closure, afb_event_to_eventid(event));
}
static int xreq_hooked_unsubscribe_eventid_cb(struct afb_request *closure, struct afb_eventid *eventid)