Source
static void proxyconfig_get_fields(char **sql, size_t *sql_alloc, size_t *sql_offset, const zbx_db_table_t *table,
/*
** 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.
**/
typedef struct
{
char *path;
zbx_hashset_t keys;
}
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);
}
static void key_path_free(void *data)
{
zbx_hashset_iter_t iter;
char **ptr;
zbx_keys_path_t *keys_path = (zbx_keys_path_t *)data;