-PUBLIC AFB_plugin *pluginRegister () {
-
- // Plugin handle should not be in stack (malloc or static)
- STATIC MyPluginHandleT handle;
-
- AFB_plugin *plugin = malloc (sizeof (AFB_plugin));
- plugin->type = AFB_PLUGIN_JSON;
- plugin->info = "Sample of Client Context Usage";
- plugin->prefix = "context";
- plugin->apis = pluginApis;
- plugin->handle = &handle;
- plugin->freeCtxCB= (AFB_freeCtxCB) freeCtxCB;
-
- // feed plugin handle before returning from registration
- handle.anythingYouWant = "My Plugin Handle";
-
- return (plugin);
+static const struct AFB_plugin plugin_desc = {
+ .type = AFB_PLUGIN_JSON,
+ .info = "Sample of Client Context Usage",
+ .prefix = "context",
+ .apis = pluginApis,
+ .freeCtxCB = (void*)freeCtxCB