add validity functions
[src/app-framework-binder.git] / include / afb / afb-event-itf.h
index e31f22c..5f7b837 100644 (file)
@@ -42,6 +42,16 @@ struct afb_event {
        void *closure;                          /* the closure argument for functions of 'itf' */
 };
 
+/*
+ * Checks wether the 'event' is valid or not.
+ *
+ * Returns 0 if not valid or 1 if valid.
+ */
+static inline int afb_event_is_valid(struct afb_event event)
+{
+       return event.itf != NULL;
+}
+
 /*
  * Broadcasts widely the 'event' with the data 'object'.
  * 'object' can be NULL.