mco_uda_db_open
MCO_RET mco_uda_db_open( /*IN*/const mco_metadict_header_t * metadict,
/*IN*/ unsigned short dict_no,
/*IN*/ mco_device_t * devs,
/*IN*/ mco_size_t n_devs,
/*IN*/ mco_db_params_t * params);
打开 UDA 的数据库。此函数可用于替换 。mco_db_open_dev()
| |
---|
MCO_S_OK | 已成功打开数据库 |
MCO_E_UDA_DICT_NOTFOUND | 词典未注册 |
MCO_E_UDA_DICT_NOT_DIRECT | 尚未显式注册字典 |
/* 应用程序代码片段 */
const char * dbname = "SimpleDb";
int main(int argc, char* argv[])
{
MCO_RET rc;
mco_runtime_info_t info;
unsigned int dict_no = 0;
unsigned int count;
mco_metadict_header_t *header;
mco_device_t dev;
unsigned int n_dev;
mco_db_params_t db_params;
mco_uda_class_storge patches[2];
...
mco_runtime_start();
mco_get_runtime_info(&info);
...
header = (mco_metadict_header_t *) malloc(size);
mco_metadict_init(header, size); /* initialize the metadict */
...
/* open database */
rc = mco_uda_db_open(metadict, /* meta-dictionary header - must be initialized */
0, /* dictionary number */
dev, /* memory devices */
n_dev, /* num of memory devices */
&db_params); /* db parameters */
...
}