mco_uda_get_collmap_size

Return the size of the collation map structure.

Prototype

    MCO_RET mco_uda_get_collmap_size(	/*IN*/ const mco_metadict_header_t * metadict,
                       /*IN*/ unsigned short dict_no,
                       /*IN*/ unsigned int * size );

Arguments

metadict
The address of an initialized mco_metadict_header_t structure.
dict_no
The number of the dictionary (must be between 0 and mco_metadict_count() - 1).
size
The address of a variable to receive the collation map size.

Description

This function returns the size of the collation map structure. It is called to determine the amount of memory to allocate for the collation map structure prior to calling mco_uda_register_collation().

Return Codes

MCO_S_OK
Collation map size successfully returned.

Example

    Application snippet:

    int main(int argc, char *argv[])
    {
        MCO_RET rc;
        mco_collation_funcs_h coll_map;
        unsigned int coll_map_size;

        ...
        /* allocate collmap */
        mco_uda_get_collmap_size(metadict, 0, &coll_map_size);

        coll_map = (mco_collation_funcs_h) malloc(coll_map_size);

        /* register collation compare & hash functions */
        rc = mco_uda_register_collation(metadict, 0, coll_no, coll_map, &coll_cmp, &coll_hash);
        ...
    }

Files

Header file:
mcouda.h
Source file:
mcouda.c
Library:
libmcouda.a