diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-04-06 17:55:04 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-04-06 17:55:04 +0200 |
commit | 8e3c5a9ca3732a41fbb8581b13c49acd699820da (patch) | |
tree | f75be0a65a7ab52fd3c35d240d0cc0446d3e883d /runtime/vmop.h | |
parent | 010060289a729dd930ac04b72237f0ca0db9ea1d (diff) | |
download | rsyslog-8e3c5a9ca3732a41fbb8581b13c49acd699820da.tar.gz rsyslog-8e3c5a9ca3732a41fbb8581b13c49acd699820da.tar.xz rsyslog-8e3c5a9ca3732a41fbb8581b13c49acd699820da.zip |
improved internal handling of RainerScript functions
- building the necessary plumbing to support more functions with
decent runtime performance. This is also necessary towards the
long-term goal of loadable library modules.
- added new RainerScript function "tolower"
Diffstat (limited to 'runtime/vmop.h')
-rw-r--r-- | runtime/vmop.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/runtime/vmop.h b/runtime/vmop.h index 938b08fd..67048c26 100644 --- a/runtime/vmop.h +++ b/runtime/vmop.h @@ -26,6 +26,7 @@ #define INCLUDED_VMOP_H #include "ctok_token.h" +#include "vmstk.h" #include "stringbuf.h" /* machine instructions types */ @@ -96,7 +97,8 @@ typedef struct vmop_s { BEGINobjInstance; /* Data to implement generic object - MUST be the first data element! */ opcode_t opcode; union { - var_t *pVar; /* for function call, this is the name (string) of function to be called */ + var_t *pVar; + prsf_t rsf; /* pointer to function for "call" instruction */ } operand; struct vmop_s *pNext; /* next operation or NULL, if end of program (logically this belongs to vmprg) */ } vmop_t; @@ -112,8 +114,13 @@ BEGINinterface(vmop) /* name must also be changed in ENDinterface macro! */ rsRetVal (*SetVar)(vmop_t *pThis, var_t *pVar); rsRetVal (*Opcode2Str)(vmop_t *pThis, uchar **ppName); rsRetVal (*Obj2Str)(vmop_t *pThis, cstr_t *pstr); + /* v2 */ + rsRetVal (*SetFunc)(vmop_t *pThis, cstr_t *pcsFuncName); ENDinterface(vmop) -#define vmopCURR_IF_VERSION 1 /* increment whenever you change the interface structure! */ +#define vmopCURR_IF_VERSION 2 /* increment whenever you change the interface structure! */ +/* interface changes, v1 -> v2 + * added SetFuct after existing function pointers -- rgerhards, 2009-04-06 + */ /* the remaining prototypes */ PROTOTYPEObj(vmop); |