summaryrefslogtreecommitdiffstats
path: root/module-template.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-07-26 09:31:50 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-07-26 09:31:50 +0000
commit1b1229cd1e76ee43b8fb75466dd80a2c72b54136 (patch)
tree3af783f24c4ad2272ba06656d8b02d7a0fa9f124 /module-template.h
parentb0f7302011f1bcc298c7a78ed3bb3f500893e70a (diff)
downloadrsyslog-1b1229cd1e76ee43b8fb75466dd80a2c72b54136.tar.gz
rsyslog-1b1229cd1e76ee43b8fb75466dd80a2c72b54136.tar.xz
rsyslog-1b1229cd1e76ee43b8fb75466dd80a2c72b54136.zip
- changed doAction() interface to include module data pointer
- removed references to f_un from omusrmsg.c - changed module template for parseSelectorAct() [code reduction, consitency]
Diffstat (limited to 'module-template.h')
-rw-r--r--module-template.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/module-template.h b/module-template.h
index 200a48c0..55b8f821 100644
--- a/module-template.h
+++ b/module-template.h
@@ -89,7 +89,7 @@ static rsRetVal isCompatibleWithFeature(syslogFeature __attribute__((unused)) eF
/* doAction()
*/
#define BEGINdoAction \
-static rsRetVal doAction(selector_t *f)\
+static rsRetVal doAction(selector_t *f, instanceData __attribute__((unused)) *pData)\
{\
rsRetVal iRet = RS_RET_OK;
@@ -175,14 +175,20 @@ static rsRetVal getWriteFDForSelect(selector_t *f, void *pModData, short *fd)\
static rsRetVal parseSelectorAct(uchar **pp, selector_t *f, void **ppModData)\
{\
rsRetVal iRet = RS_RET_OK;\
- instanceData *pModData = NULL;
+ uchar *p;\
+ instanceData *pData = NULL;
#define CODESTARTparseSelectorAct \
assert(pp != NULL);\
assert(ppModData != NULL);\
- assert(f != NULL);
+ assert(f != NULL);\
+ p = *pp;
#define ENDparseSelectorAct \
+ if(iRet == RS_RET_OK) {\
+ *ppModData = pData;\
+ *pp = p;\
+ }\
return iRet;\
}