• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 ZipCompressParam {
34     uint8_t* destBuf;
35     int64_t destBufLen;
36     uint8_t* srcBuf;
37     int64_t srcBufLen;
38     int32_t outStatus;
39     int64_t outDestLen;
40     int32_t level;
41 };
42 
43 struct CZStream {
44     uint8_t* nextIn;
45     uint32_t availableIn;
46     uint64_t totalIn;
47     uint8_t* nextOut;
48     uint32_t availableOut;
49     uint64_t totalOut;
50     int32_t dataType;
51     uint64_t adler;
52 
53     bool hasNextIn;
54     bool hasAvailableIn;
55     bool hasTotalIn;
56     bool hasNextOut;
57     bool hasAvailableOut;
58     bool hasTotalOut;
59     bool hasDataType;
60     bool hasAdler;
61 };
62 
63 struct DeflateInit2Param {
64     int32_t level;
65     int32_t method;
66     int32_t windowBits;
67     int32_t memLevel;
68     int32_t strategy;
69 };
70 
71 } // LIBZIP
72 } // AppExecFwk
73 } // OHOS
74 #endif
75