zabbix-agent2/src/libs/zbxserver/expression.c
/******************************************************************************
 *                                                                            *
 * Function: zbx_substitute_item_name_macros                                  *
 *                                                                            *
 * Purpose: substitute key macros and use it to substitute item name macros   *
 *          if item name is specified                                         *
 *                                                                            *
 * Parameters: dc_item    - [IN] item information used in substitution        *
 *             name       - [IN] optional item name to substitute             *
 *             replace_to - [OUT] expanded item name or key if name is absent *
 *                                                                            *
 ******************************************************************************/
zbx_substitute_item_name_macros

Purpose: substitute key macros and use it to substitute item name macros
if item name is specified

Parameters: dc_item    - [IN] item information used in substitution
name       - [IN] optional item name to substitute
replace_to - [OUT] expanded item name or key if name is absent
zbx_substitute_item_name_macros Purpose : substitute key macros and use it to substitute item name macros if item name is specified Parameters : dc_item - [ IN ] item information used in substitution name - [ IN ] optional item name to substitute replace_to - [ OUT ] expanded item name or key if name is absent
void	zbx_substitute_item_name_macros(DC_ITEM *dc_item, const char *name, char **replace_to)
{
	char	*key;
	key = zbx_strdup(NULL, dc_item->key_orig);
	substitute_key_macros_impl(&key, NULL, dc_item, NULL, NULL, MACRO_TYPE_ITEM_KEY, NULL, 0);
	if (NULL != name)
	{
		*replace_to = zbx_strdup(*replace_to, name);
		item_description(replace_to, key, dc_item->host.hostid);
		zbx_free(key);
	}
	else	
	{
		zbx_free(*replace_to);
		*replace_to = key;
	}
}
void zbx_substitute_item_name_macros ( DC_ITEM * dc_item , const char * name , char * * replace_to ) { char * key ; key = zbx_strdup ( NULL , dc_item -> key_orig ) ; substitute_key_macros_impl ( & key , NULL , dc_item , NULL , NULL , MACRO_TYPE_ITEM_KEY , NULL , 0 ) ; if ( NULL != name ) { * replace_to = zbx_strdup ( * replace_to , name ) ; item_description ( replace_to , key , dc_item -> host . hostid ) ; zbx_free ( key ) ; } else { zbx_free ( * replace_to ) ; * replace_to = key ; } }
Function: zbx_substitute_item_name_macros                                  
                                                                            
 Purpose: substitute key macros and use it to substitute item name macros   
          if item name is specified                                         
                                                                            
 Parameters: dc_item    - [IN] item information used in substitution        
             name       - [IN] optional item name to substitute             
             replace_to - [OUT] expanded item name or key if name is absent
Function : zbx_substitute_item_name_macros Purpose : substitute key macros and use it to substitute item name macros if item name is specified Parameters : dc_item - [ IN ] item information used in substitution name - [ IN ] optional item name to substitute replace_to - [ OUT ] expanded item name or key if name is absent
/* ZBX_REQUEST_ITEM_KEY */