m_hash.h File Reference


Detailed Description

a stripped down hashtable implementation. based on glib, but only using the defaults that we need, e.g. we only need basic types.

Go to the source code of this file.

Data Structures

struct  m_hash_node
 individual entries in the hash table More...
struct  m_hash_table
 a hash table data structure More...

Functions

void m_hash_table_destroy (struct m_hash_table *hash_table)
 destroys a hash table.
void * m_hash_table_get (struct m_hash_table *hash_table, const char *key)
 gets a value in the hash table.
int m_hash_table_set (struct m_hash_table *hash_table, char *key, void *value)
 sets a value in the hash table, creating or overwriting if necessary.
void m_hash_table_remove (struct m_hash_table *hash_table, const char *key)
 removes a key/value pair in the hash table.
void m_hash_table_remove_all (struct m_hash_table *hash_table)
 removes all the elements.
const char ** m_hash_table_keys (struct m_hash_table *hash_table)
 returns an array of char * elements representing the keys in the hash table. The last element is NULL to mark the end of the array. The list must be freed after usage to prevent memory leaks.


Function Documentation

int m_hash_table_set ( struct m_hash_table hash_table,
char *  key,
void *  value 
)

sets a value in the hash table, creating or overwriting if necessary.

Returns:
0 on success, non-zero on failure


Generated on Tue May 12 14:40:00 2009 for mondemand by  doxygen 1.4.7