diff options
author | José Bollo <jose.bollo@iot.bzh> | 2016-08-31 14:13:54 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2016-08-31 14:13:54 +0200 |
commit | 7c7d610ccbd7e30204501622ebee6690aef5af0c (patch) | |
tree | 1fec77cfe24934610dd1393a957cd601ac73c260 /src/afb-api-so.c | |
parent | 335959621b8ffa33f66f55e0dea1c08aaea75775 (diff) |
bindings: adds ability to use data of applications
The two new verbs 'afb_daemon_rootdir_get_fd' and
'afb_daemon_rootdir_open_locale' allow the bindings to retrieve
its installed global data.
Change-Id: I369997d9e59402a413a929aa650c48613f034183
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-api-so.c')
-rw-r--r-- | src/afb-api-so.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/afb-api-so.c b/src/afb-api-so.c index d7609bba..ef1bbcc2 100644 --- a/src/afb-api-so.c +++ b/src/afb-api-so.c @@ -67,6 +67,8 @@ static int api_timeout = 15; static struct afb_event afb_api_so_event_make_cb(void *closure, const char *name); static int afb_api_so_event_broadcast_cb(void *closure, const char *name, struct json_object *object); static void afb_api_so_vverbose_cb(void *closure, int level, const char *file, int line, const char *fmt, va_list args); +static int afb_api_so_rootdir_get_fd(void *closure); +static int afb_api_so_rootdir_open_locale(void *closure, const char *filename, int flags, const char *locale); static const struct afb_daemon_itf daemon_itf = { .event_broadcast = afb_api_so_event_broadcast_cb, @@ -74,7 +76,9 @@ static const struct afb_daemon_itf daemon_itf = { .get_user_bus = afb_common_get_user_bus, .get_system_bus = afb_common_get_system_bus, .vverbose = afb_api_so_vverbose_cb, - .event_make = afb_api_so_event_make_cb + .event_make = afb_api_so_event_make_cb, + .rootdir_get_fd = afb_api_so_rootdir_get_fd, + .rootdir_open_locale = afb_api_so_rootdir_open_locale }; static struct afb_event afb_api_so_event_make_cb(void *closure, const char *name) @@ -125,6 +129,16 @@ static void afb_api_so_vverbose_cb(void *closure, int level, const char *file, i } } +static int afb_api_so_rootdir_get_fd(void *closure) +{ + return afb_common_rootdir_get_fd(); +} + +static int afb_api_so_rootdir_open_locale(void *closure, const char *filename, int flags, const char *locale) +{ + return afb_common_rootdir_open_locale(filename, flags, locale); +} + static void monitored_call(int signum, void *arg) { struct monitoring *data = arg; |