summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_ipc
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@free.fr>2009-02-25 11:03:47 +0000
committerCedric BAIL <cedric.bail@free.fr>2009-02-25 11:03:47 +0000
commit6978e98dc6247373e7a2a3ec2ec58b37ff404c01 (patch)
treebf9d12da012faab9bc4c2bd925b864c19a38d8d9 /legacy/ecore/src/lib/ecore_ipc
parente31b5e961eff9b2c8d5c6a5419502d391e12ca00 (diff)
* estickies,
* etk, * PROTO/exalt, * E-MODULES-EXTRA/diskio, * E-MODULES-EXTRA/drawer, * E-MODULES-EXTRA/penguins, * E-MODULES-EXTRA/slideshow, * E-MODULES-EXTRA/mail, * E-MODULES-EXTRA/forecasts, * E-MODULES-EXTRA/iiirk, * E-MODULES-EXTRA/places, * e, * ewl, * ecore, * elitaire, * entrance, * e_dbus, * efreet: Here we go, move from Ecore_List to Eina_List. NOTE: This patch is huge, I did test it a lot, and I hope nothing is broken. But if you think something change after this commit, please contact me ASAP. SVN revision: 39200
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h2
-rw-r--r--legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c44
-rw-r--r--legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h6
3 files changed, 25 insertions, 27 deletions
diff --git a/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h b/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h
index 8e07366880..9c26a749d8 100644
--- a/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h
+++ b/legacy/ecore/src/lib/ecore_ipc/Ecore_Ipc.h
@@ -297,7 +297,7 @@ EAPI unsigned long long _ecore_ipc_swap_64(unsigned long long v);
297 EAPI void *ecore_ipc_server_del(Ecore_Ipc_Server *svr); 297 EAPI void *ecore_ipc_server_del(Ecore_Ipc_Server *svr);
298 EAPI void *ecore_ipc_server_data_get(Ecore_Ipc_Server *svr); 298 EAPI void *ecore_ipc_server_data_get(Ecore_Ipc_Server *svr);
299 EAPI int ecore_ipc_server_connected_get(Ecore_Ipc_Server *svr); 299 EAPI int ecore_ipc_server_connected_get(Ecore_Ipc_Server *svr);
300 EAPI Ecore_List *ecore_ipc_server_clients_get(Ecore_Ipc_Server *svr); 300 EAPI Eina_List *ecore_ipc_server_clients_get(Ecore_Ipc_Server *svr);
301 /* FIXME: this needs to become an ipc message */ 301 /* FIXME: this needs to become an ipc message */
302 EAPI int ecore_ipc_server_send(Ecore_Ipc_Server *svr, int major, int minor, int ref, int ref_to, int response, const void *data, int size); 302 EAPI int ecore_ipc_server_send(Ecore_Ipc_Server *svr, int major, int minor, int ref, int ref_to, int response, const void *data, int size);
303 EAPI void ecore_ipc_server_client_limit_set(Ecore_Ipc_Server *svr, int client_limit, char reject_excess_clients); 303 EAPI void ecore_ipc_server_client_limit_set(Ecore_Ipc_Server *svr, int client_limit, char reject_excess_clients);
diff --git a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c
index 6bfc04bbbc..e69866aa51 100644
--- a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c
+++ b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc.c
@@ -241,7 +241,7 @@ EAPI int ECORE_IPC_EVENT_CLIENT_DATA = 0;
241EAPI int ECORE_IPC_EVENT_SERVER_DATA = 0; 241EAPI int ECORE_IPC_EVENT_SERVER_DATA = 0;
242 242
243static int init_count = 0; 243static int init_count = 0;
244static Ecore_Ipc_Server *servers = NULL; 244static Eina_List *servers = NULL;
245static Ecore_Event_Handler *handler[6]; 245static Ecore_Event_Handler *handler[6];
246 246
247/** 247/**
@@ -300,7 +300,7 @@ ecore_ipc_shutdown(void)
300 300
301 if (--init_count != 0) return init_count; 301 if (--init_count != 0) return init_count;
302 302
303 while (servers) ecore_ipc_server_del(servers); 303 while (servers) ecore_ipc_server_del(eina_list_data_get(servers));
304 304
305 for (i = 0; i < 6; i++) 305 for (i = 0; i < 6; i++)
306 ecore_event_handler_del(handler[i]); 306 ecore_event_handler_del(handler[i]);
@@ -364,9 +364,7 @@ ecore_ipc_server_add(Ecore_Ipc_Type compl_type, const char *name, int port, cons
364 } 364 }
365 svr->max_buf_size = 32 * 1024; 365 svr->max_buf_size = 32 * 1024;
366 svr->data = (void *)data; 366 svr->data = (void *)data;
367 svr->client_list = ecore_list_new(); 367 servers = eina_list_append(servers, svr);
368 ecore_list_init(svr->client_list);
369 servers = _ecore_list2_append(servers, svr);
370 ECORE_MAGIC_SET(svr, ECORE_MAGIC_IPC_SERVER); 368 ECORE_MAGIC_SET(svr, ECORE_MAGIC_IPC_SERVER);
371 return svr; 369 return svr;
372} 370}
@@ -422,7 +420,7 @@ ecore_ipc_server_connect(Ecore_Ipc_Type compl_type, char *name, int port, const
422 } 420 }
423 svr->max_buf_size = -1; 421 svr->max_buf_size = -1;
424 svr->data = (void *)data; 422 svr->data = (void *)data;
425 servers = _ecore_list2_append(servers, svr); 423 servers = eina_list_append(servers, svr);
426 ECORE_MAGIC_SET(svr, ECORE_MAGIC_IPC_SERVER); 424 ECORE_MAGIC_SET(svr, ECORE_MAGIC_IPC_SERVER);
427 return svr; 425 return svr;
428} 426}
@@ -444,17 +442,21 @@ ecore_ipc_server_del(Ecore_Ipc_Server *svr)
444 "ecore_ipc_server_del"); 442 "ecore_ipc_server_del");
445 return NULL; 443 return NULL;
446 } 444 }
445 if (svr->delete_me) return NULL;
446
447 data = svr->data; 447 data = svr->data;
448 svr->data = NULL; 448 svr->data = NULL;
449 svr->delete_me = 1; 449 svr->delete_me = 1;
450 if (svr->event_count == 0) 450 if (svr->event_count == 0)
451 { 451 {
452 while (svr->clients) 452 Ecore_Ipc_Client *cl;
453 ecore_ipc_client_del((Ecore_Ipc_Client *)svr->clients); 453
454 EINA_LIST_FREE(svr->clients, cl)
455 ecore_ipc_client_del(cl);
454 ecore_con_server_del(svr->server); 456 ecore_con_server_del(svr->server);
455 servers = _ecore_list2_remove(servers, svr); 457 servers = eina_list_remove(servers, svr);
458
456 if (svr->buf) free(svr->buf); 459 if (svr->buf) free(svr->buf);
457 if (svr->client_list) ecore_list_destroy(svr->client_list);
458 ECORE_MAGIC_SET(svr, ECORE_MAGIC_NONE); 460 ECORE_MAGIC_SET(svr, ECORE_MAGIC_NONE);
459 free(svr); 461 free(svr);
460 } 462 }
@@ -500,10 +502,10 @@ ecore_ipc_server_connected_get(Ecore_Ipc_Server *svr)
500/** 502/**
501 * Retrieves the list of clients for this server. 503 * Retrieves the list of clients for this server.
502 * @param svr The given IPC server. 504 * @param svr The given IPC server.
503 * @return An Ecore_List with the clients. 505 * @return An Eina_List with the clients.
504 * @ingroup Ecore_IPC_Server_Group 506 * @ingroup Ecore_IPC_Server_Group
505 */ 507 */
506EAPI Ecore_List * 508EAPI Eina_List *
507ecore_ipc_server_clients_get(Ecore_Ipc_Server *svr) 509ecore_ipc_server_clients_get(Ecore_Ipc_Server *svr)
508{ 510{
509 if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER)) 511 if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER))
@@ -1000,7 +1002,7 @@ _ecore_ipc_event_client_add(void *data __UNUSED__, int ev_type __UNUSED__, void
1000 Ecore_Con_Event_Client_Add *e; 1002 Ecore_Con_Event_Client_Add *e;
1001 1003
1002 e = ev; 1004 e = ev;
1003 if (!_ecore_list2_find(servers, ecore_con_server_data_get(ecore_con_client_server_get(e->client)))) return 1; 1005 if (!eina_list_data_find(servers, ecore_con_server_data_get(ecore_con_client_server_get(e->client)))) return 1;
1004 /* handling code here */ 1006 /* handling code here */
1005 { 1007 {
1006 Ecore_Ipc_Client *cl; 1008 Ecore_Ipc_Client *cl;
@@ -1014,7 +1016,7 @@ _ecore_ipc_event_client_add(void *data __UNUSED__, int ev_type __UNUSED__, void
1014 cl->max_buf_size = 32 * 1024; 1016 cl->max_buf_size = 32 * 1024;
1015 ecore_con_client_data_set(cl->client, (void *)cl); 1017 ecore_con_client_data_set(cl->client, (void *)cl);
1016 svr->clients = _ecore_list2_append(svr->clients, cl); 1018 svr->clients = _ecore_list2_append(svr->clients, cl);
1017 ecore_list_append(svr->client_list, cl); 1019 svr->client_list = eina_list_append(svr->client_list, cl);
1018 if (!cl->delete_me) 1020 if (!cl->delete_me)
1019 { 1021 {
1020 Ecore_Ipc_Event_Client_Add *e2; 1022 Ecore_Ipc_Event_Client_Add *e2;
@@ -1038,7 +1040,7 @@ _ecore_ipc_event_client_del(void *data __UNUSED__, int ev_type __UNUSED__, void
1038 Ecore_Con_Event_Client_Del *e; 1040 Ecore_Con_Event_Client_Del *e;
1039 1041
1040 e = ev; 1042 e = ev;
1041 if (!_ecore_list2_find(servers, ecore_con_server_data_get(ecore_con_client_server_get(e->client)))) return 1; 1043 if (!eina_list_data_find(servers, ecore_con_server_data_get(ecore_con_client_server_get(e->client)))) return 1;
1042 /* handling code here */ 1044 /* handling code here */
1043 { 1045 {
1044 Ecore_Ipc_Client *cl; 1046 Ecore_Ipc_Client *cl;
@@ -1049,9 +1051,7 @@ _ecore_ipc_event_client_del(void *data __UNUSED__, int ev_type __UNUSED__, void
1049 Ecore_Ipc_Server *svr; 1051 Ecore_Ipc_Server *svr;
1050 1052
1051 svr = ecore_con_server_data_get(ecore_con_client_server_get(e->client)); 1053 svr = ecore_con_server_data_get(ecore_con_client_server_get(e->client));
1052 ecore_list_goto(svr->client_list, cl); 1054 svr->client_list = eina_list_remove(svr->client_list, cl);
1053 ecore_list_remove(svr->client_list);
1054 ecore_list_first_goto(svr->client_list);
1055 if (!cl->delete_me) 1055 if (!cl->delete_me)
1056 { 1056 {
1057 e2 = calloc(1, sizeof(Ecore_Ipc_Event_Client_Del)); 1057 e2 = calloc(1, sizeof(Ecore_Ipc_Event_Client_Del));
@@ -1074,7 +1074,7 @@ _ecore_ipc_event_server_add(void *data __UNUSED__, int ev_type __UNUSED__, void
1074 Ecore_Con_Event_Server_Add *e; 1074 Ecore_Con_Event_Server_Add *e;
1075 1075
1076 e = ev; 1076 e = ev;
1077 if (!_ecore_list2_find(servers, ecore_con_server_data_get(e->server))) return 1; 1077 if (!eina_list_data_find(servers, ecore_con_server_data_get(e->server))) return 1;
1078 /* handling code here */ 1078 /* handling code here */
1079 { 1079 {
1080 Ecore_Ipc_Server *svr; 1080 Ecore_Ipc_Server *svr;
@@ -1103,7 +1103,7 @@ _ecore_ipc_event_server_del(void *data __UNUSED__, int ev_type __UNUSED__, void
1103 Ecore_Con_Event_Server_Del *e; 1103 Ecore_Con_Event_Server_Del *e;
1104 1104
1105 e = ev; 1105 e = ev;
1106 if (!_ecore_list2_find(servers, ecore_con_server_data_get(e->server))) return 1; 1106 if (!eina_list_data_find(servers, ecore_con_server_data_get(e->server))) return 1;
1107 /* handling code here */ 1107 /* handling code here */
1108 { 1108 {
1109 Ecore_Ipc_Server *svr; 1109 Ecore_Ipc_Server *svr;
@@ -1173,7 +1173,7 @@ _ecore_ipc_event_client_data(void *data __UNUSED__, int ev_type __UNUSED__, void
1173 Ecore_Con_Event_Client_Data *e; 1173 Ecore_Con_Event_Client_Data *e;
1174 1174
1175 e = ev; 1175 e = ev;
1176 if (!_ecore_list2_find(servers, ecore_con_server_data_get(ecore_con_client_server_get(e->client)))) return 1; 1176 if (!eina_list_data_find(servers, ecore_con_server_data_get(ecore_con_client_server_get(e->client)))) return 1;
1177 /* handling code here */ 1177 /* handling code here */
1178 { 1178 {
1179 Ecore_Ipc_Client *cl; 1179 Ecore_Ipc_Client *cl;
@@ -1365,7 +1365,7 @@ _ecore_ipc_event_server_data(void *data __UNUSED__, int ev_type __UNUSED__, void
1365 Ecore_Con_Event_Server_Data *e; 1365 Ecore_Con_Event_Server_Data *e;
1366 1366
1367 e = ev; 1367 e = ev;
1368 if (!_ecore_list2_find(servers, ecore_con_server_data_get(e->server))) return 1; 1368 if (!eina_list_data_find(servers, ecore_con_server_data_get(e->server))) return 1;
1369 /* handling code here */ 1369 /* handling code here */
1370 { 1370 {
1371 Ecore_Ipc_Server *svr; 1371 Ecore_Ipc_Server *svr;
diff --git a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h
index f8813a8999..9595975018 100644
--- a/legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h
+++ b/legacy/ecore/src/lib/ecore_ipc/ecore_ipc_private.h
@@ -39,7 +39,6 @@ __attribute__ ((packed));
39 39
40struct _Ecore_Ipc_Client 40struct _Ecore_Ipc_Client
41{ 41{
42 Ecore_List __list_data;
43 ECORE_MAGIC; 42 ECORE_MAGIC;
44 Ecore_Con_Client *client; 43 Ecore_Con_Client *client;
45 void *data; 44 void *data;
@@ -57,11 +56,10 @@ struct _Ecore_Ipc_Client
57 56
58struct _Ecore_Ipc_Server 57struct _Ecore_Ipc_Server
59{ 58{
60 Ecore_List __list_data;
61 ECORE_MAGIC; 59 ECORE_MAGIC;
62 Ecore_Con_Server *server; 60 Ecore_Con_Server *server;
63 Ecore_Ipc_Client *clients; 61 Eina_List *clients;
64 Ecore_List *client_list; 62 Eina_List *client_list;
65 void *data; 63 void *data;
66 unsigned char *buf; 64 unsigned char *buf;
67 int buf_size; 65 int buf_size;