summaryrefslogtreecommitdiffstats
path: root/grammar/rainerscript.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-12-06 17:27:37 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2012-12-06 17:27:37 +0100
commit42d1d27a019f25bf39c1f424cd9fb23560728c58 (patch)
treeebd6f6afb5e41bd8570ca5ca398deef518f60c8c /grammar/rainerscript.c
parent7df68798be96d38fcb17143daa2c3e2b093a8ba5 (diff)
parent27e0f06b17b59e5de7db94ec1d0e74369536373a (diff)
downloadrsyslog-42d1d27a019f25bf39c1f424cd9fb23560728c58.tar.gz
rsyslog-42d1d27a019f25bf39c1f424cd9fb23560728c58.tar.bz2
rsyslog-42d1d27a019f25bf39c1f424cd9fb23560728c58.zip
Merge branch 'v7-stable-newmsglock' into master-newmsglock
Conflicts: runtime/msg.c runtime/queue.c tools/syslogd.c
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)
{