Apache2
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
apr_reslist.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_RESLIST_H
18 #define APR_RESLIST_H
19 
25 #include "apr.h"
26 #include "apu.h"
27 #include "apr_pools.h"
28 #include "apr_errno.h"
29 #include "apr_time.h"
30 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif /* __cplusplus */
40 
43 
44 /* Generic constructor called by resource list when it needs to create a
45  * resource.
46  * @param resource opaque resource
47  * @param params flags
48  * @param pool Pool
49  */
50 typedef apr_status_t (*apr_reslist_constructor)(void **resource, void *params,
51  apr_pool_t *pool);
52 
53 /* Generic destructor called by resource list when it needs to destroy a
54  * resource.
55  * @param resource opaque resource
56  * @param params flags
57  * @param pool Pool
58  */
59 typedef apr_status_t (*apr_reslist_destructor)(void *resource, void *params,
60  apr_pool_t *pool);
61 
62 /* Cleanup order modes */
63 #define APR_RESLIST_CLEANUP_DEFAULT 0
64 #define APR_RESLIST_CLEANUP_FIRST 1
89 APR_DECLARE(apr_status_t) apr_reslist_create(apr_reslist_t **reslist,
90  int min, int smax, int hmax,
94  void *params,
95  apr_pool_t *pool);
96 
109 
110 /* Acquire order modes */
111 #define APR_RESLIST_ACQUIRE_LIFO 0x0
112 #define APR_RESLIST_ACQUIRE_FIFO 0x1
113 #define APR_RESLIST_ACQUIRE_MASK 0x1
114 
126  void **resource, int flags);
127 
137  void **resource);
138 
145  void *resource);
146 
154  apr_interval_time_t timeout);
155 
161 
170  void *resource);
171 
178 
193  apr_uint32_t mode);
194 
195 #ifdef __cplusplus
196 }
197 #endif
198 
201 #endif /* ! APR_RESLIST_H */
struct apr_reslist_t apr_reslist_t
Definition: apr_reslist.h:42
void apr_reslist_timeout_set(apr_reslist_t *reslist, apr_interval_time_t timeout)
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:552
apr_status_t apr_reslist_maintain(apr_reslist_t *reslist)
apr_status_t apr_reslist_acquire(apr_reslist_t *reslist, void **resource)
apr_int64_t apr_interval_time_t
Definition: apr_time.h:55
apr_status_t apr_reslist_destroy(apr_reslist_t *reslist)
APR memory allocation.
void apr_reslist_cleanup_order_set(apr_reslist_t *reslist, apr_uint32_t mode)
APR Error Codes.
unsigned int apr_uint32_t
Definition: apr.h:334
APR Platform Definitions.
apr_uint32_t apr_reslist_acquired_count(apr_reslist_t *reslist)
apr_status_t apr_reslist_release(apr_reslist_t *reslist, void *resource)
apr_status_t apr_reslist_invalidate(apr_reslist_t *reslist, void *resource)
apr_status_t(* apr_reslist_destructor)(void *resource, void *params, apr_pool_t *pool)
Definition: apr_reslist.h:59
#define APR_DECLARE(x)
Definition: macros.h:6
const dav_resource * resource
Definition: mod_dav.h:994
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
int apr_status_t
Definition: apr_errno.h:44
APR Time Library.
apr_status_t(* apr_reslist_constructor)(void **resource, void *params, apr_pool_t *pool)
Definition: apr_reslist.h:50
apr_status_t apr_reslist_acquire_ex(apr_reslist_t *reslist, void **resource, int flags)
dav_resource int dav_locktoken dav_response int flags
Definition: mod_dav.h:1346