1 /* 2 * Copyright (c) 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 /** 17 * @addtogroup HDF_IPC_ADAPTER 18 * @{ 19 * 20 * @brief Provides capabilities for the user-mode driver to use inter-process communication (IPC). 21 * 22 * The driver is implemented in C, while IPC is implemented in C++. 23 * This module implements IPC APIs in C based on the IPC over C++. 24 * It provides APIs for registering a service object, registering a function for processing the death 25 * notification of a service object, and implementing the dump mechanism. 26 * 27 * @since 1.0 28 */ 29 30 /** 31 * @file hdf_dump_reg.h 32 * 33 * @brief Provides the dump feature in C based on the IPC dump over C++. 34 * 35 * @since 1.0 36 */ 37 38 #ifndef HDF_DUMP_REG_H 39 #define HDF_DUMP_REG_H 40 41 #include "hdf_sbuf.h" 42 43 #ifdef __cplusplus 44 extern "C" { 45 #endif /* __cplusplus */ 46 47 /** 48 * @brief Implements IPC dump. 49 * 50 * @param data Indicates the pointer to the input parameter, which is obtained from the command line. 51 * @param reply Indicates the pointer to the output parameter, 52 * which is returned by the service module to the command line for display. 53 * @return Returns <b>HDF_SUCCESS</b> if the operation is successful; otherwise, the operation fails. 54 */ 55 typedef int32_t (*DevHostDumpFunc)(struct HdfSBuf *data, struct HdfSBuf *reply); 56 57 /** 58 * @brief Registers the dump function. 59 * 60 * @param dump Indicates the dump function to register. 61 */ 62 void HdfRegisterDumpFunc(DevHostDumpFunc dump); 63 64 #ifdef __cplusplus 65 } 66 #endif /* __cplusplus */ 67 #endif // HDF_DUMP_REG_H 68