diff --git a/interfaces/innerkits/init_module_engine/include/init_module_engine.h b/interfaces/innerkits/init_module_engine/include/init_module_engine.h index c9de0110ad6d0b92f9d4cb3b468cb86308999891..005a1a29270ae5bbaf00a1915f3cca5fbb275f40 100755 --- a/interfaces/innerkits/init_module_engine/include/init_module_engine.h +++ b/interfaces/innerkits/init_module_engine/include/init_module_engine.h @@ -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); diff --git a/interfaces/innerkits/init_module_engine/stub/libinit.stub.json b/interfaces/innerkits/init_module_engine/stub/libinit.stub.json index 09fae6666efaf87e623d98f78a4315cbee2bafae..bf210c7a4c5e0a8fbdcdf41f58a3e4b5c1cb631b 100755 --- a/interfaces/innerkits/init_module_engine/stub/libinit.stub.json +++ b/interfaces/innerkits/init_module_engine/stub/libinit.stub.json @@ -1,6 +1,7 @@ [ { "name": "SystemWriteParam" }, { "name": "SystemReadParam" }, + { "name": "LoadParamsFile" }, { "name": "SplitString" }, { "name": "AddCmdExecutor" }, { "name": "RemoveCmdExecutor" }, diff --git a/services/param/manager/param_server.c b/services/param/manager/param_server.c index 26af8fe2db42c670258ed908d59054ecacac2436..d1e83952f0a440fdb35bcafba4b73844d96d9ea0 100755 --- a/services/param/manager/param_server.c +++ b/services/param/manager/param_server.c @@ -193,6 +193,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");