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/evas/src/lib/cserve | |
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/evas/src/lib/cserve')
-rw-r--r-- | libraries/evas/src/lib/cserve/Makefile.am | 32 | ||||
-rw-r--r-- | libraries/evas/src/lib/cserve/Makefile.in | 688 | ||||
-rw-r--r-- | libraries/evas/src/lib/cserve/evas_cs.h | 285 | ||||
-rw-r--r-- | libraries/evas/src/lib/cserve/evas_cs_client.c | 528 | ||||
-rw-r--r-- | libraries/evas/src/lib/cserve/evas_cs_main.c | 9 | ||||
-rw-r--r-- | libraries/evas/src/lib/cserve/evas_cs_mem.c | 168 | ||||
-rw-r--r-- | libraries/evas/src/lib/cserve/evas_cs_server.c | 380 |
7 files changed, 2090 insertions, 0 deletions
diff --git a/libraries/evas/src/lib/cserve/Makefile.am b/libraries/evas/src/lib/cserve/Makefile.am new file mode 100644 index 0000000..6ff6e2a --- /dev/null +++ b/libraries/evas/src/lib/cserve/Makefile.am | |||
@@ -0,0 +1,32 @@ | |||
1 | MAINTAINERCLEANFILES = Makefile.in | ||
2 | |||
3 | AM_CPPFLAGS = \ | ||
4 | -I. \ | ||
5 | -I$(top_srcdir)/src/lib \ | ||
6 | -I$(top_srcdir)/src/lib/include \ | ||
7 | -I$(top_srcdir)/src/lib/cserve \ | ||
8 | -DPACKAGE_BIN_DIR=\"$(bindir)\" \ | ||
9 | -DPACKAGE_LIB_DIR=\"$(libdir)\" \ | ||
10 | -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ | ||
11 | @EINA_CFLAGS@ \ | ||
12 | @FREETYPE_CFLAGS@ \ | ||
13 | @FRIBIDI_CFLAGS@ \ | ||
14 | @EET_CFLAGS@ \ | ||
15 | @FONTCONFIG_CFLAGS@ \ | ||
16 | @pthread_cflags@ \ | ||
17 | @PIXMAN_CFLAGS@ | ||
18 | |||
19 | if EVAS_CSERVE | ||
20 | |||
21 | noinst_LTLIBRARIES = libevas_cserve.la | ||
22 | |||
23 | endif | ||
24 | |||
25 | libevas_cserve_la_SOURCES = \ | ||
26 | evas_cs.h \ | ||
27 | evas_cs_main.c \ | ||
28 | evas_cs_server.c \ | ||
29 | evas_cs_client.c \ | ||
30 | evas_cs_mem.c | ||
31 | |||
32 | libevas_cserve_la_LIBADD = @EINA_LIBS@ -lrt | ||
diff --git a/libraries/evas/src/lib/cserve/Makefile.in b/libraries/evas/src/lib/cserve/Makefile.in new file mode 100644 index 0000000..74b5ff9 --- /dev/null +++ b/libraries/evas/src/lib/cserve/Makefile.in | |||
@@ -0,0 +1,688 @@ | |||
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 | VPATH = @srcdir@ | ||
19 | pkgdatadir = $(datadir)/@PACKAGE@ | ||
20 | pkgincludedir = $(includedir)/@PACKAGE@ | ||
21 | pkglibdir = $(libdir)/@PACKAGE@ | ||
22 | pkglibexecdir = $(libexecdir)/@PACKAGE@ | ||
23 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd | ||
24 | install_sh_DATA = $(install_sh) -c -m 644 | ||
25 | install_sh_PROGRAM = $(install_sh) -c | ||
26 | install_sh_SCRIPT = $(install_sh) -c | ||
27 | INSTALL_HEADER = $(INSTALL_DATA) | ||
28 | transform = $(program_transform_name) | ||
29 | NORMAL_INSTALL = : | ||
30 | PRE_INSTALL = : | ||
31 | POST_INSTALL = : | ||
32 | NORMAL_UNINSTALL = : | ||
33 | PRE_UNINSTALL = : | ||
34 | POST_UNINSTALL = : | ||
35 | build_triplet = @build@ | ||
36 | host_triplet = @host@ | ||
37 | subdir = src/lib/cserve | ||
38 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in | ||
39 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||
40 | am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ | ||
41 | $(top_srcdir)/m4/efl_coverage.m4 \ | ||
42 | $(top_srcdir)/m4/efl_doxygen.m4 \ | ||
43 | $(top_srcdir)/m4/efl_fnmatch.m4 \ | ||
44 | $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ | ||
45 | $(top_srcdir)/m4/evas_check_engine.m4 \ | ||
46 | $(top_srcdir)/m4/evas_check_loader.m4 \ | ||
47 | $(top_srcdir)/m4/evas_converter.m4 \ | ||
48 | $(top_srcdir)/m4/evas_dither.m4 \ | ||
49 | $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \ | ||
50 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ | ||
51 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ | ||
52 | $(top_srcdir)/configure.ac | ||
53 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||
54 | $(ACLOCAL_M4) | ||
55 | mkinstalldirs = $(install_sh) -d | ||
56 | CONFIG_HEADER = $(top_builddir)/config.h | ||
57 | CONFIG_CLEAN_FILES = | ||
58 | CONFIG_CLEAN_VPATH_FILES = | ||
59 | LTLIBRARIES = $(noinst_LTLIBRARIES) | ||
60 | libevas_cserve_la_DEPENDENCIES = | ||
61 | am_libevas_cserve_la_OBJECTS = evas_cs_main.lo evas_cs_server.lo \ | ||
62 | evas_cs_client.lo evas_cs_mem.lo | ||
63 | libevas_cserve_la_OBJECTS = $(am_libevas_cserve_la_OBJECTS) | ||
64 | AM_V_lt = $(am__v_lt_$(V)) | ||
65 | am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) | ||
66 | am__v_lt_0 = --silent | ||
67 | @EVAS_CSERVE_TRUE@am_libevas_cserve_la_rpath = | ||
68 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) | ||
69 | depcomp = $(SHELL) $(top_srcdir)/depcomp | ||
70 | am__depfiles_maybe = depfiles | ||
71 | am__mv = mv -f | ||
72 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
73 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
74 | LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
75 | $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ | ||
76 | $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ | ||
77 | $(AM_CFLAGS) $(CFLAGS) | ||
78 | AM_V_CC = $(am__v_CC_$(V)) | ||
79 | am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) | ||
80 | am__v_CC_0 = @echo " CC " $@; | ||
81 | AM_V_at = $(am__v_at_$(V)) | ||
82 | am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) | ||
83 | am__v_at_0 = @ | ||
84 | CCLD = $(CC) | ||
85 | LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
86 | $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ | ||
87 | $(AM_LDFLAGS) $(LDFLAGS) -o $@ | ||
88 | AM_V_CCLD = $(am__v_CCLD_$(V)) | ||
89 | am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) | ||
90 | am__v_CCLD_0 = @echo " CCLD " $@; | ||
91 | AM_V_GEN = $(am__v_GEN_$(V)) | ||
92 | am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) | ||
93 | am__v_GEN_0 = @echo " GEN " $@; | ||
94 | SOURCES = $(libevas_cserve_la_SOURCES) | ||
95 | DIST_SOURCES = $(libevas_cserve_la_SOURCES) | ||
96 | ETAGS = etags | ||
97 | CTAGS = ctags | ||
98 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
99 | ACLOCAL = @ACLOCAL@ | ||
100 | ALLOCA = @ALLOCA@ | ||
101 | AMTAR = @AMTAR@ | ||
102 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ | ||
103 | AR = @AR@ | ||
104 | AS = @AS@ | ||
105 | AUTOCONF = @AUTOCONF@ | ||
106 | AUTOHEADER = @AUTOHEADER@ | ||
107 | AUTOMAKE = @AUTOMAKE@ | ||
108 | AWK = @AWK@ | ||
109 | CC = @CC@ | ||
110 | CCDEPMODE = @CCDEPMODE@ | ||
111 | CFLAGS = @CFLAGS@ | ||
112 | CHECK_CFLAGS = @CHECK_CFLAGS@ | ||
113 | CHECK_LIBS = @CHECK_LIBS@ | ||
114 | CPP = @CPP@ | ||
115 | CPPFLAGS = @CPPFLAGS@ | ||
116 | CXX = @CXX@ | ||
117 | CXXCPP = @CXXCPP@ | ||
118 | CXXDEPMODE = @CXXDEPMODE@ | ||
119 | CXXFLAGS = @CXXFLAGS@ | ||
120 | CYGPATH_W = @CYGPATH_W@ | ||
121 | DEFS = @DEFS@ | ||
122 | DEPDIR = @DEPDIR@ | ||
123 | DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@ | ||
124 | DIRECTFB_LIBS = @DIRECTFB_LIBS@ | ||
125 | DLLTOOL = @DLLTOOL@ | ||
126 | DSYMUTIL = @DSYMUTIL@ | ||
127 | DUMPBIN = @DUMPBIN@ | ||
128 | ECHO_C = @ECHO_C@ | ||
129 | ECHO_N = @ECHO_N@ | ||
130 | ECHO_T = @ECHO_T@ | ||
131 | ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@ | ||
132 | ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@ | ||
133 | EDB_CFLAGS = @EDB_CFLAGS@ | ||
134 | EDB_LIBS = @EDB_LIBS@ | ||
135 | EDJE_CFLAGS = @EDJE_CFLAGS@ | ||
136 | EDJE_LIBS = @EDJE_LIBS@ | ||
137 | EET_CFLAGS = @EET_CFLAGS@ | ||
138 | EET_LIBS = @EET_LIBS@ | ||
139 | EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@ | ||
140 | EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@ | ||
141 | EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@ | ||
142 | EGREP = @EGREP@ | ||
143 | EINA_CFLAGS = @EINA_CFLAGS@ | ||
144 | EINA_LIBS = @EINA_LIBS@ | ||
145 | EVAS_CFLAGS = @EVAS_CFLAGS@ | ||
146 | EVAS_LIBS = @EVAS_LIBS@ | ||
147 | EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@ | ||
148 | EVIL_CFLAGS = @EVIL_CFLAGS@ | ||
149 | EVIL_LIBS = @EVIL_LIBS@ | ||
150 | EXEEXT = @EXEEXT@ | ||
151 | FGREP = @FGREP@ | ||
152 | FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ | ||
153 | FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ | ||
154 | FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ | ||
155 | FREETYPE_LIBS = @FREETYPE_LIBS@ | ||
156 | FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ | ||
157 | FRIBIDI_LIBS = @FRIBIDI_LIBS@ | ||
158 | GL_EET_CFLAGS = @GL_EET_CFLAGS@ | ||
159 | GL_EET_LIBS = @GL_EET_LIBS@ | ||
160 | GREP = @GREP@ | ||
161 | HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ | ||
162 | HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ | ||
163 | INSTALL = @INSTALL@ | ||
164 | INSTALL_DATA = @INSTALL_DATA@ | ||
165 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
166 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | ||
167 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | ||
168 | LD = @LD@ | ||
169 | LDFLAGS = @LDFLAGS@ | ||
170 | LIBOBJS = @LIBOBJS@ | ||
171 | LIBS = @LIBS@ | ||
172 | LIBTOOL = @LIBTOOL@ | ||
173 | LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@ | ||
174 | LINEBREAK_LIBS = @LINEBREAK_LIBS@ | ||
175 | LIPO = @LIPO@ | ||
176 | LN_S = @LN_S@ | ||
177 | LTLIBOBJS = @LTLIBOBJS@ | ||
178 | MAKEINFO = @MAKEINFO@ | ||
179 | MKDIR_P = @MKDIR_P@ | ||
180 | MODULE_ARCH = @MODULE_ARCH@ | ||
181 | NM = @NM@ | ||
182 | NMEDIT = @NMEDIT@ | ||
183 | OBJC = @OBJC@ | ||
184 | OBJCDEPMODE = @OBJCDEPMODE@ | ||
185 | OBJCFLAGS = @OBJCFLAGS@ | ||
186 | OBJDUMP = @OBJDUMP@ | ||
187 | OBJEXT = @OBJEXT@ | ||
188 | OTOOL = @OTOOL@ | ||
189 | OTOOL64 = @OTOOL64@ | ||
190 | PACKAGE = @PACKAGE@ | ||
191 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | ||
192 | PACKAGE_NAME = @PACKAGE_NAME@ | ||
193 | PACKAGE_STRING = @PACKAGE_STRING@ | ||
194 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | ||
195 | PACKAGE_URL = @PACKAGE_URL@ | ||
196 | PACKAGE_VERSION = @PACKAGE_VERSION@ | ||
197 | PATH_SEPARATOR = @PATH_SEPARATOR@ | ||
198 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | ||
199 | PIXMAN_LIBS = @PIXMAN_LIBS@ | ||
200 | PKG_CONFIG = @PKG_CONFIG@ | ||
201 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
202 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
203 | PNG_CFLAGS = @PNG_CFLAGS@ | ||
204 | PNG_LIBS = @PNG_LIBS@ | ||
205 | RANLIB = @RANLIB@ | ||
206 | SDL_CFLAGS = @SDL_CFLAGS@ | ||
207 | SDL_LIBS = @SDL_LIBS@ | ||
208 | SED = @SED@ | ||
209 | SET_MAKE = @SET_MAKE@ | ||
210 | SHELL = @SHELL@ | ||
211 | SHM_OPEN_LINK = @SHM_OPEN_LINK@ | ||
212 | STRIP = @STRIP@ | ||
213 | SVG_CFLAGS = @SVG_CFLAGS@ | ||
214 | SVG_LIBS = @SVG_LIBS@ | ||
215 | VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | ||
216 | VALGRIND_LIBS = @VALGRIND_LIBS@ | ||
217 | VERSION = @VERSION@ | ||
218 | VMAJ = @VMAJ@ | ||
219 | WIN32_CFLAGS = @WIN32_CFLAGS@ | ||
220 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | ||
221 | XCB_CFLAGS = @XCB_CFLAGS@ | ||
222 | XCB_GL_CFLAGS = @XCB_GL_CFLAGS@ | ||
223 | XCB_GL_LIBS = @XCB_GL_LIBS@ | ||
224 | XCB_LIBS = @XCB_LIBS@ | ||
225 | XEXT_CFLAGS = @XEXT_CFLAGS@ | ||
226 | XEXT_LIBS = @XEXT_LIBS@ | ||
227 | XMKMF = @XMKMF@ | ||
228 | X_CFLAGS = @X_CFLAGS@ | ||
229 | X_EXTRA_LIBS = @X_EXTRA_LIBS@ | ||
230 | X_LIBS = @X_LIBS@ | ||
231 | X_PRE_LIBS = @X_PRE_LIBS@ | ||
232 | abs_builddir = @abs_builddir@ | ||
233 | abs_srcdir = @abs_srcdir@ | ||
234 | abs_top_builddir = @abs_top_builddir@ | ||
235 | abs_top_srcdir = @abs_top_srcdir@ | ||
236 | ac_ct_CC = @ac_ct_CC@ | ||
237 | ac_ct_CXX = @ac_ct_CXX@ | ||
238 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ | ||
239 | ac_ct_OBJC = @ac_ct_OBJC@ | ||
240 | altivec_cflags = @altivec_cflags@ | ||
241 | am__include = @am__include@ | ||
242 | am__leading_dot = @am__leading_dot@ | ||
243 | am__quote = @am__quote@ | ||
244 | am__tar = @am__tar@ | ||
245 | am__untar = @am__untar@ | ||
246 | bindir = @bindir@ | ||
247 | build = @build@ | ||
248 | build_alias = @build_alias@ | ||
249 | build_cpu = @build_cpu@ | ||
250 | build_os = @build_os@ | ||
251 | build_vendor = @build_vendor@ | ||
252 | builddir = @builddir@ | ||
253 | datadir = @datadir@ | ||
254 | datarootdir = @datarootdir@ | ||
255 | dlopen_libs = @dlopen_libs@ | ||
256 | docdir = @docdir@ | ||
257 | dvidir = @dvidir@ | ||
258 | edje_cc = @edje_cc@ | ||
259 | efl_doxygen = @efl_doxygen@ | ||
260 | efl_have_doxygen = @efl_have_doxygen@ | ||
261 | evas_engine_buffer_cflags = @evas_engine_buffer_cflags@ | ||
262 | evas_engine_buffer_libs = @evas_engine_buffer_libs@ | ||
263 | evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@ | ||
264 | evas_engine_direct3d_libs = @evas_engine_direct3d_libs@ | ||
265 | evas_engine_directfb_cflags = @evas_engine_directfb_cflags@ | ||
266 | evas_engine_directfb_libs = @evas_engine_directfb_libs@ | ||
267 | evas_engine_fb_cflags = @evas_engine_fb_cflags@ | ||
268 | evas_engine_fb_libs = @evas_engine_fb_libs@ | ||
269 | evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@ | ||
270 | evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@ | ||
271 | evas_engine_gl_common_libs = @evas_engine_gl_common_libs@ | ||
272 | evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@ | ||
273 | evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@ | ||
274 | evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@ | ||
275 | evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@ | ||
276 | evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@ | ||
277 | evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@ | ||
278 | evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@ | ||
279 | evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@ | ||
280 | evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@ | ||
281 | evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@ | ||
282 | evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@ | ||
283 | evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@ | ||
284 | evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@ | ||
285 | evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@ | ||
286 | evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@ | ||
287 | evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@ | ||
288 | evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@ | ||
289 | evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@ | ||
290 | evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@ | ||
291 | evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@ | ||
292 | evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@ | ||
293 | evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@ | ||
294 | evas_engine_software_sdl_cflags = @evas_engine_software_sdl_cflags@ | ||
295 | evas_engine_software_sdl_libs = @evas_engine_software_sdl_libs@ | ||
296 | evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | ||
297 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | ||
298 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | ||
299 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | ||
300 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | ||
301 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | ||
302 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | ||
303 | evas_image_loader_edb_libs = @evas_image_loader_edb_libs@ | ||
304 | evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@ | ||
305 | evas_image_loader_eet_libs = @evas_image_loader_eet_libs@ | ||
306 | evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@ | ||
307 | evas_image_loader_generic_libs = @evas_image_loader_generic_libs@ | ||
308 | evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@ | ||
309 | evas_image_loader_gif_libs = @evas_image_loader_gif_libs@ | ||
310 | evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@ | ||
311 | evas_image_loader_ico_libs = @evas_image_loader_ico_libs@ | ||
312 | evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@ | ||
313 | evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@ | ||
314 | evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@ | ||
315 | evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@ | ||
316 | evas_image_loader_png_cflags = @evas_image_loader_png_cflags@ | ||
317 | evas_image_loader_png_libs = @evas_image_loader_png_libs@ | ||
318 | evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@ | ||
319 | evas_image_loader_psd_libs = @evas_image_loader_psd_libs@ | ||
320 | evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@ | ||
321 | evas_image_loader_svg_libs = @evas_image_loader_svg_libs@ | ||
322 | evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@ | ||
323 | evas_image_loader_tga_libs = @evas_image_loader_tga_libs@ | ||
324 | evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@ | ||
325 | evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@ | ||
326 | evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@ | ||
327 | evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@ | ||
328 | evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@ | ||
329 | evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@ | ||
330 | exec_prefix = @exec_prefix@ | ||
331 | have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@ | ||
332 | have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@ | ||
333 | have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@ | ||
334 | have_evas_engine_software_x11 = @have_evas_engine_software_x11@ | ||
335 | have_evas_engine_software_xcb = @have_evas_engine_software_xcb@ | ||
336 | have_evas_engine_software_xlib = @have_evas_engine_software_xlib@ | ||
337 | have_lcov = @have_lcov@ | ||
338 | host = @host@ | ||
339 | host_alias = @host_alias@ | ||
340 | host_cpu = @host_cpu@ | ||
341 | host_os = @host_os@ | ||
342 | host_vendor = @host_vendor@ | ||
343 | htmldir = @htmldir@ | ||
344 | includedir = @includedir@ | ||
345 | infodir = @infodir@ | ||
346 | install_sh = @install_sh@ | ||
347 | libdir = @libdir@ | ||
348 | libexecdir = @libexecdir@ | ||
349 | localedir = @localedir@ | ||
350 | localstatedir = @localstatedir@ | ||
351 | lt_ECHO = @lt_ECHO@ | ||
352 | lt_enable_auto_import = @lt_enable_auto_import@ | ||
353 | mandir = @mandir@ | ||
354 | mkdir_p = @mkdir_p@ | ||
355 | oldincludedir = @oldincludedir@ | ||
356 | pdfdir = @pdfdir@ | ||
357 | pkgconfig_requires_private = @pkgconfig_requires_private@ | ||
358 | prefix = @prefix@ | ||
359 | program_transform_name = @program_transform_name@ | ||
360 | psdir = @psdir@ | ||
361 | pthread_cflags = @pthread_cflags@ | ||
362 | pthread_libs = @pthread_libs@ | ||
363 | release_info = @release_info@ | ||
364 | requirement_evas = @requirement_evas@ | ||
365 | sbindir = @sbindir@ | ||
366 | sharedstatedir = @sharedstatedir@ | ||
367 | srcdir = @srcdir@ | ||
368 | sysconfdir = @sysconfdir@ | ||
369 | target_alias = @target_alias@ | ||
370 | top_build_prefix = @top_build_prefix@ | ||
371 | top_builddir = @top_builddir@ | ||
372 | top_srcdir = @top_srcdir@ | ||
373 | version_info = @version_info@ | ||
374 | MAINTAINERCLEANFILES = Makefile.in | ||
375 | AM_CPPFLAGS = \ | ||
376 | -I. \ | ||
377 | -I$(top_srcdir)/src/lib \ | ||
378 | -I$(top_srcdir)/src/lib/include \ | ||
379 | -I$(top_srcdir)/src/lib/cserve \ | ||
380 | -DPACKAGE_BIN_DIR=\"$(bindir)\" \ | ||
381 | -DPACKAGE_LIB_DIR=\"$(libdir)\" \ | ||
382 | -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ | ||
383 | @EINA_CFLAGS@ \ | ||
384 | @FREETYPE_CFLAGS@ \ | ||
385 | @FRIBIDI_CFLAGS@ \ | ||
386 | @EET_CFLAGS@ \ | ||
387 | @FONTCONFIG_CFLAGS@ \ | ||
388 | @pthread_cflags@ \ | ||
389 | @PIXMAN_CFLAGS@ | ||
390 | |||
391 | @EVAS_CSERVE_TRUE@noinst_LTLIBRARIES = libevas_cserve.la | ||
392 | libevas_cserve_la_SOURCES = \ | ||
393 | evas_cs.h \ | ||
394 | evas_cs_main.c \ | ||
395 | evas_cs_server.c \ | ||
396 | evas_cs_client.c \ | ||
397 | evas_cs_mem.c | ||
398 | |||
399 | libevas_cserve_la_LIBADD = @EINA_LIBS@ -lrt | ||
400 | all: all-am | ||
401 | |||
402 | .SUFFIXES: | ||
403 | .SUFFIXES: .c .lo .o .obj | ||
404 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
405 | @for dep in $?; do \ | ||
406 | case '$(am__configure_deps)' in \ | ||
407 | *$$dep*) \ | ||
408 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ | ||
409 | && { if test -f $@; then exit 0; else break; fi; }; \ | ||
410 | exit 1;; \ | ||
411 | esac; \ | ||
412 | done; \ | ||
413 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/lib/cserve/Makefile'; \ | ||
414 | $(am__cd) $(top_srcdir) && \ | ||
415 | $(AUTOMAKE) --gnu src/lib/cserve/Makefile | ||
416 | .PRECIOUS: Makefile | ||
417 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
418 | @case '$?' in \ | ||
419 | *config.status*) \ | ||
420 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
421 | *) \ | ||
422 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
423 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
424 | esac; | ||
425 | |||
426 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
427 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
428 | |||
429 | $(top_srcdir)/configure: $(am__configure_deps) | ||
430 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
431 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
432 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
433 | $(am__aclocal_m4_deps): | ||
434 | |||
435 | clean-noinstLTLIBRARIES: | ||
436 | -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) | ||
437 | @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ | ||
438 | dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ | ||
439 | test "$$dir" != "$$p" || dir=.; \ | ||
440 | echo "rm -f \"$${dir}/so_locations\""; \ | ||
441 | rm -f "$${dir}/so_locations"; \ | ||
442 | done | ||
443 | libevas_cserve.la: $(libevas_cserve_la_OBJECTS) $(libevas_cserve_la_DEPENDENCIES) | ||
444 | $(AM_V_CCLD)$(LINK) $(am_libevas_cserve_la_rpath) $(libevas_cserve_la_OBJECTS) $(libevas_cserve_la_LIBADD) $(LIBS) | ||
445 | |||
446 | mostlyclean-compile: | ||
447 | -rm -f *.$(OBJEXT) | ||
448 | |||
449 | distclean-compile: | ||
450 | -rm -f *.tab.c | ||
451 | |||
452 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_cs_client.Plo@am__quote@ | ||
453 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_cs_main.Plo@am__quote@ | ||
454 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_cs_mem.Plo@am__quote@ | ||
455 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_cs_server.Plo@am__quote@ | ||
456 | |||
457 | .c.o: | ||
458 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
459 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
460 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
461 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
462 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
463 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< | ||
464 | |||
465 | .c.obj: | ||
466 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` | ||
467 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
468 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
469 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
470 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
471 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` | ||
472 | |||
473 | .c.lo: | ||
474 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
475 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo | ||
476 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
477 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ | ||
478 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
479 | @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< | ||
480 | |||
481 | mostlyclean-libtool: | ||
482 | -rm -f *.lo | ||
483 | |||
484 | clean-libtool: | ||
485 | -rm -rf .libs _libs | ||
486 | |||
487 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
488 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
489 | unique=`for i in $$list; do \ | ||
490 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
491 | done | \ | ||
492 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
493 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
494 | mkid -fID $$unique | ||
495 | tags: TAGS | ||
496 | |||
497 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
498 | $(TAGS_FILES) $(LISP) | ||
499 | set x; \ | ||
500 | here=`pwd`; \ | ||
501 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
502 | unique=`for i in $$list; do \ | ||
503 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
504 | done | \ | ||
505 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
506 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
507 | shift; \ | ||
508 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ | ||
509 | test -n "$$unique" || unique=$$empty_fix; \ | ||
510 | if test $$# -gt 0; then \ | ||
511 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
512 | "$$@" $$unique; \ | ||
513 | else \ | ||
514 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
515 | $$unique; \ | ||
516 | fi; \ | ||
517 | fi | ||
518 | ctags: CTAGS | ||
519 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
520 | $(TAGS_FILES) $(LISP) | ||
521 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
522 | unique=`for i in $$list; do \ | ||
523 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
524 | done | \ | ||
525 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
526 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
527 | test -z "$(CTAGS_ARGS)$$unique" \ | ||
528 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
529 | $$unique | ||
530 | |||
531 | GTAGS: | ||
532 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
533 | && $(am__cd) $(top_srcdir) \ | ||
534 | && gtags -i $(GTAGS_ARGS) "$$here" | ||
535 | |||
536 | distclean-tags: | ||
537 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
538 | |||
539 | distdir: $(DISTFILES) | ||
540 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
541 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
542 | list='$(DISTFILES)'; \ | ||
543 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
544 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
545 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
546 | case $$dist_files in \ | ||
547 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
548 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
549 | sort -u` ;; \ | ||
550 | esac; \ | ||
551 | for file in $$dist_files; do \ | ||
552 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
553 | if test -d $$d/$$file; then \ | ||
554 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
555 | if test -d "$(distdir)/$$file"; then \ | ||
556 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
557 | fi; \ | ||
558 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
559 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ | ||
560 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
561 | fi; \ | ||
562 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ | ||
563 | else \ | ||
564 | test -f "$(distdir)/$$file" \ | ||
565 | || cp -p $$d/$$file "$(distdir)/$$file" \ | ||
566 | || exit 1; \ | ||
567 | fi; \ | ||
568 | done | ||
569 | check-am: all-am | ||
570 | check: check-am | ||
571 | all-am: Makefile $(LTLIBRARIES) | ||
572 | installdirs: | ||
573 | install: install-am | ||
574 | install-exec: install-exec-am | ||
575 | install-data: install-data-am | ||
576 | uninstall: uninstall-am | ||
577 | |||
578 | install-am: all-am | ||
579 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
580 | |||
581 | installcheck: installcheck-am | ||
582 | install-strip: | ||
583 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
584 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
585 | `test -z '$(STRIP)' || \ | ||
586 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
587 | mostlyclean-generic: | ||
588 | |||
589 | clean-generic: | ||
590 | |||
591 | distclean-generic: | ||
592 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
593 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) | ||
594 | |||
595 | maintainer-clean-generic: | ||
596 | @echo "This command is intended for maintainers to use" | ||
597 | @echo "it deletes files that may require special tools to rebuild." | ||
598 | -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) | ||
599 | clean: clean-am | ||
600 | |||
601 | clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ | ||
602 | mostlyclean-am | ||
603 | |||
604 | distclean: distclean-am | ||
605 | -rm -rf ./$(DEPDIR) | ||
606 | -rm -f Makefile | ||
607 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
608 | distclean-tags | ||
609 | |||
610 | dvi: dvi-am | ||
611 | |||
612 | dvi-am: | ||
613 | |||
614 | html: html-am | ||
615 | |||
616 | html-am: | ||
617 | |||
618 | info: info-am | ||
619 | |||
620 | info-am: | ||
621 | |||
622 | install-data-am: | ||
623 | |||
624 | install-dvi: install-dvi-am | ||
625 | |||
626 | install-dvi-am: | ||
627 | |||
628 | install-exec-am: | ||
629 | |||
630 | install-html: install-html-am | ||
631 | |||
632 | install-html-am: | ||
633 | |||
634 | install-info: install-info-am | ||
635 | |||
636 | install-info-am: | ||
637 | |||
638 | install-man: | ||
639 | |||
640 | install-pdf: install-pdf-am | ||
641 | |||
642 | install-pdf-am: | ||
643 | |||
644 | install-ps: install-ps-am | ||
645 | |||
646 | install-ps-am: | ||
647 | |||
648 | installcheck-am: | ||
649 | |||
650 | maintainer-clean: maintainer-clean-am | ||
651 | -rm -rf ./$(DEPDIR) | ||
652 | -rm -f Makefile | ||
653 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
654 | |||
655 | mostlyclean: mostlyclean-am | ||
656 | |||
657 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
658 | mostlyclean-libtool | ||
659 | |||
660 | pdf: pdf-am | ||
661 | |||
662 | pdf-am: | ||
663 | |||
664 | ps: ps-am | ||
665 | |||
666 | ps-am: | ||
667 | |||
668 | uninstall-am: | ||
669 | |||
670 | .MAKE: install-am install-strip | ||
671 | |||
672 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ | ||
673 | clean-libtool clean-noinstLTLIBRARIES ctags distclean \ | ||
674 | distclean-compile distclean-generic distclean-libtool \ | ||
675 | distclean-tags distdir dvi dvi-am html html-am info info-am \ | ||
676 | install install-am install-data install-data-am install-dvi \ | ||
677 | install-dvi-am install-exec install-exec-am install-html \ | ||
678 | install-html-am install-info install-info-am install-man \ | ||
679 | install-pdf install-pdf-am install-ps install-ps-am \ | ||
680 | install-strip installcheck installcheck-am installdirs \ | ||
681 | maintainer-clean maintainer-clean-generic mostlyclean \ | ||
682 | mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ | ||
683 | pdf pdf-am ps ps-am tags uninstall uninstall-am | ||
684 | |||
685 | |||
686 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
687 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
688 | .NOEXPORT: | ||
diff --git a/libraries/evas/src/lib/cserve/evas_cs.h b/libraries/evas/src/lib/cserve/evas_cs.h new file mode 100644 index 0000000..73bbaed --- /dev/null +++ b/libraries/evas/src/lib/cserve/evas_cs.h | |||
@@ -0,0 +1,285 @@ | |||
1 | #ifndef EVAS_CS_H | ||
2 | #define EVAS_CS_H 1 | ||
3 | |||
4 | #ifdef EVAS_CSERVE | ||
5 | |||
6 | #include <sys/select.h> | ||
7 | #include <sys/time.h> | ||
8 | #include <sys/types.h> | ||
9 | #include <sys/socket.h> | ||
10 | #include <sys/mman.h> | ||
11 | #include <sys/stat.h> | ||
12 | #include <sys/param.h> | ||
13 | #include <fcntl.h> | ||
14 | #include <stdio.h> | ||
15 | #include <stdlib.h> | ||
16 | #include <unistd.h> | ||
17 | #include <string.h> | ||
18 | #include <netinet/in.h> | ||
19 | #include <sys/un.h> | ||
20 | #include <arpa/inet.h> | ||
21 | #include <errno.h> | ||
22 | |||
23 | #include "evas_common.h" | ||
24 | #include "evas_private.h" | ||
25 | |||
26 | #ifdef EAPI | ||
27 | # undef EAPI | ||
28 | #endif | ||
29 | |||
30 | #ifdef _WIN32 | ||
31 | # ifdef EFL_EVAS_BUILD | ||
32 | # ifdef DLL_EXPORT | ||
33 | # define EAPI __declspec(dllexport) | ||
34 | # else | ||
35 | # define EAPI | ||
36 | # endif /* ! DLL_EXPORT */ | ||
37 | # else | ||
38 | # define EAPI __declspec(dllimport) | ||
39 | # endif /* ! EFL_EVAS_BUILD */ | ||
40 | #else | ||
41 | # ifdef __GNUC__ | ||
42 | # if __GNUC__ >= 4 | ||
43 | # define EAPI __attribute__ ((visibility("default"))) | ||
44 | # else | ||
45 | # define EAPI | ||
46 | # endif | ||
47 | # else | ||
48 | # define EAPI | ||
49 | # endif | ||
50 | #endif /* ! _WIN32 */ | ||
51 | |||
52 | #define LENGTH_OF_SOCKADDR_UN(s) (strlen((s)->sun_path) + (size_t)(((struct sockaddr_un *)NULL)->sun_path)) | ||
53 | |||
54 | typedef struct _Server Server; | ||
55 | typedef struct _Client Client; | ||
56 | typedef struct _Mem Mem; | ||
57 | |||
58 | struct _Server | ||
59 | { | ||
60 | char *socket_path; | ||
61 | Eina_List *clients; | ||
62 | int (*func) (void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *data); | ||
63 | void *data; | ||
64 | pid_t pid; | ||
65 | int server_id; | ||
66 | // for channel 2; | ||
67 | struct { | ||
68 | int fd; | ||
69 | int req_from, req_to; | ||
70 | } ch[2]; | ||
71 | void *main_handle; | ||
72 | }; | ||
73 | |||
74 | struct _Client | ||
75 | { | ||
76 | Server *server; | ||
77 | unsigned char *buf; | ||
78 | Client *client_main; | ||
79 | int bufsize, bufalloc; | ||
80 | int fd; | ||
81 | unsigned char *inbuf; | ||
82 | int inbufsize, inbufalloc; | ||
83 | unsigned char dead : 1; | ||
84 | void (*func) (void *fdata, Client *c); | ||
85 | void *data; | ||
86 | pid_t pid; | ||
87 | int req_from, req_to; | ||
88 | LK(lock); | ||
89 | }; | ||
90 | |||
91 | struct _Mem | ||
92 | { | ||
93 | unsigned char *data; | ||
94 | char *name; | ||
95 | int fd; | ||
96 | int id; | ||
97 | int offset; | ||
98 | int size; | ||
99 | int ref; | ||
100 | Eina_Bool write : 1; | ||
101 | }; | ||
102 | |||
103 | //// for comms | ||
104 | enum | ||
105 | { | ||
106 | OP_NOP, // 0 | ||
107 | |||
108 | OP_INIT, // 1 | ||
109 | OP_LOAD, // 2 | ||
110 | OP_UNLOAD, // 3 | ||
111 | OP_LOADDATA, // 4 | ||
112 | OP_UNLOADDATA, // 5 | ||
113 | OP_USELESSDATA, // 6 | ||
114 | OP_PRELOAD, // 7 | ||
115 | OP_FORCEDUNLOAD, // 8 | ||
116 | |||
117 | OP_GETCONFIG, // 9 | ||
118 | OP_SETCONFIG, // 10 | ||
119 | OP_GETSTATS, // 11 | ||
120 | OP_GETINFO, // 12 | ||
121 | |||
122 | OP_INVALID // 13 | ||
123 | }; | ||
124 | |||
125 | typedef struct | ||
126 | { | ||
127 | pid_t pid; | ||
128 | int server_id; | ||
129 | void *handle; | ||
130 | } Op_Init; | ||
131 | typedef struct | ||
132 | { | ||
133 | struct { | ||
134 | int scale_down_by; | ||
135 | double dpi; | ||
136 | int w, h; | ||
137 | struct { | ||
138 | int x, y, w, h; | ||
139 | } region; | ||
140 | Eina_Bool orientation; | ||
141 | } lopt; | ||
142 | } Op_Load; // +"file""key" | ||
143 | typedef struct | ||
144 | { | ||
145 | void *handle; | ||
146 | int server_id; | ||
147 | struct { | ||
148 | int id; | ||
149 | int offset; | ||
150 | int size; | ||
151 | } mem; | ||
152 | struct { | ||
153 | int w, h; | ||
154 | Eina_Bool alpha : 1; | ||
155 | } image; | ||
156 | } Op_Load_Reply; | ||
157 | typedef struct | ||
158 | { | ||
159 | void *handle; | ||
160 | int server_id; | ||
161 | } Op_Unload; | ||
162 | typedef struct | ||
163 | { | ||
164 | void *handle; | ||
165 | int server_id; | ||
166 | } Op_Unloaddata; | ||
167 | typedef struct | ||
168 | { | ||
169 | void *handle; | ||
170 | int server_id; | ||
171 | } Op_Loaddata; | ||
172 | typedef struct | ||
173 | { | ||
174 | struct { | ||
175 | int id; | ||
176 | int offset; | ||
177 | int size; | ||
178 | } mem; | ||
179 | } Op_Loaddata_Reply; | ||
180 | typedef struct | ||
181 | { | ||
182 | void *handle; | ||
183 | int server_id; | ||
184 | } Op_Preload; | ||
185 | typedef struct | ||
186 | { | ||
187 | void *handle; | ||
188 | struct { | ||
189 | int id; | ||
190 | int offset; | ||
191 | int size; | ||
192 | } mem; | ||
193 | } Op_Preload_Reply; | ||
194 | typedef struct | ||
195 | { | ||
196 | void *handle; | ||
197 | int server_id; | ||
198 | } Op_Forcedunload; | ||
199 | typedef struct | ||
200 | { | ||
201 | int cache_max_usage; | ||
202 | int cache_item_timeout; | ||
203 | int cache_item_timeout_check; | ||
204 | } Op_Getconfig_Reply; | ||
205 | typedef struct | ||
206 | { | ||
207 | int cache_max_usage; | ||
208 | int cache_item_timeout; | ||
209 | int cache_item_timeout_check; | ||
210 | } Op_Setconfig; | ||
211 | typedef struct | ||
212 | { | ||
213 | int saved_memory; | ||
214 | int wasted_memory; | ||
215 | int saved_memory_peak; | ||
216 | int wasted_memory_peak; | ||
217 | double saved_time_image_header_load; | ||
218 | double saved_time_image_data_load; | ||
219 | } Op_Getstats_Reply; | ||
220 | typedef struct | ||
221 | { | ||
222 | struct { | ||
223 | int mem_total; | ||
224 | int count; | ||
225 | } active, cached; | ||
226 | } Op_Getinfo_Reply; // + N active Info Items + N cached items | ||
227 | typedef struct | ||
228 | { | ||
229 | int file_key_size; | ||
230 | int w, h; | ||
231 | time_t file_mod_time; | ||
232 | time_t file_checked_time; | ||
233 | time_t cached_time; | ||
234 | int refcount; | ||
235 | int data_refcount; | ||
236 | int memory_footprint; | ||
237 | double head_load_time; | ||
238 | double data_load_time; | ||
239 | Eina_Bool alpha : 1; | ||
240 | Eina_Bool data_loaded : 1; | ||
241 | Eina_Bool active : 1; | ||
242 | Eina_Bool dead : 1; | ||
243 | Eina_Bool useless : 1; | ||
244 | } Op_Getinfo_Item; // + "file""key" | ||
245 | |||
246 | |||
247 | // for clients to connect to cserve | ||
248 | EAPI Eina_Bool evas_cserve_init(void); | ||
249 | EAPI int evas_cserve_use_get(void); | ||
250 | EAPI Eina_Bool evas_cserve_have_get(void); | ||
251 | EAPI void evas_cserve_shutdown(void); | ||
252 | EAPI void evas_cserve_discon(void); | ||
253 | EAPI Eina_Bool evas_cserve_image_load(Image_Entry *ie, const char *file, const char *key, RGBA_Image_Loadopts *lopt); | ||
254 | EAPI Eina_Bool evas_cserve_image_data_load(Image_Entry *ie); | ||
255 | EAPI void evas_cserve_image_unload(Image_Entry *ie); | ||
256 | EAPI void evas_cserve_image_useless(Image_Entry *ie); | ||
257 | EAPI void evas_cserve_image_free(Image_Entry *ie); | ||
258 | EAPI Eina_Bool evas_cserve_raw_config_get(Op_Getconfig_Reply *config); | ||
259 | EAPI Eina_Bool evas_cserve_raw_config_set(Op_Setconfig *config); | ||
260 | EAPI Eina_Bool evas_cserve_raw_stats_get(Op_Getstats_Reply *stats); | ||
261 | EAPI Op_Getinfo_Reply *evas_cserve_raw_info_get(void); | ||
262 | |||
263 | // for the server | ||
264 | EAPI Server *evas_cserve_server_add(void); | ||
265 | EAPI void evas_cserve_server_del(Server *s); | ||
266 | EAPI void evas_cserve_client_send(Client *c, int opcode, int size, unsigned char *data); | ||
267 | EAPI void evas_cserve_server_message_handler_set(Server *s, int (*func) (void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *data), void *data); | ||
268 | EAPI void evas_cserve_server_wait(Server *s, int timeout); | ||
269 | |||
270 | //// for memory | ||
271 | // for server | ||
272 | EAPI Mem *evas_cserve_mem_new(int size, const char *name); | ||
273 | EAPI void evas_cserve_mem_free(Mem *m); | ||
274 | |||
275 | // for client | ||
276 | EAPI Mem *evas_cserve_mem_open(int pid, int id, const char *name, int size, int do_write); | ||
277 | EAPI void evas_cserve_mem_close(Mem *m); | ||
278 | |||
279 | // for both | ||
280 | EAPI Eina_Bool evas_cserve_mem_resize(Mem *m, int size); | ||
281 | EAPI void evas_cserve_mem_del(int pid, int id); | ||
282 | |||
283 | #endif | ||
284 | |||
285 | #endif | ||
diff --git a/libraries/evas/src/lib/cserve/evas_cs_client.c b/libraries/evas/src/lib/cserve/evas_cs_client.c new file mode 100644 index 0000000..b24848d --- /dev/null +++ b/libraries/evas/src/lib/cserve/evas_cs_client.c | |||
@@ -0,0 +1,528 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include "config.h" | ||
3 | #endif | ||
4 | |||
5 | #include <signal.h> | ||
6 | |||
7 | #include "evas_cs.h" | ||
8 | |||
9 | #ifdef EVAS_CSERVE | ||
10 | |||
11 | static Server *cserve = NULL; | ||
12 | static int csrve_init = 0; | ||
13 | static int connect_num = 0; | ||
14 | static int cserve_discon = 0; | ||
15 | |||
16 | static void | ||
17 | pipe_handler(int x __UNUSED__, siginfo_t *info __UNUSED__, void *data __UNUSED__) | ||
18 | { | ||
19 | } | ||
20 | |||
21 | static void | ||
22 | pipe_handle(int push) | ||
23 | { | ||
24 | static struct sigaction old_action; | ||
25 | struct sigaction action; | ||
26 | |||
27 | if (push) | ||
28 | { | ||
29 | action.sa_handler = NULL; | ||
30 | action.sa_sigaction = pipe_handler; | ||
31 | action.sa_flags = SA_RESTART | SA_SIGINFO; | ||
32 | sigemptyset(&action.sa_mask); | ||
33 | sigaction(SIGPIPE, &action, &old_action); | ||
34 | } | ||
35 | else | ||
36 | { | ||
37 | sigaction(SIGPIPE, &old_action, &action); | ||
38 | } | ||
39 | } | ||
40 | |||
41 | static Server * | ||
42 | server_connect(void) | ||
43 | { | ||
44 | Server *s; | ||
45 | char buf[PATH_MAX]; | ||
46 | int curstate = 0; | ||
47 | struct sockaddr_un socket_unix; | ||
48 | int socket_unix_len; | ||
49 | |||
50 | s = calloc(1, sizeof(Server)); | ||
51 | if (!s) return NULL; | ||
52 | s->ch[0].fd = -1; | ||
53 | s->ch[1].fd = -1; | ||
54 | snprintf(buf, sizeof(buf), "/tmp/.evas-cserve-%x", getuid()); | ||
55 | s->socket_path = strdup(buf); | ||
56 | if (!s->socket_path) | ||
57 | { | ||
58 | free(s); | ||
59 | return NULL; | ||
60 | } | ||
61 | s->ch[0].fd = socket(AF_UNIX, SOCK_STREAM, 0); | ||
62 | if (s->ch[0].fd < 0) goto error; | ||
63 | if (fcntl(s->ch[0].fd, F_SETFD, FD_CLOEXEC) < 0) goto error; | ||
64 | if (setsockopt(s->ch[0].fd, SOL_SOCKET, SO_REUSEADDR, &curstate, sizeof(curstate)) < 0) | ||
65 | goto error; | ||
66 | socket_unix.sun_family = AF_UNIX; | ||
67 | strncpy(socket_unix.sun_path, buf, sizeof(socket_unix.sun_path)); | ||
68 | socket_unix_len = LENGTH_OF_SOCKADDR_UN(&socket_unix); | ||
69 | if (connect(s->ch[0].fd, (struct sockaddr *)&socket_unix, socket_unix_len) < 0) goto error; | ||
70 | |||
71 | s->ch[1].fd = socket(AF_UNIX, SOCK_STREAM, 0); | ||
72 | if (s->ch[1].fd < 0) goto error; | ||
73 | if (fcntl(s->ch[1].fd, F_SETFD, FD_CLOEXEC) < 0) goto error; | ||
74 | if (setsockopt(s->ch[1].fd, SOL_SOCKET, SO_REUSEADDR, &curstate, sizeof(curstate)) < 0) | ||
75 | goto error; | ||
76 | socket_unix.sun_family = AF_UNIX; | ||
77 | strncpy(socket_unix.sun_path, buf, sizeof(socket_unix.sun_path)); | ||
78 | socket_unix_len = LENGTH_OF_SOCKADDR_UN(&socket_unix); | ||
79 | if (connect(s->ch[1].fd, (struct sockaddr *)&socket_unix, socket_unix_len) < 0) goto error; | ||
80 | |||
81 | return s; | ||
82 | error: | ||
83 | if (s->ch[0].fd >= 0) close(s->ch[0].fd); | ||
84 | if (s->ch[1].fd >= 0) close(s->ch[1].fd); | ||
85 | free(s->socket_path); | ||
86 | free(s); | ||
87 | return NULL; | ||
88 | } | ||
89 | |||
90 | static void | ||
91 | server_disconnect(Server *s) | ||
92 | { | ||
93 | close(s->ch[0].fd); | ||
94 | close(s->ch[1].fd); | ||
95 | free(s->socket_path); | ||
96 | free(s); | ||
97 | } | ||
98 | |||
99 | static int | ||
100 | server_send(Server *s, int channel, int opcode, int size, unsigned char *data) | ||
101 | { | ||
102 | int ints[3]; | ||
103 | int num; | ||
104 | |||
105 | pipe_handle(1); | ||
106 | ints[0] = size; | ||
107 | ints[1] = opcode; | ||
108 | s->ch[channel].req_to++; | ||
109 | ints[2] = s->ch[channel].req_to; | ||
110 | num = write(s->ch[channel].fd, ints, (sizeof(int) * 3)); | ||
111 | if (num < 0) | ||
112 | { | ||
113 | pipe_handle(0); | ||
114 | if (cserve) server_disconnect(cserve); | ||
115 | cserve = NULL; | ||
116 | return 0; | ||
117 | } | ||
118 | num = write(s->ch[channel].fd, data, size); | ||
119 | if (num < 0) | ||
120 | { | ||
121 | pipe_handle(0); | ||
122 | if (cserve) server_disconnect(cserve); | ||
123 | cserve = NULL; | ||
124 | return 0; | ||
125 | } | ||
126 | pipe_handle(0); | ||
127 | return 1; | ||
128 | } | ||
129 | |||
130 | static unsigned char * | ||
131 | server_read(Server *s, int channel, int *opcode, int *size) | ||
132 | { | ||
133 | int ints[3], num, left; | ||
134 | unsigned char *data; | ||
135 | |||
136 | num = read(s->ch[channel].fd, ints, sizeof(int) * 3); | ||
137 | if (num != (sizeof(int) * 3)) | ||
138 | { | ||
139 | if (cserve) server_disconnect(cserve); | ||
140 | cserve = NULL; | ||
141 | return NULL; | ||
142 | } | ||
143 | *size = ints[0]; | ||
144 | *opcode = ints[1]; | ||
145 | if ((*size < 0) || (*size > (1024 * 1024))) return NULL; | ||
146 | if (ints[2] != (s->ch[channel].req_from + 1)) | ||
147 | { | ||
148 | ERR("EEK! sequence number mismatch from serer with pid: %i. " | ||
149 | "---- num %i is not 1 more than %i" | ||
150 | , | ||
151 | s->pid, ints[2], s->ch[channel].req_from); | ||
152 | return NULL; | ||
153 | } | ||
154 | s->ch[channel].req_from++; | ||
155 | data = malloc(*size); | ||
156 | if (!data) return NULL; | ||
157 | num = read(s->ch[channel].fd, data, *size); | ||
158 | if (num < 0) | ||
159 | { | ||
160 | free(data); | ||
161 | return NULL; | ||
162 | } | ||
163 | left = *size - num; | ||
164 | while (left > 0) | ||
165 | { | ||
166 | num = read(s->ch[channel].fd, data + (*size - left), left); | ||
167 | if (num < 0) | ||
168 | { | ||
169 | free(data); | ||
170 | return NULL; | ||
171 | } | ||
172 | left -= num; | ||
173 | } | ||
174 | return data; | ||
175 | } | ||
176 | |||
177 | static int | ||
178 | server_init(Server *s) | ||
179 | { | ||
180 | Op_Init msg, *rep; | ||
181 | int opcode; | ||
182 | int size; | ||
183 | |||
184 | msg.pid = getpid(); | ||
185 | msg.server_id = 0; | ||
186 | msg.handle = NULL; | ||
187 | if (!server_send(s, 0, OP_INIT, sizeof(msg), (unsigned char *)(&msg))) | ||
188 | return 0; | ||
189 | rep = (Op_Init *)server_read(s, 0, &opcode, &size); | ||
190 | if ((rep) && (opcode == OP_INIT) && (size == sizeof(Op_Init))) | ||
191 | { | ||
192 | s->pid = rep->pid; | ||
193 | s->server_id = rep->server_id; | ||
194 | s->main_handle = rep->handle; | ||
195 | connect_num++; | ||
196 | msg.pid = getpid(); | ||
197 | msg.server_id = 1; | ||
198 | msg.handle = rep->handle; | ||
199 | free(rep); | ||
200 | if (!server_send(s, 1, OP_INIT, sizeof(msg), (unsigned char *)(&msg))) | ||
201 | return 0; | ||
202 | rep = (Op_Init *)server_read(s, 1, &opcode, &size); | ||
203 | if ((rep) && (opcode == OP_INIT) && (size == sizeof(Op_Init))) | ||
204 | { | ||
205 | free(rep); | ||
206 | return 1; | ||
207 | } | ||
208 | if (rep) free(rep); | ||
209 | return 0; | ||
210 | } | ||
211 | if (rep) free(rep); | ||
212 | return 0; | ||
213 | } | ||
214 | |||
215 | EAPI Eina_Bool | ||
216 | evas_cserve_init(void) | ||
217 | { | ||
218 | csrve_init++; | ||
219 | if (cserve) return 1; | ||
220 | cserve = server_connect(); | ||
221 | if (!cserve) return 0; | ||
222 | if (!server_init(cserve)) | ||
223 | { | ||
224 | if (cserve) server_disconnect(cserve); | ||
225 | cserve = NULL; | ||
226 | return 0; | ||
227 | } | ||
228 | return 1; | ||
229 | } | ||
230 | |||
231 | EAPI int | ||
232 | evas_cserve_use_get(void) | ||
233 | { | ||
234 | return csrve_init; | ||
235 | } | ||
236 | |||
237 | EAPI Eina_Bool | ||
238 | evas_cserve_have_get(void) | ||
239 | { | ||
240 | if (cserve) return 1; | ||
241 | return 0; | ||
242 | } | ||
243 | |||
244 | EAPI void | ||
245 | evas_cserve_shutdown(void) | ||
246 | { | ||
247 | csrve_init--; | ||
248 | if (csrve_init > 0) return; | ||
249 | if (!cserve) return; | ||
250 | server_disconnect(cserve); | ||
251 | cserve = NULL; | ||
252 | } | ||
253 | |||
254 | EAPI void | ||
255 | evas_cserve_discon(void) | ||
256 | { | ||
257 | if (cserve) | ||
258 | { | ||
259 | server_disconnect(cserve); | ||
260 | cserve = NULL; | ||
261 | cserve_discon = 1; | ||
262 | } | ||
263 | } | ||
264 | |||
265 | static void | ||
266 | server_reinit(void) | ||
267 | { | ||
268 | if (cserve) return; | ||
269 | if (cserve_discon) return; | ||
270 | cserve = server_connect(); | ||
271 | if (cserve) | ||
272 | { | ||
273 | if (!server_init(cserve)) | ||
274 | { | ||
275 | if (cserve) server_disconnect(cserve); | ||
276 | cserve = NULL; | ||
277 | } | ||
278 | } | ||
279 | } | ||
280 | |||
281 | EAPI Eina_Bool | ||
282 | evas_cserve_image_load(Image_Entry *ie, const char *file, const char *key, RGBA_Image_Loadopts *lopt) | ||
283 | { | ||
284 | Op_Load msg; | ||
285 | Op_Load_Reply *rep; | ||
286 | unsigned char *buf; | ||
287 | char fbuf[PATH_MAX], wdb[PATH_MAX]; | ||
288 | int flen, klen; | ||
289 | int opcode; | ||
290 | int size; | ||
291 | |||
292 | if (csrve_init > 0) server_reinit(); | ||
293 | else return 0; | ||
294 | if (!cserve) return 0; | ||
295 | if (!key) key = ""; | ||
296 | memset(&msg, 0, sizeof(msg)); | ||
297 | msg.lopt.scale_down_by = lopt->scale_down_by; | ||
298 | msg.lopt.dpi = lopt->dpi; | ||
299 | msg.lopt.w = lopt->w; | ||
300 | msg.lopt.h = lopt->h; | ||
301 | msg.lopt.region.x = lopt->region.x; | ||
302 | msg.lopt.region.y = lopt->region.y; | ||
303 | msg.lopt.region.w = lopt->region.w; | ||
304 | msg.lopt.region.h = lopt->region.h; | ||
305 | msg.lopt.orientation = lopt->orientation; | ||
306 | if (file[0] != '/') | ||
307 | { | ||
308 | if (getcwd(wdb, sizeof(wdb))) | ||
309 | { | ||
310 | snprintf(fbuf, sizeof(buf), "%s/%s", wdb, file); | ||
311 | file = fbuf; | ||
312 | } | ||
313 | } | ||
314 | if (!realpath(file, wdb)) file = wdb; | ||
315 | flen = strlen(file) + 1; | ||
316 | klen = strlen(key) + 1; | ||
317 | buf = malloc(sizeof(msg) + flen + klen); | ||
318 | if (!buf) return 0; | ||
319 | memcpy(buf, &msg, sizeof(msg)); | ||
320 | memcpy(buf + sizeof(msg), file, flen); | ||
321 | memcpy(buf + sizeof(msg) + flen, key, klen); | ||
322 | if (!server_send(cserve, ie->channel, OP_LOAD, | ||
323 | sizeof(msg) + flen + klen, | ||
324 | buf)) | ||
325 | { | ||
326 | free(buf); | ||
327 | return 0; | ||
328 | } | ||
329 | free(buf); | ||
330 | if (!cserve) return 0; | ||
331 | rep = (Op_Load_Reply *)server_read(cserve, ie->channel, &opcode, &size); | ||
332 | if ((rep) && (opcode == OP_LOAD) && (size == sizeof(Op_Load_Reply))) | ||
333 | { | ||
334 | ie->w = rep->image.w; | ||
335 | ie->h = rep->image.h; | ||
336 | ie->flags.alpha = rep->image.alpha; | ||
337 | ie->data1 = rep->handle; | ||
338 | } | ||
339 | if (rep) free(rep); | ||
340 | if (!ie->data1) return 0; | ||
341 | ie->connect_num = connect_num; | ||
342 | if (cserve) | ||
343 | ie->server_id = cserve->server_id; | ||
344 | return 1; | ||
345 | } | ||
346 | |||
347 | EAPI Eina_Bool | ||
348 | evas_cserve_image_data_load(Image_Entry *ie) | ||
349 | { | ||
350 | Op_Loaddata msg; | ||
351 | Op_Loaddata_Reply *rep; | ||
352 | int opcode; | ||
353 | int size; | ||
354 | if (csrve_init > 0) server_reinit(); | ||
355 | else return 0; | ||
356 | if (!cserve) return 0; | ||
357 | if (!ie->data1) return 0; | ||
358 | if (cserve->server_id != ie->server_id) | ||
359 | { | ||
360 | ie->data1 = NULL; | ||
361 | if (!evas_cserve_image_load(ie, ie->file, ie->key, &(ie->load_opts))) | ||
362 | return 0; | ||
363 | } | ||
364 | if (ie->connect_num != connect_num) return 0; | ||
365 | memset(&msg, 0, sizeof(msg)); | ||
366 | msg.handle = ie->data1; | ||
367 | msg.server_id = cserve->server_id; | ||
368 | if (!server_send(cserve, ie->channel, OP_LOADDATA, sizeof(msg), (unsigned char *)(&msg))) | ||
369 | return 0; | ||
370 | if (!cserve) return 0; | ||
371 | rep = (Op_Loaddata_Reply *)server_read(cserve, ie->channel, &opcode, &size); | ||
372 | if ((rep) && (opcode == OP_LOADDATA) && (size == sizeof(Op_Loaddata_Reply))) | ||
373 | { | ||
374 | if (rep->mem.size <= 0) | ||
375 | { | ||
376 | free(rep); | ||
377 | return 0; | ||
378 | } | ||
379 | ie->data2 = evas_cserve_mem_open(cserve->pid, rep->mem.id, NULL, rep->mem.size, 0); | ||
380 | free(rep); | ||
381 | return 1; | ||
382 | } | ||
383 | if (rep) free(rep); | ||
384 | return 0; | ||
385 | } | ||
386 | |||
387 | EAPI void | ||
388 | evas_cserve_image_free(Image_Entry *ie) | ||
389 | { | ||
390 | Op_Unload msg; | ||
391 | |||
392 | if (csrve_init > 0) server_reinit(); | ||
393 | else return; | ||
394 | if (!cserve) return; | ||
395 | if (!ie->data1) return; | ||
396 | memset(&msg, 0, sizeof(msg)); | ||
397 | msg.handle = ie->data1; | ||
398 | msg.server_id = cserve->server_id; | ||
399 | if (ie->data2) evas_cserve_image_unload(ie); | ||
400 | if (cserve) | ||
401 | { | ||
402 | if (ie->connect_num == connect_num) | ||
403 | { | ||
404 | if (ie->server_id == cserve->server_id) | ||
405 | server_send(cserve, ie->channel, OP_UNLOAD, sizeof(msg), (unsigned char *)(&msg)); | ||
406 | } | ||
407 | } | ||
408 | ie->data1 = NULL; | ||
409 | ie->data2 = NULL; | ||
410 | } | ||
411 | |||
412 | EAPI void | ||
413 | evas_cserve_image_unload(Image_Entry *ie) | ||
414 | { | ||
415 | Op_Unloaddata msg; | ||
416 | |||
417 | if (csrve_init > 0) server_reinit(); | ||
418 | else return; | ||
419 | if (!cserve) return; | ||
420 | if (!ie->data1) return; | ||
421 | if (ie->connect_num != connect_num) return; | ||
422 | memset(&msg, 0, sizeof(msg)); | ||
423 | msg.handle = ie->data1; | ||
424 | msg.server_id = cserve->server_id; | ||
425 | if (ie->data2) evas_cserve_mem_close(ie->data2); | ||
426 | ie->data2 = NULL; | ||
427 | if (ie->connect_num == connect_num) | ||
428 | { | ||
429 | if (ie->server_id == cserve->server_id) | ||
430 | server_send(cserve, ie->channel, OP_UNLOADDATA, sizeof(msg), (unsigned char *)(&msg)); | ||
431 | } | ||
432 | } | ||
433 | |||
434 | EAPI void | ||
435 | evas_cserve_image_useless(Image_Entry *ie) | ||
436 | { | ||
437 | Op_Unloaddata msg; | ||
438 | |||
439 | if (csrve_init > 0) server_reinit(); | ||
440 | else return; | ||
441 | if (!cserve) return; | ||
442 | if (!ie->data1) return; | ||
443 | if (ie->connect_num != connect_num) return; | ||
444 | memset(&msg, 0, sizeof(msg)); | ||
445 | msg.handle = ie->data1; | ||
446 | msg.server_id = cserve->server_id; | ||
447 | if (ie->data2) evas_cserve_mem_close(ie->data2); | ||
448 | ie->data2 = NULL; | ||
449 | if (ie->connect_num == connect_num) | ||
450 | { | ||
451 | if (ie->server_id == cserve->server_id) | ||
452 | server_send(cserve, ie->channel, OP_USELESSDATA, sizeof(msg), (unsigned char *)(&msg)); | ||
453 | } | ||
454 | } | ||
455 | |||
456 | EAPI Eina_Bool | ||
457 | evas_cserve_raw_config_get(Op_Getconfig_Reply *config) | ||
458 | { | ||
459 | Op_Getconfig_Reply *rep; | ||
460 | int opcode; | ||
461 | int size; | ||
462 | if (csrve_init > 0) server_reinit(); | ||
463 | else return 0; | ||
464 | if (!cserve) return 0; | ||
465 | if (!server_send(cserve, 0, OP_GETCONFIG, 0, NULL)) return 0; | ||
466 | rep = (Op_Getconfig_Reply *)server_read(cserve, 0, &opcode, &size); | ||
467 | if ((rep) && (opcode == OP_GETCONFIG) && (size == sizeof(Op_Getconfig_Reply))) | ||
468 | { | ||
469 | memcpy(config, rep, sizeof(Op_Getconfig_Reply)); | ||
470 | free(rep); | ||
471 | return 1; | ||
472 | } | ||
473 | if (rep) free(rep); | ||
474 | return 0; | ||
475 | } | ||
476 | |||
477 | EAPI Eina_Bool | ||
478 | evas_cserve_raw_config_set(Op_Setconfig *config) | ||
479 | { | ||
480 | if (csrve_init > 0) server_reinit(); | ||
481 | else return 0; | ||
482 | if (!cserve) return 0; | ||
483 | if (!server_send(cserve, 0, OP_SETCONFIG, sizeof(Op_Setconfig), (unsigned char *)config)) return 0; | ||
484 | return 1; | ||
485 | } | ||
486 | |||
487 | EAPI Eina_Bool | ||
488 | evas_cserve_raw_stats_get(Op_Getstats_Reply *stats) | ||
489 | { | ||
490 | Op_Getstats_Reply *rep; | ||
491 | int opcode; | ||
492 | int size; | ||
493 | if (csrve_init > 0) server_reinit(); | ||
494 | else return 0; | ||
495 | if (!cserve) return 0; | ||
496 | if (!server_send(cserve, 0, OP_GETSTATS, 0, NULL)) return 0; | ||
497 | rep = (Op_Getstats_Reply *)server_read(cserve, 0, &opcode, &size); | ||
498 | if ((rep) && (opcode == OP_GETSTATS) && (size == sizeof(Op_Getstats_Reply))) | ||
499 | { | ||
500 | memcpy(stats, rep, sizeof(Op_Getstats_Reply)); | ||
501 | free(rep); | ||
502 | return 1; | ||
503 | } | ||
504 | if (rep) free(rep); | ||
505 | return 0; | ||
506 | } | ||
507 | |||
508 | EAPI Op_Getinfo_Reply * | ||
509 | evas_cserve_raw_info_get(void) | ||
510 | { | ||
511 | Op_Getinfo_Reply *rep; | ||
512 | int opcode; | ||
513 | int size; | ||
514 | if (csrve_init > 0) server_reinit(); | ||
515 | else return NULL; | ||
516 | if (!cserve) return NULL; | ||
517 | if (!server_send(cserve, 0, OP_GETINFO, 0, NULL)) return NULL; | ||
518 | rep = (Op_Getinfo_Reply *)server_read(cserve, 0, &opcode, &size); | ||
519 | if ((rep) && (opcode == OP_GETINFO) && | ||
520 | (size >= (int)sizeof(Op_Getinfo_Reply))) | ||
521 | { | ||
522 | return rep; | ||
523 | } | ||
524 | if (rep) free(rep); | ||
525 | return NULL; | ||
526 | } | ||
527 | |||
528 | #endif | ||
diff --git a/libraries/evas/src/lib/cserve/evas_cs_main.c b/libraries/evas/src/lib/cserve/evas_cs_main.c new file mode 100644 index 0000000..e8282aa --- /dev/null +++ b/libraries/evas/src/lib/cserve/evas_cs_main.c | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include "config.h" | ||
3 | #endif | ||
4 | |||
5 | #include "evas_cs.h" | ||
6 | |||
7 | #ifdef EVAS_CSERVE | ||
8 | |||
9 | #endif | ||
diff --git a/libraries/evas/src/lib/cserve/evas_cs_mem.c b/libraries/evas/src/lib/cserve/evas_cs_mem.c new file mode 100644 index 0000000..15edf93 --- /dev/null +++ b/libraries/evas/src/lib/cserve/evas_cs_mem.c | |||
@@ -0,0 +1,168 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include "config.h" | ||
3 | #endif | ||
4 | |||
5 | #include "evas_cs.h" | ||
6 | |||
7 | #ifdef EVAS_CSERVE | ||
8 | |||
9 | EAPI Mem * | ||
10 | evas_cserve_mem_new(int size, const char *name) | ||
11 | { | ||
12 | Mem *m; | ||
13 | static int id = 0; | ||
14 | char buf[PATH_MAX]; | ||
15 | |||
16 | m = calloc(1, sizeof(Mem)); | ||
17 | if (!m) return NULL; | ||
18 | if (name) | ||
19 | snprintf(buf, sizeof(buf), "/evas-shm-%x.%s", getuid(), name); | ||
20 | else | ||
21 | { | ||
22 | id++; | ||
23 | snprintf(buf, sizeof(buf), "/evas-shm-%x.%x.%x", getuid(), getpid(), id); | ||
24 | } | ||
25 | m->id = id; | ||
26 | m->offset = 0; | ||
27 | m->name = strdup(buf); | ||
28 | if (!m->name) | ||
29 | { | ||
30 | free(m); | ||
31 | return NULL; | ||
32 | } | ||
33 | m->size = size; | ||
34 | m->fd = shm_open(m->name, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); | ||
35 | if (m->fd < 0) | ||
36 | { | ||
37 | free(m->name); | ||
38 | free(m); | ||
39 | return NULL; | ||
40 | } | ||
41 | if (ftruncate(m->fd, m->size) < 0) | ||
42 | { | ||
43 | shm_unlink(m->name); | ||
44 | close(m->fd); | ||
45 | free(m->name); | ||
46 | free(m); | ||
47 | return NULL; | ||
48 | } | ||
49 | |||
50 | eina_mmap_safety_enabled_set(EINA_TRUE); | ||
51 | |||
52 | m->data = mmap(NULL, m->size, PROT_READ | PROT_WRITE, MAP_SHARED, m->fd, 0); | ||
53 | if (m->data == MAP_FAILED) | ||
54 | { | ||
55 | shm_unlink(m->name); | ||
56 | close(m->fd); | ||
57 | free(m->name); | ||
58 | free(m); | ||
59 | return NULL; | ||
60 | } | ||
61 | m->ref = 1; | ||
62 | m->write = 1; | ||
63 | return m; | ||
64 | } | ||
65 | |||
66 | EAPI void | ||
67 | evas_cserve_mem_free(Mem *m) | ||
68 | { | ||
69 | shm_unlink(m->name); | ||
70 | munmap(m->data, m->size); | ||
71 | close(m->fd); | ||
72 | free(m->name); | ||
73 | free(m); | ||
74 | } | ||
75 | |||
76 | EAPI Mem * | ||
77 | evas_cserve_mem_open(int pid, int id, const char *name, int size, int do_write) | ||
78 | { | ||
79 | Mem *m; | ||
80 | char buf[PATH_MAX]; | ||
81 | |||
82 | m = calloc(1, sizeof(Mem)); | ||
83 | if (!m) return NULL; | ||
84 | if (name) | ||
85 | snprintf(buf, sizeof(buf), "/evas-shm-%x.%s", getuid(), name); | ||
86 | else | ||
87 | snprintf(buf, sizeof(buf), "/evas-shm-%x.%x.%x", getuid(), pid, id); | ||
88 | m->name = strdup(buf); | ||
89 | if (!m->name) | ||
90 | { | ||
91 | free(m); | ||
92 | return NULL; | ||
93 | } | ||
94 | m->size = size; | ||
95 | if (do_write) | ||
96 | m->fd = shm_open(m->name, O_RDWR, S_IRUSR | S_IWUSR); | ||
97 | else | ||
98 | m->fd = shm_open(m->name, O_RDONLY, S_IRUSR); | ||
99 | if (m->fd < 0) | ||
100 | { | ||
101 | free(m->name); | ||
102 | free(m); | ||
103 | return NULL; | ||
104 | } | ||
105 | m->write = do_write; | ||
106 | |||
107 | eina_mmap_safety_enabled_set(EINA_TRUE); | ||
108 | |||
109 | if (do_write) | ||
110 | m->data = mmap(NULL, m->size, PROT_READ | PROT_WRITE, MAP_SHARED, m->fd, 0); | ||
111 | else | ||
112 | m->data = mmap(NULL, m->size, PROT_READ, MAP_SHARED, m->fd, 0); | ||
113 | if (m->data == MAP_FAILED) | ||
114 | { | ||
115 | close(m->fd); | ||
116 | free(m->name); | ||
117 | free(m); | ||
118 | return NULL; | ||
119 | } | ||
120 | m->ref = 1; | ||
121 | return m; | ||
122 | } | ||
123 | |||
124 | EAPI void | ||
125 | evas_cserve_mem_close(Mem *m) | ||
126 | { | ||
127 | munmap(m->data, m->size); | ||
128 | close(m->fd); | ||
129 | free(m->name); | ||
130 | free(m); | ||
131 | } | ||
132 | |||
133 | EAPI Eina_Bool | ||
134 | evas_cserve_mem_resize(Mem *m, int size) | ||
135 | { | ||
136 | if (m->size == size) return 1; | ||
137 | if (m->write) | ||
138 | { | ||
139 | if (ftruncate(m->fd, size) < 0) return 0; | ||
140 | munmap(m->data, m->size); | ||
141 | eina_mmap_safety_enabled_set(EINA_TRUE); | ||
142 | m->data = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, m->fd, 0); | ||
143 | } | ||
144 | else | ||
145 | { | ||
146 | munmap(m->data, m->size); | ||
147 | eina_mmap_safety_enabled_set(EINA_TRUE); | ||
148 | m->data = mmap(NULL, size, PROT_READ, MAP_SHARED, m->fd, 0); | ||
149 | } | ||
150 | if (m->data == MAP_FAILED) | ||
151 | { | ||
152 | m->data = NULL; | ||
153 | return 0; | ||
154 | } | ||
155 | m->size = size; | ||
156 | return 1; | ||
157 | } | ||
158 | |||
159 | EAPI void | ||
160 | evas_cserve_mem_del(int pid, int id) | ||
161 | { | ||
162 | char buf[PATH_MAX]; | ||
163 | |||
164 | snprintf(buf, sizeof(buf), "/evas-shm-%x.%x.%x", getuid(), pid, id); | ||
165 | shm_unlink(buf); | ||
166 | } | ||
167 | |||
168 | #endif | ||
diff --git a/libraries/evas/src/lib/cserve/evas_cs_server.c b/libraries/evas/src/lib/cserve/evas_cs_server.c new file mode 100644 index 0000000..3b5d8b9 --- /dev/null +++ b/libraries/evas/src/lib/cserve/evas_cs_server.c | |||
@@ -0,0 +1,380 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include "config.h" | ||
3 | #endif | ||
4 | |||
5 | #include "evas_cs.h" | ||
6 | |||
7 | #ifdef EVAS_CSERVE | ||
8 | |||
9 | EAPI Server * | ||
10 | evas_cserve_server_add(void) | ||
11 | { | ||
12 | Server *s; | ||
13 | char buf[PATH_MAX]; | ||
14 | struct sockaddr_un socket_unix; | ||
15 | struct linger lin; | ||
16 | mode_t pmode; | ||
17 | int socket_unix_len; | ||
18 | |||
19 | s = calloc(1, sizeof(Server)); | ||
20 | if (!s) return NULL; | ||
21 | s->ch[0].fd = -1; | ||
22 | snprintf(buf, sizeof(buf), "/tmp/.evas-cserve-%x", getuid()); | ||
23 | s->socket_path = strdup(buf); | ||
24 | if (!s->socket_path) | ||
25 | { | ||
26 | free(s); | ||
27 | return NULL; | ||
28 | } | ||
29 | pmode = umask(~(S_IRUSR | S_IWUSR)); | ||
30 | start: | ||
31 | s->ch[0].fd = socket(AF_UNIX, SOCK_STREAM, 0); | ||
32 | if (s->ch[0].fd < 0) goto error; | ||
33 | if (fcntl(s->ch[0].fd, F_SETFL, O_NONBLOCK) < 0) goto error; | ||
34 | if (fcntl(s->ch[0].fd, F_SETFD, FD_CLOEXEC) < 0) goto error; | ||
35 | lin.l_onoff = 1; | ||
36 | lin.l_linger = 0; | ||
37 | if (setsockopt(s->ch[0].fd, SOL_SOCKET, SO_LINGER, &lin, sizeof(struct linger)) < 0) | ||
38 | goto error; | ||
39 | socket_unix.sun_family = AF_UNIX; | ||
40 | strncpy(socket_unix.sun_path, buf, sizeof(socket_unix.sun_path)); | ||
41 | socket_unix_len = LENGTH_OF_SOCKADDR_UN(&socket_unix); | ||
42 | if (bind(s->ch[0].fd, (struct sockaddr *)&socket_unix, socket_unix_len) < 0) | ||
43 | { | ||
44 | if ((connect(s->ch[0].fd, (struct sockaddr *)&socket_unix, socket_unix_len) < 0) && | ||
45 | (unlink(s->socket_path) >= 0)) | ||
46 | { | ||
47 | close(s->ch[0].fd); | ||
48 | goto start; | ||
49 | } | ||
50 | else | ||
51 | goto error; | ||
52 | } | ||
53 | if (listen(s->ch[0].fd, 4096) < 0) goto error; | ||
54 | umask(pmode); | ||
55 | return s; | ||
56 | error: | ||
57 | umask(pmode); | ||
58 | if (s->ch[0].fd >= 0) close(s->ch[0].fd); | ||
59 | free(s->socket_path); | ||
60 | free(s); | ||
61 | return NULL; | ||
62 | } | ||
63 | |||
64 | EAPI void | ||
65 | evas_cserve_server_del(Server *s) | ||
66 | { | ||
67 | Client *c; | ||
68 | |||
69 | EINA_LIST_FREE(s->clients, c) | ||
70 | { | ||
71 | LKL(c->lock); | ||
72 | close(c->fd); | ||
73 | if (c->buf) free(c->buf); | ||
74 | if (c->inbuf) free(c->inbuf); | ||
75 | LKD(c->lock); | ||
76 | free(c); | ||
77 | } | ||
78 | close(s->ch[0].fd); | ||
79 | unlink(s->socket_path); | ||
80 | free(s->socket_path); | ||
81 | free(s); | ||
82 | } | ||
83 | |||
84 | static void | ||
85 | server_accept(Server *s) | ||
86 | { | ||
87 | Client *c; | ||
88 | int new_fd; | ||
89 | struct sockaddr_in incoming; | ||
90 | size_t size_in; | ||
91 | |||
92 | size_in = sizeof(struct sockaddr_in); | ||
93 | new_fd = accept(s->ch[0].fd, (struct sockaddr *)&incoming, (socklen_t *)&size_in); | ||
94 | if (new_fd < 0) return; | ||
95 | fcntl(new_fd, F_SETFL, O_NONBLOCK); | ||
96 | fcntl(new_fd, F_SETFD, FD_CLOEXEC); | ||
97 | c = calloc(1, sizeof(Client)); | ||
98 | if (!c) | ||
99 | { | ||
100 | close(new_fd); | ||
101 | return; | ||
102 | } | ||
103 | c->server = s; | ||
104 | c->fd = new_fd; | ||
105 | LKI(c->lock); | ||
106 | s->clients = eina_list_append(s->clients, c); | ||
107 | } | ||
108 | |||
109 | static void | ||
110 | client_flush(Client *c) | ||
111 | { | ||
112 | int num; | ||
113 | |||
114 | num = write(c->fd, c->buf, c->bufsize); | ||
115 | if (num < 0) | ||
116 | { | ||
117 | c->dead = 1; | ||
118 | return; | ||
119 | } | ||
120 | if (num < c->bufsize) | ||
121 | { | ||
122 | unsigned char *buf; | ||
123 | |||
124 | buf = malloc(c->bufsize - num); | ||
125 | if (buf) | ||
126 | { | ||
127 | memcpy(buf, c->buf + num, c->bufsize - num); | ||
128 | free(c->buf); | ||
129 | c->bufsize = c->bufsize - num; | ||
130 | c->bufalloc = c->bufsize; | ||
131 | c->buf = buf; | ||
132 | } | ||
133 | } | ||
134 | else | ||
135 | { | ||
136 | free(c->buf); | ||
137 | c->buf = NULL; | ||
138 | c->bufsize = 0; | ||
139 | c->bufalloc = 0; | ||
140 | } | ||
141 | } | ||
142 | |||
143 | static void | ||
144 | client_buf_add(Client *c, unsigned char *data, int size) | ||
145 | { | ||
146 | int newsize; | ||
147 | unsigned char *buf; | ||
148 | |||
149 | newsize = c->bufsize + size; | ||
150 | if (newsize > c->bufalloc) | ||
151 | { | ||
152 | c->bufalloc = newsize + 16384; | ||
153 | buf = realloc(c->buf, c->bufalloc); | ||
154 | if (buf) c->buf = buf; | ||
155 | else return; | ||
156 | } | ||
157 | memcpy(c->buf + c->bufsize, data, size); | ||
158 | c->bufsize += size; | ||
159 | } | ||
160 | |||
161 | static void | ||
162 | client_write(Client *c, unsigned char *data, int size) | ||
163 | { | ||
164 | int num; | ||
165 | |||
166 | if (!c->buf) | ||
167 | { | ||
168 | num = write(c->fd, data, size); | ||
169 | if (num != size) | ||
170 | client_buf_add(c, data + num, size - num); | ||
171 | } | ||
172 | else | ||
173 | { | ||
174 | client_buf_add(c, data, size); | ||
175 | } | ||
176 | } | ||
177 | |||
178 | EAPI void | ||
179 | evas_cserve_client_send(Client *c, int opcode, int size, unsigned char *data) | ||
180 | { | ||
181 | unsigned char *data2; | ||
182 | int *ints; | ||
183 | |||
184 | data2 = malloc(size + (sizeof(int) * 3)); | ||
185 | if (!data2) return; | ||
186 | ints = (int *)data2; | ||
187 | ints[0] = size; | ||
188 | ints[1] = opcode; | ||
189 | // LKL(c->lock); | ||
190 | c->req_to++; | ||
191 | ints[2] = c->req_to; | ||
192 | memcpy(data2 + (sizeof(int) * 3), data, size); | ||
193 | client_write(c, data2, size + (sizeof(int) * 3)); | ||
194 | // LKU(c->lock); | ||
195 | free(data2); | ||
196 | } | ||
197 | |||
198 | static void | ||
199 | server_message_handle(Server *s, Client *c, int opcode, int size, unsigned char *data) | ||
200 | { | ||
201 | if (s->func) s->func(s->data, s, c, opcode, size, data); | ||
202 | } | ||
203 | |||
204 | EAPI void | ||
205 | evas_cserve_server_message_handler_set(Server *s, int (*func) (void *fdata, Server *s, Client *c, int opcode, int size, unsigned char *data), void *data) | ||
206 | { | ||
207 | s->func = func; | ||
208 | s->data = data; | ||
209 | } | ||
210 | |||
211 | static int | ||
212 | server_parse(Server *s, Client *c) | ||
213 | { | ||
214 | int *ints; | ||
215 | unsigned char *data, *newbuf; | ||
216 | |||
217 | if (c->inbufsize < (int)sizeof(int)) return 0; | ||
218 | ints = (int *)((c->inbuf)); | ||
219 | if ((ints[0] < 0) || (ints[0] > (1024 * 1024))) | ||
220 | return 0; | ||
221 | if (c->inbufsize < (ints[0] + ((int)sizeof(int) * 3))) | ||
222 | { | ||
223 | return 0; | ||
224 | } | ||
225 | data = c->inbuf + (sizeof(int) * 3); | ||
226 | if (ints[2] != (c->req_from + 1)) | ||
227 | { | ||
228 | ERR("EEK! sequence number mismatch from client with pid: %i." | ||
229 | "---- num %i is not 1 more than %i" | ||
230 | , | ||
231 | c->pid, ints[2], c->req_from); | ||
232 | return 0; | ||
233 | } | ||
234 | c->req_from++; | ||
235 | server_message_handle(s, c, ints[1], ints[0], data); | ||
236 | c->inbufalloc -= ints[0] + (sizeof(int) * 3); | ||
237 | if (c->inbufalloc == 0) | ||
238 | { | ||
239 | free(c->inbuf); | ||
240 | c->inbuf = NULL; | ||
241 | c->inbufsize = 0; | ||
242 | return 0; | ||
243 | } | ||
244 | newbuf = malloc(c->inbufalloc); | ||
245 | if (!newbuf) | ||
246 | { | ||
247 | c->inbufalloc += ints[0] + (sizeof(int) * 3); | ||
248 | /* fixme - bad situation */ | ||
249 | return 0; | ||
250 | } | ||
251 | memcpy(newbuf, c->inbuf + ints[0] + (sizeof(int) * 3), c->inbufalloc); | ||
252 | c->inbufsize -= ints[0] + (sizeof(int) * 3); | ||
253 | free(c->inbuf); | ||
254 | c->inbuf = newbuf; | ||
255 | return 1; | ||
256 | } | ||
257 | |||
258 | static void | ||
259 | server_data(Server *s, Client *c, unsigned char *data, int size) | ||
260 | { | ||
261 | if (!c->inbuf) | ||
262 | { | ||
263 | c->inbuf = malloc(size); | ||
264 | if (c->inbuf) | ||
265 | { | ||
266 | memcpy(c->inbuf, data, size); | ||
267 | c->inbufalloc = size; | ||
268 | c->inbufsize = size; | ||
269 | } | ||
270 | else | ||
271 | { | ||
272 | /* fixme - bad situation */ | ||
273 | return; | ||
274 | } | ||
275 | } | ||
276 | else | ||
277 | { | ||
278 | int size2; | ||
279 | |||
280 | size2 = c->inbufsize + size; | ||
281 | if (size2 > c->inbufalloc) | ||
282 | { | ||
283 | unsigned char *newbuf; | ||
284 | |||
285 | c->inbufalloc = size2; | ||
286 | newbuf = realloc(c->inbuf, c->inbufalloc); | ||
287 | if (newbuf) c->inbuf = newbuf; | ||
288 | else size2 = 0; | ||
289 | } | ||
290 | if (size2 > 0) | ||
291 | { | ||
292 | memcpy(c->inbuf + c->inbufsize, data, size); | ||
293 | c->inbufsize = size2; | ||
294 | } | ||
295 | else | ||
296 | { | ||
297 | /* fixme - bad situation */ | ||
298 | return; | ||
299 | } | ||
300 | } | ||
301 | while (server_parse(s, c)); | ||
302 | } | ||
303 | |||
304 | EAPI void | ||
305 | evas_cserve_server_wait(Server *s, int timeout) | ||
306 | { | ||
307 | fd_set rset, wset, xset; | ||
308 | int maxfd; | ||
309 | int ret; | ||
310 | struct timeval to; | ||
311 | Eina_List *l, *dead = NULL; | ||
312 | Client *c; | ||
313 | |||
314 | maxfd = 0; | ||
315 | FD_ZERO(&rset); | ||
316 | FD_ZERO(&wset); | ||
317 | FD_ZERO(&xset); | ||
318 | FD_SET(s->ch[0].fd, &rset); | ||
319 | if (s->ch[0].fd > maxfd) maxfd = s->ch[0].fd; | ||
320 | EINA_LIST_FOREACH(s->clients, l, c) | ||
321 | { | ||
322 | FD_SET(c->fd, &rset); | ||
323 | if (c->buf) | ||
324 | FD_SET(c->fd, &wset); | ||
325 | if (c->fd > maxfd) maxfd = c->fd; | ||
326 | } | ||
327 | if (timeout > 0) | ||
328 | { | ||
329 | to.tv_sec = timeout / 1000000; | ||
330 | to.tv_usec = timeout % 1000000; | ||
331 | ret = select(maxfd + 1, &rset, &wset, &xset, &to); | ||
332 | } | ||
333 | else | ||
334 | ret = select(maxfd + 1, &rset, &wset, &xset, NULL); | ||
335 | if (ret < 1) return; | ||
336 | |||
337 | EINA_LIST_FOREACH(s->clients, l, c) | ||
338 | { | ||
339 | if (c->dead) continue; | ||
340 | if (FD_ISSET(c->fd, &rset)) | ||
341 | { | ||
342 | unsigned char buf[16384]; | ||
343 | int num; | ||
344 | |||
345 | errno = 0; | ||
346 | num = read(c->fd, buf, sizeof(buf)); | ||
347 | if (num <= 0) | ||
348 | { | ||
349 | c->dead = 1; | ||
350 | dead = eina_list_append(dead, c); | ||
351 | } | ||
352 | else if (num > 0) | ||
353 | { | ||
354 | server_data(s, c, buf, num); | ||
355 | } | ||
356 | } | ||
357 | else if (FD_ISSET(c->fd, &wset)) | ||
358 | { | ||
359 | client_flush(c); | ||
360 | if (c->dead) dead = eina_list_append(dead, c); | ||
361 | } | ||
362 | } | ||
363 | if (FD_ISSET(s->ch[0].fd, &rset)) | ||
364 | { | ||
365 | server_accept(s); | ||
366 | } | ||
367 | EINA_LIST_FREE(dead, c) | ||
368 | { | ||
369 | LKL(c->lock); | ||
370 | if (c->func) c->func(c->data, c); | ||
371 | s->clients = eina_list_remove(s->clients, c); | ||
372 | close(c->fd); | ||
373 | if (c->buf) free(c->buf); | ||
374 | if (c->inbuf) free(c->inbuf); | ||
375 | LKD(c->lock); | ||
376 | free(c); | ||
377 | } | ||
378 | } | ||
379 | |||
380 | #endif | ||