diff options
Diffstat (limited to 'runtime/modules.c')
-rw-r--r-- | runtime/modules.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/runtime/modules.c b/runtime/modules.c index d09ba770..59eaec34 100644 --- a/runtime/modules.c +++ b/runtime/modules.c @@ -427,7 +427,7 @@ static cfgmodules_etry_t if(rqtdType != eMOD_ANY) { /* if any, we already have the right one! */ while(node != NULL && node->pMod->eType != rqtdType) { - node = node->next; /* warning: do ... while() */ + node = node->next; } } @@ -435,6 +435,25 @@ static cfgmodules_etry_t } +/* Find a module with the given conf name and type. Returns NULL if none + * can be found, otherwise module found. + */ +static modInfo_t * +FindWithCnfName(rsconf_t *cnf, uchar *name, eModType_t rqtdType) +{ + cfgmodules_etry_t *node; + + node = cnf->modules.root; + while(node != NULL && node->pMod->eType != rqtdType) { + if(!strcasecmp((char*)node->pMod->cnfName, (char*)name)) + break; + node = node->next; + } + + return node == NULL ? NULL : node->pMod; +} + + /* Prepare a module for unloading. * This is currently a dummy, to be filled when we have a plug-in * interface - rgerhards, 2007-08-09 @@ -1179,6 +1198,7 @@ CODESTARTobjQueryInterface(module) pIf->GetName = modGetName; pIf->GetStateName = modGetStateName; pIf->PrintList = modPrintList; + pIf->FindWithCnfName = FindWithCnfName; pIf->UnloadAndDestructAll = modUnloadAndDestructAll; pIf->doModInit = doModInit; pIf->SetModDir = SetModDir; |