Source
if (FAIL != (i = zbx_vector_uint64_search(&group->unassigned_hostids, hostid, ZBX_DEFAULT_UINT64_COMPARE_FUNC)))
/*
** 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_VECTOR_IMPL(pg_update, zbx_pg_update_t)
typedef struct
{
zbx_pg_proxy_t *proxy;
zbx_vector_pg_host_ref_ptr_t host_refs;
int hosts_num;
}
zbx_pg_proxy_hosts_t;
ZBX_PTR_VECTOR_DECL(pg_proxy_hosts_ptr, zbx_pg_proxy_hosts_t *)
ZBX_PTR_VECTOR_IMPL(pg_proxy_hosts_ptr, zbx_pg_proxy_hosts_t *)
static void pg_proxy_hosts_free(zbx_pg_proxy_hosts_t *ph)
{
zbx_vector_pg_host_ref_ptr_destroy(&ph->host_refs);
zbx_free(ph);
}
static int pg_host_ref_compare_by_revision(const void *d1, const void *d2)
{
const zbx_pg_host_ref_t *hr1 = *(const zbx_pg_host_ref_t * const *)d1;
const zbx_pg_host_ref_t *hr2 = *(const zbx_pg_host_ref_t * const *)d2;
ZBX_RETURN_IF_NOT_EQUAL(hr1->host->revision, hr2->host->revision);
return 0;
}
void pg_cache_lock(zbx_pg_cache_t *cache)
{
pthread_mutex_lock(&cache->lock);
}