mco_dict_ifield_name
MCO_RET mco_dict_ifield_name( /*IN*/ mco_metadict_header_t * metadict,
/*IN*/ unsigned short dict_no,
/*IN*/ unsigned short struct_no,
/*IN*/ unsigned short index_no,
/*IN*/ const char * name,
/*OUT*/ mco_dict_ifield_info_t * ifield_info );
| |
---|
metadict | 要初始化的 mco_metadict_header_t 结构的地址 |
dict_no | 字典的编号 ( 必须介于 0 和 mco_metadict_count() 之间。 -1 ) |
struct_info | 用于接收结构/类描述符的变量的地址mco_dict_struct_info_t |
index_no | 索引号(必须介于 0 和 - 1 之间)struct_info.index_count |
name | 架构中定义的复合索引字段(段)名称 |
ifield_info | 用于接收索引字段描述符的变量的地址mco_dict_ifield_info_t |
此函数按索引字段名称返回复合索引字段(段)描述符。
| |
---|
MCO_S_OK | 已成功返回索引字段描述符 |
MCO_E_UDA_DICT_NOTFOUND | 无效dict_no |
MCO_E_UDA_STRUCT_NOTFOUND | 无效struct_no |
MCO_E_UDA_STRUCT_NOT_CLASS | 无效 (不是类)struct_no |
MCO_E_UDA_INDEX_NOTFOUND | 无效index_no |
MCO_E_UDA_IFIELD_NOTFOUND | 名称无效 |
/* 应用程序代码片段 */
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 index_no = 0;
mco_metadict_header_t *header;
const char * index_field_name = "MyCompoundIndexField";
mco_dict_index_info_t ifield_info;
...
header = (mco_metadict_header_t *) malloc(size);
mco_metadict_init(header, size); /* initialize the metadict */
...
rc = mco_dict_ifield_name(header, dict_no, struct_no, index_no, index_field_name, &ifield_info);
printf("Compound index field %d : %s\n", ifield_info.field_no, index_field_name);
...
}