MCO_RET mco_dict_index_name( /*IN*/ mco_metadict_header_t * metadict,
/*IN*/ unsigned short dict_no,
/*IN*/ unsigned short struct_no,
/*IN*/ const char * name,
/*OUT*/ mco_dict_index_info_t * index_info );
此函数通过 返回索引描述符。name
| |
---|
MCO_S_OK | 已成功返回索引描述符 |
MCO_E_UDA_DICT_NOTFOUND | 词典未注册 |
MCO_E_UDA_STRUCT_NOTFOUND | 无效struct_no |
MCO_E_UDA_STRUCT_NOT_CLASS | struct_no 不对应于类 |
MCO_E_UDA_INDEX_NOTFOUND | 无效的 DDL 名称 |
/* 应用程序代码片段 */
const char * dbname = "SimpleDb";
int main(int argc, char* argv[])
{
MCO_RET rc;
unsigned int dict_no = 0;
unsigned int struct_no = 0;
unsigned int count;
mco_metadict_header_t *header;
const char * index_name = "MyIndex";
mco_dict_index_info_t index_info;
...
header = (mco_metadict_header_t *) malloc(size);
mco_metadict_init(header, size); /* initialize the metadict */
...
rc = mco_dict_index_name(header, dict_no, struct_no, index_name, &index_info);
printf("Index %d : %s\n", index_info.index_no, index_name);
...
}