1 /* 2 * Copyright (c) 2025 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 SOFTBUS_INIT_COMMON_H 17 #define SOFTBUS_INIT_COMMON_H 18 19 #include <dlfcn.h> 20 #include "stdint.h" 21 #include "stdbool.h" 22 #include "softbus_error_code.h" 23 24 #ifndef NULL 25 #define NULL 0 26 #endif 27 28 typedef enum { 29 SOFTBUS_HANDLE_SERVER_PLUGIN, 30 SOFTBUS_HANDLE_CLIENT_PLUGIN, 31 SOFTBUS_HANDLE_SERVER, 32 SOFTBUS_HANDLE_CLIENT, 33 SOFTBUS_HANDLE_BUTT 34 } SoftBusHandleType; 35 36 #ifdef __cplusplus 37 extern "C" { 38 #endif 39 40 bool SoftbusServerPluginLoadedFlagGet(void); 41 bool SoftbusClientPluginLoadedFlagGet(void); 42 int32_t SoftBusDlopen(SoftBusHandleType type, void **dllHandle); 43 int32_t SoftBusDlsym(const void *DllHandle, const char *funcName, void **funcHandle); 44 void SoftBusDlclose(SoftBusHandleType type); 45 int32_t LnnCheckFuncPointer(void *func); 46 int32_t ConnCheckFuncPointer(void *func); 47 int32_t DiscCheckFuncPointer(void *func); 48 int32_t TransCheckFuncPointer(void *func); 49 int32_t AuthCheckFuncPointer(void *func); 50 int32_t AdapterCheckFuncPointer(void *func); 51 52 #ifdef __cplusplus 53 } 54 #endif 55 56 #endif /* SOFTBUS_INIT_COMMON_H */