diff options
author | 2018-08-02 15:26:59 +0200 | |
---|---|---|
committer | 2018-08-02 15:49:43 +0200 | |
commit | de0527f7cf5b4a4278698ab034a332cf75723300 (patch) | |
tree | c62706f06e295e6e6f7650b1fe6df9c78aaeac27 /src/afb-api-so-v2.c | |
parent | 5ef271effacb83552f9ea56572c751c2f5a556b6 (diff) |
afb-export: Manage path of libraries
This change allows a binding to know its
installation path. This path is retrieved using
the api function 'afb_api_settings'.
The path is returned --if known-- as a string
of key "binding-path".
Change-Id: Ie1a349dc4936d4ccf173f1f77e118099f7f0599a
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 | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/afb-api-so-v2.c b/src/afb-api-so-v2.c index 39107887..deb8783c 100644 --- a/src/afb-api-so-v2.c +++ b/src/afb-api-so-v2.c @@ -130,7 +130,13 @@ static void do_preinit(int sig, void *closure) } }; -int afb_api_so_v2_add_binding(const struct afb_binding_v2 *binding, void *handle, struct afb_apiset *declare_set, struct afb_apiset * call_set, struct afb_binding_data_v2 *data) +int afb_api_so_v2_add_binding( + const struct afb_binding_v2 *binding, + void *handle, + struct afb_apiset *declare_set, + struct afb_apiset * call_set, + struct afb_binding_data_v2 *data, + const char *path) { int rc; struct afb_export *export; @@ -143,7 +149,7 @@ int afb_api_so_v2_add_binding(const struct afb_binding_v2 *binding, void *handle assert(data); /* allocates the description */ - export = afb_export_create_v2(declare_set, call_set, binding->api, binding, data, binding->init, binding->onevent); + export = afb_export_create_v2(declare_set, call_set, binding->api, binding, data, binding->init, binding->onevent, path); if (!export) { ERROR("out of memory"); goto error; @@ -209,7 +215,7 @@ int afb_api_so_v2_add(const char *path, void *handle, struct afb_apiset *declare goto error; } - return afb_api_so_v2_add_binding(binding, handle, declare_set, call_set, data); + return afb_api_so_v2_add_binding(binding, handle, declare_set, call_set, data, path); error: return -1; |