diff options
Diffstat (limited to 'src/microhttpd/mhd_itc.h')
-rw-r--r-- | src/microhttpd/mhd_itc.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/microhttpd/mhd_itc.h b/src/microhttpd/mhd_itc.h index 0f10a2bc..7b2a5cc7 100644 --- a/src/microhttpd/mhd_itc.h +++ b/src/microhttpd/mhd_itc.h | |||
@@ -210,7 +210,7 @@ MHD_itc_nonblocking_ (MHD_itc_ itc); | |||
210 | */ | 210 | */ |
211 | struct MHD_Itc | 211 | struct MHD_Itc |
212 | { | 212 | { |
213 | MHD_socket fd[2]; | 213 | MHD_socket sk[2]; |
214 | }; | 214 | }; |
215 | typedef struct MHD_Itc MHD_itc_; | 215 | typedef struct MHD_Itc MHD_itc_; |
216 | 216 | ||
@@ -219,7 +219,7 @@ typedef struct MHD_Itc MHD_itc_; | |||
219 | * @param itc the itc to initialise | 219 | * @param itc the itc to initialise |
220 | * @return non-zero if succeeded, zero otherwise | 220 | * @return non-zero if succeeded, zero otherwise |
221 | */ | 221 | */ |
222 | #define MHD_itc_init_(itc) MHD_socket_pair_((itc).fd) | 222 | #define MHD_itc_init_(itc) MHD_socket_pair_((itc).sk) |
223 | 223 | ||
224 | /** | 224 | /** |
225 | * Get description string of last pipe error | 225 | * Get description string of last pipe error |
@@ -229,40 +229,40 @@ typedef struct MHD_Itc MHD_itc_; | |||
229 | /** | 229 | /** |
230 | * Write data to emulated pipe | 230 | * Write data to emulated pipe |
231 | */ | 231 | */ |
232 | #define MHD_pipe_write_(pip, ptr, sz) send((pip.fd[1]), (const char*)(ptr), (sz), 0) | 232 | #define MHD_pipe_write_(pip, ptr, sz) send((pip).sk[1], (const char*)(ptr), (sz), 0) |
233 | 233 | ||
234 | #define MHD_pipe_get_read_fd_(pip) (pip.fd[0]) | 234 | #define MHD_pipe_get_read_fd_(pip) ((pip).sk[0]) |
235 | 235 | ||
236 | #define MHD_pipe_get_write_fd_(pip) (pip.fd[1]) | 236 | #define MHD_pipe_get_write_fd_(pip) ((pip).sk[1]) |
237 | 237 | ||
238 | /** | 238 | /** |
239 | * Drain data from emulated pipe | 239 | * Drain data from emulated pipe |
240 | */ | 240 | */ |
241 | #define MHD_pipe_drain_(pip) do { long tmp; while (0 < recv((pip.fd[0]), (void*)&tmp, sizeof (tmp), 0)) ; } while (0) | 241 | #define MHD_pipe_drain_(pip) do { long tmp; while (0 < recv((pip).sk[0], (void*)&tmp, sizeof (tmp), 0)) ; } while (0) |
242 | 242 | ||
243 | 243 | ||
244 | /** | 244 | /** |
245 | * Close emulated pipe FDs | 245 | * Close emulated pipe FDs |
246 | */ | 246 | */ |
247 | #define MHD_pipe_close_(pip) do { \ | 247 | #define MHD_pipe_close_(pip) do { \ |
248 | MHD_socket_close_chk_ ((pip).fd[0]); \ | 248 | MHD_socket_close_chk_ ((pip).sk[0]); \ |
249 | MHD_socket_close_chk_ ((pip).fd[1]); \ | 249 | MHD_socket_close_chk_ ((pip).sk[1]); \ |
250 | } while (0) | 250 | } while (0) |
251 | 251 | ||
252 | /** | 252 | /** |
253 | * Check for uninitialized pipe @a pip | 253 | * Check for uninitialized pipe @a pip |
254 | */ | 254 | */ |
255 | #define MHD_INVALID_PIPE_(pip) (MHD_INVALID_SOCKET == pip.fd[0]) | 255 | #define MHD_INVALID_PIPE_(pip) (MHD_INVALID_SOCKET == (pip).sk[0]) |
256 | 256 | ||
257 | /** | 257 | /** |
258 | * Setup uninitialized @a pip data structure. | 258 | * Setup uninitialized @a pip data structure. |
259 | */ | 259 | */ |
260 | #define MHD_make_invalid_pipe_(pip) do { \ | 260 | #define MHD_make_invalid_pipe_(pip) do { \ |
261 | pip.fd[0] = pip.fd[1] = MHD_INVALID_SOCKET; \ | 261 | pip.sk[0] = pip.sk[1] = MHD_INVALID_SOCKET; \ |
262 | } while (0) | 262 | } while (0) |
263 | 263 | ||
264 | 264 | ||
265 | #define MHD_itc_nonblocking_(pip) (MHD_socket_nonblocking_((pip.fd[0])) && MHD_socket_nonblocking_((pip.fd[1]))) | 265 | #define MHD_itc_nonblocking_(pip) (MHD_socket_nonblocking_((pip).sk[0]) && MHD_socket_nonblocking_((pip).sk[1])) |
266 | 266 | ||
267 | #endif /* _MHD_ITC_SOCKETPAIR */ | 267 | #endif /* _MHD_ITC_SOCKETPAIR */ |
268 | 268 | ||