zabbix-agent2/src/libs/zbxserver/expression.c
/******************************************************************************
 *                                                                            *
 * Function: is_indexed_macro                                                 *
 *                                                                            *
 * Purpose: check if a token contains indexed macro                           *
 *                                                                            *
 ******************************************************************************/
is_indexed_macro

Purpose: check if a token contains indexed macro
is_indexed_macro Purpose : check if a token contains indexed macro
static int	is_indexed_macro(const char *str, const zbx_token_t *token)
{
	const char	*p;
	switch (token->type)
	{
		case ZBX_TOKEN_MACRO:
			p = str + token->loc.r - 1;
			break;
		case ZBX_TOKEN_FUNC_MACRO:
			p = str + token->data.func_macro.macro.r - 1;
			break;
		default:
			THIS_SHOULD_NEVER_HAPPEN;
			return FAIL;
	}
	return '1' <= *p && *p <= '9' ? 1 : 0;
}
static int is_indexed_macro ( const char * str , const zbx_token_t * token ) { const char * p ; switch ( token -> type ) { case ZBX_TOKEN_MACRO : p = str + token -> loc . r - 1 ; break ; case ZBX_TOKEN_FUNC_MACRO : p = str + token -> data . func_macro . macro . r - 1 ; break ; default : THIS_SHOULD_NEVER_HAPPEN ; return FAIL ; } return ' ' <= * p && * p <= ' ' ? 1 : 0 ; }
Function: is_indexed_macro                                                 
                                                                            
 Purpose: check if a token contains indexed macro
Function : is_indexed_macro Purpose : check if a token contains indexed macro