summaryrefslogtreecommitdiffstats
path: root/runtime/module-template.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-06-21 16:19:20 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-06-21 16:19:20 +0200
commit4b150db338ae885ea3a3bb7cc5b5f84e2fc96e89 (patch)
treea36f82c93b7391c4f98417f420e78949651cb562 /runtime/module-template.h
parent46ccc9e77f5e2ee3ded1ca79e973fafdc37e4c0f (diff)
downloadrsyslog-4b150db338ae885ea3a3bb7cc5b5f84e2fc96e89.tar.gz
rsyslog-4b150db338ae885ea3a3bb7cc5b5f84e2fc96e89.tar.xz
rsyslog-4b150db338ae885ea3a3bb7cc5b5f84e2fc96e89.zip
milestone: module() config statement basically works
some nits to iron out, only omfile actually support module params
Diffstat (limited to 'runtime/module-template.h')
-rw-r--r--runtime/module-template.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/runtime/module-template.h b/runtime/module-template.h
index 75bf7312..5d32b909 100644
--- a/runtime/module-template.h
+++ b/runtime/module-template.h
@@ -4,7 +4,7 @@
*
* File begun on 2007-07-25 by RGerhards
*
- * Copyright 2007 Adiscon GmbH. This is Adiscon-exclusive code without any other
+ * Copyright 2007-2012 Adiscon GmbH. This is Adiscon-exclusive code without any other
* contributions. *** GPLv3 ***
*
* This file is part of the rsyslog runtime library.
@@ -503,6 +503,14 @@ static rsRetVal queryEtryPt(uchar *name, rsRetVal (**pEtryPoint)())\
} \
CODEqueryEtryPt_STD_CONF2_CNFNAME_QUERIES
+/* the following block is to be added for modules that support v2
+ * module global parameters [module(...)]
+ */
+#define CODEqueryEtryPt_STD_CONF2_setModCnf_QUERIES \
+ else if(!strcmp((char*) name, "setModCnf")) {\
+ *pEtryPoint = setModCnf;\
+ } \
+
/* the following block is to be added for output modules that support the v2
* config system. The config name is also provided.
*/
@@ -693,6 +701,28 @@ static rsRetVal beginCnfLoad(modConfData_t **ptr, __attribute__((unused)) rsconf
}
+/* setModCnf()
+ * This function permits to set module global parameters via the v2 config
+ * interface. It may be called multiple times, but parameters must not be
+ * set in a conflicting way. The module must use its current config load
+ * context when processing the directives.
+ * Note that lst may be NULL, especially if the module is loaded via the
+ * legacy config system. The module must check for this.
+ * NOTE: This entry point must only be implemented if module global
+ * parameters are actually required.
+ */
+#define BEGINsetModCnf \
+static rsRetVal setModCnf(struct nvlst *lst)\
+{\
+ DEFiRet;
+
+#define CODESTARTsetModCnf
+
+#define ENDsetModCnf \
+ RETiRet;\
+}
+
+
/* endCnfLoad()
* This is a function tells an input module that the current config load ended.
* It gets a last chance to make changes to its in-memory config object. After