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 OHOS_ZIP_FFI_H 17 #define OHOS_ZIP_FFI_H 18 19 #include <cstdint> 20 #include "cj_common_ffi.h" 21 #include "native/ffi_remote_data.h" 22 23 namespace OHOS { 24 namespace AppExecFwk { 25 namespace LIBZIP { 26 27 struct RetOptions { 28 int32_t level; 29 int32_t memLevel; 30 int32_t strategy; 31 }; 32 33 struct CArrUI8 { 34 uint8_t *data; 35 int32_t len; 36 }; 37 38 extern "C" { 39 FFI_EXPORT int32_t FfiBundleManagerCompressFile(CArrUI8 inFile, CArrUI8 outFile, RetOptions options); 40 FFI_EXPORT int32_t FfiBundleManagerDeCompressFileOptions(CArrUI8 inFile, CArrUI8 outFile, RetOptions options); 41 FFI_EXPORT int32_t FfiBundleManagerDeCompressFile(CArrUI8 inFile, CArrUI8 outFile); 42 } 43 44 45 } // LIBZIP 46 } // AppExecFwk 47 } // OHOS 48 #endif 49 50