Grid Community Toolkit  6.2.1629922860 (tag: v6.2.20210826)
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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
41 extern "C" {
42 #endif
43 
57 typedef int
59  void * key,
60  int limit);
61 
69 typedef int
71  void * key1,
72  void * key2);
73 
78 typedef void
80  void ** dest_key,
81  void ** dest_datum,
82  void * src_key,
83  void * src_datum);
84 
85 
90 typedef void
92  void * datum);
93 
94 typedef struct globus_l_hashtable_s * globus_hashtable_t;
95 
96 int
98  globus_hashtable_t * table,
99  int size,
101  globus_hashtable_keyeq_func_t keyeq_func);
102 
103 int
104 globus_hashtable_copy(
105  globus_hashtable_t * dest_table,
106  globus_hashtable_t * src_table,
107  globus_hashtable_copy_func_t copy_func);
108 
109 void *
111  globus_hashtable_t * table,
112  void * key);
113 
114 int
116  globus_hashtable_t * table,
117  void * key,
118  void * datum);
119 
120 void *
122  globus_hashtable_t * table,
123  void * key,
124  void * datum);
125 
126 void *
128  globus_hashtable_t * table,
129  void * key);
130 
131 int
133  globus_hashtable_t * table,
134  globus_list_t ** list);
135 
138  globus_hashtable_t * table);
139 
140 int
142  globus_hashtable_t * table);
143 
160 void *
162  globus_hashtable_t * table);
163 
164 void *
166  globus_hashtable_t * table);
167 
168 void *
170  globus_hashtable_t * table);
171 
172 void *
174  globus_hashtable_t * table);
175 
176 int
178  globus_hashtable_t * table);
179 
180 void
181 globus_hashtable_destroy_all(
182  globus_hashtable_t * table,
184 
185 int
187  void * string,
188  int limit);
189 
190 int
192  void * string1,
193  void * string2);
194 
195 int
197  void * voidp,
198  int limit);
199 
200 int
202  void * voidp1,
203  void * voidp2);
204 
205 int
207  void * integer,
208  int limit);
209 
210 int
212  void * integer1,
213  void * integer2);
214 
215 int
216 globus_hashtable_ulong_hash(
217  void * integer,
218  int limit);
219 
220 int
221 globus_hashtable_ulong_keyeq(
222  void * integer1,
223  void * integer2);
224 
225 #ifdef __cplusplus
226 }
227 #endif
228 
229 #endif /* GLOBUS_HASHTABLE_H */
int(* globus_hashtable_hash_func_t)(void *key, int limit)
Definition: globus_hashtable.h:58
Common Primitive Types.
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_string_keyeq(void *string1, void *string2)
Null-terminated string equality predicate.
Definition: globus_hashtable.c:825
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_insert(globus_hashtable_t *table, void *key, void *datum)
Insert a datum into a hash table.
Definition: globus_hashtable.c:297
int globus_hashtable_int_hash(void *integer, int limit)
Integer hash function.
Definition: globus_hashtable.c:886
int globus_bool_t
Boolean type.
Definition: globus_types.h:93
Linked List.
void * globus_hashtable_first(globus_hashtable_t *table)
Initialize iterator to first hash table entry.
Definition: globus_hashtable.c:612
void * globus_hashtable_lookup(globus_hashtable_t *table, void *key)
Look up a datum in a hash table.
Definition: globus_hashtable.c:423
List data type.
Definition: globus_list.h:44
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
void * globus_hashtable_prev(globus_hashtable_t *table)
Decrement hash table iterator.
Definition: globus_hashtable.c:696
void(* globus_hashtable_destructor_func_t)(void *datum)
Definition: globus_hashtable.h:91
int globus_hashtable_size(globus_hashtable_t *table)
Hash table size.
Definition: globus_hashtable.c:593
int globus_hashtable_string_hash(void *string, int limit)
Null-terminated string hash function.
Definition: globus_hashtable.c:803
void * globus_hashtable_next(globus_hashtable_t *table)
Increment hash table iterator.
Definition: globus_hashtable.c:639
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_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
int globus_hashtable_voidp_hash(void *voidp, int limit)
Void pointer hash function.
Definition: globus_hashtable.c:849
globus_bool_t globus_hashtable_empty(globus_hashtable_t *table)
Test hash table emptiness.
Definition: globus_hashtable.c:580
int(* globus_hashtable_keyeq_func_t)(void *key1, void *key2)
Definition: globus_hashtable.h:70
int globus_hashtable_int_keyeq(void *integer1, void *integer2)
Integer equality predicate.
Definition: globus_hashtable.c:898
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
void * globus_hashtable_remove(globus_hashtable_t *table, void *key)
Remove a datum from a hash table.
Definition: globus_hashtable.c:463