From: Ralph Boehme Date: Wed, 23 Sep 2015 02:27:53 +0000 (+0200) Subject: tevent.h: improve tevent_req documentation X-Git-Tag: tevent-0.9.37~23 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cd517516b79f97d6f31c368e61565326a5c70af7;p=thirdparty%2Fsamba.git tevent.h: improve tevent_req documentation Document tevent_req naming conventions. Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- 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);