summaryrefslogtreecommitdiff
path: root/src/bin/e_datastore.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2008-12-17 15:33:43 +0000
committerCedric BAIL <cedric.bail@free.fr>2008-12-17 15:33:43 +0000
commit773d102291f1341a5e11c5a05027ede526b8d600 (patch)
treef9f367ea2be603598d4264c7b8b699f3046da8f2 /src/bin/e_datastore.c
parente29866312c9e61ba192036c02fe8e612e91b111c (diff)
downloadenlightenment-773d102291f1341a5e11c5a05027ede526b8d600.tar.gz
This commit is huge. I did test it a lot on my computer, and it run fine here.
But is so big i fear i could have broken some piece of code. So report any wrong behaviour to me (cedric on #edevelop). So moving e17 and efreet to eina_hash. With a little efreet API break so they must come together. SVN revision: 38185
Diffstat (limited to 'src/bin/e_datastore.c')
-rw-r--r--src/bin/e_datastore.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/bin/e_datastore.c b/src/bin/e_datastore.c
index 7364a26843..d9676a239a 100644
--- a/src/bin/e_datastore.c
+++ b/src/bin/e_datastore.c
@@ -6,26 +6,30 @@
/* local subsystem functions */
/* local subsystem globals */
-static Evas_Hash *store = NULL;
+static Eina_Hash *store = NULL;
/* externally accessible functions */
EAPI void
e_datastore_set(char *key, void *data)
{
- store = evas_hash_del(store, key, NULL);
- store = evas_hash_add(store, key, data);
+ if (!store) store = eina_hash_string_superfast_new(NULL);
+ eina_hash_del(store, key, NULL);
+ eina_hash_add(store, key, data);
}
EAPI void *
e_datastore_get(char *key)
{
- return evas_hash_find(store, key);
+ return eina_hash_find(store, key);
}
EAPI void
e_datastore_del(char *key)
{
- store = evas_hash_del(store, key, NULL);
+ eina_hash_del(store, key, NULL);
+ if (eina_hash_population(store)) return;
+ eina_hash_free(store);
+ store = NULL;
}
/* local subsystem functions */