int zbx_execute_threaded_metric(zbx_metric_func_t metric_func, AGENT_REQUEST *request, AGENT_RESULT *result);
#define ISSET_UI64(res) ((res)->type & AR_UINT64)
#define ISSET_DBL(res) ((res)->type & AR_DOUBLE)
#define ISSET_STR(res) ((res)->type & AR_STRING)
#define ISSET_TEXT(res) ((res)->type & AR_TEXT)
#define ISSET_LOG(res) ((res)->type & AR_LOG)
#define ISSET_MSG(res) ((res)->type & AR_MESSAGE)
#define ISSET_META(res) ((res)->type & AR_META)
#define ISSET_VALUE(res) ((res)->type & (AR_UINT64 | AR_DOUBLE | AR_STRING | AR_TEXT | AR_LOG))
#define UNSET_UI64_RESULT(res) \
(res)->type &= ~AR_UINT64; \
(res)->ui64 = (zbx_uint64_t)0; \
#define UNSET_DBL_RESULT(res) \
(res)->type &= ~AR_DOUBLE; \
(res)->dbl = (double)0; \
#define UNSET_STR_RESULT(res) \
if ((res)->type & AR_STRING) \
(res)->type &= ~AR_STRING; \
#define UNSET_TEXT_RESULT(res) \
if ((res)->type & AR_TEXT) \
(res)->type &= ~AR_TEXT; \
#define UNSET_LOG_RESULT(res) \
if ((res)->type & AR_LOG) \
zbx_log_free((res)->log); \
(res)->type &= ~AR_LOG; \