#include "zbxmockassert.h"
#include "zbxexpression.h"
zbx_uint64_t mock_eval_read_rules(const char *path)
zbx_mock_handle_t hrules, hflag;
hrules = zbx_mock_get_parameter_handle(path);
while (ZBX_MOCK_END_OF_VECTOR != (err = (zbx_mock_vector_element(hrules, &hflag))))
if (ZBX_MOCK_SUCCESS != err || ZBX_MOCK_SUCCESS != (err = zbx_mock_string(hflag, &flag)))
fail_msg("Cannot read flag #%d: %s", rules_num, zbx_mock_error_string(err));
if (0 == strcmp(flag, "ZBX_EVAL_PARSE_FUNCTIONID"))
rules |= ZBX_EVAL_PARSE_FUNCTIONID;
else if (0 == strcmp(flag, "ZBX_EVAL_PARSE_FUNCTION"))
rules |= ZBX_EVAL_PARSE_FUNCTION;
else if (0 == strcmp(flag, "ZBX_EVAL_PARSE_ITEM_QUERY"))
rules |= ZBX_EVAL_PARSE_ITEM_QUERY;
else if (0 == strcmp(flag, "ZBX_EVAL_PARSE_MACRO"))
rules |= ZBX_EVAL_PARSE_MACRO;
else if (0 == strcmp(flag, "ZBX_EVAL_PARSE_USERMACRO"))
rules |= ZBX_EVAL_PARSE_USERMACRO;
else if (0 == strcmp(flag, "ZBX_EVAL_PARSE_LLDMACRO"))
rules |= ZBX_EVAL_PARSE_LLDMACRO;
else if (0 == strcmp(flag, "ZBX_EVAL_PARSE_CONST_INDEX"))
rules |= ZBX_EVAL_PARSE_CONST_INDEX;
else if (0 == strcmp(flag, "ZBX_EVAL_PARSE_MATH"))
rules |= ZBX_EVAL_PARSE_MATH;
else if (0 == strcmp(flag, "ZBX_EVAL_PARSE_COMPARE_EQ"))
rules |= ZBX_EVAL_PARSE_COMPARE_EQ;
else if (0 == strcmp(flag, "ZBX_EVAL_PARSE_LOGIC"))
rules |= ZBX_EVAL_PARSE_LOGIC;
else if (0 == strcmp(flag, "ZBX_EVAL_PARSE_VAR_NUM"))
rules |= ZBX_EVAL_PARSE_VAR_NUM;
else if (0 == strcmp(flag, "ZBX_EVAL_PARSE_VAR_STR"))
rules |= ZBX_EVAL_PARSE_VAR_STR;
else if (0 == strcmp(flag, "ZBX_EVAL_PARSE_GROUP"))
rules |= ZBX_EVAL_PARSE_GROUP;
else if (0 == strcmp(flag, "ZBX_EVAL_PARSE_PROP_TAG"))
rules |= ZBX_EVAL_PARSE_PROP_TAG;
else if (0 == strcmp(flag, "ZBX_EVAL_PARSE_PROP_GROUP"))
rules |= ZBX_EVAL_PARSE_PROP_GROUP;
else if (0 == strcmp(flag, "ZBX_EVAL_PARSE_COMPARE"))
rules |= ZBX_EVAL_PARSE_COMPARE;
else if (0 == strcmp(flag, "ZBX_EVAL_PARSE_VAR"))
rules |= ZBX_EVAL_PARSE_VAR;
else if (0 == strcmp(flag, "ZBX_EVAL_PARSE_PROPERTY"))
rules |= ZBX_EVAL_PARSE_PROPERTY;
else if (0 == strcmp(flag, "ZBX_EVAL_COMPOSE_LLD"))
rules |= ZBX_EVAL_COMPOSE_LLD;
else if (0 == strcmp(flag, "ZBX_EVAL_COMPOSE_FUNCTIONID"))
rules |= ZBX_EVAL_COMPOSE_FUNCTIONID;
else if (0 == strcmp(flag, "ZBX_EVAL_PROCESS_ERROR"))
rules |= ZBX_EVAL_PROCESS_ERROR;
else if (0 == strcmp(flag, "ZBX_EVAL_PARSE_COMPOUND_CONST"))
rules |= ZBX_EVAL_PARSE_COMPOUND_CONST;
else if (0 == strcmp(flag, "ZBX_EVAL_PARSE_STR_V64_COMPAT"))
rules |= ZBX_EVAL_PARSE_STR_V64_COMPAT;
fail_msg("Unsupported flag: %s", flag);