diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2010-07-21 18:08:19 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2010-07-21 18:08:19 +0200 |
commit | e64cd212432c2cf76245888499461e9c8bf73243 (patch) | |
tree | 2356138e72aac9469804fafdb743740504354f3c /runtime/cfsysline.c | |
parent | 490518ae18290b546510fb4bd112e01f23002d5f (diff) | |
download | rsyslog-e64cd212432c2cf76245888499461e9c8bf73243.tar.gz rsyslog-e64cd212432c2cf76245888499461e9c8bf73243.tar.bz2 rsyslog-e64cd212432c2cf76245888499461e9c8bf73243.zip |
moving towards scoping inside rsyslog.conf
first step: adding object-type specifier to config statement table
Diffstat (limited to 'runtime/cfsysline.c')
-rw-r--r-- | runtime/cfsysline.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/runtime/cfsysline.c b/runtime/cfsysline.c index 5df8e64c..041b5b28 100644 --- a/runtime/cfsysline.c +++ b/runtime/cfsysline.c @@ -655,11 +655,13 @@ static int cslchKeyCompare(void *pKey1, void *pKey2) /* set data members for this object */ -rsRetVal cslchSetEntry(cslCmdHdlr_t *pThis, ecslCmdHdrlType eType, rsRetVal (*pHdlr)(), void *pData) +rsRetVal cslchSetEntry(cslCmdHdlr_t *pThis, ecslCmdHdrlType eType, rsRetVal (*pHdlr)(), + void *pData, ecslConfObjType eConfObjType) { assert(pThis != NULL); assert(eType != eCmdHdlrInvalid); + pThis->eConfObjType = eConfObjType; pThis->eType = eType; pThis->cslCmdHdlr = pHdlr; pThis->pData = pData; @@ -776,7 +778,8 @@ finalize_it: /* add a handler entry to a known command */ -static rsRetVal cslcAddHdlr(cslCmd_t *pThis, ecslCmdHdrlType eType, rsRetVal (*pHdlr)(), void *pData, void *pOwnerCookie) +static rsRetVal cslcAddHdlr(cslCmd_t *pThis, ecslCmdHdrlType eType, rsRetVal (*pHdlr)(), void *pData, + void *pOwnerCookie, ecslConfObjType eConfObjType) { DEFiRet; cslCmdHdlr_t *pCmdHdlr = NULL; @@ -784,7 +787,7 @@ static rsRetVal cslcAddHdlr(cslCmd_t *pThis, ecslCmdHdrlType eType, rsRetVal (*p assert(pThis != NULL); CHKiRet(cslchConstruct(&pCmdHdlr)); - CHKiRet(cslchSetEntry(pCmdHdlr, eType, pHdlr, pData)); + CHKiRet(cslchSetEntry(pCmdHdlr, eType, pHdlr, pData, eConfObjType)); CHKiRet(llAppend(&pThis->llCmdHdlrs, pOwnerCookie, pCmdHdlr)); finalize_it: @@ -804,7 +807,7 @@ finalize_it: * free pCmdName if he allocated it dynamically! -- rgerhards, 2007-08-09 */ rsRetVal regCfSysLineHdlr(uchar *pCmdName, int bChainingPermitted, ecslCmdHdrlType eType, rsRetVal (*pHdlr)(), void *pData, - void *pOwnerCookie) + void *pOwnerCookie, ecslConfObjType eConfObjType) { DEFiRet; cslCmd_t *pThis; @@ -814,7 +817,7 @@ rsRetVal regCfSysLineHdlr(uchar *pCmdName, int bChainingPermitted, ecslCmdHdrlTy if(iRet == RS_RET_NOT_FOUND) { /* new command */ CHKiRet(cslcConstruct(&pThis, bChainingPermitted)); - CHKiRet_Hdlr(cslcAddHdlr(pThis, eType, pHdlr, pData, pOwnerCookie)) { + CHKiRet_Hdlr(cslcAddHdlr(pThis, eType, pHdlr, pData, pOwnerCookie, eConfObjType)) { cslcDestruct(pThis); FINALIZE; } @@ -834,7 +837,7 @@ rsRetVal regCfSysLineHdlr(uchar *pCmdName, int bChainingPermitted, ecslCmdHdrlTy if(pThis->bChainingPermitted == 0 || bChainingPermitted == 0) { ABORT_FINALIZE(RS_RET_CHAIN_NOT_PERMITTED); } - CHKiRet_Hdlr(cslcAddHdlr(pThis, eType, pHdlr, pData, pOwnerCookie)) { + CHKiRet_Hdlr(cslcAddHdlr(pThis, eType, pHdlr, pData, pOwnerCookie, eConfObjType)) { cslcDestruct(pThis); FINALIZE; } |