OK, sorry about that - needless looping

SVN revision: 15056
This commit is contained in:
handyande 2005-06-02 14:41:17 +00:00 committed by handyande
parent ff669b3289
commit c55341c52b
2 changed files with 17 additions and 21 deletions

View File

@ -1,6 +1,6 @@
MAINTAINERCLEANFILES = Makefile.in MAINTAINERCLEANFILES = Makefile.in
INCLUDES = -I$(includedir) \ INCLUDES = -I$(includedir) \
-I$(top_srcdir)/src/bin -I$(top_srcdir)/src/bin \
@ecore_cflags@ \ @ecore_cflags@ \
@evas_cflags@ @evas_cflags@

View File

@ -41,8 +41,8 @@ Opt opts[] = {
static int _e_ipc_init(const char *display); static int _e_ipc_init(const char *display);
static void _e_ipc_shutdown(void); static void _e_ipc_shutdown(void);
static Opt *_e_ipc_call_find(char *name); static E_Ipc_Op _e_ipc_call_find(char *name);
static void _e_ipc_call(Opt *opt, char **params); static void _e_ipc_call(E_Ipc_Op opcode, char **params);
static int _e_cb_server_data(void *data, int type, void *event); static int _e_cb_server_data(void *data, int type, void *event);
static void _e_cb_module_list_free(void *data, void *ev); static void _e_cb_module_list_free(void *data, void *ev);
@ -159,47 +159,43 @@ e_shutdown(void)
void void
e_restart(void) e_restart(void)
{ {
_e_ipc_call(_e_ipc_call_find("-restart"), NULL); _e_ipc_call(E_IPC_OP_RESTART, NULL);
} }
void void
e_quit(void) e_quit(void)
{ {
_e_ipc_call(_e_ipc_call_find("-shutdown"), NULL); _e_ipc_call(E_IPC_OP_SHUTDOWN, NULL);
} }
void void
e_module_enabled_set(const char *module, int enable) e_module_enabled_set(const char *module, int enable)
{ {
E_Ipc_Op type;
if (!module) if (!module)
return; return;
if (enable) if (enable)
_e_ipc_call(_e_ipc_call_find("-module-enable"), &module); _e_ipc_call(E_IPC_OP_MODULE_ENABLE, &module);
else else
_e_ipc_call(_e_ipc_call_find("-module-disable"), &module); _e_ipc_call(E_IPC_OP_MODULE_DISABLE, &module);
} }
void void
e_module_load_set(const char *module, int load) e_module_load_set(const char *module, int load)
{ {
E_Ipc_Op type;
if (!module) if (!module)
return; return;
if (load) if (load)
_e_ipc_call(_e_ipc_call_find("-module-load"), &module); _e_ipc_call(E_IPC_OP_MODULE_LOAD, &module);
else else
_e_ipc_call(_e_ipc_call_find("-module-unload"), &module); _e_ipc_call(E_IPC_OP_MODULE_UNLOAD, &module);
} }
void void
e_module_list(void) e_module_list(void)
{ {
_e_ipc_call(_e_ipc_call_find("-module-list"), NULL); _e_ipc_call(E_IPC_OP_MODULE_LIST, NULL);
} }
void void
@ -216,13 +212,13 @@ e_background_set(const char *bgfile)
if (!bgfile) if (!bgfile)
return; return;
_e_ipc_call(_e_ipc_call_find("-default-bg-set"), &bgfile); _e_ipc_call(E_IPC_OP_BG_SET, &bgfile);
} }
void void
e_background_get(void) e_background_get(void)
{ {
_e_ipc_call(_e_ipc_call_find("-default-bg-get"), NULL); _e_ipc_call(E_IPC_OP_BG_GET, NULL);
} }
void void
@ -272,7 +268,7 @@ _e_ipc_shutdown(void)
} }
} }
static Opt * static E_Ipc_Op
_e_ipc_call_find(char *name) _e_ipc_call_find(char *name)
{ {
int i, j; int i, j;
@ -283,18 +279,18 @@ _e_ipc_call_find(char *name)
opt = &(opts[j]); opt = &(opts[j]);
if (!strcmp(opt->opt, name)) if (!strcmp(opt->opt, name))
return opt; return opt->opcode;
} }
return NULL; return 0;
} }
static void static void
_e_ipc_call(Opt *opt, char **params) _e_ipc_call(E_Ipc_Op opcode, char **params)
{ {
Ecore_Ipc_Event_Server_Data *e = malloc(sizeof(Ecore_Ipc_Event_Server_Data)); Ecore_Ipc_Event_Server_Data *e = malloc(sizeof(Ecore_Ipc_Event_Server_Data));
e->server = _e_ipc_server; e->server = _e_ipc_server;
switch(opt->opcode) switch(opcode)
{ {
#define TYPE E_REMOTE_OUT #define TYPE E_REMOTE_OUT