diff options
author | David Walter Seikel | 2013-01-13 17:29:19 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 17:29:19 +1000 |
commit | 07274513e984f0b5544586c74508ccd16e7dcafa (patch) | |
tree | b32ff2a9136fbc1a4a6a0ed1e4d79cde0f5f16d9 /libraries/evas/src/bin | |
parent | Added Irrlicht 1.8, but without all the Windows binaries. (diff) | |
download | SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.zip SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.gz SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.bz2 SledjHamr-07274513e984f0b5544586c74508ccd16e7dcafa.tar.xz |
Remove EFL, since it's been released now.
Diffstat (limited to '')
-rw-r--r-- | libraries/evas/src/bin/Makefile.am | 41 | ||||
-rw-r--r-- | libraries/evas/src/bin/Makefile.in | 753 | ||||
-rw-r--r-- | libraries/evas/src/bin/evas_cserve_main.c | 1683 | ||||
-rw-r--r-- | libraries/evas/src/bin/evas_cserve_tool.c | 160 |
4 files changed, 0 insertions, 2637 deletions
diff --git a/libraries/evas/src/bin/Makefile.am b/libraries/evas/src/bin/Makefile.am deleted file mode 100644 index 7159eaa..0000000 --- a/libraries/evas/src/bin/Makefile.am +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | MAINTAINERCLEANFILES = Makefile.in | ||
2 | |||
3 | if EVAS_CSERVE | ||
4 | |||
5 | AM_CPPFLAGS = \ | ||
6 | -I. \ | ||
7 | -I$(top_srcdir)/src/lib \ | ||
8 | -I$(top_srcdir)/src/lib/include \ | ||
9 | -I$(top_srcdir)/src/lib/cserve \ | ||
10 | -DPACKAGE_BIN_DIR=\"$(bindir)\" \ | ||
11 | -DPACKAGE_LIB_DIR=\"$(libdir)\" \ | ||
12 | -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ | ||
13 | @EINA_CFLAGS@ \ | ||
14 | @FREETYPE_CFLAGS@ \ | ||
15 | @FRIBIDI_CFLAGS@ \ | ||
16 | @EET_CFLAGS@ \ | ||
17 | @FONTCONFIG_CFLAGS@ \ | ||
18 | @pthread_cflags@ \ | ||
19 | @PIXMAN_CFLAGS@ | ||
20 | |||
21 | bin_PROGRAMS = evas_cserve evas_cserve_tool | ||
22 | |||
23 | evas_cserve_SOURCES = \ | ||
24 | evas_cserve_main.c | ||
25 | |||
26 | evas_cserve_LDADD = \ | ||
27 | $(top_builddir)/src/lib/libevas.la \ | ||
28 | @pthread_libs@ \ | ||
29 | @EINA_LIBS@ | ||
30 | |||
31 | evas_cserve_tool_LDFLAGS = | ||
32 | |||
33 | evas_cserve_tool_SOURCES = \ | ||
34 | evas_cserve_tool.c | ||
35 | |||
36 | evas_cserve_tool_LDADD = \ | ||
37 | $(top_builddir)/src/lib/libevas.la \ | ||
38 | @pthread_libs@ \ | ||
39 | @EINA_LIBS@ | ||
40 | |||
41 | endif | ||
diff --git a/libraries/evas/src/bin/Makefile.in b/libraries/evas/src/bin/Makefile.in deleted file mode 100644 index 1a23abe..0000000 --- a/libraries/evas/src/bin/Makefile.in +++ /dev/null | |||
@@ -1,753 +0,0 @@ | |||
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 | @EVAS_CSERVE_TRUE@bin_PROGRAMS = evas_cserve$(EXEEXT) \ | ||
38 | @EVAS_CSERVE_TRUE@ evas_cserve_tool$(EXEEXT) | ||
39 | subdir = src/bin | ||
40 | DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in | ||
41 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||
42 | am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ | ||
43 | $(top_srcdir)/m4/efl_coverage.m4 \ | ||
44 | $(top_srcdir)/m4/efl_doxygen.m4 \ | ||
45 | $(top_srcdir)/m4/efl_fnmatch.m4 \ | ||
46 | $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ | ||
47 | $(top_srcdir)/m4/evas_check_engine.m4 \ | ||
48 | $(top_srcdir)/m4/evas_check_loader.m4 \ | ||
49 | $(top_srcdir)/m4/evas_converter.m4 \ | ||
50 | $(top_srcdir)/m4/evas_dither.m4 \ | ||
51 | $(top_srcdir)/m4/evas_scaler.m4 $(top_srcdir)/m4/libtool.m4 \ | ||
52 | $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ | ||
53 | $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ | ||
54 | $(top_srcdir)/configure.ac | ||
55 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||
56 | $(ACLOCAL_M4) | ||
57 | mkinstalldirs = $(install_sh) -d | ||
58 | CONFIG_HEADER = $(top_builddir)/config.h | ||
59 | CONFIG_CLEAN_FILES = | ||
60 | CONFIG_CLEAN_VPATH_FILES = | ||
61 | am__installdirs = "$(DESTDIR)$(bindir)" | ||
62 | PROGRAMS = $(bin_PROGRAMS) | ||
63 | am__evas_cserve_SOURCES_DIST = evas_cserve_main.c | ||
64 | @EVAS_CSERVE_TRUE@am_evas_cserve_OBJECTS = evas_cserve_main.$(OBJEXT) | ||
65 | evas_cserve_OBJECTS = $(am_evas_cserve_OBJECTS) | ||
66 | @EVAS_CSERVE_TRUE@evas_cserve_DEPENDENCIES = \ | ||
67 | @EVAS_CSERVE_TRUE@ $(top_builddir)/src/lib/libevas.la | ||
68 | AM_V_lt = $(am__v_lt_$(V)) | ||
69 | am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) | ||
70 | am__v_lt_0 = --silent | ||
71 | am__evas_cserve_tool_SOURCES_DIST = evas_cserve_tool.c | ||
72 | @EVAS_CSERVE_TRUE@am_evas_cserve_tool_OBJECTS = \ | ||
73 | @EVAS_CSERVE_TRUE@ evas_cserve_tool.$(OBJEXT) | ||
74 | evas_cserve_tool_OBJECTS = $(am_evas_cserve_tool_OBJECTS) | ||
75 | @EVAS_CSERVE_TRUE@evas_cserve_tool_DEPENDENCIES = \ | ||
76 | @EVAS_CSERVE_TRUE@ $(top_builddir)/src/lib/libevas.la | ||
77 | evas_cserve_tool_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ | ||
78 | $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ | ||
79 | $(AM_CFLAGS) $(CFLAGS) $(evas_cserve_tool_LDFLAGS) $(LDFLAGS) \ | ||
80 | -o $@ | ||
81 | DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) | ||
82 | depcomp = $(SHELL) $(top_srcdir)/depcomp | ||
83 | am__depfiles_maybe = depfiles | ||
84 | am__mv = mv -f | ||
85 | COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ | ||
86 | $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) | ||
87 | LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
88 | $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ | ||
89 | $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ | ||
90 | $(AM_CFLAGS) $(CFLAGS) | ||
91 | AM_V_CC = $(am__v_CC_$(V)) | ||
92 | am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) | ||
93 | am__v_CC_0 = @echo " CC " $@; | ||
94 | AM_V_at = $(am__v_at_$(V)) | ||
95 | am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) | ||
96 | am__v_at_0 = @ | ||
97 | CCLD = $(CC) | ||
98 | LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ | ||
99 | $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ | ||
100 | $(AM_LDFLAGS) $(LDFLAGS) -o $@ | ||
101 | AM_V_CCLD = $(am__v_CCLD_$(V)) | ||
102 | am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) | ||
103 | am__v_CCLD_0 = @echo " CCLD " $@; | ||
104 | AM_V_GEN = $(am__v_GEN_$(V)) | ||
105 | am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) | ||
106 | am__v_GEN_0 = @echo " GEN " $@; | ||
107 | SOURCES = $(evas_cserve_SOURCES) $(evas_cserve_tool_SOURCES) | ||
108 | DIST_SOURCES = $(am__evas_cserve_SOURCES_DIST) \ | ||
109 | $(am__evas_cserve_tool_SOURCES_DIST) | ||
110 | ETAGS = etags | ||
111 | CTAGS = ctags | ||
112 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
113 | ACLOCAL = @ACLOCAL@ | ||
114 | ALLOCA = @ALLOCA@ | ||
115 | AMTAR = @AMTAR@ | ||
116 | AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ | ||
117 | AR = @AR@ | ||
118 | AS = @AS@ | ||
119 | AUTOCONF = @AUTOCONF@ | ||
120 | AUTOHEADER = @AUTOHEADER@ | ||
121 | AUTOMAKE = @AUTOMAKE@ | ||
122 | AWK = @AWK@ | ||
123 | CC = @CC@ | ||
124 | CCDEPMODE = @CCDEPMODE@ | ||
125 | CFLAGS = @CFLAGS@ | ||
126 | CHECK_CFLAGS = @CHECK_CFLAGS@ | ||
127 | CHECK_LIBS = @CHECK_LIBS@ | ||
128 | CPP = @CPP@ | ||
129 | CPPFLAGS = @CPPFLAGS@ | ||
130 | CXX = @CXX@ | ||
131 | CXXCPP = @CXXCPP@ | ||
132 | CXXDEPMODE = @CXXDEPMODE@ | ||
133 | CXXFLAGS = @CXXFLAGS@ | ||
134 | CYGPATH_W = @CYGPATH_W@ | ||
135 | DEFS = @DEFS@ | ||
136 | DEPDIR = @DEPDIR@ | ||
137 | DIRECTFB_CFLAGS = @DIRECTFB_CFLAGS@ | ||
138 | DIRECTFB_LIBS = @DIRECTFB_LIBS@ | ||
139 | DLLTOOL = @DLLTOOL@ | ||
140 | DSYMUTIL = @DSYMUTIL@ | ||
141 | DUMPBIN = @DUMPBIN@ | ||
142 | ECHO_C = @ECHO_C@ | ||
143 | ECHO_N = @ECHO_N@ | ||
144 | ECHO_T = @ECHO_T@ | ||
145 | ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@ | ||
146 | ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@ | ||
147 | EDB_CFLAGS = @EDB_CFLAGS@ | ||
148 | EDB_LIBS = @EDB_LIBS@ | ||
149 | EDJE_CFLAGS = @EDJE_CFLAGS@ | ||
150 | EDJE_LIBS = @EDJE_LIBS@ | ||
151 | EET_CFLAGS = @EET_CFLAGS@ | ||
152 | EET_LIBS = @EET_LIBS@ | ||
153 | EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@ | ||
154 | EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@ | ||
155 | EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@ | ||
156 | EGREP = @EGREP@ | ||
157 | EINA_CFLAGS = @EINA_CFLAGS@ | ||
158 | EINA_LIBS = @EINA_LIBS@ | ||
159 | EVAS_CFLAGS = @EVAS_CFLAGS@ | ||
160 | EVAS_LIBS = @EVAS_LIBS@ | ||
161 | EVAS_SSE3_CFLAGS = @EVAS_SSE3_CFLAGS@ | ||
162 | EVIL_CFLAGS = @EVIL_CFLAGS@ | ||
163 | EVIL_LIBS = @EVIL_LIBS@ | ||
164 | EXEEXT = @EXEEXT@ | ||
165 | EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ | ||
166 | EXOTIC_LIBS = @EXOTIC_LIBS@ | ||
167 | FGREP = @FGREP@ | ||
168 | FONTCONFIG_CFLAGS = @FONTCONFIG_CFLAGS@ | ||
169 | FONTCONFIG_LIBS = @FONTCONFIG_LIBS@ | ||
170 | FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ | ||
171 | FREETYPE_LIBS = @FREETYPE_LIBS@ | ||
172 | FRIBIDI_CFLAGS = @FRIBIDI_CFLAGS@ | ||
173 | FRIBIDI_LIBS = @FRIBIDI_LIBS@ | ||
174 | GL_EET_CFLAGS = @GL_EET_CFLAGS@ | ||
175 | GL_EET_LIBS = @GL_EET_LIBS@ | ||
176 | GREP = @GREP@ | ||
177 | HARFBUZZ_CFLAGS = @HARFBUZZ_CFLAGS@ | ||
178 | HARFBUZZ_LIBS = @HARFBUZZ_LIBS@ | ||
179 | INSTALL = @INSTALL@ | ||
180 | INSTALL_DATA = @INSTALL_DATA@ | ||
181 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
182 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | ||
183 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | ||
184 | LD = @LD@ | ||
185 | LDFLAGS = @LDFLAGS@ | ||
186 | LIBOBJS = @LIBOBJS@ | ||
187 | LIBS = @LIBS@ | ||
188 | LIBTOOL = @LIBTOOL@ | ||
189 | LINEBREAK_CFLAGS = @LINEBREAK_CFLAGS@ | ||
190 | LINEBREAK_LIBS = @LINEBREAK_LIBS@ | ||
191 | LIPO = @LIPO@ | ||
192 | LN_S = @LN_S@ | ||
193 | LTLIBOBJS = @LTLIBOBJS@ | ||
194 | MAKEINFO = @MAKEINFO@ | ||
195 | MKDIR_P = @MKDIR_P@ | ||
196 | MODULE_ARCH = @MODULE_ARCH@ | ||
197 | NM = @NM@ | ||
198 | NMEDIT = @NMEDIT@ | ||
199 | OBJC = @OBJC@ | ||
200 | OBJCDEPMODE = @OBJCDEPMODE@ | ||
201 | OBJCFLAGS = @OBJCFLAGS@ | ||
202 | OBJDUMP = @OBJDUMP@ | ||
203 | OBJEXT = @OBJEXT@ | ||
204 | OTOOL = @OTOOL@ | ||
205 | OTOOL64 = @OTOOL64@ | ||
206 | PACKAGE = @PACKAGE@ | ||
207 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | ||
208 | PACKAGE_NAME = @PACKAGE_NAME@ | ||
209 | PACKAGE_STRING = @PACKAGE_STRING@ | ||
210 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | ||
211 | PACKAGE_URL = @PACKAGE_URL@ | ||
212 | PACKAGE_VERSION = @PACKAGE_VERSION@ | ||
213 | PATH_SEPARATOR = @PATH_SEPARATOR@ | ||
214 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | ||
215 | PIXMAN_LIBS = @PIXMAN_LIBS@ | ||
216 | PKG_CONFIG = @PKG_CONFIG@ | ||
217 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
218 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
219 | PNG_CFLAGS = @PNG_CFLAGS@ | ||
220 | PNG_LIBS = @PNG_LIBS@ | ||
221 | RANLIB = @RANLIB@ | ||
222 | SDL_CFLAGS = @SDL_CFLAGS@ | ||
223 | SDL_LIBS = @SDL_LIBS@ | ||
224 | SED = @SED@ | ||
225 | SET_MAKE = @SET_MAKE@ | ||
226 | SHELL = @SHELL@ | ||
227 | SHM_OPEN_LINK = @SHM_OPEN_LINK@ | ||
228 | STRIP = @STRIP@ | ||
229 | SVG_CFLAGS = @SVG_CFLAGS@ | ||
230 | SVG_LIBS = @SVG_LIBS@ | ||
231 | VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | ||
232 | VALGRIND_LIBS = @VALGRIND_LIBS@ | ||
233 | VERSION = @VERSION@ | ||
234 | VMAJ = @VMAJ@ | ||
235 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
236 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
237 | XCB_CFLAGS = @XCB_CFLAGS@ | ||
238 | XCB_GL_CFLAGS = @XCB_GL_CFLAGS@ | ||
239 | XCB_GL_LIBS = @XCB_GL_LIBS@ | ||
240 | XCB_LIBS = @XCB_LIBS@ | ||
241 | XEXT_CFLAGS = @XEXT_CFLAGS@ | ||
242 | XEXT_LIBS = @XEXT_LIBS@ | ||
243 | XMKMF = @XMKMF@ | ||
244 | X_CFLAGS = @X_CFLAGS@ | ||
245 | X_EXTRA_LIBS = @X_EXTRA_LIBS@ | ||
246 | X_LIBS = @X_LIBS@ | ||
247 | X_PRE_LIBS = @X_PRE_LIBS@ | ||
248 | abs_builddir = @abs_builddir@ | ||
249 | abs_srcdir = @abs_srcdir@ | ||
250 | abs_top_builddir = @abs_top_builddir@ | ||
251 | abs_top_srcdir = @abs_top_srcdir@ | ||
252 | ac_ct_CC = @ac_ct_CC@ | ||
253 | ac_ct_CXX = @ac_ct_CXX@ | ||
254 | ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ | ||
255 | ac_ct_OBJC = @ac_ct_OBJC@ | ||
256 | altivec_cflags = @altivec_cflags@ | ||
257 | am__include = @am__include@ | ||
258 | am__leading_dot = @am__leading_dot@ | ||
259 | am__quote = @am__quote@ | ||
260 | am__tar = @am__tar@ | ||
261 | am__untar = @am__untar@ | ||
262 | bindir = @bindir@ | ||
263 | build = @build@ | ||
264 | build_alias = @build_alias@ | ||
265 | build_cpu = @build_cpu@ | ||
266 | build_os = @build_os@ | ||
267 | build_vendor = @build_vendor@ | ||
268 | builddir = @builddir@ | ||
269 | datadir = @datadir@ | ||
270 | datarootdir = @datarootdir@ | ||
271 | dlopen_libs = @dlopen_libs@ | ||
272 | docdir = @docdir@ | ||
273 | dvidir = @dvidir@ | ||
274 | edje_cc = @edje_cc@ | ||
275 | efl_doxygen = @efl_doxygen@ | ||
276 | efl_have_doxygen = @efl_have_doxygen@ | ||
277 | evas_engine_buffer_cflags = @evas_engine_buffer_cflags@ | ||
278 | evas_engine_buffer_libs = @evas_engine_buffer_libs@ | ||
279 | evas_engine_direct3d_cflags = @evas_engine_direct3d_cflags@ | ||
280 | evas_engine_direct3d_libs = @evas_engine_direct3d_libs@ | ||
281 | evas_engine_directfb_cflags = @evas_engine_directfb_cflags@ | ||
282 | evas_engine_directfb_libs = @evas_engine_directfb_libs@ | ||
283 | evas_engine_fb_cflags = @evas_engine_fb_cflags@ | ||
284 | evas_engine_fb_libs = @evas_engine_fb_libs@ | ||
285 | evas_engine_gl_cocoa_cflags = @evas_engine_gl_cocoa_cflags@ | ||
286 | evas_engine_gl_cocoa_libs = @evas_engine_gl_cocoa_libs@ | ||
287 | evas_engine_gl_common_libs = @evas_engine_gl_common_libs@ | ||
288 | evas_engine_gl_sdl_cflags = @evas_engine_gl_sdl_cflags@ | ||
289 | evas_engine_gl_sdl_libs = @evas_engine_gl_sdl_libs@ | ||
290 | evas_engine_gl_xcb_cflags = @evas_engine_gl_xcb_cflags@ | ||
291 | evas_engine_gl_xcb_libs = @evas_engine_gl_xcb_libs@ | ||
292 | evas_engine_gl_xlib_cflags = @evas_engine_gl_xlib_cflags@ | ||
293 | evas_engine_gl_xlib_libs = @evas_engine_gl_xlib_libs@ | ||
294 | evas_engine_psl1ght_cflags = @evas_engine_psl1ght_cflags@ | ||
295 | evas_engine_psl1ght_libs = @evas_engine_psl1ght_libs@ | ||
296 | evas_engine_software_16_ddraw_cflags = @evas_engine_software_16_ddraw_cflags@ | ||
297 | evas_engine_software_16_ddraw_libs = @evas_engine_software_16_ddraw_libs@ | ||
298 | evas_engine_software_16_sdl_cflags = @evas_engine_software_16_sdl_cflags@ | ||
299 | evas_engine_software_16_sdl_libs = @evas_engine_software_16_sdl_libs@ | ||
300 | evas_engine_software_16_wince_cflags = @evas_engine_software_16_wince_cflags@ | ||
301 | evas_engine_software_16_wince_libs = @evas_engine_software_16_wince_libs@ | ||
302 | evas_engine_software_16_x11_cflags = @evas_engine_software_16_x11_cflags@ | ||
303 | evas_engine_software_16_x11_libs = @evas_engine_software_16_x11_libs@ | ||
304 | evas_engine_software_8_x11_cflags = @evas_engine_software_8_x11_cflags@ | ||
305 | evas_engine_software_8_x11_libs = @evas_engine_software_8_x11_libs@ | ||
306 | evas_engine_software_ddraw_cflags = @evas_engine_software_ddraw_cflags@ | ||
307 | evas_engine_software_ddraw_libs = @evas_engine_software_ddraw_libs@ | ||
308 | evas_engine_software_gdi_cflags = @evas_engine_software_gdi_cflags@ | ||
309 | evas_engine_software_gdi_libs = @evas_engine_software_gdi_libs@ | ||
310 | evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | ||
311 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | ||
312 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | ||
313 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | ||
314 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
315 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
316 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
317 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
318 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | ||
319 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | ||
320 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | ||
321 | evas_image_loader_edb_libs = @evas_image_loader_edb_libs@ | ||
322 | evas_image_loader_eet_cflags = @evas_image_loader_eet_cflags@ | ||
323 | evas_image_loader_eet_libs = @evas_image_loader_eet_libs@ | ||
324 | evas_image_loader_generic_cflags = @evas_image_loader_generic_cflags@ | ||
325 | evas_image_loader_generic_libs = @evas_image_loader_generic_libs@ | ||
326 | evas_image_loader_gif_cflags = @evas_image_loader_gif_cflags@ | ||
327 | evas_image_loader_gif_libs = @evas_image_loader_gif_libs@ | ||
328 | evas_image_loader_ico_cflags = @evas_image_loader_ico_cflags@ | ||
329 | evas_image_loader_ico_libs = @evas_image_loader_ico_libs@ | ||
330 | evas_image_loader_jpeg_cflags = @evas_image_loader_jpeg_cflags@ | ||
331 | evas_image_loader_jpeg_libs = @evas_image_loader_jpeg_libs@ | ||
332 | evas_image_loader_pmaps_cflags = @evas_image_loader_pmaps_cflags@ | ||
333 | evas_image_loader_pmaps_libs = @evas_image_loader_pmaps_libs@ | ||
334 | evas_image_loader_png_cflags = @evas_image_loader_png_cflags@ | ||
335 | evas_image_loader_png_libs = @evas_image_loader_png_libs@ | ||
336 | evas_image_loader_psd_cflags = @evas_image_loader_psd_cflags@ | ||
337 | evas_image_loader_psd_libs = @evas_image_loader_psd_libs@ | ||
338 | evas_image_loader_svg_cflags = @evas_image_loader_svg_cflags@ | ||
339 | evas_image_loader_svg_libs = @evas_image_loader_svg_libs@ | ||
340 | evas_image_loader_tga_cflags = @evas_image_loader_tga_cflags@ | ||
341 | evas_image_loader_tga_libs = @evas_image_loader_tga_libs@ | ||
342 | evas_image_loader_tiff_cflags = @evas_image_loader_tiff_cflags@ | ||
343 | evas_image_loader_tiff_libs = @evas_image_loader_tiff_libs@ | ||
344 | evas_image_loader_wbmp_cflags = @evas_image_loader_wbmp_cflags@ | ||
345 | evas_image_loader_wbmp_libs = @evas_image_loader_wbmp_libs@ | ||
346 | evas_image_loader_xpm_cflags = @evas_image_loader_xpm_cflags@ | ||
347 | evas_image_loader_xpm_libs = @evas_image_loader_xpm_libs@ | ||
348 | exec_prefix = @exec_prefix@ | ||
349 | have_evas_engine_gl_x11 = @have_evas_engine_gl_x11@ | ||
350 | have_evas_engine_gl_xcb = @have_evas_engine_gl_xcb@ | ||
351 | have_evas_engine_gl_xlib = @have_evas_engine_gl_xlib@ | ||
352 | have_evas_engine_software_x11 = @have_evas_engine_software_x11@ | ||
353 | have_evas_engine_software_xcb = @have_evas_engine_software_xcb@ | ||
354 | have_evas_engine_software_xlib = @have_evas_engine_software_xlib@ | ||
355 | have_lcov = @have_lcov@ | ||
356 | host = @host@ | ||
357 | host_alias = @host_alias@ | ||
358 | host_cpu = @host_cpu@ | ||
359 | host_os = @host_os@ | ||
360 | host_vendor = @host_vendor@ | ||
361 | htmldir = @htmldir@ | ||
362 | includedir = @includedir@ | ||
363 | infodir = @infodir@ | ||
364 | install_sh = @install_sh@ | ||
365 | libdir = @libdir@ | ||
366 | libexecdir = @libexecdir@ | ||
367 | localedir = @localedir@ | ||
368 | localstatedir = @localstatedir@ | ||
369 | lt_ECHO = @lt_ECHO@ | ||
370 | lt_enable_auto_import = @lt_enable_auto_import@ | ||
371 | mandir = @mandir@ | ||
372 | mkdir_p = @mkdir_p@ | ||
373 | oldincludedir = @oldincludedir@ | ||
374 | pdfdir = @pdfdir@ | ||
375 | pkgconfig_requires_private = @pkgconfig_requires_private@ | ||
376 | prefix = @prefix@ | ||
377 | program_transform_name = @program_transform_name@ | ||
378 | psdir = @psdir@ | ||
379 | pthread_cflags = @pthread_cflags@ | ||
380 | pthread_libs = @pthread_libs@ | ||
381 | release_info = @release_info@ | ||
382 | requirement_evas = @requirement_evas@ | ||
383 | sbindir = @sbindir@ | ||
384 | sharedstatedir = @sharedstatedir@ | ||
385 | srcdir = @srcdir@ | ||
386 | sysconfdir = @sysconfdir@ | ||
387 | target_alias = @target_alias@ | ||
388 | top_build_prefix = @top_build_prefix@ | ||
389 | top_builddir = @top_builddir@ | ||
390 | top_srcdir = @top_srcdir@ | ||
391 | version_info = @version_info@ | ||
392 | MAINTAINERCLEANFILES = Makefile.in | ||
393 | @EVAS_CSERVE_TRUE@AM_CPPFLAGS = \ | ||
394 | @EVAS_CSERVE_TRUE@-I. \ | ||
395 | @EVAS_CSERVE_TRUE@-I$(top_srcdir)/src/lib \ | ||
396 | @EVAS_CSERVE_TRUE@-I$(top_srcdir)/src/lib/include \ | ||
397 | @EVAS_CSERVE_TRUE@-I$(top_srcdir)/src/lib/cserve \ | ||
398 | @EVAS_CSERVE_TRUE@-DPACKAGE_BIN_DIR=\"$(bindir)\" \ | ||
399 | @EVAS_CSERVE_TRUE@-DPACKAGE_LIB_DIR=\"$(libdir)\" \ | ||
400 | @EVAS_CSERVE_TRUE@-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ | ||
401 | @EVAS_CSERVE_TRUE@@EINA_CFLAGS@ \ | ||
402 | @EVAS_CSERVE_TRUE@@FREETYPE_CFLAGS@ \ | ||
403 | @EVAS_CSERVE_TRUE@@FRIBIDI_CFLAGS@ \ | ||
404 | @EVAS_CSERVE_TRUE@@EET_CFLAGS@ \ | ||
405 | @EVAS_CSERVE_TRUE@@FONTCONFIG_CFLAGS@ \ | ||
406 | @EVAS_CSERVE_TRUE@@pthread_cflags@ \ | ||
407 | @EVAS_CSERVE_TRUE@@PIXMAN_CFLAGS@ | ||
408 | |||
409 | @EVAS_CSERVE_TRUE@evas_cserve_SOURCES = \ | ||
410 | @EVAS_CSERVE_TRUE@evas_cserve_main.c | ||
411 | |||
412 | @EVAS_CSERVE_TRUE@evas_cserve_LDADD = \ | ||
413 | @EVAS_CSERVE_TRUE@$(top_builddir)/src/lib/libevas.la \ | ||
414 | @EVAS_CSERVE_TRUE@@pthread_libs@ \ | ||
415 | @EVAS_CSERVE_TRUE@@EINA_LIBS@ | ||
416 | |||
417 | @EVAS_CSERVE_TRUE@evas_cserve_tool_LDFLAGS = | ||
418 | @EVAS_CSERVE_TRUE@evas_cserve_tool_SOURCES = \ | ||
419 | @EVAS_CSERVE_TRUE@evas_cserve_tool.c | ||
420 | |||
421 | @EVAS_CSERVE_TRUE@evas_cserve_tool_LDADD = \ | ||
422 | @EVAS_CSERVE_TRUE@$(top_builddir)/src/lib/libevas.la \ | ||
423 | @EVAS_CSERVE_TRUE@@pthread_libs@ \ | ||
424 | @EVAS_CSERVE_TRUE@@EINA_LIBS@ | ||
425 | |||
426 | all: all-am | ||
427 | |||
428 | .SUFFIXES: | ||
429 | .SUFFIXES: .c .lo .o .obj | ||
430 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
431 | @for dep in $?; do \ | ||
432 | case '$(am__configure_deps)' in \ | ||
433 | *$$dep*) \ | ||
434 | ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ | ||
435 | && { if test -f $@; then exit 0; else break; fi; }; \ | ||
436 | exit 1;; \ | ||
437 | esac; \ | ||
438 | done; \ | ||
439 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/bin/Makefile'; \ | ||
440 | $(am__cd) $(top_srcdir) && \ | ||
441 | $(AUTOMAKE) --gnu src/bin/Makefile | ||
442 | .PRECIOUS: Makefile | ||
443 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
444 | @case '$?' in \ | ||
445 | *config.status*) \ | ||
446 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
447 | *) \ | ||
448 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
449 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
450 | esac; | ||
451 | |||
452 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
453 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
454 | |||
455 | $(top_srcdir)/configure: $(am__configure_deps) | ||
456 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
457 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
458 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
459 | $(am__aclocal_m4_deps): | ||
460 | install-binPROGRAMS: $(bin_PROGRAMS) | ||
461 | @$(NORMAL_INSTALL) | ||
462 | test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" | ||
463 | @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ | ||
464 | for p in $$list; do echo "$$p $$p"; done | \ | ||
465 | sed 's/$(EXEEXT)$$//' | \ | ||
466 | while read p p1; do if test -f $$p || test -f $$p1; \ | ||
467 | then echo "$$p"; echo "$$p"; else :; fi; \ | ||
468 | done | \ | ||
469 | sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ | ||
470 | -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ | ||
471 | sed 'N;N;N;s,\n, ,g' | \ | ||
472 | $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ | ||
473 | { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ | ||
474 | if ($$2 == $$4) files[d] = files[d] " " $$1; \ | ||
475 | else { print "f", $$3 "/" $$4, $$1; } } \ | ||
476 | END { for (d in files) print "f", d, files[d] }' | \ | ||
477 | while read type dir files; do \ | ||
478 | if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ | ||
479 | test -z "$$files" || { \ | ||
480 | echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ | ||
481 | $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ | ||
482 | } \ | ||
483 | ; done | ||
484 | |||
485 | uninstall-binPROGRAMS: | ||
486 | @$(NORMAL_UNINSTALL) | ||
487 | @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ | ||
488 | files=`for p in $$list; do echo "$$p"; done | \ | ||
489 | sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ | ||
490 | -e 's/$$/$(EXEEXT)/' `; \ | ||
491 | test -n "$$list" || exit 0; \ | ||
492 | echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ | ||
493 | cd "$(DESTDIR)$(bindir)" && rm -f $$files | ||
494 | |||
495 | clean-binPROGRAMS: | ||
496 | @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ | ||
497 | echo " rm -f" $$list; \ | ||
498 | rm -f $$list || exit $$?; \ | ||
499 | test -n "$(EXEEXT)" || exit 0; \ | ||
500 | list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ | ||
501 | echo " rm -f" $$list; \ | ||
502 | rm -f $$list | ||
503 | evas_cserve$(EXEEXT): $(evas_cserve_OBJECTS) $(evas_cserve_DEPENDENCIES) | ||
504 | @rm -f evas_cserve$(EXEEXT) | ||
505 | $(AM_V_CCLD)$(LINK) $(evas_cserve_OBJECTS) $(evas_cserve_LDADD) $(LIBS) | ||
506 | evas_cserve_tool$(EXEEXT): $(evas_cserve_tool_OBJECTS) $(evas_cserve_tool_DEPENDENCIES) | ||
507 | @rm -f evas_cserve_tool$(EXEEXT) | ||
508 | $(AM_V_CCLD)$(evas_cserve_tool_LINK) $(evas_cserve_tool_OBJECTS) $(evas_cserve_tool_LDADD) $(LIBS) | ||
509 | |||
510 | mostlyclean-compile: | ||
511 | -rm -f *.$(OBJEXT) | ||
512 | |||
513 | distclean-compile: | ||
514 | -rm -f *.tab.c | ||
515 | |||
516 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_cserve_main.Po@am__quote@ | ||
517 | @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/evas_cserve_tool.Po@am__quote@ | ||
518 | |||
519 | .c.o: | ||
520 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
521 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
522 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
523 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
524 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
525 | @am__fastdepCC_FALSE@ $(COMPILE) -c $< | ||
526 | |||
527 | .c.obj: | ||
528 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` | ||
529 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po | ||
530 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
531 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ | ||
532 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
533 | @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` | ||
534 | |||
535 | .c.lo: | ||
536 | @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< | ||
537 | @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo | ||
538 | @am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ | ||
539 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ | ||
540 | @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ | ||
541 | @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< | ||
542 | |||
543 | mostlyclean-libtool: | ||
544 | -rm -f *.lo | ||
545 | |||
546 | clean-libtool: | ||
547 | -rm -rf .libs _libs | ||
548 | |||
549 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
550 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
551 | unique=`for i in $$list; do \ | ||
552 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
553 | done | \ | ||
554 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
555 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
556 | mkid -fID $$unique | ||
557 | tags: TAGS | ||
558 | |||
559 | TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
560 | $(TAGS_FILES) $(LISP) | ||
561 | set x; \ | ||
562 | here=`pwd`; \ | ||
563 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
564 | unique=`for i in $$list; do \ | ||
565 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
566 | done | \ | ||
567 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
568 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
569 | shift; \ | ||
570 | if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ | ||
571 | test -n "$$unique" || unique=$$empty_fix; \ | ||
572 | if test $$# -gt 0; then \ | ||
573 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
574 | "$$@" $$unique; \ | ||
575 | else \ | ||
576 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
577 | $$unique; \ | ||
578 | fi; \ | ||
579 | fi | ||
580 | ctags: CTAGS | ||
581 | CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ | ||
582 | $(TAGS_FILES) $(LISP) | ||
583 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
584 | unique=`for i in $$list; do \ | ||
585 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
586 | done | \ | ||
587 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
588 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
589 | test -z "$(CTAGS_ARGS)$$unique" \ | ||
590 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
591 | $$unique | ||
592 | |||
593 | GTAGS: | ||
594 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
595 | && $(am__cd) $(top_srcdir) \ | ||
596 | && gtags -i $(GTAGS_ARGS) "$$here" | ||
597 | |||
598 | distclean-tags: | ||
599 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
600 | |||
601 | distdir: $(DISTFILES) | ||
602 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
603 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
604 | list='$(DISTFILES)'; \ | ||
605 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
606 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
607 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
608 | case $$dist_files in \ | ||
609 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
610 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
611 | sort -u` ;; \ | ||
612 | esac; \ | ||
613 | for file in $$dist_files; do \ | ||
614 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
615 | if test -d $$d/$$file; then \ | ||
616 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
617 | if test -d "$(distdir)/$$file"; then \ | ||
618 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
619 | fi; \ | ||
620 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
621 | cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ | ||
622 | find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ | ||
623 | fi; \ | ||
624 | cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ | ||
625 | else \ | ||
626 | test -f "$(distdir)/$$file" \ | ||
627 | || cp -p $$d/$$file "$(distdir)/$$file" \ | ||
628 | || exit 1; \ | ||
629 | fi; \ | ||
630 | done | ||
631 | check-am: all-am | ||
632 | check: check-am | ||
633 | all-am: Makefile $(PROGRAMS) | ||
634 | installdirs: | ||
635 | for dir in "$(DESTDIR)$(bindir)"; do \ | ||
636 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
637 | done | ||
638 | install: install-am | ||
639 | install-exec: install-exec-am | ||
640 | install-data: install-data-am | ||
641 | uninstall: uninstall-am | ||
642 | |||
643 | install-am: all-am | ||
644 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
645 | |||
646 | installcheck: installcheck-am | ||
647 | install-strip: | ||
648 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
649 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
650 | `test -z '$(STRIP)' || \ | ||
651 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
652 | mostlyclean-generic: | ||
653 | |||
654 | clean-generic: | ||
655 | |||
656 | distclean-generic: | ||
657 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
658 | -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) | ||
659 | |||
660 | maintainer-clean-generic: | ||
661 | @echo "This command is intended for maintainers to use" | ||
662 | @echo "it deletes files that may require special tools to rebuild." | ||
663 | -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) | ||
664 | clean: clean-am | ||
665 | |||
666 | clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am | ||
667 | |||
668 | distclean: distclean-am | ||
669 | -rm -rf ./$(DEPDIR) | ||
670 | -rm -f Makefile | ||
671 | distclean-am: clean-am distclean-compile distclean-generic \ | ||
672 | distclean-tags | ||
673 | |||
674 | dvi: dvi-am | ||
675 | |||
676 | dvi-am: | ||
677 | |||
678 | html: html-am | ||
679 | |||
680 | html-am: | ||
681 | |||
682 | info: info-am | ||
683 | |||
684 | info-am: | ||
685 | |||
686 | install-data-am: | ||
687 | |||
688 | install-dvi: install-dvi-am | ||
689 | |||
690 | install-dvi-am: | ||
691 | |||
692 | install-exec-am: install-binPROGRAMS | ||
693 | |||
694 | install-html: install-html-am | ||
695 | |||
696 | install-html-am: | ||
697 | |||
698 | install-info: install-info-am | ||
699 | |||
700 | install-info-am: | ||
701 | |||
702 | install-man: | ||
703 | |||
704 | install-pdf: install-pdf-am | ||
705 | |||
706 | install-pdf-am: | ||
707 | |||
708 | install-ps: install-ps-am | ||
709 | |||
710 | install-ps-am: | ||
711 | |||
712 | installcheck-am: | ||
713 | |||
714 | maintainer-clean: maintainer-clean-am | ||
715 | -rm -rf ./$(DEPDIR) | ||
716 | -rm -f Makefile | ||
717 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
718 | |||
719 | mostlyclean: mostlyclean-am | ||
720 | |||
721 | mostlyclean-am: mostlyclean-compile mostlyclean-generic \ | ||
722 | mostlyclean-libtool | ||
723 | |||
724 | pdf: pdf-am | ||
725 | |||
726 | pdf-am: | ||
727 | |||
728 | ps: ps-am | ||
729 | |||
730 | ps-am: | ||
731 | |||
732 | uninstall-am: uninstall-binPROGRAMS | ||
733 | |||
734 | .MAKE: install-am install-strip | ||
735 | |||
736 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ | ||
737 | clean-generic clean-libtool ctags distclean distclean-compile \ | ||
738 | distclean-generic distclean-libtool distclean-tags distdir dvi \ | ||
739 | dvi-am html html-am info info-am install install-am \ | ||
740 | install-binPROGRAMS install-data install-data-am install-dvi \ | ||
741 | install-dvi-am install-exec install-exec-am install-html \ | ||
742 | install-html-am install-info install-info-am install-man \ | ||
743 | install-pdf install-pdf-am install-ps install-ps-am \ | ||
744 | install-strip installcheck installcheck-am installdirs \ | ||
745 | maintainer-clean maintainer-clean-generic mostlyclean \ | ||
746 | mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ | ||
747 | pdf pdf-am ps ps-am tags uninstall uninstall-am \ | ||
748 | uninstall-binPROGRAMS | ||
749 | |||
750 | |||
751 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
752 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
753 | .NOEXPORT: | ||
diff --git a/libraries/evas/src/bin/evas_cserve_main.c b/libraries/evas/src/bin/evas_cserve_main.c deleted file mode 100644 index 92718da..0000000 --- a/libraries/evas/src/bin/evas_cserve_main.c +++ /dev/null | |||
@@ -1,1683 +0,0 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include "config.h" | ||
3 | #endif | ||
4 | |||
5 | #include <signal.h> | ||
6 | #include <sys/time.h> | ||
7 | #include <time.h> | ||
8 | #ifdef _WIN32 | ||
9 | # include <windows.h> | ||
10 | #endif | ||
11 | |||
12 | #ifdef BUILD_PTHREAD | ||
13 | #include <pthread.h> | ||
14 | #endif | ||
15 | |||
16 | #include "Evas.h" | ||
17 | #include "evas_cs.h" | ||
18 | |||
19 | #define D(...) EINA_LOG_DOM_DBG(_evas_cserve_bin_log_dom, __VA_ARGS__) | ||
20 | #ifdef ERR | ||
21 | #undef ERR | ||
22 | #endif | ||
23 | #define ERR(...) EINA_LOG_DOM_ERR(_evas_cserve_bin_log_dom, __VA_ARGS__) | ||
24 | #ifdef DBG | ||
25 | #undef DBG | ||
26 | #endif | ||
27 | #define DBG(...) EINA_LOG_DOM_DBG(_evas_cserve_bin_log_dom, __VA_ARGS__) | ||
28 | #ifdef WRN | ||
29 | #undef WRN | ||
30 | #endif | ||
31 | #define WRN(...) EINA_LOG_DOM_WARN(_evas_cserve_bin_log_dom, __VA_ARGS__) | ||
32 | |||
33 | #ifdef CSERVE_BIN_DEFAULT_COLOR | ||
34 | #undef CSERVE_BIN_DEFAULT_COLOR | ||
35 | #endif | ||
36 | #define CSERVE_BIN_DEFAULT_COLOR EINA_COLOR_BLUE | ||
37 | // fixme:'s | ||
38 | // | ||
39 | // preload - make it work (both) | ||
40 | |||
41 | // | ||
42 | // pants! | ||
43 | |||
44 | typedef struct _Img Img; | ||
45 | typedef struct _Lopt Lopt; | ||
46 | typedef struct _Load_Inf Load_Inf; | ||
47 | |||
48 | struct _Lopt | ||
49 | { | ||
50 | int scale_down_by; // if > 1 then use this | ||
51 | double dpi; // if > 0.0 use this | ||
52 | int w, h; // if > 0 use this | ||
53 | struct { | ||
54 | int x, y, w, h; | ||
55 | } region; | ||
56 | }; | ||
57 | |||
58 | struct _Img | ||
59 | { | ||
60 | Image_Entry ie; | ||
61 | int ref; | ||
62 | int dref; | ||
63 | int usage; | ||
64 | Mem *mem; | ||
65 | const char *key; | ||
66 | time_t cached; | ||
67 | struct { | ||
68 | const char *file; | ||
69 | const char *key; | ||
70 | time_t modtime; | ||
71 | time_t last_stat; | ||
72 | } file; | ||
73 | struct { | ||
74 | int load1saved, load2saved; | ||
75 | double load1, load2; | ||
76 | } stats; | ||
77 | Lopt load_opts; | ||
78 | struct { | ||
79 | int w, h; | ||
80 | void *data; | ||
81 | Eina_Bool alpha : 1; | ||
82 | } image; | ||
83 | int incache; | ||
84 | LK(lock); | ||
85 | Eina_Bool dead : 1; | ||
86 | Eina_Bool active : 1; | ||
87 | Eina_Bool useless : 1; | ||
88 | Eina_Bool killme : 1; | ||
89 | }; | ||
90 | |||
91 | struct _Load_Inf | ||
92 | { | ||
93 | Img *img; | ||
94 | Client *c; | ||
95 | }; | ||
96 | |||
97 | // config | ||
98 | static int stat_res_interval = 2; | ||
99 | |||
100 | static time_t t_now = 0; | ||
101 | |||
102 | static int server_id = 0; | ||
103 | |||
104 | LK(strshr_freeme_lock); | ||
105 | static int strshr_freeme_count = 0; | ||
106 | static int strshr_freeme_alloc = 0; | ||
107 | static const char **strshr_freeme = NULL; | ||
108 | |||
109 | static int cache_cleanme = 0; | ||
110 | static Evas_Cache_Image *cache = NULL; | ||
111 | |||
112 | static Eina_Hash *active_images = NULL; | ||
113 | LK(cache_lock); | ||
114 | static Eina_List *cache_images = NULL; | ||
115 | static int cache_usage = 0; | ||
116 | static int cache_max_usage = 1 * 1024; | ||
117 | static int cache_max_adjust = 0; | ||
118 | static int cache_item_timeout = -1; | ||
119 | static int cache_item_timeout_check = -1; | ||
120 | static Mem *stat_mem = NULL; | ||
121 | static int _evas_cserve_bin_log_dom = -1; | ||
122 | static Eina_List *stat_mems = NULL; | ||
123 | |||
124 | static void cache_clean(void); | ||
125 | |||
126 | #ifndef _WIN32 | ||
127 | static double | ||
128 | get_time(void) | ||
129 | { | ||
130 | struct timeval timev; | ||
131 | |||
132 | gettimeofday(&timev, NULL); | ||
133 | return (double)timev.tv_sec + (((double)timev.tv_usec) / 1000000); | ||
134 | } | ||
135 | #else | ||
136 | static double | ||
137 | get_time(void) | ||
138 | { | ||
139 | return (double)GetTickCount()/1000.0; | ||
140 | } | ||
141 | #endif | ||
142 | |||
143 | static int mem_total = 0; | ||
144 | static int mem_free = 0; | ||
145 | static int mem_buffers = 0; | ||
146 | static int mem_cached = 0; | ||
147 | |||
148 | static void | ||
149 | meminfo_check(void) | ||
150 | { | ||
151 | FILE *f; | ||
152 | char buf[1024]; | ||
153 | int v; | ||
154 | |||
155 | f = fopen("/proc/meminfo", "r"); | ||
156 | if (!f) return; | ||
157 | if (!fgets(buf, sizeof(buf), f)) goto done; | ||
158 | v = 0; if (sscanf(buf, "%*s %i %*s", &v) != 1) goto done; | ||
159 | mem_total = v; | ||
160 | if (!fgets(buf, sizeof(buf), f)) goto done; | ||
161 | v = 0; if (sscanf(buf, "%*s %i %*s", &v) != 1) goto done; | ||
162 | mem_free = v; | ||
163 | if (!fgets(buf, sizeof(buf), f)) goto done; | ||
164 | v = 0; if (sscanf(buf, "%*s %i %*s", &v) != 1) goto done; | ||
165 | mem_buffers = v; | ||
166 | if (!fgets(buf, sizeof(buf), f)) goto done; | ||
167 | v = 0; if (sscanf(buf, "%*s %i %*s", &v) != 1) goto done; | ||
168 | mem_cached = v; | ||
169 | done: | ||
170 | fclose(f); | ||
171 | } | ||
172 | |||
173 | static int stats_dirty = 0; | ||
174 | static int saved_loads = 0; | ||
175 | static double saved_load_time = 0; | ||
176 | static double saved_load_lifetime = 0; | ||
177 | |||
178 | static int saved_loaddatas = 0; | ||
179 | static double saved_loaddata_time = 0; | ||
180 | static double saved_loaddata_lifetime = 0; | ||
181 | |||
182 | static int saved_memory = 0; | ||
183 | static int saved_memory_peak = 0; | ||
184 | static int alloced_memory = 0; | ||
185 | static int alloced_memory_peak = 0; | ||
186 | static int real_memory = 0; | ||
187 | static int real_memory_peak = 0; | ||
188 | |||
189 | static Eina_Bool | ||
190 | stats_hash_image_cb(const Eina_Hash *hash __UNUSED__, | ||
191 | const void *key __UNUSED__, | ||
192 | void *data, void *fdata __UNUSED__) | ||
193 | { | ||
194 | Img *img = data; | ||
195 | |||
196 | |||
197 | saved_load_time += img->stats.load1 * img->stats.load1saved; | ||
198 | saved_loaddata_time += img->stats.load2 * img->stats.load2saved; | ||
199 | if (img->ref > 1) | ||
200 | saved_memory += img->image.w * img->image.h * sizeof(DATA32) * (img->ref - 1); | ||
201 | if (img->mem) | ||
202 | { | ||
203 | alloced_memory += img->image.w * img->image.h * sizeof(DATA32); | ||
204 | real_memory += (((img->image.w * img->image.h * sizeof(DATA32)) + 4095) >> 12) << 12; | ||
205 | } | ||
206 | return 1; | ||
207 | } | ||
208 | |||
209 | static void | ||
210 | stats_calc(void) | ||
211 | { | ||
212 | Img *img; | ||
213 | Eina_List *l; | ||
214 | |||
215 | if (!stats_dirty) return; | ||
216 | stats_dirty = 0; | ||
217 | saved_loads = 0; | ||
218 | saved_load_time = 0; | ||
219 | saved_loaddatas = 0; | ||
220 | saved_loaddata_time = 0; | ||
221 | saved_memory = 0; | ||
222 | alloced_memory = 0; | ||
223 | real_memory = 0; | ||
224 | |||
225 | if (active_images) | ||
226 | eina_hash_foreach(active_images, stats_hash_image_cb, NULL); | ||
227 | LKL(cache_lock); | ||
228 | EINA_LIST_FOREACH(cache_images, l, img) | ||
229 | { | ||
230 | saved_loads += img->stats.load1saved; | ||
231 | saved_load_time += img->stats.load1 * img->stats.load1saved; | ||
232 | saved_loaddatas += img->stats.load2saved; | ||
233 | saved_loaddata_time += img->stats.load2 * img->stats.load2saved; | ||
234 | if (img->mem) | ||
235 | { | ||
236 | alloced_memory += img->image.w * img->image.h * sizeof(DATA32); | ||
237 | real_memory += (((img->image.w * img->image.h * sizeof(DATA32)) + 4095) >> 12) << 12; | ||
238 | } | ||
239 | } | ||
240 | LKU(cache_lock); | ||
241 | if (saved_memory > saved_memory_peak) | ||
242 | saved_memory_peak = saved_memory; | ||
243 | if (real_memory > real_memory_peak) | ||
244 | real_memory_peak = real_memory; | ||
245 | if (alloced_memory > alloced_memory_peak) | ||
246 | alloced_memory_peak = alloced_memory; | ||
247 | } | ||
248 | |||
249 | static void | ||
250 | stats_update(void) | ||
251 | { | ||
252 | stats_dirty = 1; | ||
253 | } | ||
254 | |||
255 | static void | ||
256 | stats_lifetime_update(Img *img) | ||
257 | { | ||
258 | saved_load_lifetime += img->stats.load1 * img->stats.load1saved; | ||
259 | saved_loaddata_lifetime += img->stats.load2 * img->stats.load2saved; | ||
260 | } | ||
261 | |||
262 | static void | ||
263 | stat_clean(Mem *m) | ||
264 | { | ||
265 | int *ints; | ||
266 | int size, pid, *ids, count, i; | ||
267 | |||
268 | ints = (int *)m->data; | ||
269 | size = ints[0]; | ||
270 | if (!evas_cserve_mem_resize(m, size)) return; | ||
271 | ints = (int *)m->data; | ||
272 | pid = ints[1]; | ||
273 | count = (size - (2 * sizeof(int))) / sizeof(int); | ||
274 | ids = ints + 2; | ||
275 | for (i = 0; i < count; i++) | ||
276 | evas_cserve_mem_del(pid, ids[i]); | ||
277 | } | ||
278 | |||
279 | static int | ||
280 | stat_init(Mem *m) | ||
281 | { | ||
282 | int *ints; | ||
283 | |||
284 | ints = (int *)m->data; | ||
285 | |||
286 | if (!evas_cserve_mem_resize(m, 2 * sizeof(int))) return 0; | ||
287 | ints[0] = 2 * sizeof(int); | ||
288 | ints[1] = getpid(); | ||
289 | msync(m->data, 2 * sizeof(int), MS_SYNC | MS_INVALIDATE); | ||
290 | return 1; | ||
291 | } | ||
292 | |||
293 | static int | ||
294 | stat_update(Mem *m) | ||
295 | { | ||
296 | Eina_List *l; | ||
297 | Mem *m2; | ||
298 | int *ints, *ids, i; | ||
299 | |||
300 | ints = (int *)m->data; | ||
301 | ints[0] = (2 * sizeof(int)) + (eina_list_count(stat_mems) * sizeof(int)); | ||
302 | if (!evas_cserve_mem_resize(m, ints[0])) return 0; | ||
303 | ints = (int *)m->data; | ||
304 | ids = ints + 2; | ||
305 | i = 0; | ||
306 | EINA_LIST_FOREACH(stat_mems, l, m2) | ||
307 | { | ||
308 | ids[i] = m2->id; | ||
309 | i++; | ||
310 | } | ||
311 | msync(m->data, ints[0], MS_SYNC | MS_INVALIDATE); | ||
312 | return 1; | ||
313 | } | ||
314 | |||
315 | static Image_Entry * | ||
316 | _img_alloc(void) | ||
317 | { | ||
318 | Img *img; | ||
319 | |||
320 | img = calloc(1, sizeof(Img)); | ||
321 | LKI(img->lock); | ||
322 | return (Image_Entry *)img; | ||
323 | } | ||
324 | |||
325 | static void | ||
326 | _img_dealloc(Image_Entry *ie) | ||
327 | { | ||
328 | Img *img = (Img *)ie; | ||
329 | LKD(img->lock); | ||
330 | free(img); | ||
331 | } | ||
332 | |||
333 | static int | ||
334 | _img_surface_alloc(Image_Entry *ie, unsigned int w, unsigned int h) | ||
335 | { | ||
336 | Img *img = (Img *)ie; | ||
337 | |||
338 | img->mem = evas_cserve_mem_new(w * h * sizeof(DATA32), NULL); | ||
339 | if (!img->mem) return -1; | ||
340 | img->image.data = img->mem->data + img->mem->offset; | ||
341 | |||
342 | stat_mems = eina_list_append(stat_mems, img->mem); | ||
343 | stat_update(stat_mem); | ||
344 | return 0; | ||
345 | } | ||
346 | |||
347 | static void | ||
348 | _img_surface_delete(Image_Entry *ie) | ||
349 | { | ||
350 | Img *img = (Img *)ie; | ||
351 | |||
352 | if (!img->mem) return; | ||
353 | |||
354 | stat_mems = eina_list_remove(stat_mems, img->mem); | ||
355 | stat_update(stat_mem); | ||
356 | |||
357 | evas_cserve_mem_free(img->mem); | ||
358 | img->mem = NULL; | ||
359 | img->image.data = NULL; | ||
360 | } | ||
361 | |||
362 | static DATA32 * | ||
363 | _img_surface_pixels(Image_Entry *ie) | ||
364 | { | ||
365 | Img *img = (Img *)ie; | ||
366 | |||
367 | return img->image.data; | ||
368 | } | ||
369 | |||
370 | static int | ||
371 | _img_load(Image_Entry *ie) | ||
372 | { | ||
373 | return evas_common_load_rgba_image_module_from_file(ie); | ||
374 | } | ||
375 | |||
376 | static void | ||
377 | _img_unload(Image_Entry *ie __UNUSED__) | ||
378 | { | ||
379 | } | ||
380 | |||
381 | static void | ||
382 | _img_dirty_region(Image_Entry *ie __UNUSED__, unsigned int x __UNUSED__, unsigned int y __UNUSED__, unsigned int w __UNUSED__, unsigned int h __UNUSED__) | ||
383 | { | ||
384 | } | ||
385 | |||
386 | static int | ||
387 | _img_dirty(Image_Entry *dst __UNUSED__, const Image_Entry *src __UNUSED__) | ||
388 | { | ||
389 | return 0; | ||
390 | } | ||
391 | |||
392 | static int | ||
393 | _img_size_set(Image_Entry *dst __UNUSED__, const Image_Entry *src __UNUSED__, unsigned int w __UNUSED__, unsigned int h __UNUSED__) | ||
394 | { | ||
395 | return 0; | ||
396 | } | ||
397 | |||
398 | static int | ||
399 | _img_copied_data(Image_Entry *ie __UNUSED__, unsigned int w __UNUSED__, unsigned int h __UNUSED__, DATA32 *image_data __UNUSED__, int alpha __UNUSED__, int cspace __UNUSED__) | ||
400 | { | ||
401 | return 0; | ||
402 | } | ||
403 | |||
404 | static int | ||
405 | _img_data(Image_Entry *ie __UNUSED__, unsigned int w __UNUSED__, unsigned int h __UNUSED__, DATA32 *image_data __UNUSED__, int alpha __UNUSED__, int cspace __UNUSED__) | ||
406 | { | ||
407 | return 0; | ||
408 | } | ||
409 | |||
410 | static int | ||
411 | _img_color_space(Image_Entry *ie __UNUSED__, int cspace __UNUSED__) | ||
412 | { | ||
413 | return 0; | ||
414 | } | ||
415 | |||
416 | static int | ||
417 | _img_load_data(Image_Entry *ie) | ||
418 | { | ||
419 | return evas_common_load_rgba_image_data_from_file(ie); | ||
420 | } | ||
421 | |||
422 | static int | ||
423 | _img_mem_size_get(Image_Entry *ie __UNUSED__) | ||
424 | { | ||
425 | return 1; | ||
426 | } | ||
427 | |||
428 | static void | ||
429 | img_init(void) | ||
430 | { | ||
431 | const Evas_Cache_Image_Func cache_funcs = | ||
432 | { | ||
433 | _img_alloc,//Image_Entry *(*alloc)(void); | ||
434 | _img_dealloc,//void (*dealloc)(Image_Entry *im); | ||
435 | /* The cache provide some helpers for surface manipulation. */ | ||
436 | _img_surface_alloc,//int (*surface_alloc)(Image_Entry *im, unsigned int w, unsigned int h); | ||
437 | _img_surface_delete,//void (*surface_delete)(Image_Entry *im); | ||
438 | _img_surface_pixels,//DATA32 *(*surface_pixels)(Image_Entry *im); | ||
439 | /* The cache is doing the allocation and deallocation, you must just do the rest. */ | ||
440 | _img_load,//int (*constructor)(Image_Entry *im); | ||
441 | _img_unload,//void (*destructor)(Image_Entry *im); | ||
442 | _img_dirty_region,//void (*dirty_region)(Image_Entry *im, unisnged int x, unisnged int y, unisnged int w, unsigned int h); | ||
443 | /* Only called when references > 0. Need to provide a fresh copie of im. */ | ||
444 | /* The destination surface does have a surface, but no allocated pixel data. */ | ||
445 | _img_dirty,//int (*dirty)(Image_Entry *dst, const Image_Entry *src); | ||
446 | /* Only called when references == 1. We will call drop on im'. */ | ||
447 | /* The destination surface does not have any surface. */ | ||
448 | _img_size_set,//int (*size_set)(Image_Entry *dst, const Image_Entry *src, unisnged int w, unisnged int h); | ||
449 | /* The destination surface does not have any surface. */ | ||
450 | _img_copied_data,//int (*copied_data)(Image_Entry *dst, unisnged int w, unisnged int h, DATA32 *image_data, int alpha, int cspace); | ||
451 | /* The destination surface does not have any surface. */ | ||
452 | _img_data,//int (*data)(Image_Entry *dst, unsigned int w, unisgned int h, DATA32 *image_data, int alpha, int cspace); | ||
453 | _img_color_space,//int (*color_space)(Image_Entry *dst, int cspace); | ||
454 | /* This function need to update im->w and im->h. */ | ||
455 | _img_load_data,//int (*load)(Image_Entry *im); | ||
456 | _img_mem_size_get,//int (*mem_size_get)(Image_Entry *im); | ||
457 | NULL,//void (*debug)(const char *context, Image_Entry *im); | ||
458 | }; | ||
459 | |||
460 | active_images = eina_hash_string_superfast_new(NULL); | ||
461 | cache = evas_cache_image_init(&cache_funcs); | ||
462 | LKI(cache_lock); | ||
463 | LKI(strshr_freeme_lock); | ||
464 | } | ||
465 | |||
466 | static void | ||
467 | img_shutdown(void) | ||
468 | { | ||
469 | evas_cache_image_shutdown(cache); | ||
470 | cache = NULL; | ||
471 | // FIXME: shutdown properly | ||
472 | LKD(strshr_freeme_lock); | ||
473 | LKI(cache_lock); | ||
474 | } | ||
475 | |||
476 | static Img * | ||
477 | img_new(const char *file, const char *key, RGBA_Image_Loadopts *load_opts, const char *bufkey) | ||
478 | { | ||
479 | Img *img; | ||
480 | struct stat st; | ||
481 | int ret; | ||
482 | Image_Entry *ie; | ||
483 | int err = 0; | ||
484 | double t; | ||
485 | |||
486 | DBG("... stat %s", file); | ||
487 | ret = stat(file, &st); | ||
488 | if (ret < 0) return NULL; | ||
489 | DBG("... load header"); | ||
490 | t = get_time(); | ||
491 | ie = evas_cache_image_request(cache, file, key, load_opts, &err); | ||
492 | t = get_time() - t; | ||
493 | DBG("... header done"); | ||
494 | if (!ie) return NULL; | ||
495 | DBG("... ie->cache = %p", ie->cache); | ||
496 | img = (Img *)ie; | ||
497 | img->stats.load1 = t; | ||
498 | img->key = eina_stringshare_add(bufkey); | ||
499 | img->file.modtime = st.st_mtime; | ||
500 | img->file.last_stat = t_now; | ||
501 | img->file.file = eina_stringshare_add(file); | ||
502 | if (key) img->file.key = eina_stringshare_add(key); | ||
503 | img->load_opts.scale_down_by = load_opts->scale_down_by; | ||
504 | img->load_opts.dpi = load_opts->dpi; | ||
505 | img->load_opts.w = load_opts->w; | ||
506 | img->load_opts.h = load_opts->h; | ||
507 | img->image.w = ie->w; | ||
508 | img->image.h = ie->h; | ||
509 | img->image.alpha = ie->flags.alpha; | ||
510 | img->ref = 1; | ||
511 | img->active = 1; | ||
512 | img->usage = sizeof(Img) + strlen(img->key) + 1 + | ||
513 | strlen(img->file.file) + 1; | ||
514 | if (img->file.key) img->usage += strlen(img->file.key) + 1; | ||
515 | eina_hash_direct_add(active_images, img->key, img); | ||
516 | return img; | ||
517 | } | ||
518 | |||
519 | static void | ||
520 | img_loaddata(Img *img) | ||
521 | { | ||
522 | double t; | ||
523 | |||
524 | if (img->mem) return; | ||
525 | t = get_time(); | ||
526 | LKL(cache_lock); | ||
527 | evas_cache_image_load_data((Image_Entry *)img); | ||
528 | t = get_time() - t; | ||
529 | img->stats.load2 = t; | ||
530 | if (img->image.data) | ||
531 | msync(img->image.data, img->image.w * img->image.h * sizeof(DATA32), MS_SYNC | MS_INVALIDATE); | ||
532 | if (!img->active) cache_usage -= img->usage; | ||
533 | img->usage += | ||
534 | (4096 * (((img->image.w * img->image.h * sizeof(DATA32)) + 4095) / 4096)) + | ||
535 | sizeof(Mem); | ||
536 | if (!img->active) cache_usage += img->usage; | ||
537 | LKU(cache_lock); | ||
538 | cache_clean(); | ||
539 | } | ||
540 | |||
541 | static void | ||
542 | img_free(Img *img) | ||
543 | { | ||
544 | if (img->incache > 0) | ||
545 | { | ||
546 | ERR("EEEEEEEEEEEEEEEEK!"); | ||
547 | ERR("EEEEEEEEEEEEEEEEK! %p '%s' still in cache", | ||
548 | img, img->file.file); | ||
549 | ERR("EEEEEEEEEEEEEEEEK!"); | ||
550 | return; | ||
551 | } | ||
552 | stats_lifetime_update(img); | ||
553 | stats_update(); | ||
554 | |||
555 | LKL(strshr_freeme_lock); | ||
556 | strshr_freeme_count += 3; | ||
557 | if (strshr_freeme_count > strshr_freeme_alloc) | ||
558 | { | ||
559 | const char **tmp; | ||
560 | |||
561 | strshr_freeme_alloc += 32; | ||
562 | tmp = realloc(strshr_freeme, strshr_freeme_alloc * sizeof(const char **)); | ||
563 | if (tmp) strshr_freeme = tmp; | ||
564 | else | ||
565 | { | ||
566 | ERR("realloc of strshr_freeme failed for %i items", | ||
567 | strshr_freeme_alloc); | ||
568 | strshr_freeme_alloc -= 32; | ||
569 | strshr_freeme_count -= 3; | ||
570 | return; | ||
571 | } | ||
572 | } | ||
573 | strshr_freeme[strshr_freeme_count - 3] = img->key; | ||
574 | strshr_freeme[strshr_freeme_count - 2] = img->file.file; | ||
575 | strshr_freeme[strshr_freeme_count - 1] = img->file.key; | ||
576 | LKU(strshr_freeme_lock); | ||
577 | |||
578 | evas_cache_image_drop((Image_Entry *)img); | ||
579 | } | ||
580 | |||
581 | static void | ||
582 | cache_clean(void) | ||
583 | { | ||
584 | DBG("... cache clean!!! do"); | ||
585 | LKL(cache_lock); | ||
586 | while ((cache_usage > ((cache_max_usage + cache_max_adjust) * 1024)) && | ||
587 | (cache_images)) | ||
588 | { | ||
589 | Img *img; | ||
590 | Eina_List *l; | ||
591 | |||
592 | DBG("... clean loop %i > %i", cache_usage, (cache_max_usage + cache_max_adjust) * 1024); | ||
593 | l = eina_list_last(cache_images); // THREAD: called from thread. happens to be safe as it uses no unlocked shared resources | ||
594 | if (!l) break; | ||
595 | img = l->data; | ||
596 | if (!img) break; | ||
597 | LKL(img->lock); | ||
598 | DBG("... REMOVE %p '%s'", img, img->file.file); | ||
599 | #ifdef BUILD_PTHREAD | ||
600 | img->killme = 1; | ||
601 | img->useless = 1; | ||
602 | img->dead = 1; | ||
603 | cache_cleanme++; | ||
604 | LKU(img->lock); | ||
605 | #else | ||
606 | cache_images = eina_list_remove_list(cache_images, l); // FIXME: called from thread | ||
607 | img->incache--; | ||
608 | cache_usage -= img->usage; | ||
609 | DBG("... IMG FREE %p", img); | ||
610 | img_free(img); | ||
611 | #endif | ||
612 | } | ||
613 | LKU(cache_lock); | ||
614 | } | ||
615 | |||
616 | static void | ||
617 | cache_timeout(time_t t) | ||
618 | { | ||
619 | Eina_List *l, *l_next; | ||
620 | Img *img; | ||
621 | |||
622 | if (cache_item_timeout < 0) return; | ||
623 | LKL(cache_lock); | ||
624 | EINA_LIST_FOREACH_SAFE(cache_images, l, l_next, img) | ||
625 | { | ||
626 | LKL(img->lock); | ||
627 | if ((t - img->cached) > cache_item_timeout) | ||
628 | { | ||
629 | cache_images = eina_list_remove_list(cache_images, l); | ||
630 | img->incache--; | ||
631 | cache_usage -= img->usage; | ||
632 | img_free(img); | ||
633 | } | ||
634 | else | ||
635 | LKU(img->lock); | ||
636 | } | ||
637 | LKU(cache_lock); | ||
638 | } | ||
639 | |||
640 | static void | ||
641 | mem_cache_adjust(void) | ||
642 | { | ||
643 | int pval = cache_max_adjust; | ||
644 | int max = 0; | ||
645 | |||
646 | if (mem_total <= 0) return; | ||
647 | //int mem_used = mem_total - mem_free - mem_cached - mem_buffers; | ||
648 | #if 0 // this lets the image cache to grow to fill all real free ram, if | ||
649 | // there is any (ie ram unused by disk cache) | ||
650 | if (mem_free < mem_total) | ||
651 | { | ||
652 | cache_max_adjust = mem_free; | ||
653 | return; | ||
654 | } | ||
655 | #endif | ||
656 | |||
657 | max = ((mem_free + mem_cached + mem_buffers) / 8) - cache_max_usage; | ||
658 | if (max < 0) max = 0; | ||
659 | if (max > cache_max_usage) max = cache_max_usage; | ||
660 | cache_max_adjust = max - cache_max_usage; | ||
661 | |||
662 | if (cache_max_adjust < -cache_max_usage) | ||
663 | cache_max_adjust = -cache_max_usage; | ||
664 | DBG("... cache_max_adjust = %i", cache_max_adjust); | ||
665 | if (pval != cache_max_adjust) | ||
666 | { | ||
667 | DBG("... cache clean"); | ||
668 | // FIXME lock problem | ||
669 | cache_clean(); | ||
670 | } | ||
671 | } | ||
672 | |||
673 | static void | ||
674 | img_cache(Img *img) | ||
675 | { | ||
676 | eina_hash_del(active_images, img->key, img); | ||
677 | if (img->dead) | ||
678 | { | ||
679 | DBG("... img %p '%s' dead", img , img->file.file); | ||
680 | img_free(img); | ||
681 | return; | ||
682 | } | ||
683 | if ((cache_usage + img->usage) > ((cache_max_usage + cache_max_adjust) * 1024)) | ||
684 | { | ||
685 | DBG("... img %p '%s' too big for cache", img , img->file.file); | ||
686 | img_free(img); | ||
687 | return; | ||
688 | } | ||
689 | DBG("... img %p '%s' cached += %i", img , img->file.file, img->usage); | ||
690 | if (img->incache > 0) | ||
691 | { | ||
692 | ERR("EEEEEEEEEEEEEEEEK!"); | ||
693 | ERR("EEEEEEEEEEEEEEEEK! %p '%s' already in cache", | ||
694 | img, img->file.file); | ||
695 | ERR("EEEEEEEEEEEEEEEEK!"); | ||
696 | return; | ||
697 | } | ||
698 | LKL(cache_lock); | ||
699 | cache_images = eina_list_prepend(cache_images, img); | ||
700 | LKU(cache_lock); | ||
701 | img->incache++; | ||
702 | cache_usage += img->usage; | ||
703 | img->active = 0; | ||
704 | img->cached = t_now; | ||
705 | // FIXME: lock problem | ||
706 | if (cache_usage > ((cache_max_usage + cache_max_adjust) * 1024)) | ||
707 | cache_clean(); | ||
708 | } | ||
709 | |||
710 | static void | ||
711 | img_dead(Img *img) | ||
712 | { | ||
713 | if (img->active) return; | ||
714 | LKL(cache_lock); | ||
715 | cache_images = eina_list_remove(cache_images, img); | ||
716 | LKU(cache_lock); | ||
717 | img->incache--; | ||
718 | cache_usage -= img->usage; | ||
719 | img_free(img); | ||
720 | } | ||
721 | |||
722 | static Eina_Bool | ||
723 | img_ok(Img *img) | ||
724 | { | ||
725 | struct stat st; | ||
726 | int ret; | ||
727 | |||
728 | if (img->dead) return 0; | ||
729 | if ((t_now > img->file.last_stat) && | ||
730 | ((t_now - img->file.last_stat) < stat_res_interval)) return 1; | ||
731 | img->file.last_stat = t_now; | ||
732 | ret = stat(img->file.file, &st); | ||
733 | img->file.last_stat = t_now; | ||
734 | if (ret < 0) | ||
735 | { | ||
736 | img->dead = 1; | ||
737 | img_dead(img); | ||
738 | return 0; | ||
739 | } | ||
740 | if (st.st_mtime != img->file.modtime) | ||
741 | { | ||
742 | img->dead = 1; | ||
743 | img_dead(img); | ||
744 | return 0; | ||
745 | } | ||
746 | return 1; | ||
747 | } | ||
748 | |||
749 | static Img * | ||
750 | img_load(const char *file, const char *key, RGBA_Image_Loadopts *load_opts) | ||
751 | { | ||
752 | Img *img; | ||
753 | char buf[8192]; | ||
754 | Eina_List *l, *l_next; | ||
755 | |||
756 | if (!file) return NULL; | ||
757 | DBG("... img_load '%s'", file); | ||
758 | if (key) DBG("... ... key '%s'", key); | ||
759 | if (key) | ||
760 | snprintf(buf, sizeof(buf), "%s///::/%s/\001/%i/%1.8f/%ix%i", | ||
761 | file, key, | ||
762 | load_opts->scale_down_by, | ||
763 | load_opts->dpi, | ||
764 | load_opts->w, load_opts->h); | ||
765 | else | ||
766 | snprintf(buf, sizeof(buf), "%s///\001/%i/%1.8f/%ix%i", | ||
767 | file, | ||
768 | load_opts->scale_down_by, | ||
769 | load_opts->dpi, | ||
770 | load_opts->w, load_opts->h); | ||
771 | DBG("... find '%s'", buf); | ||
772 | img = eina_hash_find(active_images, buf); | ||
773 | if ((img) && (img_ok(img))) | ||
774 | { | ||
775 | DBG("... found!"); | ||
776 | img->stats.load1saved++; | ||
777 | img->ref++; | ||
778 | DBG("... stats update"); | ||
779 | stats_update(); | ||
780 | DBG("... return %p", img); | ||
781 | return img; | ||
782 | } | ||
783 | |||
784 | // FIXME: keep hash of cached images too | ||
785 | LKL(cache_lock); | ||
786 | EINA_LIST_FOREACH_SAFE(cache_images, l, l_next, img) | ||
787 | { | ||
788 | if (!strcmp(img->key, buf)) | ||
789 | { | ||
790 | LKL(img->lock); | ||
791 | if (img_ok(img)) | ||
792 | { | ||
793 | DBG("... found cached"); | ||
794 | cache_images = eina_list_remove_list(cache_images, l); | ||
795 | img->incache--; | ||
796 | cache_usage -= img->usage; | ||
797 | img->active = 1; | ||
798 | img->stats.load1saved++; | ||
799 | img->ref++; | ||
800 | eina_hash_direct_add(active_images, img->key, img); | ||
801 | DBG("... sats update"); | ||
802 | stats_update(); | ||
803 | DBG("... return %p", img); | ||
804 | LKU(img->lock); | ||
805 | LKU(cache_lock); | ||
806 | return img; | ||
807 | } | ||
808 | LKU(img->lock); | ||
809 | } | ||
810 | } | ||
811 | LKU(cache_lock); | ||
812 | DBG("... ned new img"); | ||
813 | return img_new(file, key, load_opts, buf); | ||
814 | } | ||
815 | |||
816 | static void | ||
817 | img_unload(Img *img) | ||
818 | { | ||
819 | if (img->ref == 0) | ||
820 | { | ||
821 | ERR("EEEEEEEEEEEEEEEEK!"); | ||
822 | ERR("EEEEEEEEEEEEEEEEK! %p '%s' already @ ref 0", | ||
823 | img, img->file.file); | ||
824 | ERR("EEEEEEEEEEEEEEEEK!"); | ||
825 | return; | ||
826 | } | ||
827 | img->ref--; | ||
828 | DBG("... img ref-- = %i", img->ref); | ||
829 | if (img->ref == 0) | ||
830 | { | ||
831 | DBG("... img cache %p '%s'", img, img->file.file); | ||
832 | img_cache(img); | ||
833 | } | ||
834 | } | ||
835 | |||
836 | static void | ||
837 | img_unloaddata(Img *img) | ||
838 | { | ||
839 | DBG("img_unloaddata() %p '%s'", img, img->file.file); | ||
840 | if ((img->dref <= 0) && (img->useless) && (img->mem)) | ||
841 | { | ||
842 | Image_Entry *ie = (Image_Entry *)img; | ||
843 | |||
844 | DBG("... really do forced unload"); | ||
845 | if (!img->active) cache_usage -= img->usage; | ||
846 | img->usage -= | ||
847 | (4096 * (((img->image.w * img->image.h * sizeof(DATA32)) + 4095) / 4096)) + | ||
848 | sizeof(Mem); | ||
849 | if (!img->active) cache_usage += img->usage; | ||
850 | evas_cserve_mem_free(img->mem); | ||
851 | stat_mems = eina_list_remove(stat_mems, img->mem); | ||
852 | img->mem = NULL; | ||
853 | img->image.data = NULL; | ||
854 | img->dref = 0; | ||
855 | DBG("... done"); | ||
856 | |||
857 | ie->flags.loaded = 0; | ||
858 | ie->allocated.w = 0; | ||
859 | ie->allocated.h = 0; | ||
860 | } | ||
861 | } | ||
862 | |||
863 | static void | ||
864 | img_useless(Img *img) | ||
865 | { | ||
866 | DBG("img_useless() %p", img); | ||
867 | img->useless = 1; | ||
868 | if (img->dref <= 0) img_unloaddata(img); | ||
869 | } | ||
870 | |||
871 | static void | ||
872 | img_forcedunload(Img *img) | ||
873 | { | ||
874 | DBG("img_forcedunload() %p", img); | ||
875 | img->dead = 1; | ||
876 | img_unload(img); | ||
877 | } | ||
878 | |||
879 | static void | ||
880 | img_preload(Img *img) | ||
881 | { | ||
882 | DBG("img_preload() %p", img); | ||
883 | } | ||
884 | |||
885 | static void | ||
886 | client_del(void *data, Client *c) | ||
887 | { | ||
888 | Eina_List *images; | ||
889 | Img *img; | ||
890 | |||
891 | images = data; | ||
892 | DBG("... CLIENT DEL %i", c->pid); | ||
893 | EINA_LIST_FREE(images, img) | ||
894 | { | ||
895 | DBG("... unloaddata img %p", img); | ||
896 | img_unloaddata(img); | ||
897 | DBG("... unload img %p", img); | ||
898 | img_unload(img); | ||
899 | } | ||
900 | } | ||
901 | |||
902 | static Eina_Bool | ||
903 | getinfo_hash_image_cb(const Eina_Hash *hash __UNUSED__, | ||
904 | const void *key __UNUSED__, | ||
905 | void *data, void *fdata __UNUSED__) | ||
906 | { | ||
907 | Img *img = data; | ||
908 | Eina_List **list = fdata; | ||
909 | |||
910 | *list = eina_list_append(*list, img); | ||
911 | return 1; | ||
912 | } | ||
913 | |||
914 | #ifdef BUILD_PTHREAD | ||
915 | static void * | ||
916 | load_data_thread(void *data) | ||
917 | { | ||
918 | Load_Inf *li = data; | ||
919 | Img *img = li->img; | ||
920 | Client *c = li->c; | ||
921 | Op_Loaddata_Reply msg; | ||
922 | |||
923 | free(li); | ||
924 | LKL(img->lock); | ||
925 | if (img->mem) | ||
926 | { | ||
927 | memset(&msg, 0, sizeof(msg)); | ||
928 | msg.mem.id = img->mem->id; | ||
929 | msg.mem.offset = img->mem->offset; | ||
930 | msg.mem.size = img->mem->size; | ||
931 | DBG("... reply"); | ||
932 | evas_cserve_client_send(c, OP_LOADDATA, sizeof(msg), (unsigned char *)(&msg)); | ||
933 | LKU(c->lock); | ||
934 | return NULL; | ||
935 | } | ||
936 | img_loaddata(img); | ||
937 | memset(&msg, 0, sizeof(msg)); | ||
938 | if (img->mem) | ||
939 | { | ||
940 | msg.mem.id = img->mem->id; | ||
941 | msg.mem.offset = img->mem->offset; | ||
942 | msg.mem.size = img->mem->size; | ||
943 | } | ||
944 | else | ||
945 | msg.mem.id = msg.mem.offset = msg.mem.size = 0; | ||
946 | LKU(img->lock); | ||
947 | DBG("... reply"); | ||
948 | evas_cserve_client_send(c, OP_LOADDATA, sizeof(msg), (unsigned char *)(&msg)); | ||
949 | LKU(c->lock); | ||
950 | return NULL; | ||
951 | } | ||
952 | #endif | ||
953 | |||
954 | static int | ||
955 | message(void *fdata __UNUSED__, Server *s __UNUSED__, Client *c, int opcode, int size, unsigned char *data) | ||
956 | { | ||
957 | // copy data into local aligned buffer... in case. | ||
958 | unsigned char *tdata = alloca(size + 16); | ||
959 | memcpy(tdata, data, size); | ||
960 | |||
961 | t_now = time(NULL); | ||
962 | DBG("message @ %i...", (int)t_now); | ||
963 | switch (opcode) | ||
964 | { | ||
965 | case OP_INIT: | ||
966 | { | ||
967 | Op_Init *rep; | ||
968 | Op_Init msg; | ||
969 | |||
970 | memset(&msg, 0, sizeof(msg)); | ||
971 | msg.pid = getpid(); | ||
972 | msg.server_id = server_id; | ||
973 | msg.handle = c; | ||
974 | rep = (Op_Init *)tdata; | ||
975 | c->pid = rep->pid; | ||
976 | if (rep->server_id == 1) // 2nd channel conn | ||
977 | { | ||
978 | c->client_main = rep->handle; | ||
979 | } | ||
980 | c->func = client_del; | ||
981 | c->data = NULL; | ||
982 | DBG("OP_INIT %i", c->pid); | ||
983 | DBG("... reply"); | ||
984 | evas_cserve_client_send(c, OP_INIT, sizeof(msg), (unsigned char *)(&msg)); | ||
985 | } | ||
986 | break; | ||
987 | case OP_LOAD: | ||
988 | { | ||
989 | Op_Load *rep; | ||
990 | Op_Load_Reply msg; | ||
991 | Img *img; | ||
992 | RGBA_Image_Loadopts lopt; | ||
993 | char *file = NULL, *key = NULL; | ||
994 | |||
995 | memset(&lopt, 0, sizeof lopt); | ||
996 | DBG("OP_LOAD %i", c->pid); | ||
997 | rep = (Op_Load *)tdata; | ||
998 | file = (char*) (data + sizeof(Op_Load)); | ||
999 | key = file + strlen(file) + 1; | ||
1000 | if (key[0] == 0) key = NULL; | ||
1001 | lopt.scale_down_by = rep->lopt.scale_down_by; | ||
1002 | lopt.dpi = rep->lopt.dpi; | ||
1003 | lopt.w = rep->lopt.w; | ||
1004 | lopt.h = rep->lopt.h; | ||
1005 | lopt.region.x = rep->lopt.region.x; | ||
1006 | lopt.region.y = rep->lopt.region.y; | ||
1007 | lopt.region.w = rep->lopt.region.w; | ||
1008 | lopt.region.h = rep->lopt.region.h; | ||
1009 | DBG("... img_load '%s'", file); | ||
1010 | if (key) DBG("'%s'", (char *)key); | ||
1011 | else DBG(" '%s'", ""); | ||
1012 | DBG(" lopt { %i %1.1f %i %i { %i %i %i %i}}", | ||
1013 | lopt.scale_down_by, lopt.dpi, lopt.w, lopt.h, | ||
1014 | lopt.region.x, lopt.region.y, lopt.region.w, lopt.region.h); | ||
1015 | img = img_load(file, key, &lopt); | ||
1016 | DBG("... img_load = %p", img); | ||
1017 | if (img) | ||
1018 | { | ||
1019 | DBG("... add image to client list"); | ||
1020 | if (c->client_main) | ||
1021 | c->client_main->data = eina_list_append(c->client_main->data, img); | ||
1022 | else | ||
1023 | c->data = eina_list_append(c->data, img); | ||
1024 | } | ||
1025 | memset(&msg, 0, sizeof(msg)); | ||
1026 | msg.handle = img; | ||
1027 | if ((img) && (img->mem)) | ||
1028 | { | ||
1029 | msg.mem.id = img->mem->id; | ||
1030 | msg.mem.offset = img->mem->offset; | ||
1031 | msg.mem.size = img->mem->size; | ||
1032 | img->stats.load2saved++; | ||
1033 | stats_update(); | ||
1034 | } | ||
1035 | else | ||
1036 | msg.mem.id = msg.mem.offset = msg.mem.size = 0; | ||
1037 | if (img) | ||
1038 | { | ||
1039 | msg.image.w = img->image.w; | ||
1040 | msg.image.h = img->image.h; | ||
1041 | msg.image.alpha = img->image.alpha; | ||
1042 | } | ||
1043 | DBG("... reply"); | ||
1044 | evas_cserve_client_send(c, OP_LOAD, sizeof(msg), (unsigned char *)(&msg)); | ||
1045 | } | ||
1046 | break; | ||
1047 | case OP_UNLOAD: | ||
1048 | { | ||
1049 | Op_Unload *rep; | ||
1050 | Img *img; | ||
1051 | |||
1052 | DBG("OP_UNLOAD %i", c->pid); | ||
1053 | rep = (Op_Unload *)tdata; | ||
1054 | img = rep->handle; | ||
1055 | if ((img) && (rep->server_id == server_id)) | ||
1056 | { | ||
1057 | Eina_Bool doflush = 0; | ||
1058 | |||
1059 | DBG("... remove %p from list", img); | ||
1060 | if (c->client_main) | ||
1061 | c->client_main->data = eina_list_remove(c->client_main->data, img); | ||
1062 | else | ||
1063 | c->data = eina_list_remove(c->data, img); | ||
1064 | DBG("... unload %p", img); | ||
1065 | LKL(img->lock); | ||
1066 | img->ref++; | ||
1067 | img_unload(img); | ||
1068 | img->ref--; | ||
1069 | if (img->ref == 0) doflush = 1; | ||
1070 | LKU(img->lock); | ||
1071 | if (doflush) | ||
1072 | img_cache(img); | ||
1073 | cache_clean(); | ||
1074 | } | ||
1075 | } | ||
1076 | break; | ||
1077 | case OP_LOADDATA: | ||
1078 | { | ||
1079 | Op_Loaddata *rep; | ||
1080 | Op_Loaddata_Reply msg; | ||
1081 | Img *img; | ||
1082 | |||
1083 | DBG("OP_LOADDATA %i", c->pid); | ||
1084 | rep = (Op_Loaddata *)tdata; | ||
1085 | img = rep->handle; | ||
1086 | if ((img) && (rep->server_id == server_id)) | ||
1087 | { | ||
1088 | if (img->mem) | ||
1089 | { | ||
1090 | DBG("... load saved - cached %p", img); | ||
1091 | img->stats.load2saved++; | ||
1092 | stats_update(); | ||
1093 | memset(&msg, 0, sizeof(msg)); | ||
1094 | if (img->mem) | ||
1095 | { | ||
1096 | msg.mem.id = img->mem->id; | ||
1097 | msg.mem.offset = img->mem->offset; | ||
1098 | msg.mem.size = img->mem->size; | ||
1099 | } | ||
1100 | else | ||
1101 | msg.mem.id = msg.mem.offset = msg.mem.size = 0; | ||
1102 | DBG("... reply"); | ||
1103 | evas_cserve_client_send(c, OP_LOADDATA, sizeof(msg), (unsigned char *)(&msg)); | ||
1104 | } | ||
1105 | else | ||
1106 | { | ||
1107 | #ifdef BUILD_PTHREAD | ||
1108 | pthread_t tid; | ||
1109 | pthread_attr_t attr; | ||
1110 | Load_Inf *li; | ||
1111 | |||
1112 | DBG("... load data %p", img); | ||
1113 | pthread_attr_init(&attr); | ||
1114 | li = calloc(1, sizeof(Load_Inf)); | ||
1115 | if (li) | ||
1116 | { | ||
1117 | li->img= img; | ||
1118 | li->c = c; | ||
1119 | LKL(c->lock); | ||
1120 | if (pthread_create(&tid, &attr, load_data_thread, li)) | ||
1121 | { | ||
1122 | perror("pthread_create()"); | ||
1123 | } | ||
1124 | else | ||
1125 | pthread_detach(tid); | ||
1126 | } | ||
1127 | pthread_attr_destroy(&attr); | ||
1128 | #else | ||
1129 | img_loaddata(img); | ||
1130 | memset(&msg, 0, sizeof(msg)); | ||
1131 | if (img->mem) | ||
1132 | { | ||
1133 | msg.mem.id = img->mem->id; | ||
1134 | msg.mem.offset = img->mem->offset; | ||
1135 | msg.mem.size = img->mem->size; | ||
1136 | } | ||
1137 | else | ||
1138 | msg.mem.id = msg.mem.offset = msg.mem.size = 0; | ||
1139 | DBG("... reply"); | ||
1140 | evas_cserve_client_send(c, OP_LOADDATA, sizeof(msg), (unsigned char *)(&msg)); | ||
1141 | #endif | ||
1142 | } | ||
1143 | } | ||
1144 | else | ||
1145 | { | ||
1146 | msg.mem.id = msg.mem.offset = msg.mem.size = 0; | ||
1147 | evas_cserve_client_send(c, OP_LOADDATA, sizeof(msg), (unsigned char *)(&msg)); | ||
1148 | } | ||
1149 | } | ||
1150 | break; | ||
1151 | case OP_UNLOADDATA: | ||
1152 | { | ||
1153 | Op_Unloaddata *rep; | ||
1154 | Img *img; | ||
1155 | |||
1156 | DBG("OP_UNLOADDATA %i", c->pid); | ||
1157 | rep = (Op_Unloaddata *)tdata; | ||
1158 | img = rep->handle; | ||
1159 | if ((img) && (rep->server_id == server_id)) | ||
1160 | { | ||
1161 | DBG("... dref--"); | ||
1162 | LKL(img->lock); | ||
1163 | img->dref--; | ||
1164 | if (img->dref < 0) img->dref = 0; | ||
1165 | DBG("... unload data %p '%s'", img, img->file.file); | ||
1166 | img_unloaddata(img); | ||
1167 | LKU(img->lock); | ||
1168 | } | ||
1169 | } | ||
1170 | break; | ||
1171 | case OP_USELESSDATA: | ||
1172 | { | ||
1173 | Op_Unloaddata *rep; | ||
1174 | Img *img; | ||
1175 | |||
1176 | DBG("OP_USELESSDATA %i", c->pid); | ||
1177 | rep = (Op_Unloaddata *)tdata; | ||
1178 | img = rep->handle; | ||
1179 | if ((img) && (rep->server_id == server_id)) | ||
1180 | { | ||
1181 | DBG("... dref--"); | ||
1182 | LKL(img->lock); | ||
1183 | img->dref--; | ||
1184 | if (img->dref < 0) img->dref = 0; | ||
1185 | DBG("... useless %p", img); | ||
1186 | img_useless(img); | ||
1187 | LKU(img->lock); | ||
1188 | } | ||
1189 | } | ||
1190 | break; | ||
1191 | case OP_PRELOAD: | ||
1192 | { | ||
1193 | Op_Preload *rep; | ||
1194 | Img *img; | ||
1195 | |||
1196 | DBG("OP_PRELOAD %i", c->pid); | ||
1197 | rep = (Op_Preload *)tdata; | ||
1198 | img = rep->handle; | ||
1199 | if ((img) && (rep->server_id == server_id)) | ||
1200 | { | ||
1201 | LKL(img->lock); | ||
1202 | if (c->client_main) | ||
1203 | c->client_main->data = eina_list_remove(c->client_main->data, img); | ||
1204 | else | ||
1205 | c->data = eina_list_remove(c->data, img); | ||
1206 | // FIXME: preload doesn't work async | ||
1207 | img_preload(img); | ||
1208 | LKU(img->lock); | ||
1209 | } | ||
1210 | } | ||
1211 | case OP_FORCEDUNLOAD: | ||
1212 | { | ||
1213 | Op_Forcedunload *rep; | ||
1214 | Img *img; | ||
1215 | |||
1216 | DBG("OP_FORCEDUNLOAD %i", c->pid); | ||
1217 | rep = (Op_Forcedunload *)tdata; | ||
1218 | img = rep->handle; | ||
1219 | if ((img) && (rep->server_id == server_id)) | ||
1220 | { | ||
1221 | Eina_Bool doflush = 0; | ||
1222 | |||
1223 | LKL(img->lock); | ||
1224 | DBG("remove %p from list", img); | ||
1225 | if (c->client_main) | ||
1226 | c->client_main->data = eina_list_remove(c->client_main->data, img); | ||
1227 | else | ||
1228 | c->data = eina_list_remove(c->data, img); | ||
1229 | DBG("... forced unload now"); | ||
1230 | img->ref++; | ||
1231 | img_forcedunload(img); | ||
1232 | img->ref--; | ||
1233 | if (img->ref == 0) doflush = 1; | ||
1234 | LKU(img->lock); | ||
1235 | if (doflush) | ||
1236 | img_cache(img); | ||
1237 | cache_clean(); | ||
1238 | } | ||
1239 | } | ||
1240 | break; | ||
1241 | case OP_GETCONFIG: | ||
1242 | { | ||
1243 | Op_Getconfig_Reply msg; | ||
1244 | |||
1245 | DBG("OP_GETCONFIG %i", c->pid); | ||
1246 | msg.cache_max_usage = cache_max_usage; | ||
1247 | msg.cache_item_timeout = cache_item_timeout; | ||
1248 | msg.cache_item_timeout_check = cache_item_timeout_check; | ||
1249 | DBG("... reply"); | ||
1250 | evas_cserve_client_send(c, OP_GETCONFIG, sizeof(msg), (unsigned char *)(&msg)); | ||
1251 | } | ||
1252 | break; | ||
1253 | case OP_SETCONFIG: | ||
1254 | { | ||
1255 | Op_Setconfig *rep; | ||
1256 | |||
1257 | DBG("OP_SETCONFIG %i", c->pid); | ||
1258 | rep = (Op_Setconfig *)tdata; | ||
1259 | cache_max_usage = rep->cache_max_usage; | ||
1260 | cache_item_timeout = rep->cache_item_timeout; | ||
1261 | cache_item_timeout_check = rep->cache_item_timeout_check; | ||
1262 | DBG("... cache timeout"); | ||
1263 | cache_timeout(t_now); | ||
1264 | DBG("... cache clean"); | ||
1265 | cache_clean(); | ||
1266 | } | ||
1267 | break; | ||
1268 | case OP_GETSTATS: | ||
1269 | { | ||
1270 | Op_Getstats_Reply msg; | ||
1271 | |||
1272 | DBG("OP_GETSTATS %i", c->pid); | ||
1273 | stats_calc(); | ||
1274 | msg.saved_memory = saved_memory; | ||
1275 | msg.wasted_memory = (real_memory - alloced_memory); | ||
1276 | msg.saved_memory_peak = saved_memory_peak; | ||
1277 | msg.wasted_memory_peak = (real_memory_peak - alloced_memory_peak); | ||
1278 | msg.saved_time_image_header_load = saved_load_lifetime + saved_load_time; | ||
1279 | msg.saved_time_image_data_load = saved_loaddata_lifetime + saved_loaddata_time; | ||
1280 | DBG("... reply"); | ||
1281 | evas_cserve_client_send(c, OP_GETSTATS, sizeof(msg), (unsigned char *)(&msg)); | ||
1282 | } | ||
1283 | break; | ||
1284 | case OP_GETINFO: | ||
1285 | { | ||
1286 | Op_Getinfo_Reply *msg; | ||
1287 | int len; | ||
1288 | Eina_List *imgs = NULL, *l; | ||
1289 | Img *img; | ||
1290 | |||
1291 | DBG("OP_GETINFO %i", c->pid); | ||
1292 | len = sizeof(Op_Getinfo_Reply); | ||
1293 | DBG("... foreach"); | ||
1294 | if (active_images) | ||
1295 | eina_hash_foreach(active_images, getinfo_hash_image_cb, &imgs); | ||
1296 | DBG("... walk foreach list output"); | ||
1297 | LKL(cache_lock); | ||
1298 | EINA_LIST_FOREACH(cache_images, l, img) | ||
1299 | { | ||
1300 | imgs = eina_list_append(imgs, img); | ||
1301 | } | ||
1302 | LKU(cache_lock); | ||
1303 | DBG("... walk image cache"); | ||
1304 | EINA_LIST_FOREACH(imgs, l, img) | ||
1305 | { | ||
1306 | len += sizeof(Op_Getinfo_Item); | ||
1307 | if (img->file.file) len += strlen(img->file.file); | ||
1308 | len++; | ||
1309 | if (img->file.key) len += strlen(img->file.key); | ||
1310 | len++; | ||
1311 | } | ||
1312 | DBG("... malloc msg"); | ||
1313 | msg = calloc(1, len); | ||
1314 | if (msg) | ||
1315 | { | ||
1316 | unsigned char *p; | ||
1317 | |||
1318 | DBG("... init msg"); | ||
1319 | p = (unsigned char *)msg; | ||
1320 | msg->active.mem_total = 0; | ||
1321 | msg->active.count = 0; | ||
1322 | msg->cached.mem_total = 0; | ||
1323 | msg->cached.count = 0; | ||
1324 | p += sizeof(Op_Getinfo_Reply); | ||
1325 | DBG("... walk all imgs"); | ||
1326 | EINA_LIST_FOREACH(imgs, l, img) | ||
1327 | { | ||
1328 | Op_Getinfo_Item it; | ||
1329 | |||
1330 | LKL(img->lock); | ||
1331 | DBG("... img %p", img); | ||
1332 | memset(&it, 0, sizeof(Op_Getinfo_Item)); | ||
1333 | it.file_key_size = 0; | ||
1334 | if (img->file.file) | ||
1335 | { | ||
1336 | strcpy((char *)p + sizeof(Op_Getinfo_Item) + it.file_key_size, img->file.file); | ||
1337 | it.file_key_size += strlen(img->file.file); | ||
1338 | } | ||
1339 | p[sizeof(Op_Getinfo_Item) + it.file_key_size] = 0; | ||
1340 | it.file_key_size += 1; | ||
1341 | if (img->file.key) | ||
1342 | { | ||
1343 | strcpy((char *)p + sizeof(Op_Getinfo_Item) + it.file_key_size, img->file.key); | ||
1344 | it.file_key_size += strlen(img->file.key); | ||
1345 | } | ||
1346 | p[sizeof(Op_Getinfo_Item) + it.file_key_size] = 0; | ||
1347 | it.file_key_size += 1; | ||
1348 | |||
1349 | it.w = img->image.w; | ||
1350 | it.h = img->image.h; | ||
1351 | it.file_mod_time = img->file.modtime; | ||
1352 | it.file_checked_time = img->file.last_stat; | ||
1353 | if (!img->active) | ||
1354 | it.cached_time = img->cached; | ||
1355 | else | ||
1356 | it.cached_time = 0; | ||
1357 | it.refcount = img->ref; | ||
1358 | it.data_refcount = img->dref; | ||
1359 | it.memory_footprint = img->usage; | ||
1360 | it.head_load_time = img->stats.load1; | ||
1361 | it.data_load_time = img->stats.load2; | ||
1362 | it.alpha = img->image.alpha; | ||
1363 | if (img->image.data) | ||
1364 | it.data_loaded = 1; | ||
1365 | else | ||
1366 | it.data_loaded = 0; | ||
1367 | it.active = img->active; | ||
1368 | if (it.active) | ||
1369 | { | ||
1370 | msg->active.count++; | ||
1371 | msg->active.mem_total += img->usage; | ||
1372 | } | ||
1373 | else | ||
1374 | { | ||
1375 | msg->cached.count++; | ||
1376 | msg->cached.mem_total += img->usage; | ||
1377 | } | ||
1378 | it.dead = img->dead; | ||
1379 | it.useless = img->useless; | ||
1380 | DBG("... memcpy %p %p %zu ", | ||
1381 | p, &it, sizeof(Op_Getinfo_Item)); | ||
1382 | memcpy(p, &it, sizeof(Op_Getinfo_Item)); | ||
1383 | DBG("... memcpy done %p", img); | ||
1384 | p += sizeof(Op_Getinfo_Item) + it.file_key_size; | ||
1385 | LKU(img->lock); | ||
1386 | } | ||
1387 | DBG("... walk all imgs done"); | ||
1388 | msg->active.mem_total = | ||
1389 | (msg->active.mem_total + 1023) / 1024; | ||
1390 | msg->cached.mem_total = | ||
1391 | (msg->cached.mem_total + 1023) / 1024; | ||
1392 | DBG("... reply"); | ||
1393 | evas_cserve_client_send(c, OP_GETINFO, len, (unsigned char *)msg); | ||
1394 | free(msg); | ||
1395 | } | ||
1396 | else | ||
1397 | { | ||
1398 | DBG("... reply empty"); | ||
1399 | evas_cserve_client_send(c, OP_GETINFO, 0, NULL); | ||
1400 | } | ||
1401 | DBG("... free imgs list"); | ||
1402 | if (imgs) eina_list_free(imgs); | ||
1403 | } | ||
1404 | break; | ||
1405 | default: | ||
1406 | DBG("OP_... UNKNOWN??? %i opcode: %i", c->pid, opcode); | ||
1407 | break; | ||
1408 | } | ||
1409 | return 0; | ||
1410 | } | ||
1411 | |||
1412 | static void | ||
1413 | parse_args(int argc, char **argv) | ||
1414 | { | ||
1415 | int i; | ||
1416 | |||
1417 | for (i = 1; i < argc; i++) | ||
1418 | { | ||
1419 | if ((!strcmp(argv[i], "-h")) || | ||
1420 | (!strcmp(argv[i], "-help")) || | ||
1421 | (!strcmp(argv[i], "--help"))) | ||
1422 | { | ||
1423 | printf("Options:\n" | ||
1424 | "\t-h This help\n" | ||
1425 | "\t-csize Size of speculative cache (Kb)\n" | ||
1426 | "\t-ctime Maximum life of a cached image (seconds)\n" | ||
1427 | "\t-ctimecheck Time between checking the cache for timeouts (seconds)\n" | ||
1428 | "\t-debug Enable debug logging\n" | ||
1429 | "\n"); | ||
1430 | exit(0); | ||
1431 | } | ||
1432 | else if ((!strcmp(argv[i], "-csize")) && (i < (argc - 1))) | ||
1433 | { | ||
1434 | i++; | ||
1435 | cache_max_usage = atoi(argv[i]); | ||
1436 | } | ||
1437 | else if ((!strcmp(argv[i], "-ctime")) && (i < (argc - 1))) | ||
1438 | { | ||
1439 | i++; | ||
1440 | cache_item_timeout = atoi(argv[i]); | ||
1441 | } | ||
1442 | else if ((!strcmp(argv[i], "-ctimecheck")) && (i < (argc - 1))) | ||
1443 | { | ||
1444 | i++; | ||
1445 | cache_item_timeout_check = atoi(argv[i]); | ||
1446 | } | ||
1447 | else if (!strcmp(argv[i], "-debug")) | ||
1448 | { | ||
1449 | eina_log_level_set(EINA_LOG_LEVEL_DBG); | ||
1450 | } | ||
1451 | } | ||
1452 | } | ||
1453 | |||
1454 | static int exit_flag = 0; | ||
1455 | |||
1456 | static void | ||
1457 | exit_handler(int x __UNUSED__, siginfo_t *info __UNUSED__, void *data __UNUSED__) | ||
1458 | { | ||
1459 | exit_flag = 1; | ||
1460 | } | ||
1461 | |||
1462 | static void | ||
1463 | pipe_handler(int x __UNUSED__, siginfo_t *info __UNUSED__, void *data __UNUSED__) | ||
1464 | { | ||
1465 | } | ||
1466 | |||
1467 | static void | ||
1468 | signal_init(void) | ||
1469 | { | ||
1470 | struct sigaction action, old_action; | ||
1471 | |||
1472 | action.sa_handler = NULL; | ||
1473 | action.sa_sigaction = exit_handler; | ||
1474 | action.sa_flags = SA_RESTART | SA_SIGINFO; | ||
1475 | sigemptyset(&action.sa_mask); | ||
1476 | sigaction(SIGINT, &action, &old_action); | ||
1477 | |||
1478 | action.sa_handler = NULL; | ||
1479 | action.sa_sigaction = exit_handler; | ||
1480 | action.sa_flags = SA_RESTART | SA_SIGINFO; | ||
1481 | sigemptyset(&action.sa_mask); | ||
1482 | sigaction(SIGTERM, &action, &old_action); | ||
1483 | |||
1484 | action.sa_handler = NULL; | ||
1485 | action.sa_sigaction = exit_handler; | ||
1486 | action.sa_flags = SA_RESTART | SA_SIGINFO; | ||
1487 | sigemptyset(&action.sa_mask); | ||
1488 | sigaction(SIGQUIT, &action, &old_action); | ||
1489 | |||
1490 | action.sa_handler = NULL; | ||
1491 | action.sa_sigaction = pipe_handler; | ||
1492 | action.sa_flags = SA_RESTART | SA_SIGINFO; | ||
1493 | sigemptyset(&action.sa_mask); | ||
1494 | sigaction(SIGPIPE, &action, &old_action); | ||
1495 | |||
1496 | // SIGUSR1 | ||
1497 | // SIGUSR2 | ||
1498 | // SIGHUP | ||
1499 | |||
1500 | // SIGCHLD | ||
1501 | |||
1502 | // SIGSEGV | ||
1503 | // SIGILL | ||
1504 | // SIGBUS | ||
1505 | // SIGFPE | ||
1506 | // SIGABRT | ||
1507 | } | ||
1508 | |||
1509 | static void | ||
1510 | signal_shutdown(void) | ||
1511 | { | ||
1512 | } | ||
1513 | |||
1514 | int | ||
1515 | main(int argc, char **argv) | ||
1516 | { | ||
1517 | Server *s; | ||
1518 | time_t last_check, t, t_next; | ||
1519 | pid_t pid; | ||
1520 | |||
1521 | t = time(NULL); | ||
1522 | pid = getpid(); | ||
1523 | t ^= (pid << 24) | (pid << 16) | (pid << 8) | (pid); | ||
1524 | srand(t); | ||
1525 | server_id = rand(); | ||
1526 | |||
1527 | parse_args(argc, argv); | ||
1528 | |||
1529 | unsetenv("EVAS_CSERVE"); | ||
1530 | |||
1531 | eina_init(); | ||
1532 | _evas_cserve_bin_log_dom = eina_log_domain_register | ||
1533 | ("evas_cserve_bin", CSERVE_BIN_DEFAULT_COLOR); | ||
1534 | if (_evas_cserve_bin_log_dom < 0) | ||
1535 | { | ||
1536 | EINA_LOG_ERR("impossible to create a log domain."); | ||
1537 | eina_shutdown(); | ||
1538 | exit(1); | ||
1539 | } | ||
1540 | |||
1541 | DBG("evas init..."); | ||
1542 | evas_init(); | ||
1543 | DBG("img init..."); | ||
1544 | img_init(); | ||
1545 | DBG("signal init..."); | ||
1546 | signal_init(); | ||
1547 | DBG("cserve add..."); | ||
1548 | s = evas_cserve_server_add(); | ||
1549 | if (!s) | ||
1550 | { | ||
1551 | ERR("ERROR: server socket init fail. abort."); | ||
1552 | goto error; | ||
1553 | } | ||
1554 | DBG("mem open (status)..."); | ||
1555 | stat_mem = evas_cserve_mem_open(0, 0, "status", sizeof(int), 0); | ||
1556 | if (stat_mem) | ||
1557 | { | ||
1558 | WRN("WARNING: previous evas_cserve left garbage. cleaning up."); | ||
1559 | stat_clean(stat_mem); | ||
1560 | evas_cserve_mem_close(stat_mem); | ||
1561 | stat_mem = NULL; | ||
1562 | } | ||
1563 | DBG("mem new (status)..."); | ||
1564 | stat_mem = evas_cserve_mem_new(sizeof(int), "status"); | ||
1565 | if (!stat_mem) | ||
1566 | { | ||
1567 | ERR("ERROR: cannot create status shmseg. abort."); | ||
1568 | goto error; | ||
1569 | } | ||
1570 | DBG("init status..."); | ||
1571 | if (!stat_init(stat_mem)) | ||
1572 | { | ||
1573 | ERR("cannot init status shmseg. abort."); | ||
1574 | evas_cserve_mem_free(stat_mem); | ||
1575 | stat_mem = NULL; | ||
1576 | goto error; | ||
1577 | } | ||
1578 | |||
1579 | DBG("cset server message handler..."); | ||
1580 | evas_cserve_server_message_handler_set(s, message, NULL); | ||
1581 | last_check = time(NULL); | ||
1582 | t_next = 0; | ||
1583 | if (cache_item_timeout_check > 0) t_next = cache_item_timeout_check; | ||
1584 | DBG("LOOP!!! ..."); | ||
1585 | for (;;) | ||
1586 | { | ||
1587 | /* fixme: timeout 0 only her - future use timeouts for timed | ||
1588 | * housekeping */ | ||
1589 | if (exit_flag) break; | ||
1590 | DBG("wait for messages..."); | ||
1591 | evas_cserve_server_wait(s, t_next * 1000000); | ||
1592 | if (exit_flag) break; | ||
1593 | t = time(NULL); | ||
1594 | t_next = t - last_check; | ||
1595 | if ((cache_item_timeout_check > 0) && | ||
1596 | ((t_next) >= cache_item_timeout_check)) | ||
1597 | { | ||
1598 | DBG("check timeout of items..."); | ||
1599 | t_next = cache_item_timeout_check; | ||
1600 | |||
1601 | last_check = t; | ||
1602 | DBG("cache timeout..."); | ||
1603 | cache_timeout(t); | ||
1604 | DBG("meminfo check..."); | ||
1605 | meminfo_check(); | ||
1606 | DBG("mem cache adjust..."); | ||
1607 | mem_cache_adjust(); | ||
1608 | } | ||
1609 | if ((t_next <= 0) && (cache_item_timeout_check > 0)) | ||
1610 | t_next = 1; | ||
1611 | DBG("sleep for %isec...", (int)t_next); | ||
1612 | |||
1613 | LKL(strshr_freeme_lock); | ||
1614 | if (strshr_freeme_count > 0) | ||
1615 | { | ||
1616 | int i; | ||
1617 | |||
1618 | for (i = 0; i < strshr_freeme_count; i++) | ||
1619 | eina_stringshare_del(strshr_freeme[i]); | ||
1620 | strshr_freeme_count = 0; | ||
1621 | } | ||
1622 | LKU(strshr_freeme_lock); | ||
1623 | |||
1624 | LKL(cache_lock); | ||
1625 | if (cache_cleanme) | ||
1626 | { | ||
1627 | Eina_List *l; | ||
1628 | Img *img; | ||
1629 | Eina_List *kills = NULL; | ||
1630 | |||
1631 | EINA_LIST_FOREACH(cache_images, l, img) | ||
1632 | { | ||
1633 | LKL(img->lock); | ||
1634 | if (img->killme) | ||
1635 | kills = eina_list_append(kills, img); | ||
1636 | LKU(img->lock); | ||
1637 | } | ||
1638 | while (kills) | ||
1639 | { | ||
1640 | img = kills->data; | ||
1641 | kills = eina_list_remove_list(kills, kills); | ||
1642 | LKL(img->lock); | ||
1643 | cache_images = eina_list_remove(cache_images, img); | ||
1644 | img->incache--; | ||
1645 | cache_usage -= img->usage; | ||
1646 | DBG("... IMG FREE %p", img); | ||
1647 | img_free(img); | ||
1648 | } | ||
1649 | cache_cleanme = 0; | ||
1650 | } | ||
1651 | LKU(cache_lock); | ||
1652 | } | ||
1653 | DBG("end loop..."); | ||
1654 | error: | ||
1655 | DBG("cleanup..."); | ||
1656 | if (stat_mem) | ||
1657 | { | ||
1658 | DBG("clean mem stat..."); | ||
1659 | stat_clean(stat_mem); | ||
1660 | } | ||
1661 | DBG("signal shutdown..."); | ||
1662 | signal_shutdown(); | ||
1663 | DBG("img shutdown..."); | ||
1664 | img_shutdown(); | ||
1665 | if (stat_mem) | ||
1666 | { | ||
1667 | DBG("free stat mem..."); | ||
1668 | evas_cserve_mem_free(stat_mem); | ||
1669 | stat_mem = NULL; | ||
1670 | } | ||
1671 | if (s) | ||
1672 | { | ||
1673 | DBG("del server..."); | ||
1674 | evas_cserve_server_del(s); | ||
1675 | } | ||
1676 | DBG("evas shutdown..."); | ||
1677 | evas_shutdown(); | ||
1678 | eina_log_domain_unregister(_evas_cserve_bin_log_dom); | ||
1679 | DBG("eina shutdown..."); | ||
1680 | eina_shutdown(); | ||
1681 | DBG("exit.."); | ||
1682 | return 0; | ||
1683 | } | ||
diff --git a/libraries/evas/src/bin/evas_cserve_tool.c b/libraries/evas/src/bin/evas_cserve_tool.c deleted file mode 100644 index acaa703..0000000 --- a/libraries/evas/src/bin/evas_cserve_tool.c +++ /dev/null | |||
@@ -1,160 +0,0 @@ | |||
1 | #ifdef HAVE_CONFIG_H | ||
2 | # include "config.h" | ||
3 | #endif | ||
4 | |||
5 | #include "evas_cs.h" | ||
6 | |||
7 | int _cserve_tool_log_dom = -1; | ||
8 | |||
9 | int | ||
10 | main(int argc, char **argv) | ||
11 | { | ||
12 | int i; | ||
13 | |||
14 | evas_init(); | ||
15 | if (!evas_cserve_init()) | ||
16 | { | ||
17 | printf("ERROR: Cannot connect to cserve. abort\n"); | ||
18 | exit(-1); | ||
19 | } | ||
20 | |||
21 | for (i = 1; i < argc; i++) | ||
22 | { | ||
23 | if ((!strcmp(argv[i], "-h")) || | ||
24 | (!strcmp(argv[i], "-help")) || | ||
25 | (!strcmp(argv[i], "--help"))) | ||
26 | { | ||
27 | printf("Options:\n" | ||
28 | "\t-h This help\n" | ||
29 | "\tgetconfig Get configuration values\n" | ||
30 | "\tsetconfig CSIZE CTIME CTIMECHECK Set the config values\n" | ||
31 | "\tgetstats Get current cache statistics\n" | ||
32 | "\tgetinfo Get current cache content info\n" | ||
33 | ); | ||
34 | exit(0); | ||
35 | } | ||
36 | else if ((!strcmp(argv[i], "getconfig"))) | ||
37 | { | ||
38 | Op_Getconfig_Reply config; | ||
39 | |||
40 | if (!evas_cserve_raw_config_get(&config)) | ||
41 | { | ||
42 | printf("ERROR: cannot fetch config.\n"); | ||
43 | exit(-1); | ||
44 | } | ||
45 | printf("-REPLY-\n"); | ||
46 | printf("csize: %i\n", config.cache_max_usage); | ||
47 | printf("ctime: %i\n", config.cache_item_timeout); | ||
48 | printf("ctimecheck: %i\n", config.cache_item_timeout_check); | ||
49 | printf("-OK-\n"); | ||
50 | } | ||
51 | else if ((!strcmp(argv[i], "setconfig")) && (i < (argc - 3))) | ||
52 | { | ||
53 | Op_Setconfig config; | ||
54 | |||
55 | i++; | ||
56 | config.cache_max_usage = atoi(argv[i]); | ||
57 | i++; | ||
58 | config.cache_item_timeout = atoi(argv[i]); | ||
59 | i++; | ||
60 | config.cache_item_timeout_check = atoi(argv[i]); | ||
61 | if (!evas_cserve_raw_config_set(&config)) | ||
62 | { | ||
63 | printf("ERROR: cannot set config.\n"); | ||
64 | exit(-1); | ||
65 | } | ||
66 | } | ||
67 | else if ((!strcmp(argv[i], "getstats"))) | ||
68 | { | ||
69 | Op_Getstats_Reply stats; | ||
70 | |||
71 | if (!evas_cserve_raw_stats_get(&stats)) | ||
72 | { | ||
73 | printf("ERROR: cannot fetch stats.\n"); | ||
74 | exit(-1); | ||
75 | } | ||
76 | printf("-REPLY-\n"); | ||
77 | printf("saved_memory: %i Kb\n", stats.saved_memory / 1024); | ||
78 | printf("wasted_memory: %i Kb\n", stats.wasted_memory / 1024); | ||
79 | printf("saved_memory_peak: %i Kb\n", stats.saved_memory_peak / 1024); | ||
80 | printf("wasted_memory_peak: %i Kb\n", stats.wasted_memory_peak / 1024); | ||
81 | printf("saved_time_image_header_load: %1.3f sec\n", stats.saved_time_image_header_load); | ||
82 | printf("saved_time_image_data_load: %1.3f sec\n", stats.saved_time_image_data_load); | ||
83 | printf("-OK-\n"); | ||
84 | } | ||
85 | else if ((!strcmp(argv[i], "getinfo"))) | ||
86 | { | ||
87 | Op_Getinfo_Reply *info; | ||
88 | unsigned char *p; | ||
89 | int h, j; | ||
90 | |||
91 | info = evas_cserve_raw_info_get(); | ||
92 | if (!info) | ||
93 | { | ||
94 | printf("ERROR: cannot fetch info.\n"); | ||
95 | exit(-1); | ||
96 | } | ||
97 | j = info->active.count + info->cached.count; | ||
98 | printf("-REPLY-\n"); | ||
99 | printf("active_count: %i\n", info->active.count); | ||
100 | printf("active_memory: %i Kb\n", info->active.mem_total); | ||
101 | printf("cache_count: %i\n", info->cached.count); | ||
102 | printf("cache_memory: %i Kb\n", info->cached.mem_total); | ||
103 | p = (unsigned char *)info; | ||
104 | p += sizeof(Op_Getinfo_Reply); | ||
105 | for (h = 0; h < j; h++) | ||
106 | { | ||
107 | Op_Getinfo_Item it; | ||
108 | char *file, *key, buf[512]; | ||
109 | struct tm *ltm; | ||
110 | |||
111 | memcpy(&it, p, sizeof(Op_Getinfo_Item)); | ||
112 | file = (char*) (p + sizeof(Op_Getinfo_Item)); | ||
113 | key = file + strlen(file) + 1; | ||
114 | printf("-IMAGE- [#%i]\n", h); | ||
115 | printf(" file : %s\n", file); | ||
116 | printf(" key : %s\n", key); | ||
117 | printf(" size : %i x %i\n", it.w, it.h); | ||
118 | printf(" active : %i\n", (int)it.active); | ||
119 | printf(" memory used: %i bytes (%i Kb)\n", it.memory_footprint, (it.memory_footprint + 1023) / 1024); | ||
120 | printf(" has alpha : %i\n", (int)it.alpha); | ||
121 | printf(" data loaded: %i\n", (int)it.data_loaded); | ||
122 | printf(" dead : %i\n", (int)it.dead); | ||
123 | printf(" useless : %i\n", (int)it.useless); | ||
124 | printf(" image refs : %i\n", it.refcount); | ||
125 | printf(" data refs : %i\n", it.data_refcount); | ||
126 | printf(" header load: %1.5f sec\n", it.head_load_time); | ||
127 | printf(" data load : %1.5f sec\n", it.data_load_time); | ||
128 | if (it.cached_time == 0) | ||
129 | printf(" cached at : N/A\n"); | ||
130 | else | ||
131 | { | ||
132 | ltm = localtime(&(it.cached_time)); | ||
133 | if (ltm) | ||
134 | { | ||
135 | strftime(buf, sizeof(buf), "%Y.%m.%d %T", ltm); | ||
136 | printf(" cached at : %s\n", buf); | ||
137 | } | ||
138 | } | ||
139 | ltm = localtime(&(it.file_mod_time)); | ||
140 | if (ltm) | ||
141 | { | ||
142 | strftime(buf, sizeof(buf), "%Y.%m.%d %T", ltm); | ||
143 | printf(" file mod at: %s\n", buf); | ||
144 | } | ||
145 | ltm = localtime(&(it.file_checked_time)); | ||
146 | if (ltm) | ||
147 | { | ||
148 | strftime(buf, sizeof(buf), "%Y.%m.%d %T", ltm); | ||
149 | printf(" file check : %s\n", buf); | ||
150 | } | ||
151 | p += sizeof(Op_Getinfo_Item) + it.file_key_size; | ||
152 | } | ||
153 | free(info); | ||
154 | printf("-OK-\n"); | ||
155 | } | ||
156 | } | ||
157 | evas_cserve_shutdown(); | ||
158 | evas_shutdown(); | ||
159 | return 0; | ||
160 | } | ||