提交 1579f0c0 编写于 作者: 还_没_想_好's avatar 还_没_想_好 提交者: mysterywolf

[components][var_export] 添加获取长度及二分查找功能

上级 a881c05e
......@@ -181,7 +181,7 @@ const ve_exporter_t *ve_iter_next(ve_iterator_t *iter)
}
/* binary search based on identifier */
static const ve_exporter_t *ve_binary_search(ve_module_t *mod, const char *identifier)
const ve_exporter_t *ve_binary_search(ve_module_t *mod, const char *identifier)
{
int ve_low_num = 0;
int ve_high_num = mod->end - mod->begin;
......@@ -237,3 +237,8 @@ rt_bool_t ve_value_exist(ve_module_t *mod, const char *identifier)
return RT_FALSE;
}
}
rt_size_t ve_value_count(ve_module_t *mod)
{
return mod->end - mod->begin + 1;
}
......@@ -90,5 +90,7 @@ const ve_exporter_t *ve_iter_next(ve_iterator_t *iter);
rt_base_t ve_value_get(ve_module_t *mod, const char *identifier);
/* check if this value exists in the module*/
rt_bool_t ve_value_exist(ve_module_t *mod, const char *identifier);
rt_size_t ve_value_count(ve_module_t *mod);
const ve_exporter_t *ve_binary_search(ve_module_t *mod, const char *identifier);
#endif /* _VAR_EXPORT_H__ */
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册