diff options
author | José Bollo <jose.bollo@iot.bzh> | 2017-04-07 17:05:24 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2017-04-07 17:07:22 +0200 |
commit | b529ded85a3e50a1aa6529e870b2e2f43e377ca2 (patch) | |
tree | c46d606619ae77206b75b7eb7b599554b9d34408 /src/afb-api-so-v2.c | |
parent | 59db7c73c9d98414be9edf7056d7afe025512b3e (diff) |
Add hooking of daemon interface
Change-Id: I5840609f4300ade98412e8527ac5ce1f1e8c0c59
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-api-so-v2.c')
-rw-r--r-- | src/afb-api-so-v2.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/afb-api-so-v2.c b/src/afb-api-so-v2.c index 7df83dd8..12b83aca 100644 --- a/src/afb-api-so-v2.c +++ b/src/afb-api-so-v2.c @@ -113,11 +113,18 @@ static int service_start_cb(void *closure, int share_session, int onneed) return 0; } +static void update_hooks_cb(void *closure) +{ + struct api_so_v2 *desc = closure; + afb_ditf_update_hook(&desc->ditf); +} + int afb_api_so_v2_add(const char *path, void *handle) { int rc; struct api_so_v2 *desc; struct afb_binding_v2 *binding; + struct afb_api afb_api; /* retrieves the register function */ binding = dlsym(handle, afb_api_so_v2_descriptor); @@ -169,10 +176,11 @@ int afb_api_so_v2_add(const char *path, void *handle) } /* records the binding */ - if (afb_apis_add(binding->api, (struct afb_api){ - .closure = desc, - .call = call_cb, - .service_start = service_start_cb }) < 0) { + afb_api.closure = desc; + afb_api.call = call_cb; + afb_api.service_start = service_start_cb; + afb_api.update_hooks = update_hooks_cb; + if (afb_apis_add(binding->api, afb_api) < 0) { ERROR("binding [%s] can't be registered...", path); goto error2; } |