[SCM] Samba Shared Repository - branch master updated - 268f3e93a4dd66ce43dc53278eff01f801ba5083

Stefan Metzmacher metze at samba.org
Fri Jan 2 17:23:40 GMT 2009


The branch, master has been updated
       via  268f3e93a4dd66ce43dc53278eff01f801ba5083 (commit)
       via  2885a7ab6e2a44a76148380f47e2d0cde69d8b38 (commit)
       via  34cc50cb63a1a9e466d833de781e57b2f7c0b8ab (commit)
       via  73ef1773bebc206522b0a285573254441fc6a18a (commit)
       via  2176295b02cb39945d5335d93f0c5dfe054c9b9a (commit)
       via  784b2dc8d02c4e5c1ae31314f08874fa57416c40 (commit)
       via  4f04b06ac2cfceddaabcbf661f9878ff69a6f01b (commit)
       via  d79fc2ffcd9802d927f82f014c2b13c7eb8cc873 (commit)
       via  227f799dee4e59479612bcb3dc96231589515051 (commit)
       via  49acf9799aab288b4e585295eb7c44a719973945 (commit)
       via  b12e78e64517d423aefecc84f23499b13aedd734 (commit)
       via  d9529a331afaf1c82b24becc1d0d245e19d518aa (commit)
       via  0a73e8b334d2b9f5e8032c685d78b6425a9fa5e7 (commit)
       via  7db63990698563fd5d32698cb7988358cf5ab247 (commit)
       via  d33b6aeff3ff0220c16211936043934cfa3ec71b (commit)
       via  8bdc947993dd29d0480675464d548134c6f71ea7 (commit)
       via  0ffed7d992a50bff5f3bc89447418ed485dbccb0 (commit)
       via  25387d89427d1cc79c80d4915ecc00100712be87 (commit)
       via  3f8f99eaecf7a07126969594c41c00392b85cefd (commit)
       via  54c0f626f51c33245ae8f7778cc6ad6b48ae0f93 (commit)
      from  0e95c9a1eb82a50281c94b226fbae2ac3210e5f5 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 268f3e93a4dd66ce43dc53278eff01f801ba5083
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 2 16:41:21 2009 +0100

    s4:lib/events: remove unused events_internal.h
    
    external users need to use tevent_internal.h anyway
    
    metze

commit 2885a7ab6e2a44a76148380f47e2d0cde69d8b38
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 2 16:27:48 2009 +0100

    s4:selftest: report tevent tests as 'tevent.python'
    
    metze

commit 34cc50cb63a1a9e466d833de781e57b2f7c0b8ab
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 2 15:34:37 2009 +0100

    s4:lib/events: convert to use tevent_* functions instead of compat macros
    
    metze

commit 73ef1773bebc206522b0a285573254441fc6a18a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 2 16:28:38 2009 +0100

    tevent: only provide compat macros if the caller wants them
    
    metze

commit 2176295b02cb39945d5335d93f0c5dfe054c9b9a
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 2 16:27:11 2009 +0100

    tevent: change pytevent to tevent_*
    
    metze

commit 784b2dc8d02c4e5c1ae31314f08874fa57416c40
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 2 16:25:29 2009 +0100

    tevent: use TEVENT_FD_* instead of EVENT_FD_*
    
    metze

commit 4f04b06ac2cfceddaabcbf661f9878ff69a6f01b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 2 13:39:56 2009 +0100

    tevent: rename ev_debug_ops => tevent_debug_ops
    
    And related changes, but we keep compat macros
    
    metze

commit d79fc2ffcd9802d927f82f014c2b13c7eb8cc873
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 2 14:20:37 2009 +0100

    tevent: rename events => tevent in tevent.pc
    
    metze

commit 227f799dee4e59479612bcb3dc96231589515051
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 2 13:26:32 2009 +0100

    tevent: pass down handler_name and location to the backend layer
    
    metze

commit 49acf9799aab288b4e585295eb7c44a719973945
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 2 11:44:17 2009 +0100

    tevent: make tevent_add_*() macros arround _tevent_add_*()
    
    This passes some additional debug information into
    the events system to make it easier to find bugs.
    
    metze

commit b12e78e64517d423aefecc84f23499b13aedd734
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 2 13:39:26 2009 +0100

    tevent: use HAVE_EPOLL instead of HAVE_EVENTS_EPOLL
    
    metze

commit d9529a331afaf1c82b24becc1d0d245e19d518aa
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 2 13:35:32 2009 +0100

    tevent: rename event_register_backend() => tevent_register_backend()
    
    And fix the callers and there init functions.
    
    metze

commit 0a73e8b334d2b9f5e8032c685d78b6425a9fa5e7
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 2 11:30:00 2009 +0100

    tevent: rename event_context_init* => tevent_context_init*()
    
    metze

commit 7db63990698563fd5d32698cb7988358cf5ab247
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 2 11:36:52 2009 +0100

    tevent: rename event_[s|g]et_fd_flags => tevent_fd_[s|g]et_flags
    
    metze

commit d33b6aeff3ff0220c16211936043934cfa3ec71b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 2 11:32:29 2009 +0100

    tevent: rename event_loop_* => tevent_loop_*
    
    metze

commit 8bdc947993dd29d0480675464d548134c6f71ea7
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 2 11:17:00 2009 +0100

    tevent: rename event_set_default_backend() => tevent_set_default_backend()
    
    metze

commit 0ffed7d992a50bff5f3bc89447418ed485dbccb0
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 2 12:53:05 2009 +0100

    tevent: use libreplace headers instead of system headers
    
    metze

commit 25387d89427d1cc79c80d4915ecc00100712be87
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 2 15:33:23 2009 +0100

    s4:lib/events: deprecate event_context_find()
    
    metze

commit 3f8f99eaecf7a07126969594c41c00392b85cefd
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 2 12:06:39 2009 +0100

    s4:tevent: move event_context_find() to tevent_s4.c
    
    metze

commit 54c0f626f51c33245ae8f7778cc6ad6b48ae0f93
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jan 2 16:06:31 2009 +0100

    s4:pyregistry: use tevent_context_init()
    
    metze

-----------------------------------------------------------------------

Summary of changes:
 lib/tevent/libtevent.m4              |    2 -
 lib/tevent/pytevent.c                |   39 ++++----
 lib/tevent/tests.py                  |    8 +-
 lib/tevent/tevent.c                  |  169 +++++++++++++++++-----------------
 lib/tevent/tevent.h                  |   97 ++++++++++++++-----
 lib/tevent/tevent.pc.in              |    2 +-
 lib/tevent/tevent_aio.c              |   80 +++++++++-------
 lib/tevent/tevent_debug.c            |   32 ++++---
 lib/tevent/tevent_epoll.c            |   66 +++++++------
 lib/tevent/tevent_internal.h         |   99 ++++++++++++---------
 lib/tevent/tevent_select.c           |   43 +++++----
 lib/tevent/tevent_signal.c           |   44 +++++----
 lib/tevent/tevent_standard.c         |   82 +++++++++--------
 lib/tevent/tevent_timed.c            |   27 +++---
 source4/headermap.txt                |    3 -
 source4/lib/events/config.mk         |    2 +-
 source4/lib/events/events.h          |    2 +-
 source4/lib/events/events_internal.h |    5 -
 source4/lib/events/tevent_s4.c       |   38 ++++++--
 source4/lib/registry/pyregistry.c    |    2 +-
 source4/selftest/tests.sh            |    2 +-
 21 files changed, 470 insertions(+), 374 deletions(-)
 delete mode 100644 source4/lib/events/events_internal.h


Changeset truncated at 500 lines:

diff --git a/lib/tevent/libtevent.m4 b/lib/tevent/libtevent.m4
index 30105d9..24cdd8c 100644
--- a/lib/tevent/libtevent.m4
+++ b/lib/tevent/libtevent.m4
@@ -26,8 +26,6 @@ if test x"$ac_cv_header_sys_epoll_h" = x"yes" -a x"$ac_cv_func_epoll_create" = x
    TEVENT_OBJ="$TEVENT_OBJ tevent_epoll.o"
    SMB_ENABLE(TEVENT_EPOLL,YES)
    AC_DEFINE(HAVE_EPOLL, 1, [Whether epoll available])
-   #TODO: remove HAVE_EVENTS_EPOLL and use HAVE_EPOLL
-   AC_DEFINE(HAVE_EVENTS_EPOLL, 1, [Whether epoll available])
 
    # check for native Linux AIO interface
    AC_CHECK_HEADERS(libaio.h)
diff --git a/lib/tevent/pytevent.c b/lib/tevent/pytevent.c
index a969373..3d71d78 100644
--- a/lib/tevent/pytevent.c
+++ b/lib/tevent/pytevent.c
@@ -24,9 +24,9 @@
 typedef struct {
 	PyObject_HEAD
 	struct tevent_context *ev_ctx;
-} PyEventContextObject;
+} PyTEventContextObject;
 
-PyAPI_DATA(PyTypeObject) PyEventContext;
+PyAPI_DATA(PyTypeObject) PyTEventContext;
 
 static PyObject *py_set_default_backend(PyObject *self, PyObject *args)
 {
@@ -34,13 +34,13 @@ static PyObject *py_set_default_backend(PyObject *self, PyObject *args)
 
     if (!PyArg_ParseTuple(args, "s", &name))
         return NULL;
-    event_set_default_backend(name);
+    tevent_set_default_backend(name);
     return Py_None;
 }
 
 static PyObject *py_backend_list(PyObject *self)
 {
-    const char **backends = event_backend_list(NULL);
+    const char **backends = tevent_backend_list(NULL);
     PyObject *ret;
     int i, len;
 
@@ -66,28 +66,28 @@ static PyObject *py_event_ctx_new(PyTypeObject *type, PyObject *args, PyObject *
     const char *kwnames[] = { "name", NULL };
     char *name = NULL;
     struct tevent_context *ev_ctx;
-    PyEventContextObject *ret;
+    PyTEventContextObject *ret;
     if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|s", (char **)kwnames, &name))
         return NULL;
 
     if (name == NULL)
-        ev_ctx = event_context_init(NULL);
+        ev_ctx = tevent_context_init(NULL);
     else
-        ev_ctx = event_context_init_byname(NULL, name);
+        ev_ctx = tevent_context_init_byname(NULL, name);
 
-    ret = (PyEventContextObject *)type->tp_alloc(type, 0);
+    ret = (PyTEventContextObject *)type->tp_alloc(type, 0);
     ret->ev_ctx = ev_ctx;
     return (PyObject *)ret;
 }
 
-static PyObject *py_event_ctx_loop_once(PyEventContextObject *self)
+static PyObject *py_event_ctx_loop_once(PyTEventContextObject *self)
 {
-    return PyInt_FromLong(event_loop_once(self->ev_ctx));
+    return PyInt_FromLong(tevent_loop_once(self->ev_ctx));
 }
 
-static PyObject *py_event_ctx_loop_wait(PyEventContextObject *self)
+static PyObject *py_event_ctx_loop_wait(PyTEventContextObject *self)
 {
-    return PyInt_FromLong(event_loop_wait(self->ev_ctx));
+    return PyInt_FromLong(tevent_loop_wait(self->ev_ctx));
 }
 
 static PyMethodDef py_event_ctx_methods[] = {
@@ -98,16 +98,17 @@ static PyMethodDef py_event_ctx_methods[] = {
     { NULL }
 };
 
-static void py_event_ctx_dealloc(PyEventContextObject * self)
+static void py_event_ctx_dealloc(PyTEventContextObject * self)
 {
 	talloc_free(self->ev_ctx);
 	self->ob_type->tp_free(self);
 }
 
-PyTypeObject PyEventContext = {
-    .tp_name = "EventContext",
+
+PyTypeObject PyTEventContext = {
+    .tp_name = "TEventContext",
     .tp_methods = py_event_ctx_methods,
-    .tp_basicsize = sizeof(PyEventContextObject),
+    .tp_basicsize = sizeof(PyTEventContextObject),
     .tp_dealloc = (destructor)py_event_ctx_dealloc,
     .tp_flags = Py_TPFLAGS_DEFAULT,
     .tp_new = py_event_ctx_new,
@@ -117,14 +118,14 @@ void inittevent(void)
 {
     PyObject *m;
 
-    if (PyType_Ready(&PyEventContext) < 0)
+    if (PyType_Ready(&PyTEventContext) < 0)
     	return;
 
     m = Py_InitModule3("tevent", tevent_methods, "Event management.");
     if (m == NULL)
         return;
 
-    Py_INCREF(&PyEventContext);
-    PyModule_AddObject(m, "EventContext", (PyObject *)&PyEventContext);
+    Py_INCREF(&PyTEventContext);
+    PyModule_AddObject(m, "TEventContext", (PyObject *)&PyTEventContext);
 }
 
diff --git a/lib/tevent/tests.py b/lib/tevent/tests.py
index 0ec736b..bf594a1 100644
--- a/lib/tevent/tests.py
+++ b/lib/tevent/tests.py
@@ -17,15 +17,15 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-import tevent as events
+import tevent
 import unittest
 
 # Just test the bindings are there and that calling them doesn't crash
 # anything.
 
-class EventTestCase(unittest.TestCase):
+class TEventTestCase(unittest.TestCase):
     def test_create(self):
-        self.assertTrue(events.EventContext() is not None)
+        self.assertTrue(tevent.TEventContext() is not None)
 
     def test_loop_wait(self):
-        self.assertEquals(0, events.EventContext().loop_wait())
+        self.assertEquals(0, tevent.TEventContext().loop_wait())
diff --git a/lib/tevent/tevent.c b/lib/tevent/tevent.c
index e45a690..9319177 100644
--- a/lib/tevent/tevent.c
+++ b/lib/tevent/tevent.c
@@ -41,14 +41,14 @@
      handler to get another event.
 
   To setup a set of events you first need to create a event_context
-  structure using the function event_context_init(); This returns a
+  structure using the function tevent_context_init(); This returns a
   'struct tevent_context' that you use in all subsequent calls.
 
   After that you can add/remove events that you are interested in
-  using event_add_*() and talloc_free()
+  using tevent_add_*() and talloc_free()
 
-  Finally, you call event_loop_wait_once() to block waiting for one of the
-  events to occor or event_loop_wait() which will loop
+  Finally, you call tevent_loop_wait_once() to block waiting for one of the
+  events to occor or tevent_loop_wait() which will loop
   forever.
 
 */
@@ -57,36 +57,36 @@
 #include "tevent_internal.h"
 #include "tevent_util.h"
 
-struct event_ops_list {
-	struct event_ops_list *next, *prev;
+struct tevent_ops_list {
+	struct tevent_ops_list *next, *prev;
 	const char *name;
-	const struct event_ops *ops;
+	const struct tevent_ops *ops;
 };
 
 /* list of registered event backends */
-static struct event_ops_list *event_backends = NULL;
-static char *event_default_backend = NULL;
+static struct tevent_ops_list *tevent_backends = NULL;
+static char *tevent_default_backend = NULL;
 
 /*
   register an events backend
 */
-bool event_register_backend(const char *name, const struct event_ops *ops)
+bool tevent_register_backend(const char *name, const struct tevent_ops *ops)
 {
-	struct event_ops_list *e;
+	struct tevent_ops_list *e;
 
-	for (e = event_backends; e != NULL; e = e->next) {
+	for (e = tevent_backends; e != NULL; e = e->next) {
 		if (0 == strcmp(e->name, name)) {
 			/* already registered, skip it */
 			return true;
 		}
 	}
 
-	e = talloc(talloc_autofree_context(), struct event_ops_list);
+	e = talloc(talloc_autofree_context(), struct tevent_ops_list);
 	if (e == NULL) return false;
 
 	e->name = name;
 	e->ops = ops;
-	DLIST_ADD(event_backends, e);
+	DLIST_ADD(tevent_backends, e);
 
 	return true;
 }
@@ -94,38 +94,39 @@ bool event_register_backend(const char *name, const struct event_ops *ops)
 /*
   set the default event backend
  */
-void event_set_default_backend(const char *backend)
+void tevent_set_default_backend(const char *backend)
 {
-	if (event_default_backend) free(event_default_backend);
-	event_default_backend = strdup(backend);
+	talloc_free(tevent_default_backend);
+	tevent_default_backend = talloc_strdup(talloc_autofree_context(),
+					       backend);
 }
 
 /*
   initialise backends if not already done
 */
-static void event_backend_init(void)
+static void tevent_backend_init(void)
 {
-	events_select_init();
-	events_standard_init();
-#if HAVE_EVENTS_EPOLL
-	events_epoll_init();
+	tevent_select_init();
+	tevent_standard_init();
+#ifdef HAVE_EPOLL
+	tevent_epoll_init();
 #endif
-#if HAVE_LINUX_AIO
-	events_aio_init();
+#ifdef HAVE_LINUX_AIO
+	tevent_aio_init();
 #endif
 }
 
 /*
   list available backends
 */
-const char **event_backend_list(TALLOC_CTX *mem_ctx)
+const char **tevent_backend_list(TALLOC_CTX *mem_ctx)
 {
 	const char **list = NULL;
-	struct event_ops_list *e;
+	struct tevent_ops_list *e;
 
-	event_backend_init();
+	tevent_backend_init();
 
-	for (e=event_backends;e;e=e->next) {
+	for (e=tevent_backends;e;e=e->next) {
 		list = ev_str_list_add(list, e->name);
 	}
 
@@ -143,10 +144,10 @@ const char **event_backend_list(TALLOC_CTX *mem_ctx)
   This function is for allowing third-party-applications to hook in gluecode
   to their own event loop code, so that they can make async usage of our client libs
 
-  NOTE: use event_context_init() inside of samba!
+  NOTE: use tevent_context_init() inside of samba!
 */
-static struct tevent_context *event_context_init_ops(TALLOC_CTX *mem_ctx, 
-						    const struct event_ops *ops)
+static struct tevent_context *tevent_context_init_ops(TALLOC_CTX *mem_ctx,
+						      const struct tevent_ops *ops)
 {
 	struct tevent_context *ev;
 	int ret;
@@ -170,22 +171,23 @@ static struct tevent_context *event_context_init_ops(TALLOC_CTX *mem_ctx,
   call, and all subsequent calls pass this event_context as the first
   element. Event handlers also receive this as their first argument.
 */
-struct tevent_context *event_context_init_byname(TALLOC_CTX *mem_ctx, const char *name)
+struct tevent_context *tevent_context_init_byname(TALLOC_CTX *mem_ctx,
+						  const char *name)
 {
-	struct event_ops_list *e;
+	struct tevent_ops_list *e;
 
-	event_backend_init();
+	tevent_backend_init();
 
 	if (name == NULL) {
-		name = event_default_backend;
+		name = tevent_default_backend;
 	}
 	if (name == NULL) {
 		name = "standard";
 	}
 
-	for (e=event_backends;e;e=e->next) {
+	for (e=tevent_backends;e;e=e->next) {
 		if (strcmp(name, e->name) == 0) {
-			return event_context_init_ops(mem_ctx, e->ops);
+			return tevent_context_init_ops(mem_ctx, e->ops);
 		}
 	}
 	return NULL;
@@ -197,42 +199,51 @@ struct tevent_context *event_context_init_byname(TALLOC_CTX *mem_ctx, const char
   call, and all subsequent calls pass this event_context as the first
   element. Event handlers also receive this as their first argument.
 */
-struct tevent_context *event_context_init(TALLOC_CTX *mem_ctx)
+struct tevent_context *tevent_context_init(TALLOC_CTX *mem_ctx)
 {
-	return event_context_init_byname(mem_ctx, NULL);
+	return tevent_context_init_byname(mem_ctx, NULL);
 }
 
 /*
   add a fd based event
   return NULL on failure (memory allocation error)
 
-  if flags contains EVENT_FD_AUTOCLOSE then the fd will be closed when
+  if flags contains TEVENT_FD_AUTOCLOSE then the fd will be closed when
   the returned fd_event context is freed
 */
-struct tevent_fd *event_add_fd(struct tevent_context *ev, TALLOC_CTX *mem_ctx,
-			      int fd, uint16_t flags, event_fd_handler_t handler,
-			      void *private_data)
+struct tevent_fd *_tevent_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)
 {
-	return ev->ops->add_fd(ev, mem_ctx, fd, flags, handler, private_data);
+	return ev->ops->add_fd(ev, mem_ctx, fd, flags, handler, private_data,
+			       handler_name, location);
 }
 
 /*
   add a disk aio event
 */
-struct aio_event *event_add_aio(struct tevent_context *ev,
-				TALLOC_CTX *mem_ctx,
-				struct iocb *iocb,
-				event_aio_handler_t handler,
-				void *private_data)
+struct tevent_aio *_tevent_add_aio(struct tevent_context *ev,
+				   TALLOC_CTX *mem_ctx,
+				   struct iocb *iocb,
+				   tevent_aio_handler_t handler,
+				   void *private_data,
+				   const char *handler_name,
+				   const char *location)
 {
 	if (ev->ops->add_aio == NULL) return NULL;
-	return ev->ops->add_aio(ev, mem_ctx, iocb, handler, private_data);
+	return ev->ops->add_aio(ev, mem_ctx, iocb, handler, private_data,
+				handler_name, location);
 }
 
 /*
   return the fd event flags
 */
-uint16_t event_get_fd_flags(struct tevent_fd *fde)
+uint16_t tevent_fd_get_flags(struct tevent_fd *fde)
 {
 	if (!fde) return 0;
 	return fde->event_ctx->ops->get_fd_flags(fde);
@@ -241,22 +252,26 @@ uint16_t event_get_fd_flags(struct tevent_fd *fde)
 /*
   set the fd event flags
 */
-void event_set_fd_flags(struct tevent_fd *fde, uint16_t flags)
+void tevent_fd_set_flags(struct tevent_fd *fde, uint16_t flags)
 {
 	if (!fde) return;
 	fde->event_ctx->ops->set_fd_flags(fde, flags);
 }
 
 /*
-  add a timed event
+  add a timer event
   return NULL on failure
 */
-struct tevent_timer *event_add_timed(struct tevent_context *ev, TALLOC_CTX *mem_ctx,
-				    struct timeval next_event, 
-				    event_timed_handler_t handler, 
-				    void *private_data)
+struct tevent_timer *_tevent_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)
 {
-	return ev->ops->add_timer(ev, mem_ctx, next_event, handler, private_data);
+	return ev->ops->add_timer(ev, mem_ctx, next_event, handler, private_data,
+				  handler_name, location);
 }
 
 /*
@@ -266,19 +281,23 @@ struct tevent_timer *event_add_timed(struct tevent_context *ev, TALLOC_CTX *mem_
 
   return NULL on failure
 */
-struct signal_event *event_add_signal(struct tevent_context *ev, TALLOC_CTX *mem_ctx,
-				      int signum,
-				      int sa_flags,
-				      event_signal_handler_t handler, 
-				      void *private_data)
+struct tevent_signal *_tevent_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)
 {
-	return ev->ops->add_signal(ev, mem_ctx, signum, sa_flags, handler, private_data);
+	return ev->ops->add_signal(ev, mem_ctx, signum, sa_flags, handler, private_data,
+				   handler_name, location);
 }
 
 /*
   do a single event loop using the events defined in ev 
 */
-int event_loop_once(struct tevent_context *ev)
+int tevent_loop_once(struct tevent_context *ev)
 {
 	return ev->ops->loop_once(ev);
 }
@@ -286,25 +305,7 @@ int event_loop_once(struct tevent_context *ev)
 /*
   return on failure or (with 0) if all fd events are removed
 */
-int event_loop_wait(struct tevent_context *ev)
+int tevent_loop_wait(struct tevent_context *ev)
 {
 	return ev->ops->loop_wait(ev);
 }
-
-/*
-  find an event context that is a parent of the given memory context,
-  or create a new event context as a child of the given context if
-  none is found
-
-  This should be used in preference to event_context_init() in places
-  where you would prefer to use the existing event context if possible
-  (which is most situations)
-*/
-struct tevent_context *event_context_find(TALLOC_CTX *mem_ctx)
-{
-	struct tevent_context *ev = talloc_find_parent_bytype(mem_ctx, struct tevent_context);
-	if (ev == NULL) {		
-		ev = event_context_init(mem_ctx);
-	}
-	return ev;
-}
diff --git a/lib/tevent/tevent.h b/lib/tevent/tevent.h
index f626de9..01e79df 100644
--- a/lib/tevent/tevent.h
+++ b/lib/tevent/tevent.h
@@ -51,30 +51,52 @@ struct tevent_context *tevent_context_init_byname(TALLOC_CTX *mem_ctx, const cha
 const char **tevent_backend_list(TALLOC_CTX *mem_ctx);
 void tevent_set_default_backend(const char *backend);
 
-struct tevent_fd *tevent_add_fd(struct tevent_context *ev,
-				TALLOC_CTX *mem_ctx,
-				int fd, uint16_t flags,
-				tevent_fd_handler_t handler,
-				void *private_data);
-
-struct tevent_timer *tevent_add_timer(struct tevent_context *ev,
-				      TALLOC_CTX *mem_ctx,
-				      struct timeval next_event,
-				      tevent_timer_handler_t handler,
-				      void *private_data);
-
-struct tevent_signal *tevent_add_signal(struct tevent_context *ev,
-					TALLOC_CTX *mem_ctx,
-					int signum, int sa_flags,
-					tevent_signal_handler_t handler,
-					void *private_data);
+struct tevent_fd *_tevent_add_fd(struct tevent_context *ev,
+				 TALLOC_CTX *mem_ctx,
+				 int fd,


-- 
Samba Shared Repository


More information about the samba-cvs mailing list