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
00037 #include "globus_types.h"
00038 #include "globus_list.h"
00039
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043
00057 typedef int
00058 (*globus_hashtable_hash_func_t)(
00059 void * key,
00060 int limit);
00061
00069 typedef int
00070 (*globus_hashtable_keyeq_func_t)(
00071 void * key1,
00072 void * key2);
00073
00078 typedef void
00079 (*globus_hashtable_copy_func_t)(
00080 void ** dest_key,
00081 void ** dest_datum,
00082 void * src_key,
00083 void * src_datum);
00084
00085
00090 typedef void
00091 (*globus_hashtable_destructor_func_t)(
00092 void * datum);
00093
00094 typedef struct globus_l_hashtable_s * globus_hashtable_t;
00095
00096 int
00097 globus_hashtable_init(
00098 globus_hashtable_t * table,
00099 int size,
00100 globus_hashtable_hash_func_t hash_func,
00101 globus_hashtable_keyeq_func_t keyeq_func);
00102
00103 int
00104 globus_hashtable_copy(
00105 globus_hashtable_t * dest_table,
00106 globus_hashtable_t * src_table,
00107 globus_hashtable_copy_func_t copy_func);
00108
00109 void *
00110 globus_hashtable_lookup(
00111 globus_hashtable_t * table,
00112 void * key);
00113
00114 int
00115 globus_hashtable_insert(
00116 globus_hashtable_t * table,
00117 void * key,
00118 void * datum);
00119
00120 void *
00121 globus_hashtable_update(
00122 globus_hashtable_t * table,
00123 void * key,
00124 void * datum);
00125
00126 void *
00127 globus_hashtable_remove(
00128 globus_hashtable_t * table,
00129 void * key);
00130
00131 int
00132 globus_hashtable_to_list(
00133 globus_hashtable_t * table,
00134 globus_list_t ** list);
00135
00136 globus_bool_t
00137 globus_hashtable_empty(
00138 globus_hashtable_t * table);
00139
00140 int
00141 globus_hashtable_size(
00142 globus_hashtable_t * table);
00143
00160 void *
00161 globus_hashtable_first(
00162 globus_hashtable_t * table);
00163
00164 void *
00165 globus_hashtable_next(
00166 globus_hashtable_t * table);
00167
00168 void *
00169 globus_hashtable_last(
00170 globus_hashtable_t * table);
00171
00172 void *
00173 globus_hashtable_prev(
00174 globus_hashtable_t * table);
00175
00176 int
00177 globus_hashtable_destroy(
00178 globus_hashtable_t * table);
00179
00180 void
00181 globus_hashtable_destroy_all(
00182 globus_hashtable_t * table,
00183 globus_hashtable_destructor_func_t element_free);
00184
00185 int
00186 globus_hashtable_string_hash(
00187 void * string,
00188 int limit);
00189
00190 int
00191 globus_hashtable_string_keyeq(
00192 void * string1,
00193 void * string2);
00194
00195 int
00196 globus_hashtable_voidp_hash(
00197 void * voidp,
00198 int limit);
00199
00200 int
00201 globus_hashtable_voidp_keyeq(
00202 void * voidp1,
00203 void * voidp2);
00204
00205 int
00206 globus_hashtable_int_hash(
00207 void * integer,
00208 int limit);
00209
00210 int
00211 globus_hashtable_int_keyeq(
00212 void * integer1,
00213 void * integer2);
00214
00215 int
00216 globus_hashtable_ulong_hash(
00217 void * integer,
00218 int limit);
00219
00220 int
00221 globus_hashtable_ulong_keyeq(
00222 void * integer1,
00223 void * integer2);
00224
00225 #ifdef __cplusplus
00226 }
00227 #endif
00228
00229 #endif