From a5cc0758a393f36a770cdd57e317214d03934c13 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 9 Dec 2005 16:43:19 +0000 Subject: [PATCH] r12140: - add an additional_flags field to the fd_event struct, so that the events backend can store private flags - add function to access the gtk event loop ops struct metze --- source/gtk/common/gtk_events.c | 6 ++++++ source/lib/events/events_internal.h | 1 + source/lib/events/events_liboop.c | 7 ++++--- source/lib/events/events_standard.c | 1 + 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/source/gtk/common/gtk_events.c b/source/gtk/common/gtk_events.c index f844ab01c92..7f1230b13f4 100644 --- a/source/gtk/common/gtk_events.c +++ b/source/gtk/common/gtk_events.c @@ -135,6 +135,7 @@ static struct fd_event *gtk_event_add_fd(struct event_context *ev, TALLOC_CTX *m fde->flags = flags; fde->handler = handler; fde->private_data = private_data; + fde->additional_flags = 0; fde->additional_data = gtk_fd; channel = g_io_channel_unix_new(fde->fd); @@ -340,6 +341,11 @@ static const struct event_ops gtk_event_ops = { .loop_wait = gtk_event_loop_wait, }; +const struct event_ops *gtk_event_get_ops(void) +{ + return >k_event_ops; +} + int gtk_event_loop(void) { int ret; diff --git a/source/lib/events/events_internal.h b/source/lib/events/events_internal.h index 9fc5a2065f8..de4e5f6a5af 100644 --- a/source/lib/events/events_internal.h +++ b/source/lib/events/events_internal.h @@ -56,6 +56,7 @@ struct fd_event { /* this is private for the specific handler */ void *private_data; /* this is private for the events_ops implementation */ + uint16_t additional_flags; void *additional_data; }; diff --git a/source/lib/events/events_liboop.c b/source/lib/events/events_liboop.c index b17ea215059..c81449e65e9 100644 --- a/source/lib/events/events_liboop.c +++ b/source/lib/events/events_liboop.c @@ -127,6 +127,7 @@ static struct fd_event *oop_event_add_fd(struct event_context *ev, TALLOC_CTX *m fde->flags = flags; fde->handler = handler; fde->private_data = private_data; + fde->additional_flags = 0; fde->additional_data = NULL; if (fde->flags & EVENT_FD_READ) @@ -269,7 +270,7 @@ static int oop_event_loop_wait(struct event_context *ev) return -1; } -static const struct event_ops events_oop_ops = { +static const struct event_ops event_oop_ops = { .context_init = oop_event_context_init, .add_fd = oop_event_add_fd, .get_fd_flags = oop_event_get_fd_flags, @@ -279,7 +280,7 @@ static const struct event_ops events_oop_ops = { .loop_wait = oop_event_loop_wait, }; -const struct event_ops *events_oop_get_ops(void) +const struct event_ops *event_liboop_get_ops(void) { - return &events_oop_ops; + return &event_oop_ops; } diff --git a/source/lib/events/events_standard.c b/source/lib/events/events_standard.c index 1a3bdc1e167..cab1ab52b92 100644 --- a/source/lib/events/events_standard.c +++ b/source/lib/events/events_standard.c @@ -209,6 +209,7 @@ static struct fd_event *std_event_add_fd(struct event_context *ev, TALLOC_CTX *m fde->flags = flags; fde->handler = handler; fde->private_data = private_data; + fde->additional_flags = 0; fde->additional_data = NULL; DLIST_ADD(std_ev->fd_events, fde); -- 2.34.1