mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
tevent: Add a utility function tevent_find_ops_byname().
Returns an event ops struct given a string name. Not yet used, but will be part of the new "standard" fallback code. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
parent
1ee428d5ca
commit
aceeb585cb
@ -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
|
||||
*/
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user