mco_metadict_init
MCO_RET mco_metadict_init( /*IN*/ mco_metadict_header_t * metadict,
/*IN*/ unsigned int size,
/*IN*/ unsigned int flags );
| |
---|
metadict | 要初始化的 mco_metadict_header_t 结构的地址 |
size | 大小(以字节为单位) |
flags | 标志。flags 参数定义在字典初始化期间发生的情况。目前唯一支持的值是:MCO_METADICT_DONT_LOAD_EXISTING_DBS 此标志表示未完成已打开数据库的自动注册 |
此函数初始化元字典。必须先调用它,然后才能调用任何 UDA API 函数。元字典包含每个字典的标题和条目。
| |
---|
MCO_S_OK | 元字典已成功初始化 |
MCO_E_UDA_TOOMANY_ENTRIES | 元词典已满 |
MCO_E_UDA_NAME_TOO_LONG | 词典名称太长 |
/* 应用程序代码片段 */
const char * dbname = "SimpleDb";
int main(int argc, char* argv[])
{
unsigned int size;
mco_metadict_header_t *header;
mco_metadict_size(10, &size); /* figure out the buffer size to
register 10 database dictionaries */
...
header = (mco_metadict_header_t *) malloc(size);
mco_metadict_init(header, size); /* initialize the metadict */
...
}