diff options
author | Andris Zeila <andris.zeila@zabbix.com> | 2021-01-23 17:49:55 +0300 |
---|---|---|
committer | Andris Zeila <andris.zeila@zabbix.com> | 2021-01-23 17:49:55 +0300 |
commit | 5afa58b768619e2a636aa3b5ca6473a1621aeb2f (patch) | |
tree | 436dfe3e4c165e0a6eb017a316a50086e14d3b3d /include/zbxserver.h | |
parent | b4b45a38efb5caf817104ae263cef64cea3e8967 (diff) |
........S. [ZBXNEXT-6451] added caching of serialized trigger expressions
Diffstat (limited to 'include/zbxserver.h')
-rw-r--r-- | include/zbxserver.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/include/zbxserver.h b/include/zbxserver.h index ea80d304ecf..7864987b092 100644 --- a/include/zbxserver.h +++ b/include/zbxserver.h @@ -158,6 +158,7 @@ int xml_xpath_check(const char *xpath, char *error, size_t errlen); #define ZBX_EVAL_TOKEN_ARG_TIME (28 | ZBX_EVAL_CLASS_OPERAND) #define ZBX_EVAL_TOKEN_ARG_NULL (29 | ZBX_EVAL_CLASS_OPERAND) #define ZBX_EVAL_TOKEN_ARG_RAW (30 | ZBX_EVAL_CLASS_OPERAND) +#define ZBX_EVAL_TOKEN_EXCEPTION (31 | ZBX_EVAL_CLASS_FUNCTION) /* expression parsing rules */ @@ -241,14 +242,20 @@ typedef struct } zbx_eval_context_t; +typedef char *(*zbx_macro_resolve_func_t)(const char *str, size_t length, zbx_uint64_t *hostids, + int hostids_num); + int zbx_eval_parse_expression(zbx_eval_context_t *ctx, const char *expression, zbx_uint64_t rules, char **error); -void zbx_eval_clean(zbx_eval_context_t *ctx); -void zbx_eval_serialize(const zbx_eval_context_t *ctx, zbx_mem_malloc_func_t malloc_func, unsigned char **data); +void zbx_eval_clear(zbx_eval_context_t *ctx); +size_t zbx_eval_serialize(const zbx_eval_context_t *ctx, zbx_mem_malloc_func_t malloc_func, unsigned char **data); void zbx_eval_deserialize(zbx_eval_context_t *ctx, const char *expression, zbx_uint64_t rules, const unsigned char *data); void zbx_eval_compose_expression(const zbx_eval_context_t *ctx, char **expression); int zbx_eval_execute(zbx_eval_context_t *ctx, const zbx_timespec_t *ts, zbx_variant_t *value, char **error); int zbx_eval_execute_ext(zbx_eval_context_t *ctx, const zbx_timespec_t *ts, zbx_eval_function_cb_t function_cb, zbx_variant_t *value, char **error); - +void zbx_eval_get_functionids(const zbx_eval_context_t *ctx, zbx_vector_uint64_t *functionids); +void zbx_eval_expand_user_macros(const zbx_eval_context_t *ctx, zbx_uint64_t *hostids, int hostids_num, + zbx_macro_resolve_func_t resolver_cb); +void zbx_eval_set_exception(zbx_eval_context_t *ctx, char *message); #endif |