00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef AXUTIL_HASH_H
00019 #define AXUTIL_HASH_H
00020
00026 #include <axutil_utils_defines.h>
00027 #include <axutil_env.h>
00028
00029 #ifdef __cplusplus
00030 extern "C"
00031 {
00032 #endif
00033
00050 #define AXIS2_HASH_KEY_STRING (-1)
00051
00055 typedef struct axutil_hash_t axutil_hash_t;
00056
00060 typedef struct axutil_hash_index_t axutil_hash_index_t;
00061
00068 typedef unsigned int(*axutil_hashfunc_t)(const char *key, axis2_ssize_t *klen);
00069
00073 unsigned int axutil_hashfunc_default(const char *key,
00074 axis2_ssize_t *klen);
00075
00081 AXIS2_EXTERN axutil_hash_t* AXIS2_CALL
00082 axutil_hash_make(const axutil_env_t *env);
00083
00090 AXIS2_EXTERN axutil_hash_t* AXIS2_CALL
00091 axutil_hash_make_custom(const axutil_env_t *env,
00092 axutil_hashfunc_t hash_func);
00093
00101 AXIS2_EXTERN axutil_hash_t* AXIS2_CALL
00102 axutil_hash_copy(const axutil_hash_t *ht,
00103 const axutil_env_t *env);
00104
00113 AXIS2_EXTERN void AXIS2_CALL
00114 axutil_hash_set(axutil_hash_t *ht,
00115 const void *key,
00116 axis2_ssize_t klen,
00117 const void *val);
00118
00126 AXIS2_EXTERN void* AXIS2_CALL
00127 axutil_hash_get(axutil_hash_t *ht,
00128 const void *key,
00129 axis2_ssize_t klen);
00130
00159 AXIS2_EXTERN axutil_hash_index_t* AXIS2_CALL
00160 axutil_hash_first(axutil_hash_t *ht,
00161 const axutil_env_t *env);
00162
00169 AXIS2_EXTERN axutil_hash_index_t* AXIS2_CALL
00170 axutil_hash_next(const axutil_env_t *env,
00171 axutil_hash_index_t *hi);
00172
00182 AXIS2_EXTERN void AXIS2_CALL
00183 axutil_hash_this(axutil_hash_index_t *hi,
00184 const void **key,
00185 axis2_ssize_t *klen,
00186 void **val);
00187
00193 AXIS2_EXTERN unsigned int AXIS2_CALL
00194 axutil_hash_count(axutil_hash_t *ht);
00195
00205 AXIS2_EXTERN axutil_hash_t* AXIS2_CALL
00206 axutil_hash_overlay(const axutil_hash_t *overlay,
00207 const axutil_env_t *env,
00208 const axutil_hash_t *base);
00209
00224 AXIS2_EXTERN axutil_hash_t* AXIS2_CALL
00225 axutil_hash_merge(const axutil_hash_t *h1,
00226 const axutil_env_t *env,
00227 const axutil_hash_t *h2,
00228 void *(*merger)(const axutil_env_t *env,
00229 const void *key,
00230 axis2_ssize_t klen,
00231 const void *h1_val,
00232 const void *h2_val,
00233 const void *data),
00234 const void *data);
00235
00243 AXIS2_EXTERN axis2_bool_t AXIS2_CALL
00244 axutil_hash_contains_key(axutil_hash_t *ht,
00245 const axutil_env_t *env,
00246 const axis2_char_t *key);
00247
00255 AXIS2_EXTERN void AXIS2_CALL
00256 axutil_hash_free(axutil_hash_t *ht,
00257 const axutil_env_t *env);
00258
00266 AXIS2_EXTERN void AXIS2_CALL
00267 axutil_hash_free_void_arg(void *ht_void,
00268 const axutil_env_t* env);
00269
00272 #ifdef __cplusplus
00273 }
00274 #endif
00275
00276 #endif
00277
00278