afb-client-demo: real raw output when --raw is set
[src/app-framework-binder.git] / include / afb / afb-request.h
index 678922b..8e909bb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016, 2017 "IoT.bzh"
+ * Copyright (C) 2016, 2017, 2018 "IoT.bzh"
  * Author: José Bollo <jose.bollo@iot.bzh>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
 
 #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'.
@@ -356,3 +376,14 @@ static inline char *afb_request_get_application_id(struct afb_request *request)
        return request->itf->get_application_id(request);
 }
 
+/*
+ * Get the user identifier (UID) of the client for the
+ * request 'request'.
+ *
+ * Returns -1 when the application can not be identified.
+ */
+static inline int afb_request_get_uid(struct afb_request *request)
+{
+       return request->itf->get_uid(request);
+}
+