mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-12-29 10:30:24 +00:00
[components][var_export] 添加获取长度及二分查找功能
This commit is contained in:
committed by
Man, Jianting (Meco)
parent
a881c05e58
commit
1579f0c02b
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user