diff options
Diffstat (limited to 'server/util')
-rw-r--r-- | server/util/util.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/server/util/util.h b/server/util/util.h index 02916c19..82c0be22 100644 --- a/server/util/util.h +++ b/server/util/util.h @@ -78,6 +78,31 @@ void debug_fn(const char *format, ...); #define talloc_zfree(ptr) do { talloc_free(ptr); ptr = NULL; } while(0) #endif +/* TODO: remove later + * These functions are available in the latest tevent and are the ones that + * should be used as tevent_req is rightfully opaque there */ +#ifndef tevent_req_data +#define tevent_req_data(req, type) ((type *)req->private_state) +#endif + +#ifndef tevent_req_set_callback +#define tevent_req_set_callback(req, func, data) \ + do { req->async.fn = func; req->async.private_data = data; } while(0) +#endif + +#ifndef tevent_req_callback_data +#define tevent_req_callback_data(req, type) ((type *)req->async.private_data) +#endif + +#ifndef tevent_req_notify_callback +#define tevent_req_notify_callback(req) \ + do { \ + if (req->async.fn != NULL) { \ + req->async.fn(req); \ + } \ + } while(0) +#endif + #include "util/dlinklist.h" /* From debug.c */ |