diff -r bc719fa5daf9 -r 2995153b596c metamod/mlist.cpp --- a/metamod/mlist.cpp Tue Jul 26 19:56:15 2005 +0000 +++ b/metamod/mlist.cpp Thu Jul 28 15:18:05 2005 +0000 @@ -293,8 +293,6 @@ return NULL; } - pl_added->source_plugin_index = pl_loader->index; - META_DEBUG(1, ("Loaded plugin '%s' successfully", pl_added->desc)); meta_errno = ME_NOERROR; @@ -338,7 +336,9 @@ // copy source iplug->source=padd->source; // copy status - iplug->status=padd->status; + iplug->status=padd->status; + //copy other things + iplug->source_plugin_index = padd->source_plugin_index; return(iplug); } @@ -598,12 +598,12 @@ META_CONS("Opened plugin '%s', but failed to attach; see log", pl_added->desc); else META_CONS("Couldn't load plugin '%s'; see log", pl_added->desc); - show(); + show(0); // meta_errno should be already set in load() return(mFALSE); } META_CONS("Loaded plugin '%s' successfully", pl_added->desc); - show(); + show(0); return(mTRUE); } @@ -742,11 +742,16 @@ // List plugins and information about them in a formatted table. // meta_errno values: // - none -void MPluginList::show() { +void MPluginList::show(int source_index) { int i, n=0, r=0; MPlugin *pl; char desc[15+1], file[16+1], vers[7+1]; // plus 1 for term null + if (source_index <= 0) + META_CONS("Currently loaded plugins:"); + else + META_CONS("Child plugins:"); + META_CONS("Currently loaded plugins:"); META_CONS(" %*s %-*s %-4s %-4s %-*s v%-*s %-3s %-5s %-5s", WIDTH_MAX_PLUGINS, "", @@ -758,6 +763,8 @@ pl=&plist[i]; if(pl->status < PL_VALID) continue; + if ((source_index > 0) && (pl->source_plugin_index != source_index)) + continue; STRNCPY(desc, pl->desc, sizeof(desc)); STRNCPY(file, pl->file, sizeof(file)); if(pl->info && pl->info->version) STRNCPY(vers, pl->info->version, sizeof(vers)); @@ -802,3 +809,23 @@ } META_CLIENT(pEntity, "%d plugins", n); } + +mBOOL MPluginList::found_child_plugins(int source_index) +{ + int i; + + if (source_index <= 0) + return mFALSE; + + for (i=0; i