forked from enlightenment/efl
Ecore_config cleanup step 2)
A contraversial one perhaps - remove the modular backend This fixes the hard coded .so extension problems and gives us a must more stable system still no API breakage :) SVN revision: 15185
This commit is contained in:
parent
2ccfb66cc7
commit
a94263b1da
|
@ -14,9 +14,6 @@ CLEANFILES = $(DB)
|
||||||
libecore_config_la_LDFLAGS = -version-info 1:0:0 \
|
libecore_config_la_LDFLAGS = -version-info 1:0:0 \
|
||||||
-L$(top_builddir)/src/lib/ecore/.libs
|
-L$(top_builddir)/src/lib/ecore/.libs
|
||||||
|
|
||||||
ecore_config_ipc_ecore_la_LDFLAGS = -no-undefined -module \
|
|
||||||
-avoid-version -rdynamic -shared
|
|
||||||
|
|
||||||
if BUILD_ECORE_CONFIG
|
if BUILD_ECORE_CONFIG
|
||||||
|
|
||||||
#DB = system.db
|
#DB = system.db
|
||||||
|
@ -26,7 +23,7 @@ if BUILD_ECORE_CONFIG
|
||||||
# edb_ed $(top_builddir)/src/lib/ecore_config/$(DB) add /apps/web/browser str `which firefox 2>/dev/null || which phoenix 2>/dev/null || which mozilla 2>/dev/null || which opera 2>/dev/null || which konqueror 2>/dev/null || which epiphany 2>/dev/null`
|
# edb_ed $(top_builddir)/src/lib/ecore_config/$(DB) add /apps/web/browser str `which firefox 2>/dev/null || which phoenix 2>/dev/null || which mozilla 2>/dev/null || which opera 2>/dev/null || which konqueror 2>/dev/null || which epiphany 2>/dev/null`
|
||||||
# edb_ed $(top_builddir)/src/lib/ecore_config/$(DB) add /apps/web/email str `which thunderbird 2>/dev/null || which mozilla 2>/dev/null || which kmail 2>/dev/null || which sylpheed 2>/dev/null || which evolution 2>/dev/null`
|
# edb_ed $(top_builddir)/src/lib/ecore_config/$(DB) add /apps/web/email str `which thunderbird 2>/dev/null || which mozilla 2>/dev/null || which kmail 2>/dev/null || which sylpheed 2>/dev/null || which evolution 2>/dev/null`
|
||||||
|
|
||||||
lib_LTLIBRARIES = libecore_config.la ecore_config_ipc_ecore.la
|
lib_LTLIBRARIES = libecore_config.la
|
||||||
include_HEADERS = \
|
include_HEADERS = \
|
||||||
Ecore_Config.h
|
Ecore_Config.h
|
||||||
|
|
||||||
|
@ -36,6 +33,7 @@ Ecore_Config.h
|
||||||
libecore_config_la_SOURCES = \
|
libecore_config_la_SOURCES = \
|
||||||
ecore_config.c \
|
ecore_config.c \
|
||||||
ecore_config_ipc_main.c \
|
ecore_config_ipc_main.c \
|
||||||
|
ecore_config_ipc_ecore.c \
|
||||||
ecore_config_util.c \
|
ecore_config_util.c \
|
||||||
ecore_config_storage.c \
|
ecore_config_storage.c \
|
||||||
ecore_config_extra.c \
|
ecore_config_extra.c \
|
||||||
|
@ -44,33 +42,22 @@ ecore_config_private.h
|
||||||
|
|
||||||
libecore_config_la_LIBADD = \
|
libecore_config_la_LIBADD = \
|
||||||
$(top_builddir)/src/lib/ecore/libecore.la \
|
$(top_builddir)/src/lib/ecore/libecore.la \
|
||||||
|
$(top_builddir)/src/lib/ecore_ipc/libecore_ipc.la \
|
||||||
@eet_libs@ \
|
@eet_libs@ \
|
||||||
@evas_libs@
|
@evas_libs@
|
||||||
|
|
||||||
libecore_config_la_DEPENDENCIES = \
|
libecore_config_la_DEPENDENCIES = \
|
||||||
$(top_builddir)/src/lib/ecore/libecore.la
|
|
||||||
|
|
||||||
ecore_config_ipc_ecore_la_DEPENDENCIES = \
|
|
||||||
$(top_builddir)/config.h \
|
|
||||||
$(top_builddir)/src/lib/ecore/libecore.la \
|
$(top_builddir)/src/lib/ecore/libecore.la \
|
||||||
$(top_builddir)/src/lib/ecore_ipc/libecore_ipc.la \
|
$(top_builddir)/src/lib/ecore_ipc/libecore_ipc.la
|
||||||
libecore_config.la
|
|
||||||
|
|
||||||
ecore_config_ipc_ecore_la_SOURCES = ecore_config_ipc_ecore.c
|
|
||||||
ecore_config_ipc_ecore_la_LIBADD = \
|
|
||||||
$(top_builddir)/src/lib/ecore/libecore.la \
|
|
||||||
$(top_builddir)/src/lib/ecore_ipc/libecore_ipc.la \
|
|
||||||
libecore_config.la \
|
|
||||||
@eet_libs@ \
|
|
||||||
@evas_libs@
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
EXTRA_DIST = \
|
EXTRA_DIST = \
|
||||||
Ecore_Config.h \
|
Ecore_Config.h \
|
||||||
ecore_config.c \
|
ecore_config.c \
|
||||||
ecore_config_ipc_main.c \
|
|
||||||
ecore_config_ipc_ecore.c \
|
ecore_config_ipc_ecore.c \
|
||||||
|
ecore_config_ipc_main.c \
|
||||||
ecore_config_ipc.h \
|
ecore_config_ipc.h \
|
||||||
ecore_config_util.c \
|
ecore_config_util.c \
|
||||||
ecore_config_util.h \
|
ecore_config_util.h \
|
||||||
|
|
|
@ -276,7 +276,7 @@ _ecore_config_ipc_client_sent(void *data, int type __UNUSED__, void *event)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
int
|
int
|
||||||
_ecore_config_mod_init(const char *pipe_name, void **data)
|
_ecore_config_ipc_ecore_init(const char *pipe_name, void **data)
|
||||||
{
|
{
|
||||||
Ecore_Ipc_Server **server;
|
Ecore_Ipc_Server **server;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
@ -335,7 +335,7 @@ _ecore_config_mod_init(const char *pipe_name, void **data)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
_ecore_config_mod_exit(void **data)
|
_ecore_config_ipc_ecore_exit(void **data)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
Ecore_Ipc_Server **server;
|
Ecore_Ipc_Server **server;
|
||||||
|
@ -360,7 +360,7 @@ _ecore_config_mod_exit(void **data)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
int
|
int
|
||||||
_ecore_config_mod_poll(void **data)
|
_ecore_config_ipc_ecore_poll(void **data)
|
||||||
{
|
{
|
||||||
Ecore_Ipc_Server **server;
|
Ecore_Ipc_Server **server;
|
||||||
|
|
||||||
|
|
|
@ -22,36 +22,24 @@
|
||||||
# define TRUE (!FALSE)
|
# define TRUE (!FALSE)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct _ecore_config_ipc
|
static Ecore_Config_Server *__ecore_config_servers;
|
||||||
{
|
|
||||||
void *lib;
|
|
||||||
void *data;
|
|
||||||
int (*ipc_init) (const char *pipe_name, void **data);
|
|
||||||
int (*ipc_exit) (void **data);
|
|
||||||
int (*ipc_poll) (void **data);
|
|
||||||
struct _ecore_config_ipc *next;
|
|
||||||
} Ecore_Config_Ipc;
|
|
||||||
|
|
||||||
static Ecore_Config_Ipc *ipc_modules = NULL;
|
|
||||||
static unsigned long ipc_timer = 0L;
|
static unsigned long ipc_timer = 0L;
|
||||||
|
|
||||||
|
extern int _ecore_config_ipc_ecore_init(const char *pipe_name, void **data);
|
||||||
|
extern int _ecore_config_ipc_ecore_exit(void **data);
|
||||||
|
extern int _ecore_config_ipc_ecore_poll(void **data);
|
||||||
|
|
||||||
Ecore_Config_Server *
|
Ecore_Config_Server *
|
||||||
_ecore_config_server_convert(void *srv)
|
_ecore_config_server_convert(void *srv)
|
||||||
{
|
{
|
||||||
Ecore_Config_Ipc *ipc_tmp;
|
|
||||||
Ecore_Config_Server *srv_tmp;
|
Ecore_Config_Server *srv_tmp;
|
||||||
|
|
||||||
ipc_tmp = ipc_modules;
|
srv_tmp = __ecore_config_servers;
|
||||||
while (ipc_tmp)
|
while (srv_tmp)
|
||||||
{
|
{
|
||||||
srv_tmp = ipc_tmp->data;
|
if (srv_tmp->server == srv)
|
||||||
while (srv_tmp)
|
return srv_tmp;
|
||||||
{
|
srv_tmp = srv_tmp->next;
|
||||||
if (srv_tmp->server == srv)
|
|
||||||
return srv_tmp;
|
|
||||||
srv_tmp = srv_tmp->next;
|
|
||||||
}
|
|
||||||
ipc_tmp = ipc_tmp->next;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return __ecore_config_server_global;
|
return __ecore_config_server_global;
|
||||||
|
@ -231,19 +219,13 @@ _ecore_config_ipc_bundle_label_find(Ecore_Config_Server * srv,
|
||||||
static int
|
static int
|
||||||
_ecore_config_ipc_poll(void *data)
|
_ecore_config_ipc_poll(void *data)
|
||||||
{
|
{
|
||||||
Ecore_Config_Ipc *m;
|
|
||||||
Ecore_Config_Server *s;
|
Ecore_Config_Server *s;
|
||||||
|
|
||||||
m = (Ecore_Config_Ipc *) data;
|
s = __ecore_config_servers;
|
||||||
while (m)
|
while (s)
|
||||||
{
|
{
|
||||||
s = m->data;
|
_ecore_config_ipc_ecore_poll(&s->server);
|
||||||
while (s)
|
s = s->next;
|
||||||
{
|
|
||||||
m->ipc_poll(&s->server);
|
|
||||||
s = s->next;
|
|
||||||
}
|
|
||||||
m = m->next;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -252,160 +234,51 @@ _ecore_config_ipc_poll(void *data)
|
||||||
int
|
int
|
||||||
_ecore_config_ipc_exit(void)
|
_ecore_config_ipc_exit(void)
|
||||||
{
|
{
|
||||||
Ecore_Config_Ipc *m;
|
|
||||||
Ecore_Config_Server *l;
|
Ecore_Config_Server *l;
|
||||||
|
|
||||||
if (ipc_timer)
|
if (ipc_timer)
|
||||||
timeout_remove(ipc_timer);
|
timeout_remove(ipc_timer);
|
||||||
while (ipc_modules)
|
l = __ecore_config_servers;
|
||||||
|
while (l)
|
||||||
{
|
{
|
||||||
m = ipc_modules;
|
_ecore_config_ipc_ecore_exit(&l->server);
|
||||||
ipc_modules = ipc_modules->next;
|
l = l->next;
|
||||||
l = m->data;
|
|
||||||
while (l)
|
|
||||||
{
|
|
||||||
m->ipc_exit(&l->server);
|
|
||||||
l = l->next;
|
|
||||||
}
|
|
||||||
free(m);
|
|
||||||
}
|
}
|
||||||
return ECORE_CONFIG_ERR_IGNORED;
|
|
||||||
|
return ECORE_CONFIG_ERR_SUCC;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ecore_Config_Server *
|
Ecore_Config_Server *
|
||||||
_ecore_config_ipc_init(const char *pipe_name)
|
_ecore_config_ipc_init(const char *pipe_name)
|
||||||
{
|
{
|
||||||
char buf[PATH_MAX];
|
|
||||||
glob_t globbuf;
|
|
||||||
int ret;
|
int ret;
|
||||||
unsigned int c;
|
|
||||||
Ecore_Config_Ipc *nm;
|
|
||||||
Ecore_Config_Server *list;
|
Ecore_Config_Server *list;
|
||||||
Ecore_Config_Server *ret_srv;
|
Ecore_Config_Server *ret_srv;
|
||||||
|
|
||||||
nm = NULL;
|
|
||||||
list = NULL;
|
list = NULL;
|
||||||
ret_srv = NULL;
|
ret_srv = NULL;
|
||||||
|
|
||||||
if (nm)
|
|
||||||
{
|
|
||||||
list = (Ecore_Config_Server *) nm->data;
|
|
||||||
while (list)
|
|
||||||
{
|
|
||||||
if (!strcmp(list->name, pipe_name))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
list = list->next;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
list = NULL;
|
list = NULL;
|
||||||
|
|
||||||
if (ipc_modules)
|
list = malloc(sizeof(Ecore_Config_Server));
|
||||||
|
memset(list, 0, sizeof(Ecore_Config_Server));
|
||||||
|
if ((ret = _ecore_config_ipc_ecore_init(pipe_name, &list->server)) != ECORE_CONFIG_ERR_SUCC)
|
||||||
{
|
{
|
||||||
nm = ipc_modules;
|
E(2, "_ecore_config_ipc_init: failed to register %s, code %d\n",
|
||||||
while (nm)
|
pipe_name, ret);
|
||||||
{
|
|
||||||
list = malloc(sizeof(Ecore_Config_Server));
|
|
||||||
memset(list, 0, sizeof(Ecore_Config_Server));
|
|
||||||
if ((ret =
|
|
||||||
nm->ipc_init(pipe_name,
|
|
||||||
&list->server)) != ECORE_CONFIG_ERR_SUCC)
|
|
||||||
{
|
|
||||||
E(2,
|
|
||||||
"_ecore_config_ipc_init: failed to register %s, code %d\n",
|
|
||||||
pipe_name, ret);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
E(2, "_ecore_config_ipc_init: registered \"%s\"...\n", pipe_name);
|
|
||||||
|
|
||||||
list->name = strdup(pipe_name);
|
|
||||||
list->next = nm->data;
|
|
||||||
|
|
||||||
nm->data = list;
|
|
||||||
if (!ret_srv)
|
|
||||||
ret_srv = list;
|
|
||||||
nm = nm->next;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret_srv;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((ret =
|
E(2, "_ecore_config_ipc_init: registered \"%s\"...\n", pipe_name);
|
||||||
snprintf(buf, PATH_MAX, PACKAGE_LIB_DIR "/ecore_config_ipc_*.so")) < 0)
|
|
||||||
|| (ret >= PATH_MAX))
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
glob(buf, 0, NULL, &globbuf);
|
list->name = strdup(pipe_name);
|
||||||
if (!globbuf.gl_pathc)
|
list->next = __ecore_config_servers;
|
||||||
return NULL;
|
|
||||||
|
|
||||||
for (c = 0; c < globbuf.gl_pathc; c++)
|
__ecore_config_servers = list;
|
||||||
{
|
if (!ret_srv)
|
||||||
if (!(nm = malloc(sizeof(Ecore_Config_Ipc))))
|
ret_srv = list;
|
||||||
{
|
|
||||||
ret = ECORE_CONFIG_ERR_OOM;
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
memset(nm, 0, sizeof(Ecore_Config_Ipc));
|
|
||||||
|
|
||||||
E(1, "_ecore_config_ipc_init: checking \"%s\"...\n",
|
if (!ipc_timer)
|
||||||
globbuf.gl_pathv[c]);
|
ipc_timer = timeout_add(100, _ecore_config_ipc_poll, NULL);
|
||||||
ret =
|
|
||||||
dlmulti("IPC-plugin", globbuf.gl_pathv[c], RTLD_NOW, &nm->lib,
|
|
||||||
"!_ecore_config_mod_init !_ecore_config_mod_exit !_ecore_config_mod_poll",
|
|
||||||
&nm->ipc_init, &nm->ipc_exit, &nm->ipc_poll);
|
|
||||||
if (ret == ECORE_CONFIG_ERR_NODATA)
|
|
||||||
E(0, "_ecore_config_ipc_init: could not load \"%s\": %s...\n",
|
|
||||||
globbuf.gl_pathv[c], dlerror());
|
|
||||||
else if (ret == ECORE_CONFIG_ERR_SUCC)
|
|
||||||
{
|
|
||||||
list = malloc(sizeof(Ecore_Config_Server));
|
|
||||||
/* memcpy(list, 0, sizeof(Ecore_Config_Server));*/
|
|
||||||
if ((ret =
|
|
||||||
nm->ipc_init(pipe_name,
|
|
||||||
&list->server)) != ECORE_CONFIG_ERR_SUCC)
|
|
||||||
E(0,
|
|
||||||
"_ecore_config_ipc_init: could not initialize \"%s\": %d\n",
|
|
||||||
globbuf.gl_pathv[c], ret);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
char *p = globbuf.gl_pathv[c];
|
|
||||||
|
|
||||||
if (DEBUG != 0)
|
|
||||||
{
|
|
||||||
char *q = strrchr(p, DIR_DELIMITER);
|
|
||||||
|
|
||||||
if (q)
|
|
||||||
p = ++q;
|
|
||||||
}
|
|
||||||
E(0, "_ecore_config_ipc_init: adding \"%s\"...\n", p);
|
|
||||||
E(2, "_ecore_config_ipc_init: registered \"%s\"...\n",
|
|
||||||
pipe_name);
|
|
||||||
|
|
||||||
list->name = strdup(pipe_name);
|
|
||||||
list->next = nm->data;
|
|
||||||
nm->data = list;
|
|
||||||
if (!ret_srv)
|
|
||||||
ret_srv = list;
|
|
||||||
|
|
||||||
nm->next = ipc_modules;
|
|
||||||
ipc_modules = nm;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ret != ECORE_CONFIG_ERR_SUCC)
|
|
||||||
free(nm);
|
|
||||||
}
|
|
||||||
|
|
||||||
done:
|
|
||||||
globfree(&globbuf);
|
|
||||||
|
|
||||||
if (ipc_modules)
|
|
||||||
{
|
|
||||||
ipc_timer = timeout_add(100, _ecore_config_ipc_poll, ipc_modules);
|
|
||||||
}
|
|
||||||
return ret_srv;
|
return ret_srv;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue