jsquery_extract.c
static int
comparePathItems(PathItem *i1, PathItem *i2)
{
	int cmp;

	if (i1 == i2)
		return 0;

	if (!i1)
		return -1;
	if (!i2)
		return 1;

	if (i1->type != i2->type)
	{
		return (i1->type < i2->type) ? -1 : 1;
	}

	if (i1->type == iKey)
		cmp = memcmp(i1->s, i2->s, Min(i1->len, i2->len));
	else
		cmp = 0;

	if (cmp == 0)
	{
		if (i1->len != i2->len)
			return (i1->len < i2->len) ? -1 : 1;
		return comparePathItems(i1->parent, i2->parent);
	}
	else
	{
		return cmp;
	}
}
/*
 * Compare path items chains from child to parent.
 */
Compare path items chains from child to parent.
Compare path items chains from child to parent .
static int
comparePathItems(PathItem *i1, PathItem *i2)
{
	int cmp;
	if (i1 == i2)
		return 0;
	if (!i1)
		return -1;
	if (!i2)
		return 1;
	if (i1->type != i2->type)
	{
		return (i1->type < i2->type) ? -1 : 1;
	}
	if (i1->type == iKey)
		cmp = memcmp(i1->s, i2->s, Min(i1->len, i2->len));
	else
		cmp = 0;
	if (cmp == 0)
	{
		if (i1->len != i2->len)
			return (i1->len < i2->len) ? -1 : 1;
		return comparePathItems(i1->parent, i2->parent);
	}
	else
	{
		return cmp;
	}
}
static int comparePathItems ( PathItem * i1 , PathItem * i2 ) { int cmp ; if ( i1 == i2 ) return 0 ; if ( ! i1 ) return -1 ; if ( ! i2 ) return 1 ; if ( i1 -> type != i2 -> type ) { return ( i1 -> type < i2 -> type ) ? -1 : 1 ; } if ( i1 -> type == iKey ) cmp = memcmp ( i1 -> s , i2 -> s , Min ( i1 -> len , i2 -> len ) ) ; else cmp = 0 ; if ( cmp == 0 ) { if ( i1 -> len != i2 -> len ) return ( i1 -> len < i2 -> len ) ? -1 : 1 ; return comparePathItems ( i1 -> parent , i2 -> parent ) ; } else { return cmp ; } }
Compare path items chains from child to parent.
Compare path items chains from child to parent .