Apache2
apr_hash.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_HASH_H
18 #define APR_HASH_H
19 
25 #include "apr_pools.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
47 #define APR_HASH_KEY_STRING (-1)
48 
52 typedef struct apr_hash_t apr_hash_t;
53 
57 typedef struct apr_hash_index_t apr_hash_index_t;
58 
65 typedef unsigned int (*apr_hashfunc_t)(const char *key, apr_ssize_t *klen);
66 
70 APR_DECLARE_NONSTD(unsigned int) apr_hashfunc_default(const char *key,
71  apr_ssize_t *klen);
72 
79 
87  apr_hashfunc_t hash_func);
88 
97  const apr_hash_t *h);
98 
108 APR_DECLARE(void) apr_hash_set(apr_hash_t *ht, const void *key,
109  apr_ssize_t klen, const void *val);
110 
118 APR_DECLARE(void *) apr_hash_get(apr_hash_t *ht, const void *key,
119  apr_ssize_t klen);
120 
132 APR_DECLARE(void *) apr_hash_get_or_set(apr_hash_t *ht, const void *key,
133  apr_ssize_t klen, const void *val);
134 
163 
171 
181 APR_DECLARE(void) apr_hash_this(apr_hash_index_t *hi, const void **key,
182  apr_ssize_t *klen, void **val);
183 
190 
197 
204 
211 
217 
228  const apr_hash_t *overlay,
229  const apr_hash_t *base);
230 
246  const apr_hash_t *h1,
247  const apr_hash_t *h2,
248  void * (*merger)(apr_pool_t *p,
249  const void *key,
250  apr_ssize_t klen,
251  const void *h1_val,
252  const void *h2_val,
253  const void *data),
254  const void *data);
255 
267 typedef int (apr_hash_do_callback_fn_t)(void *rec, const void *key,
268  apr_ssize_t klen,
269  const void *value);
270 
284  void *rec, const apr_hash_t *ht);
285 
290 
293 #ifdef __cplusplus
294 }
295 #endif
296 
297 #endif /* !APR_HASH_H */
APR memory allocation.
apr_bucket_brigade request_rec apr_pool_t * pool
Definition: mod_dav.h:557
int
Definition: mod_proxy.h:674
void * apr_hash_get(apr_hash_t *ht, const void *key, apr_ssize_t klen)
void apr_hash_clear(apr_hash_t *ht)
unsigned int(* apr_hashfunc_t)(const char *key, apr_ssize_t *klen)
Definition: apr_hash.h:65
void * apr_hash_get_or_set(apr_hash_t *ht, const void *key, apr_ssize_t klen, const void *val)
apr_hash_t * apr_hash_make_custom(apr_pool_t *pool, apr_hashfunc_t hash_func)
apr_hash_t * apr_hash_overlay(apr_pool_t *p, const apr_hash_t *overlay, const apr_hash_t *base)
struct apr_hash_index_t apr_hash_index_t
Definition: apr_hash.h:57
int apr_hash_do(apr_hash_do_callback_fn_t *comp, void *rec, const apr_hash_t *ht)
void apr_hash_set(apr_hash_t *ht, const void *key, apr_ssize_t klen, const void *val)
unsigned int apr_hash_count(apr_hash_t *ht)
apr_hash_t * apr_hash_make(apr_pool_t *pool)
apr_hash_index_t * apr_hash_first(apr_pool_t *p, apr_hash_t *ht)
struct apr_hash_t apr_hash_t
Definition: apr_hash.h:52
const void * apr_hash_this_key(apr_hash_index_t *hi)
unsigned int apr_hashfunc_default(const char *key, apr_ssize_t *klen)
apr_hash_index_t * apr_hash_next(apr_hash_index_t *hi)
apr_hash_t * apr_hash_merge(apr_pool_t *p, const apr_hash_t *h1, const apr_hash_t *h2, void *(*merger)(apr_pool_t *p, const void *key, apr_ssize_t klen, const void *h1_val, const void *h2_val, const void *data), const void *data)
APR_POOL_DECLARE_ACCESSOR(hash)
void apr_hash_this(apr_hash_index_t *hi, const void **key, apr_ssize_t *klen, void **val)
apr_ssize_t apr_hash_this_key_len(apr_hash_index_t *hi)
void * apr_hash_this_val(apr_hash_index_t *hi)
apr_hash_t * apr_hash_copy(apr_pool_t *pool, const apr_hash_t *h)
int() apr_hash_do_callback_fn_t(void *rec, const void *key, apr_ssize_t klen, const void *value)
Definition: apr_hash.h:267
ssize_t apr_ssize_t
Definition: apr.h:395
struct apr_pool_t apr_pool_t
Definition: apr_pools.h:60
#define APR_DECLARE(x)
Definition: macros.h:6
#define APR_DECLARE_NONSTD(x)
Definition: macros.h:7
apr_pool_t * p