169570cc8Sopenharmony_ci/* 269570cc8Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 369570cc8Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 469570cc8Sopenharmony_ci * you may not use this file except in compliance with the License. 569570cc8Sopenharmony_ci * You may obtain a copy of the License at 669570cc8Sopenharmony_ci * 769570cc8Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 869570cc8Sopenharmony_ci * 969570cc8Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1069570cc8Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1169570cc8Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1269570cc8Sopenharmony_ci * See the License for the specific language governing permissions and 1369570cc8Sopenharmony_ci * limitations under the License. 1469570cc8Sopenharmony_ci */ 1569570cc8Sopenharmony_ci 1669570cc8Sopenharmony_ci#ifndef HNP_PACK_H 1769570cc8Sopenharmony_ci#define HNP_PACK_H 1869570cc8Sopenharmony_ci 1969570cc8Sopenharmony_ci#include "hnp_base.h" 2069570cc8Sopenharmony_ci 2169570cc8Sopenharmony_ci#ifdef __cplusplus 2269570cc8Sopenharmony_ciextern "C" { 2369570cc8Sopenharmony_ci#endif 2469570cc8Sopenharmony_ci 2569570cc8Sopenharmony_ci// 0x801201 获取绝对路径失败 2669570cc8Sopenharmony_ci#define HNP_ERRNO_PACK_GET_REALPATH_FAILED HNP_ERRNO_COMMON(HNP_MID_PACK, 0x1) 2769570cc8Sopenharmony_ci 2869570cc8Sopenharmony_ci// 0x801202 组装hnp输出路径失败 2969570cc8Sopenharmony_ci#define HNP_ERRNO_PACK_GET_HNP_PATH_FAILED HNP_ERRNO_COMMON(HNP_MID_PACK, 0x2) 3069570cc8Sopenharmony_ci 3169570cc8Sopenharmony_ci// 0x801203 压缩目录失败 3269570cc8Sopenharmony_ci#define HNP_ERRNO_PACK_ZIP_DIR_FAILED HNP_ERRNO_COMMON(HNP_MID_PACK, 0x3) 3369570cc8Sopenharmony_ci 3469570cc8Sopenharmony_ci/* hnp打包参数 */ 3569570cc8Sopenharmony_citypedef struct HnpPackArgvStru { 3669570cc8Sopenharmony_ci char *source; // 待打包目录 3769570cc8Sopenharmony_ci char *output; // 打包后文件存放目录 3869570cc8Sopenharmony_ci char *name; // 软件包名 3969570cc8Sopenharmony_ci char *version; // 版本号 4069570cc8Sopenharmony_ci} HnpPackArgv; 4169570cc8Sopenharmony_ci 4269570cc8Sopenharmony_ci/* hnp打包信息 */ 4369570cc8Sopenharmony_citypedef struct HnpPackInfoStru { 4469570cc8Sopenharmony_ci char source[MAX_FILE_PATH_LEN]; // 待打包目录 4569570cc8Sopenharmony_ci char output[MAX_FILE_PATH_LEN]; // 打包后文件存放目录 4669570cc8Sopenharmony_ci HnpCfgInfo cfgInfo; // hnp配置信息 4769570cc8Sopenharmony_ci int hnpCfgExist; // 是否存在配置文件 4869570cc8Sopenharmony_ci} HnpPackInfo; 4969570cc8Sopenharmony_ci 5069570cc8Sopenharmony_ciint HnpCmdPack(int argc, char *argv[]); 5169570cc8Sopenharmony_ci 5269570cc8Sopenharmony_ci#ifdef __cplusplus 5369570cc8Sopenharmony_ci} 5469570cc8Sopenharmony_ci#endif 5569570cc8Sopenharmony_ci 5669570cc8Sopenharmony_ci#endif