diff options
Diffstat (limited to 'src/lib/mhd_itc_types.h')
-rw-r--r-- | src/lib/mhd_itc_types.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/src/lib/mhd_itc_types.h b/src/lib/mhd_itc_types.h new file mode 100644 index 00000000..04966d36 --- /dev/null +++ b/src/lib/mhd_itc_types.h | |||
@@ -0,0 +1,77 @@ | |||
1 | /* | ||
2 | This file is part of libmicrohttpd | ||
3 | Copyright (C) 2016 Karlson2k (Evgeny Grin), Christian Grothoff | ||
4 | |||
5 | This library is free software; you can redistribute it and/or | ||
6 | modify it under the terms of the GNU Lesser General Public | ||
7 | License as published by the Free Software Foundation; either | ||
8 | version 2.1 of the License, or (at your option) any later version. | ||
9 | |||
10 | This library is distributed in the hope that it will be useful, | ||
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
13 | Lesser General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU Lesser General Public | ||
16 | License along with this library; if not, write to the Free Software | ||
17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | |||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file microhttpd/mhd_itc_types.h | ||
23 | * @brief Types for platform-independent inter-thread communication | ||
24 | * @author Karlson2k (Evgeny Grin) | ||
25 | * @author Christian Grothoff | ||
26 | * | ||
27 | * Provides basic types for inter-thread communication. | ||
28 | * Designed to be included by other headers. | ||
29 | */ | ||
30 | #ifndef MHD_ITC_TYPES_H | ||
31 | #define MHD_ITC_TYPES_H 1 | ||
32 | #include "mhd_options.h" | ||
33 | |||
34 | /* Force socketpair on native W32 */ | ||
35 | #if defined(_WIN32) && !defined(__CYGWIN__) && !defined(_MHD_ITC_SOCKETPAIR) | ||
36 | #error _MHD_ITC_SOCKETPAIR is not defined on naitive W32 platform | ||
37 | #endif /* _WIN32 && !__CYGWIN__ && !_MHD_ITC_SOCKETPAIR */ | ||
38 | |||
39 | #if defined(_MHD_ITC_EVENTFD) | ||
40 | /* **************** Optimized GNU/Linux ITC implementation by eventfd ********** */ | ||
41 | |||
42 | /** | ||
43 | * Data type for a MHD ITC. | ||
44 | */ | ||
45 | struct MHD_itc_ | ||
46 | { | ||
47 | int fd; | ||
48 | }; | ||
49 | |||
50 | #elif defined(_MHD_ITC_PIPE) | ||
51 | /* **************** Standard UNIX ITC implementation by pipe ********** */ | ||
52 | |||
53 | /** | ||
54 | * Data type for a MHD ITC. | ||
55 | */ | ||
56 | struct MHD_itc_ | ||
57 | { | ||
58 | int fd[2]; | ||
59 | }; | ||
60 | |||
61 | |||
62 | #elif defined(_MHD_ITC_SOCKETPAIR) | ||
63 | /* **************** ITC implementation by socket pair ********** */ | ||
64 | |||
65 | #include "mhd_sockets.h" | ||
66 | |||
67 | /** | ||
68 | * Data type for a MHD ITC. | ||
69 | */ | ||
70 | struct MHD_itc_ | ||
71 | { | ||
72 | MHD_socket sk[2]; | ||
73 | }; | ||
74 | |||
75 | #endif /* _MHD_ITC_SOCKETPAIR */ | ||
76 | |||
77 | #endif /* ! MHD_ITC_TYPES_H */ | ||