diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-25 15:23:57 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-25 15:23:57 +0000 |
commit | 50ddd3fd7de672a2fa2df67adb27401cc38ce38c (patch) | |
tree | e509dc31fce2c6edb230147ee547b3967bc636c2 /vm.c | |
parent | c9fc3fc06d2566aa6aed977af66392dce97d1264 (diff) | |
download | rsyslog-50ddd3fd7de672a2fa2df67adb27401cc38ce38c.tar.gz rsyslog-50ddd3fd7de672a2fa2df67adb27401cc38ce38c.tar.xz rsyslog-50ddd3fd7de672a2fa2df67adb27401cc38ce38c.zip |
added string concatenation operator & to RainerScript
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -205,6 +205,21 @@ ENDop(CMP_CONTAINS) /* end comare operations that work on strings, only */ +BEGINop(STRADD) /* remember to set the instruction also in the ENDop macro! */ + var_t *operand1; + var_t *operand2; +CODESTARTop(STRADD) + vmstk.PopString(pThis->pStk, &operand2); + vmstk.PopString(pThis->pStk, &operand1); + + CHKiRet(rsCStrAppendCStr(operand1->val.pStr, operand2->val.pStr)); + + /* we have a result, so let's push it */ + vmstk.Push(pThis->pStk, operand1); + var.Destruct(&operand2); /* no longer needed */ +finalize_it: +ENDop(STRADD) + BEGINop(NOT) /* remember to set the instruction also in the ENDop macro! */ var_t *operand; CODESTARTop(NOT) @@ -332,6 +347,7 @@ execProg(vm_t *pThis, vmprg_t *pProg) doOP(PUSHCONSTANT); doOP(PUSHMSGVAR); doOP(PUSHSYSVAR); + doOP(STRADD); doOP(PLUS); doOP(MINUS); doOP(TIMES); |