afb-eventid: Fix comments 29/14329/1
authorJosé Bollo <jose.bollo@iot.bzh>
Mon, 9 Apr 2018 12:18:46 +0000 (14:18 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Wed, 13 Jun 2018 15:14:22 +0000 (17:14 +0200)
Change-Id: I4ba49719a4776511d7f5448cd7fbf84caf7474e8
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
include/afb/afb-eventid-itf.h
include/afb/afb-eventid.h

index 8da3990..0af3658 100644 (file)
@@ -22,10 +22,9 @@ struct afb_eventid;
 struct afb_eventid_itf;
 
 /*
- * Interface for handling requests.
- * It records the functions to be called for the request.
+ * Interface for handling eventid.
+ * It records the functions to be called for the eventid.
  * Don't use this structure directly.
- * Use the helper functions documented below.
  */
 struct afb_eventid_itf
 {
@@ -39,7 +38,7 @@ struct afb_eventid_itf
 };
 
 /*
- * Describes the request of afb-daemon for bindings
+ * Describes the eventid
  */
 struct afb_eventid
 {
index 4c68d02..69d82a7 100644 (file)
@@ -29,7 +29,9 @@
  *
  * Returns the count of clients that received the event.
  */
-static inline int afb_eventid_broadcast(struct afb_eventid *eventid, struct json_object *object)
+static inline int afb_eventid_broadcast(
+                       struct afb_eventid *eventid,
+                       struct json_object *object)
 {
        return eventid->itf->broadcast(eventid, object);
 }
@@ -44,13 +46,16 @@ static inline int afb_eventid_broadcast(struct afb_eventid *eventid, struct json
  *
  * Returns the count of clients that received the event.
  */
-static inline int afb_eventid_push(struct afb_eventid *eventid, struct json_object *object)
+static inline int afb_eventid_push(
+                       struct afb_eventid *eventid,
+                       struct json_object *object)
 {
        return eventid->itf->push(eventid, object);
 }
 
 /*
  * Gets the name associated to 'eventid'.
+ * The returned name can be used until call to 'afb_eventid_unref'.
  */
 static inline const char *afb_eventid_name(struct afb_eventid *eventid)
 {
@@ -58,8 +63,9 @@ static inline const char *afb_eventid_name(struct afb_eventid *eventid)
 }
 
 /*
- * Decrease the count of reference to 'eventid' and
- * destroys the eventid when the reference count falls to zero.
+ * Decrease the count of references to 'eventid'.
+ * Call this function when the evenid is no more used.
+ * It destroys the eventid when the reference count falls to zero.
  */
 static inline void afb_eventid_unref(struct afb_eventid *eventid)
 {
@@ -67,9 +73,10 @@ static inline void afb_eventid_unref(struct afb_eventid *eventid)
 }
 
 /*
- * Increases the count of reference to 'eventid'
+ * Increases the count of references to 'eventid'
  */
-static inline struct afb_eventid *afb_eventid_addref(struct afb_eventid *eventid)
+static inline struct afb_eventid *afb_eventid_addref(
+                                       struct afb_eventid *eventid)
 {
        return eventid->itf->addref(eventid);
 }