Grid Community Toolkit  6.2.1541705016
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 
35 #include "globus_types.h"
36 #include "globus_list.h"
37 
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41 
55 typedef int
57  void * key,
58  int limit);
59 
67 typedef int
69  void * key1,
70  void * key2);
71 
76 typedef void
78  void ** dest_key,
79  void ** dest_datum,
80  void * src_key,
81  void * src_datum);
82 
83 
88 typedef void
90  void * datum);
91 
92 typedef struct globus_l_hashtable_s * globus_hashtable_t;
93 
94 int
96  globus_hashtable_t * table,
97  int size,
100 
101 int
102 globus_hashtable_copy(
103  globus_hashtable_t * dest_table,
104  globus_hashtable_t * src_table,
105  globus_hashtable_copy_func_t copy_func);
106 
107 void *
109  globus_hashtable_t * table,
110  void * key);
111 
112 int
114  globus_hashtable_t * table,
115  void * key,
116  void * datum);
117 
118 void *
120  globus_hashtable_t * table,
121  void * key,
122  void * datum);
123 
124 void *
126  globus_hashtable_t * table,
127  void * key);
128 
129 int
131  globus_hashtable_t * table,
132  globus_list_t ** list);
133 
136  globus_hashtable_t * table);
137 
138 int
140  globus_hashtable_t * table);
141 
156 void *
158  globus_hashtable_t * table);
159 
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 int
174  globus_hashtable_t * table);
175 
176 void
177 globus_hashtable_destroy_all(
178  globus_hashtable_t * table,
180 
181 int
183  void * string,
184  int limit);
185 
186 int
188  void * string1,
189  void * string2);
190 
191 int
193  void * voidp,
194  int limit);
195 
196 int
198  void * voidp1,
199  void * voidp2);
200 
201 int
203  void * integer,
204  int limit);
205 
206 int
208  void * integer1,
209  void * integer2);
210 
211 int
212 globus_hashtable_ulong_hash(
213  void * integer,
214  int limit);
215 
216 int
217 globus_hashtable_ulong_keyeq(
218  void * integer1,
219  void * integer2);
220 
221 #ifdef __cplusplus
222 }
223 #endif
224 
225 #endif /* GLOBUS_HASHTABLE_H */
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
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
int(* globus_hashtable_hash_func_t)(void *key, int limit)
Definition: globus_hashtable.h:56
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:89
int(* globus_hashtable_keyeq_func_t)(void *key1, void *key2)
Definition: globus_hashtable.h:68
List data type.
Definition: globus_list.h:43
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
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_copy_func_t)(void **dest_key, void **dest_datum, void *src_key, void *src_datum)
Definition: globus_hashtable.h:77
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_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