summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2018-08-02 18:48:57 +0200
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2018-08-16 13:49:16 +0000
commit6caade489f8bd15dccdde6c69452d920ead2201e (patch)
treefd04aca394c42225aa235a6453c560f2eb6761a6 /src
parent8c7132a146aa744f167ea2fc45dcd8d53018ecc0 (diff)
Add the external binding featureflounder_5.99.3flounder/5.99.35.99.3
This commit introduce two new features: <urn:AGL:widget:provided-binding> <param "name"="public-name" "value"="relative-path-to-the-binding"/> <urn:AGL:widget:required-binding> <param "name"="public-name" "value"="extern"> <param "name"="relative-path-to-the-binding" "value"="local"> TODO: manage security by setting correct Smack label to the exported files Bugs-AGL: SPEC-1439 Bugs-AGL: SPEC-1663 Change-Id: I70aad7d523ece7a2ae0058b79708a02ef81144e2 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src')
-rw-r--r--src/wgt-json.c26
-rw-r--r--src/wgt-strings.c2
-rw-r--r--src/wgt-strings.h2
3 files changed, 30 insertions, 0 deletions
diff --git a/src/wgt-json.c b/src/wgt-json.c
index bb1ba55..f4212d0 100644
--- a/src/wgt-json.c
+++ b/src/wgt-json.c
@@ -387,6 +387,26 @@ static int add_required_api(struct json_object *targets, const struct wgt_desc_f
return add_targeted_params(targets, feat, actions);
}
+/* Treats the feature "provided_binding" */
+static int add_provided_binding(struct json_object *targets, const struct wgt_desc_feature *feat)
+{
+ static struct paramaction actions[] = {
+ { .name = string_sharp_target, .action = NULL, .closure = NULL }, /* TODO: should be an error! */
+ { .name = NULL, .action = add_param_array, .closure = (void*)string_provided_binding }
+ };
+ return add_targeted_params(targets, feat, actions);
+}
+
+/* Treats the feature "required_binding" */
+static int add_required_binding(struct json_object *targets, const struct wgt_desc_feature *feat)
+{
+ static struct paramaction actions[] = {
+ { .name = string_sharp_target, .action = NULL, .closure = NULL }, /* skip #target */
+ { .name = NULL, .action = add_param_array, .closure = (void*)string_required_binding }
+ };
+ return add_targeted_params(targets, feat, actions);
+}
+
/* Treats the feature "required_permission" */
static int add_required_permission(struct json_object *targets, const struct wgt_desc_feature *feat)
{
@@ -460,9 +480,15 @@ static struct json_object *to_json(const struct wgt_desc *desc)
else if (!strcmp(featname, string_provided_api)) {
rc2 = add_provided_api(targets, feat);
}
+ else if (!strcmp(featname, string_provided_binding)) {
+ rc2 = add_provided_binding(targets, feat);
+ }
else if (!strcmp(featname, string_required_api)) {
rc2 = add_required_api(targets, feat);
}
+ else if (!strcmp(featname, string_required_binding)) {
+ rc2 = add_required_binding(targets, feat);
+ }
else if (!strcmp(featname, string_required_permission)) {
rc2 = add_required_permission(targets, feat);
} else {
diff --git a/src/wgt-strings.c b/src/wgt-strings.c
index 9185ee9..5dc5e68 100644
--- a/src/wgt-strings.c
+++ b/src/wgt-strings.c
@@ -57,8 +57,10 @@ const char string_list[] = "list";
const char string_main[] = "main";
const char string_optional[] = "optional";
const char string_provided_api[] = "provided-api";
+const char string_provided_binding[] = "provided-binding";
const char string_provided_unit[] = "provided-unit";
const char string_required_api[] = "required-api";
+const char string_required_binding[] = "required-binding";
const char string_required_permission[] = "required-permission";
const char string_targets[] = "targets";
const char string_sharp_target[] = "#target";
diff --git a/src/wgt-strings.h b/src/wgt-strings.h
index 0a9c0e9..6f58db1 100644
--- a/src/wgt-strings.h
+++ b/src/wgt-strings.h
@@ -55,8 +55,10 @@ extern const char string_list[];
extern const char string_main[];
extern const char string_optional[];
extern const char string_provided_api[];
+extern const char string_provided_binding[];
extern const char string_provided_unit[];
extern const char string_required_api[];
+extern const char string_required_binding[];
extern const char string_required_permission[];
extern const char string_sharp_target[];
extern const char string_targets[];