未验证 提交 e03ce132 编写于 作者: O openharmony_ci 提交者: Gitee

!1490 FIX: 恢复接口LoadParamsFile

Merge pull request !1490 from cheng_jinsong/1107_paramLoad
...@@ -34,6 +34,8 @@ int SystemWriteParam(const char *name, const char *value); ...@@ -34,6 +34,8 @@ int SystemWriteParam(const char *name, const char *value);
int SystemReadParam(const char *name, char *value, unsigned int *len); int SystemReadParam(const char *name, char *value, unsigned int *len);
int LoadParamsFile(const char *fileName, bool onlyAdd);
typedef int (*CmdExecutor)(int id, const char *name, int argc, const char **argv); typedef int (*CmdExecutor)(int id, const char *name, int argc, const char **argv);
int AddCmdExecutor(const char *cmdName, CmdExecutor execCmd); int AddCmdExecutor(const char *cmdName, CmdExecutor execCmd);
......
[ [
{ "name": "SystemWriteParam" }, { "name": "SystemWriteParam" },
{ "name": "SystemReadParam" }, { "name": "SystemReadParam" },
{ "name": "LoadParamsFile" },
{ "name": "SplitString" }, { "name": "SplitString" },
{ "name": "AddCmdExecutor" }, { "name": "AddCmdExecutor" },
{ "name": "RemoveCmdExecutor" }, { "name": "RemoveCmdExecutor" },
......
...@@ -192,6 +192,11 @@ static int ProcessParamFile(const char *fileName, void *context) ...@@ -192,6 +192,11 @@ static int ProcessParamFile(const char *fileName, void *context)
return LoadDefaultParam_(fileName, mode, exclude, ARRAY_LENGTH(exclude), LoadOneParam_); return LoadDefaultParam_(fileName, mode, exclude, ARRAY_LENGTH(exclude), LoadOneParam_);
} }
int LoadParamsFile(const char *fileName, bool onlyAdd)
{
return LoadDefaultParams(fileName, onlyAdd ? LOAD_PARAM_ONLY_ADD : LOAD_PARAM_NORMAL);
}
int LoadDefaultParams(const char *fileName, uint32_t mode) int LoadDefaultParams(const char *fileName, uint32_t mode)
{ {
PARAM_CHECK(fileName != NULL, return -1, "Invalid filename for load"); PARAM_CHECK(fileName != NULL, return -1, "Invalid filename for load");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册