zabbix-agent2/src/libs/zbxeval/parse.c
/******************************************************************************
 *                                                                            *
 * Function: eval_update_const_variable                                       *
 *                                                                            *
 * Purpose: update constant variable index in the trigger expression          *
 *                                                                            *
 * Parameters: ctx   - [IN] the evaluation context                            *
 *             token - [IN] the variable token                                *
 *                                                                            *
 * Comments: The index is used to refer constant values by using $<N> in      *
 *           trigger names. Function arguments are excluded.                  *
 *                                                                            *
 ******************************************************************************/
eval_update_const_variable

Purpose: update constant variable index in the trigger expression

Parameters: ctx   - [IN] the evaluation context
token - [IN] the variable token

Comments: The index is used to refer constant values by using $ in
trigger names. Function arguments are excluded.
eval_update_const_variable Purpose : update constant variable index in the trigger expression Parameters : ctx - [ IN ] the evaluation context token - [ IN ] the variable token Comments : The index is used to refer constant values by using $ in trigger names . Function arguments are excluded .
static void	eval_update_const_variable(zbx_eval_context_t *ctx, zbx_eval_token_t *token)
{
	zbx_variant_set_none(&token->value);
	if (0 != (ctx->rules & ZBX_EVAL_PARSE_CONST_INDEX))
	{
		int	i;
		for (i = 0; i < ctx->ops.values_num; i++)
		{
			if (0 != (ctx->ops.values[i].type & ZBX_EVAL_CLASS_FUNCTION))
				return;
		}
		token->opt = ctx->const_index++;
	}
}
static void eval_update_const_variable ( zbx_eval_context_t * ctx , zbx_eval_token_t * token ) { zbx_variant_set_none ( & token -> value ) ; if ( 0 != ( ctx -> rules & ZBX_EVAL_PARSE_CONST_INDEX ) ) { int i ; for ( i = 0 ; i < ctx -> ops . values_num ; i ++ ) { if ( 0 != ( ctx -> ops . values [ i ] . type & ZBX_EVAL_CLASS_FUNCTION ) ) return ; } token -> opt = ctx -> const_index ++ ; } }
Function: eval_update_const_variable                                       
                                                                            
 Purpose: update constant variable index in the trigger expression          
                                                                            
 Parameters: ctx   - [IN] the evaluation context                            
             token - [IN] the variable token                                
                                                                            
 Comments: The index is used to refer constant values by using $<N> in      
           trigger names.
Function : eval_update_const_variable Purpose : update constant variable index in the trigger expression Parameters : ctx - [ IN ] the evaluation context token - [ IN ] the variable token Comments : The index is used to refer constant values by using $<N > in trigger names .