summaryrefslogtreecommitdiffstats
path: root/module-template.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-03-04 10:27:45 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-03-04 10:27:45 +0000
commitbc7d8ccebb0a9e7726a9c85cb10746d7407c28d8 (patch)
treed27718278d91f1de5170a97ce2dd30b69532da37 /module-template.h
parentcb71628f67e12081db2449eff83667e2a832f495 (diff)
downloadrsyslog-bc7d8ccebb0a9e7726a9c85cb10746d7407c28d8.tar.gz
rsyslog-bc7d8ccebb0a9e7726a9c85cb10746d7407c28d8.tar.xz
rsyslog-bc7d8ccebb0a9e7726a9c85cb10746d7407c28d8.zip
- changed module interface to support querying obj interface (stage work)
- changed module interface version, as the interface change is quite large
Diffstat (limited to 'module-template.h')
-rw-r--r--module-template.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/module-template.h b/module-template.h
index efa07be9..458a837c 100644
--- a/module-template.h
+++ b/module-template.h
@@ -33,7 +33,9 @@
/* macro to define standard output-module static data members
*/
#define DEF_MOD_STATIC_DATA \
+ DEFobjCurrIf(obj) \
static rsRetVal (*omsdRegCFSLineHdlr)();
+
#define DEF_OMOD_STATIC_DATA \
DEF_MOD_STATIC_DATA
#define DEF_IMOD_STATIC_DATA \
@@ -374,14 +376,18 @@ static rsRetVal queryEtryPt(uchar *name, rsRetVal (**pEtryPoint)())\
#define BEGINmodInit(uniqName) \
rsRetVal modInit##uniqName(int iIFVersRequested __attribute__((unused)), int *ipIFVersProvided, rsRetVal (**pQueryEtryPt)(), rsRetVal (*pHostQueryEtryPt)(uchar*, rsRetVal (**)()))\
{\
- DEFiRet;
+ DEFiRet; \
+ rsRetVal (*pObjGetObjInterface)(obj_if_t *pIf);
#define CODESTARTmodInit \
assert(pHostQueryEtryPt != NULL);\
- if((pQueryEtryPt == NULL) || (ipIFVersProvided == NULL)) {\
+ iRet = pHostQueryEtryPt((uchar*)"objGetObjInterface", &pObjGetObjInterface); \
+ if((iRet != RS_RET_OK) || (pQueryEtryPt == NULL) || (ipIFVersProvided == NULL) || (pObjGetObjInterface == NULL)) { \
ENDfunc \
- return RS_RET_PARAM_ERROR; \
- }
+ return (iRet == RS_RET_OK) ? RS_RET_PARAM_ERROR : iRet; \
+ } \
+ /* now get the obj interface so that we can access other objects */ \
+ CHKiRet(pObjGetObjInterface(&obj));
#define ENDmodInit \
finalize_it:\