Source
xxxxxxxxxx
if (ZBX_MOCK_SUCCESS != err || ZBX_MOCK_SUCCESS != (err = zbx_mock_string(hflag, &flag)))
/*
** Zabbix
** Copyright (C) 2001-2024 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
static void get_macros(const char *path, zbx_vector_lld_macro_path_ptr_t *macros)
{
zbx_lld_macro_path_t *macro;
zbx_mock_handle_t hmacros, hmacro;
int macros_num = 1;
zbx_mock_error_t err;
hmacros = zbx_mock_get_parameter_handle(path);
while (ZBX_MOCK_END_OF_VECTOR != (err = (zbx_mock_vector_element(hmacros, &hmacro))))
{
if (ZBX_MOCK_SUCCESS != err)
fail_msg("Cannot read macro #%d: %s", macros_num, zbx_mock_error_string(err));
macro = (zbx_lld_macro_path_t *)zbx_malloc(NULL, sizeof(zbx_lld_macro_path_t));
macro->lld_macro = zbx_strdup(NULL, zbx_mock_get_object_member_string(hmacro, "macro"));
macro->path = zbx_strdup(NULL, zbx_mock_get_object_member_string(hmacro, "path"));
zbx_vector_lld_macro_path_ptr_append(macros, macro);
macros_num++;
}
}
static int get_flags(const char *path)
{
zbx_mock_handle_t hflags, hflag;
int flags_num = 1, flags = 0;
zbx_mock_error_t err;
hflags = zbx_mock_get_parameter_handle(path);
while (ZBX_MOCK_END_OF_VECTOR != (err = (zbx_mock_vector_element(hflags, &hflag))))
{
const char *flag;