summaryrefslogtreecommitdiffstats
path: root/grammar/rainerscript.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-09-04 10:50:07 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-09-04 10:50:07 +0200
commit0bf6991bf6c155ff43c394c284e23dfe6b0fc53f (patch)
treeb1132d38b757ebf146864872a0223f926b61a3f0 /grammar/rainerscript.h
parent07527fbd38dbed4ed1708fe558ad34b1ebf9e48c (diff)
downloadrsyslog-0bf6991bf6c155ff43c394c284e23dfe6b0fc53f.tar.gz
rsyslog-0bf6991bf6c155ff43c394c284e23dfe6b0fc53f.tar.xz
rsyslog-0bf6991bf6c155ff43c394c284e23dfe6b0fc53f.zip
new ruleengine: first code for stmt handling
Diffstat (limited to 'grammar/rainerscript.h')
-rw-r--r--grammar/rainerscript.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/grammar/rainerscript.h b/grammar/rainerscript.h
index 4c625cd8..3238b7fe 100644
--- a/grammar/rainerscript.h
+++ b/grammar/rainerscript.h
@@ -118,7 +118,14 @@ struct cnfactlst {
* R - rule
* S - string
* V - var
+ * ... plus the S_* #define's below:
*/
+#define S_STOP 4000
+#define S_PRIFILT 4001
+#define S_PROPFILT 4002
+#define S_IF 4003
+#define S_ACT 4004
+
enum cnfFiltType { CNFFILT_NONE, CNFFILT_PRI, CNFFILT_PROP, CNFFILT_SCRIPT };
static inline char*
cnfFiltType2str(enum cnfFiltType filttype)
@@ -147,6 +154,19 @@ struct cnfrule {
struct cnfactlst *actlst;
};
+struct cnfstmt { /* base statement, for simple types */
+ unsigned nodetype;
+ struct cnfstmt *next;
+ union {
+ struct {
+ struct cnfexpr *expr;
+ struct cnfstmt *t_then;
+ struct cnfstmt *t_else;
+ } cond;
+ struct action_s *act;
+ } d;
+};
+
struct cnfexpr {
unsigned nodetype;
struct cnfexpr *l;
@@ -273,6 +293,8 @@ void cnfparamsPrint(struct cnfparamblk *params, struct cnfparamvals *vals);
void varDelete(struct var *v);
void cnfparamvalsDestruct(struct cnfparamvals *paramvals, struct cnfparamblk *blk);
void cnfcfsyslinelstDestruct(struct cnfcfsyslinelst *cfslst);
+struct cnfstmt * cnfstmtNew(unsigned s_type);
+void cnfstmtPrint(struct cnfstmt *stmt, int indent);
rsRetVal initRainerscript(void);
/* debug helper */