MCO_RET mco_metadict_entry_name( /*IN*/ mco_metadict_header_t * metadict,
/*IN*/ const char * name,
/*OUT*/ mco_metadict_entry_t ** entry );
此函数根据其 name 返回指向字典的指针。metadict->entries[]->name
| |
---|
MCO_S_OK | 已成功返回字典 |
MCO_E_UDA_DICT_NOTFOUND | 词典未注册 |
/* 应用程序代码片段 */
const char * dbname = "SimpleDb";
int main(int argc, char* argv[])
{
MCO_RET rc;
unsigned int count;
mco_metadict_header_t *header;
mco_metadict_entry_t *entry;
const char * name = "Dict_1";
unsigned int size;
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 */
...
rc = mco_metadict_entry_name(header, name, &entry);
}