diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-08-25 13:30:53 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-08-25 13:30:53 +0200 |
commit | 6258cb42fd407b9388de63c746634b4df03e78eb (patch) | |
tree | 258f407772a4457dcaf9aaea4388bd5ef5576164 /grammar/rainerscript.c | |
parent | 27a0078958d808a323c945b58b77ee96ee690444 (diff) | |
download | rsyslog-6258cb42fd407b9388de63c746634b4df03e78eb.tar.gz rsyslog-6258cb42fd407b9388de63c746634b4df03e78eb.tar.xz rsyslog-6258cb42fd407b9388de63c746634b4df03e78eb.zip |
milestone: base plumbing for LIST-type templates mostly in place
Diffstat (limited to 'grammar/rainerscript.c')
-rw-r--r-- | grammar/rainerscript.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c index 3bfb2e07..1ccac575 100644 --- a/grammar/rainerscript.c +++ b/grammar/rainerscript.c @@ -98,6 +98,44 @@ readConfFile(FILE *fp, es_str_t **str) es_addChar(str, '\0'); } +struct objlst* +objlstNew(struct cnfobj *o) +{ + struct objlst *lst; + + if((lst = malloc(sizeof(struct objlst))) != NULL) { + lst->next = NULL; + lst->obj = o; + } +dbgprintf("AAAA: creating new objlst\n"); +cnfobjPrint(o); + + return lst; +} + +void +objlstDestruct(struct objlst *lst) +{ + struct objlst *toDel; + + while(lst != NULL) { + toDel = lst; + lst = lst->next; + // TODO: delete object + free(toDel); + } +} + +void +objlstPrint(struct objlst *lst) +{ + dbgprintf("objlst %p:\n", lst); + while(lst != NULL) { + cnfobjPrint(lst->obj); + lst = lst->next; + } +} + struct nvlst* nvlstNew(es_str_t *name, es_str_t *value) { @@ -581,6 +619,7 @@ cnfobjNew(enum cnfobjType objType, struct nvlst *lst) nvlstChkDupes(lst); o->objType = objType; o->nvlst = lst; + o->subobjs = NULL; } return o; |