summaryrefslogtreecommitdiffstats
path: root/grammar/rainerscript.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-10-01 10:29:38 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-10-01 10:29:38 +0200
commitc0ccd3ff253401ce2081a5d2042f50af35b07233 (patch)
tree0c828480a8d8b2fa507edc83e7727d913ee426a1 /grammar/rainerscript.h
parentcdbeb9d75a9a79c1f5941f748af540ab13425cf1 (diff)
downloadrsyslog-c0ccd3ff253401ce2081a5d2042f50af35b07233.tar.gz
rsyslog-c0ccd3ff253401ce2081a5d2042f50af35b07233.tar.xz
rsyslog-c0ccd3ff253401ce2081a5d2042f50af35b07233.zip
implement string arrays for config objects
as a tester, imudp now supports binding to multiple options based on a string array
Diffstat (limited to 'grammar/rainerscript.h')
-rw-r--r--grammar/rainerscript.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/grammar/rainerscript.h b/grammar/rainerscript.h
index 974f2160..314f8434 100644
--- a/grammar/rainerscript.h
+++ b/grammar/rainerscript.h
@@ -74,11 +74,13 @@ enum cnfactType { CNFACT_V2, CNFACT_LEGACY };
struct var {
union {
es_str_t *estr;
- struct cnfexpr *expr;
+ struct cnfarray *ar;
long long n;
struct json_object *json;
} d;
- char datatype; /* 'N' number, 'S' string, 'E' expression, 'J' JSON */
+ char datatype; /* 'N' number, 'S' string, 'J' JSON, 'A' array
+ * Note: 'A' is only supported during config phase
+ */
};
struct cnfobj {
@@ -284,7 +286,9 @@ void readConfFile(FILE *fp, es_str_t **str);
struct objlst* objlstNew(struct cnfobj *obj);
void objlstDestruct(struct objlst *lst);
void objlstPrint(struct objlst *lst);
-struct nvlst* nvlstNew(es_str_t *name, es_str_t *value);
+struct nvlst* nvlstNewArray(struct cnfarray *ar);
+struct nvlst* nvlstNewStr(es_str_t *value);
+struct nvlst* nvlstSetName(struct nvlst *lst, es_str_t *name);
void nvlstDestruct(struct nvlst *lst);
void nvlstPrint(struct nvlst *lst);
void nvlstChkUnused(struct nvlst *lst);
@@ -323,6 +327,7 @@ struct cnfstmt * cnfstmtNewUnset(char *var);
void cnfstmtDestruct(struct cnfstmt *root);
void cnfstmtOptimize(struct cnfstmt *root);
struct cnfarray* cnfarrayNew(es_str_t *val);
+//struct cnfarray* cnfarrayDup(struct cnfarray *old);
struct cnfarray* cnfarrayAdd(struct cnfarray *ar, es_str_t *val);
char* getFIOPName(unsigned iFIOP);
rsRetVal initRainerscript(void);