MCO_RET mco_uda_collate_get( /*IN*/ const mco_collate_h c,
/*OUT*/ mco_uda_value_t *val );
| c | The address of an mco_collate_t struct containing the collation operands |
|
val |
The address of an mco_uda_value_t variable to receive the value in the |
This function returns a value from the
mco_collate_hstruct. It is used within collation compare and hash functions.
| MCO_S_OK | The collation value was successfully returned |
Application snippet:
/* custom compare & hash functions */
int2 coll_cmp(mco_collate_h c1, uint2 len1, mco_collate_h c2, uint2 len2)
{
mco_uda_value_t val1, val2;
char buf1[20], buf2[20];
/* get first object's value */
val1.type = MCO_DD_STRING;
val1.v.p.size = sizeof(buf1);
val1.v.p.p.c = buf1;
mco_uda_collate_get(c1, &val1);
/* get second object's value */
val2.type = MCO_DD_STRING;
val2.v.p.size = sizeof(buf2);
val2.v.p.p.c = buf2;
mco_uda_collate_get(c2, &val2);
/* compare values */
return STR_CMP(buf1, buf2);
}