diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-28 14:45:34 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2012-09-28 14:45:34 +0200 |
commit | 04c0124eb7dee70be4abeeba5e10d363154c8b40 (patch) | |
tree | cf2939f86281d3bbfa86716ba85d70eada1da5fd /grammar/rainerscript.h | |
parent | 38cdf1abaddea47aa5e9d11d97fade6a2455b632 (diff) | |
download | rsyslog-04c0124eb7dee70be4abeeba5e10d363154c8b40.tar.gz rsyslog-04c0124eb7dee70be4abeeba5e10d363154c8b40.tar.xz rsyslog-04c0124eb7dee70be4abeeba5e10d363154c8b40.zip |
rainerscript: add basic plumbing for arrays
can be used in expressions, but always evaluate to the first
element, only
Diffstat (limited to 'grammar/rainerscript.h')
-rw-r--r-- | grammar/rainerscript.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/grammar/rainerscript.h b/grammar/rainerscript.h index 6bd1660a..974f2160 100644 --- a/grammar/rainerscript.h +++ b/grammar/rainerscript.h @@ -116,6 +116,7 @@ struct nvlst { * V - var * ... plus the S_* #define's below: */ +#define S_ARRAY 3000 #define S_STOP 4000 #define S_PRIFILT 4001 #define S_PROPFILT 4002 @@ -200,6 +201,12 @@ struct cnfvar { char *name; }; +struct cnfarray { + unsigned nodetype; + int nmemb; + es_str_t **arr; +}; + struct cnffparamlst { unsigned nodetype; /* P */ struct cnffparamlst *next; @@ -315,6 +322,8 @@ struct cnfstmt * cnfstmtNewSet(char *var, struct cnfexpr *expr); struct cnfstmt * cnfstmtNewUnset(char *var); void cnfstmtDestruct(struct cnfstmt *root); void cnfstmtOptimize(struct cnfstmt *root); +struct cnfarray* cnfarrayNew(es_str_t *val); +struct cnfarray* cnfarrayAdd(struct cnfarray *ar, es_str_t *val); char* getFIOPName(unsigned iFIOP); rsRetVal initRainerscript(void); void unescapeStr(uchar *s, int len); |