break out xwl init/shutdown into static functions for reuse internally

calling modapi functions like this causes symbol collision and randomly
calls corresponding functions for other modules
This commit is contained in:
Mike Blumenkrantz 2016-03-12 11:15:42 -05:00
parent f1bccff8e1
commit 1fd9d8eee5
1 changed files with 23 additions and 13 deletions

View File

@ -8,9 +8,9 @@
EINTERN void dnd_init(void); EINTERN void dnd_init(void);
EINTERN void dnd_shutdown(void); EINTERN void dnd_shutdown(void);
E_API int e_modapi_shutdown(E_Module *m EINA_UNUSED);
E_API void *e_modapi_init(E_Module *m); static E_Module *xwl_init(E_Module *m);
static void xwl_shutdown(void);
/* local structures */ /* local structures */
typedef struct _E_XWayland_Server E_XWayland_Server; typedef struct _E_XWayland_Server E_XWayland_Server;
@ -259,8 +259,8 @@ static void
xwayland_fatal(void *d EINA_UNUSED) xwayland_fatal(void *d EINA_UNUSED)
{ {
/* on xwayland fatal, attempt to restart it */ /* on xwayland fatal, attempt to restart it */
e_modapi_shutdown(NULL); xwl_shutdown();
e_modapi_init(NULL); xwl_init(NULL);
} }
static void static void
@ -343,11 +343,8 @@ error_dialog()
return EINA_FALSE; return EINA_FALSE;
} }
/* module functions */ static E_Module *
E_API E_Module_Api e_modapi = { E_MODULE_API_VERSION, "XWayland" }; xwl_init(E_Module *m)
E_API void *
e_modapi_init(E_Module *m)
{ {
char disp[8]; char disp[8];
@ -417,16 +414,15 @@ e_modapi_init(E_Module *m)
/* setup listener for SIGUSR1 */ /* setup listener for SIGUSR1 */
exs->sig_hdlr = exs->sig_hdlr =
ecore_event_handler_add(ECORE_EVENT_SIGNAL_USER, _cb_signal_event, exs); ecore_event_handler_add(ECORE_EVENT_SIGNAL_USER, _cb_signal_event, exs);
return m; return m;
} }
E_API int static void
e_modapi_shutdown(E_Module *m EINA_UNUSED) xwl_shutdown(void)
{ {
char path[256]; char path[256];
if (!exs) return 1; if (!exs) return;
dnd_shutdown(); dnd_shutdown();
unlink(exs->lock); unlink(exs->lock);
@ -444,6 +440,20 @@ e_modapi_shutdown(E_Module *m EINA_UNUSED)
free(exs); free(exs);
e_util_env_set("DISPLAY", NULL); e_util_env_set("DISPLAY", NULL);
}
/* module functions */
E_API E_Module_Api e_modapi = { E_MODULE_API_VERSION, "XWayland" };
E_API void *
e_modapi_init(E_Module *m)
{
return xwl_init(m);
}
E_API int
e_modapi_shutdown(E_Module *m EINA_UNUSED)
{
xwl_shutdown();
return 1; return 1;
} }