diff options
-rw-r--r-- | lib/tevent/tevent.c | 22 | ||||
-rw-r--r-- | lib/tevent/tevent_internal.h | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/lib/tevent/tevent.c b/lib/tevent/tevent.c index e307dba3d7..63524710da 100644 --- a/lib/tevent/tevent.c +++ b/lib/tevent/tevent.c @@ -121,6 +121,28 @@ static void tevent_backend_init(void) tevent_standard_init(); } +_PRIVATE_ const struct tevent_ops *tevent_find_ops_byname(const char *name) +{ + struct tevent_ops_list *e; + + tevent_backend_init(); + + if (name == NULL) { + name = tevent_default_backend; + } + if (name == NULL) { + name = "standard"; + } + + for (e = tevent_backends; e != NULL; e = e->next) { + if (0 == strcmp(e->name, name)) { + return e->ops; + } + } + + return NULL; +} + /* list available backends */ diff --git a/lib/tevent/tevent_internal.h b/lib/tevent/tevent_internal.h index 4e9cd69213..fa6652cfa1 100644 --- a/lib/tevent/tevent_internal.h +++ b/lib/tevent/tevent_internal.h @@ -265,6 +265,7 @@ struct tevent_context { } tracing; }; +const struct tevent_ops *tevent_find_ops_byname(const char *name); int tevent_common_context_destructor(struct tevent_context *ev); int tevent_common_loop_wait(struct tevent_context *ev, |