From e45ed828d042acca09cb1ed5b6dd7a24eb5e7ffd Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 3 Jan 2009 11:27:00 +0100 Subject: tevent: add tevent_fd_set_close_fn() Let callers specify a close function as an alternative to TEVENT_FD_AUTOCLOSE. metze --- lib/tevent/tevent_internal.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/tevent/tevent_internal.h') diff --git a/lib/tevent/tevent_internal.h b/lib/tevent/tevent_internal.h index 6099387362..f29e9c62f5 100644 --- a/lib/tevent/tevent_internal.h +++ b/lib/tevent/tevent_internal.h @@ -33,6 +33,8 @@ struct tevent_ops { void *private_data, const char *handler_name, const char *location); + void (*set_fd_close_fn)(struct tevent_fd *fde, + tevent_fd_close_fn_t close_fn); uint16_t (*get_fd_flags)(struct tevent_fd *fde); void (*set_fd_flags)(struct tevent_fd *fde, uint16_t flags); @@ -70,8 +72,9 @@ struct tevent_fd { struct tevent_fd *prev, *next; struct tevent_context *event_ctx; int fd; - uint16_t flags; /* see EVENT_FD_* flags */ + uint16_t flags; /* see TEVENT_FD_* flags */ tevent_fd_handler_t handler; + tevent_fd_close_fn_t close_fn; /* this is private for the specific handler */ void *private_data; /* this is for debugging only! */ @@ -146,6 +149,8 @@ struct tevent_context { bool tevent_register_backend(const char *name, const struct tevent_ops *ops); +void tevent_common_fd_set_close_fn(struct tevent_fd *fde, + tevent_fd_close_fn_t close_fn); uint16_t tevent_common_fd_get_flags(struct tevent_fd *fde); void tevent_common_fd_set_flags(struct tevent_fd *fde, uint16_t flags); -- cgit