1 /*
2  * Copyright (c) 2024 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 
16 #ifndef HNP_PACK_H
17 #define HNP_PACK_H
18 
19 #include "hnp_base.h"
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 // 0x801201 获取绝对路径失败
26 #define HNP_ERRNO_PACK_GET_REALPATH_FAILED      HNP_ERRNO_COMMON(HNP_MID_PACK, 0x1)
27 
28 // 0x801202 组装hnp输出路径失败
29 #define HNP_ERRNO_PACK_GET_HNP_PATH_FAILED      HNP_ERRNO_COMMON(HNP_MID_PACK, 0x2)
30 
31 // 0x801203 压缩目录失败
32 #define HNP_ERRNO_PACK_ZIP_DIR_FAILED           HNP_ERRNO_COMMON(HNP_MID_PACK, 0x3)
33 
34 /* hnp打包参数 */
35 typedef struct HnpPackArgvStru {
36     char *source;       // 待打包目录
37     char *output;       // 打包后文件存放目录
38     char *name;         // 软件包名
39     char *version;      // 版本号
40 } HnpPackArgv;
41 
42 /* hnp打包信息 */
43 typedef struct HnpPackInfoStru {
44     char source[MAX_FILE_PATH_LEN];     // 待打包目录
45     char output[MAX_FILE_PATH_LEN];     // 打包后文件存放目录
46     HnpCfgInfo cfgInfo;                 // hnp配置信息
47     int hnpCfgExist;                    // 是否存在配置文件
48 } HnpPackInfo;
49 
50 int HnpCmdPack(int argc, char *argv[]);
51 
52 #ifdef __cplusplus
53 }
54 #endif
55 
56 #endif