1 /* 2 * Copyright (C) 2022-2023 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 HIDUMP_ADAPTER_H 17 #define HIDUMP_ADAPTER_H 18 19 #include <stdio.h> 20 #include "hc_string_vector.h" 21 22 #define PERFORM_DUMP_ARG "performance" 23 24 typedef void (*DumpCallBack)(int); 25 typedef void (*PerformanceDumpCallBack)(int, StringVector *); 26 27 #ifndef DEV_AUTH_HIVIEW_ENABLE 28 29 #define DEV_AUTH_DUMP(fd, strArgVec) 30 #define DEV_AUTH_REG_DUMP_FUNC(func) 31 #define DEV_AUTH_REG_PERFORM_DUMP_FUNC(func) 32 33 #else 34 35 #define DEV_AUTH_DUMP(fd, strArgVec) DevAuthDump(fd, strArgVec) 36 #define DEV_AUTH_REG_DUMP_FUNC(func) RegisterDumpFunc(func) 37 #define DEV_AUTH_REG_PERFORM_DUMP_FUNC(func) RegisterPerformDumpFunc(func) 38 39 #ifdef __cplusplus 40 extern "C" { 41 #endif 42 43 void DevAuthDump(int fd, StringVector *strArgVec); 44 45 void RegisterDumpFunc(DumpCallBack func); 46 void RegisterPerformDumpFunc(PerformanceDumpCallBack func); 47 48 #ifdef __cplusplus 49 } 50 #endif 51 52 #endif 53 54 #endif