tevent: add tevent_req_cancel() infrastructure
[metze/samba/wip.git] / lib / tevent / tevent.h
index 56ae0ee0820e4f2fc86bf0777fa11f04c0aa5e52..d3556053acc22f65477a1d6b702606b79ba13813 100644 (file)
@@ -238,6 +238,14 @@ char *tevent_req_default_print(struct tevent_req *req, TALLOC_CTX *mem_ctx);
 
 char *tevent_req_print(TALLOC_CTX *mem_ctx, struct tevent_req *req);
 
+typedef bool (*tevent_req_cancel_fn)(struct tevent_req *);
+
+void tevent_req_set_cancel_fn(struct tevent_req *req, tevent_req_cancel_fn fn);
+
+bool _tevent_req_cancel(struct tevent_req *req, const char *location);
+#define tevent_req_cancel(req) \
+       _tevent_req_cancel(req, __location__)
+
 struct tevent_req *_tevent_req_create(TALLOC_CTX *mem_ctx,
                                      void *pstate,
                                      size_t state_size,