From 1579f0c02b22169198f9438269d2b4ff16aa075b Mon Sep 17 00:00:00 2001 From: tyx <462747508@qq.com> Date: Wed, 8 Jun 2022 09:51:36 +0800 Subject: [PATCH] =?UTF-8?q?[components][var=5Fexport]=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E9=95=BF=E5=BA=A6=E5=8F=8A=E4=BA=8C=E5=88=86?= =?UTF-8?q?=E6=9F=A5=E6=89=BE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/utilities/var_export/var_export.c | 7 ++++++- components/utilities/var_export/var_export.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/components/utilities/var_export/var_export.c b/components/utilities/var_export/var_export.c index 5ab7e2b57e..e4146d6ff8 100644 --- a/components/utilities/var_export/var_export.c +++ b/components/utilities/var_export/var_export.c @@ -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; +} diff --git a/components/utilities/var_export/var_export.h b/components/utilities/var_export/var_export.h index 6e147e8201..b0e2e88b3f 100644 --- a/components/utilities/var_export/var_export.h +++ b/components/utilities/var_export/var_export.h @@ -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__ */