00001 #ifndef __M_HASH_H__
00002 #define __M_HASH_H__
00003
00012 struct m_hash_node
00013 {
00014
00015 char *key;
00016
00017 void *value;
00018
00019 struct m_hash_node *next;
00020 };
00021
00025 struct m_hash_table
00026 {
00027
00028 int size;
00029
00030 int num;
00031
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