aboutsummaryrefslogblamecommitdiffstats
path: root/src/bin/e_datastore.c
blob: eb28ee1834d5837bec44219db61681ef0b0be916 (plain) (tree)
1
2
3
4
5
6
7
8
9




                               
                               

                                     
          

                                      


                                                            

 
            

                          
                                     

 
          

                          



                                           


                               
#include "e.h"

/* local subsystem functions */

/* local subsystem globals */
static Eina_Hash *store = NULL;

/* externally accessible functions */
E_API void
e_datastore_set(char *key, void *data)
{
   if (!store) store = eina_hash_string_superfast_new(NULL);
   eina_hash_del(store, key, NULL);
   eina_hash_add(store, key, data);
}

E_API void *
e_datastore_get(char *key)
{
   return eina_hash_find(store, key);
}

E_API void
e_datastore_del(char *key)
{
   eina_hash_del(store, key, NULL);
   if (eina_hash_population(store)) return;
   eina_hash_free(store);
   store = NULL;
}

/* local subsystem functions */