summaryrefslogtreecommitdiffstats
path: root/plugins/samples
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-04-04 17:48:50 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2016-04-04 17:48:50 +0200
commit11d36a9f7e16aa9992835f8ce06f0e1e5297b131 (patch)
treeff15e8fe346df9bcc92e063747c43476054113f7 /plugins/samples
parentb8d4c81cc8175ce49c77d41e572a9f1a2e367cdc (diff)
work in progress, session handling
Change-Id: I0393346280825e24a34e8db386160d857723b841 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'plugins/samples')
-rw-r--r--plugins/samples/ClientCtx.c9
-rw-r--r--plugins/samples/HelloWorld.c3
2 files changed, 6 insertions, 6 deletions
diff --git a/plugins/samples/ClientCtx.c b/plugins/samples/ClientCtx.c
index cda6abbb..3fa43adf 100644
--- a/plugins/samples/ClientCtx.c
+++ b/plugins/samples/ClientCtx.c
@@ -75,7 +75,7 @@ static void myCreate (struct afb_req request)
ctx->count = 0;
ctx->abcd = "SomeThingUseful";
- *request.context = ctx;
+ request.context = ctx;
afb_req_success_f(request, NULL, "SUCCESS: create client context for plugin [%s]", handle->anythingYouWant);
}
@@ -86,7 +86,7 @@ static void myCreate (struct afb_req request)
static void myAction (struct afb_req request)
{
MyPluginHandleT *handle = (MyPluginHandleT*) &global_handle;
- MyClientContextT *ctx = (MyClientContextT*) *request.context;
+ MyClientContextT *ctx = (MyClientContextT*) request.context;
// store something in our plugin private client context
ctx->count++;
@@ -100,7 +100,7 @@ static void myAction (struct afb_req request)
static void myClose (struct afb_req request)
{
MyPluginHandleT *handle = (MyPluginHandleT*) &global_handle;
- MyClientContextT *ctx = (MyClientContextT*) *request.context;
+ MyClientContextT *ctx = (MyClientContextT*) request.context;
// store something in our plugin private client context
ctx->count++;
@@ -132,8 +132,9 @@ static const struct AFB_plugin plugin_desc = {
.freeCtxCB = (void*)freeCtxCB
};
-const struct AFB_plugin *pluginRegister ()
+const struct AFB_plugin *pluginRegister (const struct AFB_interface *itf)
{
+ global_handle.anythingYouWant = "anythingYouWant";
return &plugin_desc;
}
diff --git a/plugins/samples/HelloWorld.c b/plugins/samples/HelloWorld.c
index 4f0af71f..c60cc70c 100644
--- a/plugins/samples/HelloWorld.c
+++ b/plugins/samples/HelloWorld.c
@@ -85,7 +85,6 @@ static void pingBug (struct afb_req request)
{
int a,b,c;
- fprintf (stderr, "Use --timeout=10 to trap error\n");
b=4;
c=0;
a=b/c;
@@ -128,7 +127,7 @@ static const struct AFB_plugin plugin_desc = {
.apis = pluginApis
};
-const struct AFB_plugin *pluginRegister ()
+const struct AFB_plugin *pluginRegister (const struct AFB_interface *itf)
{
return &plugin_desc;
}