diff options
author | Costa Tsaousis <costa@tsaousis.gr> | 2016-08-10 02:33:07 +0300 |
---|---|---|
committer | Costa Tsaousis <costa@tsaousis.gr> | 2016-08-10 02:33:07 +0300 |
commit | cd39ffd3753f705d3edc290df0f2856df9f581f7 (patch) | |
tree | 5b659b926ab82af9b686efb2e26c3efd29e100c7 /src/eval.h | |
parent | 308c6c24b914e0f22486e4c123a8089564a47d00 (diff) |
added RRDCALC management; preparation for expression evaluation
Diffstat (limited to 'src/eval.h')
-rw-r--r-- | src/eval.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/eval.h b/src/eval.h new file mode 100644 index 0000000000..da3be13097 --- /dev/null +++ b/src/eval.h @@ -0,0 +1,38 @@ +#ifndef NETDATA_EVAL_H +#define NETDATA_EVAL_H + +typedef struct variable { + char *name; + struct rrdvar *rrdvar; + struct variable *next; +} VARIABLE; + +#define EVAL_OPERAND_INVALID 0 +#define EVAL_OPERAND_NUMBER 1 +#define EVAL_OPERAND_VARIABLE 2 +#define EVAL_OPERAND_EXPRESSION 3 + +// these are used for EVAL_OPERAND.operator +#define EVAL_OPERATOR_NOP '\0' +#define EVAL_OPERATOR_NOT '!' +#define EVAL_OPERATOR_PLUS '+' +#define EVAL_OPERATOR_MINUS '-' + +typedef struct eval_value { + int type; + + union { + calculated_number number; + VARIABLE *variable; + struct eval_operand *expression; + }; +} EVAL_VALUE; + +typedef struct eval_operand { + char operator; + + int count; + EVAL_VALUE ops[]; +} EVAL_OPERAND; + +#endif //NETDATA_EVAL_H |