zabbix-4.2.1/src/libs/zbxserver/expression.c
/******************************************************************************
 *                                                                            *
 * Function: compare_tags                                                     *
 *                                                                            *
 * Purpose: comparison function to sort tags by tag/value                     *
 *                                                                            *
 ******************************************************************************/


comparison function to sort tags by tag/value
comparison function to sort tags by tag / value
static int	compare_tags(const void *d1, const void *d2)
{
	int	ret;
	const zbx_tag_t	*tag1 = *(const zbx_tag_t **)d1;
	const zbx_tag_t	*tag2 = *(const zbx_tag_t **)d2;
	if (0 == (ret = zbx_strcmp_natural(tag1->tag, tag2->tag)))
		ret = zbx_strcmp_natural(tag1->value, tag2->value);
	return ret;
}
static int compare_tags ( const void * d1 , const void * d2 ) { int ret ; const zbx_tag_t * tag1 = * ( const zbx_tag_t * * ) d1 ; const zbx_tag_t * tag2 = * ( const zbx_tag_t * * ) d2 ; if ( 0 == ( ret = zbx_strcmp_natural ( tag1 -> tag , tag2 -> tag ) ) ) ret = zbx_strcmp_natural ( tag1 -> value , tag2 -> value ) ; return ret ; }
Function: compare_tags
Function : compare_tags