summaryrefslogtreecommitdiffstats
path: root/grammar/rainerscript.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-08-25 17:17:27 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-08-25 17:17:27 +0200
commit76e9968c0890cb4db068c953db6e6574b6c28da0 (patch)
tree75f9e4be5663a3e2dd877619d4559b05b3859bf3 /grammar/rainerscript.c
parent6258cb42fd407b9388de63c746634b4df03e78eb (diff)
downloadrsyslog-76e9968c0890cb4db068c953db6e6574b6c28da0.tar.gz
rsyslog-76e9968c0890cb4db068c953db6e6574b6c28da0.tar.bz2
rsyslog-76e9968c0890cb4db068c953db6e6574b6c28da0.zip
milestone: LIST-type templates work, but no all options yet present
Diffstat (limited to 'grammar/rainerscript.c')
-rw-r--r--grammar/rainerscript.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c
index 1ccac575..33630a76 100644
--- a/grammar/rainerscript.c
+++ b/grammar/rainerscript.c
@@ -113,6 +113,24 @@ cnfobjPrint(o);
return lst;
}
+/* add object to end of object list, always returns pointer to root object */
+struct objlst*
+objlstAdd(struct objlst *root, struct cnfobj *o)
+{
+ struct objlst *l;
+ struct objlst *newl;
+
+ newl = objlstNew(o);
+ if(root == 0) {
+ root = newl;
+ } else { /* find last, linear search ok, as only during config phase */
+ for(l = root ; l->next != NULL ; l = l->next)
+ ;
+ l->next = newl;
+ }
+ return root;
+}
+
void
objlstDestruct(struct objlst *lst)
{