• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef BASE_STARTUP_INITLITE_JOBS_INTERNAL_H
16 #define BASE_STARTUP_INITLITE_JOBS_INTERNAL_H
17 #include "cJSON.h"
18 #include "init_cmds.h"
19 
20 #ifdef __cplusplus
21 #if __cplusplus
22 extern "C" {
23 #endif
24 #endif
25 
26 #define MAX_JOB_NAME_LEN 64
27 
28 // one job, could have many cmd lines
29 typedef struct {
30     char name[MAX_JOB_NAME_LEN + 1];
31     CmdLines *cmdLines;
32 } Job;
33 
34 void ParseAllJobs(const cJSON *fileRoot, const ConfigContext *context);
35 void DoJob(const char *jobName);
36 void ReleaseAllJobs(void);
37 void DumpAllJobs(void);
38 
39 int DoJobNow(const char *jobName);
40 
41 #define INIT_CONFIGURATION_FILE "/etc/init.cfg"
42 #define OTHER_CFG_PATH "/system/etc/init"
43 #define OTHER_CHARGE_PATH "/system/etc/charger"
44 #define MAX_PATH_ARGS_CNT 20
45 
46 void ReadConfig(void);
47 
48 #ifdef __cplusplus
49 #if __cplusplus
50 }
51 #endif
52 #endif
53 
54 #endif // BASE_STARTUP_INITLITE_JOBS_INTERNAL_H
55