diff options
author | José Bollo <jose.bollo@iot.bzh> | 2018-07-20 17:57:59 +0200 |
---|---|---|
committer | Jose Bollo <jose.bollo@iot.bzh> | 2018-07-25 15:12:48 +0200 |
commit | f96bbb49cc9bcd81693300191cf7a01b879fd83d (patch) | |
tree | 0d50513ecaab432ce2a4fbd73175363b49545b7e /src/afb-supervision.c | |
parent | fe9601cbf6bbebe9464bfbde2efd0ec278b3e243 (diff) |
afb-config: Rewrite the config as JSON object
Despite its poor performance, this changes is good
at the end because:
- it allows to put config in files
- it removes dirty code to translate to JSON
- it removes dirty code to dump the config
- it unifies code for scanning hook's flag's names
- it improves unity of naming between option's names and JSON's names
Change-Id: I2487c8746d78a0cff80505a12b9fa60e40da9951
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-supervision.c')
-rw-r--r-- | src/afb-supervision.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/afb-supervision.c b/src/afb-supervision.c index 2482a082..8636ef03 100644 --- a/src/afb-supervision.c +++ b/src/afb-supervision.c @@ -64,7 +64,7 @@ static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; /* the standard apiset */ static struct { struct afb_apiset *apiset; - struct afb_config *config; + struct json_object *config; } global; /* the supervision apiset (not exported) */ @@ -238,7 +238,7 @@ static void on_sighup(int signum) /** * initialize the supervision */ -int afb_supervision_init(struct afb_apiset *apiset, struct afb_config *config) +int afb_supervision_init(struct afb_apiset *apiset, struct json_object *config) { int rc; struct sigaction sa; @@ -351,7 +351,7 @@ static void on_supervision_call(void *closure, struct afb_xreq *xreq) afb_xreq_reply(xreq, list, NULL, NULL); break; case Config: - afb_xreq_reply(xreq, afb_config_json(global.config), NULL, NULL); + afb_xreq_reply(xreq, json_object_get(global.config), NULL, NULL); break; case Trace: if (!trace) |