zabbix-agent2/src/libs/zbxtrends/cache.c
/******************************************************************************
 *                                                                            *
 * Function: tfc_index_add                                                    *
 *                                                                            *
 * Purpose: indexes data by adding it to the index hashset                    *
 *                                                                            *
 ******************************************************************************/
tfc_index_add

Purpose: indexes data by adding it to the index hashset
tfc_index_add Purpose : indexes data by adding it to the index hashset
static zbx_tfc_data_t	*tfc_index_add(zbx_tfc_data_t *data_local)
{
	zbx_tfc_data_t	*data;
	if (NULL == (data = (zbx_tfc_data_t *)zbx_hashset_insert(&cache->index, data_local, sizeof(zbx_tfc_data_t))))
	{
		cache->slots_num = cache->index.num_data;
		tfc_reserve_slot();
		if (NULL == (data = (zbx_tfc_data_t *)zbx_hashset_insert(&cache->index, data_local,
				sizeof(zbx_tfc_data_t))))
		{
			THIS_SHOULD_NEVER_HAPPEN;
			exit(EXIT_FAILURE);
		}
	}
	return data;
}
static zbx_tfc_data_t * tfc_index_add ( zbx_tfc_data_t * data_local ) { zbx_tfc_data_t * data ; if ( NULL == ( data = ( zbx_tfc_data_t * ) zbx_hashset_insert ( & cache -> index , data_local , sizeof ( zbx_tfc_data_t ) ) ) ) { cache -> slots_num = cache -> index . num_data ; tfc_reserve_slot ( ) ; if ( NULL == ( data = ( zbx_tfc_data_t * ) zbx_hashset_insert ( & cache -> index , data_local , sizeof ( zbx_tfc_data_t ) ) ) ) { THIS_SHOULD_NEVER_HAPPEN ; exit ( EXIT_FAILURE ) ; } } return data ; }
Function: tfc_index_add                                                    
                                                                            
 Purpose: indexes data by adding it to the index hashset
Function : tfc_index_add Purpose : indexes data by adding it to the index hashset