Enlightenment CVS committal Author : dj2 Project : e17 Module : apps/e
Dir : e17/apps/e/src/lib Modified Files: e_main.c Log Message: - move duplicate code in e_ipc_handlers into a macro - stop warnings in e_main.c. Is there a better way to fix this? =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/e/src/lib/e_main.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -3 -r1.21 -r1.22 --- e_main.c 5 Jun 2005 05:08:36 -0000 1.21 +++ e_main.c 5 Jun 2005 18:59:53 -0000 1.22 @@ -44,7 +44,7 @@ static int _e_ipc_init(const char *display); static void _e_ipc_shutdown(void); -static E_Ipc_Op _e_ipc_call_find(char *name); +static E_Ipc_Op _e_ipc_call_find(const char *name); static void _e_ipc_call(E_Ipc_Op opcode, char **params); static int _e_cb_server_data(void *data, int type, void *event); @@ -188,25 +188,32 @@ void e_lib_module_enabled_set(const char *module, int enable) { + char *tmp; + if (!module) return; + tmp = strdup(module); if (enable) - _e_ipc_call(E_IPC_OP_MODULE_ENABLE, &module); + _e_ipc_call(E_IPC_OP_MODULE_ENABLE, &tmp); else - _e_ipc_call(E_IPC_OP_MODULE_DISABLE, &module); + _e_ipc_call(E_IPC_OP_MODULE_DISABLE, &tmp); + free(tmp); } void e_lib_module_load_set(const char *module, int load) { + char *tmp; if (!module) return; + tmp = strdup(module); if (load) - _e_ipc_call(E_IPC_OP_MODULE_LOAD, &module); + _e_ipc_call(E_IPC_OP_MODULE_LOAD, &tmp); else - _e_ipc_call(E_IPC_OP_MODULE_UNLOAD, &module); + _e_ipc_call(E_IPC_OP_MODULE_UNLOAD, &tmp); + free(tmp); } void @@ -218,10 +225,13 @@ void e_lib_background_set(const char *bgfile) { + char *tmp; if (!bgfile) return; - _e_ipc_call(E_IPC_OP_BG_SET, &bgfile); + tmp = strdup(bgfile); + _e_ipc_call(E_IPC_OP_BG_SET, &tmp); + free(tmp); } void @@ -316,7 +326,7 @@ } static E_Ipc_Op -_e_ipc_call_find(char *name) +_e_ipc_call_find(const char *name) { int i, j; ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs