00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef APR_HASH_H
00018 #define APR_HASH_H
00019
00025 #include "apr_pools.h"
00026
00027 #ifdef __cplusplus
00028 extern "C" {
00029 #endif
00030
00047 #define APR_HASH_KEY_STRING (-1)
00048
00052 typedef struct apr_hash_t apr_hash_t;
00053
00057 typedef struct apr_hash_index_t apr_hash_index_t;
00058
00065 typedef unsigned int (*apr_hashfunc_t)(const char *key, apr_ssize_t *klen);
00066
00070 APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *key,
00071 apr_ssize_t *klen);
00072
00078 APR_DECLARE(apr_hash_t *) apr_hash_make(apr_pool_t *pool);
00079
00086 APR_DECLARE(apr_hash_t *) apr_hash_make_custom(apr_pool_t *pool,
00087 apr_hashfunc_t hash_func);
00088
00096 APR_DECLARE(apr_hash_t *) apr_hash_copy(apr_pool_t *pool,
00097 const apr_hash_t *h);
00098
00107 APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key,
00108 apr_ssize_t klen, const void *val);
00109
00117 APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key,
00118 apr_ssize_t klen);
00119
00148 APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_pool_t *p, apr_hash_t *ht);
00149
00156 APR_DECLARE(apr_hash_index_t *) apr_hash_next(apr_hash_index_t *hi);
00157
00167 APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key,
00168 apr_ssize_t *klen, void **val);
00169
00175 APR_DECLARE(unsigned int) apr_hash_count(apr_hash_t *ht);
00176
00186 APR_DECLARE(apr_hash_t *) apr_hash_overlay(apr_pool_t *p,
00187 const apr_hash_t *overlay,
00188 const apr_hash_t *base);
00189
00204 APR_DECLARE(apr_hash_t *) apr_hash_merge(apr_pool_t *p,
00205 const apr_hash_t *h1,
00206 const apr_hash_t *h2,
00207 void * (*merger)(apr_pool_t *p,
00208 const void *key,
00209 apr_ssize_t klen,
00210 const void *h1_val,
00211 const void *h2_val,
00212 const void *data),
00213 const void *data);
00214
00218 APR_POOL_DECLARE_ACCESSOR(hash);
00219
00222 #ifdef __cplusplus
00223 }
00224 #endif
00225
00226 #endif