Add a closure argument to dynamic verbs
[src/app-framework-binder.git] / include / afb / afb-request-itf.h
index a5c3f82..eb7c534 100644 (file)
@@ -28,6 +28,7 @@ struct json_object;
 struct afb_req;
 struct afb_event;
 struct afb_eventid;
+struct afb_dynapi;
 struct afb_stored_req;
 
 /*
@@ -42,9 +43,20 @@ struct afb_arg
                                /* when the request is finalized this file is removed */
 };
 
+/*
+ * structure for the request
+ */
 struct afb_request
 {
+       /* interface for the request */
        const struct afb_request_itf *itf;
+
+       /* current dynapi if dynapi (is NULL for bindings v1 and v2) */
+       struct afb_dynapi *dynapi;
+
+       /* closure associated with the callback processing the verb of the request
+        * as given at its declaration */
+       void *vcbdata;
 };
 
 /*
@@ -171,5 +183,14 @@ struct afb_request_itf
        int (*unsubscribe_eventid)(
                        struct afb_request *request,
                        struct afb_eventid *eventid);
+
+       void (*subcall_request)(
+                       struct afb_request *request,
+                       const char *api,
+                       const char *verb,
+                       struct json_object *args,
+                       void (*callback)(void*, int, struct json_object*, struct afb_request *request),
+                       void *cb_closure);
+
 };