Source
/*
** Zabbix
** Copyright (C) 2001-2023 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.
**/
/* mock field to estimate how much data can be stored in characters, bytes or both, */
/* depending on database backend */
typedef struct
{
int bytes_num;
int chars_num;
}
zbx_db_mock_field_t;
ZBX_PTR_VECTOR_IMPL(pp_result_ptr, zbx_pp_result_t *)
/******************************************************************************
* *
* Purpose: set result value *
* *
* Parameters: result - [OUT] result to set *
* value - [IN] field type in database schema *
* action - [IN] on fail action *
* value_raw - [IN] value before applying on fail action if *
* non-default action was applied. This value is *
* 'moved' over to result. *
* *
******************************************************************************/
void pp_result_set(zbx_pp_result_t *result, const zbx_variant_t *value, int action, zbx_variant_t *value_raw)
{
zbx_variant_copy(&result->value, value);
result->value_raw = *value_raw;
zbx_variant_set_none(value_raw);
result->action = action;
}
void zbx_pp_result_free(zbx_pp_result_t *result)
{
zbx_variant_clear(&result->value);
zbx_variant_clear(&result->value_raw);
zbx_free(result);