Loading...
Searching...
No Matches
apr_reslist.h
Go to the documentation of this file.
/* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef APR_RESLIST_H
#define APR_RESLIST_H
#include "apr.h"
#include "apu.h"
#include "apr_pools.h"
#include "apr_errno.h"
#include "apr_time.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct apr_reslist_t apr_reslist_t;
/* Generic constructor called by resource list when it needs to create a
* resource.
* @param resource opaque resource
* @param params flags
* @param pool Pool
*/
typedef apr_status_t (*apr_reslist_constructor)(void **resource, void *params,
apr_pool_t *pool);
/* Generic destructor called by resource list when it needs to destroy a
* resource.
* @param resource opaque resource
* @param params flags
* @param pool Pool
*/
typedef apr_status_t (*apr_reslist_destructor)(void *resource, void *params,
apr_pool_t *pool);
/* Cleanup order modes */
#define APR_RESLIST_CLEANUP_DEFAULT 0
#define APR_RESLIST_CLEANUP_FIRST 1
APU_DECLARE(apr_status_t) apr_reslist_create(apr_reslist_t **reslist,
int min, int smax, int hmax,
apr_interval_time_t ttl,
apr_reslist_constructor con,
apr_reslist_destructor de,
void *params,
apr_pool_t *pool);
APU_DECLARE(apr_status_t) apr_reslist_destroy(apr_reslist_t *reslist);
APU_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist,
void **resource);
APU_DECLARE(apr_status_t) apr_reslist_release(apr_reslist_t *reslist,
void *resource);
APU_DECLARE(void) apr_reslist_timeout_set(apr_reslist_t *reslist,
apr_interval_time_t timeout);
APU_DECLARE(apr_uint32_t) apr_reslist_acquired_count(apr_reslist_t *reslist);
APU_DECLARE(apr_status_t) apr_reslist_invalidate(apr_reslist_t *reslist,
void *resource);
APU_DECLARE(apr_status_t) apr_reslist_maintain(apr_reslist_t *reslist);
APU_DECLARE(void) apr_reslist_cleanup_order_set(apr_reslist_t *reslist,
apr_uint32_t mode);
#ifdef __cplusplus
}
#endif
#endif /* ! APR_RESLIST_H */
apr_reslist_destroy
apr_status_t apr_reslist_destroy(apr_reslist_t *reslist)
apr_reslist_invalidate
apr_status_t apr_reslist_invalidate(apr_reslist_t *reslist, void *resource)
apr_reslist_create
apr_status_t apr_reslist_create(apr_reslist_t **reslist, int min, int smax, int hmax, apr_interval_time_t ttl, apr_reslist_constructor con, apr_reslist_destructor de, void *params, apr_pool_t *pool)
apr_reslist_t
struct apr_reslist_t apr_reslist_t
Definition apr_reslist.h:42
apr_reslist_cleanup_order_set
void apr_reslist_cleanup_order_set(apr_reslist_t *reslist, apr_uint32_t mode)
apr_reslist_maintain
apr_status_t apr_reslist_maintain(apr_reslist_t *reslist)
apr_reslist_acquired_count
apr_uint32_t apr_reslist_acquired_count(apr_reslist_t *reslist)
apr_reslist_acquire
apr_status_t apr_reslist_acquire(apr_reslist_t *reslist, void **resource)
apr_reslist_release
apr_status_t apr_reslist_release(apr_reslist_t *reslist, void *resource)
apr_reslist_timeout_set
void apr_reslist_timeout_set(apr_reslist_t *reslist, apr_interval_time_t timeout)