ret := C.zbx_regexp_sub_ex(C.zbx_vector_expression_lp_t(grxp), cvalue, cpattern, C.int(mode), ctemplate,
** 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/>.
#cgo CFLAGS: -I${SRCDIR}/../../../../../include
typedef zbx_vector_ptr_t * zbx_vector_ptr_lp_t;
typedef zbx_vector_expression_t * zbx_vector_expression_lp_t;
static void *new_global_regexp()
zbx_vector_ptr_t *regexps;
regexps = malloc(sizeof(zbx_vector_ptr_t));
zbx_vector_ptr_create(regexps);
static void free_global_regexp(zbx_vector_expression_t *regexps)
zbx_regexp_clean_expressions(regexps);
zbx_vector_expression_destroy(regexps);
"golang.zabbix.com/sdk/log"
func NewGlobalRegexp() (grxp unsafe.Pointer) {
log.Tracef("Calling C function \"new_global_regexp()\"")
return unsafe.Pointer(C.new_global_regexp())
func DestroyGlobalRegexp(grxp unsafe.Pointer) {
log.Tracef("Calling C function \"free_global_regexp()\"")
C.free_global_regexp(C.zbx_vector_expression_lp_t(grxp))
func AddGlobalRegexp(grxp unsafe.Pointer, name, body string, expr_type int, delim byte, mode int) {