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 | The address of an initialized mco_metadict_header_t structure |
|
dict_no |
The number of the dictionary (must be between 0 and |
|
size |
The size of the memory buffer used to store user-defined functions. (See also |
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().
| MCO_S_OK | Size returned successfully |
| MCO_E_UDA_DICT_NOTFOUND | Invalid dict_no |
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);
...
}