diff options
author | José Bollo <jose.bollo@iot.bzh> | 2017-04-28 14:10:52 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2017-05-02 11:01:25 +0200 |
commit | 17f9cdadca63005fe075d999e49154342fdd5086 (patch) | |
tree | ce9d18bbd308889262c14f0ed7b68e6169e29ff5 /src/wgtpkg-unit.h | |
parent | 3f6dcaacd7abc85ebed40053a3ce73bc7753ddf9 (diff) |
Use structures for generating units
Change-Id: I7258a494d62ef22219c973048d052965cb5fea28
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/wgtpkg-unit.h')
-rw-r--r-- | src/wgtpkg-unit.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/wgtpkg-unit.h b/src/wgtpkg-unit.h index f152736..8acc62e 100644 --- a/src/wgtpkg-unit.h +++ b/src/wgtpkg-unit.h @@ -20,6 +20,7 @@ struct json_object; struct wgt_info; + enum unitscope { unitscope_unknown = 0, unitscope_system, @@ -43,9 +44,21 @@ struct unitdesc { size_t wanted_by_length; }; +struct unitconf { + const char *installdir; + const char *icondir; + int port; +}; + +struct generatedesc { + const struct unitconf *conf; + const struct unitdesc *units; + int nunits; +}; + extern int unit_generator_on(const char *filename); extern void unit_generator_off(); -extern int unit_generator_process(struct json_object *jdesc, int (*process)(void *closure, const struct unitdesc descs[], unsigned count), void *closure); -extern int unit_install(struct wgt_info *ifo, const char *installdir, const char *icondir, int port); -extern int unit_uninstall(struct wgt_info *ifo); +extern int unit_generator_process(struct json_object *jdesc, const struct unitconf *conf, int (*process)(void *closure, const struct generatedesc *desc), void *closure); +extern int unit_install(struct wgt_info *ifo, const struct unitconf *conf); +extern int unit_uninstall(struct wgt_info *ifo, const struct unitconf *conf); |