15bebb993Sopenharmony_ci/*
25bebb993Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd.
35bebb993Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
45bebb993Sopenharmony_ci * you may not use this file except in compliance with the License.
55bebb993Sopenharmony_ci * You may obtain a copy of the License at
65bebb993Sopenharmony_ci *
75bebb993Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0
85bebb993Sopenharmony_ci *
95bebb993Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
105bebb993Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
115bebb993Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
125bebb993Sopenharmony_ci * See the License for the specific language governing permissions and
135bebb993Sopenharmony_ci * limitations under the License.
145bebb993Sopenharmony_ci */
155bebb993Sopenharmony_ci
165bebb993Sopenharmony_ci#ifndef OHOS_FILE_FFI_H
175bebb993Sopenharmony_ci#define OHOS_FILE_FFI_H
185bebb993Sopenharmony_ci
195bebb993Sopenharmony_ci#include "cj_common_ffi.h"
205bebb993Sopenharmony_ci#include <cstdint>
215bebb993Sopenharmony_ci
225bebb993Sopenharmony_ciextern "C" {
235bebb993Sopenharmony_ci    FFI_EXPORT RetDataI64 FfiOHOSFileFsOpen(const char* path, int64_t mode);
245bebb993Sopenharmony_ci    FFI_EXPORT int32_t FfiOHOSFileFsClose(int64_t file);
255bebb993Sopenharmony_ci    FFI_EXPORT int32_t FfiOHOSFileFsCloseByFd(int32_t file);
265bebb993Sopenharmony_ci    FFI_EXPORT RetDataI64 FfiOHOSFileFsDup(int32_t fd);
275bebb993Sopenharmony_ci    FFI_EXPORT int32_t FfiOHOSFILEFsGetFD(int64_t id);
285bebb993Sopenharmony_ci    FFI_EXPORT const char* FfiOHOSFILEFsGetPath(int64_t id);
295bebb993Sopenharmony_ci    FFI_EXPORT const char* FfiOHOSFILEFsGetName(int64_t id);
305bebb993Sopenharmony_ci    FFI_EXPORT RetCode FfiOHOSFILEFsTryLock(int64_t id, bool exclusive);
315bebb993Sopenharmony_ci    FFI_EXPORT RetCode FfiOHOSFILEFsUnLock(int64_t id);
325bebb993Sopenharmony_ci    FFI_EXPORT RetDataCString FfiOHOSFILEFsGetParent(int64_t id);
335bebb993Sopenharmony_ci}
345bebb993Sopenharmony_ci
355bebb993Sopenharmony_ci#endif // OHOS_FILE_FFI_H
36