summaryrefslogtreecommitdiffstats
path: root/module-template.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-07-31 13:02:23 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-07-31 13:02:23 +0000
commit48fd0e472a75a32e70fa1938c2279cf730282370 (patch)
treed009cb0f3e3b1c3d733b1d816b1413af3cb356c2 /module-template.h
parent19e94f195997a4907f96b5d53e88c2f5c44b08e0 (diff)
downloadrsyslog-48fd0e472a75a32e70fa1938c2279cf730282370.tar.gz
rsyslog-48fd0e472a75a32e70fa1938c2279cf730282370.tar.xz
rsyslog-48fd0e472a75a32e70fa1938c2279cf730282370.zip
- changed modInit() interface to contain pointer to host-function query
method
Diffstat (limited to 'module-template.h')
-rw-r--r--module-template.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/module-template.h b/module-template.h
index a8de8263..9cad16ff 100644
--- a/module-template.h
+++ b/module-template.h
@@ -27,6 +27,11 @@
#include "objomsr.h"
+/* macro to define standard output-module static data members
+ */
+#define DEF_OMOD_STATIC_DATA \
+ static rsRetVal (*omsdRegCFSLineHdlr)();
+
/* to following macros are used to generate function headers and standard
* functionality. It works as follows (described on the sample case of
* createInstance()):
@@ -248,7 +253,7 @@ static rsRetVal queryEtryPt(uchar *name, rsRetVal (**pEtryPoint)())\
return iRet;\
}
-/* the following defintion is the standard block for queryEtryPt for output
+/* the following definition is the standard block for queryEtryPt for output
* modules. This can be used if no specific handling (e.g. to cover version
* differences) is needed.
*/
@@ -287,19 +292,25 @@ static rsRetVal queryEtryPt(uchar *name, rsRetVal (**pEtryPoint)())\
* decide to provide.
*/
#define BEGINmodInit(uniqName) \
-rsRetVal modInit##uniqName(int iIFVersRequested __attribute__((unused)), int *ipIFVersProvided, rsRetVal (**pQueryEtryPt)())\
+rsRetVal modInit##uniqName(int iIFVersRequested __attribute__((unused)), int *ipIFVersProvided, rsRetVal (**pQueryEtryPt)(), rsRetVal (*pHostQueryEtryPt)(uchar*, rsRetVal (**)()))\
{\
DEFiRet;
#define CODESTARTmodInit \
+ assert(pHostQueryEtryPt != NULL);\
if((pQueryEtryPt == NULL) || (ipIFVersProvided == NULL))\
return RS_RET_PARAM_ERROR;
#define ENDmodInit \
+finalize_it:\
*pQueryEtryPt = queryEtryPt;\
return iRet;\
}
+/* definitions for host API queries */
+#define CODEmodInit_QueryRegCFSLineHdlr \
+ CHKiRet(pHostQueryEtryPt((uchar*)"regCfSysLineHdlr", &omsdRegCFSLineHdlr));
+
#endif /* #ifndef MODULE_TEMPLATE_H_INCLUDED */
/*
* vi:set ai: