summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-10-29 16:17:46 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-10-29 16:17:46 +0100
commit64a4358384699478babd8bd90c724c171b1c549f (patch)
tree10479a958553840e63a19463ccf14a7e2dd53c1e
parent1960b94b8a3f210f64d141d6dd60052d4ab9220f (diff)
downloadrsyslog-64a4358384699478babd8bd90c724c171b1c549f.tar.gz
rsyslog-64a4358384699478babd8bd90c724c171b1c549f.tar.bz2
rsyslog-64a4358384699478babd8bd90c724c171b1c549f.zip
add freeWrkrInstance to output module interface
-rw-r--r--plugins/mmanon/mmanon.c5
-rw-r--r--runtime/module-template.h4
-rw-r--r--runtime/modules.c1
-rw-r--r--runtime/modules.h3
-rw-r--r--tools/omdiscard.c5
-rw-r--r--tools/omfile.c5
-rw-r--r--tools/omfwd.c5
-rw-r--r--tools/ompipe.c5
-rw-r--r--tools/omshell.c5
-rw-r--r--tools/omusrmsg.c5
10 files changed, 41 insertions, 2 deletions
diff --git a/plugins/mmanon/mmanon.c b/plugins/mmanon/mmanon.c
index 0612c812..c714706a 100644
--- a/plugins/mmanon/mmanon.c
+++ b/plugins/mmanon/mmanon.c
@@ -138,6 +138,11 @@ CODESTARTfreeInstance
ENDfreeInstance
+BEGINfreeWrkrInstance
+CODESTARTfreeWrkrInstance
+ENDfreeWrkrInstance
+
+
static inline void
setInstParamDefaults(instanceData *pData)
{
diff --git a/runtime/module-template.h b/runtime/module-template.h
index f6afc961..7657a985 100644
--- a/runtime/module-template.h
+++ b/runtime/module-template.h
@@ -204,7 +204,7 @@ static rsRetVal freeWrkrInstance(void* pd)\
wrkrInstanceData_t *pWrkrData;
#define CODESTARTfreeWrkrInstance \
- pWrkrData = (wrkrInstanceData_t*) pModData;
+ pWrkrData = (wrkrInstanceData_t*) pd;
#define ENDfreeWrkrInstance \
if(pWrkrData != NULL)\
@@ -511,6 +511,8 @@ static rsRetVal queryEtryPt(uchar *name, rsRetVal (**pEtryPoint)())\
#define CODEqueryEtryPt_STD_OMOD8_QUERIES \
else if(!strcmp((char*) name, "createWrkrInstance")) {\
*pEtryPoint = createWrkrInstance;\
+ } else if(!strcmp((char*) name, "freeWrkrInstance")) {\
+ *pEtryPoint = freeWrkrInstance;\
}
/* the following definition is queryEtryPt block that must be added
diff --git a/runtime/modules.c b/runtime/modules.c
index 7f01a0fb..52096082 100644
--- a/runtime/modules.c
+++ b/runtime/modules.c
@@ -653,6 +653,7 @@ doModInit(rsRetVal (*modInit)(int, int*, rsRetVal(**)(), rsRetVal(*)(), modInfo_
CHKiRet((*pNew->modQueryEtryPt)((uchar*)"parseSelectorAct", &pNew->mod.om.parseSelectorAct));
CHKiRet((*pNew->modQueryEtryPt)((uchar*)"tryResume", &pNew->tryResume));
CHKiRet((*pNew->modQueryEtryPt)((uchar*)"createWrkrInstance", &pNew->mod.om.createWrkrInstance));
+ CHKiRet((*pNew->modQueryEtryPt)((uchar*)"freeWrkrInstance", &pNew->mod.om.freeWrkrInstance));
/* try load optional interfaces */
localRet = (*pNew->modQueryEtryPt)((uchar*)"doHUP", &pNew->doHUP);
diff --git a/runtime/modules.h b/runtime/modules.h
index 31e87995..a0637ac9 100644
--- a/runtime/modules.h
+++ b/runtime/modules.h
@@ -139,7 +139,8 @@ struct modInfo_s {
rsRetVal (*parseSelectorAct)(uchar**, void**,omodStringRequest_t**);
rsRetVal (*newActInst)(uchar *modName, struct nvlst *lst, void **, omodStringRequest_t **);
rsRetVal (*SetShutdownImmdtPtr)(void *pData, void *pPtr);
- rsRetVal (*createWrkrInstance)(void*pWrkrData, void*pData);
+ rsRetVal (*createWrkrInstance)(void*ppWrkrData, void*pData);
+ rsRetVal (*freeWrkrInstance)(void*pWrkrData);
} om;
struct { /* data for library modules */
char dummy;
diff --git a/tools/omdiscard.c b/tools/omdiscard.c
index c5fb1874..a76bcc33 100644
--- a/tools/omdiscard.c
+++ b/tools/omdiscard.c
@@ -96,6 +96,11 @@ CODESTARTfreeInstance
ENDfreeInstance
+BEGINfreeWrkrInstance
+CODESTARTfreeWrkrInstance
+ENDfreeWrkrInstance
+
+
BEGINparseSelectorAct
CODESTARTparseSelectorAct
CODE_STD_STRING_REQUESTparseSelectorAct(0)
diff --git a/tools/omfile.c b/tools/omfile.c
index 151cc92e..4300bb4d 100644
--- a/tools/omfile.c
+++ b/tools/omfile.c
@@ -941,6 +941,11 @@ CODESTARTfreeInstance
ENDfreeInstance
+BEGINfreeWrkrInstance
+CODESTARTfreeWrkrInstance
+ENDfreeWrkrInstance
+
+
BEGINtryResume
CODESTARTtryResume
ENDtryResume
diff --git a/tools/omfwd.c b/tools/omfwd.c
index c6d5449c..ca33cac2 100644
--- a/tools/omfwd.c
+++ b/tools/omfwd.c
@@ -369,6 +369,11 @@ CODESTARTfreeInstance
ENDfreeInstance
+BEGINfreeWrkrInstance
+CODESTARTfreeWrkrInstance
+ENDfreeWrkrInstance
+
+
BEGINdbgPrintInstInfo
CODESTARTdbgPrintInstInfo
dbgprintf("%s", pData->target);
diff --git a/tools/ompipe.c b/tools/ompipe.c
index 29a1a0b6..eab7f694 100644
--- a/tools/ompipe.c
+++ b/tools/ompipe.c
@@ -296,6 +296,11 @@ CODESTARTfreeInstance
ENDfreeInstance
+BEGINfreeWrkrInstance
+CODESTARTfreeWrkrInstance
+ENDfreeWrkrInstance
+
+
BEGINtryResume
CODESTARTtryResume
ENDtryResume
diff --git a/tools/omshell.c b/tools/omshell.c
index cf4ad111..6680faab 100644
--- a/tools/omshell.c
+++ b/tools/omshell.c
@@ -89,6 +89,11 @@ CODESTARTfreeInstance
ENDfreeInstance
+BEGINfreeWrkrInstance
+CODESTARTfreeWrkrInstance
+ENDfreeWrkrInstance
+
+
BEGINdbgPrintInstInfo
CODESTARTdbgPrintInstInfo
printf("%s", pData->progName);
diff --git a/tools/omusrmsg.c b/tools/omusrmsg.c
index b3903413..cab2a4fe 100644
--- a/tools/omusrmsg.c
+++ b/tools/omusrmsg.c
@@ -137,6 +137,11 @@ CODESTARTfreeInstance
ENDfreeInstance
+BEGINfreeWrkrInstance
+CODESTARTfreeWrkrInstance
+ENDfreeWrkrInstance
+
+
BEGINdbgPrintInstInfo
register int i;
CODESTARTdbgPrintInstInfo