jsquery_extract.c
static int
compareNodes(const void *a1, const void *a2)
{
	ExtractedNode *n1 = *((ExtractedNode **)a1);
	ExtractedNode *n2 = *((ExtractedNode **)a2);

	if (n1->indirect != n2->indirect)
	{
		if (n1->indirect)
			return 1;
		if (n2->indirect)
			return -1;
	}

	if (n1->type != n2->type)
		return (n1->type < n2->type) ? -1 : 1;

	if (!isLogicalNodeType(n1->type))
	{
		int cmp = comparePathItems(n1->path, n2->path);
		if (cmp) return cmp;
	}

	if (n1->number != n2->number)
		return (n1->number < n2->number) ? -1 : 1;

	return 0;
}
/*
 * Compare nodes in the order where conditions to the same fields are located
 * together.
 */
Compare nodes in the order where conditions to the same fields are located
together.
Compare nodes in the order where conditions to the same fields are located together .
static int
compareNodes(const void *a1, const void *a2)
{
	ExtractedNode *n1 = *((ExtractedNode **)a1);
	ExtractedNode *n2 = *((ExtractedNode **)a2);
	if (n1->indirect != n2->indirect)
	{
		if (n1->indirect)
			return 1;
		if (n2->indirect)
			return -1;
	}
	if (n1->type != n2->type)
		return (n1->type < n2->type) ? -1 : 1;
	if (!isLogicalNodeType(n1->type))
	{
		int cmp = comparePathItems(n1->path, n2->path);
		if (cmp) return cmp;
	}
	if (n1->number != n2->number)
		return (n1->number < n2->number) ? -1 : 1;
	return 0;
}
static int compareNodes ( const void * a1 , const void * a2 ) { ExtractedNode * n1 = * ( ( ExtractedNode * * ) a1 ) ; ExtractedNode * n2 = * ( ( ExtractedNode * * ) a2 ) ; if ( n1 -> indirect != n2 -> indirect ) { if ( n1 -> indirect ) return 1 ; if ( n2 -> indirect ) return -1 ; } if ( n1 -> type != n2 -> type ) return ( n1 -> type < n2 -> type ) ? -1 : 1 ; if ( ! isLogicalNodeType ( n1 -> type ) ) { int cmp = comparePathItems ( n1 -> path , n2 -> path ) ; if ( cmp ) return cmp ; } if ( n1 -> number != n2 -> number ) return ( n1 -> number < n2 -> number ) ? -1 : 1 ; return 0 ; }
Compare nodes in the order where conditions to the same fields are located
 together.
Compare nodes in the order where conditions to the same fields are located together .