00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef AXIS2_HASH_H
00018 #define AXIS2_HASH_H
00019
00025 #include <axis2_utils_defines.h>
00026 #include <axis2_env.h>
00027
00028 #ifdef __cplusplus
00029 extern "C"
00030 {
00031 #endif
00032
00049 #define AXIS2_HASH_KEY_STRING (-1)
00050
00054 typedef struct axis2_hash_t axis2_hash_t;
00055
00059 typedef struct axis2_hash_index_t axis2_hash_index_t;
00060
00067 typedef unsigned int (*axis2_hashfunc_t) (const char *key, axis2_ssize_t *klen);
00068
00072 unsigned int axis2_hashfunc_default (const char *key, axis2_ssize_t *klen);
00073
00079 AXIS2_EXTERN axis2_hash_t* AXIS2_CALL axis2_hash_make (const axis2_env_t *env);
00080
00087 AXIS2_EXTERN axis2_hash_t* AXIS2_CALL axis2_hash_make_custom (const axis2_env_t *env
00088 , axis2_hashfunc_t hash_func);
00089
00097 AXIS2_EXTERN axis2_hash_t* AXIS2_CALL axis2_hash_copy (const axis2_hash_t *ht
00098 , const axis2_env_t *env);
00099
00108 AXIS2_EXTERN void AXIS2_CALL axis2_hash_set (axis2_hash_t *ht, const void *key
00109 , axis2_ssize_t klen, const void *val);
00110
00118 AXIS2_EXTERN void* AXIS2_CALL axis2_hash_get (axis2_hash_t *ht, const void *key
00119 , axis2_ssize_t klen);
00120
00149 AXIS2_EXTERN axis2_hash_index_t* AXIS2_CALL axis2_hash_first (axis2_hash_t *ht
00150 ,const axis2_env_t *env);
00151
00158 AXIS2_EXTERN axis2_hash_index_t* AXIS2_CALL axis2_hash_next (const axis2_env_t *env
00159 , axis2_hash_index_t *hi);
00160
00170 AXIS2_EXTERN void AXIS2_CALL axis2_hash_this (axis2_hash_index_t *hi, const void **key
00171 , axis2_ssize_t *klen, void **val);
00172
00178 AXIS2_EXTERN unsigned int AXIS2_CALL axis2_hash_count (axis2_hash_t *ht);
00179
00189 AXIS2_EXTERN axis2_hash_t* AXIS2_CALL axis2_hash_overlay (const axis2_hash_t *overlay
00190 ,const axis2_env_t *env, const axis2_hash_t *base);
00191
00206 AXIS2_EXTERN axis2_hash_t* AXIS2_CALL axis2_hash_merge (const axis2_hash_t *h1
00207 , const axis2_env_t *env, const axis2_hash_t *h2
00208 , void *(*merger) (const axis2_env_t *env, const void *key
00209 , axis2_ssize_t klen, const void *h1_val, const void *h2_val
00210 , const void *data), const void *data);
00211
00219 AXIS2_EXTERN axis2_bool_t AXIS2_CALL
00220 axis2_hash_contains_key (
00221 axis2_hash_t *ht,
00222 const axis2_env_t *env,
00223 const axis2_char_t *key);
00224
00232 AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_hash_free(axis2_hash_t *ht
00233 , const axis2_env_t *env);
00234
00242 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00243 axis2_hash_free_void_arg (void *ht_void, const axis2_env_t* env);
00244
00247 #ifdef __cplusplus
00248 }
00249 #endif
00250
00251 #endif