diff options
author | Stefan Metzmacher <metze@samba.org> | 2009-01-03 11:27:00 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2009-01-03 19:58:51 +0100 |
commit | e45ed828d042acca09cb1ed5b6dd7a24eb5e7ffd (patch) | |
tree | 87cc211ffd1b8354299ab720446dec89e8b1c18a /lib/tevent/tevent_internal.h | |
parent | e928d863e2bb654d16ac9094e3406ef6a207c023 (diff) | |
download | samba-e45ed828d042acca09cb1ed5b6dd7a24eb5e7ffd.tar.gz samba-e45ed828d042acca09cb1ed5b6dd7a24eb5e7ffd.tar.bz2 samba-e45ed828d042acca09cb1ed5b6dd7a24eb5e7ffd.zip |
tevent: add tevent_fd_set_close_fn()
Let callers specify a close function
as an alternative to TEVENT_FD_AUTOCLOSE.
metze
Diffstat (limited to 'lib/tevent/tevent_internal.h')
-rw-r--r-- | lib/tevent/tevent_internal.h | 7 |
1 files changed, 6 insertions, 1 deletions
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); |