diff options
author | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-01-04 18:41:13 +1000 |
commit | dd7595a3475407a7fa96a97393bae8c5220e8762 (patch) | |
tree | e341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/ecore/src/lib/ecore_ipc | |
parent | Add the skeleton. (diff) | |
download | SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2 SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz |
Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje.
Note that embryo wont be used, but I'm not sure yet if you can build edje without it.
Diffstat (limited to 'libraries/ecore/src/lib/ecore_ipc')
-rw-r--r-- | libraries/ecore/src/lib/ecore_ipc/Ecore_Ipc.h | 325 | ||||
-rw-r--r-- | libraries/ecore/src/lib/ecore_ipc/Makefile.am | 29 | ||||
-rw-r--r-- | libraries/ecore/src/lib/ecore_ipc/Makefile.in | 822 | ||||
-rw-r--r-- | libraries/ecore/src/lib/ecore_ipc/ecore_ipc.c | 1591 | ||||
-rw-r--r-- | libraries/ecore/src/lib/ecore_ipc/ecore_ipc_private.h | 104 |
5 files changed, 2871 insertions, 0 deletions
diff --git a/libraries/ecore/src/lib/ecore_ipc/Ecore_Ipc.h b/libraries/ecore/src/lib/ecore_ipc/Ecore_Ipc.h new file mode 100644 index 0000000..40ae621 --- /dev/null +++ b/libraries/ecore/src/lib/ecore_ipc/Ecore_Ipc.h | |||
@@ -0,0 +1,325 @@ | |||
1 | #ifndef _ECORE_IPC_H | ||
2 | #define _ECORE_IPC_H | ||
3 | |||
4 | #ifdef EAPI | ||
5 | # undef EAPI | ||
6 | #endif | ||
7 | |||
8 | #ifdef _WIN32 | ||
9 | # ifdef EFL_ECORE_IPC_BUILD | ||
10 | # ifdef DLL_EXPORT | ||
11 | # define EAPI __declspec(dllexport) | ||
12 | # else | ||
13 | # define EAPI | ||
14 | # endif | ||
15 | # else | ||
16 | # define EAPI __declspec(dllimport) | ||
17 | # endif | ||
18 | #else | ||
19 | # ifdef __GNUC__ | ||
20 | # if __GNUC__ >= 4 | ||
21 | # define EAPI __attribute__ ((visibility("default"))) | ||
22 | # else | ||
23 | # define EAPI | ||
24 | # endif | ||
25 | # else | ||
26 | # define EAPI | ||
27 | # endif | ||
28 | #endif | ||
29 | |||
30 | /** | ||
31 | * @file Ecore_Ipc.h | ||
32 | * @brief Ecore inter-process communication functions. | ||
33 | */ | ||
34 | |||
35 | #ifdef __cplusplus | ||
36 | extern "C" { | ||
37 | #endif | ||
38 | |||
39 | typedef struct _Ecore_Ipc_Server Ecore_Ipc_Server; /**< An IPC connection handle */ | ||
40 | typedef struct _Ecore_Ipc_Client Ecore_Ipc_Client; /**< An IPC connection handle */ | ||
41 | |||
42 | EAPI unsigned short _ecore_ipc_swap_16(unsigned short v); | ||
43 | EAPI unsigned int _ecore_ipc_swap_32(unsigned int v); | ||
44 | EAPI unsigned long long _ecore_ipc_swap_64(unsigned long long v); | ||
45 | |||
46 | #ifdef WORDS_BIGENDIAN | ||
47 | #define ECORE_IPC_SWAP2NET64(x) _ecore_ipc_swap_64(x) | ||
48 | #define ECORE_IPC_SWAP2CPU64(x) _ecore_ipc_swap_64(x) | ||
49 | #define ECORE_IPC_SWAP2NET32(x) _ecore_ipc_swap_32(x) | ||
50 | #define ECORE_IPC_SWAP2CPU32(x) _ecore_ipc_swap_32(x) | ||
51 | #define ECORE_IPC_SWAP2NET16(x) _ecore_ipc_swap_16(x) | ||
52 | #define ECORE_IPC_SWAP2CPU16(x) _ecore_ipc_swap_16(x) | ||
53 | #define ECORE_IPC_SWAP2NET8(x) (x) | ||
54 | #define ECORE_IPC_SWAP2CPU8(x) (x) | ||
55 | #else | ||
56 | #define ECORE_IPC_SWAP2NET64(x) (x) | ||
57 | #define ECORE_IPC_SWAP2CPU64(x) (x) | ||
58 | #define ECORE_IPC_SWAP2NET32(x) (x) | ||
59 | #define ECORE_IPC_SWAP2CPU32(x) (x) | ||
60 | #define ECORE_IPC_SWAP2NET16(x) (x) | ||
61 | #define ECORE_IPC_SWAP2CPU16(x) (x) | ||
62 | #define ECORE_IPC_SWAP2NET8(x) (x) | ||
63 | #define ECORE_IPC_SWAP2CPU8(x) (x) | ||
64 | #endif | ||
65 | |||
66 | /* 1, 2, 4 and 8 byte datatypes */ | ||
67 | /* unpacking */ | ||
68 | #define ECORE_IPC_GET64(v)\ | ||
69 | { \ | ||
70 | p->v = ECORE_IPC_SWAP2CPU64(*(long long *)(ptr)); \ | ||
71 | ptr += 8; \ | ||
72 | } | ||
73 | #define ECORE_IPC_GET32(v)\ | ||
74 | { \ | ||
75 | p->v = ECORE_IPC_SWAP2CPU32(*(int *)(ptr)); \ | ||
76 | ptr += 4; \ | ||
77 | } | ||
78 | #define ECORE_IPC_GET16(v)\ | ||
79 | { \ | ||
80 | p->v = ECORE_IPC_SWAP2CPU16(*(short *)(ptr)); \ | ||
81 | ptr += 2; \ | ||
82 | } | ||
83 | #define ECORE_IPC_GET8(v) \ | ||
84 | { \ | ||
85 | p->v = ECORE_IPC_SWAP2CPU8(*(char *)(ptr)); \ | ||
86 | ptr += 1; \ | ||
87 | } | ||
88 | /* packing */ | ||
89 | #define ECORE_IPC_PUT64(v)\ | ||
90 | { \ | ||
91 | *(long long *)(ptr) = ECORE_IPC_SWAP2NET64(p->v); \ | ||
92 | ptr += 8; \ | ||
93 | } | ||
94 | #define ECORE_IPC_PUT32(v)\ | ||
95 | { \ | ||
96 | *(int *)(ptr) = ECORE_IPC_SWAP2NET32(p->v); \ | ||
97 | ptr += 4; \ | ||
98 | } | ||
99 | #define ECORE_IPC_PUT16(v)\ | ||
100 | { \ | ||
101 | *(short *)(ptr) = ECORE_IPC_SWAP2NET16(p->v); \ | ||
102 | ptr += 2; \ | ||
103 | } | ||
104 | #define ECORE_IPC_PUT8(v) \ | ||
105 | { \ | ||
106 | *(char *)(ptr) = ECORE_IPC_SWAP2NET8(p->v); \ | ||
107 | ptr += 1; \ | ||
108 | } | ||
109 | /* padding data */ | ||
110 | #define ECORE_IPC_PAD8() ptr += 1 | ||
111 | #define ECORE_IPC_PAD16() ptr += 2 | ||
112 | #define ECORE_IPC_PAD32() ptr += 4 | ||
113 | #define ECORE_IPC_PAD64() ptr += 8 | ||
114 | |||
115 | /* counting data when encoding lists */ | ||
116 | #define ECORE_IPC_CNT8() len += 1 | ||
117 | #define ECORE_IPC_CNT16() len += 2 | ||
118 | #define ECORE_IPC_CNT32() len += 4 | ||
119 | #define ECORE_IPC_CNT64() len += 8 | ||
120 | |||
121 | /* strings */ | ||
122 | #define ECORE_IPC_CHEKS() if (*((unsigned char *)d + s - 1) != 0) return 0; | ||
123 | #define ECORE_IPC_GETS(v) \ | ||
124 | { \ | ||
125 | if (ptr < ((unsigned char *)d + s)) \ | ||
126 | { \ | ||
127 | p->v = (char *)ptr; \ | ||
128 | ptr += strlen(p->v) + 1; \ | ||
129 | } \ | ||
130 | } | ||
131 | #define ECORE_IPC_PUTS(v, l)\ | ||
132 | { \ | ||
133 | strcpy((char *)ptr, p->v); \ | ||
134 | ptr += l + 1; \ | ||
135 | } | ||
136 | |||
137 | /* handy to calculate what sized block we need to alloc */ | ||
138 | #define ECORE_IPC_SLEN(l, v) ((l = strlen(p->v)) + 1) | ||
139 | #define ECORE_IPC_CNTS(v) len += strlen(p->v) + 1 | ||
140 | |||
141 | /* saves typing function headers */ | ||
142 | #define ECORE_IPC_DEC_STRUCT_PROTO(x) static int x(void *d, int s, void *pp) | ||
143 | #define ECORE_IPC_ENC_STRUCT_PROTO(x) static void *x(void *pp, int *s) | ||
144 | #define ECORE_IPC_DEC_EINA_LIST_PROTO(x) static Eina_List *x(void *d, int s) | ||
145 | #define ECORE_IPC_ENC_EINA_LIST_PROTO(x) static void *x(Eina_List *lp, int *s) | ||
146 | |||
147 | |||
148 | /* decoder setup - saves typing. requires data packet of exact size, or fail */ | ||
149 | #define ECORE_IPC_DEC_STRUCT_HEAD_EXACT(typ, x) \ | ||
150 | typ *p; \ | ||
151 | unsigned char *ptr; \ | ||
152 | p = (typ *)pp; \ | ||
153 | if (!d) return 0; if (s != (x)) return 0; \ | ||
154 | ptr = d; | ||
155 | /* decoder setup - saves typing. requires data packet of a minimum size */ | ||
156 | #define ECORE_IPC_DEC_STRUCT_HEAD_MIN(typ, x) \ | ||
157 | typ *p; \ | ||
158 | unsigned char *ptr; \ | ||
159 | p = (typ *)pp; \ | ||
160 | if (!d) return 0; if (s < (x)) return 0; \ | ||
161 | ptr = d; | ||
162 | /* footer for the hell of it */ | ||
163 | #define ECORE_IPC_DEC_STRUCT_FOOT() return 1 | ||
164 | /* header for encoder - gives native strct type and size of flattened packet */ | ||
165 | #define ECORE_IPC_ENC_STRUCT_HEAD(typ, sz) \ | ||
166 | typ *p; \ | ||
167 | unsigned char *d, *ptr; \ | ||
168 | int len; \ | ||
169 | *s = 0; \ | ||
170 | if(!pp) return NULL; \ | ||
171 | p = (typ *)pp; \ | ||
172 | len = sz; \ | ||
173 | d = malloc(len); \ | ||
174 | if (!d) return NULL; \ | ||
175 | *s = len; \ | ||
176 | ptr = d; | ||
177 | /* footer for the hell of it */ | ||
178 | #define ECORE_IPC_ENC_STRUCT_FOOT() return d | ||
179 | |||
180 | #define ECORE_IPC_DEC_EINA_LIST_HEAD(typ) \ | ||
181 | unsigned char *ptr; \ | ||
182 | Eina_List *l; \ | ||
183 | typ *p; \ | ||
184 | l = NULL; \ | ||
185 | ptr = d; \ | ||
186 | while(ptr < (unsigned char *)(d + s)) \ | ||
187 | { \ | ||
188 | p = malloc(sizeof(typ)); | ||
189 | |||
190 | #define ECORE_IPC_DEC_EINA_LIST_FOOT() \ | ||
191 | l = eina_list_append(l, p); \ | ||
192 | } \ | ||
193 | return l | ||
194 | #define ECORE_IPC_ENC_EINA_LIST_HEAD_START(typ) \ | ||
195 | Eina_List *l; \ | ||
196 | typ *p; \ | ||
197 | unsigned char *d, *ptr; \ | ||
198 | int len; \ | ||
199 | *s = 0; \ | ||
200 | len = 0; \ | ||
201 | for (l = lp; l; l = l->next) \ | ||
202 | { \ | ||
203 | p = l->data; | ||
204 | #define ECORE_IPC_ENC_EINA_LIST_HEAD_FINISH() \ | ||
205 | } \ | ||
206 | d = malloc(len); \ | ||
207 | if(!d) return NULL; \ | ||
208 | *s = len; \ | ||
209 | ptr = d; \ | ||
210 | for (l = lp; l; l = l->next) \ | ||
211 | { \ | ||
212 | p = l->data; | ||
213 | |||
214 | #define ECORE_IPC_ENC_EINA_LIST_FOOT() \ | ||
215 | } \ | ||
216 | return d | ||
217 | |||
218 | typedef enum _Ecore_Ipc_Type | ||
219 | { | ||
220 | ECORE_IPC_LOCAL_USER, | ||
221 | ECORE_IPC_LOCAL_SYSTEM, | ||
222 | ECORE_IPC_REMOTE_SYSTEM, | ||
223 | ECORE_IPC_USE_SSL = 16 | ||
224 | } Ecore_Ipc_Type; | ||
225 | |||
226 | typedef struct _Ecore_Ipc_Event_Client_Add Ecore_Ipc_Event_Client_Add; | ||
227 | typedef struct _Ecore_Ipc_Event_Client_Del Ecore_Ipc_Event_Client_Del; | ||
228 | typedef struct _Ecore_Ipc_Event_Server_Add Ecore_Ipc_Event_Server_Add; | ||
229 | typedef struct _Ecore_Ipc_Event_Server_Del Ecore_Ipc_Event_Server_Del; | ||
230 | typedef struct _Ecore_Ipc_Event_Client_Data Ecore_Ipc_Event_Client_Data; | ||
231 | typedef struct _Ecore_Ipc_Event_Server_Data Ecore_Ipc_Event_Server_Data; | ||
232 | |||
233 | struct _Ecore_Ipc_Event_Client_Add | ||
234 | { | ||
235 | Ecore_Ipc_Client *client; | ||
236 | }; | ||
237 | |||
238 | struct _Ecore_Ipc_Event_Client_Del | ||
239 | { | ||
240 | Ecore_Ipc_Client *client; | ||
241 | }; | ||
242 | |||
243 | struct _Ecore_Ipc_Event_Server_Add | ||
244 | { | ||
245 | Ecore_Ipc_Server *server; | ||
246 | }; | ||
247 | |||
248 | struct _Ecore_Ipc_Event_Server_Del | ||
249 | { | ||
250 | Ecore_Ipc_Server *server; | ||
251 | }; | ||
252 | |||
253 | struct _Ecore_Ipc_Event_Client_Data | ||
254 | { | ||
255 | Ecore_Ipc_Client *client; | ||
256 | /* FIXME: this needs to become an ipc message */ | ||
257 | int major; | ||
258 | int minor; | ||
259 | int ref; | ||
260 | int ref_to; | ||
261 | int response; | ||
262 | void *data; | ||
263 | int size; | ||
264 | }; | ||
265 | |||
266 | struct _Ecore_Ipc_Event_Server_Data | ||
267 | { | ||
268 | Ecore_Ipc_Server *server; | ||
269 | /* FIXME: this needs to become an ipc message */ | ||
270 | int major; | ||
271 | int minor; | ||
272 | int ref; | ||
273 | int ref_to; | ||
274 | int response; | ||
275 | void *data; | ||
276 | int size; | ||
277 | }; | ||
278 | |||
279 | EAPI extern int ECORE_IPC_EVENT_CLIENT_ADD; | ||
280 | EAPI extern int ECORE_IPC_EVENT_CLIENT_DEL; | ||
281 | EAPI extern int ECORE_IPC_EVENT_SERVER_ADD; | ||
282 | EAPI extern int ECORE_IPC_EVENT_SERVER_DEL; | ||
283 | EAPI extern int ECORE_IPC_EVENT_CLIENT_DATA; | ||
284 | EAPI extern int ECORE_IPC_EVENT_SERVER_DATA; | ||
285 | |||
286 | EAPI int ecore_ipc_init(void); | ||
287 | EAPI int ecore_ipc_shutdown(void); | ||
288 | |||
289 | /* FIXME: need to add protocol type parameter */ | ||
290 | EAPI Ecore_Ipc_Server *ecore_ipc_server_add(Ecore_Ipc_Type type, const char *name, int port, const void *data); | ||
291 | |||
292 | /* FIXME: need to add protocol type parameter */ | ||
293 | EAPI Ecore_Ipc_Server *ecore_ipc_server_connect(Ecore_Ipc_Type type, char *name, int port, const void *data); | ||
294 | EAPI void *ecore_ipc_server_del(Ecore_Ipc_Server *svr); | ||
295 | EAPI void *ecore_ipc_server_data_get(Ecore_Ipc_Server *svr); | ||
296 | EAPI Eina_Bool ecore_ipc_server_connected_get(Ecore_Ipc_Server *svr); | ||
297 | EAPI Eina_List *ecore_ipc_server_clients_get(Ecore_Ipc_Server *svr); | ||
298 | /* FIXME: this needs to become an ipc message */ | ||
299 | 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); | ||
300 | EAPI void ecore_ipc_server_client_limit_set(Ecore_Ipc_Server *svr, int client_limit, char reject_excess_clients); | ||
301 | EAPI void ecore_ipc_server_data_size_max_set(Ecore_Ipc_Server *srv, int size); | ||
302 | EAPI int ecore_ipc_server_data_size_max_get(Ecore_Ipc_Server *srv); | ||
303 | EAPI const char *ecore_ipc_server_ip_get(Ecore_Ipc_Server *svr); | ||
304 | EAPI void ecore_ipc_server_flush(Ecore_Ipc_Server *svr); | ||
305 | |||
306 | /* FIXME: this needs to become an ipc message */ | ||
307 | EAPI int ecore_ipc_client_send(Ecore_Ipc_Client *cl, int major, int minor, int ref, int ref_to, int response, const void *data, int size); | ||
308 | EAPI Ecore_Ipc_Server *ecore_ipc_client_server_get(Ecore_Ipc_Client *cl); | ||
309 | EAPI void *ecore_ipc_client_del(Ecore_Ipc_Client *cl); | ||
310 | EAPI void ecore_ipc_client_data_set(Ecore_Ipc_Client *cl, const void *data); | ||
311 | EAPI void *ecore_ipc_client_data_get(Ecore_Ipc_Client *cl); | ||
312 | EAPI void ecore_ipc_client_data_size_max_set(Ecore_Ipc_Client *cl, int size); | ||
313 | EAPI int ecore_ipc_client_data_size_max_get(Ecore_Ipc_Client *cl); | ||
314 | EAPI const char *ecore_ipc_client_ip_get(Ecore_Ipc_Client *cl); | ||
315 | EAPI void ecore_ipc_client_flush(Ecore_Ipc_Client *cl); | ||
316 | |||
317 | EAPI int ecore_ipc_ssl_available_get(void); | ||
318 | /* FIXME: need to add a callback to "ok" large ipc messages greater than */ | ||
319 | /* a certain size (seurity/DOS attack safety) */ | ||
320 | |||
321 | #ifdef __cplusplus | ||
322 | } | ||
323 | #endif | ||
324 | |||
325 | #endif | ||
diff --git a/libraries/ecore/src/lib/ecore_ipc/Makefile.am b/libraries/ecore/src/lib/ecore_ipc/Makefile.am new file mode 100644 index 0000000..9cbed43 --- /dev/null +++ b/libraries/ecore/src/lib/ecore_ipc/Makefile.am | |||
@@ -0,0 +1,29 @@ | |||
1 | MAINTAINERCLEANFILES = Makefile.in | ||
2 | |||
3 | AM_CPPFLAGS = \ | ||
4 | -I$(top_builddir)/src/lib/ecore \ | ||
5 | -I$(top_builddir)/src/lib/ecore_con \ | ||
6 | -I$(top_builddir)/src/lib/ecore_ipc \ | ||
7 | -I$(top_srcdir)/src/lib/ecore \ | ||
8 | -I$(top_srcdir)/src/lib/ecore_con \ | ||
9 | -I$(top_srcdir)/src/lib/ecore_ipc \ | ||
10 | @EFL_ECORE_IPC_BUILD@ \ | ||
11 | @SSL_CFLAGS@ \ | ||
12 | @EINA_CFLAGS@ | ||
13 | |||
14 | lib_LTLIBRARIES = libecore_ipc.la | ||
15 | includes_HEADERS = Ecore_Ipc.h | ||
16 | includesdir = $(includedir)/ecore-@VMAJ@ | ||
17 | |||
18 | libecore_ipc_la_SOURCES = \ | ||
19 | ecore_ipc.c | ||
20 | |||
21 | libecore_ipc_la_LIBADD = \ | ||
22 | $(top_builddir)/src/lib/ecore/libecore.la \ | ||
23 | $(top_builddir)/src/lib/ecore_con/libecore_con.la \ | ||
24 | @SSL_LIBS@ \ | ||
25 | @EINA_LIBS@ | ||
26 | |||
27 | libecore_ipc_la_LDFLAGS = -no-undefined -version-info @version_info@ @release_info@ | ||
28 | |||
29 | EXTRA_DIST = ecore_ipc_private.h | ||
diff --git a/libraries/ecore/src/lib/ecore_ipc/Makefile.in b/libraries/ecore/src/lib/ecore_ipc/Makefile.in new file mode 100644 index 0000000..189e069 --- /dev/null +++ b/libraries/ecore/src/lib/ecore_ipc/Makefile.in | |||
@@ -0,0 +1,822 @@ | |||
1 | # Makefile.in generated by automake 1.11.1 from Makefile.am. | ||
2 | # @configure_input@ | ||
3 | |||
4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, | ||
5 | # 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, | ||
6 | # Inc. | ||
7 | # This Makefile.in is free software; the Free Software Foundation | ||
8 | # gives unlimited permission to copy and/or distribute it, | ||
9 | # with or without modifications, as long as this notice is preserved. | ||
10 | |||
11 | # This program is distributed in the hope that it will be useful, | ||
12 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | ||
13 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
14 | # PARTICULAR PURPOSE. | ||
15 | |||
16 | @SET_MAKE@ | ||
17 | |||
18 | |||
19 | VPATH = @srcdir@ | ||
20 | pkgdatadir = $(datadir)/@PACKAGE@ | ||
21 | pkgincludedir = $(includedir)/@PACKAGE@ | ||
22 | pkglibdir = $(libdir)/@PACKAGE@ | ||
23 | pkglibexecdir = $(libexecdir)/@PACKAGE@ | ||
24 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd | ||
25 | install_sh_DATA = $(install_sh) -c -m 644 | ||
26 | install_sh_PROGRAM = $(install_sh) -c | ||
27 | install_sh_SCRIPT = $(install_sh) -c | ||
28 | INSTALL_HEADER = $(INSTALL_DATA) | ||
29 | transform = $(program_transform_name) | ||
30 | NORMAL_INSTALL = : | ||
31 | PRE_INSTALL = : | ||
32 | POST_INSTALL = : | ||
33 | NORMAL_UNINSTALL = : | ||
34 | PRE_UNINSTALL = : | ||
35 | POST_UNINSTALL = : | ||
36 | build_triplet = @build@ | ||
37 | host_triplet = @host@ | ||
38 | subdir = src/lib/ecore_ipc | ||
39 | DIST_COMMON = $(includes_HEADERS) $(srcdir)/Makefile.am \ | ||
40 | $(srcdir)/Makefile.in | ||
41 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||
42 | am__aclocal_m4_deps = $(top_srcdir)/m4/ac_attribute.m4 \ | ||
43 | $(top_srcdir)/m4/ac_path_generic.m4 \ | ||
44 | $(top_srcdir)/m4/check_x_extension.m4 \ | ||
45 | $(top_srcdir)/m4/ecore_check_module.m4 \ | ||
46 | $(top_srcdir)/m4/ecore_check_options.m4 \ | ||
47 | $(top_srcdir)/m4/efl_compiler_flag.m4 \ | ||
48 | $(top_srcdir)/m4/efl_doxygen.m4 \ | ||
49 | $(top_srcdir)/m4/efl_examples.m4 \ | ||
50 | $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ | ||
51 | $(top_srcdir)/m4/efl_threads.m4 $(top_srcdir)/m4/gettext.m4 \ | ||
52 | $(top_srcdir)/m4/iconv.m4 $(top_srcdir)/m4/intlmacosx.m4 \ | ||
53 | $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ | ||
54 | $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ | ||
55 | $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ | ||
56 | $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ | ||
57 | $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/nls.m4 \ | ||
58 | $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/progtest.m4 \ | ||
59 | $(top_srcdir)/configure.ac | ||
60 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||
61 | $(ACLOCAL_M4) | ||
62 | mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs | ||
63 | CONFIG_HEADER = $(top_builddir)/config.h | ||
64 | CONFIG_CLEAN_FILES = | ||
65 | CONFIG_CLEAN_VPATH_FILES = | ||
66 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; | ||
67 | am__vpath_adj = case $$p in \ | ||
68 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ | ||
69 | *) f=$$p;; \ | ||
70 | esac; | ||
71 | am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; | ||
72 | am__install_max = 40 | ||
73 | am__nobase_strip_setup = \ | ||
74 | srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` | ||
75 | am__nobase_strip = \ | ||
76 | for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" | ||
77 | am__nobase_list = $(am__nobase_strip_setup); \ | ||
78 | for p in $$list; do echo "$$p $$p"; done | \ | ||
79 | sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ | ||
80 | $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ | ||
81 | if (++n[$$2] == $(am__install_max)) \ | ||
82 | { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ | ||
83 | END { for (dir in files) print dir, files[dir] }' | ||
84 | am__base_list = \ | ||
85 | sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ | ||
86 | sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | ||
87 | am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includesdir)" | ||
88 | LTLIBRARIES = $(lib_LTLIBRARIES) | ||
89 | libecore_ipc_la_DEPENDENCIES = \ | ||
90 | $(top_builddir)/src/lib/ecore/libecore.la \ | ||
91 | $(top_builddir)/src/lib/ecore_con/libecore_con.la | ||
92 | am_libecore_ipc_la_OBJECTS = ecore_ipc.lo | ||
93 | libecore_ipc_la_OBJECTS = $(am_libecore_ipc_la_OBJECTS) | ||
94 | AM_V_lt = $(am__v_lt_$(V)) | ||
95 | am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) | ||
96 | am__v_lt_0 = --silent | ||
97 | libecore_ipc_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ | ||
98 | $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ | ||
99 | $(AM_CFLAGS) $(CFLAGS) $(libecore_ipc_la_LDFLAGS) $(LDFLAGS) \ | ||
100 | -o $@ | ||
101 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) | ||
102 | depcomp = $(SHELL) $(top_srcdir)/depcomp | ||
103 | am__depfiles_maybe = depfiles | ||
104 | am__mv = mv -f | ||
105 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
106 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
107 | LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
108 | $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ | ||
109 | $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ | ||
110 | $(AM_CFLAGS) $(CFLAGS) | ||
111 | AM_V_CC = $(am__v_CC_$(V)) | ||
112 | am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) | ||
113 | am__v_CC_0 = @echo " CC " $@; | ||
114 | AM_V_at = $(am__v_at_$(V)) | ||
115 | am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) | ||
116 | am__v_at_0 = @ | ||
117 | CCLD = $(CC) | ||
118 | LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
119 | $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ | ||
120 | $(AM_LDFLAGS) $(LDFLAGS) -o $@ | ||
121 | AM_V_CCLD = $(am__v_CCLD_$(V)) | ||
122 | am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) | ||
123 | am__v_CCLD_0 = @echo " CCLD " $@; | ||
124 | AM_V_GEN = $(am__v_GEN_$(V)) | ||
125 | am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) | ||
126 | am__v_GEN_0 = @echo " GEN " $@; | ||
127 | SOURCES = $(libecore_ipc_la_SOURCES) | ||
128 | DIST_SOURCES = $(libecore_ipc_la_SOURCES) | ||
129 | HEADERS = $(includes_HEADERS) | ||
130 | ETAGS = etags | ||
131 | CTAGS = ctags | ||
132 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
133 | ACLOCAL = @ACLOCAL@ | ||
134 | ALLOCA = @ALLOCA@ | ||
135 | AMTAR = @AMTAR@ | ||
136 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ | ||
137 | AR = @AR@ | ||
138 | AS = @AS@ | ||
139 | AUTOCONF = @AUTOCONF@ | ||
140 | AUTOHEADER = @AUTOHEADER@ | ||
141 | AUTOMAKE = @AUTOMAKE@ | ||
142 | AWK = @AWK@ | ||
143 | CARES_CFLAGS = @CARES_CFLAGS@ | ||
144 | CARES_LIBS = @CARES_LIBS@ | ||
145 | CC = @CC@ | ||
146 | CCDEPMODE = @CCDEPMODE@ | ||
147 | CFLAGS = @CFLAGS@ | ||
148 | CHECK_CFLAGS = @CHECK_CFLAGS@ | ||
149 | CHECK_LIBS = @CHECK_LIBS@ | ||
150 | CPP = @CPP@ | ||
151 | CPPFLAGS = @CPPFLAGS@ | ||
152 | CURL_CFLAGS = @CURL_CFLAGS@ | ||
153 | CURL_LIBS = @CURL_LIBS@ | ||
154 | CXX = @CXX@ | ||
155 | CXXCPP = @CXXCPP@ | ||
156 | CXXDEPMODE = @CXXDEPMODE@ | ||
157 | CXXFLAGS = @CXXFLAGS@ | ||
158 | CYGPATH_W = @CYGPATH_W@ | ||
159 | DEFS = @DEFS@ | ||
160 | DEPDIR = @DEPDIR@ | ||
161 | DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@ | ||
162 | DIRECTFB_LIBS = @DIRECTFB_LIBS@ | ||
163 | DLLTOOL = @DLLTOOL@ | ||
164 | DSYMUTIL = @DSYMUTIL@ | ||
165 | DUMPBIN = @DUMPBIN@ | ||
166 | ECHO_C = @ECHO_C@ | ||
167 | ECHO_N = @ECHO_N@ | ||
168 | ECHO_T = @ECHO_T@ | ||
169 | ECORE_XCB_CFLAGS = @ECORE_XCB_CFLAGS@ | ||
170 | ECORE_XCB_LIBS = @ECORE_XCB_LIBS@ | ||
171 | EFL_ECORE_BUILD = @EFL_ECORE_BUILD@ | ||
172 | EFL_ECORE_CON_BUILD = @EFL_ECORE_CON_BUILD@ | ||
173 | EFL_ECORE_EVAS_BUILD = @EFL_ECORE_EVAS_BUILD@ | ||
174 | EFL_ECORE_FILE_BUILD = @EFL_ECORE_FILE_BUILD@ | ||
175 | EFL_ECORE_IMF_BUILD = @EFL_ECORE_IMF_BUILD@ | ||
176 | EFL_ECORE_IMF_EVAS_BUILD = @EFL_ECORE_IMF_EVAS_BUILD@ | ||
177 | EFL_ECORE_INPUT_BUILD = @EFL_ECORE_INPUT_BUILD@ | ||
178 | EFL_ECORE_INPUT_EVAS_BUILD = @EFL_ECORE_INPUT_EVAS_BUILD@ | ||
179 | EFL_ECORE_IPC_BUILD = @EFL_ECORE_IPC_BUILD@ | ||
180 | EFL_ECORE_PSL1GHT_BUILD = @EFL_ECORE_PSL1GHT_BUILD@ | ||
181 | EFL_ECORE_SDL_BUILD = @EFL_ECORE_SDL_BUILD@ | ||
182 | EFL_ECORE_WIN32_BUILD = @EFL_ECORE_WIN32_BUILD@ | ||
183 | EFL_ECORE_WINCE_BUILD = @EFL_ECORE_WINCE_BUILD@ | ||
184 | EFL_PTHREAD_CFLAGS = @EFL_PTHREAD_CFLAGS@ | ||
185 | EFL_PTHREAD_LIBS = @EFL_PTHREAD_LIBS@ | ||
186 | EGREP = @EGREP@ | ||
187 | EINA_CFLAGS = @EINA_CFLAGS@ | ||
188 | EINA_LIBS = @EINA_LIBS@ | ||
189 | ESCAPE_CFLAGS = @ESCAPE_CFLAGS@ | ||
190 | ESCAPE_LIBS = @ESCAPE_LIBS@ | ||
191 | EVAS_CFLAGS = @EVAS_CFLAGS@ | ||
192 | EVAS_LIBS = @EVAS_LIBS@ | ||
193 | EVIL_CFLAGS = @EVIL_CFLAGS@ | ||
194 | EVIL_LIBS = @EVIL_LIBS@ | ||
195 | EXEEXT = @EXEEXT@ | ||
196 | FGREP = @FGREP@ | ||
197 | GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ | ||
198 | GLIB_CFLAGS = @GLIB_CFLAGS@ | ||
199 | GLIB_LIBS = @GLIB_LIBS@ | ||
200 | GMSGFMT = @GMSGFMT@ | ||
201 | GMSGFMT_015 = @GMSGFMT_015@ | ||
202 | GREP = @GREP@ | ||
203 | INSTALL = @INSTALL@ | ||
204 | INSTALL_DATA = @INSTALL_DATA@ | ||
205 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
206 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | ||
207 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | ||
208 | INTLLIBS = @INTLLIBS@ | ||
209 | INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ | ||
210 | KEYSYMDEFS = @KEYSYMDEFS@ | ||
211 | LD = @LD@ | ||
212 | LDFLAGS = @LDFLAGS@ | ||
213 | LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ | ||
214 | LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ | ||
215 | LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ | ||
216 | LIBICONV = @LIBICONV@ | ||
217 | LIBINTL = @LIBINTL@ | ||
218 | LIBOBJS = @LIBOBJS@ | ||
219 | LIBS = @LIBS@ | ||
220 | LIBTOOL = @LIBTOOL@ | ||
221 | LIPO = @LIPO@ | ||
222 | LN_S = @LN_S@ | ||
223 | LTLIBICONV = @LTLIBICONV@ | ||
224 | LTLIBINTL = @LTLIBINTL@ | ||
225 | LTLIBOBJS = @LTLIBOBJS@ | ||
226 | MAKEINFO = @MAKEINFO@ | ||
227 | MKDIR_P = @MKDIR_P@ | ||
228 | MSGFMT = @MSGFMT@ | ||
229 | MSGFMT_015 = @MSGFMT_015@ | ||
230 | MSGMERGE = @MSGMERGE@ | ||
231 | NM = @NM@ | ||
232 | NMEDIT = @NMEDIT@ | ||
233 | OBJC = @OBJC@ | ||
234 | OBJCDEPMODE = @OBJCDEPMODE@ | ||
235 | OBJCFLAGS = @OBJCFLAGS@ | ||
236 | OBJDUMP = @OBJDUMP@ | ||
237 | OBJEXT = @OBJEXT@ | ||
238 | OTOOL = @OTOOL@ | ||
239 | OTOOL64 = @OTOOL64@ | ||
240 | PACKAGE = @PACKAGE@ | ||
241 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | ||
242 | PACKAGE_NAME = @PACKAGE_NAME@ | ||
243 | PACKAGE_STRING = @PACKAGE_STRING@ | ||
244 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | ||
245 | PACKAGE_URL = @PACKAGE_URL@ | ||
246 | PACKAGE_VERSION = @PACKAGE_VERSION@ | ||
247 | PATH_SEPARATOR = @PATH_SEPARATOR@ | ||
248 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | ||
249 | PIXMAN_LIBS = @PIXMAN_LIBS@ | ||
250 | PKG_CONFIG = @PKG_CONFIG@ | ||
251 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
252 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
253 | POSUB = @POSUB@ | ||
254 | RANLIB = @RANLIB@ | ||
255 | SDL_CFLAGS = @SDL_CFLAGS@ | ||
256 | SDL_CONFIG = @SDL_CONFIG@ | ||
257 | SDL_LIBS = @SDL_LIBS@ | ||
258 | SED = @SED@ | ||
259 | SET_MAKE = @SET_MAKE@ | ||
260 | SHELL = @SHELL@ | ||
261 | SSL_CFLAGS = @SSL_CFLAGS@ | ||
262 | SSL_LIBS = @SSL_LIBS@ | ||
263 | STRIP = @STRIP@ | ||
264 | TLS2_CFLAGS = @TLS2_CFLAGS@ | ||
265 | TLS2_LIBS = @TLS2_LIBS@ | ||
266 | TLS_CFLAGS = @TLS_CFLAGS@ | ||
267 | TLS_LIBS = @TLS_LIBS@ | ||
268 | TSLIB_CFLAGS = @TSLIB_CFLAGS@ | ||
269 | TSLIB_LIBS = @TSLIB_LIBS@ | ||
270 | USE_NLS = @USE_NLS@ | ||
271 | VERSION = @VERSION@ | ||
272 | VMAJ = @VMAJ@ | ||
273 | WIN32_CFLAGS = @WIN32_CFLAGS@ | ||
274 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | ||
275 | WIN32_LIBS = @WIN32_LIBS@ | ||
276 | XCB_COMPOSITE_CFLAGS = @XCB_COMPOSITE_CFLAGS@ | ||
277 | XCB_COMPOSITE_LIBS = @XCB_COMPOSITE_LIBS@ | ||
278 | XCB_CURSOR_CFLAGS = @XCB_CURSOR_CFLAGS@ | ||
279 | XCB_CURSOR_LIBS = @XCB_CURSOR_LIBS@ | ||
280 | XCB_DAMAGE_CFLAGS = @XCB_DAMAGE_CFLAGS@ | ||
281 | XCB_DAMAGE_LIBS = @XCB_DAMAGE_LIBS@ | ||
282 | XCB_DPMS_CFLAGS = @XCB_DPMS_CFLAGS@ | ||
283 | XCB_DPMS_LIBS = @XCB_DPMS_LIBS@ | ||
284 | XCB_RANDR_CFLAGS = @XCB_RANDR_CFLAGS@ | ||
285 | XCB_RANDR_LIBS = @XCB_RANDR_LIBS@ | ||
286 | XCB_RENDER_CFLAGS = @XCB_RENDER_CFLAGS@ | ||
287 | XCB_RENDER_LIBS = @XCB_RENDER_LIBS@ | ||
288 | XCB_SCREENSAVER_CFLAGS = @XCB_SCREENSAVER_CFLAGS@ | ||
289 | XCB_SCREENSAVER_LIBS = @XCB_SCREENSAVER_LIBS@ | ||
290 | XCB_SHAPE_CFLAGS = @XCB_SHAPE_CFLAGS@ | ||
291 | XCB_SHAPE_LIBS = @XCB_SHAPE_LIBS@ | ||
292 | XCB_SYNC_CFLAGS = @XCB_SYNC_CFLAGS@ | ||
293 | XCB_SYNC_LIBS = @XCB_SYNC_LIBS@ | ||
294 | XCB_X11_CFLAGS = @XCB_X11_CFLAGS@ | ||
295 | XCB_X11_LIBS = @XCB_X11_LIBS@ | ||
296 | XCB_XFIXES_CFLAGS = @XCB_XFIXES_CFLAGS@ | ||
297 | XCB_XFIXES_LIBS = @XCB_XFIXES_LIBS@ | ||
298 | XCB_XGESTURE_CFLAGS = @XCB_XGESTURE_CFLAGS@ | ||
299 | XCB_XGESTURE_LIBS = @XCB_XGESTURE_LIBS@ | ||
300 | XCB_XINERAMA_CFLAGS = @XCB_XINERAMA_CFLAGS@ | ||
301 | XCB_XINERAMA_LIBS = @XCB_XINERAMA_LIBS@ | ||
302 | XCB_XINPUT_CFLAGS = @XCB_XINPUT_CFLAGS@ | ||
303 | XCB_XINPUT_LIBS = @XCB_XINPUT_LIBS@ | ||
304 | XCB_XPRINT_CFLAGS = @XCB_XPRINT_CFLAGS@ | ||
305 | XCB_XPRINT_LIBS = @XCB_XPRINT_LIBS@ | ||
306 | XCB_XTEST_CFLAGS = @XCB_XTEST_CFLAGS@ | ||
307 | XCB_XTEST_LIBS = @XCB_XTEST_LIBS@ | ||
308 | XCOMPOSITE_CFLAGS = @XCOMPOSITE_CFLAGS@ | ||
309 | XCOMPOSITE_LIBS = @XCOMPOSITE_LIBS@ | ||
310 | XDAMAGE_CFLAGS = @XDAMAGE_CFLAGS@ | ||
311 | XDAMAGE_LIBS = @XDAMAGE_LIBS@ | ||
312 | XDPMS_CFLAGS = @XDPMS_CFLAGS@ | ||
313 | XDPMS_LIBS = @XDPMS_LIBS@ | ||
314 | XFIXES_CFLAGS = @XFIXES_CFLAGS@ | ||
315 | XFIXES_LIBS = @XFIXES_LIBS@ | ||
316 | XGESTURE_CFLAGS = @XGESTURE_CFLAGS@ | ||
317 | XGESTURE_LIBS = @XGESTURE_LIBS@ | ||
318 | XGETTEXT = @XGETTEXT@ | ||
319 | XGETTEXT_015 = @XGETTEXT_015@ | ||
320 | XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ | ||
321 | XI2_CFLAGS = @XI2_CFLAGS@ | ||
322 | XI2_LIBS = @XI2_LIBS@ | ||
323 | XINERAMA_CFLAGS = @XINERAMA_CFLAGS@ | ||
324 | XINERAMA_LIBS = @XINERAMA_LIBS@ | ||
325 | XKB_CFLAGS = @XKB_CFLAGS@ | ||
326 | XKB_LIBS = @XKB_LIBS@ | ||
327 | XMKMF = @XMKMF@ | ||
328 | XPRINT_CFLAGS = @XPRINT_CFLAGS@ | ||
329 | XPRINT_LIBS = @XPRINT_LIBS@ | ||
330 | XRANDR_CFLAGS = @XRANDR_CFLAGS@ | ||
331 | XRANDR_LIBS = @XRANDR_LIBS@ | ||
332 | XRENDER_CFLAGS = @XRENDER_CFLAGS@ | ||
333 | XRENDER_LIBS = @XRENDER_LIBS@ | ||
334 | XSS_CFLAGS = @XSS_CFLAGS@ | ||
335 | XSS_LIBS = @XSS_LIBS@ | ||
336 | XTEST_CFLAGS = @XTEST_CFLAGS@ | ||
337 | XTEST_LIBS = @XTEST_LIBS@ | ||
338 | X_CFLAGS = @X_CFLAGS@ | ||
339 | X_EXTRA_LIBS = @X_EXTRA_LIBS@ | ||
340 | X_LIBS = @X_LIBS@ | ||
341 | X_PRE_LIBS = @X_PRE_LIBS@ | ||
342 | Xcursor_cflags = @Xcursor_cflags@ | ||
343 | Xcursor_libs = @Xcursor_libs@ | ||
344 | abs_builddir = @abs_builddir@ | ||
345 | abs_srcdir = @abs_srcdir@ | ||
346 | abs_top_builddir = @abs_top_builddir@ | ||
347 | abs_top_srcdir = @abs_top_srcdir@ | ||
348 | ac_ct_CC = @ac_ct_CC@ | ||
349 | ac_ct_CXX = @ac_ct_CXX@ | ||
350 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ | ||
351 | ac_ct_OBJC = @ac_ct_OBJC@ | ||
352 | am__include = @am__include@ | ||
353 | am__leading_dot = @am__leading_dot@ | ||
354 | am__quote = @am__quote@ | ||
355 | am__tar = @am__tar@ | ||
356 | am__untar = @am__untar@ | ||
357 | bindir = @bindir@ | ||
358 | build = @build@ | ||
359 | build_alias = @build_alias@ | ||
360 | build_cpu = @build_cpu@ | ||
361 | build_os = @build_os@ | ||
362 | build_vendor = @build_vendor@ | ||
363 | builddir = @builddir@ | ||
364 | cocoa_ldflags = @cocoa_ldflags@ | ||
365 | datadir = @datadir@ | ||
366 | datarootdir = @datarootdir@ | ||
367 | dlopen_libs = @dlopen_libs@ | ||
368 | docdir = @docdir@ | ||
369 | dvidir = @dvidir@ | ||
370 | ecore_cocoa_cflags = @ecore_cocoa_cflags@ | ||
371 | ecore_cocoa_libs = @ecore_cocoa_libs@ | ||
372 | ecore_con_cflags = @ecore_con_cflags@ | ||
373 | ecore_con_libs = @ecore_con_libs@ | ||
374 | ecore_directfb_cflags = @ecore_directfb_cflags@ | ||
375 | ecore_directfb_libs = @ecore_directfb_libs@ | ||
376 | ecore_evas_cflags = @ecore_evas_cflags@ | ||
377 | ecore_evas_libs = @ecore_evas_libs@ | ||
378 | ecore_fb_cflags = @ecore_fb_cflags@ | ||
379 | ecore_fb_libs = @ecore_fb_libs@ | ||
380 | ecore_file_cflags = @ecore_file_cflags@ | ||
381 | ecore_file_libs = @ecore_file_libs@ | ||
382 | ecore_imf_cflags = @ecore_imf_cflags@ | ||
383 | ecore_imf_evas_cflags = @ecore_imf_evas_cflags@ | ||
384 | ecore_imf_evas_libs = @ecore_imf_evas_libs@ | ||
385 | ecore_imf_libs = @ecore_imf_libs@ | ||
386 | ecore_imf_xim_cflags = @ecore_imf_xim_cflags@ | ||
387 | ecore_imf_xim_libs = @ecore_imf_xim_libs@ | ||
388 | ecore_input_cflags = @ecore_input_cflags@ | ||
389 | ecore_input_evas_cflags = @ecore_input_evas_cflags@ | ||
390 | ecore_input_evas_libs = @ecore_input_evas_libs@ | ||
391 | ecore_input_libs = @ecore_input_libs@ | ||
392 | ecore_ipc_cflags = @ecore_ipc_cflags@ | ||
393 | ecore_ipc_libs = @ecore_ipc_libs@ | ||
394 | ecore_psl1ght_cflags = @ecore_psl1ght_cflags@ | ||
395 | ecore_psl1ght_libs = @ecore_psl1ght_libs@ | ||
396 | ecore_sdl_cflags = @ecore_sdl_cflags@ | ||
397 | ecore_sdl_libs = @ecore_sdl_libs@ | ||
398 | ecore_win32_cflags = @ecore_win32_cflags@ | ||
399 | ecore_win32_libs = @ecore_win32_libs@ | ||
400 | ecore_wince_cflags = @ecore_wince_cflags@ | ||
401 | ecore_wince_libs = @ecore_wince_libs@ | ||
402 | ecore_x_cflags = @ecore_x_cflags@ | ||
403 | ecore_x_libs = @ecore_x_libs@ | ||
404 | ecore_x_libs_private = @ecore_x_libs_private@ | ||
405 | efl_doxygen = @efl_doxygen@ | ||
406 | efl_have_doxygen = @efl_have_doxygen@ | ||
407 | exec_prefix = @exec_prefix@ | ||
408 | have_ecore_x_xcb_define = @have_ecore_x_xcb_define@ | ||
409 | host = @host@ | ||
410 | host_alias = @host_alias@ | ||
411 | host_cpu = @host_cpu@ | ||
412 | host_os = @host_os@ | ||
413 | host_vendor = @host_vendor@ | ||
414 | htmldir = @htmldir@ | ||
415 | includedir = @includedir@ | ||
416 | infodir = @infodir@ | ||
417 | install_sh = @install_sh@ | ||
418 | libdir = @libdir@ | ||
419 | libexecdir = @libexecdir@ | ||
420 | localedir = @localedir@ | ||
421 | localstatedir = @localstatedir@ | ||
422 | lt_ECHO = @lt_ECHO@ | ||
423 | lt_enable_auto_import = @lt_enable_auto_import@ | ||
424 | mandir = @mandir@ | ||
425 | mkdir_p = @mkdir_p@ | ||
426 | oldincludedir = @oldincludedir@ | ||
427 | pdfdir = @pdfdir@ | ||
428 | pkgconfig_requires_private = @pkgconfig_requires_private@ | ||
429 | prefix = @prefix@ | ||
430 | program_transform_name = @program_transform_name@ | ||
431 | psdir = @psdir@ | ||
432 | release_info = @release_info@ | ||
433 | requirements_ecore = @requirements_ecore@ | ||
434 | requirements_ecore_cocoa = @requirements_ecore_cocoa@ | ||
435 | requirements_ecore_con = @requirements_ecore_con@ | ||
436 | requirements_ecore_directfb = @requirements_ecore_directfb@ | ||
437 | requirements_ecore_evas = @requirements_ecore_evas@ | ||
438 | requirements_ecore_fb = @requirements_ecore_fb@ | ||
439 | requirements_ecore_file = @requirements_ecore_file@ | ||
440 | requirements_ecore_imf = @requirements_ecore_imf@ | ||
441 | requirements_ecore_imf_evas = @requirements_ecore_imf_evas@ | ||
442 | requirements_ecore_imf_xim = @requirements_ecore_imf_xim@ | ||
443 | requirements_ecore_input = @requirements_ecore_input@ | ||
444 | requirements_ecore_input_evas = @requirements_ecore_input_evas@ | ||
445 | requirements_ecore_ipc = @requirements_ecore_ipc@ | ||
446 | requirements_ecore_psl1ght = @requirements_ecore_psl1ght@ | ||
447 | requirements_ecore_sdl = @requirements_ecore_sdl@ | ||
448 | requirements_ecore_win32 = @requirements_ecore_win32@ | ||
449 | requirements_ecore_wince = @requirements_ecore_wince@ | ||
450 | requirements_ecore_x = @requirements_ecore_x@ | ||
451 | rt_libs = @rt_libs@ | ||
452 | sbindir = @sbindir@ | ||
453 | sharedstatedir = @sharedstatedir@ | ||
454 | srcdir = @srcdir@ | ||
455 | sysconfdir = @sysconfdir@ | ||
456 | target_alias = @target_alias@ | ||
457 | top_build_prefix = @top_build_prefix@ | ||
458 | top_builddir = @top_builddir@ | ||
459 | top_srcdir = @top_srcdir@ | ||
460 | version_info = @version_info@ | ||
461 | x_cflags = @x_cflags@ | ||
462 | x_includes = @x_includes@ | ||
463 | x_libs = @x_libs@ | ||
464 | MAINTAINERCLEANFILES = Makefile.in | ||
465 | AM_CPPFLAGS = \ | ||
466 | -I$(top_builddir)/src/lib/ecore \ | ||
467 | -I$(top_builddir)/src/lib/ecore_con \ | ||
468 | -I$(top_builddir)/src/lib/ecore_ipc \ | ||
469 | -I$(top_srcdir)/src/lib/ecore \ | ||
470 | -I$(top_srcdir)/src/lib/ecore_con \ | ||
471 | -I$(top_srcdir)/src/lib/ecore_ipc \ | ||
472 | @EFL_ECORE_IPC_BUILD@ \ | ||
473 | @SSL_CFLAGS@ \ | ||
474 | @EINA_CFLAGS@ | ||
475 | |||
476 | lib_LTLIBRARIES = libecore_ipc.la | ||
477 | includes_HEADERS = Ecore_Ipc.h | ||
478 | includesdir = $(includedir)/ecore-@VMAJ@ | ||
479 | libecore_ipc_la_SOURCES = \ | ||
480 | ecore_ipc.c | ||
481 | |||
482 | libecore_ipc_la_LIBADD = \ | ||
483 | $(top_builddir)/src/lib/ecore/libecore.la \ | ||
484 | $(top_builddir)/src/lib/ecore_con/libecore_con.la \ | ||
485 | @SSL_LIBS@ \ | ||
486 | @EINA_LIBS@ | ||
487 | |||
488 | libecore_ipc_la_LDFLAGS = -no-undefined -version-info @version_info@ @release_info@ | ||
489 | EXTRA_DIST = ecore_ipc_private.h | ||
490 | all: all-am | ||
491 | |||
492 | .SUFFIXES: | ||
493 | .SUFFIXES: .c .lo .o .obj | ||
494 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
495 | @for dep in $?; do \ | ||
496 | case '$(am__configure_deps)' in \ | ||
497 | *$$dep*) \ | ||
498 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ | ||
499 | && { if test -f $@; then exit 0; else break; fi; }; \ | ||
500 | exit 1;; \ | ||
501 | esac; \ | ||
502 | done; \ | ||
503 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/ecore_ipc/Makefile'; \ | ||
504 | $(am__cd) $(top_srcdir) && \ | ||
505 | $(AUTOMAKE) --gnu src/lib/ecore_ipc/Makefile | ||
506 | .PRECIOUS: Makefile | ||
507 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
508 | @case '$?' in \ | ||
509 | *config.status*) \ | ||
510 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
511 | *) \ | ||
512 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
513 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
514 | esac; | ||
515 | |||
516 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
517 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
518 | |||
519 | $(top_srcdir)/configure: $(am__configure_deps) | ||
520 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
521 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
522 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
523 | $(am__aclocal_m4_deps): | ||
524 | install-libLTLIBRARIES: $(lib_LTLIBRARIES) | ||
525 | @$(NORMAL_INSTALL) | ||
526 | test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" | ||
527 | @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ | ||
528 | list2=; for p in $$list; do \ | ||
529 | if test -f $$p; then \ | ||
530 | list2="$$list2 $$p"; \ | ||
531 | else :; fi; \ | ||
532 | done; \ | ||
533 | test -z "$$list2" || { \ | ||
534 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ | ||
535 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ | ||
536 | } | ||
537 | |||
538 | uninstall-libLTLIBRARIES: | ||
539 | @$(NORMAL_UNINSTALL) | ||
540 | @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \ | ||
541 | for p in $$list; do \ | ||
542 | $(am__strip_dir) \ | ||
543 | echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \ | ||
544 | $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \ | ||
545 | done | ||
546 | |||
547 | clean-libLTLIBRARIES: | ||
548 | -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) | ||
549 | @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ | ||
550 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ | ||
551 | test "$$dir" != "$$p" || dir=.; \ | ||
552 | echo "rm -f \"$${dir}/so_locations\""; \ | ||
553 | rm -f "$${dir}/so_locations"; \ | ||
554 | done | ||
555 | libecore_ipc.la: $(libecore_ipc_la_OBJECTS) $(libecore_ipc_la_DEPENDENCIES) | ||
556 | $(AM_V_CCLD)$(libecore_ipc_la_LINK) -rpath $(libdir) $(libecore_ipc_la_OBJECTS) $(libecore_ipc_la_LIBADD) $(LIBS) | ||
557 | |||
558 | mostlyclean-compile: | ||
559 | -rm -f *.$(OBJEXT) | ||
560 | |||
561 | distclean-compile: | ||
562 | -rm -f *.tab.c | ||
563 | |||
564 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ecore_ipc.Plo@am__quote@ | ||
565 | |||
566 | .c.o: | ||
567 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
568 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
569 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
570 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
571 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
572 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< | ||
573 | |||
574 | .c.obj: | ||
575 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` | ||
576 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
577 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
578 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
579 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
580 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` | ||
581 | |||
582 | .c.lo: | ||
583 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
584 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo | ||
585 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
586 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ | ||
587 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
588 | @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< | ||
589 | |||
590 | mostlyclean-libtool: | ||
591 | -rm -f *.lo | ||
592 | |||
593 | clean-libtool: | ||
594 | -rm -rf .libs _libs | ||
595 | install-includesHEADERS: $(includes_HEADERS) | ||
596 | @$(NORMAL_INSTALL) | ||
597 | test -z "$(includesdir)" || $(MKDIR_P) "$(DESTDIR)$(includesdir)" | ||
598 | @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \ | ||
599 | for p in $$list; do \ | ||
600 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ | ||
601 | echo "$$d$$p"; \ | ||
602 | done | $(am__base_list) | \ | ||
603 | while read files; do \ | ||
604 | echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includesdir)'"; \ | ||
605 | $(INSTALL_HEADER) $$files "$(DESTDIR)$(includesdir)" || exit $$?; \ | ||
606 | done | ||
607 | |||
608 | uninstall-includesHEADERS: | ||
609 | @$(NORMAL_UNINSTALL) | ||
610 | @list='$(includes_HEADERS)'; test -n "$(includesdir)" || list=; \ | ||
611 | files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ | ||
612 | test -n "$$files" || exit 0; \ | ||
613 | echo " ( cd '$(DESTDIR)$(includesdir)' && rm -f" $$files ")"; \ | ||
614 | cd "$(DESTDIR)$(includesdir)" && rm -f $$files | ||
615 | |||
616 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
617 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
618 | unique=`for i in $$list; do \ | ||
619 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
620 | done | \ | ||
621 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
622 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
623 | mkid -fID $$unique | ||
624 | tags: TAGS | ||
625 | |||
626 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
627 | $(TAGS_FILES) $(LISP) | ||
628 | set x; \ | ||
629 | here=`pwd`; \ | ||
630 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
631 | unique=`for i in $$list; do \ | ||
632 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
633 | done | \ | ||
634 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
635 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
636 | shift; \ | ||
637 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ | ||
638 | test -n "$$unique" || unique=$$empty_fix; \ | ||
639 | if test $$# -gt 0; then \ | ||
640 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
641 | "$$@" $$unique; \ | ||
642 | else \ | ||
643 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
644 | $$unique; \ | ||
645 | fi; \ | ||
646 | fi | ||
647 | ctags: CTAGS | ||
648 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
649 | $(TAGS_FILES) $(LISP) | ||
650 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
651 | unique=`for i in $$list; do \ | ||
652 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
653 | done | \ | ||
654 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
655 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
656 | test -z "$(CTAGS_ARGS)$$unique" \ | ||
657 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
658 | $$unique | ||
659 | |||
660 | GTAGS: | ||
661 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
662 | && $(am__cd) $(top_srcdir) \ | ||
663 | && gtags -i $(GTAGS_ARGS) "$$here" | ||
664 | |||
665 | distclean-tags: | ||
666 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
667 | |||
668 | distdir: $(DISTFILES) | ||
669 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
670 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
671 | list='$(DISTFILES)'; \ | ||
672 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
673 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
674 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
675 | case $$dist_files in \ | ||
676 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
677 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
678 | sort -u` ;; \ | ||
679 | esac; \ | ||
680 | for file in $$dist_files; do \ | ||
681 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
682 | if test -d $$d/$$file; then \ | ||
683 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
684 | if test -d "$(distdir)/$$file"; then \ | ||
685 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
686 | fi; \ | ||
687 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
688 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ | ||
689 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
690 | fi; \ | ||
691 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ | ||
692 | else \ | ||
693 | test -f "$(distdir)/$$file" \ | ||
694 | || cp -p $$d/$$file "$(distdir)/$$file" \ | ||
695 | || exit 1; \ | ||
696 | fi; \ | ||
697 | done | ||
698 | check-am: all-am | ||
699 | check: check-am | ||
700 | all-am: Makefile $(LTLIBRARIES) $(HEADERS) | ||
701 | installdirs: | ||
702 | for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includesdir)"; do \ | ||
703 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
704 | done | ||
705 | install: install-am | ||
706 | install-exec: install-exec-am | ||
707 | install-data: install-data-am | ||
708 | uninstall: uninstall-am | ||
709 | |||
710 | install-am: all-am | ||
711 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
712 | |||
713 | installcheck: installcheck-am | ||
714 | install-strip: | ||
715 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
716 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
717 | `test -z '$(STRIP)' || \ | ||
718 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
719 | mostlyclean-generic: | ||
720 | |||
721 | clean-generic: | ||
722 | |||
723 | distclean-generic: | ||
724 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
725 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) | ||
726 | |||
727 | maintainer-clean-generic: | ||
728 | @echo "This command is intended for maintainers to use" | ||
729 | @echo "it deletes files that may require special tools to rebuild." | ||
730 | -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) | ||
731 | clean: clean-am | ||
732 | |||
733 | clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ | ||
734 | mostlyclean-am | ||
735 | |||
736 | distclean: distclean-am | ||
737 | -rm -rf ./$(DEPDIR) | ||
738 | -rm -f Makefile | ||
739 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
740 | distclean-tags | ||
741 | |||
742 | dvi: dvi-am | ||
743 | |||
744 | dvi-am: | ||
745 | |||
746 | html: html-am | ||
747 | |||
748 | html-am: | ||
749 | |||
750 | info: info-am | ||
751 | |||
752 | info-am: | ||
753 | |||
754 | install-data-am: install-includesHEADERS | ||
755 | |||
756 | install-dvi: install-dvi-am | ||
757 | |||
758 | install-dvi-am: | ||
759 | |||
760 | install-exec-am: install-libLTLIBRARIES | ||
761 | |||
762 | install-html: install-html-am | ||
763 | |||
764 | install-html-am: | ||
765 | |||
766 | install-info: install-info-am | ||
767 | |||
768 | install-info-am: | ||
769 | |||
770 | install-man: | ||
771 | |||
772 | install-pdf: install-pdf-am | ||
773 | |||
774 | install-pdf-am: | ||
775 | |||
776 | install-ps: install-ps-am | ||
777 | |||
778 | install-ps-am: | ||
779 | |||
780 | installcheck-am: | ||
781 | |||
782 | maintainer-clean: maintainer-clean-am | ||
783 | -rm -rf ./$(DEPDIR) | ||
784 | -rm -f Makefile | ||
785 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
786 | |||
787 | mostlyclean: mostlyclean-am | ||
788 | |||
789 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
790 | mostlyclean-libtool | ||
791 | |||
792 | pdf: pdf-am | ||
793 | |||
794 | pdf-am: | ||
795 | |||
796 | ps: ps-am | ||
797 | |||
798 | ps-am: | ||
799 | |||
800 | uninstall-am: uninstall-includesHEADERS uninstall-libLTLIBRARIES | ||
801 | |||
802 | .MAKE: install-am install-strip | ||
803 | |||
804 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ | ||
805 | clean-libLTLIBRARIES clean-libtool ctags distclean \ | ||
806 | distclean-compile distclean-generic distclean-libtool \ | ||
807 | distclean-tags distdir dvi dvi-am html html-am info info-am \ | ||
808 | install install-am install-data install-data-am install-dvi \ | ||
809 | install-dvi-am install-exec install-exec-am install-html \ | ||
810 | install-html-am install-includesHEADERS install-info \ | ||
811 | install-info-am install-libLTLIBRARIES install-man install-pdf \ | ||
812 | install-pdf-am install-ps install-ps-am install-strip \ | ||
813 | installcheck installcheck-am installdirs maintainer-clean \ | ||
814 | maintainer-clean-generic mostlyclean mostlyclean-compile \ | ||
815 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ | ||
816 | tags uninstall uninstall-am uninstall-includesHEADERS \ | ||
817 | uninstall-libLTLIBRARIES | ||
818 | |||
819 | |||
820 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
821 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
822 | .NOEXPORT: | ||
diff --git a/libraries/ecore/src/lib/ecore_ipc/ecore_ipc.c b/libraries/ecore/src/lib/ecore_ipc/ecore_ipc.c new file mode 100644 index 0000000..c17cadd --- /dev/null +++ b/libraries/ecore/src/lib/ecore_ipc/ecore_ipc.c | |||
@@ -0,0 +1,1591 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include <config.h> | ||
3 | #endif | ||
4 | |||
5 | #include <string.h> | ||
6 | |||
7 | #ifdef HAVE_NETINET_IN_H | ||
8 | # include <sys/types.h> | ||
9 | # include <netinet/in.h> | ||
10 | #endif | ||
11 | |||
12 | #ifdef HAVE_WINSOCK2_H | ||
13 | # include <winsock2.h> | ||
14 | #endif | ||
15 | |||
16 | #if USE_GNUTLS_OPENSSL | ||
17 | # include <gnutls/openssl.h> | ||
18 | #elif USE_OPENSSL | ||
19 | # include <openssl/ssl.h> | ||
20 | #endif | ||
21 | |||
22 | #include <Ecore.h> | ||
23 | #include <ecore_private.h> | ||
24 | #include <Ecore_Con.h> | ||
25 | |||
26 | #include "Ecore_Ipc.h" | ||
27 | #include "ecore_ipc_private.h" | ||
28 | |||
29 | #define DLT_ZERO 0 | ||
30 | #define DLT_ONE 1 | ||
31 | #define DLT_SAME 2 | ||
32 | #define DLT_SHL 3 | ||
33 | #define DLT_SHR 4 | ||
34 | #define DLT_ADD8 5 | ||
35 | #define DLT_DEL8 6 | ||
36 | #define DLT_ADDU8 7 | ||
37 | #define DLT_DELU8 8 | ||
38 | #define DLT_ADD16 9 | ||
39 | #define DLT_DEL16 10 | ||
40 | #define DLT_ADDU16 11 | ||
41 | #define DLT_DELU16 12 | ||
42 | #define DLT_SET 13 | ||
43 | #define DLT_R1 14 | ||
44 | #define DLT_R2 15 | ||
45 | |||
46 | int _ecore_ipc_log_dom = -1; | ||
47 | |||
48 | EAPI unsigned short | ||
49 | _ecore_ipc_swap_16(unsigned short v) | ||
50 | { | ||
51 | unsigned char *s, t; | ||
52 | |||
53 | s = (unsigned char *)(&v); | ||
54 | t = s[0]; s[0] = s[1]; s[1] = t; | ||
55 | return v; | ||
56 | } | ||
57 | |||
58 | EAPI unsigned int | ||
59 | _ecore_ipc_swap_32(unsigned int v) | ||
60 | { | ||
61 | unsigned char *s, t; | ||
62 | |||
63 | s = (unsigned char *)(&v); | ||
64 | t = s[0]; s[0] = s[3]; s[3] = t; | ||
65 | t = s[1]; s[1] = s[2]; s[2] = t; | ||
66 | return v; | ||
67 | } | ||
68 | |||
69 | EAPI unsigned long long | ||
70 | _ecore_ipc_swap_64(unsigned long long v) | ||
71 | { | ||
72 | unsigned char *s, t; | ||
73 | |||
74 | s = (unsigned char *)(&v); | ||
75 | t = s[0]; s[0] = s[7]; s[7] = t; | ||
76 | t = s[1]; s[1] = s[6]; s[6] = t; | ||
77 | t = s[2]; s[2] = s[5]; s[5] = t; | ||
78 | t = s[3]; s[3] = s[4]; s[4] = t; | ||
79 | return v; | ||
80 | } | ||
81 | |||
82 | static int _ecore_ipc_dlt_int(int out, int prev, int *mode); | ||
83 | static int _ecore_ipc_ddlt_int(int in, int prev, int mode); | ||
84 | |||
85 | static int | ||
86 | _ecore_ipc_dlt_int(int out, int prev, int *mode) | ||
87 | { | ||
88 | int dlt; | ||
89 | |||
90 | /* 0 byte */ | ||
91 | if (out == 0) | ||
92 | { | ||
93 | *mode = DLT_ZERO; | ||
94 | return 0; | ||
95 | } | ||
96 | if (out == (int)0xffffffff) | ||
97 | { | ||
98 | *mode = DLT_ONE; | ||
99 | return 0; | ||
100 | } | ||
101 | if (out == prev) | ||
102 | { | ||
103 | *mode = DLT_SAME; | ||
104 | return 0; | ||
105 | } | ||
106 | if (out == prev << 1) | ||
107 | { | ||
108 | *mode = DLT_SHL; | ||
109 | return 0; | ||
110 | } | ||
111 | if (out == prev >> 1) | ||
112 | { | ||
113 | *mode = DLT_SHR; | ||
114 | return 0; | ||
115 | } | ||
116 | /* 1 byte */ | ||
117 | dlt = out - prev; | ||
118 | if (!(dlt & 0xffffff00)) | ||
119 | { | ||
120 | *mode = DLT_ADD8; | ||
121 | return dlt & 0xff; | ||
122 | } | ||
123 | dlt = prev - out; | ||
124 | if (!(dlt & 0xffffff00)) | ||
125 | { | ||
126 | *mode = DLT_DEL8; | ||
127 | return dlt & 0xff; | ||
128 | } | ||
129 | dlt = out - prev; | ||
130 | if (!(dlt & 0x00ffffff)) | ||
131 | { | ||
132 | *mode = DLT_ADDU8; | ||
133 | return (dlt >> 24) & 0xff; | ||
134 | } | ||
135 | dlt = prev - out; | ||
136 | if (!(dlt & 0x00ffffff)) | ||
137 | { | ||
138 | *mode = DLT_DELU8; | ||
139 | return (dlt >> 24) & 0xff; | ||
140 | } | ||
141 | /* 2 byte */ | ||
142 | dlt = out - prev; | ||
143 | if (!(dlt & 0xffff0000)) | ||
144 | { | ||
145 | *mode = DLT_ADD16; | ||
146 | return dlt & 0xffff; | ||
147 | } | ||
148 | dlt = prev - out; | ||
149 | if (!(dlt & 0xffff0000)) | ||
150 | { | ||
151 | *mode = DLT_DEL16; | ||
152 | return dlt & 0xffff; | ||
153 | } | ||
154 | dlt = out - prev; | ||
155 | if (!(dlt & 0x0000ffff)) | ||
156 | { | ||
157 | *mode = DLT_ADDU16; | ||
158 | return (dlt >> 16) & 0xffff; | ||
159 | } | ||
160 | dlt = prev - out; | ||
161 | if (!(dlt & 0x0000ffff)) | ||
162 | { | ||
163 | *mode = DLT_DELU16; | ||
164 | return (dlt >> 16) & 0xffff; | ||
165 | } | ||
166 | /* 4 byte */ | ||
167 | *mode = DLT_SET; | ||
168 | return out; | ||
169 | } | ||
170 | |||
171 | static int | ||
172 | _ecore_ipc_ddlt_int(int in, int prev, int mode) | ||
173 | { | ||
174 | switch (mode) | ||
175 | { | ||
176 | case DLT_ZERO: | ||
177 | return 0; | ||
178 | break; | ||
179 | case DLT_ONE: | ||
180 | return 0xffffffff; | ||
181 | break; | ||
182 | case DLT_SAME: | ||
183 | return prev; | ||
184 | break; | ||
185 | case DLT_SHL: | ||
186 | return prev << 1; | ||
187 | break; | ||
188 | case DLT_SHR: | ||
189 | return prev >> 1; | ||
190 | break; | ||
191 | case DLT_ADD8: | ||
192 | return prev + in; | ||
193 | break; | ||
194 | case DLT_DEL8: | ||
195 | return prev - in; | ||
196 | break; | ||
197 | case DLT_ADDU8: | ||
198 | return prev + (in << 24); | ||
199 | break; | ||
200 | case DLT_DELU8: | ||
201 | return prev - (in << 24); | ||
202 | break; | ||
203 | case DLT_ADD16: | ||
204 | return prev + in; | ||
205 | break; | ||
206 | case DLT_DEL16: | ||
207 | return prev - in; | ||
208 | break; | ||
209 | case DLT_ADDU16: | ||
210 | return prev + (in << 16); | ||
211 | break; | ||
212 | case DLT_DELU16: | ||
213 | return prev - (in << 16); | ||
214 | break; | ||
215 | case DLT_SET: | ||
216 | return in; | ||
217 | break; | ||
218 | case DLT_R1: | ||
219 | return 0; | ||
220 | break; | ||
221 | case DLT_R2: | ||
222 | return 0; | ||
223 | break; | ||
224 | default: | ||
225 | break; | ||
226 | } | ||
227 | return 0; | ||
228 | } | ||
229 | |||
230 | static Eina_Bool _ecore_ipc_event_client_add(void *data, int ev_type, void *ev); | ||
231 | static Eina_Bool _ecore_ipc_event_client_del(void *data, int ev_type, void *ev); | ||
232 | static Eina_Bool _ecore_ipc_event_server_add(void *data, int ev_type, void *ev); | ||
233 | static Eina_Bool _ecore_ipc_event_server_del(void *data, int ev_type, void *ev); | ||
234 | static Eina_Bool _ecore_ipc_event_client_data(void *data, int ev_type, void *ev); | ||
235 | static Eina_Bool _ecore_ipc_event_server_data(void *data, int ev_type, void *ev); | ||
236 | static void _ecore_ipc_event_client_add_free(void *data, void *ev); | ||
237 | static void _ecore_ipc_event_client_del_free(void *data, void *ev); | ||
238 | static void _ecore_ipc_event_client_data_free(void *data, void *ev); | ||
239 | static void _ecore_ipc_event_server_add_free(void *data, void *ev); | ||
240 | static void _ecore_ipc_event_server_del_free(void *data, void *ev); | ||
241 | static void _ecore_ipc_event_server_data_free(void *data, void *ev); | ||
242 | |||
243 | EAPI int ECORE_IPC_EVENT_CLIENT_ADD = 0; | ||
244 | EAPI int ECORE_IPC_EVENT_CLIENT_DEL = 0; | ||
245 | EAPI int ECORE_IPC_EVENT_SERVER_ADD = 0; | ||
246 | EAPI int ECORE_IPC_EVENT_SERVER_DEL = 0; | ||
247 | EAPI int ECORE_IPC_EVENT_CLIENT_DATA = 0; | ||
248 | EAPI int ECORE_IPC_EVENT_SERVER_DATA = 0; | ||
249 | |||
250 | static int _ecore_ipc_init_count = 0; | ||
251 | static Eina_List *servers = NULL; | ||
252 | static Ecore_Event_Handler *handler[6]; | ||
253 | |||
254 | /** | ||
255 | * @defgroup Ecore_IPC_Library_Group IPC Library Functions | ||
256 | * | ||
257 | * Functions that set up and shut down the Ecore IPC Library. | ||
258 | */ | ||
259 | |||
260 | /** | ||
261 | * Initialises the Ecore IPC library. | ||
262 | * @return Number of times the library has been initialised without | ||
263 | * being shut down. | ||
264 | * @ingroup Ecore_IPC_Library_Group | ||
265 | */ | ||
266 | EAPI int | ||
267 | ecore_ipc_init(void) | ||
268 | { | ||
269 | int i = 0; | ||
270 | |||
271 | if (++_ecore_ipc_init_count != 1) | ||
272 | return _ecore_ipc_init_count; | ||
273 | _ecore_ipc_log_dom = eina_log_domain_register | ||
274 | ("ecore_ipc", ECORE_IPC_DEFAULT_LOG_COLOR); | ||
275 | if(_ecore_ipc_log_dom < 0) | ||
276 | { | ||
277 | EINA_LOG_ERR("Impossible to create a log domain for the Ecore IPC module."); | ||
278 | return --_ecore_ipc_init_count; | ||
279 | } | ||
280 | if (!ecore_con_init()) | ||
281 | return --_ecore_ipc_init_count; | ||
282 | |||
283 | ECORE_IPC_EVENT_CLIENT_ADD = ecore_event_type_new(); | ||
284 | ECORE_IPC_EVENT_CLIENT_DEL = ecore_event_type_new(); | ||
285 | ECORE_IPC_EVENT_SERVER_ADD = ecore_event_type_new(); | ||
286 | ECORE_IPC_EVENT_SERVER_DEL = ecore_event_type_new(); | ||
287 | ECORE_IPC_EVENT_CLIENT_DATA = ecore_event_type_new(); | ||
288 | ECORE_IPC_EVENT_SERVER_DATA = ecore_event_type_new(); | ||
289 | |||
290 | handler[i++] = ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_ADD, | ||
291 | _ecore_ipc_event_client_add, NULL); | ||
292 | handler[i++] = ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DEL, | ||
293 | _ecore_ipc_event_client_del, NULL); | ||
294 | handler[i++] = ecore_event_handler_add(ECORE_CON_EVENT_SERVER_ADD, | ||
295 | _ecore_ipc_event_server_add, NULL); | ||
296 | handler[i++] = ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DEL, | ||
297 | _ecore_ipc_event_server_del, NULL); | ||
298 | handler[i++] = ecore_event_handler_add(ECORE_CON_EVENT_CLIENT_DATA, | ||
299 | _ecore_ipc_event_client_data, NULL); | ||
300 | handler[i] = ecore_event_handler_add(ECORE_CON_EVENT_SERVER_DATA, | ||
301 | _ecore_ipc_event_server_data, NULL); | ||
302 | return _ecore_ipc_init_count; | ||
303 | } | ||
304 | |||
305 | /** | ||
306 | * Shuts down the Ecore IPC library. | ||
307 | * @return Number of times the library has been initialised without being | ||
308 | * shut down. | ||
309 | * @ingroup Ecore_IPC_Library_Group | ||
310 | */ | ||
311 | EAPI int | ||
312 | ecore_ipc_shutdown(void) | ||
313 | { | ||
314 | int i; | ||
315 | |||
316 | if (--_ecore_ipc_init_count != 0) | ||
317 | return _ecore_ipc_init_count; | ||
318 | |||
319 | while (servers) ecore_ipc_server_del(eina_list_data_get(servers)); | ||
320 | |||
321 | for (i = 0; i < 6; i++) | ||
322 | ecore_event_handler_del(handler[i]); | ||
323 | |||
324 | ecore_con_shutdown(); | ||
325 | eina_log_domain_unregister(_ecore_ipc_log_dom); | ||
326 | _ecore_ipc_log_dom = -1; | ||
327 | return _ecore_ipc_init_count; | ||
328 | } | ||
329 | |||
330 | /** | ||
331 | * @defgroup Ecore_IPC_Server_Group IPC Server Functions | ||
332 | * | ||
333 | * Functions the deal with IPC server objects. | ||
334 | */ | ||
335 | |||
336 | /** | ||
337 | * Creates an IPC server that listens for connections. | ||
338 | * | ||
339 | * For more details about the @p compl_type, @p name and @p port | ||
340 | * parameters, see the @ref ecore_con_server_add documentation. | ||
341 | * | ||
342 | * @param compl_type The connection type. | ||
343 | * @param name Name to associate with the socket used for connection. | ||
344 | * @param port Number to identify with socket used for connection. | ||
345 | * @param data Data to associate with the IPC server. | ||
346 | * @return New IPC server. If there is an error, @c NULL is returned. | ||
347 | * @ingroup Ecore_IPC_Server_Group | ||
348 | * @todo Need to add protocol type parameter to this function. | ||
349 | */ | ||
350 | EAPI Ecore_Ipc_Server * | ||
351 | ecore_ipc_server_add(Ecore_Ipc_Type compl_type, const char *name, int port, const void *data) | ||
352 | { | ||
353 | Ecore_Ipc_Server *svr; | ||
354 | Ecore_Ipc_Type type; | ||
355 | Ecore_Con_Type extra = 0; | ||
356 | |||
357 | svr = calloc(1, sizeof(Ecore_Ipc_Server)); | ||
358 | if (!svr) return NULL; | ||
359 | type = compl_type; | ||
360 | type &= ~ECORE_IPC_USE_SSL; | ||
361 | if (compl_type & ECORE_IPC_USE_SSL) extra = ECORE_CON_USE_SSL; | ||
362 | switch (type) | ||
363 | { | ||
364 | case ECORE_IPC_LOCAL_USER: | ||
365 | svr->server = ecore_con_server_add(ECORE_CON_LOCAL_USER | extra, name, port, svr); | ||
366 | break; | ||
367 | case ECORE_IPC_LOCAL_SYSTEM: | ||
368 | svr->server = ecore_con_server_add(ECORE_CON_LOCAL_SYSTEM | extra, name, port, svr); | ||
369 | break; | ||
370 | case ECORE_IPC_REMOTE_SYSTEM: | ||
371 | svr->server = ecore_con_server_add(ECORE_CON_REMOTE_SYSTEM | extra, name, port, svr); | ||
372 | break; | ||
373 | default: | ||
374 | free(svr); | ||
375 | return NULL; | ||
376 | } | ||
377 | if (!svr->server) | ||
378 | { | ||
379 | free(svr); | ||
380 | return NULL; | ||
381 | } | ||
382 | svr->max_buf_size = 32 * 1024; | ||
383 | svr->data = (void *)data; | ||
384 | servers = eina_list_append(servers, svr); | ||
385 | ECORE_MAGIC_SET(svr, ECORE_MAGIC_IPC_SERVER); | ||
386 | return svr; | ||
387 | } | ||
388 | |||
389 | /** | ||
390 | * Creates an IPC server object to represent the IPC server listening | ||
391 | * on the given port. | ||
392 | * | ||
393 | * For more details about the @p compl_type, @p name and @p port | ||
394 | * parameters, see the @ref ecore_con_server_connect documentation. | ||
395 | * | ||
396 | * @param compl_type The IPC connection type. | ||
397 | * @param name Name used to determine which socket to use for the | ||
398 | * IPC connection. | ||
399 | * @param port Number used to identify the socket to use for the | ||
400 | * IPC connection. | ||
401 | * @param data Data to associate with the server. | ||
402 | * @return A new IPC server. @c NULL is returned on error. | ||
403 | * @ingroup Ecore_IPC_Server_Group | ||
404 | * @todo Need to add protocol type parameter. | ||
405 | */ | ||
406 | EAPI Ecore_Ipc_Server * | ||
407 | ecore_ipc_server_connect(Ecore_Ipc_Type compl_type, char *name, int port, const void *data) | ||
408 | { | ||
409 | Ecore_Ipc_Server *svr; | ||
410 | Ecore_Ipc_Type type; | ||
411 | Ecore_Con_Type extra = 0; | ||
412 | |||
413 | svr = calloc(1, sizeof(Ecore_Ipc_Server)); | ||
414 | if (!svr) return NULL; | ||
415 | type = compl_type; | ||
416 | type &= ~ECORE_IPC_USE_SSL; | ||
417 | if (compl_type & ECORE_IPC_USE_SSL) extra = ECORE_CON_USE_SSL; | ||
418 | switch (type) | ||
419 | { | ||
420 | case ECORE_IPC_LOCAL_USER: | ||
421 | svr->server = ecore_con_server_connect(ECORE_CON_LOCAL_USER | extra, name, port, svr); | ||
422 | break; | ||
423 | case ECORE_IPC_LOCAL_SYSTEM: | ||
424 | svr->server = ecore_con_server_connect(ECORE_CON_LOCAL_SYSTEM | extra, name, port, svr); | ||
425 | break; | ||
426 | case ECORE_IPC_REMOTE_SYSTEM: | ||
427 | svr->server = ecore_con_server_connect(ECORE_CON_REMOTE_SYSTEM | extra, name, port, svr); | ||
428 | break; | ||
429 | default: | ||
430 | free(svr); | ||
431 | return NULL; | ||
432 | } | ||
433 | if (!svr->server) | ||
434 | { | ||
435 | free(svr); | ||
436 | return NULL; | ||
437 | } | ||
438 | svr->max_buf_size = -1; | ||
439 | svr->data = (void *)data; | ||
440 | servers = eina_list_append(servers, svr); | ||
441 | ECORE_MAGIC_SET(svr, ECORE_MAGIC_IPC_SERVER); | ||
442 | return svr; | ||
443 | } | ||
444 | |||
445 | /** | ||
446 | * Closes the connection and frees the given IPC server. | ||
447 | * @param svr The given IPC server. | ||
448 | * @return The data associated with the server when it was created. | ||
449 | * @ingroup Ecore_IPC_Server_Group | ||
450 | */ | ||
451 | EAPI void * | ||
452 | ecore_ipc_server_del(Ecore_Ipc_Server *svr) | ||
453 | { | ||
454 | void *data; | ||
455 | |||
456 | if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER)) | ||
457 | { | ||
458 | ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_IPC_SERVER, | ||
459 | "ecore_ipc_server_del"); | ||
460 | return NULL; | ||
461 | } | ||
462 | if (svr->delete_me) return NULL; | ||
463 | |||
464 | data = svr->data; | ||
465 | svr->data = NULL; | ||
466 | svr->delete_me = 1; | ||
467 | if (svr->event_count == 0) | ||
468 | { | ||
469 | Ecore_Ipc_Client *cl; | ||
470 | |||
471 | EINA_LIST_FREE(svr->clients, cl) | ||
472 | ecore_ipc_client_del(cl); | ||
473 | ecore_con_server_del(svr->server); | ||
474 | servers = eina_list_remove(servers, svr); | ||
475 | |||
476 | if (svr->buf) free(svr->buf); | ||
477 | ECORE_MAGIC_SET(svr, ECORE_MAGIC_NONE); | ||
478 | free(svr); | ||
479 | } | ||
480 | return data; | ||
481 | } | ||
482 | |||
483 | /** | ||
484 | * Retrieves the data associated with the given IPC server. | ||
485 | * @param svr The given IPC server. | ||
486 | * @return The associated data. | ||
487 | * @ingroup Ecore_IPC_Server_Group | ||
488 | */ | ||
489 | EAPI void * | ||
490 | ecore_ipc_server_data_get(Ecore_Ipc_Server *svr) | ||
491 | { | ||
492 | if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER)) | ||
493 | { | ||
494 | ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_IPC_SERVER, | ||
495 | "ecore_ipc_server_data_get"); | ||
496 | return NULL; | ||
497 | } | ||
498 | return svr->data; | ||
499 | } | ||
500 | |||
501 | /** | ||
502 | * Retrieves whether the given IPC server is currently connected. | ||
503 | * @param svr The given IPC server. | ||
504 | * @return #EINA_TRUE if the server is connected. #EINA_FALSE otherwise. | ||
505 | * @ingroup Ecore_IPC_Server_Group | ||
506 | */ | ||
507 | EAPI Eina_Bool | ||
508 | ecore_ipc_server_connected_get(Ecore_Ipc_Server *svr) | ||
509 | { | ||
510 | if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER)) | ||
511 | { | ||
512 | ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_IPC_SERVER, | ||
513 | "ecore_ipc_server_connected_get"); | ||
514 | return EINA_FALSE; | ||
515 | } | ||
516 | return ecore_con_server_connected_get(svr->server); | ||
517 | } | ||
518 | |||
519 | /** | ||
520 | * Retrieves the list of clients for this server. | ||
521 | * @param svr The given IPC server. | ||
522 | * @return An Eina_List with the clients. | ||
523 | * @ingroup Ecore_IPC_Server_Group | ||
524 | */ | ||
525 | EAPI Eina_List * | ||
526 | ecore_ipc_server_clients_get(Ecore_Ipc_Server *svr) | ||
527 | { | ||
528 | if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER)) | ||
529 | { | ||
530 | ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_IPC_SERVER, | ||
531 | "ecore_ipc_server_clients_get"); | ||
532 | return NULL; | ||
533 | } | ||
534 | return svr->client_list; | ||
535 | } | ||
536 | |||
537 | #define SVENC(_member) \ | ||
538 | d = _ecore_ipc_dlt_int(msg._member, svr->prev.o._member, &md); \ | ||
539 | if (md >= DLT_SET) \ | ||
540 | { \ | ||
541 | unsigned int v; \ | ||
542 | unsigned char *dd; \ | ||
543 | dd = (unsigned char *)&v; \ | ||
544 | v = d; \ | ||
545 | v = htonl(v); \ | ||
546 | *(dat + s + 0) = dd[0]; \ | ||
547 | *(dat + s + 1) = dd[1]; \ | ||
548 | *(dat + s + 2) = dd[2]; \ | ||
549 | *(dat + s + 3) = dd[3]; \ | ||
550 | s += 4; \ | ||
551 | } \ | ||
552 | else if (md >= DLT_ADD16) \ | ||
553 | { \ | ||
554 | unsigned short v; \ | ||
555 | unsigned char *dd; \ | ||
556 | dd = (unsigned char *)&v; \ | ||
557 | v = d; \ | ||
558 | v = htons(v); \ | ||
559 | *(dat + s + 0) = dd[0]; \ | ||
560 | *(dat + s + 1) = dd[1]; \ | ||
561 | s += 2; \ | ||
562 | } \ | ||
563 | else if (md >= DLT_ADD8) \ | ||
564 | { \ | ||
565 | *(dat + s + 0) = (unsigned char)d; \ | ||
566 | s += 1; \ | ||
567 | } | ||
568 | |||
569 | /** | ||
570 | * Sends a message to the given IPC server. | ||
571 | * | ||
572 | * The content of the parameters, excluding the @p svr paramter, is up to | ||
573 | * the client. | ||
574 | * | ||
575 | * @param svr The given IPC server. | ||
576 | * @param major Major opcode of the message. | ||
577 | * @param minor Minor opcode of the message. | ||
578 | * @param ref Message reference number. | ||
579 | * @param ref_to Reference number of the message this message refers to. | ||
580 | * @param response Requires response. | ||
581 | * @param data The data to send as part of the message. | ||
582 | * @param size Length of the data, in bytes, to send. | ||
583 | * @return Number of bytes sent. @c 0 is returned if there is an error. | ||
584 | * @ingroup Ecore_IPC_Server_Group | ||
585 | * @todo This function needs to become an IPC message. | ||
586 | * @todo Fix up the documentation: Make sure what ref_to and response are. | ||
587 | */ | ||
588 | EAPI int | ||
589 | ecore_ipc_server_send(Ecore_Ipc_Server *svr, int major, int minor, int ref, int ref_to, int response, const void *data, int size) | ||
590 | { | ||
591 | Ecore_Ipc_Msg_Head msg; | ||
592 | int ret; | ||
593 | int *head, md = 0, d, s; | ||
594 | unsigned char dat[sizeof(Ecore_Ipc_Msg_Head)]; | ||
595 | |||
596 | if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER)) | ||
597 | { | ||
598 | ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_IPC_SERVER, | ||
599 | "ecore_ipc_server_send"); | ||
600 | return 0; | ||
601 | } | ||
602 | if (size < 0) size = 0; | ||
603 | msg.major = major; | ||
604 | msg.minor = minor; | ||
605 | msg.ref = ref; | ||
606 | msg.ref_to = ref_to; | ||
607 | msg.response = response; | ||
608 | msg.size = size; | ||
609 | head = (int *)dat; | ||
610 | s = 4; | ||
611 | SVENC(major); | ||
612 | *head = md; | ||
613 | SVENC(minor); | ||
614 | *head |= md << (4 * 1); | ||
615 | SVENC(ref); | ||
616 | *head |= md << (4 * 2); | ||
617 | SVENC(ref_to); | ||
618 | *head |= md << (4 * 3); | ||
619 | SVENC(response); | ||
620 | *head |= md << (4 * 4); | ||
621 | SVENC(size); | ||
622 | *head |= md << (4 * 5); | ||
623 | *head = htonl(*head); | ||
624 | svr->prev.o = msg; | ||
625 | ret = ecore_con_server_send(svr->server, dat, s); | ||
626 | if (size > 0) ret += ecore_con_server_send(svr->server, data, size); | ||
627 | return ret; | ||
628 | } | ||
629 | |||
630 | /** | ||
631 | * Sets a limit on the number of clients that can be handled concurrently | ||
632 | * by the given server, and a policy on what to do if excess clients try to | ||
633 | * connect. | ||
634 | * Beware that if you set this once ecore is already running, you may | ||
635 | * already have pending CLIENT_ADD events in your event queue. Those | ||
636 | * clients have already connected and will not be affected by this call. | ||
637 | * Only clients subsequently trying to connect will be affected. | ||
638 | * @param svr The given server. | ||
639 | * @param client_limit The maximum number of clients to handle | ||
640 | * concurrently. -1 means unlimited (default). 0 | ||
641 | * effectively disables the server. | ||
642 | * @param reject_excess_clients Set to 1 to automatically disconnect | ||
643 | * excess clients as soon as they connect if you are | ||
644 | * already handling client_limit clients. Set to 0 | ||
645 | * (default) to just hold off on the "accept()" | ||
646 | * system call until the number of active clients | ||
647 | * drops. This causes the kernel to queue up to 4096 | ||
648 | * connections (or your kernel's limit, whichever is | ||
649 | * lower). | ||
650 | * @ingroup Ecore_Ipc_Server_Group | ||
651 | */ | ||
652 | EAPI void | ||
653 | ecore_ipc_server_client_limit_set(Ecore_Ipc_Server *svr, int client_limit, char reject_excess_clients) | ||
654 | { | ||
655 | if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER)) | ||
656 | { | ||
657 | ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_IPC_SERVER, | ||
658 | "ecore_ipc_server_client_limit_set"); | ||
659 | return; | ||
660 | } | ||
661 | ecore_con_server_client_limit_set(svr->server, client_limit, reject_excess_clients); | ||
662 | } | ||
663 | |||
664 | /** | ||
665 | * Sets the max data payload size for an Ipc message in bytes | ||
666 | * | ||
667 | * @param svr The given server. | ||
668 | * @param size The maximum data payload size in bytes. | ||
669 | * @ingroup Ecore_Ipc_Server_Group | ||
670 | */ | ||
671 | EAPI void | ||
672 | ecore_ipc_server_data_size_max_set(Ecore_Ipc_Server *svr, int size) | ||
673 | { | ||
674 | if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER)) | ||
675 | { | ||
676 | ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_IPC_SERVER, | ||
677 | "ecore_ipc_server_data_size_max_set"); | ||
678 | return; | ||
679 | } | ||
680 | svr->max_buf_size = size; | ||
681 | } | ||
682 | |||
683 | /** | ||
684 | * Gets the max data payload size for an Ipc message in bytes | ||
685 | * | ||
686 | * @param svr The given server. | ||
687 | * @return The maximum data payload in bytes. | ||
688 | * @ingroup Ecore_Ipc_Server_Group | ||
689 | */ | ||
690 | EAPI int | ||
691 | ecore_ipc_server_data_size_max_get(Ecore_Ipc_Server *svr) | ||
692 | { | ||
693 | if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER)) | ||
694 | { | ||
695 | ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_IPC_SERVER, | ||
696 | "ecore_ipc_server_data_size_max_get"); | ||
697 | return -1; | ||
698 | } | ||
699 | return svr->max_buf_size; | ||
700 | } | ||
701 | |||
702 | /** | ||
703 | * Gets the IP address of a server that has been connected to. | ||
704 | * | ||
705 | * @param svr The given server. | ||
706 | * @return A pointer to an internal string that contains the IP address of | ||
707 | * the connected server in the form "XXX.YYY.ZZZ.AAA" IP notation. | ||
708 | * This string should not be modified or trusted to stay valid after | ||
709 | * deletion for the @p svr object. If no IP is known NULL is returned. | ||
710 | * @ingroup Ecore_Ipc_Server_Group | ||
711 | */ | ||
712 | EAPI const char * | ||
713 | ecore_ipc_server_ip_get(Ecore_Ipc_Server *svr) | ||
714 | { | ||
715 | if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER)) | ||
716 | { | ||
717 | ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_IPC_SERVER, | ||
718 | "ecore_ipc_server_ip_get"); | ||
719 | return NULL; | ||
720 | } | ||
721 | return ecore_con_server_ip_get(svr->server); | ||
722 | } | ||
723 | |||
724 | /** | ||
725 | * Flushes all pending data to the given server. Will return when done. | ||
726 | * | ||
727 | * @param svr The given server. | ||
728 | * @ingroup Ecore_Ipc_Server_Group | ||
729 | */ | ||
730 | EAPI void | ||
731 | ecore_ipc_server_flush(Ecore_Ipc_Server *svr) | ||
732 | { | ||
733 | if (!ECORE_MAGIC_CHECK(svr, ECORE_MAGIC_IPC_SERVER)) | ||
734 | { | ||
735 | ECORE_MAGIC_FAIL(svr, ECORE_MAGIC_IPC_SERVER, | ||
736 | "ecore_ipc_server_server_flush"); | ||
737 | return; | ||
738 | } | ||
739 | ecore_con_server_flush(svr->server); | ||
740 | } | ||
741 | |||
742 | #define CLENC(_member) \ | ||
743 | d = _ecore_ipc_dlt_int(msg._member, cl->prev.o._member, &md); \ | ||
744 | if (md >= DLT_SET) \ | ||
745 | { \ | ||
746 | unsigned int v; \ | ||
747 | unsigned char *dd; \ | ||
748 | dd = (unsigned char *)&v; \ | ||
749 | v = d; \ | ||
750 | v = htonl(v); \ | ||
751 | *(dat + s + 0) = dd[0]; \ | ||
752 | *(dat + s + 1) = dd[1]; \ | ||
753 | *(dat + s + 2) = dd[2]; \ | ||
754 | *(dat + s + 3) = dd[3]; \ | ||
755 | s += 4; \ | ||
756 | } \ | ||
757 | else if (md >= DLT_ADD16) \ | ||
758 | { \ | ||
759 | unsigned short v; \ | ||
760 | unsigned char *dd; \ | ||
761 | dd = (unsigned char *)&v; \ | ||
762 | v = d; \ | ||
763 | v = htons(v); \ | ||
764 | *(dat + s + 0) = dd[0]; \ | ||
765 | *(dat + s + 1) = dd[1]; \ | ||
766 | s += 2; \ | ||
767 | } \ | ||
768 | else if (md >= DLT_ADD8) \ | ||
769 | { \ | ||
770 | *(dat + s) = (unsigned char)d; \ | ||
771 | s += 1; \ | ||
772 | } | ||
773 | |||
774 | /** | ||
775 | * @defgroup Ecore_IPC_Client_Group IPC Client Functions | ||
776 | * | ||
777 | * Functions that deal with IPC client objects. | ||
778 | */ | ||
779 | |||
780 | /** | ||
781 | * Sends a message to the given IPC client. | ||
782 | * @param cl The given IPC client. | ||
783 | * @param major Major opcode of the message. | ||
784 | * @param minor Minor opcode of the message. | ||
785 | * @param ref Reference number of the message. | ||
786 | * @param ref_to Reference number of the message this message refers to. | ||
787 | * @param response Requires response. | ||
788 | * @param data The data to send as part of the message. | ||
789 | * @param size Length of the data, in bytes, to send. | ||
790 | * @return The number of bytes sent. @c 0 will be returned if there is | ||
791 | * an error. | ||
792 | * @ingroup Ecore_IPC_Client_Group | ||
793 | * @todo This function needs to become an IPC message. | ||
794 | * @todo Make sure ref_to and response parameters are described correctly. | ||
795 | */ | ||
796 | EAPI int | ||
797 | ecore_ipc_client_send(Ecore_Ipc_Client *cl, int major, int minor, int ref, int ref_to, int response, const void *data, int size) | ||
798 | { | ||
799 | Ecore_Ipc_Msg_Head msg; | ||
800 | int ret; | ||
801 | int *head, md = 0, d, s; | ||
802 | unsigned char dat[sizeof(Ecore_Ipc_Msg_Head)]; | ||
803 | |||
804 | if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_IPC_CLIENT)) | ||
805 | { | ||
806 | ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_IPC_CLIENT, | ||
807 | "ecore_ipc_client_send"); | ||
808 | return 0; | ||
809 | } | ||
810 | if (size < 0) size = 0; | ||
811 | msg.major = major; | ||
812 | msg.minor = minor; | ||
813 | msg.ref = ref; | ||
814 | msg.ref_to = ref_to; | ||
815 | msg.response = response; | ||
816 | msg.size = size; | ||
817 | head = (int *)dat; | ||
818 | s = 4; | ||
819 | CLENC(major); | ||
820 | *head = md; | ||
821 | CLENC(minor); | ||
822 | *head |= md << (4 * 1); | ||
823 | CLENC(ref); | ||
824 | *head |= md << (4 * 2); | ||
825 | CLENC(ref_to); | ||
826 | *head |= md << (4 * 3); | ||
827 | CLENC(response); | ||
828 | *head |= md << (4 * 4); | ||
829 | CLENC(size); | ||
830 | *head |= md << (4 * 5); | ||
831 | *head = htonl(*head); | ||
832 | cl->prev.o = msg; | ||
833 | ret = ecore_con_client_send(cl->client, dat, s); | ||
834 | if (size > 0) ret += ecore_con_client_send(cl->client, data, size); | ||
835 | return ret; | ||
836 | } | ||
837 | |||
838 | /** | ||
839 | * Retrieves the IPC server that the given IPC client is connected to. | ||
840 | * @param cl The given IPC client. | ||
841 | * @return The IPC server the IPC client is connected to. | ||
842 | * @ingroup Ecore_IPC_Client_Group | ||
843 | */ | ||
844 | EAPI Ecore_Ipc_Server * | ||
845 | ecore_ipc_client_server_get(Ecore_Ipc_Client *cl) | ||
846 | { | ||
847 | if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_IPC_CLIENT)) | ||
848 | { | ||
849 | ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_IPC_CLIENT, | ||
850 | "ecore_ipc_client_server_get"); | ||
851 | return NULL; | ||
852 | } | ||
853 | return (ecore_con_server_data_get(ecore_con_client_server_get(cl->client))); | ||
854 | } | ||
855 | |||
856 | /** | ||
857 | * Closes the connection and frees memory allocated to the given IPC | ||
858 | * client. | ||
859 | * @param cl The given client. | ||
860 | * @return Data associated with the client. | ||
861 | * @ingroup Ecore_IPC_Client_Group | ||
862 | */ | ||
863 | EAPI void * | ||
864 | ecore_ipc_client_del(Ecore_Ipc_Client *cl) | ||
865 | { | ||
866 | void *data; | ||
867 | Ecore_Ipc_Server *svr; | ||
868 | |||
869 | if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_IPC_CLIENT)) | ||
870 | { | ||
871 | ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_IPC_CLIENT, | ||
872 | "ecore_ipc_client_del"); | ||
873 | return NULL; | ||
874 | } | ||
875 | data = cl->data; | ||
876 | cl->data = NULL; | ||
877 | cl->delete_me = 1; | ||
878 | if (cl->event_count == 0) | ||
879 | { | ||
880 | svr = ecore_con_server_data_get(ecore_con_client_server_get(cl->client)); | ||
881 | ecore_con_client_del(cl->client); | ||
882 | svr->clients = eina_list_remove(svr->clients, cl); | ||
883 | if (cl->buf) free(cl->buf); | ||
884 | ECORE_MAGIC_SET(cl, ECORE_MAGIC_NONE); | ||
885 | free(cl); | ||
886 | } | ||
887 | return data; | ||
888 | } | ||
889 | |||
890 | /** | ||
891 | * Sets the IPC data associated with the given IPC client to @p data. | ||
892 | * @param cl The given IPC client. | ||
893 | * @param data The data to associate with the IPC client. | ||
894 | * @ingroup Ecore_IPC_Client_Group | ||
895 | */ | ||
896 | EAPI void | ||
897 | ecore_ipc_client_data_set(Ecore_Ipc_Client *cl, const void *data) | ||
898 | { | ||
899 | if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_IPC_CLIENT)) | ||
900 | { | ||
901 | ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_IPC_CLIENT, | ||
902 | "ecore_ipc_client_data_set"); | ||
903 | return; | ||
904 | } | ||
905 | cl->data = (void *)data; | ||
906 | } | ||
907 | |||
908 | /** | ||
909 | * Retrieves the data that has been associated with the given IPC client. | ||
910 | * @param cl The given client. | ||
911 | * @return The data associated with the IPC client. | ||
912 | * @ingroup Ecore_IPC_Client_Group | ||
913 | */ | ||
914 | EAPI void * | ||
915 | ecore_ipc_client_data_get(Ecore_Ipc_Client *cl) | ||
916 | { | ||
917 | if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_IPC_CLIENT)) | ||
918 | { | ||
919 | ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_IPC_CLIENT, | ||
920 | "ecore_ipc_client_data_get"); | ||
921 | return NULL; | ||
922 | } | ||
923 | return cl->data; | ||
924 | } | ||
925 | |||
926 | /** | ||
927 | * Sets the max data payload size for an Ipc message in bytes | ||
928 | * | ||
929 | * @param client The given client. | ||
930 | * @param size The maximum data payload size in bytes. | ||
931 | * @ingroup Ecore_Ipc_Client_Group | ||
932 | */ | ||
933 | EAPI void | ||
934 | ecore_ipc_client_data_size_max_set(Ecore_Ipc_Client *cl, int size) | ||
935 | { | ||
936 | if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_IPC_CLIENT)) | ||
937 | { | ||
938 | ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_IPC_CLIENT, | ||
939 | "ecore_ipc_client_data_size_max_set"); | ||
940 | return; | ||
941 | } | ||
942 | cl->max_buf_size = size; | ||
943 | } | ||
944 | |||
945 | /** | ||
946 | * Sets the max data payload size for an Ipc message in bytes | ||
947 | * | ||
948 | * @param cl The given client. | ||
949 | * @param size The maximum data payload size in bytes. | ||
950 | * @ingroup Ecore_Ipc_Client_Group | ||
951 | */ | ||
952 | EAPI int | ||
953 | ecore_ipc_client_data_size_max_get(Ecore_Ipc_Client *cl) | ||
954 | { | ||
955 | if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_IPC_CLIENT)) | ||
956 | { | ||
957 | ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_IPC_CLIENT, | ||
958 | "ecore_ipc_client_data_size_max_get"); | ||
959 | return -1; | ||
960 | } | ||
961 | return cl->max_buf_size; | ||
962 | } | ||
963 | |||
964 | /** | ||
965 | * Gets the IP address of a client that has been connected to. | ||
966 | * | ||
967 | * @param cl The given client. | ||
968 | * @return A pointer to an internal string that contains the IP address of | ||
969 | * the connected server in the form "XXX.YYY.ZZZ.AAA" IP notation. | ||
970 | * This string should not be modified or trusted to stay valid after | ||
971 | * deletion for the @p cl object. If no IP is known NULL is returned. | ||
972 | * @ingroup Ecore_Ipc_Client_Group | ||
973 | */ | ||
974 | EAPI const char * | ||
975 | ecore_ipc_client_ip_get(Ecore_Ipc_Client *cl) | ||
976 | { | ||
977 | if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_IPC_CLIENT)) | ||
978 | { | ||
979 | ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_IPC_CLIENT, | ||
980 | "ecore_ipc_client_ip_get"); | ||
981 | return NULL; | ||
982 | } | ||
983 | return ecore_con_client_ip_get(cl->client); | ||
984 | } | ||
985 | |||
986 | /** | ||
987 | * Flushes all pending data to the given client. Will return when done. | ||
988 | * | ||
989 | * @param cl The given client. | ||
990 | * @ingroup Ecore_Ipc_Client_Group | ||
991 | */ | ||
992 | EAPI void | ||
993 | ecore_ipc_client_flush(Ecore_Ipc_Client *cl) | ||
994 | { | ||
995 | if (!ECORE_MAGIC_CHECK(cl, ECORE_MAGIC_IPC_CLIENT)) | ||
996 | { | ||
997 | ECORE_MAGIC_FAIL(cl, ECORE_MAGIC_IPC_CLIENT, | ||
998 | "ecore_ipc_client_flush"); | ||
999 | return; | ||
1000 | } | ||
1001 | ecore_con_client_flush(cl->client); | ||
1002 | } | ||
1003 | |||
1004 | /** | ||
1005 | * Returns if SSL support is available | ||
1006 | * @return 1 if SSL is available, 0 if it is not. | ||
1007 | * @ingroup Ecore_Con_Client_Group | ||
1008 | */ | ||
1009 | EAPI int | ||
1010 | ecore_ipc_ssl_available_get(void) | ||
1011 | { | ||
1012 | return ecore_con_ssl_available_get(); | ||
1013 | } | ||
1014 | |||
1015 | |||
1016 | static Eina_Bool | ||
1017 | _ecore_ipc_event_client_add(void *data __UNUSED__, int ev_type __UNUSED__, void *ev) | ||
1018 | { | ||
1019 | Ecore_Con_Event_Client_Add *e; | ||
1020 | |||
1021 | e = ev; | ||
1022 | if (!eina_list_data_find(servers, ecore_con_server_data_get(ecore_con_client_server_get(e->client)))) return ECORE_CALLBACK_RENEW; | ||
1023 | /* handling code here */ | ||
1024 | { | ||
1025 | Ecore_Ipc_Client *cl; | ||
1026 | Ecore_Ipc_Server *svr; | ||
1027 | |||
1028 | cl = calloc(1, sizeof(Ecore_Ipc_Client)); | ||
1029 | if (!cl) return ECORE_CALLBACK_CANCEL; | ||
1030 | svr = ecore_con_server_data_get(ecore_con_client_server_get(e->client)); | ||
1031 | ECORE_MAGIC_SET(cl, ECORE_MAGIC_IPC_CLIENT); | ||
1032 | cl->client = e->client; | ||
1033 | cl->max_buf_size = 32 * 1024; | ||
1034 | ecore_con_client_data_set(cl->client, (void *)cl); | ||
1035 | svr->clients = eina_list_append(svr->clients, cl); | ||
1036 | svr->client_list = eina_list_append(svr->client_list, cl); | ||
1037 | if (!cl->delete_me) | ||
1038 | { | ||
1039 | Ecore_Ipc_Event_Client_Add *e2; | ||
1040 | |||
1041 | e2 = calloc(1, sizeof(Ecore_Ipc_Event_Client_Add)); | ||
1042 | if (e2) | ||
1043 | { | ||
1044 | cl->event_count++; | ||
1045 | e2->client = cl; | ||
1046 | ecore_event_add(ECORE_IPC_EVENT_CLIENT_ADD, e2, | ||
1047 | _ecore_ipc_event_client_add_free, NULL); | ||
1048 | } | ||
1049 | } | ||
1050 | } | ||
1051 | return ECORE_CALLBACK_CANCEL; | ||
1052 | } | ||
1053 | |||
1054 | static Eina_Bool | ||
1055 | _ecore_ipc_event_client_del(void *data __UNUSED__, int ev_type __UNUSED__, void *ev) | ||
1056 | { | ||
1057 | Ecore_Con_Event_Client_Del *e; | ||
1058 | |||
1059 | e = ev; | ||
1060 | if (!eina_list_data_find(servers, ecore_con_server_data_get(ecore_con_client_server_get(e->client)))) return ECORE_CALLBACK_RENEW; | ||
1061 | /* handling code here */ | ||
1062 | { | ||
1063 | Ecore_Ipc_Client *cl; | ||
1064 | |||
1065 | cl = ecore_con_client_data_get(e->client); | ||
1066 | { | ||
1067 | Ecore_Ipc_Event_Client_Del *e2; | ||
1068 | Ecore_Ipc_Server *svr; | ||
1069 | |||
1070 | svr = ecore_con_server_data_get(ecore_con_client_server_get(e->client)); | ||
1071 | svr->client_list = eina_list_remove(svr->client_list, cl); | ||
1072 | if (!cl->delete_me) | ||
1073 | { | ||
1074 | e2 = calloc(1, sizeof(Ecore_Ipc_Event_Client_Del)); | ||
1075 | if (e2) | ||
1076 | { | ||
1077 | cl->event_count++; | ||
1078 | e2->client = cl; | ||
1079 | ecore_event_add(ECORE_IPC_EVENT_CLIENT_DEL, e2, | ||
1080 | _ecore_ipc_event_client_del_free, NULL); | ||
1081 | } | ||
1082 | } | ||
1083 | } | ||
1084 | } | ||
1085 | return ECORE_CALLBACK_CANCEL; | ||
1086 | } | ||
1087 | |||
1088 | static Eina_Bool | ||
1089 | _ecore_ipc_event_server_add(void *data __UNUSED__, int ev_type __UNUSED__, void *ev) | ||
1090 | { | ||
1091 | Ecore_Con_Event_Server_Add *e; | ||
1092 | |||
1093 | e = ev; | ||
1094 | if (!eina_list_data_find(servers, ecore_con_server_data_get(e->server))) return ECORE_CALLBACK_RENEW; | ||
1095 | /* handling code here */ | ||
1096 | { | ||
1097 | Ecore_Ipc_Server *svr; | ||
1098 | |||
1099 | svr = ecore_con_server_data_get(e->server); | ||
1100 | if (!svr->delete_me) | ||
1101 | { | ||
1102 | Ecore_Ipc_Event_Server_Add *e2; | ||
1103 | |||
1104 | e2 = calloc(1, sizeof(Ecore_Ipc_Event_Server_Add)); | ||
1105 | if (e2) | ||
1106 | { | ||
1107 | svr->event_count++; | ||
1108 | e2->server = svr; | ||
1109 | ecore_event_add(ECORE_IPC_EVENT_SERVER_ADD, e2, | ||
1110 | _ecore_ipc_event_server_add_free, NULL); | ||
1111 | } | ||
1112 | } | ||
1113 | } | ||
1114 | return ECORE_CALLBACK_CANCEL; | ||
1115 | } | ||
1116 | |||
1117 | static Eina_Bool | ||
1118 | _ecore_ipc_event_server_del(void *data __UNUSED__, int ev_type __UNUSED__, void *ev) | ||
1119 | { | ||
1120 | Ecore_Con_Event_Server_Del *e; | ||
1121 | |||
1122 | e = ev; | ||
1123 | if (!eina_list_data_find(servers, ecore_con_server_data_get(e->server))) return ECORE_CALLBACK_RENEW; | ||
1124 | /* handling code here */ | ||
1125 | { | ||
1126 | Ecore_Ipc_Server *svr; | ||
1127 | |||
1128 | svr = ecore_con_server_data_get(e->server); | ||
1129 | if (!svr->delete_me) | ||
1130 | { | ||
1131 | Ecore_Ipc_Event_Server_Del *e2; | ||
1132 | |||
1133 | e2 = calloc(1, sizeof(Ecore_Ipc_Event_Server_Del)); | ||
1134 | if (e2) | ||
1135 | { | ||
1136 | svr->event_count++; | ||
1137 | e2->server = svr; | ||
1138 | ecore_event_add(ECORE_IPC_EVENT_SERVER_DEL, e2, | ||
1139 | _ecore_ipc_event_server_del_free, NULL); | ||
1140 | } | ||
1141 | } | ||
1142 | } | ||
1143 | return ECORE_CALLBACK_CANCEL; | ||
1144 | } | ||
1145 | |||
1146 | #define CLSZ(_n) \ | ||
1147 | md = ((head >> (4 * _n)) & 0xf); \ | ||
1148 | if (md >= DLT_SET) s += 4; \ | ||
1149 | else if (md >= DLT_ADD16) s += 2; \ | ||
1150 | else if (md >= DLT_ADD8) s += 1; | ||
1151 | |||
1152 | #define CLDEC(_n, _member) \ | ||
1153 | md = ((head >> (4 * _n)) & 0xf); \ | ||
1154 | if (md >= DLT_SET) \ | ||
1155 | { \ | ||
1156 | unsigned int v; \ | ||
1157 | unsigned char *dv; \ | ||
1158 | dv = (unsigned char *)&v; \ | ||
1159 | dv[0] = *(cl->buf + offset + s + 0); \ | ||
1160 | dv[1] = *(cl->buf + offset + s + 1); \ | ||
1161 | dv[2] = *(cl->buf + offset + s + 2); \ | ||
1162 | dv[3] = *(cl->buf + offset + s + 3); \ | ||
1163 | d = (int)ntohl(v); \ | ||
1164 | s += 4; \ | ||
1165 | } \ | ||
1166 | else if (md >= DLT_ADD16) \ | ||
1167 | { \ | ||
1168 | unsigned short v; \ | ||
1169 | unsigned char *dv; \ | ||
1170 | dv = (unsigned char *)&v; \ | ||
1171 | dv[0] = *(cl->buf + offset + s + 0); \ | ||
1172 | dv[1] = *(cl->buf + offset + s + 1); \ | ||
1173 | d = (int)ntohs(v); \ | ||
1174 | s += 2; \ | ||
1175 | } \ | ||
1176 | else if (md >= DLT_ADD8) \ | ||
1177 | { \ | ||
1178 | unsigned char v; \ | ||
1179 | unsigned char *dv; \ | ||
1180 | dv = (unsigned char *)&v; \ | ||
1181 | dv[0] = *(cl->buf + offset + s + 0); \ | ||
1182 | d = (int)v; \ | ||
1183 | s += 1; \ | ||
1184 | } \ | ||
1185 | msg._member = _ecore_ipc_ddlt_int(d, cl->prev.i._member, md); | ||
1186 | |||
1187 | static Eina_Bool | ||
1188 | _ecore_ipc_event_client_data(void *data __UNUSED__, int ev_type __UNUSED__, void *ev) | ||
1189 | { | ||
1190 | Ecore_Con_Event_Client_Data *e; | ||
1191 | |||
1192 | e = ev; | ||
1193 | if (!eina_list_data_find(servers, ecore_con_server_data_get(ecore_con_client_server_get(e->client)))) return ECORE_CALLBACK_RENEW; | ||
1194 | /* handling code here */ | ||
1195 | { | ||
1196 | Ecore_Ipc_Client *cl; | ||
1197 | Ecore_Ipc_Msg_Head msg; | ||
1198 | int offset = 0; | ||
1199 | unsigned char *buf; | ||
1200 | |||
1201 | cl = ecore_con_client_data_get(e->client); | ||
1202 | |||
1203 | if (!cl->buf) | ||
1204 | { | ||
1205 | cl->buf_size = e->size; | ||
1206 | cl->buf = e->data; | ||
1207 | e->data = NULL; /* take it out of the old event */ | ||
1208 | } | ||
1209 | else | ||
1210 | { | ||
1211 | buf = realloc(cl->buf, cl->buf_size + e->size); | ||
1212 | if (!buf) | ||
1213 | { | ||
1214 | free(cl->buf); | ||
1215 | cl->buf = 0; | ||
1216 | cl->buf_size = 0; | ||
1217 | return ECORE_CALLBACK_CANCEL; | ||
1218 | } | ||
1219 | cl->buf = buf; | ||
1220 | memcpy(cl->buf + cl->buf_size, e->data, e->size); | ||
1221 | cl->buf_size += e->size; | ||
1222 | } | ||
1223 | /* examine header */ | ||
1224 | redo: | ||
1225 | if ((cl->buf_size - offset) >= (int)sizeof(int)) | ||
1226 | { | ||
1227 | int s, md, d = 0, head; | ||
1228 | unsigned char *dd; | ||
1229 | |||
1230 | dd = (unsigned char *)&head; | ||
1231 | dd[0] = *(cl->buf + offset + 0); | ||
1232 | dd[1] = *(cl->buf + offset + 1); | ||
1233 | dd[2] = *(cl->buf + offset + 2); | ||
1234 | dd[3] = *(cl->buf + offset + 3); | ||
1235 | head = ntohl(head); | ||
1236 | dd = (unsigned char *)&d; | ||
1237 | s = 4; | ||
1238 | CLSZ(0); | ||
1239 | CLSZ(1); | ||
1240 | CLSZ(2); | ||
1241 | CLSZ(3); | ||
1242 | CLSZ(4); | ||
1243 | CLSZ(5); | ||
1244 | if ((cl->buf_size - offset) < s) | ||
1245 | { | ||
1246 | if (offset > 0) goto scroll; | ||
1247 | return ECORE_CALLBACK_CANCEL; | ||
1248 | } | ||
1249 | |||
1250 | s = 4; | ||
1251 | CLDEC(0, major); | ||
1252 | CLDEC(1, minor); | ||
1253 | CLDEC(2, ref); | ||
1254 | CLDEC(3, ref_to); | ||
1255 | CLDEC(4, response); | ||
1256 | CLDEC(5, size); | ||
1257 | if (msg.size < 0) msg.size = 0; | ||
1258 | /* there is enough data in the buffer for a full message */ | ||
1259 | if ((cl->buf_size - offset) >= (s + msg.size)) | ||
1260 | { | ||
1261 | Ecore_Ipc_Event_Client_Data *e2; | ||
1262 | Ecore_Ipc_Server *svr; | ||
1263 | int max, max2; | ||
1264 | |||
1265 | buf = NULL; | ||
1266 | svr = ecore_con_server_data_get(ecore_con_client_server_get(cl->client)); | ||
1267 | max = svr->max_buf_size; | ||
1268 | max2 = cl->max_buf_size; | ||
1269 | if ((max >= 0) && (max2 >= 0)) | ||
1270 | { | ||
1271 | if (max2 < max) max = max2; | ||
1272 | } | ||
1273 | else | ||
1274 | { | ||
1275 | if (max < 0) max = max2; | ||
1276 | } | ||
1277 | if ((max < 0) || (msg.size <= max)) | ||
1278 | { | ||
1279 | if (msg.size > 0) | ||
1280 | { | ||
1281 | buf = malloc(msg.size); | ||
1282 | if (!buf) return ECORE_CALLBACK_CANCEL; | ||
1283 | memcpy(buf, cl->buf + offset + s, msg.size); | ||
1284 | } | ||
1285 | if (!cl->delete_me) | ||
1286 | { | ||
1287 | e2 = calloc(1, sizeof(Ecore_Ipc_Event_Client_Data)); | ||
1288 | if (e2) | ||
1289 | { | ||
1290 | cl->event_count++; | ||
1291 | e2->client = cl; | ||
1292 | e2->major = msg.major; | ||
1293 | e2->minor = msg.minor; | ||
1294 | e2->ref = msg.ref; | ||
1295 | e2->ref_to = msg.ref_to; | ||
1296 | e2->response = msg.response; | ||
1297 | e2->size = msg.size; | ||
1298 | e2->data = buf; | ||
1299 | ecore_event_add(ECORE_IPC_EVENT_CLIENT_DATA, e2, | ||
1300 | _ecore_ipc_event_client_data_free, | ||
1301 | NULL); | ||
1302 | } | ||
1303 | } | ||
1304 | } | ||
1305 | cl->prev.i = msg; | ||
1306 | offset += (s + msg.size); | ||
1307 | if (cl->buf_size == offset) | ||
1308 | { | ||
1309 | free(cl->buf); | ||
1310 | cl->buf = NULL; | ||
1311 | cl->buf_size = 0; | ||
1312 | return ECORE_CALLBACK_CANCEL; | ||
1313 | } | ||
1314 | goto redo; | ||
1315 | } | ||
1316 | else goto scroll; | ||
1317 | } | ||
1318 | else | ||
1319 | { | ||
1320 | scroll: | ||
1321 | buf = malloc(cl->buf_size - offset); | ||
1322 | if (!buf) | ||
1323 | { | ||
1324 | free(cl->buf); | ||
1325 | cl->buf = NULL; | ||
1326 | cl->buf_size = 0; | ||
1327 | return ECORE_CALLBACK_CANCEL; | ||
1328 | } | ||
1329 | memcpy(buf, cl->buf + offset, cl->buf_size - offset); | ||
1330 | free(cl->buf); | ||
1331 | cl->buf = buf; | ||
1332 | cl->buf_size -= offset; | ||
1333 | } | ||
1334 | } | ||
1335 | return ECORE_CALLBACK_CANCEL; | ||
1336 | } | ||
1337 | |||
1338 | #define SVSZ(_n) \ | ||
1339 | md = ((head >> (4 * _n)) & 0xf); \ | ||
1340 | if (md >= DLT_SET) s += 4; \ | ||
1341 | else if (md >= DLT_ADD16) s += 2; \ | ||
1342 | else if (md >= DLT_ADD8) s += 1; | ||
1343 | |||
1344 | #define SVDEC(_n, _member) \ | ||
1345 | md = ((head >> (4 * _n)) & 0xf); \ | ||
1346 | if (md >= DLT_SET) \ | ||
1347 | { \ | ||
1348 | unsigned int v; \ | ||
1349 | unsigned char *dv; \ | ||
1350 | dv = (unsigned char *)&v; \ | ||
1351 | dv[0] = *(svr->buf + offset + s + 0); \ | ||
1352 | dv[1] = *(svr->buf + offset + s + 1); \ | ||
1353 | dv[2] = *(svr->buf + offset + s + 2); \ | ||
1354 | dv[3] = *(svr->buf + offset + s + 3); \ | ||
1355 | d = (int)ntohl(v); \ | ||
1356 | s += 4; \ | ||
1357 | } \ | ||
1358 | else if (md >= DLT_ADD16) \ | ||
1359 | { \ | ||
1360 | unsigned short v; \ | ||
1361 | unsigned char *dv; \ | ||
1362 | dv = (unsigned char *)&v; \ | ||
1363 | dv[0] = *(svr->buf + offset + s + 0); \ | ||
1364 | dv[1] = *(svr->buf + offset + s + 1); \ | ||
1365 | d = (int)ntohs(v); \ | ||
1366 | s += 2; \ | ||
1367 | } \ | ||
1368 | else if (md >= DLT_ADD8) \ | ||
1369 | { \ | ||
1370 | unsigned char v; \ | ||
1371 | unsigned char *dv; \ | ||
1372 | dv = (unsigned char *)&v; \ | ||
1373 | dv[0] = *(svr->buf + offset + s + 0); \ | ||
1374 | d = (int)v; \ | ||
1375 | s += 1; \ | ||
1376 | } \ | ||
1377 | msg._member = _ecore_ipc_ddlt_int(d, svr->prev.i._member, md); | ||
1378 | |||
1379 | static Eina_Bool | ||
1380 | _ecore_ipc_event_server_data(void *data __UNUSED__, int ev_type __UNUSED__, void *ev) | ||
1381 | { | ||
1382 | Ecore_Con_Event_Server_Data *e; | ||
1383 | |||
1384 | e = ev; | ||
1385 | if (!eina_list_data_find(servers, ecore_con_server_data_get(e->server))) return ECORE_CALLBACK_RENEW; | ||
1386 | /* handling code here */ | ||
1387 | { | ||
1388 | Ecore_Ipc_Server *svr; | ||
1389 | Ecore_Ipc_Msg_Head msg; | ||
1390 | int offset = 0; | ||
1391 | unsigned char *buf; | ||
1392 | |||
1393 | svr = ecore_con_server_data_get(e->server); | ||
1394 | |||
1395 | if (!svr->buf) | ||
1396 | { | ||
1397 | svr->buf_size = e->size; | ||
1398 | svr->buf = e->data; | ||
1399 | e->data = NULL; /* take it out of the old event */ | ||
1400 | } | ||
1401 | else | ||
1402 | { | ||
1403 | buf = realloc(svr->buf, svr->buf_size + e->size); | ||
1404 | if (!buf) | ||
1405 | { | ||
1406 | free(svr->buf); | ||
1407 | svr->buf = 0; | ||
1408 | svr->buf_size = 0; | ||
1409 | return ECORE_CALLBACK_CANCEL; | ||
1410 | } | ||
1411 | svr->buf = buf; | ||
1412 | memcpy(svr->buf + svr->buf_size, e->data, e->size); | ||
1413 | svr->buf_size += e->size; | ||
1414 | } | ||
1415 | /* examine header */ | ||
1416 | redo: | ||
1417 | if ((svr->buf_size - offset) >= (int)sizeof(int)) | ||
1418 | { | ||
1419 | int s, md, d = 0, head; | ||
1420 | unsigned char *dd; | ||
1421 | |||
1422 | dd = (unsigned char *)&head; | ||
1423 | dd[0] = *(svr->buf + offset + 0); | ||
1424 | dd[1] = *(svr->buf + offset + 1); | ||
1425 | dd[2] = *(svr->buf + offset + 2); | ||
1426 | dd[3] = *(svr->buf + offset + 3); | ||
1427 | head = ntohl(head); | ||
1428 | dd = (unsigned char *)&d; | ||
1429 | s = 4; | ||
1430 | SVSZ(0); | ||
1431 | SVSZ(1); | ||
1432 | SVSZ(2); | ||
1433 | SVSZ(3); | ||
1434 | SVSZ(4); | ||
1435 | SVSZ(5); | ||
1436 | if ((svr->buf_size - offset) < s) | ||
1437 | { | ||
1438 | if (offset > 0) goto scroll; | ||
1439 | return ECORE_CALLBACK_CANCEL; | ||
1440 | } | ||
1441 | |||
1442 | s = 4; | ||
1443 | SVDEC(0, major); | ||
1444 | SVDEC(1, minor); | ||
1445 | SVDEC(2, ref); | ||
1446 | SVDEC(3, ref_to); | ||
1447 | SVDEC(4, response); | ||
1448 | SVDEC(5, size); | ||
1449 | if (msg.size < 0) msg.size = 0; | ||
1450 | /* there is enough data in the buffer for a full message */ | ||
1451 | if ((svr->buf_size - offset) >= (s + msg.size)) | ||
1452 | { | ||
1453 | Ecore_Ipc_Event_Server_Data *e2; | ||
1454 | int max; | ||
1455 | |||
1456 | buf = NULL; | ||
1457 | max = svr->max_buf_size; | ||
1458 | if ((max < 0) || (msg.size <= max)) | ||
1459 | { | ||
1460 | if (msg.size > 0) | ||
1461 | { | ||
1462 | buf = malloc(msg.size); | ||
1463 | if (!buf) return ECORE_CALLBACK_CANCEL; | ||
1464 | memcpy(buf, svr->buf + offset + s, msg.size); | ||
1465 | } | ||
1466 | if (!svr->delete_me) | ||
1467 | { | ||
1468 | e2 = calloc(1, sizeof(Ecore_Ipc_Event_Server_Data)); | ||
1469 | if (e2) | ||
1470 | { | ||
1471 | svr->event_count++; | ||
1472 | e2->server = svr; | ||
1473 | e2->major = msg.major; | ||
1474 | e2->minor = msg.minor; | ||
1475 | e2->ref = msg.ref; | ||
1476 | e2->ref_to = msg.ref_to; | ||
1477 | e2->response = msg.response; | ||
1478 | e2->size = msg.size; | ||
1479 | e2->data = buf; | ||
1480 | ecore_event_add(ECORE_IPC_EVENT_SERVER_DATA, e2, | ||
1481 | _ecore_ipc_event_server_data_free, | ||
1482 | NULL); | ||
1483 | } | ||
1484 | } | ||
1485 | } | ||
1486 | svr->prev.i = msg; | ||
1487 | offset += (s + msg.size); | ||
1488 | if (svr->buf_size == offset) | ||
1489 | { | ||
1490 | free(svr->buf); | ||
1491 | svr->buf = NULL; | ||
1492 | svr->buf_size = 0; | ||
1493 | return ECORE_CALLBACK_CANCEL; | ||
1494 | } | ||
1495 | goto redo; | ||
1496 | } | ||
1497 | else goto scroll; | ||
1498 | } | ||
1499 | else | ||
1500 | { | ||
1501 | scroll: | ||
1502 | buf = malloc(svr->buf_size - offset); | ||
1503 | if (!buf) | ||
1504 | { | ||
1505 | free(svr->buf); | ||
1506 | svr->buf = NULL; | ||
1507 | svr->buf_size = 0; | ||
1508 | return ECORE_CALLBACK_CANCEL; | ||
1509 | } | ||
1510 | memcpy(buf, svr->buf + offset, svr->buf_size - offset); | ||
1511 | free(svr->buf); | ||
1512 | svr->buf = buf; | ||
1513 | svr->buf_size -= offset; | ||
1514 | } | ||
1515 | } | ||
1516 | return ECORE_CALLBACK_CANCEL; | ||
1517 | } | ||
1518 | |||
1519 | static void | ||
1520 | _ecore_ipc_event_client_add_free(void *data __UNUSED__, void *ev) | ||
1521 | { | ||
1522 | Ecore_Ipc_Event_Client_Add *e; | ||
1523 | |||
1524 | e = ev; | ||
1525 | e->client->event_count--; | ||
1526 | if ((e->client->event_count == 0) && (e->client->delete_me)) | ||
1527 | ecore_ipc_client_del(e->client); | ||
1528 | free(e); | ||
1529 | } | ||
1530 | |||
1531 | static void | ||
1532 | _ecore_ipc_event_client_del_free(void *data __UNUSED__, void *ev) | ||
1533 | { | ||
1534 | Ecore_Ipc_Event_Client_Del *e; | ||
1535 | |||
1536 | e = ev; | ||
1537 | e->client->event_count--; | ||
1538 | if ((e->client->event_count == 0) && (e->client->delete_me)) | ||
1539 | ecore_ipc_client_del(e->client); | ||
1540 | free(e); | ||
1541 | } | ||
1542 | |||
1543 | static void | ||
1544 | _ecore_ipc_event_client_data_free(void *data __UNUSED__, void *ev) | ||
1545 | { | ||
1546 | Ecore_Ipc_Event_Client_Data *e; | ||
1547 | |||
1548 | e = ev; | ||
1549 | e->client->event_count--; | ||
1550 | if (e->data) free(e->data); | ||
1551 | if ((e->client->event_count == 0) && (e->client->delete_me)) | ||
1552 | ecore_ipc_client_del(e->client); | ||
1553 | free(e); | ||
1554 | } | ||
1555 | |||
1556 | static void | ||
1557 | _ecore_ipc_event_server_add_free(void *data __UNUSED__, void *ev) | ||
1558 | { | ||
1559 | Ecore_Ipc_Event_Server_Add *e; | ||
1560 | |||
1561 | e = ev; | ||
1562 | e->server->event_count--; | ||
1563 | if ((e->server->event_count == 0) && (e->server->delete_me)) | ||
1564 | ecore_ipc_server_del(e->server); | ||
1565 | free(e); | ||
1566 | } | ||
1567 | |||
1568 | static void | ||
1569 | _ecore_ipc_event_server_del_free(void *data __UNUSED__, void *ev) | ||
1570 | { | ||
1571 | Ecore_Ipc_Event_Server_Add *e; | ||
1572 | |||
1573 | e = ev; | ||
1574 | e->server->event_count--; | ||
1575 | if ((e->server->event_count == 0) && (e->server->delete_me)) | ||
1576 | ecore_ipc_server_del(e->server); | ||
1577 | free(e); | ||
1578 | } | ||
1579 | |||
1580 | static void | ||
1581 | _ecore_ipc_event_server_data_free(void *data __UNUSED__, void *ev) | ||
1582 | { | ||
1583 | Ecore_Ipc_Event_Server_Data *e; | ||
1584 | |||
1585 | e = ev; | ||
1586 | if (e->data) free(e->data); | ||
1587 | e->server->event_count--; | ||
1588 | if ((e->server->event_count == 0) && (e->server->delete_me)) | ||
1589 | ecore_ipc_server_del(e->server); | ||
1590 | free(e); | ||
1591 | } | ||
diff --git a/libraries/ecore/src/lib/ecore_ipc/ecore_ipc_private.h b/libraries/ecore/src/lib/ecore_ipc/ecore_ipc_private.h new file mode 100644 index 0000000..57f7849 --- /dev/null +++ b/libraries/ecore/src/lib/ecore_ipc/ecore_ipc_private.h | |||
@@ -0,0 +1,104 @@ | |||
1 | #ifndef _ECORE_IPC_PRIVATE_H | ||
2 | #define _ECORE_IPC_PRIVATE_H | ||
3 | |||
4 | |||
5 | extern int _ecore_ipc_log_dom; | ||
6 | |||
7 | #ifdef ECORE_IPC_DEFAULT_LOG_COLOR | ||
8 | # undef ECORE_IPC_DEFAULT_LOG_COLOR | ||
9 | #endif | ||
10 | #define ECORE_IPC_DEFAULT_LOG_COLOR EINA_COLOR_BLUE | ||
11 | |||
12 | #ifdef ERR | ||
13 | # undef ERR | ||
14 | #endif | ||
15 | #define ERR(...) EINA_LOG_DOM_ERR(_ecore_ipc_log_dom, __VA_ARGS__) | ||
16 | |||
17 | #ifdef DBG | ||
18 | # undef DBG | ||
19 | #endif | ||
20 | #define DBG(...) EINA_LOG_DOM_DBG(_ecore_ipc_log_dom, __VA_ARGS__) | ||
21 | |||
22 | #ifdef INF | ||
23 | # undef INF | ||
24 | #endif | ||
25 | #define INF(...) EINA_LOG_DOM_INFO(_ecore_ipc_log_dom, __VA_ARGS__) | ||
26 | |||
27 | #ifdef WRN | ||
28 | # undef WRN | ||
29 | #endif | ||
30 | #define WRN(...) EINA_LOG_DOM_WARN(_ecore_ipc_log_dom, __VA_ARGS__) | ||
31 | |||
32 | #ifdef CRIT | ||
33 | # undef CRIT | ||
34 | #endif | ||
35 | #define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_ipc_log_dom, __VA_ARGS__) | ||
36 | |||
37 | #define ECORE_MAGIC_IPC_SERVER 0x87786556 | ||
38 | #define ECORE_MAGIC_IPC_CLIENT 0x78875665 | ||
39 | |||
40 | typedef struct _Ecore_Ipc_Msg_Head Ecore_Ipc_Msg_Head; | ||
41 | |||
42 | |||
43 | #if defined (_MSC_VER) || (defined (__SUNPRO_C) && __SUNPRO_C < 0x5100) | ||
44 | # pragma pack(1) | ||
45 | # define ECORE_IPC_STRUCT_PACKED | ||
46 | #elif defined (__GNUC__) || (defined (__SUNPRO_C) && __SUNPRO_C >= 0x5100) | ||
47 | # define ECORE_IPC_STRUCT_PACKED __attribute__((packed)) | ||
48 | #else | ||
49 | # define ECORE_IPC_STRUCT_PACKED | ||
50 | #endif | ||
51 | |||
52 | #ifdef __sgi | ||
53 | #pragma pack 4 | ||
54 | #endif | ||
55 | struct _Ecore_Ipc_Msg_Head | ||
56 | { | ||
57 | int major; | ||
58 | int minor; | ||
59 | int ref; | ||
60 | int ref_to; | ||
61 | int response; | ||
62 | int size; | ||
63 | } ECORE_IPC_STRUCT_PACKED; | ||
64 | #ifdef __sgi | ||
65 | #pragma pack 0 | ||
66 | #endif | ||
67 | |||
68 | struct _Ecore_Ipc_Client | ||
69 | { | ||
70 | ECORE_MAGIC; | ||
71 | Ecore_Con_Client *client; | ||
72 | void *data; | ||
73 | unsigned char *buf; | ||
74 | int buf_size; | ||
75 | int max_buf_size; | ||
76 | |||
77 | struct { | ||
78 | Ecore_Ipc_Msg_Head i, o; | ||
79 | } prev; | ||
80 | |||
81 | int event_count; | ||
82 | char delete_me : 1; | ||
83 | }; | ||
84 | |||
85 | struct _Ecore_Ipc_Server | ||
86 | { | ||
87 | ECORE_MAGIC; | ||
88 | Ecore_Con_Server *server; | ||
89 | Eina_List *clients; | ||
90 | Eina_List *client_list; | ||
91 | void *data; | ||
92 | unsigned char *buf; | ||
93 | int buf_size; | ||
94 | int max_buf_size; | ||
95 | |||
96 | struct { | ||
97 | Ecore_Ipc_Msg_Head i, o; | ||
98 | } prev; | ||
99 | |||
100 | int event_count; | ||
101 | char delete_me : 1; | ||
102 | }; | ||
103 | |||
104 | #endif | ||