summaryrefslogtreecommitdiffstats
path: root/grammar/rainerscript.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-11-30 17:09:28 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2012-11-30 17:09:28 +0100
commit62f6a7d7b4b3c9fee0fffea961a201d24a059b2c (patch)
tree50dedb5ef56879fd3aa1c83f487cc60c302c7b70 /grammar/rainerscript.c
parent7182c6def360378038c9dc824b7cdf8f3d73a73f (diff)
downloadrsyslog-62f6a7d7b4b3c9fee0fffea961a201d24a059b2c.tar.gz
rsyslog-62f6a7d7b4b3c9fee0fffea961a201d24a059b2c.tar.bz2
rsyslog-62f6a7d7b4b3c9fee0fffea961a201d24a059b2c.zip
fix missing functionality: ruleset(){} could not specify ruleset queue
The "queue.xxx" parameter set was not supported, and legacy ruleset config statements did not work (by intention). The fix introduces the "queue.xxx" parameter set. It has some regression potential, but only for the new functionality. Note that using that interface it is possible to specify duplicate queue file names, which will cause trouble. This will be solved in v7.3, because there is a too-large regression potential for the v7.2 stable branch.
Diffstat (limited to 'grammar/rainerscript.c')
-rw-r--r--grammar/rainerscript.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c
index f7f09697..6b21bc9a 100644
--- a/grammar/rainerscript.c
+++ b/grammar/rainerscript.c
@@ -802,6 +802,30 @@ nvlstGetParams(struct nvlst *lst, struct cnfparamblk *params,
}
+/* check if at least one cnfparamval is actually set
+ * returns 1 if so, 0 otherwise
+ */
+int
+cnfparamvalsIsSet(struct cnfparamblk *params, struct cnfparamvals *vals)
+{
+ int i;
+
+ if(vals == NULL)
+ return 0;
+ if(params->version != CNFPARAMBLK_VERSION) {
+ dbgprintf("nvlstGetParams: invalid param block version "
+ "%d, expected %d\n",
+ params->version, CNFPARAMBLK_VERSION);
+ return 0;
+ }
+ for(i = 0 ; i < params->nParams ; ++i) {
+ if(vals[i].bUsed)
+ return 1;
+ }
+ return 0;
+}
+
+
void
cnfparamsPrint(struct cnfparamblk *params, struct cnfparamvals *vals)
{