From a0d654aa60b652233399adf6c5bc5e9e82f22be1 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Thu, 2 Jun 2005 04:21:00 +0000 Subject: [PATCH] datastore for moduels to share data via - they are in charge of cleaning up and reference counts and stuff tho SVN revision: 15049 --- TODO | 4 ++++ src/bin/Makefile.am | 4 +++- src/bin/e_datastore.c | 31 +++++++++++++++++++++++++++++++ src/bin/e_datastore.h | 15 +++++++++++++++ src/bin/e_prefix.c | 1 + 5 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 src/bin/e_datastore.c create mode 100644 src/bin/e_datastore.h diff --git a/TODO b/TODO index 45a8f773f..cda0f9591 100644 --- a/TODO +++ b/TODO @@ -55,6 +55,10 @@ Also look at all the .c files - they have their own localized TODO lists These are in no particular order: +* libechack needs to come back - and execute all things with libehack preloads active +* get all libehack properties if they exist +* titlebar/border expansion/gadget panel for moduels to put window widgets in +* a generic module messaging system (events with strings) * add actions to flip desktops on a given zone and/or container only * don't show borders before window * double check edje and evas image caches are working diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index 0c01731e2..5891e8ead 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -55,7 +55,8 @@ e_moveresize.h \ e_actions.h \ e_popup.h \ e_ipc_codec.h \ -e_prefix.h +e_prefix.h \ +e_datastore.h enlightenment_SOURCES = \ e_main.c \ @@ -102,6 +103,7 @@ e_actions.c \ e_popup.c \ e_ipc_codec.c \ e_prefix.c \ +e_datastore.c \ $(ENLIGHTENMENTHEADERS) enlightenment_LDFLAGS = -export-dynamic @e_libs@ @dlopen_libs@ diff --git a/src/bin/e_datastore.c b/src/bin/e_datastore.c new file mode 100644 index 000000000..e95fc4c26 --- /dev/null +++ b/src/bin/e_datastore.c @@ -0,0 +1,31 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ +#include "e.h" + +/* local subsystem functions */ + +/* local subsystem globals */ +static Evas_Hash *store = NULL; + +/* externally accessible functions */ +void +e_datastore_set(char *key, void *data) +{ + store = evas_hash_del(store, key, NULL); + store = evas_hash_add(store, key, data); +} + +void * +e_datastore_get(char *key) +{ + return evas_hash_find(store, key); +} + +void +e_datastore_del(char *key) +{ + store = evas_hash_del(store, key, NULL); +} + +/* local subsystem functions */ diff --git a/src/bin/e_datastore.h b/src/bin/e_datastore.h new file mode 100644 index 000000000..5e36d0286 --- /dev/null +++ b/src/bin/e_datastore.h @@ -0,0 +1,15 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ +#ifdef E_TYPEDEFS + +#else +#ifndef E_DATASTORE_H +#define E_DATASTORE_H + +EAPI void e_datastore_set(char *key, void *data); +EAPI void *e_datastore_get(char *key); +EAPI void e_datastore_del(char *key); + +#endif +#endif diff --git a/src/bin/e_prefix.c b/src/bin/e_prefix.c index 6a748dfdc..abae20983 100644 --- a/src/bin/e_prefix.c +++ b/src/bin/e_prefix.c @@ -11,6 +11,7 @@ static int _e_prefix_try_argv(char *argv0); static char *_exe_path = NULL; static char *_prefix_path = NULL; +/* externally accessible functions */ int e_prefix_determine(char *argv0) {