diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2011-07-20 17:37:44 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-07-20 17:37:44 +0200 |
commit | 5820c5f3e8dc69bdee969d6487d084e884595069 (patch) | |
tree | c44cda2313dd8ae3d1f415e864500a747ac4b23c /runtime/modules.c | |
parent | 686540cebee2920341911860c0019e687174daa8 (diff) | |
download | rsyslog-5820c5f3e8dc69bdee969d6487d084e884595069.tar.gz rsyslog-5820c5f3e8dc69bdee969d6487d084e884595069.tar.xz rsyslog-5820c5f3e8dc69bdee969d6487d084e884595069.zip |
milestone: done plumbing to call plugin create action instance entry point
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; |