Source
int zbx_parse_cfg_file(const char *cfg_file, zbx_cfg_line_t *cfg, int optional, int strict, int noexit, int noenv)
/*
** 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/>.
**/
static const char *program_type_str = NULL;
static const char *main_cfg_file = NULL;
static ZBX_THREAD_LOCAL int process_num = 0;
static int __parse_cfg_file(const char *cfg_file, zbx_cfg_line_t *cfg, int level, int optional, int strict,
int noexit, zbx_vector_str_t *env_vars);
ZBX_PTR_VECTOR_IMPL(addr_ptr, zbx_addr_t *)
void zbx_init_library_cfg(unsigned char program_type, const char *cfg_file)
{
program_type_str = get_program_type_string(program_type);
main_cfg_file = cfg_file;
}
void zbx_cfg_set_process_num(int num)
{
process_num = num;
}
/******************************************************************************
* *
* Purpose: Checks whether a file (e.g., "parameter.conf") *
* matches a pattern (e.g., "p*.conf"). *
* *
* Return value: SUCCEED - file matches pattern *
* FAIL - otherwise *
* *
******************************************************************************/
static int match_glob(const char *file, const char *pattern)
{