X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafm-db.c;h=869a0f0d96c070efb9e16b19cae4793fd28d643f;hb=refs%2Fchanges%2F53%2F7553%2F1;hp=4dc2d5fde6125cd550623d6cf1223a20ed361079;hpb=b6d4ed93426e7d4425a0178903bf1f19c8ae2f61;p=src%2Fapp-framework-main.git diff --git a/src/afm-db.c b/src/afm-db.c index 4dc2d5f..869a0f0 100644 --- a/src/afm-db.c +++ b/src/afm-db.c @@ -1,5 +1,5 @@ /* - Copyright 2015 IoT.bzh + Copyright 2015, 2016 IoT.bzh author: José Bollo @@ -25,7 +25,7 @@ #include #include -#include +#include #include "utils-json.h" #include "wgt-info.h" @@ -39,9 +39,9 @@ * path: STRING, the path of the root directory for the application * content: STRING, the relative path to the entryu point of the application * type: STRING, the mime type describing the type 'content' - * plugins: ARRAY, array of plugins + * bindings: ARRAY, array of bindings * [ - * STRING, path to the plugin + * STRING, path to the binding * ] * public: OBJECT, public content describing the application widget * { @@ -139,7 +139,7 @@ static int addwgt(struct afm_apps *apps, const char *path, if (!pub) goto error; - plugs = j_add_new_array(priv, "plugins"); + plugs = j_add_new_array(priv, "bindings"); if (!plugs) goto error; @@ -157,10 +157,10 @@ static int addwgt(struct afm_apps *apps, const char *path, || !j_add_string(pub, "author", desc->author)) goto error; - /* extract plugins from features */ + /* extract bindings from features */ feat = desc->features; while (feat) { - static const char prefix[] = FWK_PREFIX_PLUGIN; + static const char prefix[] = FWK_PREFIX_BINDING; if (!memcmp(feat->name, prefix, sizeof prefix - 1)) { str = json_object_new_string ( feat->name + sizeof prefix - 1); @@ -254,7 +254,8 @@ static int enumentries(struct enumdata *data, int (*callto)(struct enumdata *)) errno = ENAMETOOLONG; return -1; } - data->length = stpcpy(beg, entry.d_name) - data->path; + data->length = (int)(stpcpy(beg, entry.d_name) + - data->path); /* call the function */ rc = callto(data); if (rc) @@ -430,9 +431,9 @@ int afm_db_update_applications(struct afm_db *afdb) /* for each directory of afdb */ for (dir = afdb->dirhead ; dir != NULL ; dir = dir->next) { if (dir->type == type_root) { - edata.length = stpcpy(edata.path, dir->path) - - edata.path; - assert(edata.length < sizeof edata.path); + edata.length = (int)(stpcpy(edata.path, dir->path) + - edata.path); + assert(edata.length < (int)sizeof edata.path); /* enumerate the applications */ rc = enumentries(&edata, enumvers); if (rc)