improves naming using 'binding'
authorJosé Bollo <jose.bollo@iot.bzh>
Fri, 24 Jun 2016 12:04:37 +0000 (14:04 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Fri, 24 Jun 2016 12:04:37 +0000 (14:04 +0200)
Change-Id: I535e01ce4a8dd1e16637e61c6624b4f37639b2f7
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
CMakeLists.txt
conf/afm-launch.conf
src/afm-db.c
src/afm-launch.c
src/afm-launch.h
src/afm-run.c

index c2511af..0591847 100644 (file)
@@ -32,19 +32,18 @@ SET(PROJECT_NAME "AFM Main")
 SET(PROJECT_PRETTY_NAME "Application Framework Main")
 SET(PROJECT_DESCRIPTION "Secured Application framework")
 SET(PROJECT_VERSION "1.0")
-SET(PROJECT_URL "https://github.com/iotbzh/afm-main")
 
 setc(USE_LIBZIP 1)
 setc(USE_SIMULATION 1)
 
-setc(afm_name                "aglfwk")
-setc(afm_confdir             "${CMAKE_INSTALL_SYSCONFDIR}/${afm_name}")
-setc(afm_datadir             "${CMAKE_INSTALL_DATADIR}/${afm_name}")
+setc(afm_name                "afm")
+setc(afm_confdir             "${CMAKE_INSTALL_FULL_SYSCONFDIR}/${afm_name}")
+setc(afm_datadir             "${CMAKE_INSTALL_FULL_DATADIR}/${afm_name}")
 setc(afm_appdir              "${afm_datadir}/applications")
 setc(afm_icondir             "${afm_datadir}/icons")
 setc(afm_prefix              "urn:agl:")
 setc(afm_prefix_permission   "${afm_prefix}perm:")
-setc(afm_prefix_plugin       "${afm_prefix}plugin:")
+setc(afm_prefix_binding      "${afm_prefix}binding:")
 setc(afm_user_appdir         "app-data")
 setc(wgtpkg_trusted_cert_dir "${afm_confdir}/certs")
 
@@ -54,7 +53,7 @@ endmacro(defstr)
 
 defstr(FWK_CONFIG_DIR          "${afm_confdir}")
 defstr(FWK_PREFIX_PERMISSION   "${afm_prefix_permission}")
-defstr(FWK_PREFIX_PLUGIN       "${afm_prefix_plugin}")
+defstr(FWK_PREFIX_BINDING      "${afm_prefix_binding}")
 defstr(FWK_ICON_DIR            "${afm_icondir}")
 defstr(FWK_APP_DIR             "${afm_appdir}")
 defstr(FWK_USER_APP_DIR        "${afm_user_appdir}")
index 4dd721b..a012904 100644 (file)
@@ -1,5 +1,6 @@
 # %% %
 # %a appid
+# %b bindings
 # %c content
 # %D datadir
 # %H height
@@ -7,7 +8,6 @@
 # %I icondir
 # %m mime-type
 # %n name
-# %p plugins
 # %P port
 # %R readyfd
 # %r rootdir
index b650d67..034617b 100644 (file)
@@ -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);
index 87c5b12..88402c9 100644 (file)
@@ -487,6 +487,7 @@ static int mkport()
 /*
 %% %
 %a appid                       desc->appid
+%b bindings                    desc->bindings
 %c content                     desc->content
 %D datadir                     params->datadir
 %H height                      desc->height
@@ -494,7 +495,6 @@ static int mkport()
 %I icondir                     FWK_ICON_DIR
 %m mime-type                   desc->type
 %n name                                desc->name
-%p plugins                     desc->plugins
 %P port                                params->port
 %r rootdir                     desc->path
 %R readyfd                      params->readyfd
@@ -571,6 +571,9 @@ static union arguments instantiate_arguments(
                                        c = *p++;
                                        switch (c) {
                                        case 'a': v = desc->appid; break;
+                                       case 'b':
+                                               v = "" /*TODO:desc->bindings*/;
+                                               break;
                                        case 'c': v = desc->content; break;
                                        case 'D': v = params->datadir; break;
                                        case 'H':
@@ -589,9 +592,6 @@ static union arguments instantiate_arguments(
                                                                params->port);
                                                v = port;
                                                break;
-                                       case 'p':
-                                               v = "" /*TODO:desc->plugins*/;
-                                               break;
                                        case 'R':
                                                if(!data)
                                                        sprintf(readyfd, "%d",
index ec5a88a..b6c59f6 100644 (file)
@@ -26,7 +26,7 @@ struct afm_launch_desc {
        const char *type;          /* type to launch */
        const char *name;          /* name of the application */
        const char *home;          /* home directory of the applications */
-       const char **plugins;      /* plugins for the application */
+       const char **bindings;     /* bindings for the application */
        int width;                 /* requested width */
        int height;                /* requested height */
        enum afm_launch_mode mode; /* launch mode */
index 16b20bd..c5d1552 100644 (file)
@@ -388,11 +388,11 @@ static int fill_launch_desc(struct json_object *appli,
                return -1;
        }
 
-       /* plugins */
+       /* bindings */
        {
                /* TODO */
                static const char *null = NULL;
-               desc->plugins = &null;
+               desc->bindings = &null;
        }
 
        /* finaly */