galago-hashtable.h File Reference
Hash Table API. More...
#include <libgalago/galago-list.h>
#include <libgalago/galago-types.h>
Go to the source code of this file.
Hash Table API | |
GalagoHashTable * | galago_hash_table_new (GalagoHashFunc hash_func, GalagoEqualFunc key_equal_func) |
Creates a new hash table. | |
GalagoHashTable * | galago_hash_table_new_full (GalagoHashFunc hash_func, GalagoEqualFunc key_equal_func, GalagoFreeFunc destroy_key_func, GalagoFreeFunc destroy_value_func) |
Creates a new hash table. | |
void | galago_hash_table_destroy (GalagoHashTable *hash_table) |
Destroys a hash table. | |
void | galago_hash_table_clear (GalagoHashTable *hash_table) |
Clears a hashtable of all data. | |
void | galago_hash_table_insert (GalagoHashTable *hash_table, void *key, void *value) |
Inserts an item into a hash table. | |
void | galago_hash_table_replace (GalagoHashTable *hash_table, void *key, void *value) |
Replaces an item in a hash table. | |
void | galago_hash_table_remove (GalagoHashTable *hash_table, const void *key) |
Removes an item from a hash table. | |
void * | galago_hash_table_lookup (const GalagoHashTable *hash_table, const void *key) |
Looks up and returns data from a hash table. | |
galago_bool | galago_hash_table_exists (const GalagoHashTable *hash_table, const void *key) |
Returns whether or not data with the specified key exists in a hash table. | |
GalagoList * | galago_hash_table_get_keys (const GalagoHashTable *hash_table) |
Returns a list of all keys in a hash table. | |
GalagoList * | galago_hash_table_get_values (const GalagoHashTable *hash_table) |
Returns a list of all values in a hash table. | |
void | galago_hash_table_foreach (const GalagoHashTable *hash_table, GalagoHForEachFunc func, void *user_data) |
Calls a function on every key and value in a hash table. | |
void | galago_hash_table_foreach_key (const GalagoHashTable *hash_table, GalagoForEachFunc func, void *user_data) |
Calls a function on every key in a hash table. | |
void | galago_hash_table_foreach_value (const GalagoHashTable *hash_table, GalagoForEachFunc func, void *user_data) |
Calls a function on every value in a hash table. | |
size_t | galago_hash_table_get_size (const GalagoHashTable *hash_table) |
Returns the size of the hash table. | |
Hash Functions | |
galago_bool | galago_str_equal (const void *a, const void *b) |
Checks if two strings are equal. | |
unsigned int | galago_str_hash (const void *str) |
Returns the hash of a string. | |
galago_bool | galago_int_equal (const void *a, const void *b) |
Checks if two integers are equal. | |
unsigned int | galago_int_hash (const void *i) |
Returns the hash of an integer. | |
galago_bool | galago_direct_equal (const void *a, const void *b) |
Checks if two pointers are equal. | |
unsigned int | galago_direct_hash (const void *ptr) |
Returns the hash of a pointer. | |
Typedefs | |
typedef _GalagoHashTable | GalagoHashTable |
Detailed Description
Hash Table API.
- Copyright:
- (C) 2004-2005 Christian Hammond.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Definition in file galago-hashtable.h.
Function Documentation
|
Checks if two pointers are equal.
|
|
Returns the hash of a pointer.
|
|
Clears a hashtable of all data.
|
|
Destroys a hash table.
|
|
Returns whether or not data with the specified key exists in a hash table.
|
|
Calls a function on every key and value in a hash table.
|
|
Calls a function on every key in a hash table.
|
|
Calls a function on every value in a hash table.
|
|
Returns a list of all keys in a hash table. The returned list must be freed.
|
|
Returns the size of the hash table.
|
|
Returns a list of all values in a hash table. The returned list must be freed.
|
|
Inserts an item into a hash table.
|
|
Looks up and returns data from a hash table.
|
|
Creates a new hash table.
|
|
Creates a new hash table.
|
|
Removes an item from a hash table.
|
|
Replaces an item in a hash table.
|
|
Checks if two integers are equal.
|
|
Returns the hash of an integer.
|
|
Checks if two strings are equal.
|
|
Returns the hash of a string.
|