00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00022 #ifndef GLOBUS_HASHTABLE_H
00023 #define GLOBUS_HASHTABLE_H
00024
00035 #include "globus_types.h"
00036 #include "globus_list.h"
00037
00038 #ifdef __cplusplus
00039 extern "C" {
00040 #endif
00041
00055 typedef int
00056 (*globus_hashtable_hash_func_t)(
00057 void * key,
00058 int limit);
00059
00067 typedef int
00068 (*globus_hashtable_keyeq_func_t)(
00069 void * key1,
00070 void * key2);
00071
00076 typedef void
00077 (*globus_hashtable_copy_func_t)(
00078 void ** dest_key,
00079 void ** dest_datum,
00080 void * src_key,
00081 void * src_datum);
00082
00083
00088 typedef void
00089 (*globus_hashtable_destructor_func_t)(
00090 void * datum);
00091
00092 typedef struct globus_l_hashtable_s * globus_hashtable_t;
00093
00094 int
00095 globus_hashtable_init(
00096 globus_hashtable_t * table,
00097 int size,
00098 globus_hashtable_hash_func_t hash_func,
00099 globus_hashtable_keyeq_func_t keyeq_func);
00100
00101 int
00102 globus_hashtable_copy(
00103 globus_hashtable_t * dest_table,
00104 globus_hashtable_t * src_table,
00105 globus_hashtable_copy_func_t copy_func);
00106
00107 void *
00108 globus_hashtable_lookup(
00109 globus_hashtable_t * table,
00110 void * key);
00111
00112 int
00113 globus_hashtable_insert(
00114 globus_hashtable_t * table,
00115 void * key,
00116 void * datum);
00117
00118 void *
00119 globus_hashtable_update(
00120 globus_hashtable_t * table,
00121 void * key,
00122 void * datum);
00123
00124 void *
00125 globus_hashtable_remove(
00126 globus_hashtable_t * table,
00127 void * key);
00128
00129 int
00130 globus_hashtable_to_list(
00131 globus_hashtable_t * table,
00132 globus_list_t ** list);
00133
00134 globus_bool_t
00135 globus_hashtable_empty(
00136 globus_hashtable_t * table);
00137
00138 int
00139 globus_hashtable_size(
00140 globus_hashtable_t * table);
00141
00156 void *
00157 globus_hashtable_first(
00158 globus_hashtable_t * table);
00159
00160 void *
00161 globus_hashtable_next(
00162 globus_hashtable_t * table);
00163
00164 void *
00165 globus_hashtable_last(
00166 globus_hashtable_t * table);
00167
00168 void *
00169 globus_hashtable_prev(
00170 globus_hashtable_t * table);
00171
00172 int
00173 globus_hashtable_destroy(
00174 globus_hashtable_t * table);
00175
00176 void
00177 globus_hashtable_destroy_all(
00178 globus_hashtable_t * table,
00179 globus_hashtable_destructor_func_t element_free);
00180
00181 int
00182 globus_hashtable_string_hash(
00183 void * string,
00184 int limit);
00185
00186 int
00187 globus_hashtable_string_keyeq(
00188 void * string1,
00189 void * string2);
00190
00191 int
00192 globus_hashtable_voidp_hash(
00193 void * voidp,
00194 int limit);
00195
00196 int
00197 globus_hashtable_voidp_keyeq(
00198 void * voidp1,
00199 void * voidp2);
00200
00201 int
00202 globus_hashtable_int_hash(
00203 void * integer,
00204 int limit);
00205
00206 int
00207 globus_hashtable_int_keyeq(
00208 void * integer1,
00209 void * integer2);
00210
00211 int
00212 globus_hashtable_ulong_hash(
00213 void * integer,
00214 int limit);
00215
00216 int
00217 globus_hashtable_ulong_keyeq(
00218 void * integer1,
00219 void * integer2);
00220
00221 #ifdef __cplusplus
00222 }
00223 #endif
00224
00225 #endif