00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef APR_RESLIST_H
00018 #define APR_RESLIST_H
00019
00025 #include "apr.h"
00026 #include "apu.h"
00027 #include "apr_pools.h"
00028 #include "apr_errno.h"
00029 #include "apr_time.h"
00030
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040
00042 typedef struct apr_reslist_t apr_reslist_t;
00043
00044
00045
00046
00047
00048
00049
00050 typedef apr_status_t (*apr_reslist_constructor)(void **resource, void *params,
00051 apr_pool_t *pool);
00052
00053
00054
00055
00056
00057
00058
00059 typedef apr_status_t (*apr_reslist_destructor)(void *resource, void *params,
00060 apr_pool_t *pool);
00061
00062
00063 #define APR_RESLIST_CLEANUP_DEFAULT 0
00064 #define APR_RESLIST_CLEANUP_FIRST 1
00087 APU_DECLARE(apr_status_t) apr_reslist_create(apr_reslist_t **reslist,
00088 int min, int smax, int hmax,
00089 apr_interval_time_t ttl,
00090 apr_reslist_constructor con,
00091 apr_reslist_destructor de,
00092 void *params,
00093 apr_pool_t *pool);
00094
00106 APU_DECLARE(apr_status_t) apr_reslist_destroy(apr_reslist_t *reslist);
00107
00113 APU_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist,
00114 void **resource);
00115
00119 APU_DECLARE(apr_status_t) apr_reslist_release(apr_reslist_t *reslist,
00120 void *resource);
00121
00128 APU_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist,
00129 apr_interval_time_t timeout);
00130
00135 APU_DECLARE(apr_uint32_t) apr_reslist_acquired_count(apr_reslist_t *reslist);
00136
00142 APU_DECLARE(apr_status_t) apr_reslist_invalidate(apr_reslist_t *reslist,
00143 void *resource);
00144
00150 APU_DECLARE(apr_status_t) apr_reslist_maintain(apr_reslist_t *reslist);
00151
00165 APU_DECLARE(void) apr_reslist_cleanup_order_set(apr_reslist_t *reslist,
00166 apr_uint32_t mode);
00167
00168 #ifdef __cplusplus
00169 }
00170 #endif
00171
00174 #endif