X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-evt.h;h=8ebb2ec06c4c94e1e6bd673680eb347223faa3e6;hb=c94e1ef88adc641ebbab57377b97f8a7b6a70d1b;hp=8e10254650c136b55f6883cbcb68fcbb5a0b313a;hpb=7e0abe76db7b90369429bf387d7aad0fb5a42328;p=src%2Fapp-framework-binder.git diff --git a/src/afb-evt.h b/src/afb-evt.h index 8e102546..8ebb2ec0 100644 --- a/src/afb-evt.h +++ b/src/afb-evt.h @@ -22,7 +22,15 @@ struct AFB_clientCtx; struct afb_evt_listener; -extern struct afb_evt_listener *afb_evt_listener_create(void (*send)(void *closure, const char *event, struct json_object *object), void *closure); +struct afb_evt_itf +{ + void (*push)(void *closure, const char *event, int eventid, struct json_object *object); + void (*broadcast)(void *closure, const char *event, int eventid, struct json_object *object); + void (*add)(void *closure, const char *event, int eventid); + void (*remove)(void *closure, const char *event, int eventid); +}; + +extern struct afb_evt_listener *afb_evt_listener_create(const struct afb_evt_itf *itf, void *closure); extern int afb_evt_broadcast(const char *event, struct json_object *object); @@ -30,6 +38,8 @@ extern struct afb_evt_listener *afb_evt_listener_addref(struct afb_evt_listener extern void afb_evt_listener_unref(struct afb_evt_listener *listener); extern struct afb_event afb_evt_create_event(const char *name); +extern const char *afb_evt_event_name(struct afb_event event); +extern int afb_evt_event_id(struct afb_event event); extern int afb_evt_add_watch(struct afb_evt_listener *listener, struct afb_event event); extern int afb_evt_remove_watch(struct afb_evt_listener *listener, struct afb_event event);