diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-20 15:43:55 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-02-20 15:43:55 +0000 |
commit | c2d0c3d4c31164ece386a61ef3326bb40c348fdb (patch) | |
tree | 62086766f894e191ec090fd73003e871b46112f3 /vmop.h | |
parent | 897a6853118de669be90a451a7319a219cde6feb (diff) | |
download | rsyslog-c2d0c3d4c31164ece386a61ef3326bb40c348fdb.tar.gz rsyslog-c2d0c3d4c31164ece386a61ef3326bb40c348fdb.tar.bz2 rsyslog-c2d0c3d4c31164ece386a61ef3326bb40c348fdb.zip |
- added "contains" and "startwith" comparison operations
- defined initial set of opcodes
Diffstat (limited to 'vmop.h')
-rw-r--r-- | vmop.h | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -22,10 +22,33 @@ #ifndef INCLUDED_VMOP_H #define INCLUDED_VMOP_H +#include "ctok_token.h" + /* machine instructions types */ typedef enum { /* do NOT start at 0 to detect uninitialized types after calloc() */ opcode_INVALID = 0, - opcode_PUSH = 1 + /* for simplicity of debugging and reading dumps, we use the same IDs + * that the tokenizer uses where this applicable. + */ + opcode_OR = ctok_OR, + opcode_AND = ctok_AND, + opcode_PLUS = ctok_PLUS, + opcode_MINUS = ctok_MINUS, + opcode_TIMES = ctok_TIMES, /* "*" */ + opcode_DIV = ctok_DIV, + opcode_MOD = ctok_MOD, + opcode_NOT = ctok_NOT, + opcode_CMP_EQ = ctok_CMP_EQ, /* all compare operations must be in a row */ + opcode_CMP_NEQ = ctok_CMP_NEQ, + opcode_CMP_LT = ctok_CMP_LT, + opcode_CMP_GT = ctok_CMP_GT, + opcode_CMP_LTEQ = ctok_CMP_LTEQ, + opcode_CMP_CONTAINS = ctok_CMP_CONTAINS, + opcode_CMP_STARTSWITH = ctok_CMP_STARTSWITH, + opcode_CMP_GTEQ = ctok_CMP_GTEQ, /* end compare operations */ + /* here we start our own codes */ + opcode_PUSH = 1000, /* requires var operand */ + opcode_POP = 1001, /* requires var operand to receive result */ } opcode_t; /* the vmop object */ |