index 915c949bae429cf2bb024e6dd3b40f4425973c19..fe456f231ee1ecfdf3ff37b4fbb7b58772a2a39e 100644 (file)
****************************************************************************
* rrd_rpncalc.h RPN calculator functions
****************************************************************************/
****************************************************************************
* rrd_rpncalc.h RPN calculator functions
****************************************************************************/
+#ifndef _RRD_RPNCALC_H
+#define _RRD_RPNCALC_H
-/* WARNING: if new operators are added, they MUST be added after OP_END.
+/* WARNING: if new operators are added, they MUST be added at the very end of the list.
* This is because COMPUTE (CDEF) DS store OP nodes by number (name is not
* an option due to limited par array size). OP nodes must have the same
* numeric values, otherwise the stored numbers will mean something different. */
* This is because COMPUTE (CDEF) DS store OP nodes by number (name is not
* an option due to limited par array size). OP nodes must have the same
* numeric values, otherwise the stored numbers will mean something different. */
-enum op_en {OP_NUMBER=0,OP_VARIABLE,OP_INF,OP_PREV,OP_PREV_OTHER,OP_NEGINF,
+enum op_en {OP_NUMBER=0,OP_VARIABLE,OP_INF,OP_PREV,OP_NEGINF,
OP_UNKN,OP_NOW,OP_TIME,OP_ADD,OP_MOD,OP_SUB,OP_MUL,
OP_DIV,OP_SIN, OP_DUP, OP_EXC, OP_POP,
OP_COS,OP_LOG,OP_EXP,OP_LT,OP_LE,OP_GT,OP_GE,OP_EQ,OP_IF,
OP_MIN,OP_MAX,OP_LIMIT, OP_FLOOR, OP_CEIL,
OP_UNKN,OP_NOW,OP_TIME,OP_ADD,OP_MOD,OP_SUB,OP_MUL,
OP_DIV,OP_SIN, OP_DUP, OP_EXC, OP_POP,
OP_COS,OP_LOG,OP_EXP,OP_LT,OP_LE,OP_GT,OP_GE,OP_EQ,OP_IF,
OP_MIN,OP_MAX,OP_LIMIT, OP_FLOOR, OP_CEIL,
- OP_UN,OP_END,OP_LTIME,OP_NE,OP_ISINF};
+ OP_UN,OP_END,OP_LTIME,OP_NE,OP_ISINF,OP_PREV_OTHER,OP_COUNT,OP_ATAN};
typedef struct rpnp_t {
enum op_en op;
typedef struct rpnp_t {
enum op_en op;
void rpn_compact2str(rpn_cdefds_t *rpnc,ds_def_t *ds_def,char **str);
rpnp_t * rpn_parse(void *key_hash,char *expr, long (*lookup)(void *,char *));
short rpn_calc(rpnp_t *rpnp, rpnstack_t *rpnstack, long data_idx, rrd_value_t *output, int output_idx);
void rpn_compact2str(rpn_cdefds_t *rpnc,ds_def_t *ds_def,char **str);
rpnp_t * rpn_parse(void *key_hash,char *expr, long (*lookup)(void *,char *));
short rpn_calc(rpnp_t *rpnp, rpnstack_t *rpnstack, long data_idx, rrd_value_t *output, int output_idx);
+
+#endif