zabbix-agent2/src/libs/zbxdbcache/dbconfig.c
/******************************************************************************
 *                                                                            *
 * Function: dc_get_host_inventory_value_by_hostid                            *
 *                                                                            *
 * Purpose: find inventory value in automatically populated cache, if not     *
 *          found then look in main inventory cache                           *
 *                                                                            *
 * Comments: This function must be called inside configuration cache read     *
 *           (or write) lock.                                                 *
 *                                                                            *
 ******************************************************************************/
dc_get_host_inventory_value_by_hostid

Purpose: find inventory value in automatically populated cache, if not
found then look in main inventory cache

Comments: This function must be called inside configuration cache read
(or write) lock.
dc_get_host_inventory_value_by_hostid Purpose : find inventory value in automatically populated cache if not found then look in main inventory cache Comments : This function must be called inside configuration cache read ( or write ) lock .
static int	dc_get_host_inventory_value_by_hostid(zbx_uint64_t hostid, char **replace_to, int value_idx)
{
	const ZBX_DC_HOST_INVENTORY	*dc_inventory;
	if (NULL != (dc_inventory = (const ZBX_DC_HOST_INVENTORY *)zbx_hashset_search(&config->host_inventories_auto,
			&hostid)) && NULL != dc_inventory->values[value_idx])
	{
		*replace_to = zbx_strdup(*replace_to, dc_inventory->values[value_idx]);
		return SUCCEED;
	}
	if (NULL != (dc_inventory = (const ZBX_DC_HOST_INVENTORY *)zbx_hashset_search(&config->host_inventories,
			&hostid)))
	{
		*replace_to = zbx_strdup(*replace_to, dc_inventory->values[value_idx]);
		return SUCCEED;
	}
	return FAIL;
}
static int dc_get_host_inventory_value_by_hostid ( zbx_uint64_t hostid , char * * replace_to , int value_idx ) { const ZBX_DC_HOST_INVENTORY * dc_inventory ; if ( NULL != ( dc_inventory = ( const ZBX_DC_HOST_INVENTORY * ) zbx_hashset_search ( & config -> host_inventories_auto , & hostid ) ) && NULL != dc_inventory -> values [ value_idx ] ) { * replace_to = zbx_strdup ( * replace_to , dc_inventory -> values [ value_idx ] ) ; return SUCCEED ; } if ( NULL != ( dc_inventory = ( const ZBX_DC_HOST_INVENTORY * ) zbx_hashset_search ( & config -> host_inventories , & hostid ) ) ) { * replace_to = zbx_strdup ( * replace_to , dc_inventory -> values [ value_idx ] ) ; return SUCCEED ; } return FAIL ; }
Function: dc_get_host_inventory_value_by_hostid                            
                                                                            
 Purpose: find inventory value in automatically populated cache, if not     
          found then look in main inventory cache                           
                                                                            
 Comments: This function must be called inside configuration cache read     
           (or write) lock.
Function : dc_get_host_inventory_value_by_hostid Purpose : find inventory value in automatically populated cache if not found then look in main inventory cache Comments : This function must be called inside configuration cache read ( or write ) lock .