m_hash.h

Go to the documentation of this file.
00001 #ifndef __M_HASH_H__
00002 #define __M_HASH_H__
00003 
00012 struct m_hash_node
00013 {
00014   /* the key */
00015   char *key;
00016   /* the value */
00017   void *value;
00018   /* next element if this bin has more than one element */
00019   struct m_hash_node *next;
00020 };
00021 
00025 struct m_hash_table
00026 {
00027   /* size of table */
00028   int size;
00029   /* number of actual entries */
00030   int num;
00031   /* array of actual entries */
00032   void **nodes;
00033 };
00034 
00038 struct m_hash_table *m_hash_table_create(void);
00039 
00043 void m_hash_table_destroy(struct m_hash_table *hash_table);
00044 
00049 void *m_hash_table_get(struct m_hash_table *hash_table, const char *key);
00050 
00056 int m_hash_table_set(struct m_hash_table *hash_table, char *key, void *value);
00057 
00062 void m_hash_table_remove(struct m_hash_table *hash_table, const char *key);
00063 
00067 void m_hash_table_remove_all(struct m_hash_table *hash_table);
00068 
00075 const char **
00076 m_hash_table_keys(struct m_hash_table *hash_table);
00077 
00078 #endif

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