summaryrefslogtreecommitdiffstats
path: root/conf.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-25 13:27:10 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-25 13:27:10 +0000
commit5ebc0db1a6d4c75ce9c26449ef2a2e3d7b340e10 (patch)
treed9f34f80e487d70da9c764f7c050086eceaff5bf /conf.c
parenta24cee11b718603fbc681e4a7a23f50c8d785ad7 (diff)
downloadrsyslog-5ebc0db1a6d4c75ce9c26449ef2a2e3d7b340e10.tar.gz
rsyslog-5ebc0db1a6d4c75ce9c26449ef2a2e3d7b340e10.tar.xz
rsyslog-5ebc0db1a6d4c75ce9c26449ef2a2e3d7b340e10.zip
- added PUSHMSGVAR operation
- included expression support in filter module (and it works ;))
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/conf.c b/conf.c
index a537d18a..d2d1fbcf 100644
--- a/conf.c
+++ b/conf.c
@@ -59,6 +59,7 @@ DEFobjCurrIf(expr)
DEFobjCurrIf(ctok)
#include "vm.h"
DEFobjCurrIf(vm) // TODO: remove, testing aid! rgerhards, 2008-02-25
+DEFobjCurrIf(var) // TODO: remove, testing aid! rgerhards, 2008-02-25
uchar *pModDir = NULL; /* read-only after startup */
@@ -792,6 +793,12 @@ dbgprintf("calling expression parser, pp %p ('%s')\n", *pline, *pline);
CHKiRet(ctok.Getpp(tok, pline));
CHKiRet(ctok.Destruct(&tok));
+ /* we now need to skip whitespace to the action part, else we confuse
+ * the legacy rsyslog conf parser. -- rgerhards, 2008-02-25
+ */
+ while(isspace(**pline))
+ ++(*pline);
+
dbgprintf("expression parser successfully ended, pp %p ('%s')\n", *pline, *pline);
/* debug aid, try to exec - just now for testing the vm... -- rgerhards, 2008-02-25 */
@@ -801,8 +808,9 @@ CHKiRet(vm.Construct(&pVM));
CHKiRet(vm.ConstructFinalize(pVM));
CHKiRet(vm.ExecProg(pVM, f->f_filterData.f_expr->pVmprg));
-CHKiRet(vm.PopBoolFromStack(pVM, &pResult));
-dbgprintf("result of expression run: %lld\n", pResult->val.num);
+CHKiRet(vm.PopVarFromStack(pVM, &pResult));
+dbgprintf("result of expression run:\n");
+var.DebugPrint(pResult);
CHKiRet(vm.Destruct(&pVM));
/* ...end testing aid... */
@@ -1191,6 +1199,7 @@ rsRetVal confClassInit(void)
CHKiRet(objUse(expr));
CHKiRet(objUse(ctok));
CHKiRet(objUse(vm)); // TODO: remove, testing aid! rgerhards, 2008-02-25
+ CHKiRet(objUse(var)); // TODO: remove, testing aid! rgerhards, 2008-02-25
finalize_it:
RETiRet;