param_service.h 1.7 KB
Newer Older
Z
zhong_ning 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * Copyright (c) 2020 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

Z
zhong_ning 已提交
16 17
#ifndef BASE_STARTUP_PARAM_SERVICE_H
#define BASE_STARTUP_PARAM_SERVICE_H
S
sun_fan 已提交
18
#include <limits.h>
Z
zhong_ning 已提交
19
#include <stdio.h>
S
sun_fan 已提交
20

Z
zhong_ning 已提交
21
#include "param_manager.h"
S
sun_fan 已提交
22 23
#include "sys_param.h"

Z
zhong_ning 已提交
24 25 26 27 28 29
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif

S
sun_fan 已提交
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
#define PARAM_WATCH_FLAGS_WAIT 0x01
struct CmdLineEntry {
    char *key;
    int set;
};

int WriteParam(WorkSpace *workSpace, const char *name, const char *value, uint32_t *dataIndex, int onlyAdd);

int InitPersistParamWorkSpace(ParamWorkSpace *workSpace);
void ClosePersistParamWorkSpace(void);
int LoadPersistParam(ParamWorkSpace *workSpace);
int WritePersistParam(ParamWorkSpace *workSpace, const char *name, const char *value);

#ifdef STARTUP_INIT_TEST
int ProcessMessage(const ParamTaskPtr worker, const ParamMessage *msg);
int AddSecurityLabel(const ParamAuditData *auditData, void *context);
#endif
Z
zhong_ning 已提交
47

S
sun_fan 已提交
48 49
int ProcessParamWaitAdd(ParamWorkSpace *worksapce, const ParamTaskPtr worker, const ParamMessage *msg);
int ProcessParamWatchAdd(ParamWorkSpace *worksapce, const ParamTaskPtr worker, const ParamMessage *msg);
Z
zhong_ning 已提交
50 51 52 53 54 55
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif