Switch to a plugin model
[src/app-framework-binder.git] / plugins / samples / HelloWorld.c
index 70de03f..5638b42 100644 (file)
@@ -73,23 +73,22 @@ STATIC json_object* pingJson (AFB_session *session, AFB_request *request) {
     return jresp;
 }
 
-
+// NOTE: this sample does not use session to keep test a basic as possible
+//       in real application most APIs should be protected with AFB_SESSION_CHECK
 STATIC  AFB_restapi pluginApis[]= {
   {"ping"     , AFB_SESSION_NONE, (AFB_apiCB)pingSample  , "Ping Application Framework"},
   {"pingnull" , AFB_SESSION_NONE, (AFB_apiCB)pingFail    , "Return NULL"},
   {"pingbug"  , AFB_SESSION_NONE, (AFB_apiCB)pingBug     , "Do a Memory Violation"},
   {"pingJson" , AFB_SESSION_NONE, (AFB_apiCB)pingJson    , "Return a JSON object"},
-  {"ctx-store", AFB_SESSION_NONE, (AFB_apiCB)pingSample  , "Verbose Mode"},
-  {"ctx-load" , AFB_SESSION_NONE, (AFB_apiCB)pingSample  , "Verbose Mode"},
   {NULL}
 };
 
 
-PUBLIC AFB_plugin *dbusRegister () {
+PUBLIC AFB_plugin *pluginRegister () {
     AFB_plugin *plugin = malloc (sizeof (AFB_plugin));
     plugin->type  = AFB_PLUGIN_JSON;
     plugin->info  = "Application Framework Binder Service";
     plugin->prefix= "dbus";        
     plugin->apis  = pluginApis;
     return (plugin);
-};
\ No newline at end of file
+};