summaryrefslogtreecommitdiff
path: root/lib/tevent
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2015-09-23 04:27:53 +0200
committerRalph Boehme <slow@samba.org>2018-07-11 23:04:17 +0200
commitcd517516b79f97d6f31c368e61565326a5c70af7 (patch)
tree6f5bc5d8308e296f0015979d6a60604109a7a2a3 /lib/tevent
parentf69bca61d582a62de3a9718983362f53992e4c27 (diff)
downloadsamba-cd517516b79f97d6f31c368e61565326a5c70af7.tar.gz
tevent.h: improve tevent_req documentation
Document tevent_req naming conventions. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'lib/tevent')
-rw-r--r--lib/tevent/tevent.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/lib/tevent/tevent.h b/lib/tevent/tevent.h
index 3ccac6a3600..0e2e806ee5c 100644
--- a/lib/tevent/tevent.h
+++ b/lib/tevent/tevent.h
@@ -697,6 +697,22 @@ void tevent_get_trace_callback(struct tevent_context *ev,
* the tevent_req structure can be talloc_free'ed. After it has
* finished, it should talloc_free'ed by the API user.
*
+ * tevent_req variable naming conventions:
+ *
+ * The name of the variable pointing to the tevent_req structure
+ * returned by a _send() function SHOULD be named differently between
+ * implementation and caller.
+ *
+ * From the point of view of the implementation (of the _send() and
+ * _recv() functions) the variable returned by tevent_req_create() is
+ * always called @em req.
+ *
+ * While the caller of the _send() function should use @em subreq to
+ * hold the result.
+ *
+ * @see tevent_req_create()
+ * @see tevent_req_fn()
+ *
* @{
*/
@@ -748,9 +764,9 @@ struct tevent_req;
/**
* @brief A tevent request callback function.
*
- * @param[in] req The tevent async request which executed this callback.
+ * @param[in] subreq The tevent async request which executed this callback.
*/
-typedef void (*tevent_req_fn)(struct tevent_req *req);
+typedef void (*tevent_req_fn)(struct tevent_req *subreq);
/**
* @brief Set an async request callback.
@@ -799,8 +815,6 @@ void *_tevent_req_callback_data(struct tevent_req *req);
*
* @param[in] req The structure to get the callback data from.
*
- * @param[in] req The structure to get the data from.
- *
* @return The private data or NULL if not set.
*/
void *tevent_req_callback_data_void(struct tevent_req *req);