summaryrefslogtreecommitdiffstats
path: root/grammar/rainerscript.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-07-15 15:32:11 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2011-07-15 15:32:11 +0200
commit84ca2c443680de2c7e98f27972fb6300a025d62d (patch)
treec053b6cfbfc1655be8b4c62b9cc3143aebfa5169 /grammar/rainerscript.h
parente579791a78267353566c79c83043805a54d85b74 (diff)
downloadrsyslog-84ca2c443680de2c7e98f27972fb6300a025d62d.tar.gz
rsyslog-84ca2c443680de2c7e98f27972fb6300a025d62d.tar.xz
rsyslog-84ca2c443680de2c7e98f27972fb6300a025d62d.zip
better check for config errors
Diffstat (limited to 'grammar/rainerscript.h')
-rw-r--r--grammar/rainerscript.h35
1 files changed, 18 insertions, 17 deletions
diff --git a/grammar/rainerscript.h b/grammar/rainerscript.h
index 3129ed25..2c4d764f 100644
--- a/grammar/rainerscript.h
+++ b/grammar/rainerscript.h
@@ -40,6 +40,22 @@ cnfobjType2str(enum cnfobjType ot)
enum cnfactType { CNFACT_V2, CNFACT_LEGACY };
+/* a variant type, for example used for expression evaluation
+ * 2011-07-15/rger: note that there exists a "legacy" object var_t,
+ * which implements the same idea, but in a suboptimal manner. I have
+ * stipped this down as much as possible, but will keep it for a while
+ * to avoid unnecessary complexity during development. TODO: in the long
+ * term, var_t shall be replaced by struct var.
+ */
+struct var {
+ union {
+ es_str_t *estr;
+ struct cnfexpr *expr;
+ long long n;
+ } d;
+ char datatype; /* 'N' number, 'S' string, 'E' expression */
+};
+
struct cnfobj {
enum cnfobjType objType;
struct nvlst *nvlst;
@@ -48,7 +64,7 @@ struct cnfobj {
struct nvlst {
struct nvlst *next;
es_str_t *name;
- es_str_t *value;
+ struct var val;
};
struct cnfcfsyslinelst {
@@ -156,27 +172,12 @@ struct x {
};
*/
-/* a variant type, for example used for expression evaluation
- * 2011-07-15/rger: note that there exists a "legacy" object var_t,
- * which implements the same idea, but in a suboptimal manner. I have
- * stipped this down as much as possible, but will keep it for a while
- * to avoid unnecessary complexity during development. TODO: in the long
- * term, var_t shall be replaced by struct var.
- */
-struct var {
- union {
- es_str_t *estr;
- long long n;
- } d;
- char datatype; /* 'N' - number, 'S' - string */
-};
-
-
int cnfParseBuffer(char *buf, unsigned lenBuf);
void readConfFile(FILE *fp, es_str_t **str);
struct nvlst* nvlstNew(es_str_t *name, es_str_t *value);
void nvlstDestruct(struct nvlst *lst);
void nvlstPrint(struct nvlst *lst);
+struct nvlst* nvlstFindName(struct nvlst *lst, es_str_t *name);
struct cnfobj* cnfobjNew(enum cnfobjType objType, struct nvlst *lst);
void cnfobjDestruct(struct cnfobj *o);
void cnfobjPrint(struct cnfobj *o);