aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/afb/afb-dynapi.h17
-rw-r--r--include/afb/afb-request.h20
2 files changed, 36 insertions, 1 deletions
diff --git a/include/afb/afb-dynapi.h b/include/afb/afb-dynapi.h
index edae4915..dfdcdb24 100644
--- a/include/afb/afb-dynapi.h
+++ b/include/afb/afb-dynapi.h
@@ -19,6 +19,21 @@
#include "afb-dynapi-itf.h"
+static inline const char *afb_dynapi_name(struct afb_dynapi *dynapi)
+{
+ return dynapi->apiname;
+}
+
+static inline void *afb_dynapi_get_userdata(struct afb_dynapi *dynapi)
+{
+ return dynapi->userdata;
+}
+
+static inline void afb_dynapi_set_userdata(struct afb_dynapi *dynapi, void *userdata)
+{
+ dynapi->userdata = userdata;
+}
+
/*
* Send a message described by 'fmt' and following parameters
* to the journal for the verbosity 'level'.
@@ -188,7 +203,7 @@ static inline void afb_dynapi_call(
const char *api,
const char *verb,
struct json_object *args,
- void (*callback)(void*closure, int status, struct json_object *result, struct afb_dynapi *dynapi),
+ void (*callback)(void *closure, int status, struct json_object *result, struct afb_dynapi *dynapi),
void *callback_closure)
{
dynapi->itf->call(dynapi, api, verb, args, callback, callback_closure);
diff --git a/include/afb/afb-request.h b/include/afb/afb-request.h
index 678922b3..fcab03c3 100644
--- a/include/afb/afb-request.h
+++ b/include/afb/afb-request.h
@@ -19,6 +19,26 @@
#include "afb-request-itf.h"
+static inline struct afb_dynapi *afb_request_get_dynapi(struct afb_request *request)
+{
+ return request->dynapi;
+}
+
+static inline void *afb_request_get_vcbdata(struct afb_request *request)
+{
+ return request->vcbdata;
+}
+
+static inline const char *afb_request_get_api(struct afb_request *request)
+{
+ return request->api;
+}
+
+static inline const char *afb_request_get_verb(struct afb_request *request)
+{
+ return request->verb;
+}
+
/*
* Gets from the request 'request' the argument of 'name'.
* Returns a PLAIN structure of type 'struct afb_arg'.