vocabulary: moving from 'plugin' to 'binding'
[src/app-framework-binder.git] / bindings / samples / tic-tac-toe.c
similarity index 94%
rename from plugins/samples/tic-tac-toe.c
rename to bindings/samples/tic-tac-toe.c
index 31682d9..0100fc0 100644 (file)
 #include <string.h>
 #include <json-c/json.h>
 
-#include <afb/afb-plugin.h>
+#include <afb/afb-binding.h>
 
 /*
  * the interface to afb-daemon
  */
-const struct AFB_interface *afbitf;
+const struct afb_binding_interface *afbitf;
 
 /*
  * definition of waiters
@@ -567,7 +567,7 @@ static void wait(struct afb_req req)
 /*
  * array of the verbs exported to afb-daemon
  */
-static const struct AFB_verb_desc_v1 plugin_verbs[] = {
+static const struct afb_verb_desc_v1 binding_verbs[] = {
    /* VERB'S NAME     SESSION MANAGEMENT          FUNCTION TO CALL  SHORT DESCRIPTION */
    { .name= "new",   .session= AFB_SESSION_NONE, .callback= new,   .info= "Starts a new game" },
    { .name= "play",  .session= AFB_SESSION_NONE, .callback= play,  .info= "Asks the server to play" },
@@ -581,25 +581,25 @@ static const struct AFB_verb_desc_v1 plugin_verbs[] = {
 };
 
 /*
- * description of the plugin for afb-daemon
+ * description of the binding for afb-daemon
  */
-static const struct AFB_plugin plugin_description =
+static const struct afb_binding binding_description =
 {
    /* description conforms to VERSION 1 */
-   .type= AFB_PLUGIN_VERSION_1,
-   .v1= {                              /* fills the v1 field of the union when AFB_PLUGIN_VERSION_1 */
-      .prefix= "tictactoe",            /* the API name (or plugin name or prefix) */
-      .info= "Sample tac-tac-toe game",        /* short description of of the plugin */
-      .verbs = plugin_verbs            /* the array describing the verbs of the API */
+   .type= AFB_BINDING_VERSION_1,
+   .v1= {                              /* fills the v1 field of the union when AFB_BINDING_VERSION_1 */
+      .prefix= "tictactoe",            /* the API name (or binding name or prefix) */
+      .info= "Sample tac-tac-toe game",        /* short description of of the binding */
+      .verbs = binding_verbs           /* the array describing the verbs of the API */
    }
 };
 
 /*
- * activation function for registering the plugin called by afb-daemon
+ * activation function for registering the binding called by afb-daemon
  */
-const struct AFB_plugin *pluginAfbV1Register(const struct AFB_interface *itf)
+const struct afb_binding *afbBindingV1Register(const struct afb_binding_interface *itf)
 {
    afbitf = itf;         // records the interface for accessing afb-daemon
-   return &plugin_description;  // returns the description of the plugin
+   return &binding_description;  // returns the description of the binding
 }