zabbix-agent2/src/libs/zbxdbcache/dbconfig.c
/******************************************************************************
 *                                                                            *
 * Function: DCconfig_sort_triggers_topologically                             *
 *                                                                            *
 * Purpose: assign each trigger an index based on trigger dependency topology *
 *                                                                            *
 * Author: Aleksandrs Saveljevs                                               *
 *                                                                            *
 ******************************************************************************/
DCconfig_sort_triggers_topologically

Purpose: assign each trigger an index based on trigger dependency topology

Author: Aleksandrs Saveljevs
DCconfig_sort_triggers_topologically Purpose : assign each trigger an index based on trigger dependency topology Author : Aleksandrs Saveljevs
static void	DCconfig_sort_triggers_topologically(void)
{
	zbx_hashset_iter_t		iter;
	ZBX_DC_TRIGGER			*trigger;
	const ZBX_DC_TRIGGER_DEPLIST	*trigdep;
	zbx_hashset_iter_reset(&config->trigdeps, &iter);
	while (NULL != (trigdep = (ZBX_DC_TRIGGER_DEPLIST *)zbx_hashset_iter_next(&iter)))
	{
		trigger = trigdep->trigger;
		if (NULL == trigger || 1 < trigger->topoindex || 0 == trigdep->dependencies.values_num)
			continue;
		DCconfig_sort_triggers_topologically_rec(trigdep, 0);
	}
}
static void DCconfig_sort_triggers_topologically ( void ) { zbx_hashset_iter_t iter ; ZBX_DC_TRIGGER * trigger ; const ZBX_DC_TRIGGER_DEPLIST * trigdep ; zbx_hashset_iter_reset ( & config -> trigdeps , & iter ) ; while ( NULL != ( trigdep = ( ZBX_DC_TRIGGER_DEPLIST * ) zbx_hashset_iter_next ( & iter ) ) ) { trigger = trigdep -> trigger ; if ( NULL == trigger || 1 < trigger -> topoindex || 0 == trigdep -> dependencies . values_num ) continue ; DCconfig_sort_triggers_topologically_rec ( trigdep , 0 ) ; } }
Function: DCconfig_sort_triggers_topologically                             
                                                                            
 Purpose: assign each trigger an index based on trigger dependency topology 
                                                                            
 Author: Aleksandrs Saveljevs
Function : DCconfig_sort_triggers_topologically Purpose : assign each trigger an index based on trigger dependency topology Author : Aleksandrs Saveljevs