globus_common 18.14
Loading...
Searching...
No Matches
globus_hashtable.h
Go to the documentation of this file.
1/*
2 * Copyright 1999-2006 University of Chicago
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
22#ifndef GLOBUS_HASHTABLE_H
23#define GLOBUS_HASHTABLE_H
24
37#include "globus_types.h"
38#include "globus_list.h"
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
57typedef int
59 void * key,
60 int limit);
61
69typedef int
71 void * key1,
72 void * key2);
73
78typedef void
80 void ** dest_key,
81 void ** dest_datum,
82 void * src_key,
83 void * src_datum);
84
85
90typedef void
92 void * datum);
93
94typedef struct globus_l_hashtable_s * globus_hashtable_t;
95
96int
98 globus_hashtable_t * table,
99 int size,
102
103int
104globus_hashtable_copy(
105 globus_hashtable_t * dest_table,
106 globus_hashtable_t * src_table,
108
109void *
111 globus_hashtable_t * table,
112 void * key);
113
114int
116 globus_hashtable_t * table,
117 void * key,
118 void * datum);
119
120void *
122 globus_hashtable_t * table,
123 void * key,
124 void * datum);
125
126void *
128 globus_hashtable_t * table,
129 void * key);
130
131int
133 globus_hashtable_t * table,
134 globus_list_t ** list);
135
138 globus_hashtable_t * table);
139
140int
142 globus_hashtable_t * table);
143
160void *
162 globus_hashtable_t * table);
163
164void *
166 globus_hashtable_t * table);
167
168void *
170 globus_hashtable_t * table);
171
172void *
174 globus_hashtable_t * table);
175
176int
178 globus_hashtable_t * table);
179
180void
181globus_hashtable_destroy_all(
182 globus_hashtable_t * table,
184
185int
187 void * string,
188 int limit);
189
190int
192 void * string1,
193 void * string2);
194
195int
197 void * voidp,
198 int limit);
199
200int
202 void * voidp1,
203 void * voidp2);
204
205int
207 void * integer,
208 int limit);
209
210int
212 void * integer1,
213 void * integer2);
214
215int
216globus_hashtable_ulong_hash(
217 void * integer,
218 int limit);
219
220int
221globus_hashtable_ulong_keyeq(
222 void * integer1,
223 void * integer2);
224
225#ifdef __cplusplus
226}
227#endif
228
229#endif /* GLOBUS_HASHTABLE_H */
Linked List.
Common Primitive Types.
int globus_bool_t
Boolean type.
Definition globus_types.h:93
void * globus_hashtable_next(globus_hashtable_t *table)
Increment hash table iterator.
Definition globus_hashtable.c:639
void * globus_hashtable_prev(globus_hashtable_t *table)
Decrement hash table iterator.
Definition globus_hashtable.c:696
void * globus_hashtable_first(globus_hashtable_t *table)
Initialize iterator to first hash table entry.
Definition globus_hashtable.c:612
void * globus_hashtable_last(globus_hashtable_t *table)
Initialize iterator to last hash table entry.
Definition globus_hashtable.c:669
int globus_hashtable_voidp_keyeq(void *voidp1, void *voidp2)
Void pointer equality predicate.
Definition globus_hashtable.c:867
int globus_hashtable_voidp_hash(void *voidp, int limit)
Void pointer hash function.
Definition globus_hashtable.c:849
int(* globus_hashtable_hash_func_t)(void *key, int limit)
Definition globus_hashtable.h:58
int globus_hashtable_int_keyeq(void *integer1, void *integer2)
Integer equality predicate.
Definition globus_hashtable.c:898
int globus_hashtable_int_hash(void *integer, int limit)
Integer hash function.
Definition globus_hashtable.c:886
globus_bool_t globus_hashtable_empty(globus_hashtable_t *table)
Test hash table emptiness.
Definition globus_hashtable.c:580
void * globus_hashtable_update(globus_hashtable_t *table, void *key, void *datum)
Update a hash table mapping.
Definition globus_hashtable.c:377
int globus_hashtable_insert(globus_hashtable_t *table, void *key, void *datum)
Insert a datum into a hash table.
Definition globus_hashtable.c:297
int globus_hashtable_destroy(globus_hashtable_t *table)
Destroy a hash tableDestroys a hashtable representation, releasing any resources used to represent th...
Definition globus_hashtable.c:731
int(* globus_hashtable_keyeq_func_t)(void *key1, void *key2)
Definition globus_hashtable.h:70
int globus_hashtable_string_keyeq(void *string1, void *string2)
Null-terminated string equality predicate.
Definition globus_hashtable.c:825
int globus_hashtable_to_list(globus_hashtable_t *table, globus_list_t **list)
Create a list of all datums in a hash table.
Definition globus_hashtable.c:544
void * globus_hashtable_remove(globus_hashtable_t *table, void *key)
Remove a datum from a hash table.
Definition globus_hashtable.c:463
void(* globus_hashtable_copy_func_t)(void **dest_key, void **dest_datum, void *src_key, void *src_datum)
Definition globus_hashtable.h:79
int globus_hashtable_init(globus_hashtable_t *table, int size, globus_hashtable_hash_func_t hash_func, globus_hashtable_keyeq_func_t keyeq_func)
Initialize a hash table.
Definition globus_hashtable.c:83
int globus_hashtable_string_hash(void *string, int limit)
Null-terminated string hash function.
Definition globus_hashtable.c:803
int globus_hashtable_size(globus_hashtable_t *table)
Hash table size.
Definition globus_hashtable.c:593
void * globus_hashtable_lookup(globus_hashtable_t *table, void *key)
Look up a datum in a hash table.
Definition globus_hashtable.c:423
void(* globus_hashtable_destructor_func_t)(void *datum)
Definition globus_hashtable.h:91
List data type.
Definition globus_list.h:45