*
* Connection Manager
*
- * Copyright (C) 2007-2008 Intel Corporation. All rights reserved.
+ * Copyright (C) 2007-2009 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
{
struct connman_plugin *plugin;
+ if (desc->init == NULL)
+ return FALSE;
+
+ if (g_str_equal(desc->version, CONNMAN_VERSION) == FALSE)
+ return FALSE;
+
plugin = g_try_new0(struct connman_plugin, 1);
if (plugin == NULL)
return FALSE;
plugin->handle = handle;
plugin->desc = desc;
- if (desc->init() < 0)
+ if (desc->init() < 0) {
+ g_free(plugin);
return FALSE;
+ }
plugins = g_slist_append(plugins, plugin);
return TRUE;
}
-int __connman_plugin_init(void)
+int __connman_plugin_init(const char *pattern)
{
GDir *dir;
const gchar *file;
continue;
}
- if (desc->init == NULL) {
+ if (pattern != NULL && g_pattern_match_simple(pattern,
+ desc->name) == FALSE) {
+ DBG("ignoring %s", desc->description);
dlclose(handle);
continue;
}