Source
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** 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 Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
ZBX_PTR_VECTOR_IMPL(pp_step_ptr, zbx_pp_step_t *)
/******************************************************************************
* *
* Purpose: create item preprocessing data *
* *
* Parameters: hostid - [IN] item host id *
* type - [IN] item type *
* value_type - [IN] item value type *
* flags - [IN] item flags *
* *
* Return value: The created item preprocessing data. *
* *
******************************************************************************/
zbx_pp_item_preproc_t *zbx_pp_item_preproc_create(zbx_uint64_t hostid, unsigned char type, unsigned char value_type,
unsigned char flags)
{
zbx_pp_item_preproc_t *preproc = zbx_malloc(NULL, sizeof(zbx_pp_item_preproc_t));
preproc->refcount = 1;
preproc->refcount_peak = 1;
preproc->steps_num = 0;
preproc->steps = NULL;
preproc->pp_revision = 0;
preproc->dep_itemids_num = 0;
preproc->dep_itemids = NULL;
preproc->hostid = hostid;
preproc->type = type;
preproc->value_type = value_type;
preproc->flags = flags;
preproc->history_cache = NULL;
preproc->history_num = 0;
preproc->mode = ZBX_PP_PROCESS_PARALLEL;
return preproc;
}
void zbx_pp_step_free(zbx_pp_step_t *step)
{
zbx_free(step->params);
zbx_free(step->error_handler_params);
zbx_free(step);
}
/******************************************************************************