move publicly needed structures and functions in the public header.
Stop installing internal headers.
Update the signature and exports files with the new exposed
function.
tevent_queue_length;
tevent_queue_start;
tevent_queue_stop;
+ tevent_register_backend;
_tevent_req_callback_data;
_tevent_req_create;
_tevent_req_data;
_tevent_loop_until(ev, finished, private_data, __location__)
#endif
+
+/**
+ * The following structure and registration functions are exclusively
+ * needed for people writing and pluggin a different event engine.
+ * There is nothing useful for normal tevent user in here.
+ */
+
+struct tevent_ops {
+ /* context init */
+ int (*context_init)(struct tevent_context *ev);
+
+ /* fd_event functions */
+ struct tevent_fd *(*add_fd)(struct tevent_context *ev,
+ TALLOC_CTX *mem_ctx,
+ int fd, uint16_t flags,
+ tevent_fd_handler_t handler,
+ 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);
+
+ /* timed_event functions */
+ struct tevent_timer *(*add_timer)(struct tevent_context *ev,
+ TALLOC_CTX *mem_ctx,
+ struct timeval next_event,
+ tevent_timer_handler_t handler,
+ void *private_data,
+ const char *handler_name,
+ const char *location);
+
+ /* immediate event functions */
+ void (*schedule_immediate)(struct tevent_immediate *im,
+ struct tevent_context *ev,
+ tevent_immediate_handler_t handler,
+ void *private_data,
+ const char *handler_name,
+ const char *location);
+
+ /* signal functions */
+ struct tevent_signal *(*add_signal)(struct tevent_context *ev,
+ TALLOC_CTX *mem_ctx,
+ int signum, int sa_flags,
+ tevent_signal_handler_t handler,
+ void *private_data,
+ const char *handler_name,
+ const char *location);
+
+ /* loop functions */
+ int (*loop_once)(struct tevent_context *ev, const char *location);
+ int (*loop_wait)(struct tevent_context *ev, const char *location);
+};
+
+bool tevent_register_backend(const char *name, const struct tevent_ops *ops);
+
+
+/**
+ * The following definitions are usueful only for compatibility with the
+ * implementation originally developed within the samba4 code and will be
+ * soon removed. Please NEVER use in new code.
+ */
+
#ifdef TEVENT_COMPAT_DEFINES
#define event_context tevent_context
installheaders:: installdirs
cp $(srcdir)/tevent.h $(DESTDIR)$(includedir)
- cp $(srcdir)/tevent_internal.h $(DESTDIR)$(includedir)
installlibs:: installdirs
cp tevent.pc $(DESTDIR)$(libdir)/pkgconfig
void tevent_fd_set_flags (struct tevent_fd *, uint16_t);
_Bool tevent_signal_support (struct tevent_context *);
void tevent_set_abort_fn (void (*) (const char *));
-int tevent_set_debug (struct tevent_context *, void (*) (void *, enum tevent_debug_level, const char *, __va_list_tag *), void *);
+int tevent_set_debug (struct tevent_context *, void (*) (void *, enum tevent_debug_level, const char *, va_list), void *);
int tevent_set_debug_stderr (struct tevent_context *);
void tevent_req_set_callback (struct tevent_req *, tevent_req_fn, void *);
void *_tevent_req_callback_data (struct tevent_req *);
void tevent_loop_allow_nesting (struct tevent_context *);
void tevent_loop_set_nesting_hook (struct tevent_context *, tevent_nesting_hook, void *);
int _tevent_loop_until (struct tevent_context *, _Bool (*) (void *), void *, const char *);
+_Bool tevent_register_backend (const char *, const struct tevent_ops *);
struct tevent_context *tevent_context_init (TALLOC_CTX *);
struct tevent_context *tevent_context_init_byname (TALLOC_CTX *, const char *);
const char **tevent_backend_list (TALLOC_CTX *);
} internal;
};
-struct tevent_ops {
- /* conntext init */
- int (*context_init)(struct tevent_context *ev);
-
- /* fd_event functions */
- struct tevent_fd *(*add_fd)(struct tevent_context *ev,
- TALLOC_CTX *mem_ctx,
- int fd, uint16_t flags,
- tevent_fd_handler_t handler,
- 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);
-
- /* timed_event functions */
- struct tevent_timer *(*add_timer)(struct tevent_context *ev,
- TALLOC_CTX *mem_ctx,
- struct timeval next_event,
- tevent_timer_handler_t handler,
- void *private_data,
- const char *handler_name,
- const char *location);
-
- /* immediate event functions */
- void (*schedule_immediate)(struct tevent_immediate *im,
- struct tevent_context *ev,
- tevent_immediate_handler_t handler,
- void *private_data,
- const char *handler_name,
- const char *location);
-
- /* signal functions */
- struct tevent_signal *(*add_signal)(struct tevent_context *ev,
- TALLOC_CTX *mem_ctx,
- int signum, int sa_flags,
- tevent_signal_handler_t handler,
- void *private_data,
- const char *handler_name,
- const char *location);
-
- /* loop functions */
- int (*loop_once)(struct tevent_context *ev, const char *location);
- int (*loop_wait)(struct tevent_context *ev, const char *location);
-};
-
struct tevent_fd {
struct tevent_fd *prev, *next;
struct tevent_context *event_ctx;
};
-bool tevent_register_backend(const char *name, const struct tevent_ops *ops);
-
int tevent_common_context_destructor(struct tevent_context *ev);
int tevent_common_loop_wait(struct tevent_context *ev,
const char *location);