zabbix-agent2/src/libs/zbxserver/macrofunc.c
/******************************************************************************
 *                                                                            *
 * Function: macrofunc_iregsub                                                *
 *                                                                            *
 * Purpose: calculates case insensitive regular expression substitution       *
 *                                                                            *
 * Parameters: params - [IN] the function parameters                          *
 *             nparam - [IN] the function parameter count                     *
 *             out    - [IN/OUT] the input/output value                       *
 *                                                                            *
 * Return value: SUCCEED - the function was calculated successfully.          *
 *               FAIL    - the function calculation failed.                   *
 *                                                                            *
 ******************************************************************************/
macrofunc_iregsub

Purpose: calculates case insensitive regular expression substitution

Parameters: params - [IN] the function parameters
nparam - [IN] the function parameter count
out    - [IN/OUT] the input/output value

Return value: SUCCEED - the function was calculated successfully.
FAIL    - the function calculation failed.
macrofunc_iregsub Purpose : calculates case insensitive regular expression substitution Parameters : params - [ IN ] the function parameters nparam - [ IN ] the function parameter count out - [ IN / OUT ] the input / output value Return value : SUCCEED - the function was calculated successfully . FAIL - the function calculation failed .
static int	macrofunc_iregsub(char **params, size_t nparam, char **out)
{
	char	*value = NULL;
	if (2 != nparam)
		return FAIL;
	if (FAIL == zbx_iregexp_sub(*out, params[0], params[1], &value))
		return FAIL;
	if (NULL == value)
		value = zbx_strdup(NULL, "");
	zbx_free(*out);
	*out = value;
	return SUCCEED;
}
static int macrofunc_iregsub ( char * * params , size_t nparam , char * * out ) { char * value = NULL ; if ( 2 != nparam ) return FAIL ; if ( FAIL == zbx_iregexp_sub ( * out , params [ 0 ] , params [ 1 ] , & value ) ) return FAIL ; if ( NULL == value ) value = zbx_strdup ( NULL , " " ) ; zbx_free ( * out ) ; * out = value ; return SUCCEED ; }
Function: macrofunc_iregsub                                                
                                                                            
 Purpose: calculates case insensitive regular expression substitution       
                                                                            
 Parameters: params - [IN] the function parameters                          
             nparam - [IN] the function parameter count                     
             out    - [IN/OUT] the input/output value                       
                                                                            
 Return value: SUCCEED - the function was calculated successfully.
Function : macrofunc_iregsub Purpose : calculates case insensitive regular expression substitution Parameters : params - [ IN ] the function parameters nparam - [ IN ] the function parameter count out - [ IN / OUT ] the input / output value Return value : SUCCEED - the function was calculated successfully .