summaryrefslogtreecommitdiffstats
path: root/runtime/module-template.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-06-29 15:40:40 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-06-29 15:40:40 +0200
commit40334847b685e6058be562b4436f72426637f4d8 (patch)
treeb312baf018722872c5116e40b3aec891e513f0ca /runtime/module-template.h
parent7e7ee674bed138a19e8b7bdf962e1df5ae28128b (diff)
parent5a993ad7425bce33380ff10308f2ae93dadf8dae (diff)
downloadrsyslog-40334847b685e6058be562b4436f72426637f4d8.tar.gz
rsyslog-40334847b685e6058be562b4436f72426637f4d8.tar.bz2
rsyslog-40334847b685e6058be562b4436f72426637f4d8.zip
Merge branch 'master-module'
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