Source
zbx_jsonpath_token_t *index_token; /* relative path token that is used to index parent object */
/*
** 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
{
zbx_jsonobj_t *root; /* the root object */
zbx_jsonpath_t *path;
unsigned char found; /* set to 1 when one object was matched and */
/* no more matches are required */
zbx_vector_jsonobj_ref_t objects; /* the matched objects */
zbx_jsonpath_index_t *index;
}
zbx_jsonpath_context_t;
typedef struct zbx_jsonpath_token zbx_jsonpath_token_t;
typedef enum
{
ZBX_JSONPATH_SEGMENT_UNKNOWN,
ZBX_JSONPATH_SEGMENT_MATCH_ALL,
ZBX_JSONPATH_SEGMENT_MATCH_LIST,
ZBX_JSONPATH_SEGMENT_MATCH_RANGE,
ZBX_JSONPATH_SEGMENT_MATCH_EXPRESSION,
ZBX_JSONPATH_SEGMENT_FUNCTION
}
zbx_jsonpath_segment_type_t;
/* specifies if the match list contains object property names or array indices */
typedef enum
{
ZBX_JSONPATH_LIST_NAME = 1,
ZBX_JSONPATH_LIST_INDEX
}
zbx_jsonpath_list_type_t;
typedef enum
{
ZBX_JSONPATH_FUNCTION_MIN = 1,
ZBX_JSONPATH_FUNCTION_MAX,
ZBX_JSONPATH_FUNCTION_AVG,