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_FAULTLOGGER_FFI_H 17#define OHOS_FAULTLOGGER_FFI_H 18 19#include <cstdint> 20#include "cj_common_ffi.h" 21#include "ffi_remote_data.h" 22 23constexpr int ERR_PARAM = 401; 24constexpr int ERR_SERVICE_STATUS = 10600001; 25constexpr int ERR_SYSTEM_CAPABILITY = 801; 26 27extern "C" { 28 struct CFaultLogInfo { 29 int32_t pid = 0; 30 int32_t uid = 0; 31 int32_t faultLogType = 0; 32 int64_t timestamp = 0; 33 char* module; 34 char* reason; 35 char* summary; 36 char* fullLog; 37 }; 38 39 struct CArrFaultLogInfo { 40 CFaultLogInfo* head; 41 int64_t size; 42 }; 43 44 FFI_EXPORT CArrFaultLogInfo FfiFaultLoggerQuery(int32_t faultType, int32_t &code); 45} 46 47#endif