X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-proto-ws.h;h=103e37abc1cecf20eb4e9f927ee2c3f1a772ec25;hb=96ee1e30743b88780cc9dc975745d8dc03de25ae;hp=9cdf49029cc90751577087afa133b600fe80c857;hpb=159c895986f2358d6df8bb5804cc4419cc6b457f;p=src%2Fapp-framework-binder.git diff --git a/src/afb-proto-ws.h b/src/afb-proto-ws.h index 9cdf4902..103e37ab 100644 --- a/src/afb-proto-ws.h +++ b/src/afb-proto-ws.h @@ -18,16 +18,19 @@ #pragma once +struct sd_event; struct afb_proto_ws; struct afb_proto_ws_call; struct afb_proto_ws_subcall; struct afb_proto_ws_describe; struct afb_proto_ws_client_itf -{ +{ + /* can't be NULL */ void (*on_reply_success)(void *closure, void *request, struct json_object *result, const char *info); void (*on_reply_fail)(void *closure, void *request, const char *status, const char *info); + /* can be NULL */ void (*on_event_create)(void *closure, const char *event_name, int event_id); void (*on_event_remove)(void *closure, const char *event_name, int event_id); void (*on_event_subscribe)(void *closure, void *request, const char *event_name, int event_id); @@ -44,8 +47,8 @@ struct afb_proto_ws_server_itf void (*on_describe)(void *closure, struct afb_proto_ws_describe *describe); }; -extern struct afb_proto_ws *afb_proto_ws_create_client(int fd, const struct afb_proto_ws_client_itf *itf, void *closure); -extern struct afb_proto_ws *afb_proto_ws_create_server(int fd, const struct afb_proto_ws_server_itf *itf, void *closure); +extern struct afb_proto_ws *afb_proto_ws_create_client(struct sd_event *eloop, int fd, const struct afb_proto_ws_client_itf *itf, void *closure); +extern struct afb_proto_ws *afb_proto_ws_create_server(struct sd_event *eloop, int fd, const struct afb_proto_ws_server_itf *itf, void *closure); extern void afb_proto_ws_unref(struct afb_proto_ws *protows); extern void afb_proto_ws_addref(struct afb_proto_ws *protows);