rasqal_literal_compare

Name

rasqal_literal_compare --  Compare two literals with type promotion

Synopsis

int rasqal_literal_compare (rasqal_literal* l1, rasqal_literal* l2, int flags, int * error);

Arguments

l1

rasqal_literal first literal

l2

rasqal_literal second literal

flags

comparison flags

error

pointer to error

Description

The two literals are compared across their range. If the types are not the same, they are promoted. If one is a floating, the other is promoted to floating, otherwise for integers, otherwise to strings (all literals have a string value).

The comparison returned is as for strcmp, first before second returns <0. equal returns 0, and first after second returns >0. If there is no ordering, such as for URIs, the return value is 0 for equal, non-0 for different (using raptor_uri_equals).

flags affects string comparisons and if the RASQAL_COMPARE_NOCASE bit is set, a case independent comparison is made.

Return value

<0, 0, or >0 as described above.