typedef struct util_cache_node_t {
void *payload; /* Pointer to the payload */
- time_t add_time; /* Time node was added to cache */
+ apr_time_t add_time; /* Time node was added to cache */
struct util_cache_node_t *next;
} util_cache_node_t;
unsigned long maxentries; /* Maximum number of cache entries */
unsigned long numentries; /* Current number of cache entries */
unsigned long fullmark; /* Used to keep track of when cache becomes 3/4 full */
- time_t marktime; /* Time that the cache became 3/4 full */
+ apr_time_t marktime; /* Time that the cache became 3/4 full */
unsigned long (*hash)(void *); /* Func to hash the payload */
int (*compare)(void *, void *); /* Func to compare two payloads */
void * (*copy)(void *); /* Func to alloc mem and copy payload to new mem */
- void (*free)(void *); /* Func to free mem used by the payload */
+ void (*free)(void *); /* Func to free mem used by the payload */
util_cache_node_t **nodes;
unsigned long numpurges; /* No. of times the cache has been purged */
- double avg_purgetime; /* Average time to purge the cache */
- time_t last_purge; /* Time of the last purge */
+ double avg_purgetime; /* Average time to purge the cache */
+ apr_time_t last_purge; /* Time of the last purge */
unsigned long npurged; /* Number of elements purged in last purge. This is not
obvious: it won't be 3/4 the size of the cache if
there were a lot of expired entries. */
/* here till malloc is gone */
#include <stdlib.h>
-static const int primes[] =
+static const unsigned long primes[] =
{
11,
19,
*/
void util_ald_cache_purge(util_ald_cache_t *cache)
{
- int i;
+ unsigned long i;
util_cache_node_t *p, *q;
apr_time_t t;
void (*freefunc)(void *))
{
util_ald_cache_t *cache;
- int i;
+ unsigned long i;
if (maxentries <= 0)
return NULL;
void util_ald_destroy_cache(util_ald_cache_t *cache)
{
- int i;
+ unsigned long i;
util_cache_node_t *p, *q;
if (cache == NULL)
char *util_ald_cache_display_stats(apr_pool_t *p, util_ald_cache_t *cache, char *name)
{
- int i;
+ unsigned long i;
int totchainlen = 0;
int nchains = 0;
double chainlen;
char *util_ald_cache_display(apr_pool_t *pool)
{
- int i;
+ unsigned long i;
char *buf, *t1, *t2, *t3;
if (!util_ldap_cache) {