Return the amount of memory necessary to keep information about all user-defined functions at runtime.
MCO_RET mco_uda_get_udfmap_size ( /*IN*/ const mco_metadict_header_t * metadict,
/*IN*/ unsigned short dict_no,
/*OUT*/ unsigned int * size );
metadict
dict_no
mco_metadict_count() - 1).size
mco_uda_register_udf()).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().
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);
...
}