- /**
- * @brief Internal state of the request
- *
- * Callers should only access this via functions and never directly.
- */
- struct {
- /**
- * @brief The talloc type of the private_state pointer
- *
- * This is filled by the tevent_req_create() macro.
- *
- * This for debugging only.
- */
- const char *private_type;
-
- /**
- * @brief The location where the request was created
- *
- * This uses the __location__ macro via the tevent_req_create()
- * macro.
- *
- * This for debugging only.
- */
- const char *location;
-
- /**
- * @brief The external state - will be queried by the caller
- *
- * While the async request is being processed, state will remain in
- * TEVENT_REQ_IN_PROGRESS. A request is finished if
- * req->state>=TEVENT_REQ_DONE.
- */
- enum tevent_req_state state;
-
- /**
- * @brief status code when finished
- *
- * This status can be queried in the async completion function. It
- * will be set to 0 when everything went fine.
- */
- uint64_t error;
-
- /**
- * @brief the timer event if tevent_req_post was used
- *
- */
- struct tevent_timer *trigger;
-
- /**
- * @brief the timer event if tevent_req_set_timeout was used
- *
- */
- struct tevent_timer *timer;
- } internal;
-};
+#define tevent_req_callback_data(_req, _type) \
+ talloc_get_type_abort(_tevent_req_callback_data(_req), _type)
+#define tevent_req_data(_req, _type) \
+ talloc_get_type_abort(_tevent_req_data(_req), _type)
+
+typedef char *(*tevent_req_print_fn)(struct tevent_req *, TALLOC_CTX *);
+
+void tevent_req_set_print_fn(struct tevent_req *req, tevent_req_print_fn fn);