+static int xreq_hooked_has_permission_cb(struct afb_req_x2 *closure, const char *permission)
+{
+ struct afb_xreq *xreq = xreq_from_req_x2(closure);
+ int r = xreq_has_permission_cb(closure, permission);
+ return afb_hook_xreq_has_permission(xreq, permission, r);
+}
+
+static char *xreq_hooked_get_application_id_cb(struct afb_req_x2 *closure)
+{
+ struct afb_xreq *xreq = xreq_from_req_x2(closure);
+ char *r = xreq_get_application_id_cb(closure);
+ return afb_hook_xreq_get_application_id(xreq, r);
+}
+
+static void *xreq_hooked_context_make_cb(struct afb_req_x2 *closure, int replace, void *(*create_value)(void*), void (*free_value)(void*), void *create_closure)
+{
+ struct afb_xreq *xreq = xreq_from_req_x2(closure);
+ void *result = xreq_context_make_cb(closure, replace, create_value, free_value, create_closure);
+ return afb_hook_xreq_context_make(xreq, replace, create_value, free_value, create_closure, result);
+}
+
+static int xreq_hooked_get_uid_cb(struct afb_req_x2 *closure)
+{
+ struct afb_xreq *xreq = xreq_from_req_x2(closure);
+ int r = xreq_get_uid_cb(closure);
+ return afb_hook_xreq_get_uid(xreq, r);
+}
+
+static struct json_object *xreq_hooked_get_client_info_cb(struct afb_req_x2 *closure)
+{
+ struct afb_xreq *xreq = xreq_from_req_x2(closure);
+ struct json_object *r = xreq_get_client_info_cb(closure);
+ return afb_hook_xreq_get_client_info(xreq, r);
+}
+
+static void xreq_hooked_subcall_cb(
+ struct afb_req_x2 *req,
+ const char *api,
+ const char *verb,
+ struct json_object *args,
+ int flags,
+ void (*callback)(void *closure, struct json_object *object, const char *error, const char * info, struct afb_req_x2 *req),
+ void *closure)
+{
+ struct afb_xreq *xreq = xreq_from_req_x2(req);
+ afb_calls_hooked_subcall(xreq, api, verb, args, flags, callback, closure);
+}
+
+static int xreq_hooked_subcallsync_cb(
+ struct afb_req_x2 *req,
+ const char *api,
+ const char *verb,
+ struct json_object *args,
+ int flags,
+ struct json_object **object,
+ char **error,
+ char **info)
+{
+ struct afb_xreq *xreq = xreq_from_req_x2(req);
+ return afb_calls_hooked_subcall_sync(xreq, api, verb, args, flags, object, error, info);
+}
+