From 5d248158cc380d0a164fa56b46a7bdede4115407 Mon Sep 17 00:00:00 2001 From: José Bollo Date: Mon, 10 Apr 2017 11:41:21 +0200 Subject: Refactor of API interfaces MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new interface has increased functionnality, it allows to set debug flags by API. Change-Id: Ibd35fb02ed645e22cac8e7021b37b96e07e79877 Signed-off-by: José Bollo --- src/afb-api-ws.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/afb-api-ws.c') diff --git a/src/afb-api-ws.c b/src/afb-api-ws.c index 6995b2fa..4b870d45 100644 --- a/src/afb-api-ws.c +++ b/src/afb-api-ws.c @@ -856,6 +856,11 @@ static int api_ws_client_connect(struct api_ws *api) return -1; } +static struct afb_api_itf ws_api_itf = { + .call = api_ws_client_call_cb, + .service_start = api_ws_service_start_cb +}; + /* adds a afb-ws-service client api */ int afb_api_ws_add_client(const char *path) { @@ -877,9 +882,7 @@ int afb_api_ws_add_client(const char *path) /* record it as an API */ afb_api.closure = api; - afb_api.call = api_ws_client_call_cb; - afb_api.service_start = api_ws_service_start_cb; - afb_api.update_hooks = NULL; + afb_api.itf = &ws_api_itf; if (afb_apis_add(api->api, afb_api) < 0) goto error3; -- cgit 1.2.3-korg