Apache2
apr_poll.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef APR_POLL_H
18 #define APR_POLL_H
23 #include "apr.h"
24 #include "apr_pools.h"
25 #include "apr_errno.h"
26 #include "apr_inherit.h"
27 #include "apr_file_io.h"
28 #include "apr_network_io.h"
29 
30 #if APR_HAVE_NETINET_IN_H
31 #include <netinet/in.h>
32 #endif
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif /* __cplusplus */
37 
49 #define APR_POLLIN 0x001
50 #define APR_POLLPRI 0x002
51 #define APR_POLLOUT 0x004
52 #define APR_POLLERR 0x010
53 #define APR_POLLHUP 0x020
54 #define APR_POLLNVAL 0x040
55 #define APR_POLLEXCL 0x080
63 #define APR_POLLSET_THREADSAFE 0x001
66 #define APR_POLLSET_NOCOPY 0x002
69 #define APR_POLLSET_WAKEABLE 0x004
72 #define APR_POLLSET_NODEFAULT 0x010
81 typedef enum {
90 
92 typedef enum {
98 
100 typedef union {
104 
106 typedef struct apr_pollfd_t apr_pollfd_t;
107 
109 struct apr_pollfd_t {
115  void *client_data;
116 };
117 
118 
119 /* General-purpose poll API for arbitrarily large numbers of
120  * file descriptors
121  */
122 
124 typedef struct apr_pollset_t apr_pollset_t;
125 
157  apr_pool_t *p,
159 
194  apr_pool_t *p,
196  apr_pollset_method_e method);
197 
203 
231  const apr_pollfd_t *descriptor);
232 
252  const apr_pollfd_t *descriptor);
253 
273  apr_interval_time_t timeout,
274  apr_int32_t *num,
275  const apr_pollfd_t **descriptors);
276 
284 
302  apr_int32_t *nsds,
303  apr_interval_time_t timeout);
304 
310 
316 
318 typedef struct apr_pollcb_t apr_pollcb_t;
319 
336  apr_pool_t *p,
338 
358  apr_pool_t *p,
360  apr_pollset_method_e method);
361 
380  apr_pollfd_t *descriptor);
391  apr_pollfd_t *descriptor);
392 
402 typedef apr_status_t (*apr_pollcb_cb_t)(void *baton, apr_pollfd_t *descriptor);
403 
422  apr_interval_time_t timeout,
423  apr_pollcb_cb_t func,
424  void *baton);
425 
433 
439 
442 #ifdef __cplusplus
443 }
444 #endif
445 
446 #endif /* ! APR_POLL_H */
447 
APR Platform Definitions.
APR Error Codes.
APR File I/O Handling.
APR File Handle Inheritance Helpers.
APR Network library.
APR memory allocation.
dav_resource int dav_locktoken dav_response int flags
Definition: mod_dav.h:1458
dav_buffer apr_size_t size
Definition: mod_dav.h:461
int apr_status_t
Definition: apr_errno.h:44
int apr_int32_t
Definition: apr.h:347
short apr_int16_t
Definition: apr.h:344
unsigned int apr_uint32_t
Definition: apr.h:348
apr_datatype_e
Definition: apr_poll.h:92
apr_status_t apr_pollcb_poll(apr_pollcb_t *pollcb, apr_interval_time_t timeout, apr_pollcb_cb_t func, void *baton)
apr_status_t(* apr_pollcb_cb_t)(void *baton, apr_pollfd_t *descriptor)
Definition: apr_poll.h:402
apr_status_t apr_pollcb_create_ex(apr_pollcb_t **pollcb, apr_uint32_t size, apr_pool_t *p, apr_uint32_t flags, apr_pollset_method_e method)
apr_status_t apr_pollset_remove(apr_pollset_t *pollset, const apr_pollfd_t *descriptor)
const char * apr_pollcb_method_name(apr_pollcb_t *pollcb)
apr_status_t apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, apr_uint32_t flags)
apr_status_t apr_pollset_add(apr_pollset_t *pollset, const apr_pollfd_t *descriptor)
const char * apr_poll_method_defname(void)
apr_status_t apr_pollset_poll(apr_pollset_t *pollset, apr_interval_time_t timeout, apr_int32_t *num, const apr_pollfd_t **descriptors)
apr_status_t apr_pollcb_create(apr_pollcb_t **pollcb, apr_uint32_t size, apr_pool_t *p, apr_uint32_t flags)
apr_status_t apr_pollcb_add(apr_pollcb_t *pollcb, apr_pollfd_t *descriptor)
const char * apr_pollset_method_name(apr_pollset_t *pollset)
apr_status_t apr_pollset_create_ex(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, apr_uint32_t flags, apr_pollset_method_e method)
apr_status_t apr_pollset_destroy(apr_pollset_t *pollset)
apr_pollset_method_e
Definition: apr_poll.h:81
apr_status_t apr_pollset_wakeup(apr_pollset_t *pollset)
apr_status_t apr_pollcb_wakeup(apr_pollcb_t *pollcb)
apr_status_t apr_pollcb_remove(apr_pollcb_t *pollcb, apr_pollfd_t *descriptor)
apr_status_t apr_poll(apr_pollfd_t *aprset, apr_int32_t numsock, apr_int32_t *nsds, apr_interval_time_t timeout)
@ APR_POLL_SOCKET
Definition: apr_poll.h:94
@ APR_POLL_LASTDESC
Definition: apr_poll.h:96
@ APR_POLL_FILE
Definition: apr_poll.h:95
@ APR_NO_DESC
Definition: apr_poll.h:93
@ APR_POLLSET_EPOLL
Definition: apr_poll.h:86
@ APR_POLLSET_KQUEUE
Definition: apr_poll.h:84
@ APR_POLLSET_SELECT
Definition: apr_poll.h:83
@ APR_POLLSET_POLL
Definition: apr_poll.h:87
@ APR_POLLSET_AIO_MSGQ
Definition: apr_poll.h:88
@ APR_POLLSET_DEFAULT
Definition: apr_poll.h:82
@ APR_POLLSET_PORT
Definition: apr_poll.h:85
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
apr_int64_t apr_interval_time_t
Definition: apr_time.h:55
#define APR_DECLARE(x)
Definition: macros.h:6
Definition: apr_arch_file_io.h:107
Definition: apr_arch_poll_private.h:157
Definition: apr_poll.h:109
void * client_data
Definition: apr_poll.h:115
apr_int16_t reqevents
Definition: apr_poll.h:112
apr_datatype_e desc_type
Definition: apr_poll.h:111
apr_descriptor desc
Definition: apr_poll.h:114
apr_pool_t * p
Definition: apr_poll.h:110
apr_int16_t rtnevents
Definition: apr_poll.h:113
Definition: apr_arch_poll_private.h:124
Definition: apr_arch_networkio.h:37
apr_pool_t * p
Definition: apr_poll.h:100
apr_socket_t * s
Definition: apr_poll.h:102
apr_file_t * f
Definition: apr_poll.h:101