From b213b70c089046f426e1e3f2f733e42a02e2cbfe Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 5 Jan 2007 09:35:49 +0000 Subject: r20539: - split the common timer related events code into events_timed.c - make it easier to plug in a new events backend - add simpler 'select' and 'epoll' backends This is part of the effort to add good AIO support. The events_aio.c backend is done, but sometimes dies with a SEGV, which is why it isn't enabled yet. (This used to be commit 934f18283dbc7958944931a93a854526bcd54884) --- source4/gtk/common/gtk_events.c | 11 ++++------- source4/gtk/config.m4 | 2 ++ source4/gtk/config.mk | 11 +++++++++-- 3 files changed, 15 insertions(+), 9 deletions(-) (limited to 'source4/gtk') diff --git a/source4/gtk/common/gtk_events.c b/source4/gtk/common/gtk_events.c index 67467b87a7..45e1031093 100644 --- a/source4/gtk/common/gtk_events.c +++ b/source4/gtk/common/gtk_events.c @@ -43,7 +43,7 @@ static int gtk_event_context_destructor(struct event_context *ev) /* create a gtk_event_context structure. */ -static int gtk_event_context_init(struct event_context *ev, void *private_data) +static int gtk_event_context_init(struct event_context *ev) { talloc_set_destructor(ev, gtk_event_context_destructor); return 0; @@ -339,16 +339,13 @@ 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; - gtk_event_context_global = event_context_init_ops(NULL, >k_event_ops, NULL); + event_register_backend("gtk", >k_event_ops); + + gtk_event_context_global = event_context_init_byname(NULL, "gtk"); if (!gtk_event_context_global) return -1; ret = event_loop_wait(gtk_event_context_global); diff --git a/source4/gtk/config.m4 b/source4/gtk/config.m4 index aef24f5a74..4e23593c67 100644 --- a/source4/gtk/config.m4 +++ b/source4/gtk/config.m4 @@ -7,6 +7,7 @@ SMB_ENABLE(gwcrontab, NO) SMB_ENABLE(gwsam, NO) SMB_ENABLE(gepdump, NO) SMB_ENABLE(gwsvcctl, NO) +SMB_ENABLE(EVENTS_GTK, NO) if test t$SMB_ENABLE_gtk = tYES; then SMB_ENABLE(gtksamba, YES) @@ -15,5 +16,6 @@ if test t$SMB_ENABLE_gtk = tYES; then SMB_ENABLE(gwsam, YES) SMB_ENABLE(gwsvcctl, YES) SMB_ENABLE(gepdump, YES) + SMB_ENABLE(EVENTS_GTK, YES) AC_DEFINE(HAVE_GTK, 1, [Whether GTK+ is available]) fi diff --git a/source4/gtk/config.mk b/source4/gtk/config.mk index 56b4392d22..51b9b0febd 100644 --- a/source4/gtk/config.mk +++ b/source4/gtk/config.mk @@ -1,5 +1,13 @@ # LIB GTK SMB subsystem +############################## +[MODULE::EVENTS_GTK] +OBJ_FILES = common/gtk_events.o +SUBSYSTEM = gtksamba +INIT_FUNCTION = events_gtk_init +PRIVATE_DEPENDENCIES = gtk +############################## + [LIBRARY::gtksamba] VERSION = 0.0.1 SO_VERSION = 0 @@ -7,9 +15,8 @@ DESCRIPTION = Common Samba-related widgets for GTK+ applications PUBLIC_HEADERS = common/gtk-smb.h common/select.h OBJ_FILES = common/gtk-smb.o \ common/select.o \ - common/gtk_events.o \ common/credentials.o -PRIVATE_DEPENDENCIES = CHARSET LIBSAMBA-UTIL gtk RPC_NDR_SAMR +PRIVATE_DEPENDENCIES = CHARSET LIBSAMBA-UTIL gtk RPC_NDR_SAMR EVENTS_GTK [BINARY::gregedit] INSTALLDIR = BINDIR -- cgit