Loading...
Searching...
No Matches
globus_hashtable.h
Go to the documentation of this file.
/*
* Copyright 1999-2006 University of Chicago
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef GLOBUS_HASHTABLE_H
#define GLOBUS_HASHTABLE_H
#include "globus_types.h"
#include "globus_list.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef int
(*globus_hashtable_hash_func_t)(
void * key,
int limit);
typedef int
(*globus_hashtable_keyeq_func_t)(
void * key1,
void * key2);
typedef void
(*globus_hashtable_copy_func_t)(
void ** dest_key,
void ** dest_datum,
void * src_key,
void * src_datum);
typedef void
(*globus_hashtable_destructor_func_t)(
void * datum);
typedef struct globus_l_hashtable_s * globus_hashtable_t;
int
globus_hashtable_init(
globus_hashtable_t * table,
int size,
globus_hashtable_hash_func_t hash_func,
globus_hashtable_keyeq_func_t keyeq_func);
int
globus_hashtable_copy(
globus_hashtable_t * dest_table,
globus_hashtable_t * src_table,
globus_hashtable_copy_func_t copy_func);
void *
globus_hashtable_lookup(
globus_hashtable_t * table,
void * key);
int
globus_hashtable_insert(
globus_hashtable_t * table,
void * key,
void * datum);
void *
globus_hashtable_update(
globus_hashtable_t * table,
void * key,
void * datum);
void *
globus_hashtable_remove(
globus_hashtable_t * table,
void * key);
int
globus_hashtable_to_list(
globus_hashtable_t * table,
globus_list_t ** list);
globus_bool_t
globus_hashtable_empty(
globus_hashtable_t * table);
int
globus_hashtable_size(
globus_hashtable_t * table);
void *
globus_hashtable_first(
globus_hashtable_t * table);
void *
globus_hashtable_next(
globus_hashtable_t * table);
void *
globus_hashtable_last(
globus_hashtable_t * table);
void *
globus_hashtable_prev(
globus_hashtable_t * table);
int
globus_hashtable_destroy(
globus_hashtable_t * table);
void
globus_hashtable_destroy_all(
globus_hashtable_t * table,
globus_hashtable_destructor_func_t element_free);
int
globus_hashtable_string_hash(
void * string,
int limit);
int
globus_hashtable_string_keyeq(
void * string1,
void * string2);
int
globus_hashtable_voidp_hash(
void * voidp,
int limit);
int
globus_hashtable_voidp_keyeq(
void * voidp1,
void * voidp2);
int
globus_hashtable_int_hash(
void * integer,
int limit);
int
globus_hashtable_int_keyeq(
void * integer1,
void * integer2);
int
globus_hashtable_ulong_hash(
void * integer,
int limit);
int
globus_hashtable_ulong_keyeq(
void * integer1,
void * integer2);
#ifdef __cplusplus
}
#endif
#endif /* GLOBUS_HASHTABLE_H */
globus_list.h
Linked List.
globus_types.h
Common Primitive Types.
globus_bool_t
int globus_bool_t
Boolean type.
Definition globus_types.h:93
globus_hashtable_next
void * globus_hashtable_next(globus_hashtable_t *table)
Increment hash table iterator.
Definition globus_hashtable.c:639
globus_hashtable_prev
void * globus_hashtable_prev(globus_hashtable_t *table)
Decrement hash table iterator.
Definition globus_hashtable.c:696
globus_hashtable_first
void * globus_hashtable_first(globus_hashtable_t *table)
Initialize iterator to first hash table entry.
Definition globus_hashtable.c:612
globus_hashtable_last
void * globus_hashtable_last(globus_hashtable_t *table)
Initialize iterator to last hash table entry.
Definition globus_hashtable.c:669
globus_hashtable_voidp_keyeq
int globus_hashtable_voidp_keyeq(void *voidp1, void *voidp2)
Void pointer equality predicate.
Definition globus_hashtable.c:867
globus_hashtable_voidp_hash
int globus_hashtable_voidp_hash(void *voidp, int limit)
Void pointer hash function.
Definition globus_hashtable.c:849
globus_hashtable_hash_func_t
int(* globus_hashtable_hash_func_t)(void *key, int limit)
Definition globus_hashtable.h:58
globus_hashtable_int_keyeq
int globus_hashtable_int_keyeq(void *integer1, void *integer2)
Integer equality predicate.
Definition globus_hashtable.c:898
globus_hashtable_int_hash
int globus_hashtable_int_hash(void *integer, int limit)
Integer hash function.
Definition globus_hashtable.c:886
globus_hashtable_empty
globus_bool_t globus_hashtable_empty(globus_hashtable_t *table)
Test hash table emptiness.
Definition globus_hashtable.c:580
globus_hashtable_update
void * globus_hashtable_update(globus_hashtable_t *table, void *key, void *datum)
Update a hash table mapping.
Definition globus_hashtable.c:377
globus_hashtable_insert
int globus_hashtable_insert(globus_hashtable_t *table, void *key, void *datum)
Insert a datum into a hash table.
Definition globus_hashtable.c:297
globus_hashtable_destroy
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
globus_hashtable_keyeq_func_t
int(* globus_hashtable_keyeq_func_t)(void *key1, void *key2)
Definition globus_hashtable.h:70
globus_hashtable_string_keyeq
int globus_hashtable_string_keyeq(void *string1, void *string2)
Null-terminated string equality predicate.
Definition globus_hashtable.c:825
globus_hashtable_to_list
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
globus_hashtable_remove
void * globus_hashtable_remove(globus_hashtable_t *table, void *key)
Remove a datum from a hash table.
Definition globus_hashtable.c:463
globus_hashtable_copy_func_t
void(* globus_hashtable_copy_func_t)(void **dest_key, void **dest_datum, void *src_key, void *src_datum)
Definition globus_hashtable.h:79
globus_hashtable_init
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
globus_hashtable_string_hash
int globus_hashtable_string_hash(void *string, int limit)
Null-terminated string hash function.
Definition globus_hashtable.c:803
globus_hashtable_size
int globus_hashtable_size(globus_hashtable_t *table)
Hash table size.
Definition globus_hashtable.c:593
globus_hashtable_lookup
void * globus_hashtable_lookup(globus_hashtable_t *table, void *key)
Look up a datum in a hash table.
Definition globus_hashtable.c:423
globus_hashtable_destructor_func_t
void(* globus_hashtable_destructor_func_t)(void *datum)
Definition globus_hashtable.h:91
globus_list_t
struct globus_list globus_list_t
List data type.