diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2009-07-19 22:28:13 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2009-07-19 22:28:13 (GMT) |
commit | 59bda76b1a76d796a42ee46b9da7041dbef57253 (patch) | |
tree | 36f7d6eaa7847016b99431b1b489c6a1fdbaf33b /src/plugins/pglist.c | |
parent | 3a9fe39c6a8923f45e7c96d80b0bfe52b8686ff9 (diff) |
Encapsulated all recognized variables in the stack using a new plugin (need to be continued).
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@99 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/plugins/pglist.c')
-rw-r--r-- | src/plugins/pglist.c | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/src/plugins/pglist.c b/src/plugins/pglist.c index 85421e6..6d47f57 100644 --- a/src/plugins/pglist.c +++ b/src/plugins/pglist.c @@ -77,7 +77,7 @@ bool init_all_plugins(GObject *ref) { _list.ref = ref; - browse_directory_for_plugins(&_list, PACKAGE_SOURCE_DIR "/src/plugins"); + browse_directory_for_plugins(&_list, PACKAGE_SOURCE_DIR "/plugins"); return true; @@ -200,3 +200,36 @@ GPluginModule *get_one_plugin_for_action(PluginAction action) return result; } + + +/****************************************************************************** +* * +* Paramètres : action = fonctionnalité recherchée. * +* count = nombre de greffons trouvés. [OUT] * +* * +* Description : Founit less greffons offrant le service demandé. * +* * +* Retour : Liste de greffons correspondants à libérer de la mémoire. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GPluginModule **get_all_plugins_for_action(PluginAction action, size_t *count) +{ + GPluginModule **result; /* Greffon à retourner */ + size_t i; /* Boucle de parcours */ + + result = NULL; + *count = 0; + + for (i = 0; i < _list.plugins_count; i++) + if (g_plugin_module_get_action(_list.plugins[i]) & action) + { + result = (GPluginModule **)realloc(result, ++(*count) * sizeof(GPluginModule *)); + result[*count - 1] = _list.plugins[i]; + } + + return result; + +} |