Adds 2017 to copyrights
[src/app-framework-binder.git] / include / afb / afb-req-itf.h
index 740b3ac..c980838 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016 "IoT.bzh"
+ * Copyright (C) 2016, 2017 "IoT.bzh"
  * Author: José Bollo <jose.bollo@iot.bzh>
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -46,7 +46,7 @@ struct afb_arg {
  * It records the functions to be called for the request.
  * Don't use this structure directly.
  * Use the helper functions documented below.
- */ 
+ */
 struct afb_req_itf {
        /* CAUTION: respect the order, add at the end */
 
@@ -82,6 +82,16 @@ struct afb_req {
        void *closure;                  /* the closure argument for functions of 'itf' */
 };
 
+/*
+ * Checks wether the request 'req' is valid or not.
+ *
+ * Returns 0 if not valid or 1 if valid.
+ */
+static inline int afb_req_is_valid(struct afb_req req)
+{
+       return req.itf != NULL;
+}
+
 /*
  * Gets from the request 'req' the argument of 'name'.
  * Returns a PLAIN structure of type 'struct afb_arg'.