summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1fee763)
raw | patch | inline | side by side (parent: 1fee763)
author | Sebastian Harl <sh@tokkee.org> | |
Thu, 18 Jul 2013 01:56:44 +0000 (18:56 -0700) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Thu, 18 Jul 2013 01:56:44 +0000 (18:56 -0700) |
… and use sdb_llist_search_by_name() instead.
src/core/plugin.c | patch | blob | history |
diff --git a/src/core/plugin.c b/src/core/plugin.c
index f771d70936e5eda9fbbc2f2fbfa7c735b3e0605a..0a69bff2364a50e2b7566e4f4d0c4aaa6ec5b74c 100644 (file)
--- a/src/core/plugin.c
+++ b/src/core/plugin.c
? -1 : 0;
} /* sdb_plugin_cmp_next_update */
-static sdb_plugin_cb_t *
-sdb_plugin_find_by_name(sdb_llist_t *list, const char *name)
-{
- sdb_object_t tmp = SDB_OBJECT_INIT;
-
- sdb_object_t *obj;
- assert(name);
-
- if (! list)
- return NULL;
-
- tmp.name = strdup(name);
- if (! tmp.name)
- return NULL;
- obj = sdb_llist_search(list, &tmp, sdb_object_cmp_by_name);
- free(tmp.name);
- if (! obj)
- return NULL;
- return SDB_PLUGIN_CB(obj);
-} /* sdb_plugin_find_by_name */
-
/*
* private types
*/
assert(type);
assert(obj);
- if (sdb_plugin_find_by_name(*list, obj->name)) {
+ if (sdb_llist_search_by_name(*list, obj->name)) {
sdb_log(SDB_LOG_WARNING, "plugin: %s callback '%s' "
"has already been registered. Ignoring newly "
"registered version.", type, obj->name);
if ((! name) || (! ci))
return -1;
- plugin = sdb_plugin_find_by_name(config_list, name);
+ plugin = SDB_PLUGIN_CB(sdb_llist_search_by_name(config_list, name));
if (! plugin) {
/* XXX: check if any such plugin has been loaded */
sdb_log(SDB_LOG_ERR, "plugin: Plugin '%s' did not register "