恢复接口LoadParamsFile

Signed-off-by: chengjinsong2 <chengjinsong2@huawei.com>
This commit is contained in:
chengjinsong2 2022-11-07 16:45:32 +08:00
parent 3d7dded0e6
commit fdeecb61f1
3 changed files with 8 additions and 0 deletions

View File

@ -34,6 +34,8 @@ int SystemWriteParam(const char *name, const char *value);
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);
int AddCmdExecutor(const char *cmdName, CmdExecutor execCmd);

View File

@ -1,6 +1,7 @@
[
{ "name": "SystemWriteParam" },
{ "name": "SystemReadParam" },
{ "name": "LoadParamsFile" },
{ "name": "SplitString" },
{ "name": "AddCmdExecutor" },
{ "name": "RemoveCmdExecutor" },

View File

@ -192,6 +192,11 @@ static int ProcessParamFile(const char *fileName, void *context)
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)
{
PARAM_CHECK(fileName != NULL, return -1, "Invalid filename for load");