1 /* 2 * Copyright (C) 2021 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 #ifndef HDC_COMMON_H 16 #define HDC_COMMON_H 17 18 #include <algorithm> 19 #include <assert.h> 20 #include <atomic> 21 #include <cctype> 22 #include <cinttypes> 23 #include <cstdarg> 24 #include <ctime> 25 #include <condition_variable> 26 #include <fcntl.h> 27 #include <functional> 28 #include <list> 29 #include <map> 30 #include <mutex> 31 #include <queue> 32 #include <set> 33 #include <string> 34 #include <stdio.h> 35 #include <sys/types.h> 36 #include <unistd.h> 37 #ifdef CONFIG_USE_JEMALLOC_DFX_INIF 38 #include <malloc.h> 39 #endif 40 #include <vector> 41 42 using std::condition_variable; 43 using std::list; 44 using std::map; 45 using std::mutex; 46 using std::string; 47 using std::vector; 48 49 // clang-format off 50 #include <uv.h> // libuv 1.35 51 #ifdef HDC_HOST 52 53 #ifdef HARMONY_PROJECT 54 #include <libusb/libusb.h> 55 #else // NOT HARMONY_PROJECT 56 #include <libusb-1.0/libusb.h> 57 #endif // END HARMONY_PROJECT 58 59 #else // NOT HDC_HOST 60 #endif // HDC_HOST 61 62 #ifndef _WIN32 63 #include <sys/socket.h> 64 #include <sys/un.h> 65 #endif 66 67 #include <securec.h> 68 #include <limits.h> 69 70 #include "circle_buffer.h" 71 #include "define.h" 72 #include "debug.h" 73 #include "base.h" 74 #include "task.h" 75 #include "channel.h" 76 #include "session.h" 77 #include "auth.h" 78 79 #include "tcp.h" 80 #include "usb.h" 81 #ifdef HDC_SUPPORT_UART 82 #include "uart.h" 83 #endif 84 #include "file_descriptor.h" 85 86 // clang-format on 87 88 #endif // !defined(COMMON_H_INCLUDED) 89