zabbix-agent2/src/libs/zbxdbcache/dbconfig.c
/******************************************************************************
 *                                                                            *
 * Function: config_gmacro_context_compare                                    *
 *                                                                            *
 * Purpose: comparison function to sort global macro vector by context        *
 *          operator, value and macro name                                    *
 *                                                                            *
 ******************************************************************************/
config_gmacro_context_compare

Purpose: comparison function to sort global macro vector by context
operator, value and macro name
config_gmacro_context_compare Purpose : comparison function to sort global macro vector by context operator value and macro name
static int	config_gmacro_context_compare(const void *d1, const void *d2)
{
	const ZBX_DC_GMACRO	*m1 = *(const ZBX_DC_GMACRO **)d1;
	const ZBX_DC_GMACRO	*m2 = *(const ZBX_DC_GMACRO **)d2;
	if (NULL == m1->context)
		return NULL == m2->context ? 0 : -1;
	if (NULL == m2->context)
		return 1;
	ZBX_RETURN_IF_NOT_EQUAL(m1->context_op, m2->context_op);
	return strcmp(m1->context, m2->context);
}
static int config_gmacro_context_compare ( const void * d1 , const void * d2 ) { const ZBX_DC_GMACRO * m1 = * ( const ZBX_DC_GMACRO * * ) d1 ; const ZBX_DC_GMACRO * m2 = * ( const ZBX_DC_GMACRO * * ) d2 ; if ( NULL == m1 -> context ) return NULL == m2 -> context ? 0 : -1 ; if ( NULL == m2 -> context ) return 1 ; ZBX_RETURN_IF_NOT_EQUAL ( m1 -> context_op , m2 -> context_op ) ; return strcmp ( m1 -> context , m2 -> context ) ; }
Function: config_gmacro_context_compare                                    
                                                                            
 Purpose: comparison function to sort global macro vector by context        
          operator, value and macro name
Function : config_gmacro_context_compare Purpose : comparison function to sort global macro vector by context operator value and macro name
/* macros without context have higher priority than macros with */ /* CONDITION_OPERATOR_EQUAL (0) has higher priority than CONDITION_OPERATOR_REGEXP (8) */