2005-06-01 21:21:00 -07:00
|
|
|
#include "e.h"
|
|
|
|
|
|
|
|
/* local subsystem functions */
|
|
|
|
|
|
|
|
/* local subsystem globals */
|
2008-12-17 07:33:43 -08:00
|
|
|
static Eina_Hash *store = NULL;
|
2005-06-01 21:21:00 -07:00
|
|
|
|
|
|
|
/* externally accessible functions */
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2005-06-01 21:21:00 -07:00
|
|
|
e_datastore_set(char *key, void *data)
|
|
|
|
{
|
2008-12-17 07:33:43 -08:00
|
|
|
if (!store) store = eina_hash_string_superfast_new(NULL);
|
|
|
|
eina_hash_del(store, key, NULL);
|
|
|
|
eina_hash_add(store, key, data);
|
2005-06-01 21:21:00 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void *
|
2005-06-01 21:21:00 -07:00
|
|
|
e_datastore_get(char *key)
|
|
|
|
{
|
2008-12-17 07:33:43 -08:00
|
|
|
return eina_hash_find(store, key);
|
2005-06-01 21:21:00 -07:00
|
|
|
}
|
|
|
|
|
2015-05-07 12:13:10 -07:00
|
|
|
E_API void
|
2005-06-01 21:21:00 -07:00
|
|
|
e_datastore_del(char *key)
|
|
|
|
{
|
2008-12-17 07:33:43 -08:00
|
|
|
eina_hash_del(store, key, NULL);
|
|
|
|
if (eina_hash_population(store)) return;
|
|
|
|
eina_hash_free(store);
|
|
|
|
store = NULL;
|
2005-06-01 21:21:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* local subsystem functions */
|