• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 (*CredDumpCallBack)(int);
26 typedef void (*PerformanceDumpCallBack)(int, StringVector *);
27 
28 #ifndef DEV_AUTH_HIVIEW_ENABLE
29 
30 #define DEV_AUTH_DUMP(fd, strArgVec)
31 #define DEV_AUTH_REG_DUMP_FUNC(func)
32 #define DEV_AUTH_REG_CRED_DUMP_FUNC(func)
33 #define DEV_AUTH_REG_PERFORM_DUMP_FUNC(func)
34 
35 #else
36 
37 #define DEV_AUTH_DUMP(fd, strArgVec) DevAuthDump(fd, strArgVec)
38 #define DEV_AUTH_REG_DUMP_FUNC(func) RegisterDumpFunc(func)
39 #define DEV_AUTH_REG_CRED_DUMP_FUNC(func) RegisterCredDumpFunc(func)
40 #define DEV_AUTH_REG_PERFORM_DUMP_FUNC(func) RegisterPerformDumpFunc(func)
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 void DevAuthDump(int fd, StringVector *strArgVec);
47 
48 void RegisterDumpFunc(DumpCallBack func);
49 void RegisterCredDumpFunc(CredDumpCallBack func);
50 void RegisterPerformDumpFunc(PerformanceDumpCallBack func);
51 
52 #ifdef __cplusplus
53 }
54 #endif
55 
56 #endif
57 
58 #endif