00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef AXIS2_HASH_H
00019 #define AXIS2_HASH_H
00020
00026 #include <axis2_utils_defines.h>
00027 #include <axis2_env.h>
00028
00029 #ifdef __cplusplus
00030 extern "C"
00031 {
00032 #endif
00033
00050 #define AXIS2_HASH_KEY_STRING (-1)
00051
00055 typedef struct axis2_hash_t axis2_hash_t;
00056
00060 typedef struct axis2_hash_index_t axis2_hash_index_t;
00061
00068 typedef unsigned int (*axis2_hashfunc_t) (const char *key, axis2_ssize_t *klen);
00069
00073 unsigned int axis2_hashfunc_default (const char *key, axis2_ssize_t *klen);
00074
00080 AXIS2_EXTERN axis2_hash_t* AXIS2_CALL axis2_hash_make (const axis2_env_t *env);
00081
00088 AXIS2_EXTERN axis2_hash_t* AXIS2_CALL axis2_hash_make_custom (const axis2_env_t *env
00089 , axis2_hashfunc_t hash_func);
00090
00098 AXIS2_EXTERN axis2_hash_t* AXIS2_CALL axis2_hash_copy (const axis2_hash_t *ht
00099 , const axis2_env_t *env);
00100
00109 AXIS2_EXTERN void AXIS2_CALL axis2_hash_set (axis2_hash_t *ht, const void *key
00110 , axis2_ssize_t klen, const void *val);
00111
00119 AXIS2_EXTERN void* AXIS2_CALL axis2_hash_get (axis2_hash_t *ht, const void *key
00120 , axis2_ssize_t klen);
00121
00150 AXIS2_EXTERN axis2_hash_index_t* AXIS2_CALL axis2_hash_first (axis2_hash_t *ht
00151 ,const axis2_env_t *env);
00152
00159 AXIS2_EXTERN axis2_hash_index_t* AXIS2_CALL axis2_hash_next (const axis2_env_t *env
00160 , axis2_hash_index_t *hi);
00161
00171 AXIS2_EXTERN void AXIS2_CALL axis2_hash_this (axis2_hash_index_t *hi, const void **key
00172 , axis2_ssize_t *klen, void **val);
00173
00179 AXIS2_EXTERN unsigned int AXIS2_CALL axis2_hash_count (axis2_hash_t *ht);
00180
00190 AXIS2_EXTERN axis2_hash_t* AXIS2_CALL axis2_hash_overlay (const axis2_hash_t *overlay
00191 ,const axis2_env_t *env, const axis2_hash_t *base);
00192
00207 AXIS2_EXTERN axis2_hash_t* AXIS2_CALL axis2_hash_merge (const axis2_hash_t *h1
00208 , const axis2_env_t *env, const axis2_hash_t *h2
00209 , void *(*merger) (const axis2_env_t *env, const void *key
00210 , axis2_ssize_t klen, const void *h1_val, const void *h2_val
00211 , const void *data), const void *data);
00212
00220 AXIS2_EXTERN axis2_bool_t AXIS2_CALL
00221 axis2_hash_contains_key (
00222 axis2_hash_t *ht,
00223 const axis2_env_t *env,
00224 const axis2_char_t *key);
00225
00233 AXIS2_EXTERN axis2_status_t AXIS2_CALL axis2_hash_free(axis2_hash_t *ht
00234 , const axis2_env_t *env);
00235
00243 AXIS2_EXTERN axis2_status_t AXIS2_CALL
00244 axis2_hash_free_void_arg (void *ht_void, const axis2_env_t* env);
00245
00248 #ifdef __cplusplus
00249 }
00250 #endif
00251
00252 #endif