diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2009-01-21 21:42:41 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-01-21 21:42:41 +0100 |
commit | 0f02f72a8e871f79c8230b9bc954c9db66dbd34b (patch) | |
tree | c10533a9f38719a569736ccaefdb99db072ef755 /src/plugin.c | |
parent | ec02283f6e4bcfa2cda224cbc23b398c2862c5d1 (diff) | |
download | connman-0f02f72a8e871f79c8230b9bc954c9db66dbd34b.tar.gz connman-0f02f72a8e871f79c8230b9bc954c9db66dbd34b.tar.bz2 connman-0f02f72a8e871f79c8230b9bc954c9db66dbd34b.zip |
Add extra options to exclude devices and plugins
Diffstat (limited to 'src/plugin.c')
-rw-r--r-- | src/plugin.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/plugin.c b/src/plugin.c index 7fb7d444..59d3572c 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -43,8 +43,10 @@ static gboolean add_plugin(void *handle, struct connman_plugin_desc *desc) if (desc->init == NULL) return FALSE; - if (g_str_equal(desc->version, CONNMAN_VERSION) == FALSE) + if (g_str_equal(desc->version, CONNMAN_VERSION) == FALSE) { + DBG("version mismatch for %s", desc->description); return FALSE; + } plugin = g_try_new0(struct connman_plugin, 1); if (plugin == NULL) @@ -63,7 +65,7 @@ static gboolean add_plugin(void *handle, struct connman_plugin_desc *desc) return TRUE; } -int __connman_plugin_init(const char *pattern) +int __connman_plugin_init(const char *pattern, const char *exclude) { GDir *dir; const gchar *file; @@ -100,6 +102,13 @@ int __connman_plugin_init(const char *pattern) continue; } + if (exclude != NULL && g_pattern_match_simple(exclude, + desc->name) == TRUE) { + DBG("excluding %s", desc->description); + dlclose(handle); + continue; + } + if (pattern != NULL && g_pattern_match_simple(pattern, desc->name) == FALSE) { DBG("ignoring %s", desc->description); |