summaryrefslogtreecommitdiffstats
path: root/grammar/rainerscript.h
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-10-01 17:48:36 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-10-01 17:48:36 +0200
commit873e806df047de8ac59a90d850698d7b7c80e58f (patch)
treecccc23109028290c77d7752ddfb11df7f1ce4539 /grammar/rainerscript.h
parent819c8167414a5056fb6a87b4b38ce656c78d5897 (diff)
downloadrsyslog-873e806df047de8ac59a90d850698d7b7c80e58f.tar.gz
rsyslog-873e806df047de8ac59a90d850698d7b7c80e58f.tar.xz
rsyslog-873e806df047de8ac59a90d850698d7b7c80e58f.zip
implement RainerScript "call" statement
Diffstat (limited to 'grammar/rainerscript.h')
-rw-r--r--grammar/rainerscript.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/grammar/rainerscript.h b/grammar/rainerscript.h
index 7d4961ab..8ff0d702 100644
--- a/grammar/rainerscript.h
+++ b/grammar/rainerscript.h
@@ -5,9 +5,6 @@
#include <typedefs.h>
#include <sys/types.h>
#include <regex.h>
-//#include "stringbuf.h"
-
-/* TODO: make this hack cleaner... we have circular definitions, so we need: */
#define LOG_NFACILITIES 24 /* current number of syslog facilities */
@@ -127,6 +124,7 @@ struct nvlst {
#define S_NOP 4005 /* usually used to disable some statement */
#define S_SET 4006
#define S_UNSET 4007
+#define S_CALL 4008
enum cnfFiltType { CNFFILT_NONE, CNFFILT_PRI, CNFFILT_PROP, CNFFILT_SCRIPT };
static inline char*
@@ -164,6 +162,10 @@ struct cnfstmt {
uchar *varname;
} s_unset;
struct {
+ es_str_t *name;
+ struct cnfstmt *stmt;
+ } s_call;
+ struct {
uchar pmask[LOG_NFACILITIES+1]; /* priority mask */
struct cnfstmt *t_then;
struct cnfstmt *t_else;
@@ -324,6 +326,7 @@ struct cnfstmt * cnfstmtNewAct(struct nvlst *lst);
struct cnfstmt * cnfstmtNewLegaAct(char *actline);
struct cnfstmt * cnfstmtNewSet(char *var, struct cnfexpr *expr);
struct cnfstmt * cnfstmtNewUnset(char *var);
+struct cnfstmt * cnfstmtNewCall(es_str_t *name);
void cnfstmtDestruct(struct cnfstmt *root);
void cnfstmtOptimize(struct cnfstmt *root);
struct cnfarray* cnfarrayNew(es_str_t *val);