Code Review
/
src
/
app-framework-binder.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
fix issue for C++
[src/app-framework-binder.git]
/
include
/
afb
/
afb-req-itf.h
diff --git
a/include/afb/afb-req-itf.h
b/include/afb/afb-req-itf.h
index
740b3ac
..
82372d1
100644
(file)
--- a/
include/afb/afb-req-itf.h
+++ b/
include/afb/afb-req-itf.h
@@
-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.
* 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 */
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' */
};
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'.
/*
* Gets from the request 'req' the argument of 'name'.
* Returns a PLAIN structure of type 'struct afb_arg'.
@@
-300,7
+310,7
@@
static inline int afb_req_session_set_LOA(struct afb_req req, unsigned level)
*/
static inline struct afb_req *afb_req_store(struct afb_req req)
{
*/
static inline struct afb_req *afb_req_store(struct afb_req req)
{
- struct afb_req *result = malloc(sizeof *result);
+ struct afb_req *result =
(struct afb_req*)
malloc(sizeof *result);
if (result != NULL) {
*result = req;
afb_req_addref(req);
if (result != NULL) {
*result = req;
afb_req_addref(req);