mco_uda_get_udfmap_size

Return the amount of memory necessary to keep information about all user-defined functions at runtime.

Prototype

    MCO_RET mco_uda_get_udfmap_size (	/*IN*/ const mco_metadict_header_t * metadict,
                        /*IN*/ unsigned short dict_no,
                       /*OUT*/ 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 size of the memory buffer used to store user-defined functions. (See also mco_uda_register_udf()).

Description

This function returns the amount of memory necessary to keep information about all user-defined functions at runtime. The application should allocate the memory and pass it to the user-defined indexes registration API mco_uda_register_udf().

Return Codes

MCO_S_OK
Size returned successfully.
MCO_E_UDA_DICT_NOTFOUND
Invalid dict_no.

Example

    Application snippet:

    const char * dbname = "SimpleDb";

    int main(int argc, char* argv[])
    {
        MCO_RET rc;
        mco_runtime_info_t info;
        unsigned int dict_no = 0;
        mco_metadict_header_t *header;
        unsigned int udf_map_size;
        mco_userdef_funcs_h udf_map;

        ...
        mco_runtime_start();
        mco_get_runtime_info(&info);
        ...
        header = (mco_metadict_header_t *) malloc(size);
        mco_metadict_init(header, size); /* initialize the metadict */
        ...
        /* Allocate udfmap */
         mco_uda_get_udfmap_size(metadict, dict_no, &udf_map_size);

         udf_map = (mco_userdef_funcs_h) malloc(udf_map_size);
         ...
     }

Files

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