r12140: - add an additional_flags field to the fd_event struct, so that
authorStefan Metzmacher <metze@samba.org>
Fri, 9 Dec 2005 16:43:19 +0000 (16:43 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:47:13 +0000 (13:47 -0500)
  the events backend can store private flags
- add function to access the gtk event loop ops struct

metze
(This used to be commit a5cc0758a393f36a770cdd57e317214d03934c13)

source4/gtk/common/gtk_events.c
source4/lib/events/events_internal.h
source4/lib/events/events_liboop.c
source4/lib/events/events_standard.c

index f844ab01c92714197fb2158a226787590595cd04..7f1230b13f402d748a96479e1ce3bcd2863ec2dd 100644 (file)
@@ -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 &gtk_event_ops;
+}
+
 int gtk_event_loop(void)
 {
        int ret;
index 9fc5a2065f8492a13e15f4c9f26a165691176815..de4e5f6a5aff2262792e8e633fc7b98243729c09 100644 (file)
@@ -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;
 };
 
index b17ea215059b47a38ee824dbc068f86b5bb3807e..c81449e65e9cf9e12af43368317497719d438f2b 100644 (file)
@@ -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;
 }
index 1a3bdc1e1672c7b6295fc9a4a318b83820759a23..cab1ab52b92f90753bdd00891f5d5a04c9a4cf80 100644 (file)
@@ -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);