Plugin enumerator enumerates over loaded features, too
This commit is contained in:
@@ -214,7 +214,7 @@ static void print_plugins()
|
||||
|
||||
buf[0] = '\0';
|
||||
enumerator = lib->plugins->create_plugin_enumerator(lib->plugins);
|
||||
while (len < sizeof(buf) && enumerator->enumerate(enumerator, &plugin))
|
||||
while (len < sizeof(buf) && enumerator->enumerate(enumerator, &plugin, NULL))
|
||||
{
|
||||
len += snprintf(&buf[len], sizeof(buf)-len, "%s ",
|
||||
plugin->get_name(plugin));
|
||||
|
||||
@@ -451,7 +451,7 @@ METHOD(stroke_list_t, status, void,
|
||||
lib->scheduler->get_job_load(lib->scheduler));
|
||||
fprintf(out, " loaded plugins: ");
|
||||
enumerator = lib->plugins->create_plugin_enumerator(lib->plugins);
|
||||
while (enumerator->enumerate(enumerator, &plugin))
|
||||
while (enumerator->enumerate(enumerator, &plugin, NULL))
|
||||
{
|
||||
fprintf(out, "%s ", plugin->get_name(plugin));
|
||||
}
|
||||
|
||||
@@ -177,9 +177,14 @@ static bool load_plugin(private_plugin_loader_t *this, char *name, char *file)
|
||||
/**
|
||||
* Convert enumerated entries to plugin_t
|
||||
*/
|
||||
static bool plugin_filter(void *null, plugin_entry_t **entry, plugin_t **plugin)
|
||||
static bool plugin_filter(void *null, plugin_entry_t **entry, plugin_t **plugin,
|
||||
void *in, linked_list_t **list)
|
||||
{
|
||||
*plugin = (*entry)->plugin;
|
||||
if (list)
|
||||
{
|
||||
*list = (*entry)->loaded;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,11 @@ struct plugin_loader_t {
|
||||
/**
|
||||
* Create an enumerator over all loaded plugins.
|
||||
*
|
||||
* @return enumerator over plugin_t*
|
||||
* In addition to the plugin, a to read-only list is enumerated (if it is
|
||||
* not NULL). This list contains pointer to plugin features currently
|
||||
* loaded.
|
||||
*
|
||||
* @return enumerator over plugin_t*, linked_list_t*
|
||||
*/
|
||||
enumerator_t* (*create_plugin_enumerator)(plugin_loader_t *this);
|
||||
|
||||
|
||||
+1
-1
@@ -841,7 +841,7 @@ static void show_loaded_plugins()
|
||||
|
||||
buf[0] = '\0';
|
||||
enumerator = lib->plugins->create_plugin_enumerator(lib->plugins);
|
||||
while (len < BUF_LEN && enumerator->enumerate(enumerator, &plugin))
|
||||
while (len < BUF_LEN && enumerator->enumerate(enumerator, &plugin, NULL))
|
||||
{
|
||||
len += snprintf(&buf[len], BUF_LEN-len, "%s ", plugin->get_name(plugin));
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ static void print_plugins()
|
||||
|
||||
buf[0] = '\0';
|
||||
enumerator = lib->plugins->create_plugin_enumerator(lib->plugins);
|
||||
while (len < BUF_LEN && enumerator->enumerate(enumerator, &plugin))
|
||||
while (len < BUF_LEN && enumerator->enumerate(enumerator, &plugin, NULL))
|
||||
{
|
||||
len += snprintf(&buf[len], BUF_LEN-len, "%s ", plugin->get_name(plugin));
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ static void print_plugins()
|
||||
enumerator_t *enumerator;
|
||||
|
||||
enumerator = lib->plugins->create_plugin_enumerator(lib->plugins);
|
||||
while (len < BUF_LEN && enumerator->enumerate(enumerator, &plugin))
|
||||
while (len < BUF_LEN && enumerator->enumerate(enumerator, &plugin, NULL))
|
||||
{
|
||||
len += snprintf(&buf[len], BUF_LEN-len, "%s ", plugin->get_name(plugin));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user