Source
static void proxyconfig_get_fields(char **sql, size_t *sql_alloc, size_t *sql_offset, const zbx_db_table_t *table,
/*
** 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/>.
**/
typedef struct
{
char *path;
zbx_hashset_t keys;
}
zbx_keys_path_t;
ZBX_PTR_VECTOR_DECL(keys_path_ptr, zbx_keys_path_t *)
ZBX_PTR_VECTOR_IMPL(keys_path_ptr, zbx_keys_path_t *)
static int keys_path_compare(const void *d1, const void *d2)
{
const zbx_keys_path_t *ptr1 = *((const zbx_keys_path_t * const *)d1);
const zbx_keys_path_t *ptr2 = *((const zbx_keys_path_t * const *)d2);
return strcmp(ptr1->path, ptr2->path);
}
static zbx_hash_t keys_hash(const void *data)
{
return ZBX_DEFAULT_STRING_HASH_ALGO(*(const char * const *)data, strlen(*(const char * const *)data),
ZBX_DEFAULT_HASH_SEED);
}
static int keys_compare(const void *d1, const void *d2)
{
return strcmp(*(const char * const *)d1, *(const char * const *)d2);