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
17#ifndef OHOS_STREAM_FFI_H
18#define OHOS_STREAM_FFI_H
19
20#include "macro.h"
21#include "cj_common_ffi.h"
22#include "stream_impl.h"
23
24extern "C" {
25FFI_EXPORT RetCode FfiOHOSStreamClose(int64_t id);
26FFI_EXPORT RetCode FfiOHOSStreamFlush(int64_t id);
27FFI_EXPORT RetDataI64 FfiOHOSStreamWriteCur(int64_t id, const char* buffer, int64_t length, const char* encode);
28FFI_EXPORT RetDataI64 FfiOHOSStreamWrite(int64_t id,
29    const char* buffer, int64_t length, int64_t offset, const char* encode);
30FFI_EXPORT RetDataI64 FfiOHOSStreamReadCur(int64_t id, uint8_t* buffer, int64_t bufLen, int64_t length);
31FFI_EXPORT RetDataI64 FfiOHOSStreamRead(int64_t id, uint8_t* buffer, int64_t bufLen, int64_t length, int64_t offset);
32}
33
34#endif // OHOS_STREAM_FFI_H
35