From c963d75dfdeec11f82e79e727062fbf89afa2c04 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 22 Apr 2012 09:19:23 +1000 Subject: Update EFL to latest beta. --- libraries/eina/AUTHORS | 2 + libraries/eina/ChangeLog | 43 + libraries/eina/Makefile.am | 44 +- libraries/eina/Makefile.in | 82 +- libraries/eina/NEWS | 14 +- libraries/eina/README | 3 +- libraries/eina/aclocal.m4 | 90 +- libraries/eina/autogen.sh | 2 +- libraries/eina/config.guess | 149 +- libraries/eina/config.h.in | 14 +- libraries/eina/config.sub | 47 +- libraries/eina/configure | 960 +++++---- libraries/eina/configure.ac | 55 +- libraries/eina/doc/Makefile.am | 3 +- libraries/eina/doc/Makefile.in | 41 +- libraries/eina/eina.pc | 6 +- libraries/eina/eina.spec | 2 +- libraries/eina/ltmain.sh | 4 +- libraries/eina/src/Makefile.in | 38 +- libraries/eina/src/examples/Makefile.am | 28 +- libraries/eina/src/examples/Makefile.in | 180 +- libraries/eina/src/examples/eina_accessor_01.c | 2 +- libraries/eina/src/examples/eina_array_01.c | 2 +- libraries/eina/src/examples/eina_array_02.c | 2 +- libraries/eina/src/examples/eina_error_01.c | 4 +- libraries/eina/src/examples/eina_file_01.c | 2 +- libraries/eina/src/examples/eina_hash_01.c | 3 + libraries/eina/src/examples/eina_hash_02.c | 3 + libraries/eina/src/examples/eina_hash_03.c | 3 + libraries/eina/src/examples/eina_hash_04.c | 3 + libraries/eina/src/examples/eina_hash_05.c | 3 + libraries/eina/src/examples/eina_hash_06.c | 3 + libraries/eina/src/examples/eina_hash_07.c | 3 + libraries/eina/src/examples/eina_hash_08.c | 3 + libraries/eina/src/examples/eina_inlist_01.c | 3 +- libraries/eina/src/examples/eina_inlist_02.c | 3 +- libraries/eina/src/examples/eina_inlist_03.c | 3 +- libraries/eina/src/examples/eina_iterator_01.c | 2 +- libraries/eina/src/examples/eina_list_01.c | 2 +- libraries/eina/src/examples/eina_list_02.c | 2 +- libraries/eina/src/examples/eina_list_03.c | 2 +- libraries/eina/src/examples/eina_list_04.c | 2 +- libraries/eina/src/examples/eina_tiler_01.c | 2 +- libraries/eina/src/include/Eina.h | 44 +- libraries/eina/src/include/Makefile.am | 3 +- libraries/eina/src/include/Makefile.in | 48 +- libraries/eina/src/include/eina_array.h | 2 +- libraries/eina/src/include/eina_config.h | 9 + libraries/eina/src/include/eina_config.h.in | 9 + libraries/eina/src/include/eina_error.h | 2 +- libraries/eina/src/include/eina_file.h | 51 + libraries/eina/src/include/eina_inarray.h | 148 +- .../eina/src/include/eina_inline_lock_win32.x | 70 +- .../eina/src/include/eina_inline_stringshare.x | 4 +- libraries/eina/src/include/eina_inline_value.x | 281 ++- libraries/eina/src/include/eina_list.h | 6 +- libraries/eina/src/include/eina_stringshare.h | 43 +- libraries/eina/src/include/eina_types.h | 32 +- libraries/eina/src/include/eina_value.h | 511 ++++- libraries/eina/src/lib/Makefile.am | 5 +- libraries/eina/src/lib/Makefile.in | 94 +- libraries/eina/src/lib/eina_binshare.c | 69 +- libraries/eina/src/lib/eina_file.c | 232 +- libraries/eina/src/lib/eina_file_win32.c | 2235 +++++++++++--------- libraries/eina/src/lib/eina_inlist.c | 5 + libraries/eina/src/lib/eina_list.c | 15 +- libraries/eina/src/lib/eina_magic.c | 5 - libraries/eina/src/lib/eina_main.c | 5 +- libraries/eina/src/lib/eina_matrixsparse.c | 2 + libraries/eina/src/lib/eina_module.c | 4 + libraries/eina/src/lib/eina_prefix.c | 22 +- libraries/eina/src/lib/eina_private.h | 2 + libraries/eina/src/lib/eina_rbtree.c | 365 ++-- libraries/eina/src/lib/eina_sched.c | 19 +- libraries/eina/src/lib/eina_share_common.c | 42 +- libraries/eina/src/lib/eina_share_common.h | 21 +- libraries/eina/src/lib/eina_stringshare.c | 77 +- libraries/eina/src/lib/eina_unicode.c | 55 +- libraries/eina/src/lib/eina_ustringshare.c | 69 +- libraries/eina/src/lib/eina_value.c | 453 +++- libraries/eina/src/modules/Makefile.in | 38 +- libraries/eina/src/modules/mp/Makefile.in | 38 +- libraries/eina/src/modules/mp/buddy/Makefile.am | 1 - libraries/eina/src/modules/mp/buddy/Makefile.in | 39 +- .../eina/src/modules/mp/chained_pool/Makefile.am | 1 - .../eina/src/modules/mp/chained_pool/Makefile.in | 39 +- .../modules/mp/chained_pool/eina_chained_mempool.c | 2 +- .../eina/src/modules/mp/ememoa_fixed/Makefile.am | 1 - .../eina/src/modules/mp/ememoa_fixed/Makefile.in | 39 +- .../eina/src/modules/mp/ememoa_unknown/Makefile.am | 1 - .../eina/src/modules/mp/ememoa_unknown/Makefile.in | 39 +- .../eina/src/modules/mp/fixed_bitmap/Makefile.am | 1 - .../eina/src/modules/mp/fixed_bitmap/Makefile.in | 39 +- libraries/eina/src/modules/mp/one_big/Makefile.am | 1 - libraries/eina/src/modules/mp/one_big/Makefile.in | 39 +- .../eina/src/modules/mp/one_big/eina_one_big.c | 2 +- .../eina/src/modules/mp/pass_through/Makefile.am | 1 - .../eina/src/modules/mp/pass_through/Makefile.in | 39 +- libraries/eina/src/tests/Makefile.am | 3 +- libraries/eina/src/tests/Makefile.in | 48 +- libraries/eina/src/tests/eina_suite.c | 3 + libraries/eina/src/tests/eina_suite.h | 1 + libraries/eina/src/tests/eina_test_clist.c | 2 +- libraries/eina/src/tests/eina_test_counter.c | 92 +- libraries/eina/src/tests/eina_test_error.c | 184 ++ libraries/eina/src/tests/eina_test_file.c | 54 + libraries/eina/src/tests/eina_test_inlist.c | 171 +- libraries/eina/src/tests/eina_test_list.c | 40 + libraries/eina/src/tests/eina_test_log.c | 217 +- libraries/eina/src/tests/eina_test_magic.c | 110 + .../eina/src/tests/eina_test_simple_xml_parser.c | 6 +- libraries/eina/src/tests/eina_test_ustr.c | 130 +- libraries/eina/src/tests/eina_test_value.c | 109 +- 113 files changed, 5744 insertions(+), 2709 deletions(-) (limited to 'libraries/eina') diff --git a/libraries/eina/AUTHORS b/libraries/eina/AUTHORS index c146e20..6091910 100644 --- a/libraries/eina/AUTHORS +++ b/libraries/eina/AUTHORS @@ -21,3 +21,5 @@ Youness Alaoui billiob (Boris Faure) Sung W. Park Guillaume Friloux +Jonas M. Gastal +Raphael Kubo da Costa diff --git a/libraries/eina/ChangeLog b/libraries/eina/ChangeLog index dfecb61..1237697 100644 --- a/libraries/eina/ChangeLog +++ b/libraries/eina/ChangeLog @@ -198,3 +198,46 @@ 2012-01-19 Shinwoo Kim * Fix compilation of eina_semaphore_lock() (Windows port) + +2012-01-20 Gustavo Barbieri + + * Add eina_model data type (generic hierarchy data access). + +2011-12-30 Vincent Torri + + * Fix Eina_RWLock code on Windows > XP. + +2012-01-29 Tom Hacohen + + * Added EINA_C_ARRAY_LENGTH, a macro that returns the length of a + standard C array. + +2012-01-31 Tom Hacohen + + * Added an Eina_Stringshare type. It's just a typedef of "const char" + this is a same kind of visual hint for the purpose of the pointer, + but again, the two types are interchangeable. + +2012-02-17 Cedric Bail + + * Fix forgotten initialization of eina list count during eina_list_split_list. + +2012-02-22 Cedric Bail + + * Add eina_file_stat. + +2012-02-27 Alexandre Becoulet + + * Add faster implementation of Eina_Rbtree. + +2012-03-07 Cedric Bail + + * Fix leak of Eina_File. + +2012-03-14 Cedric Bail + + * Fix a dead lock in Eina_File. + +2012-03-16 Raphael Kubo da Costa + + * Adjust Valgrind's CFLAGS to fix the build when it is in a non-default location. diff --git a/libraries/eina/Makefile.am b/libraries/eina/Makefile.am index 7778fd8..501653c 100644 --- a/libraries/eina/Makefile.am +++ b/libraries/eina/Makefile.am @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -ACLOCAL_AMFLAGS = -I m4 +ACLOCAL_AMFLAGS = -I m4 -I m4/common -I m4/eina SUBDIRS = src doc @@ -38,18 +38,18 @@ autogen.sh \ eina.pc.in \ eina.spec \ eina.spec.in \ -m4/efl_attribute.m4 \ -m4/efl_benchmark.m4 \ -m4/efl_compiler_flag.m4 \ -m4/efl_coverage.m4 \ -m4/efl_cpu.m4 \ -m4/efl_doxygen.m4 \ -m4/efl_fnmatch.m4 \ -m4/efl_tests.m4 \ -m4/efl_threads.m4 \ -m4/eina_bench.m4 \ -m4/eina_check.m4 \ -m4/efl_path_max.m4 +m4/common/efl_attribute.m4 \ +m4/common/efl_benchmark.m4 \ +m4/common/efl_compiler_flag.m4 \ +m4/common/efl_coverage.m4 \ +m4/common/efl_cpu.m4 \ +m4/common/efl_doxygen.m4 \ +m4/common/efl_fnmatch.m4 \ +m4/common/efl_tests.m4 \ +m4/common/efl_threads.m4 \ +m4/common/efl_path_max.m4 \ +m4/eina/eina_bench.m4 \ +m4/eina/eina_check.m4 .PHONY: doc coverage benchmark @@ -77,18 +77,16 @@ endif if EFL_ENABLE_COVERAGE lcov-reset: - @rm -rf coverage - @find . -name "*.gcda" -exec rm {} \; - @lcov --directory . --zerocounters + @rm -rf $(top_builddir)/coverage + @find $(top_builddir) -name "*.gcda" -delete + @lcov --zerocounters --directory $(top_builddir) lcov-report: - @mkdir coverage - @lcov --compat-libtool --directory $(top_srcdir)/src --capture --output-file coverage/coverage.info - @lcov -l coverage/coverage.info |grep "\\.h" |cut -d " " -f 2 > coverage/remove - @lcov -r coverage/coverage.info `cat coverage/remove` > coverage/coverage.cleaned.info - @rm coverage/remove - @mv coverage/coverage.cleaned.info coverage/coverage.info - @genhtml -t "$(PACKAGE_STRING)" -o coverage coverage/coverage.info + @mkdir $(top_builddir)/coverage + lcov --capture --compat-libtool --output-file $(top_builddir)/coverage/coverage.info --directory $(top_builddir) + lcov --remove $(top_builddir)/coverage/coverage.info '*.h' --output-file $(top_builddir)/coverage/coverage.cleaned.info + genhtml -t "$(PACKAGE_STRING)" -o $(top_builddir)/coverage/html $(top_builddir)/coverage/coverage.cleaned.info + @echo "Coverage Report at $(top_builddir)/coverage/html" coverage: @$(MAKE) lcov-reset diff --git a/libraries/eina/Makefile.in b/libraries/eina/Makefile.in index 423f4da..f72c62f 100644 --- a/libraries/eina/Makefile.in +++ b/libraries/eina/Makefile.in @@ -42,20 +42,24 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ INSTALL NEWS config.guess config.sub depcomp install-sh \ ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ - $(top_srcdir)/m4/efl_benchmark.m4 \ - $(top_srcdir)/m4/efl_compiler_flag.m4 \ - $(top_srcdir)/m4/efl_coverage.m4 $(top_srcdir)/m4/efl_cpu.m4 \ - $(top_srcdir)/m4/efl_doxygen.m4 \ - $(top_srcdir)/m4/efl_examples.m4 \ - $(top_srcdir)/m4/efl_fnmatch.m4 \ - $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ - $(top_srcdir)/m4/efl_threads.m4 \ - $(top_srcdir)/m4/efl_voltron.m4 $(top_srcdir)/m4/eina_bench.m4 \ - $(top_srcdir)/m4/eina_check.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/eina/eina_bench.m4 \ + $(top_srcdir)/m4/eina/eina_check.m4 \ + $(top_srcdir)/m4/common/efl_attribute.m4 \ + $(top_srcdir)/m4/common/efl_benchmark.m4 \ + $(top_srcdir)/m4/common/efl_compiler_flag.m4 \ + $(top_srcdir)/m4/common/efl_coverage.m4 \ + $(top_srcdir)/m4/common/efl_cpu.m4 \ + $(top_srcdir)/m4/common/efl_doxygen.m4 \ + $(top_srcdir)/m4/common/efl_examples.m4 \ + $(top_srcdir)/m4/common/efl_fnmatch.m4 \ + $(top_srcdir)/m4/common/efl_path_max.m4 \ + $(top_srcdir)/m4/common/efl_tests.m4 \ + $(top_srcdir)/m4/common/efl_threads.m4 \ + $(top_srcdir)/m4/common/efl_voltron.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -191,13 +195,13 @@ EINA_CONFIGURE_DEFAULT_MEMPOOL = @EINA_CONFIGURE_DEFAULT_MEMPOOL@ EINA_CONFIGURE_ENABLE_LOG = @EINA_CONFIGURE_ENABLE_LOG@ EINA_CONFIGURE_HAVE_DEBUG_THREADS = @EINA_CONFIGURE_HAVE_DEBUG_THREADS@ EINA_CONFIGURE_HAVE_DIRENT_H = @EINA_CONFIGURE_HAVE_DIRENT_H@ +EINA_CONFIGURE_HAVE_EXOTIC = @EINA_CONFIGURE_HAVE_EXOTIC@ EINA_CONFIGURE_HAVE_INTTYPES_H = @EINA_CONFIGURE_HAVE_INTTYPES_H@ EINA_CONFIGURE_HAVE_ON_OFF_THREADS = @EINA_CONFIGURE_HAVE_ON_OFF_THREADS@ EINA_CONFIGURE_HAVE_STDINT_H = @EINA_CONFIGURE_HAVE_STDINT_H@ EINA_CONFIGURE_HAVE_THREADS = @EINA_CONFIGURE_HAVE_THREADS@ EINA_CONFIGURE_MAGIC_DEBUG = @EINA_CONFIGURE_MAGIC_DEBUG@ EINA_CONFIGURE_SAFETY_CHECKS = @EINA_CONFIGURE_SAFETY_CHECKS@ -EINA_CPPFLAGS = @EINA_CPPFLAGS@ EINA_LIBS = @EINA_LIBS@ EINA_SIZEOF_WCHAR_T = @EINA_SIZEOF_WCHAR_T@ EMEMOA_CFLAGS = @EMEMOA_CFLAGS@ @@ -207,6 +211,8 @@ ESCAPE_LIBS = @ESCAPE_LIBS@ EVIL_CFLAGS = @EVIL_CFLAGS@ EVIL_LIBS = @EVIL_LIBS@ EXEEXT = @EXEEXT@ +EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ +EXOTIC_LIBS = @EXOTIC_LIBS@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ @@ -242,6 +248,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -315,7 +323,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ version_info = @version_info@ -ACLOCAL_AMFLAGS = -I m4 +ACLOCAL_AMFLAGS = -I m4 -I m4/common -I m4/eina SUBDIRS = src doc MAINTAINERCLEANFILES = \ Makefile.in \ @@ -350,18 +358,18 @@ autogen.sh \ eina.pc.in \ eina.spec \ eina.spec.in \ -m4/efl_attribute.m4 \ -m4/efl_benchmark.m4 \ -m4/efl_compiler_flag.m4 \ -m4/efl_coverage.m4 \ -m4/efl_cpu.m4 \ -m4/efl_doxygen.m4 \ -m4/efl_fnmatch.m4 \ -m4/efl_tests.m4 \ -m4/efl_threads.m4 \ -m4/eina_bench.m4 \ -m4/eina_check.m4 \ -m4/efl_path_max.m4 +m4/common/efl_attribute.m4 \ +m4/common/efl_benchmark.m4 \ +m4/common/efl_compiler_flag.m4 \ +m4/common/efl_coverage.m4 \ +m4/common/efl_cpu.m4 \ +m4/common/efl_doxygen.m4 \ +m4/common/efl_fnmatch.m4 \ +m4/common/efl_tests.m4 \ +m4/common/efl_threads.m4 \ +m4/common/efl_path_max.m4 \ +m4/eina/eina_bench.m4 \ +m4/eina/eina_check.m4 all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive @@ -908,18 +916,16 @@ doc: # Coverage report @EFL_ENABLE_COVERAGE_TRUE@lcov-reset: -@EFL_ENABLE_COVERAGE_TRUE@ @rm -rf coverage -@EFL_ENABLE_COVERAGE_TRUE@ @find . -name "*.gcda" -exec rm {} \; -@EFL_ENABLE_COVERAGE_TRUE@ @lcov --directory . --zerocounters +@EFL_ENABLE_COVERAGE_TRUE@ @rm -rf $(top_builddir)/coverage +@EFL_ENABLE_COVERAGE_TRUE@ @find $(top_builddir) -name "*.gcda" -delete +@EFL_ENABLE_COVERAGE_TRUE@ @lcov --zerocounters --directory $(top_builddir) @EFL_ENABLE_COVERAGE_TRUE@lcov-report: -@EFL_ENABLE_COVERAGE_TRUE@ @mkdir coverage -@EFL_ENABLE_COVERAGE_TRUE@ @lcov --compat-libtool --directory $(top_srcdir)/src --capture --output-file coverage/coverage.info -@EFL_ENABLE_COVERAGE_TRUE@ @lcov -l coverage/coverage.info |grep "\\.h" |cut -d " " -f 2 > coverage/remove -@EFL_ENABLE_COVERAGE_TRUE@ @lcov -r coverage/coverage.info `cat coverage/remove` > coverage/coverage.cleaned.info -@EFL_ENABLE_COVERAGE_TRUE@ @rm coverage/remove -@EFL_ENABLE_COVERAGE_TRUE@ @mv coverage/coverage.cleaned.info coverage/coverage.info -@EFL_ENABLE_COVERAGE_TRUE@ @genhtml -t "$(PACKAGE_STRING)" -o coverage coverage/coverage.info +@EFL_ENABLE_COVERAGE_TRUE@ @mkdir $(top_builddir)/coverage +@EFL_ENABLE_COVERAGE_TRUE@ lcov --capture --compat-libtool --output-file $(top_builddir)/coverage/coverage.info --directory $(top_builddir) +@EFL_ENABLE_COVERAGE_TRUE@ lcov --remove $(top_builddir)/coverage/coverage.info '*.h' --output-file $(top_builddir)/coverage/coverage.cleaned.info +@EFL_ENABLE_COVERAGE_TRUE@ genhtml -t "$(PACKAGE_STRING)" -o $(top_builddir)/coverage/html $(top_builddir)/coverage/coverage.cleaned.info +@EFL_ENABLE_COVERAGE_TRUE@ @echo "Coverage Report at $(top_builddir)/coverage/html" @EFL_ENABLE_COVERAGE_TRUE@coverage: @EFL_ENABLE_COVERAGE_TRUE@ @$(MAKE) lcov-reset diff --git a/libraries/eina/NEWS b/libraries/eina/NEWS index 8669aa7..b118535 100644 --- a/libraries/eina/NEWS +++ b/libraries/eina/NEWS @@ -14,8 +14,20 @@ Additions: * Deprecated eina_array_count_get(), use eina_array_count() instead. * Added eina_inarray data type * Added eina_value data type (generic value storage) + * Added eina_model data type (generic hierarchy data access) + * Add eina_file_stat. -Eina 1.1.0 +Fixes: + + * compilation errors in Eina_RWLock code when building code on Windows > XP + * stop leaking Eina_File. + * remove dead lock in Eina_File. + +Improvements: + + * faster implementation of Eina_Rbtree. + +Eina 1.1.0 (2011-12-02) Changes since Eina 1.0.0: ------------------------- diff --git a/libraries/eina/README b/libraries/eina/README index 6ff84c8..cb8b0c6 100644 --- a/libraries/eina/README +++ b/libraries/eina/README @@ -1,4 +1,4 @@ -Eina 1.1.0 +Eina 1.2.0 ****************************************************************************** @@ -11,7 +11,6 @@ Requirements: ------------- Must have: libc (pthread or windows threading support, iconv support) - libm Eina is a library providing data structure utilities for EFL that are meant to be lean, efficient and tailored to EFL's needs. This saves each diff --git a/libraries/eina/aclocal.m4 b/libraries/eina/aclocal.m4 index f26e3d1..d87f7d0 100644 --- a/libraries/eina/aclocal.m4 +++ b/libraries/eina/aclocal.m4 @@ -13,13 +13,14 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],, -[m4_warning([this file was generated for autoconf 2.65. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],, +[m4_warning([this file was generated for autoconf 2.67. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # @@ -47,7 +48,10 @@ To do so, use the procedure documented by the package, typically `autoreconf'.]) AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) -AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi @@ -60,7 +64,6 @@ if test -n "$PKG_CONFIG"; then AC_MSG_RESULT([no]) PKG_CONFIG="" fi - fi[]dnl ])# PKG_PROG_PKG_CONFIG @@ -69,34 +72,31 @@ fi[]dnl # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # -# -# Similar to PKG_CHECK_MODULES, make sure that the first instance of -# this or PKG_CHECK_MODULES is called, or make sure to call -# PKG_CHECK_EXISTS manually +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +# only at the first occurence in configure.ac, so if the first place +# it's called might be skipped (such as if it is within an "if", you +# have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then - m4_ifval([$2], [$2], [:]) + m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) - # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], -[if test -n "$PKG_CONFIG"; then - if test -n "$$1"; then - pkg_cv_[]$1="$$1" - else - PKG_CHECK_EXISTS([$3], - [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], - [pkg_failed=yes]) - fi -else - pkg_failed=untried +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], + [pkg_failed=yes]) + else + pkg_failed=untried fi[]dnl ])# _PKG_CONFIG @@ -138,16 +138,17 @@ and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then - $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"` + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` else - $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD - ifelse([$4], , [AC_MSG_ERROR(dnl + m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS @@ -155,25 +156,24 @@ $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. -_PKG_TEXT -])], - [AC_MSG_RESULT([no]) - $4]) +_PKG_TEXT])[]dnl + ]) elif test $pkg_failed = untried; then - ifelse([$4], , [AC_MSG_FAILURE(dnl + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT -To get pkg-config, see .])], - [$4]) +To get pkg-config, see .])[]dnl + ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) - ifelse([$3], , :, [$3]) + $3 fi[]dnl ])# PKG_CHECK_MODULES @@ -1134,20 +1134,20 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR -m4_include([m4/efl_attribute.m4]) -m4_include([m4/efl_benchmark.m4]) -m4_include([m4/efl_compiler_flag.m4]) -m4_include([m4/efl_coverage.m4]) -m4_include([m4/efl_cpu.m4]) -m4_include([m4/efl_doxygen.m4]) -m4_include([m4/efl_examples.m4]) -m4_include([m4/efl_fnmatch.m4]) -m4_include([m4/efl_path_max.m4]) -m4_include([m4/efl_tests.m4]) -m4_include([m4/efl_threads.m4]) -m4_include([m4/efl_voltron.m4]) -m4_include([m4/eina_bench.m4]) -m4_include([m4/eina_check.m4]) +m4_include([m4/eina/eina_bench.m4]) +m4_include([m4/eina/eina_check.m4]) +m4_include([m4/common/efl_attribute.m4]) +m4_include([m4/common/efl_benchmark.m4]) +m4_include([m4/common/efl_compiler_flag.m4]) +m4_include([m4/common/efl_coverage.m4]) +m4_include([m4/common/efl_cpu.m4]) +m4_include([m4/common/efl_doxygen.m4]) +m4_include([m4/common/efl_examples.m4]) +m4_include([m4/common/efl_fnmatch.m4]) +m4_include([m4/common/efl_path_max.m4]) +m4_include([m4/common/efl_tests.m4]) +m4_include([m4/common/efl_threads.m4]) +m4_include([m4/common/efl_voltron.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) diff --git a/libraries/eina/autogen.sh b/libraries/eina/autogen.sh index 00116ea..25b7c2f 100755 --- a/libraries/eina/autogen.sh +++ b/libraries/eina/autogen.sh @@ -6,7 +6,7 @@ rm -f aclocal.m4 ltmain.sh touch README touch ABOUT-NLS -echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS -I m4 || exit 1 +echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS -I m4 -I m4/common -I m4/eina || exit 1 echo "Running autoheader..." ; autoheader || exit 1 echo "Running autoconf..." ; autoconf || exit 1 echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1 diff --git a/libraries/eina/config.guess b/libraries/eina/config.guess index e3a2116..c2246a4 100755 --- a/libraries/eina/config.guess +++ b/libraries/eina/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. -timestamp='2009-06-10' +timestamp='2009-12-30' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -27,16 +27,16 @@ timestamp='2009-06-10' # the same distribution terms that you use for the rest of that program. -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` @@ -56,8 +56,9 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -333,6 +334,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" @@ -807,12 +811,12 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - *:Interix*:[3456]*) + *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; - EM64T | authenticamd | genuineintel) + authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) @@ -854,6 +858,20 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ @@ -876,6 +894,17 @@ EOF frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; @@ -901,39 +930,18 @@ EOF #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -942,8 +950,11 @@ EOF *) echo hppa-unknown-linux-gnu ;; esac exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux @@ -966,58 +977,6 @@ EOF xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^LIBC/{ - s: ::g - p - }'`" - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } - ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both @@ -1247,6 +1206,16 @@ EOF *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} diff --git a/libraries/eina/config.h.in b/libraries/eina/config.h.in index 9bd97a1..09db082 100644 --- a/libraries/eina/config.h.in +++ b/libraries/eina/config.h.in @@ -110,6 +110,12 @@ */ #undef HAVE_ALLOCA_H +/* Define to 1 if you have the `backtrace' function. */ +#undef HAVE_BACKTRACE + +/* Define to 1 if you have the `backtrace_symbols' function. */ +#undef HAVE_BACKTRACE_SYMBOLS + /* Define to 1 if you have a valid header file. */ #undef HAVE_DIRENT_H @@ -125,15 +131,21 @@ /* Define to 1 if you have the `dlopen' function. */ #undef HAVE_DLOPEN -/* Set to 1 if evil package is installed */ +/* Set to 1 if Escape package is installed */ #undef HAVE_ESCAPE /* Set to 1 if evil package is installed */ #undef HAVE_EVIL +/* Define to 1 if you have the header file. */ +#undef HAVE_EXECINFO_H + /* Define to 1 if you have the `execvp' function. */ #undef HAVE_EXECVP +/* Define to 1 if you have Exotic. */ +#undef HAVE_EXOTIC_H + /* Define to 1 if you have the `fpathconf' function. */ #undef HAVE_FPATHCONF diff --git a/libraries/eina/config.sub b/libraries/eina/config.sub index eb0389a..c2d1257 100755 --- a/libraries/eina/config.sub +++ b/libraries/eina/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. -timestamp='2009-06-11' +timestamp='2010-01-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -32,13 +32,16 @@ timestamp='2009-06-11' # Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. @@ -72,8 +75,9 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -149,7 +153,7 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray) + -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; @@ -284,6 +288,7 @@ case $basic_machine in | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ + | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ @@ -291,13 +296,14 @@ case $basic_machine in | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ + | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12) + m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none @@ -340,7 +346,7 @@ case $basic_machine in | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -368,15 +374,17 @@ case $basic_machine in | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ - | romp-* | rs6000-* \ + | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile-* | tilegx-* \ | tron-* \ + | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ @@ -726,6 +734,9 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; + microblaze) + basic_machine=microblaze-xilinx + ;; mingw32) basic_machine=i386-pc os=-mingw32 @@ -1076,6 +1087,11 @@ case $basic_machine in basic_machine=tic6x-unknown os=-coff ;; + # This must be matched before tile*. + tilegx*) + basic_machine=tilegx-unknown + os=-linux-gnu + ;; tile*) basic_machine=tile-unknown os=-linux-gnu @@ -1247,6 +1263,9 @@ case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; @@ -1268,8 +1287,8 @@ case $os in # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ - | -kopensolaris* \ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ @@ -1290,7 +1309,7 @@ case $os in | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1423,6 +1442,8 @@ case $os in -dicos*) os=-dicos ;; + -nacl*) + ;; -none) ;; *) diff --git a/libraries/eina/configure b/libraries/eina/configure index d3c2f30..ef62c1d 100755 --- a/libraries/eina/configure +++ b/libraries/eina/configure @@ -1,13 +1,13 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for eina 1.1.99.67344. +# Generated by GNU Autoconf 2.67 for eina 1.2.0-alpha. # # Report bugs to . # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -319,7 +319,7 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -359,19 +359,19 @@ else fi # as_fn_arith -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -682,7 +682,7 @@ test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` @@ -701,8 +701,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='eina' PACKAGE_TARNAME='eina' -PACKAGE_VERSION='1.1.99.67344' -PACKAGE_STRING='eina 1.1.99.67344' +PACKAGE_VERSION='1.2.0-alpha' +PACKAGE_STRING='eina 1.2.0-alpha' PACKAGE_BUGREPORT='enlightenment-devel@lists.sourceforge.net' PACKAGE_URL='' @@ -810,9 +810,13 @@ EINA_CONFIGURE_HAVE_INTTYPES_H lt_enable_auto_import EINA_LIBS EINA_CFLAGS -EINA_CPPFLAGS ESCAPE_LIBS ESCAPE_CFLAGS +EINA_CONFIGURE_HAVE_EXOTIC +EINA_HAVE_EXOTIC_FALSE +EINA_HAVE_EXOTIC_TRUE +EXOTIC_LIBS +EXOTIC_CFLAGS EINA_HAVE_WIN32_FALSE EINA_HAVE_WIN32_TRUE EINA_HAVE_WINCE_FALSE @@ -833,6 +837,8 @@ EFL_BUILD_DOC_TRUE efl_doxygen efl_have_doxygen pkgconfig_requires_private +PKG_CONFIG_LIBDIR +PKG_CONFIG_PATH PKG_CONFIG CXXCPP am__fastdepCXX_FALSE @@ -1039,6 +1045,8 @@ CXXFLAGS CCC CXXCPP PKG_CONFIG +PKG_CONFIG_PATH +PKG_CONFIG_LIBDIR VALGRIND_CFLAGS VALGRIND_LIBS EVIL_CFLAGS @@ -1047,6 +1055,8 @@ EMEMOA_CFLAGS EMEMOA_LIBS ECORE_EVAS_CFLAGS ECORE_EVAS_LIBS +EXOTIC_CFLAGS +EXOTIC_LIBS ESCAPE_CFLAGS ESCAPE_LIBS CHECK_CFLAGS @@ -1115,8 +1125,9 @@ do fi case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -1161,7 +1172,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1187,7 +1198,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1391,7 +1402,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1407,7 +1418,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1437,8 +1448,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information." + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) @@ -1446,7 +1457,7 @@ Try \`$0 --help' for more information." # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1464,13 +1475,13 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error "missing argument to $ac_option" + as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; - fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1493,7 +1504,7 @@ do [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1507,8 +1518,8 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1523,9 +1534,9 @@ test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error "working directory cannot be determined" + as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error "pwd does not report name of working directory" + as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1564,11 +1575,11 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1594,7 +1605,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures eina 1.1.99.67344 to adapt to many kinds of systems. +\`configure' configures eina 1.2.0-alpha to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1608,7 +1619,7 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages + -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files @@ -1664,7 +1675,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of eina 1.1.99.67344:";; + short | recursive ) echo "Configuration of eina 1.2.0-alpha:";; esac cat <<\_ACEOF @@ -1772,6 +1783,10 @@ Some influential environment variables: CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor PKG_CONFIG path to pkg-config utility + PKG_CONFIG_PATH + directories to add to pkg-config's search path + PKG_CONFIG_LIBDIR + path overriding pkg-config's built-in search path VALGRIND_CFLAGS C compiler flags for VALGRIND, overriding pkg-config VALGRIND_LIBS @@ -1785,6 +1800,9 @@ Some influential environment variables: C compiler flags for ECORE_EVAS, overriding pkg-config ECORE_EVAS_LIBS linker flags for ECORE_EVAS, overriding pkg-config + EXOTIC_CFLAGS + C compiler flags for EXOTIC, overriding pkg-config + EXOTIC_LIBS linker flags for EXOTIC, overriding pkg-config ESCAPE_CFLAGS C compiler flags for ESCAPE, overriding pkg-config ESCAPE_LIBS linker flags for ESCAPE, overriding pkg-config @@ -1860,10 +1878,10 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -eina configure 1.1.99.67344 -generated by GNU Autoconf 2.65 +eina configure 1.2.0-alpha +generated by GNU Autoconf 2.67 -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1933,7 +1951,7 @@ $as_echo "$ac_try_echo"; } >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { + test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : @@ -1957,10 +1975,10 @@ fi ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + if eval "test \"\${$3+set}\"" = set; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -1996,7 +2014,7 @@ if ac_fn_c_try_cpp "$LINENO"; then : else ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } @@ -2019,17 +2037,15 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( cat <<\_ASBOX -## -------------------------------------------------------- ## +( $as_echo "## -------------------------------------------------------- ## ## Report this to enlightenment-devel@lists.sourceforge.net ## -## -------------------------------------------------------- ## -_ASBOX +## -------------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -2093,7 +2109,7 @@ ac_fn_c_check_header_compile () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2169,7 +2185,7 @@ ac_fn_c_check_func () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2287,7 +2303,7 @@ $as_echo "$ac_try_echo"; } >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { + test $ac_status = 0; } > conftest.i && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : @@ -2536,7 +2552,7 @@ ac_fn_c_check_type () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=no" @@ -2584,8 +2600,8 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by eina $as_me 1.1.99.67344, which was -generated by GNU Autoconf 2.65. Invocation command line was +It was created by eina $as_me 1.2.0-alpha, which was +generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ @@ -2695,11 +2711,9 @@ trap 'exit_status=$? { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( @@ -2733,11 +2747,9 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do @@ -2750,11 +2762,9 @@ _ASBOX echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## + $as_echo "## ------------------- ## ## File substitutions. ## -## ------------------- ## -_ASBOX +## ------------------- ##" echo for ac_var in $ac_subst_files do @@ -2768,11 +2778,9 @@ _ASBOX fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo cat confdefs.h echo @@ -2827,7 +2835,12 @@ _ACEOF ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site @@ -2842,7 +2855,11 @@ do { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5 ; } fi done @@ -2918,7 +2935,7 @@ if $ac_cache_corrupted; then $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2944,16 +2961,22 @@ am__api_version='1.11' ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - for ac_t in install-sh install.sh shtool; do - if test -f "$ac_dir/$ac_t"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/$ac_t -c" - break 2 - fi - done + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi done if test -z "$ac_aux_dir"; then - as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -3069,11 +3092,11 @@ am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error "unsafe absolute working directory name" "$LINENO" 5;; + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; esac # Do `set' in a subshell so we don't clobber the current shell's @@ -3095,7 +3118,7 @@ if ( # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". - as_fn_error "ls -t appears to fail. Make sure there is not a broken + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi @@ -3105,7 +3128,7 @@ then # Ok. : else - as_fn_error "newly created file is older than distributed files! + as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -3343,7 +3366,7 @@ done $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -3351,7 +3374,7 @@ SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; @@ -3385,7 +3408,7 @@ if test "`cd $srcdir && pwd`" != "`pwd`"; then am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then - as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi @@ -3401,7 +3424,7 @@ fi # Define the identity of the package. PACKAGE='eina' - VERSION='1.1.99.67344' + VERSION='1.2.0-alpha' cat >>confdefs.h <<_ACEOF @@ -3816,8 +3839,8 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "no acceptable C compiler found in \$PATH -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5 ; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3931,9 +3954,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "C compiler cannot create executables -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5 ; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -3975,8 +3997,8 @@ done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -4033,9 +4055,9 @@ $as_echo "$ac_try_echo"; } >&5 else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run C compiled programs. +as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details." "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi fi fi @@ -4086,8 +4108,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of object files: cannot compile -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5 ; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -4477,7 +4499,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -4493,11 +4515,11 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi @@ -4536,7 +4558,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -4552,18 +4574,18 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5 ; } fi ac_ext=c @@ -4624,7 +4646,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then - as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP @@ -4690,7 +4712,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then - as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP @@ -4822,8 +4844,7 @@ do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -5096,7 +5117,7 @@ fi # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } @@ -5107,16 +5128,16 @@ else test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -5141,7 +5162,7 @@ else ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi @@ -5149,7 +5170,7 @@ fi $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -5550,7 +5571,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then - as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5 + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED @@ -5629,7 +5650,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then - as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP @@ -5745,7 +5766,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then : @@ -5947,13 +5968,13 @@ if test "${lt_cv_nm_interface+set}" = set; then : else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:5950: $ac_compile\"" >&5) + (eval echo "\"\$as_me:5971: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:5953: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:5974: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:5956: output\"" >&5) + (eval echo "\"\$as_me:5977: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -7155,7 +7176,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 7158 "configure"' > conftest.$ac_ext + echo '#line 7179 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -8415,11 +8436,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8418: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8439: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8422: \$? = $ac_status" >&5 + echo "$as_me:8443: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8754,11 +8775,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8757: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8778: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:8761: \$? = $ac_status" >&5 + echo "$as_me:8782: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -8859,11 +8880,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8862: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8883: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8866: \$? = $ac_status" >&5 + echo "$as_me:8887: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -8914,11 +8935,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8917: $lt_compile\"" >&5) + (eval echo "\"\$as_me:8938: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:8921: \$? = $ac_status" >&5 + echo "$as_me:8942: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -11298,7 +11319,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11301 "configure" +#line 11322 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11394,7 +11415,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11397 "configure" +#line 11418 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11633,20 +11654,20 @@ _ACEOF cat >>confdefs.h <<_ACEOF -#define VMIN 1 +#define VMIN 2 _ACEOF cat >>confdefs.h <<_ACEOF -#define VMIC 99 +#define VMIC 0 _ACEOF cat >>confdefs.h <<_ACEOF -#define VREV 67344 +#define VREV 0 _ACEOF -version_info="2:99:1" +version_info="3:0:2" release_info="" @@ -11668,7 +11689,7 @@ case "$host_os" in MODULE_ARCH="$host_os-$host_cpu" ;; *) - MODULE_ARCH="$host_os-$host_cpu-1.1.99" + MODULE_ARCH="$host_os-$host_cpu-1.2.0" ;; esac @@ -12166,7 +12187,7 @@ if test "x${_efl_enable_win32_threads}" = "xyes" ; then mingw*) ;; *) - as_fn_error "Win32 threads support requested but non Windows system found." "$LINENO" 5 + as_fn_error $? "Win32 threads support requested but non Windows system found." "$LINENO" 5 ;; esac fi @@ -12174,7 +12195,7 @@ fi if test "x${_efl_enable_posix_threads}" = "xyes" ; then case "$host_os" in mingw*) - as_fn_error "POSIX threads support requested but Windows system found." "$LINENO" 5 + as_fn_error $? "POSIX threads support requested but Windows system found." "$LINENO" 5 ;; *) ;; @@ -12237,7 +12258,7 @@ $as_echo_n "checking whether system support POSIX threads... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_efl_have_posix_threads}" >&5 $as_echo "${_efl_have_posix_threads}" >&6; } if test "$x{_efl_enable_posix_threads}" = "xyes" && test "x${_efl_have_posix_threads}" = "xno"; then - as_fn_error "POSIX threads support requested but not found." "$LINENO" 5 + as_fn_error $? "POSIX threads support requested but not found." "$LINENO" 5 fi EFL_PTHREAD_CFLAGS="" @@ -12498,7 +12519,7 @@ _ACEOF with_max_log_level="${withval}" else - as_fn_error "--with-internal-maximum-log-level takes a decimal number, got \"${withval}\" instead." "$LINENO" 5 + as_fn_error $? "--with-internal-maximum-log-level takes a decimal number, got \"${withval}\" instead." "$LINENO" 5 fi fi @@ -12912,8 +12933,8 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "no acceptable C compiler found in \$PATH -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5 ; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -14089,7 +14110,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -14105,11 +14126,11 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi @@ -14148,7 +14169,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -14164,11 +14185,11 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else @@ -14397,7 +14418,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then : @@ -15938,11 +15959,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15941: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15962: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15945: \$? = $ac_status" >&5 + echo "$as_me:15966: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16037,11 +16058,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16040: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16061: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16044: \$? = $ac_status" >&5 + echo "$as_me:16065: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -16089,11 +16110,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16092: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16113: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16096: \$? = $ac_status" >&5 + echo "$as_me:16117: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -17041,6 +17062,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu # pkg-config + + + + if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. @@ -17153,7 +17178,6 @@ $as_echo "yes" >&6; } $as_echo "no" >&6; } PKG_CONFIG="" fi - fi # Check whether pkg-config supports Requires.private @@ -17349,11 +17373,10 @@ pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for VALGRIND" >&5 $as_echo_n "checking for VALGRIND... " >&6; } -if test -n "$PKG_CONFIG"; then - if test -n "$VALGRIND_CFLAGS"; then - pkg_cv_VALGRIND_CFLAGS="$VALGRIND_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$VALGRIND_CFLAGS"; then + pkg_cv_VALGRIND_CFLAGS="$VALGRIND_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"valgrind >= 2.4.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "valgrind >= 2.4.0") 2>&5 ac_status=$? @@ -17363,15 +17386,13 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi -if test -n "$PKG_CONFIG"; then - if test -n "$VALGRIND_LIBS"; then - pkg_cv_VALGRIND_LIBS="$VALGRIND_LIBS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$VALGRIND_LIBS"; then + pkg_cv_VALGRIND_LIBS="$VALGRIND_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"valgrind >= 2.4.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "valgrind >= 2.4.0") 2>&5 ac_status=$? @@ -17381,14 +17402,15 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -17396,30 +17418,30 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - VALGRIND_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "valgrind >= 2.4.0"` + VALGRIND_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "valgrind >= 2.4.0" 2>&1` else - VALGRIND_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "valgrind >= 2.4.0"` + VALGRIND_PKG_ERRORS=`$PKG_CONFIG --print-errors "valgrind >= 2.4.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$VALGRIND_PKG_ERRORS" >&5 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } $as_echo "#define NVALGRIND 1" >>confdefs.h if test "x${want_valgrind}" = "xyes"; then - as_fn_error "Valgrind >= 2.4.0 is required" "$LINENO" 5 + as_fn_error $? "Valgrind >= 2.4.0 is required" "$LINENO" 5 fi elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } $as_echo "#define NVALGRIND 1" >>confdefs.h if test "x${want_valgrind}" = "xyes"; then - as_fn_error "Valgrind >= 2.4.0 is required" "$LINENO" 5 + as_fn_error $? "Valgrind >= 2.4.0 is required" "$LINENO" 5 fi else @@ -17449,11 +17471,10 @@ pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVIL" >&5 $as_echo_n "checking for EVIL... " >&6; } -if test -n "$PKG_CONFIG"; then - if test -n "$EVIL_CFLAGS"; then - pkg_cv_EVIL_CFLAGS="$EVIL_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$EVIL_CFLAGS"; then + pkg_cv_EVIL_CFLAGS="$EVIL_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"evil >= 1.0.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "evil >= 1.0.0") 2>&5 ac_status=$? @@ -17463,15 +17484,13 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi -if test -n "$PKG_CONFIG"; then - if test -n "$EVIL_LIBS"; then - pkg_cv_EVIL_LIBS="$EVIL_LIBS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$EVIL_LIBS"; then + pkg_cv_EVIL_LIBS="$EVIL_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"evil >= 1.0.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "evil >= 1.0.0") 2>&5 ac_status=$? @@ -17481,14 +17500,15 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -17496,14 +17516,14 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - EVIL_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "evil >= 1.0.0"` + EVIL_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "evil >= 1.0.0" 2>&1` else - EVIL_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "evil >= 1.0.0"` + EVIL_PKG_ERRORS=`$PKG_CONFIG --print-errors "evil >= 1.0.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$EVIL_PKG_ERRORS" >&5 - as_fn_error "Package requirements (evil >= 1.0.0) were not met: + as_fn_error $? "Package requirements (evil >= 1.0.0) were not met: $EVIL_PKG_ERRORS @@ -17512,12 +17532,13 @@ installed software in a non-standard prefix. Alternatively, you may set the environment variables EVIL_CFLAGS and EVIL_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" "$LINENO" 5 +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "The pkg-config script could not be found or is too old. Make sure it +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. @@ -17526,18 +17547,18 @@ and EVIL_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . -See \`config.log' for more details." "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } else EVIL_CFLAGS=$pkg_cv_EVIL_CFLAGS EVIL_LIBS=$pkg_cv_EVIL_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - : + fi $as_echo "#define HAVE_EVIL 1" >>confdefs.h - requirement_eina="evil" + requirement_eina="${requirement_eina} evil" EFL_EINA_BUILD="-DEFL_EINA_BUILD" ;; esac @@ -17570,11 +17591,10 @@ pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMEMOA" >&5 $as_echo_n "checking for EMEMOA... " >&6; } -if test -n "$PKG_CONFIG"; then - if test -n "$EMEMOA_CFLAGS"; then - pkg_cv_EMEMOA_CFLAGS="$EMEMOA_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$EMEMOA_CFLAGS"; then + pkg_cv_EMEMOA_CFLAGS="$EMEMOA_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ememoa >= 0.0.26 \""; } >&5 ($PKG_CONFIG --exists --print-errors "ememoa >= 0.0.26 ") 2>&5 ac_status=$? @@ -17584,15 +17604,13 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi -if test -n "$PKG_CONFIG"; then - if test -n "$EMEMOA_LIBS"; then - pkg_cv_EMEMOA_LIBS="$EMEMOA_LIBS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$EMEMOA_LIBS"; then + pkg_cv_EMEMOA_LIBS="$EMEMOA_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ememoa >= 0.0.26 \""; } >&5 ($PKG_CONFIG --exists --print-errors "ememoa >= 0.0.26 ") 2>&5 ac_status=$? @@ -17602,14 +17620,15 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -17617,17 +17636,17 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - EMEMOA_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "ememoa >= 0.0.26 "` + EMEMOA_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "ememoa >= 0.0.26 " 2>&1` else - EMEMOA_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "ememoa >= 0.0.26 "` + EMEMOA_PKG_ERRORS=`$PKG_CONFIG --print-errors "ememoa >= 0.0.26 " 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$EMEMOA_PKG_ERRORS" >&5 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - enable_ememoa="no" + enable_ememoa="no" elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } enable_ememoa="no" else EMEMOA_CFLAGS=$pkg_cv_EMEMOA_CFLAGS @@ -17643,11 +17662,10 @@ pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ECORE_EVAS" >&5 $as_echo_n "checking for ECORE_EVAS... " >&6; } -if test -n "$PKG_CONFIG"; then - if test -n "$ECORE_EVAS_CFLAGS"; then - pkg_cv_ECORE_EVAS_CFLAGS="$ECORE_EVAS_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$ECORE_EVAS_CFLAGS"; then + pkg_cv_ECORE_EVAS_CFLAGS="$ECORE_EVAS_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ecore-evas ecore evas\""; } >&5 ($PKG_CONFIG --exists --print-errors "ecore-evas ecore evas") 2>&5 ac_status=$? @@ -17657,15 +17675,13 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi -if test -n "$PKG_CONFIG"; then - if test -n "$ECORE_EVAS_LIBS"; then - pkg_cv_ECORE_EVAS_LIBS="$ECORE_EVAS_LIBS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$ECORE_EVAS_LIBS"; then + pkg_cv_ECORE_EVAS_LIBS="$ECORE_EVAS_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"ecore-evas ecore evas\""; } >&5 ($PKG_CONFIG --exists --print-errors "ecore-evas ecore evas") 2>&5 ac_status=$? @@ -17675,14 +17691,15 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -17690,17 +17707,17 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - ECORE_EVAS_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "ecore-evas ecore evas"` + ECORE_EVAS_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "ecore-evas ecore evas" 2>&1` else - ECORE_EVAS_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "ecore-evas ecore evas"` + ECORE_EVAS_PKG_ERRORS=`$PKG_CONFIG --print-errors "ecore-evas ecore evas" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$ECORE_EVAS_PKG_ERRORS" >&5 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - build_tiler_example="no" + build_tiler_example="no" elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } build_tiler_example="no" else ECORE_EVAS_CFLAGS=$pkg_cv_ECORE_EVAS_CFLAGS @@ -18020,8 +18037,8 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) - as_fn_error "unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 @@ -18398,17 +18415,14 @@ fi have_wince="no" have_win32="no" -EINA_CPPFLAGS="" EINA_CFLAGS="" case "$host_os" in mingw32ce*) - EINA_CPPFLAGS="-D_WIN32_WCE=0x0420" EINA_CFLAGS="${EVIL_CFLAGS}" have_win32="yes" have_wince="yes" ;; mingw*) - EINA_CPPFLAGS="-D_WIN32_WINNT=0x0501" EINA_CFLAGS="${EVIL_CFLAGS}" have_win32="yes" ;; @@ -18569,6 +18583,98 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +### Checks for portability layer + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EXOTIC" >&5 +$as_echo_n "checking for EXOTIC... " >&6; } + +if test -n "$EXOTIC_CFLAGS"; then + pkg_cv_EXOTIC_CFLAGS="$EXOTIC_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"exotic\""; } >&5 + ($PKG_CONFIG --exists --print-errors "exotic") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_EXOTIC_CFLAGS=`$PKG_CONFIG --cflags "exotic" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi +if test -n "$EXOTIC_LIBS"; then + pkg_cv_EXOTIC_LIBS="$EXOTIC_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"exotic\""; } >&5 + ($PKG_CONFIG --exists --print-errors "exotic") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_EXOTIC_LIBS=`$PKG_CONFIG --libs "exotic" 2>/dev/null` +else + pkg_failed=yes +fi + else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + EXOTIC_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "exotic" 2>&1` + else + EXOTIC_PKG_ERRORS=`$PKG_CONFIG --print-errors "exotic" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$EXOTIC_PKG_ERRORS" >&5 + + enable_exotic="no" +elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + enable_exotic="no" +else + EXOTIC_CFLAGS=$pkg_cv_EXOTIC_CFLAGS + EXOTIC_LIBS=$pkg_cv_EXOTIC_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + enable_exotic="yes" +fi + +if test "x${enable_exotic}" = "xyes"; then + requirement_eina="exotic ${requirement_eina}" + EINA_CFLAGS="${EINA_CFLAGS} ${EXOTIC_CFLAGS}" + EINA_LIBS="${EXOTIC_LIBS}" + + EINA_CONFIGURE_HAVE_EXOTIC="#define EINA_HAVE_EXOTIC" + +$as_echo "#define HAVE_EXOTIC_H 1" >>confdefs.h + +fi + if test "x${enable_exotic}" = "xyes"; then + EINA_HAVE_EXOTIC_TRUE= + EINA_HAVE_EXOTIC_FALSE='#' +else + EINA_HAVE_EXOTIC_TRUE='#' + EINA_HAVE_EXOTIC_FALSE= +fi + + + case "$host_vendor" in ps3*) @@ -18576,11 +18682,10 @@ pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ESCAPE" >&5 $as_echo_n "checking for ESCAPE... " >&6; } -if test -n "$PKG_CONFIG"; then - if test -n "$ESCAPE_CFLAGS"; then - pkg_cv_ESCAPE_CFLAGS="$ESCAPE_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$ESCAPE_CFLAGS"; then + pkg_cv_ESCAPE_CFLAGS="$ESCAPE_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"escape\""; } >&5 ($PKG_CONFIG --exists --print-errors "escape") 2>&5 ac_status=$? @@ -18590,15 +18695,13 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi -if test -n "$PKG_CONFIG"; then - if test -n "$ESCAPE_LIBS"; then - pkg_cv_ESCAPE_LIBS="$ESCAPE_LIBS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$ESCAPE_LIBS"; then + pkg_cv_ESCAPE_LIBS="$ESCAPE_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"escape\""; } >&5 ($PKG_CONFIG --exists --print-errors "escape") 2>&5 ac_status=$? @@ -18608,14 +18711,15 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -18623,14 +18727,14 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - ESCAPE_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "escape"` + ESCAPE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "escape" 2>&1` else - ESCAPE_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "escape"` + ESCAPE_PKG_ERRORS=`$PKG_CONFIG --print-errors "escape" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$ESCAPE_PKG_ERRORS" >&5 - as_fn_error "Package requirements (escape) were not met: + as_fn_error $? "Package requirements (escape) were not met: $ESCAPE_PKG_ERRORS @@ -18639,12 +18743,13 @@ installed software in a non-standard prefix. Alternatively, you may set the environment variables ESCAPE_CFLAGS and ESCAPE_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" "$LINENO" 5 +See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "The pkg-config script could not be found or is too old. Make sure it +as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. @@ -18653,48 +18758,46 @@ and ESCAPE_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . -See \`config.log' for more details." "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } else ESCAPE_CFLAGS=$pkg_cv_ESCAPE_CFLAGS ESCAPE_LIBS=$pkg_cv_ESCAPE_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } - : + fi $as_echo "#define HAVE_ESCAPE 1" >>confdefs.h - requirement_eina="escape" + requirement_eina="${requirement_eina} escape" EINA_CFLAGS="${ESCAPE_CFLAGS} ${EINA_CFLAGS}" ;; esac - - ### Checks for linker characteristics EINA_LIBS= lt_enable_auto_import="" case "${host_os}" in mingw*) - EINA_LIBS="-ldl ${EVIL_LIBS} -lm" + EINA_LIBS="${EINA_LIBS} -ldl ${EVIL_LIBS} -lm" lt_enable_auto_import="-Wl,--enable-auto-import" ;; dragonfly*|openbsd*) - EINA_LIBS="-lm" + EINA_LIBS="${EINA_LIBS} -lm" ;; freebsd*|netbsd*) - EINA_LIBS="-lrt -lm" + EINA_LIBS="${EINA_LIBS} -lrt -lm" ;; darwin*) - EINA_LIBS="-lm" + EINA_LIBS="${EINA_LIBS} -lm" ;; cygwin*) - EINA_LIBS="-ldl -lm" + EINA_LIBS="${EINA_LIBS} -ldl -lm" ;; *) - EINA_LIBS="-ldl -lrt -lm" + EINA_LIBS="${EINA_LIBS} -lrt -ldl -lm" ;; esac case "$host_vendor" in @@ -18866,12 +18969,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -for ac_header in unistd.h libgen.h inttypes.h stdint.h sys/types.h siginfo.h strings.h sys/mman.h +for ac_header in unistd.h libgen.h inttypes.h stdint.h sys/types.h siginfo.h strings.h sys/mman.h execinfo.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -18914,9 +19016,8 @@ else if test "$ac_cv_type_wchar_t" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (wchar_t) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (wchar_t) +See \`config.log' for more details" "$LINENO" 5 ; } else ac_cv_sizeof_wchar_t=0 fi @@ -19160,8 +19261,7 @@ if test $ac_cv_os_cray = yes; then for ac_func in _getb67 GETB67 getb67; do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define CRAY_STACKSEG_END $ac_func @@ -19223,12 +19323,11 @@ _ACEOF fi -for ac_func in strlcpy openat fstatat fpathconf execvp +for ac_func in strlcpy openat fstatat fpathconf execvp backtrace backtrace_symbols do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -20366,11 +20465,10 @@ pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CHECK" >&5 $as_echo_n "checking for CHECK... " >&6; } -if test -n "$PKG_CONFIG"; then - if test -n "$CHECK_CFLAGS"; then - pkg_cv_CHECK_CFLAGS="$CHECK_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$CHECK_CFLAGS"; then + pkg_cv_CHECK_CFLAGS="$CHECK_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"check >= 0.9.5\""; } >&5 ($PKG_CONFIG --exists --print-errors "check >= 0.9.5") 2>&5 ac_status=$? @@ -20380,15 +20478,13 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi -if test -n "$PKG_CONFIG"; then - if test -n "$CHECK_LIBS"; then - pkg_cv_CHECK_LIBS="$CHECK_LIBS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$CHECK_LIBS"; then + pkg_cv_CHECK_LIBS="$CHECK_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"check >= 0.9.5\""; } >&5 ($PKG_CONFIG --exists --print-errors "check >= 0.9.5") 2>&5 ac_status=$? @@ -20398,14 +20494,15 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -20413,17 +20510,17 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - CHECK_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "check >= 0.9.5"` + CHECK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "check >= 0.9.5" 2>&1` else - CHECK_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "check >= 0.9.5"` + CHECK_PKG_ERRORS=`$PKG_CONFIG --print-errors "check >= 0.9.5" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$CHECK_PKG_ERRORS" >&5 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - _efl_enable_tests="no" + _efl_enable_tests="no" elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } _efl_enable_tests="no" else CHECK_CFLAGS=$pkg_cv_CHECK_CFLAGS @@ -20618,11 +20715,10 @@ pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 $as_echo_n "checking for GLIB... " >&6; } -if test -n "$PKG_CONFIG"; then - if test -n "$GLIB_CFLAGS"; then - pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$GLIB_CFLAGS"; then + pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5 ac_status=$? @@ -20632,15 +20728,13 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi -if test -n "$PKG_CONFIG"; then - if test -n "$GLIB_LIBS"; then - pkg_cv_GLIB_LIBS="$GLIB_LIBS" - else - if test -n "$PKG_CONFIG" && \ +if test -n "$GLIB_LIBS"; then + pkg_cv_GLIB_LIBS="$GLIB_LIBS" + elif test -n "$PKG_CONFIG"; then + if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0") 2>&5 ac_status=$? @@ -20650,14 +20744,15 @@ if test -n "$PKG_CONFIG"; then else pkg_failed=yes fi - fi -else - pkg_failed=untried + else + pkg_failed=untried fi if test $pkg_failed = yes; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes @@ -20665,17 +20760,17 @@ else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then - GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "glib-2.0"` + GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "glib-2.0" 2>&1` else - GLIB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "glib-2.0"` + GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors "glib-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLIB_PKG_ERRORS" >&5 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - have_module="no" + have_module="no" elif test $pkg_failed = untried; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } have_module="no" else GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS @@ -20884,6 +20979,7 @@ DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= +U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' @@ -20907,148 +21003,152 @@ else fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error "conditional \"AMDEP\" was never defined. + as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error "conditional \"am__fastdepCC\" was never defined. + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_HAVE_THREADS_TRUE}" && test -z "${EINA_HAVE_THREADS_FALSE}"; then - as_fn_error "conditional \"EINA_HAVE_THREADS\" was never defined. + as_fn_error $? "conditional \"EINA_HAVE_THREADS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_DEBUG_THREADS_TRUE}" && test -z "${EINA_DEBUG_THREADS_FALSE}"; then - as_fn_error "conditional \"EINA_DEBUG_THREADS\" was never defined. + as_fn_error $? "conditional \"EINA_DEBUG_THREADS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_ON_OFF_THREADS_TRUE}" && test -z "${EINA_ON_OFF_THREADS_FALSE}"; then - as_fn_error "conditional \"EINA_ON_OFF_THREADS\" was never defined. + as_fn_error $? "conditional \"EINA_ON_OFF_THREADS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${SAFETY_CHECKS_TRUE}" && test -z "${SAFETY_CHECKS_FALSE}"; then - as_fn_error "conditional \"SAFETY_CHECKS\" was never defined. + as_fn_error $? "conditional \"SAFETY_CHECKS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_AMALGAMATION_TRUE}" && test -z "${EINA_AMALGAMATION_FALSE}"; then - as_fn_error "conditional \"EINA_AMALGAMATION\" was never defined. + as_fn_error $? "conditional \"EINA_AMALGAMATION\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_ENABLE_BENCHMARK_E17_TRUE}" && test -z "${EINA_ENABLE_BENCHMARK_E17_FALSE}"; then - as_fn_error "conditional \"EINA_ENABLE_BENCHMARK_E17\" was never defined. + as_fn_error $? "conditional \"EINA_ENABLE_BENCHMARK_E17\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error "conditional \"am__fastdepCC\" was never defined. + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - as_fn_error "conditional \"am__fastdepCXX\" was never defined. + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then - as_fn_error "conditional \"am__fastdepCXX\" was never defined. + as_fn_error $? "conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EFL_BUILD_DOC_TRUE}" && test -z "${EFL_BUILD_DOC_FALSE}"; then - as_fn_error "conditional \"EFL_BUILD_DOC\" was never defined. + as_fn_error $? "conditional \"EFL_BUILD_DOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${BUILD_TILER_EXAMPLE_TRUE}" && test -z "${BUILD_TILER_EXAMPLE_FALSE}"; then - as_fn_error "conditional \"BUILD_TILER_EXAMPLE\" was never defined. + as_fn_error $? "conditional \"BUILD_TILER_EXAMPLE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_HAVE_WINCE_TRUE}" && test -z "${EINA_HAVE_WINCE_FALSE}"; then - as_fn_error "conditional \"EINA_HAVE_WINCE\" was never defined. + as_fn_error $? "conditional \"EINA_HAVE_WINCE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_HAVE_WIN32_TRUE}" && test -z "${EINA_HAVE_WIN32_FALSE}"; then - as_fn_error "conditional \"EINA_HAVE_WIN32\" was never defined. + as_fn_error $? "conditional \"EINA_HAVE_WIN32\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${EINA_HAVE_EXOTIC_TRUE}" && test -z "${EINA_HAVE_EXOTIC_FALSE}"; then + as_fn_error $? "conditional \"EINA_HAVE_EXOTIC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_BUILD_CHAINED_POOL_TRUE}" && test -z "${EINA_BUILD_CHAINED_POOL_FALSE}"; then - as_fn_error "conditional \"EINA_BUILD_CHAINED_POOL\" was never defined. + as_fn_error $? "conditional \"EINA_BUILD_CHAINED_POOL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_STATIC_BUILD_CHAINED_POOL_TRUE}" && test -z "${EINA_STATIC_BUILD_CHAINED_POOL_FALSE}"; then - as_fn_error "conditional \"EINA_STATIC_BUILD_CHAINED_POOL\" was never defined. + as_fn_error $? "conditional \"EINA_STATIC_BUILD_CHAINED_POOL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_BUILD_EMEMOA_FIXED_TRUE}" && test -z "${EINA_BUILD_EMEMOA_FIXED_FALSE}"; then - as_fn_error "conditional \"EINA_BUILD_EMEMOA_FIXED\" was never defined. + as_fn_error $? "conditional \"EINA_BUILD_EMEMOA_FIXED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_STATIC_BUILD_EMEMOA_FIXED_TRUE}" && test -z "${EINA_STATIC_BUILD_EMEMOA_FIXED_FALSE}"; then - as_fn_error "conditional \"EINA_STATIC_BUILD_EMEMOA_FIXED\" was never defined. + as_fn_error $? "conditional \"EINA_STATIC_BUILD_EMEMOA_FIXED\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_BUILD_EMEMOA_UNKNOWN_TRUE}" && test -z "${EINA_BUILD_EMEMOA_UNKNOWN_FALSE}"; then - as_fn_error "conditional \"EINA_BUILD_EMEMOA_UNKNOWN\" was never defined. + as_fn_error $? "conditional \"EINA_BUILD_EMEMOA_UNKNOWN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_STATIC_BUILD_EMEMOA_UNKNOWN_TRUE}" && test -z "${EINA_STATIC_BUILD_EMEMOA_UNKNOWN_FALSE}"; then - as_fn_error "conditional \"EINA_STATIC_BUILD_EMEMOA_UNKNOWN\" was never defined. + as_fn_error $? "conditional \"EINA_STATIC_BUILD_EMEMOA_UNKNOWN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_BUILD_FIXED_BITMAP_TRUE}" && test -z "${EINA_BUILD_FIXED_BITMAP_FALSE}"; then - as_fn_error "conditional \"EINA_BUILD_FIXED_BITMAP\" was never defined. + as_fn_error $? "conditional \"EINA_BUILD_FIXED_BITMAP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_STATIC_BUILD_FIXED_BITMAP_TRUE}" && test -z "${EINA_STATIC_BUILD_FIXED_BITMAP_FALSE}"; then - as_fn_error "conditional \"EINA_STATIC_BUILD_FIXED_BITMAP\" was never defined. + as_fn_error $? "conditional \"EINA_STATIC_BUILD_FIXED_BITMAP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_BUILD_PASS_THROUGH_TRUE}" && test -z "${EINA_BUILD_PASS_THROUGH_FALSE}"; then - as_fn_error "conditional \"EINA_BUILD_PASS_THROUGH\" was never defined. + as_fn_error $? "conditional \"EINA_BUILD_PASS_THROUGH\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_STATIC_BUILD_PASS_THROUGH_TRUE}" && test -z "${EINA_STATIC_BUILD_PASS_THROUGH_FALSE}"; then - as_fn_error "conditional \"EINA_STATIC_BUILD_PASS_THROUGH\" was never defined. + as_fn_error $? "conditional \"EINA_STATIC_BUILD_PASS_THROUGH\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_BUILD_BUDDY_TRUE}" && test -z "${EINA_BUILD_BUDDY_FALSE}"; then - as_fn_error "conditional \"EINA_BUILD_BUDDY\" was never defined. + as_fn_error $? "conditional \"EINA_BUILD_BUDDY\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_STATIC_BUILD_BUDDY_TRUE}" && test -z "${EINA_STATIC_BUILD_BUDDY_FALSE}"; then - as_fn_error "conditional \"EINA_STATIC_BUILD_BUDDY\" was never defined. + as_fn_error $? "conditional \"EINA_STATIC_BUILD_BUDDY\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_BUILD_ONE_BIG_TRUE}" && test -z "${EINA_BUILD_ONE_BIG_FALSE}"; then - as_fn_error "conditional \"EINA_BUILD_ONE_BIG\" was never defined. + as_fn_error $? "conditional \"EINA_BUILD_ONE_BIG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_STATIC_BUILD_ONE_BIG_TRUE}" && test -z "${EINA_STATIC_BUILD_ONE_BIG_FALSE}"; then - as_fn_error "conditional \"EINA_STATIC_BUILD_ONE_BIG\" was never defined. + as_fn_error $? "conditional \"EINA_STATIC_BUILD_ONE_BIG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EFL_ENABLE_TESTS_TRUE}" && test -z "${EFL_ENABLE_TESTS_FALSE}"; then - as_fn_error "conditional \"EFL_ENABLE_TESTS\" was never defined. + as_fn_error $? "conditional \"EFL_ENABLE_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EFL_ENABLE_COVERAGE_TRUE}" && test -z "${EFL_ENABLE_COVERAGE_FALSE}"; then - as_fn_error "conditional \"EFL_ENABLE_COVERAGE\" was never defined. + as_fn_error $? "conditional \"EFL_ENABLE_COVERAGE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EFL_ENABLE_BENCHMARK_TRUE}" && test -z "${EFL_ENABLE_BENCHMARK_FALSE}"; then - as_fn_error "conditional \"EFL_ENABLE_BENCHMARK\" was never defined. + as_fn_error $? "conditional \"EFL_ENABLE_BENCHMARK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EINA_HAVE_GLIB_TRUE}" && test -z "${EINA_HAVE_GLIB_FALSE}"; then - as_fn_error "conditional \"EINA_HAVE_GLIB\" was never defined. + as_fn_error $? "conditional \"EINA_HAVE_GLIB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CITYHASH_BENCH_TRUE}" && test -z "${CITYHASH_BENCH_FALSE}"; then - as_fn_error "conditional \"CITYHASH_BENCH\" was never defined. + as_fn_error $? "conditional \"CITYHASH_BENCH\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EFL_BUILD_EXAMPLES_TRUE}" && test -z "${EFL_BUILD_EXAMPLES_FALSE}"; then - as_fn_error "conditional \"EFL_BUILD_EXAMPLES\" was never defined. + as_fn_error $? "conditional \"EFL_BUILD_EXAMPLES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${EFL_INSTALL_EXAMPLES_TRUE}" && test -z "${EFL_INSTALL_EXAMPLES_FALSE}"; then - as_fn_error "conditional \"EFL_INSTALL_EXAMPLES\" was never defined. + as_fn_error $? "conditional \"EFL_INSTALL_EXAMPLES\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi @@ -21198,19 +21298,19 @@ export LANGUAGE (unset CDPATH) >/dev/null 2>&1 && unset CDPATH -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -21406,7 +21506,7 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -21459,8 +21559,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by eina $as_me 1.1.99.67344, which was -generated by GNU Autoconf 2.65. Invocation command line was +This file was extended by eina $as_me 1.2.0-alpha, which was +generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -21525,11 +21625,11 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -eina config.status 1.1.99.67344 -configured by $0, generated by GNU Autoconf 2.65, +eina config.status 1.2.0-alpha +configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -21547,11 +21647,16 @@ ac_need_defaults=: while test $# != 0 do case $1 in - --*=*) + --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; *) ac_option=$1 ac_optarg=$2 @@ -21573,6 +21678,7 @@ do $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; @@ -21585,7 +21691,7 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error "ambiguous option: \`$1' + as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; @@ -21594,7 +21700,7 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error "unrecognized option: \`$1' + -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" @@ -22024,7 +22130,7 @@ do "src/tests/Makefile") CONFIG_FILES="$CONFIG_FILES src/tests/Makefile" ;; "src/examples/Makefile") CONFIG_FILES="$CONFIG_FILES src/examples/Makefile" ;; - *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; esac done @@ -22062,7 +22168,7 @@ $debug || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -22079,7 +22185,7 @@ if test "x$ac_cr" = x; then fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\r' + ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi @@ -22093,18 +22199,18 @@ _ACEOF echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -22193,20 +22299,28 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || as_fn_error "could not setup config files machinery" "$LINENO" 5 + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// s/^[^=]*=[ ]*$// }' fi @@ -22234,7 +22348,7 @@ for ac_last_try in false false :; do if test -z "$ac_t"; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -22319,7 +22433,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error "could not setup config headers machinery" "$LINENO" 5 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -22332,7 +22446,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -22360,7 +22474,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -22387,7 +22501,7 @@ $as_echo "$as_me: creating $ac_file" >&6;} case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -22524,22 +22638,22 @@ s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 +which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} +which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # @@ -22550,19 +22664,19 @@ which seems to be undefined. Please make sure it is defined." >&2;} $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error "could not create -" "$LINENO" 5 + || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" @@ -23520,7 +23634,7 @@ _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -23541,7 +23655,7 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit $? + $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 diff --git a/libraries/eina/configure.ac b/libraries/eina/configure.ac index 367ffe1..38fb13d 100644 --- a/libraries/eina/configure.ac +++ b/libraries/eina/configure.ac @@ -1,12 +1,12 @@ ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## m4_define([v_maj], [1]) -m4_define([v_min], [1]) -m4_define([v_mic], [99]) +m4_define([v_min], [2]) +m4_define([v_mic], [0]) m4_define([v_rev], m4_esyscmd([(svnversion "${SVN_REPO_PATH:-.}" | grep -v '\(export\|Unversioned directory\)' || echo 0) | awk -F : '{printf("%s\n", $1);}' | tr -d ' :MSP\n'])) m4_if(v_rev, [0], [m4_define([v_rev], m4_esyscmd([git log 2> /dev/null | (grep -m1 git-svn-id || echo 0) | sed -e 's/.*@\([0-9]*\).*/\1/' | tr -d '\n']))]) ##-- When released, remove the dnl on the below line -dnl m4_undefine([v_rev]) +m4_undefine([v_rev]) ##-- When doing snapshots - change soname. remove dnl on below line dnl m4_define([relname], [ver-pre-svn-07]) dnl m4_define([v_rel], [-release relname]) @@ -18,7 +18,7 @@ m4_define([lt_age], v_min) ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## -AC_INIT([eina], [v_ver], [enlightenment-devel@lists.sourceforge.net]) +AC_INIT([eina], [v_ver]-alpha, [enlightenment-devel@lists.sourceforge.net]) AC_PREREQ([2.59]) AC_CONFIG_SRCDIR([configure.ac]) AC_CONFIG_MACRO_DIR([m4]) @@ -316,7 +316,7 @@ case "$host_os" in mingw*) PKG_CHECK_MODULES([EVIL], [evil >= 1.0.0]) AC_DEFINE([HAVE_EVIL], [1], [Set to 1 if evil package is installed]) - requirement_eina="evil" + requirement_eina="${requirement_eina} evil" EFL_EINA_BUILD="-DEFL_EINA_BUILD" ;; esac @@ -361,17 +361,14 @@ EFL_ATTRIBUTE_UNUSED have_wince="no" have_win32="no" -EINA_CPPFLAGS="" EINA_CFLAGS="" case "$host_os" in mingw32ce*) - EINA_CPPFLAGS="-D_WIN32_WCE=0x0420" EINA_CFLAGS="${EVIL_CFLAGS}" have_win32="yes" have_wince="yes" ;; mingw*) - EINA_CPPFLAGS="-D_WIN32_WINNT=0x0501" EINA_CFLAGS="${EVIL_CFLAGS}" have_win32="yes" ;; @@ -387,41 +384,57 @@ m4_ifdef([v_mic], EFL_COMPILER_FLAG([-Wshadow]) +### Checks for portability layer + +PKG_CHECK_MODULES([EXOTIC], + [exotic], + [enable_exotic="yes"], + [enable_exotic="no"]) + +if test "x${enable_exotic}" = "xyes"; then + requirement_eina="exotic ${requirement_eina}" + EINA_CFLAGS="${EINA_CFLAGS} ${EXOTIC_CFLAGS}" + EINA_LIBS="${EXOTIC_LIBS}" + + EINA_CONFIGURE_HAVE_EXOTIC="#define EINA_HAVE_EXOTIC" + AC_DEFINE([HAVE_EXOTIC_H], [1], [Define to 1 if you have Exotic.]) +fi +AM_CONDITIONAL([EINA_HAVE_EXOTIC], [test "x${enable_exotic}" = "xyes"]) +AC_SUBST([EINA_CONFIGURE_HAVE_EXOTIC]) + case "$host_vendor" in ps3*) PKG_CHECK_MODULES([ESCAPE], [escape]) - AC_DEFINE(HAVE_ESCAPE, 1, [Set to 1 if evil package is installed]) - requirement_eina="escape" + AC_DEFINE(HAVE_ESCAPE, 1, [Set to 1 if Escape package is installed]) + requirement_eina="${requirement_eina} escape" EINA_CFLAGS="${ESCAPE_CFLAGS} ${EINA_CFLAGS}" ;; esac -AC_SUBST([EINA_CPPFLAGS]) AC_SUBST([EINA_CFLAGS]) - ### Checks for linker characteristics EINA_LIBS= lt_enable_auto_import="" case "${host_os}" in mingw*) - EINA_LIBS="-ldl ${EVIL_LIBS} -lm" + EINA_LIBS="${EINA_LIBS} -ldl ${EVIL_LIBS} -lm" lt_enable_auto_import="-Wl,--enable-auto-import" ;; dragonfly*|openbsd*) - EINA_LIBS="-lm" + EINA_LIBS="${EINA_LIBS} -lm" ;; freebsd*|netbsd*) - EINA_LIBS="-lrt -lm" + EINA_LIBS="${EINA_LIBS} -lrt -lm" ;; darwin*) - EINA_LIBS="-lm" + EINA_LIBS="${EINA_LIBS} -lm" ;; cygwin*) - EINA_LIBS="-ldl -lm" + EINA_LIBS="${EINA_LIBS} -ldl -lm" ;; *) - EINA_LIBS="-ldl -lrt -lm" + EINA_LIBS="${EINA_LIBS} -lrt -ldl -lm" ;; esac case "$host_vendor" in @@ -443,7 +456,7 @@ LIBS="${LIBS} ${EINA_LIBS}" AC_HEADER_ASSERT AC_HEADER_TIME EFL_CHECK_PATH_MAX -AC_CHECK_HEADERS([unistd.h libgen.h inttypes.h stdint.h sys/types.h siginfo.h strings.h sys/mman.h]) +AC_CHECK_HEADERS([unistd.h libgen.h inttypes.h stdint.h sys/types.h siginfo.h strings.h sys/mman.h execinfo.h]) if test "x${ac_cv_header_inttypes_h}" = "xyes" ; then EINA_CONFIGURE_HAVE_INTTYPES_H="#define EINA_HAVE_INTTYPES_H" @@ -484,7 +497,7 @@ AC_SUBST([EINA_CONFIGURE_HAVE_DIRENT_H]) ### Checks for library functions AC_ISC_POSIX AC_FUNC_ALLOCA -AC_CHECK_FUNCS([strlcpy openat fstatat fpathconf execvp]) +AC_CHECK_FUNCS([strlcpy openat fstatat fpathconf execvp backtrace backtrace_symbols]) AC_MSG_CHECKING([for dirfd]) AC_LINK_IFELSE( @@ -785,7 +798,7 @@ if test -n "$CXX" && test "x$enable_benchmark" = "xyes" ; then fi AM_CONDITIONAL([CITYHASH_BENCH], [test -n "$CXX" && test "x$enable_benchmark" = "xyes"]) -AC_SUBST(requirement_eina) +AC_SUBST([requirement_eina]) ### Build and install examples EFL_CHECK_BUILD_EXAMPLES([enable_build_examples="yes"], [enable_build_examples="no"]) diff --git a/libraries/eina/doc/Makefile.am b/libraries/eina/doc/Makefile.am index 7856c13..33a2c9b 100644 --- a/libraries/eina/doc/Makefile.am +++ b/libraries/eina/doc/Makefile.am @@ -20,7 +20,8 @@ doc: all bzip2 -9 $(PACKAGE_DOCNAME).tar rm -rf $(PACKAGE_DOCNAME)/ mv $(PACKAGE_DOCNAME).tar.bz2 $(top_builddir) - @echo "Documentation Package: $(top_builddir)/$(PACKAGE_DOCNAME).tar.bz2" + @echo "Documentation Package: doc/$(PACKAGE_DOCNAME).tar.bz2" + @echo "Documentation HTML: doc/html" clean-local: doc-clean diff --git a/libraries/eina/doc/Makefile.in b/libraries/eina/doc/Makefile.in index 7331cf1..d2de754 100644 --- a/libraries/eina/doc/Makefile.in +++ b/libraries/eina/doc/Makefile.in @@ -37,20 +37,24 @@ subdir = doc DIST_COMMON = $(srcdir)/Doxyfile.in $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ - $(top_srcdir)/m4/efl_benchmark.m4 \ - $(top_srcdir)/m4/efl_compiler_flag.m4 \ - $(top_srcdir)/m4/efl_coverage.m4 $(top_srcdir)/m4/efl_cpu.m4 \ - $(top_srcdir)/m4/efl_doxygen.m4 \ - $(top_srcdir)/m4/efl_examples.m4 \ - $(top_srcdir)/m4/efl_fnmatch.m4 \ - $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ - $(top_srcdir)/m4/efl_threads.m4 \ - $(top_srcdir)/m4/efl_voltron.m4 $(top_srcdir)/m4/eina_bench.m4 \ - $(top_srcdir)/m4/eina_check.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/eina/eina_bench.m4 \ + $(top_srcdir)/m4/eina/eina_check.m4 \ + $(top_srcdir)/m4/common/efl_attribute.m4 \ + $(top_srcdir)/m4/common/efl_benchmark.m4 \ + $(top_srcdir)/m4/common/efl_compiler_flag.m4 \ + $(top_srcdir)/m4/common/efl_coverage.m4 \ + $(top_srcdir)/m4/common/efl_cpu.m4 \ + $(top_srcdir)/m4/common/efl_doxygen.m4 \ + $(top_srcdir)/m4/common/efl_examples.m4 \ + $(top_srcdir)/m4/common/efl_fnmatch.m4 \ + $(top_srcdir)/m4/common/efl_path_max.m4 \ + $(top_srcdir)/m4/common/efl_tests.m4 \ + $(top_srcdir)/m4/common/efl_threads.m4 \ + $(top_srcdir)/m4/common/efl_voltron.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -111,13 +115,13 @@ EINA_CONFIGURE_DEFAULT_MEMPOOL = @EINA_CONFIGURE_DEFAULT_MEMPOOL@ EINA_CONFIGURE_ENABLE_LOG = @EINA_CONFIGURE_ENABLE_LOG@ EINA_CONFIGURE_HAVE_DEBUG_THREADS = @EINA_CONFIGURE_HAVE_DEBUG_THREADS@ EINA_CONFIGURE_HAVE_DIRENT_H = @EINA_CONFIGURE_HAVE_DIRENT_H@ +EINA_CONFIGURE_HAVE_EXOTIC = @EINA_CONFIGURE_HAVE_EXOTIC@ EINA_CONFIGURE_HAVE_INTTYPES_H = @EINA_CONFIGURE_HAVE_INTTYPES_H@ EINA_CONFIGURE_HAVE_ON_OFF_THREADS = @EINA_CONFIGURE_HAVE_ON_OFF_THREADS@ EINA_CONFIGURE_HAVE_STDINT_H = @EINA_CONFIGURE_HAVE_STDINT_H@ EINA_CONFIGURE_HAVE_THREADS = @EINA_CONFIGURE_HAVE_THREADS@ EINA_CONFIGURE_MAGIC_DEBUG = @EINA_CONFIGURE_MAGIC_DEBUG@ EINA_CONFIGURE_SAFETY_CHECKS = @EINA_CONFIGURE_SAFETY_CHECKS@ -EINA_CPPFLAGS = @EINA_CPPFLAGS@ EINA_LIBS = @EINA_LIBS@ EINA_SIZEOF_WCHAR_T = @EINA_SIZEOF_WCHAR_T@ EMEMOA_CFLAGS = @EMEMOA_CFLAGS@ @@ -127,6 +131,8 @@ ESCAPE_LIBS = @ESCAPE_LIBS@ EVIL_CFLAGS = @EVIL_CFLAGS@ EVIL_LIBS = @EVIL_LIBS@ EXEEXT = @EXEEXT@ +EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ +EXOTIC_LIBS = @EXOTIC_LIBS@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ @@ -162,6 +168,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -449,7 +457,8 @@ uninstall-am: @EFL_BUILD_DOC_TRUE@ bzip2 -9 $(PACKAGE_DOCNAME).tar @EFL_BUILD_DOC_TRUE@ rm -rf $(PACKAGE_DOCNAME)/ @EFL_BUILD_DOC_TRUE@ mv $(PACKAGE_DOCNAME).tar.bz2 $(top_builddir) -@EFL_BUILD_DOC_TRUE@ @echo "Documentation Package: $(top_builddir)/$(PACKAGE_DOCNAME).tar.bz2" +@EFL_BUILD_DOC_TRUE@ @echo "Documentation Package: doc/$(PACKAGE_DOCNAME).tar.bz2" +@EFL_BUILD_DOC_TRUE@ @echo "Documentation HTML: doc/html" @EFL_BUILD_DOC_TRUE@clean-local: doc-clean diff --git a/libraries/eina/eina.pc b/libraries/eina/eina.pc index 0ca596f..68f77e4 100644 --- a/libraries/eina/eina.pc +++ b/libraries/eina/eina.pc @@ -1,4 +1,4 @@ -prefix=/opt/e17 +prefix=/usr/local exec_prefix=${prefix} libdir=${exec_prefix}/lib includedir=${prefix}/include @@ -6,7 +6,7 @@ includedir=${prefix}/include Name: Eina Description: A Library that implements fast data types and miscellaneous tools Requires.private: valgrind -Version: 1.1.99.67344 +Version: 1.2.0-alpha Libs: -L${libdir} -leina -pthread -Libs.private: -pthread -lrt -ldl -lrt -lm +Libs.private: -pthread -lrt -lrt -ldl -lm Cflags: -I${includedir}/eina-1 -I${includedir}/eina-1/eina diff --git a/libraries/eina/eina.spec b/libraries/eina/eina.spec index 0ad6732..fc564c6 100644 --- a/libraries/eina/eina.spec +++ b/libraries/eina/eina.spec @@ -3,7 +3,7 @@ Summary: Data Type Library Name: eina -Version: 1.1.99.67344 +Version: 1.2.0-alpha Release: %{_rel} License: LGPLv2.1 Group: System Environment/Libraries diff --git a/libraries/eina/ltmain.sh b/libraries/eina/ltmain.sh index 7ed280b..fa4b1e1 100755 --- a/libraries/eina/ltmain.sh +++ b/libraries/eina/ltmain.sh @@ -65,7 +65,7 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu1 +# $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu3 # automake: $automake_version # autoconf: $autoconf_version # @@ -73,7 +73,7 @@ PROGRAM=ltmain.sh PACKAGE=libtool -VERSION="2.2.6b Debian-2.2.6b-2ubuntu1" +VERSION="2.2.6b Debian-2.2.6b-2ubuntu3" TIMESTAMP="" package_revision=1.3017 diff --git a/libraries/eina/src/Makefile.in b/libraries/eina/src/Makefile.in index eb3a2c0..9076215 100644 --- a/libraries/eina/src/Makefile.in +++ b/libraries/eina/src/Makefile.in @@ -36,20 +36,24 @@ host_triplet = @host@ subdir = src DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ - $(top_srcdir)/m4/efl_benchmark.m4 \ - $(top_srcdir)/m4/efl_compiler_flag.m4 \ - $(top_srcdir)/m4/efl_coverage.m4 $(top_srcdir)/m4/efl_cpu.m4 \ - $(top_srcdir)/m4/efl_doxygen.m4 \ - $(top_srcdir)/m4/efl_examples.m4 \ - $(top_srcdir)/m4/efl_fnmatch.m4 \ - $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ - $(top_srcdir)/m4/efl_threads.m4 \ - $(top_srcdir)/m4/efl_voltron.m4 $(top_srcdir)/m4/eina_bench.m4 \ - $(top_srcdir)/m4/eina_check.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/eina/eina_bench.m4 \ + $(top_srcdir)/m4/eina/eina_check.m4 \ + $(top_srcdir)/m4/common/efl_attribute.m4 \ + $(top_srcdir)/m4/common/efl_benchmark.m4 \ + $(top_srcdir)/m4/common/efl_compiler_flag.m4 \ + $(top_srcdir)/m4/common/efl_coverage.m4 \ + $(top_srcdir)/m4/common/efl_cpu.m4 \ + $(top_srcdir)/m4/common/efl_doxygen.m4 \ + $(top_srcdir)/m4/common/efl_examples.m4 \ + $(top_srcdir)/m4/common/efl_fnmatch.m4 \ + $(top_srcdir)/m4/common/efl_path_max.m4 \ + $(top_srcdir)/m4/common/efl_tests.m4 \ + $(top_srcdir)/m4/common/efl_threads.m4 \ + $(top_srcdir)/m4/common/efl_voltron.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -150,13 +154,13 @@ EINA_CONFIGURE_DEFAULT_MEMPOOL = @EINA_CONFIGURE_DEFAULT_MEMPOOL@ EINA_CONFIGURE_ENABLE_LOG = @EINA_CONFIGURE_ENABLE_LOG@ EINA_CONFIGURE_HAVE_DEBUG_THREADS = @EINA_CONFIGURE_HAVE_DEBUG_THREADS@ EINA_CONFIGURE_HAVE_DIRENT_H = @EINA_CONFIGURE_HAVE_DIRENT_H@ +EINA_CONFIGURE_HAVE_EXOTIC = @EINA_CONFIGURE_HAVE_EXOTIC@ EINA_CONFIGURE_HAVE_INTTYPES_H = @EINA_CONFIGURE_HAVE_INTTYPES_H@ EINA_CONFIGURE_HAVE_ON_OFF_THREADS = @EINA_CONFIGURE_HAVE_ON_OFF_THREADS@ EINA_CONFIGURE_HAVE_STDINT_H = @EINA_CONFIGURE_HAVE_STDINT_H@ EINA_CONFIGURE_HAVE_THREADS = @EINA_CONFIGURE_HAVE_THREADS@ EINA_CONFIGURE_MAGIC_DEBUG = @EINA_CONFIGURE_MAGIC_DEBUG@ EINA_CONFIGURE_SAFETY_CHECKS = @EINA_CONFIGURE_SAFETY_CHECKS@ -EINA_CPPFLAGS = @EINA_CPPFLAGS@ EINA_LIBS = @EINA_LIBS@ EINA_SIZEOF_WCHAR_T = @EINA_SIZEOF_WCHAR_T@ EMEMOA_CFLAGS = @EMEMOA_CFLAGS@ @@ -166,6 +170,8 @@ ESCAPE_LIBS = @ESCAPE_LIBS@ EVIL_CFLAGS = @EVIL_CFLAGS@ EVIL_LIBS = @EVIL_LIBS@ EXEEXT = @EXEEXT@ +EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ +EXOTIC_LIBS = @EXOTIC_LIBS@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ @@ -201,6 +207,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/libraries/eina/src/examples/Makefile.am b/libraries/eina/src/examples/Makefile.am index 45b72f0..c8d80f9 100644 --- a/libraries/eina/src/examples/Makefile.am +++ b/libraries/eina/src/examples/Makefile.am @@ -37,7 +37,14 @@ SRCS = \ eina_inlist_03.c \ eina_str_01.c \ eina_strbuf_01.c \ - eina_tiler_01.c + eina_tiler_01.c \ + eina_model_01.c \ + eina_model_02.c \ + eina_model_03.c \ + eina_value_01.c \ + eina_value_02.c \ + eina_value_03.c \ + eina_inarray_01.c examples_PROGRAMS = @@ -73,7 +80,24 @@ examples_PROGRAMS += \ eina_inlist_02 \ eina_inlist_03 \ eina_str_01 \ - eina_strbuf_01 + eina_strbuf_01 \ + eina_model_01 \ + eina_model_02 \ + eina_model_03 \ + eina_model_04 \ + eina_value_01 \ + eina_value_02 \ + eina_value_03 \ + eina_inarray_01 + +eina_model_04_SOURCES = \ + eina_model_04_animal.c \ + eina_model_04_child.c \ + eina_model_04_human.c \ + eina_model_04_main.c \ + eina_model_04_parrot.c \ + eina_model_04_whistler.c + if BUILD_TILER_EXAMPLE AM_CPPFLAGS += @ECORE_EVAS_CFLAGS@ diff --git a/libraries/eina/src/examples/Makefile.in b/libraries/eina/src/examples/Makefile.in index 6e432bb..fba8439 100644 --- a/libraries/eina/src/examples/Makefile.in +++ b/libraries/eina/src/examples/Makefile.in @@ -62,27 +62,39 @@ examples_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) @EFL_BUILD_EXAMPLES_TRUE@ eina_inlist_02 \ @EFL_BUILD_EXAMPLES_TRUE@ eina_inlist_03 \ @EFL_BUILD_EXAMPLES_TRUE@ eina_str_01 \ -@EFL_BUILD_EXAMPLES_TRUE@ eina_strbuf_01 +@EFL_BUILD_EXAMPLES_TRUE@ eina_strbuf_01 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_model_01 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_model_02 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_model_03 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_model_04 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_value_01 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_value_02 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_value_03 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_inarray_01 @BUILD_TILER_EXAMPLE_TRUE@@EFL_BUILD_EXAMPLES_TRUE@am__append_2 = @ECORE_EVAS_CFLAGS@ @BUILD_TILER_EXAMPLE_TRUE@@EFL_BUILD_EXAMPLES_TRUE@am__append_3 = eina_tiler_01 subdir = src/examples DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ - $(top_srcdir)/m4/efl_benchmark.m4 \ - $(top_srcdir)/m4/efl_compiler_flag.m4 \ - $(top_srcdir)/m4/efl_coverage.m4 $(top_srcdir)/m4/efl_cpu.m4 \ - $(top_srcdir)/m4/efl_doxygen.m4 \ - $(top_srcdir)/m4/efl_examples.m4 \ - $(top_srcdir)/m4/efl_fnmatch.m4 \ - $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ - $(top_srcdir)/m4/efl_threads.m4 \ - $(top_srcdir)/m4/efl_voltron.m4 $(top_srcdir)/m4/eina_bench.m4 \ - $(top_srcdir)/m4/eina_check.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/eina/eina_bench.m4 \ + $(top_srcdir)/m4/eina/eina_check.m4 \ + $(top_srcdir)/m4/common/efl_attribute.m4 \ + $(top_srcdir)/m4/common/efl_benchmark.m4 \ + $(top_srcdir)/m4/common/efl_compiler_flag.m4 \ + $(top_srcdir)/m4/common/efl_coverage.m4 \ + $(top_srcdir)/m4/common/efl_cpu.m4 \ + $(top_srcdir)/m4/common/efl_doxygen.m4 \ + $(top_srcdir)/m4/common/efl_examples.m4 \ + $(top_srcdir)/m4/common/efl_fnmatch.m4 \ + $(top_srcdir)/m4/common/efl_path_max.m4 \ + $(top_srcdir)/m4/common/efl_tests.m4 \ + $(top_srcdir)/m4/common/efl_threads.m4 \ + $(top_srcdir)/m4/common/efl_voltron.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -114,7 +126,15 @@ CONFIG_CLEAN_VPATH_FILES = @EFL_BUILD_EXAMPLES_TRUE@ eina_inlist_02$(EXEEXT) \ @EFL_BUILD_EXAMPLES_TRUE@ eina_inlist_03$(EXEEXT) \ @EFL_BUILD_EXAMPLES_TRUE@ eina_str_01$(EXEEXT) \ -@EFL_BUILD_EXAMPLES_TRUE@ eina_strbuf_01$(EXEEXT) +@EFL_BUILD_EXAMPLES_TRUE@ eina_strbuf_01$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_model_01$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_model_02$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_model_03$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_model_04$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_value_01$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_value_02$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_value_03$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_inarray_01$(EXEEXT) @BUILD_TILER_EXAMPLE_TRUE@@EFL_BUILD_EXAMPLES_TRUE@am__EXEEXT_2 = eina_tiler_01$(EXEEXT) am__installdirs = "$(DESTDIR)$(examplesdir)" "$(DESTDIR)$(filesdir)" PROGRAMS = $(examples_PROGRAMS) @@ -173,6 +193,10 @@ eina_hash_08_SOURCES = eina_hash_08.c eina_hash_08_OBJECTS = eina_hash_08.$(OBJEXT) eina_hash_08_LDADD = $(LDADD) eina_hash_08_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_inarray_01_SOURCES = eina_inarray_01.c +eina_inarray_01_OBJECTS = eina_inarray_01.$(OBJEXT) +eina_inarray_01_LDADD = $(LDADD) +eina_inarray_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la eina_inlist_01_SOURCES = eina_inlist_01.c eina_inlist_01_OBJECTS = eina_inlist_01.$(OBJEXT) eina_inlist_01_LDADD = $(LDADD) @@ -217,6 +241,32 @@ eina_log_03_SOURCES = eina_log_03.c eina_log_03_OBJECTS = eina_log_03.$(OBJEXT) eina_log_03_LDADD = $(LDADD) eina_log_03_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_model_01_SOURCES = eina_model_01.c +eina_model_01_OBJECTS = eina_model_01.$(OBJEXT) +eina_model_01_LDADD = $(LDADD) +eina_model_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_model_02_SOURCES = eina_model_02.c +eina_model_02_OBJECTS = eina_model_02.$(OBJEXT) +eina_model_02_LDADD = $(LDADD) +eina_model_02_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_model_03_SOURCES = eina_model_03.c +eina_model_03_OBJECTS = eina_model_03.$(OBJEXT) +eina_model_03_LDADD = $(LDADD) +eina_model_03_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +am__eina_model_04_SOURCES_DIST = eina_model_04_animal.c \ + eina_model_04_child.c eina_model_04_human.c \ + eina_model_04_main.c eina_model_04_parrot.c \ + eina_model_04_whistler.c +@EFL_BUILD_EXAMPLES_TRUE@am_eina_model_04_OBJECTS = \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_model_04_animal.$(OBJEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_model_04_child.$(OBJEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_model_04_human.$(OBJEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_model_04_main.$(OBJEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_model_04_parrot.$(OBJEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_model_04_whistler.$(OBJEXT) +eina_model_04_OBJECTS = $(am_eina_model_04_OBJECTS) +eina_model_04_LDADD = $(LDADD) +eina_model_04_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la eina_str_01_SOURCES = eina_str_01.c eina_str_01_OBJECTS = eina_str_01.$(OBJEXT) eina_str_01_LDADD = $(LDADD) @@ -228,6 +278,18 @@ eina_strbuf_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la eina_tiler_01_SOURCES = eina_tiler_01.c eina_tiler_01_OBJECTS = eina_tiler_01.$(OBJEXT) @BUILD_TILER_EXAMPLE_TRUE@@EFL_BUILD_EXAMPLES_TRUE@eina_tiler_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_value_01_SOURCES = eina_value_01.c +eina_value_01_OBJECTS = eina_value_01.$(OBJEXT) +eina_value_01_LDADD = $(LDADD) +eina_value_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_value_02_SOURCES = eina_value_02.c +eina_value_02_OBJECTS = eina_value_02.$(OBJEXT) +eina_value_02_LDADD = $(LDADD) +eina_value_02_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_value_03_SOURCES = eina_value_03.c +eina_value_03_OBJECTS = eina_value_03.$(OBJEXT) +eina_value_03_LDADD = $(LDADD) +eina_value_03_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles @@ -257,19 +319,25 @@ am__v_GEN_0 = @echo " GEN " $@; SOURCES = eina_accessor_01.c eina_array_01.c eina_array_02.c \ eina_error_01.c eina_file_01.c eina_hash_01.c eina_hash_02.c \ eina_hash_03.c eina_hash_04.c eina_hash_05.c eina_hash_06.c \ - eina_hash_07.c eina_hash_08.c eina_inlist_01.c \ - eina_inlist_02.c eina_inlist_03.c eina_iterator_01.c \ - eina_list_01.c eina_list_02.c eina_list_03.c eina_list_04.c \ - eina_log_01.c eina_log_02.c eina_log_03.c eina_str_01.c \ - eina_strbuf_01.c eina_tiler_01.c + eina_hash_07.c eina_hash_08.c eina_inarray_01.c \ + eina_inlist_01.c eina_inlist_02.c eina_inlist_03.c \ + eina_iterator_01.c eina_list_01.c eina_list_02.c \ + eina_list_03.c eina_list_04.c eina_log_01.c eina_log_02.c \ + eina_log_03.c eina_model_01.c eina_model_02.c eina_model_03.c \ + $(eina_model_04_SOURCES) eina_str_01.c eina_strbuf_01.c \ + eina_tiler_01.c eina_value_01.c eina_value_02.c \ + eina_value_03.c DIST_SOURCES = eina_accessor_01.c eina_array_01.c eina_array_02.c \ eina_error_01.c eina_file_01.c eina_hash_01.c eina_hash_02.c \ eina_hash_03.c eina_hash_04.c eina_hash_05.c eina_hash_06.c \ - eina_hash_07.c eina_hash_08.c eina_inlist_01.c \ - eina_inlist_02.c eina_inlist_03.c eina_iterator_01.c \ - eina_list_01.c eina_list_02.c eina_list_03.c eina_list_04.c \ - eina_log_01.c eina_log_02.c eina_log_03.c eina_str_01.c \ - eina_strbuf_01.c eina_tiler_01.c + eina_hash_07.c eina_hash_08.c eina_inarray_01.c \ + eina_inlist_01.c eina_inlist_02.c eina_inlist_03.c \ + eina_iterator_01.c eina_list_01.c eina_list_02.c \ + eina_list_03.c eina_list_04.c eina_log_01.c eina_log_02.c \ + eina_log_03.c eina_model_01.c eina_model_02.c eina_model_03.c \ + $(am__eina_model_04_SOURCES_DIST) eina_str_01.c \ + eina_strbuf_01.c eina_tiler_01.c eina_value_01.c \ + eina_value_02.c eina_value_03.c am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -340,13 +408,13 @@ EINA_CONFIGURE_DEFAULT_MEMPOOL = @EINA_CONFIGURE_DEFAULT_MEMPOOL@ EINA_CONFIGURE_ENABLE_LOG = @EINA_CONFIGURE_ENABLE_LOG@ EINA_CONFIGURE_HAVE_DEBUG_THREADS = @EINA_CONFIGURE_HAVE_DEBUG_THREADS@ EINA_CONFIGURE_HAVE_DIRENT_H = @EINA_CONFIGURE_HAVE_DIRENT_H@ +EINA_CONFIGURE_HAVE_EXOTIC = @EINA_CONFIGURE_HAVE_EXOTIC@ EINA_CONFIGURE_HAVE_INTTYPES_H = @EINA_CONFIGURE_HAVE_INTTYPES_H@ EINA_CONFIGURE_HAVE_ON_OFF_THREADS = @EINA_CONFIGURE_HAVE_ON_OFF_THREADS@ EINA_CONFIGURE_HAVE_STDINT_H = @EINA_CONFIGURE_HAVE_STDINT_H@ EINA_CONFIGURE_HAVE_THREADS = @EINA_CONFIGURE_HAVE_THREADS@ EINA_CONFIGURE_MAGIC_DEBUG = @EINA_CONFIGURE_MAGIC_DEBUG@ EINA_CONFIGURE_SAFETY_CHECKS = @EINA_CONFIGURE_SAFETY_CHECKS@ -EINA_CPPFLAGS = @EINA_CPPFLAGS@ EINA_LIBS = @EINA_LIBS@ EINA_SIZEOF_WCHAR_T = @EINA_SIZEOF_WCHAR_T@ EMEMOA_CFLAGS = @EMEMOA_CFLAGS@ @@ -356,6 +424,8 @@ ESCAPE_LIBS = @ESCAPE_LIBS@ EVIL_CFLAGS = @EVIL_CFLAGS@ EVIL_LIBS = @EVIL_LIBS@ EXEEXT = @EXEEXT@ +EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ +EXOTIC_LIBS = @EXOTIC_LIBS@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ @@ -391,6 +461,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -498,10 +570,25 @@ SRCS = \ eina_inlist_03.c \ eina_str_01.c \ eina_strbuf_01.c \ - eina_tiler_01.c + eina_tiler_01.c \ + eina_model_01.c \ + eina_model_02.c \ + eina_model_03.c \ + eina_value_01.c \ + eina_value_02.c \ + eina_value_03.c \ + eina_inarray_01.c @EFL_INSTALL_EXAMPLES_TRUE@filesdir = $(datadir)/$(PACKAGE)/examples @EFL_INSTALL_EXAMPLES_TRUE@files_DATA = $(SRCS) +@EFL_BUILD_EXAMPLES_TRUE@eina_model_04_SOURCES = \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_model_04_animal.c \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_model_04_child.c \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_model_04_human.c \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_model_04_main.c \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_model_04_parrot.c \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_model_04_whistler.c + @BUILD_TILER_EXAMPLE_TRUE@@EFL_BUILD_EXAMPLES_TRUE@eina_tiler_01_LDADD = $(top_builddir)/src/lib/libeina.la @ECORE_EVAS_LIBS@ all: all-am @@ -619,6 +706,9 @@ eina_hash_07$(EXEEXT): $(eina_hash_07_OBJECTS) $(eina_hash_07_DEPENDENCIES) eina_hash_08$(EXEEXT): $(eina_hash_08_OBJECTS) $(eina_hash_08_DEPENDENCIES) @rm -f eina_hash_08$(EXEEXT) $(AM_V_CCLD)$(LINK) $(eina_hash_08_OBJECTS) $(eina_hash_08_LDADD) $(LIBS) +eina_inarray_01$(EXEEXT): $(eina_inarray_01_OBJECTS) $(eina_inarray_01_DEPENDENCIES) + @rm -f eina_inarray_01$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_inarray_01_OBJECTS) $(eina_inarray_01_LDADD) $(LIBS) eina_inlist_01$(EXEEXT): $(eina_inlist_01_OBJECTS) $(eina_inlist_01_DEPENDENCIES) @rm -f eina_inlist_01$(EXEEXT) $(AM_V_CCLD)$(LINK) $(eina_inlist_01_OBJECTS) $(eina_inlist_01_LDADD) $(LIBS) @@ -652,6 +742,18 @@ eina_log_02$(EXEEXT): $(eina_log_02_OBJECTS) $(eina_log_02_DEPENDENCIES) eina_log_03$(EXEEXT): $(eina_log_03_OBJECTS) $(eina_log_03_DEPENDENCIES) @rm -f eina_log_03$(EXEEXT) $(AM_V_CCLD)$(LINK) $(eina_log_03_OBJECTS) $(eina_log_03_LDADD) $(LIBS) +eina_model_01$(EXEEXT): $(eina_model_01_OBJECTS) $(eina_model_01_DEPENDENCIES) + @rm -f eina_model_01$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_model_01_OBJECTS) $(eina_model_01_LDADD) $(LIBS) +eina_model_02$(EXEEXT): $(eina_model_02_OBJECTS) $(eina_model_02_DEPENDENCIES) + @rm -f eina_model_02$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_model_02_OBJECTS) $(eina_model_02_LDADD) $(LIBS) +eina_model_03$(EXEEXT): $(eina_model_03_OBJECTS) $(eina_model_03_DEPENDENCIES) + @rm -f eina_model_03$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_model_03_OBJECTS) $(eina_model_03_LDADD) $(LIBS) +eina_model_04$(EXEEXT): $(eina_model_04_OBJECTS) $(eina_model_04_DEPENDENCIES) + @rm -f eina_model_04$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_model_04_OBJECTS) $(eina_model_04_LDADD) $(LIBS) eina_str_01$(EXEEXT): $(eina_str_01_OBJECTS) $(eina_str_01_DEPENDENCIES) @rm -f eina_str_01$(EXEEXT) $(AM_V_CCLD)$(LINK) $(eina_str_01_OBJECTS) $(eina_str_01_LDADD) $(LIBS) @@ -661,6 +763,15 @@ eina_strbuf_01$(EXEEXT): $(eina_strbuf_01_OBJECTS) $(eina_strbuf_01_DEPENDENCIES eina_tiler_01$(EXEEXT): $(eina_tiler_01_OBJECTS) $(eina_tiler_01_DEPENDENCIES) @rm -f eina_tiler_01$(EXEEXT) $(AM_V_CCLD)$(LINK) $(eina_tiler_01_OBJECTS) $(eina_tiler_01_LDADD) $(LIBS) +eina_value_01$(EXEEXT): $(eina_value_01_OBJECTS) $(eina_value_01_DEPENDENCIES) + @rm -f eina_value_01$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_value_01_OBJECTS) $(eina_value_01_LDADD) $(LIBS) +eina_value_02$(EXEEXT): $(eina_value_02_OBJECTS) $(eina_value_02_DEPENDENCIES) + @rm -f eina_value_02$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_value_02_OBJECTS) $(eina_value_02_LDADD) $(LIBS) +eina_value_03$(EXEEXT): $(eina_value_03_OBJECTS) $(eina_value_03_DEPENDENCIES) + @rm -f eina_value_03$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_value_03_OBJECTS) $(eina_value_03_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -681,6 +792,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_hash_06.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_hash_07.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_hash_08.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_inarray_01.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_inlist_01.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_inlist_02.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_inlist_03.Po@am__quote@ @@ -692,9 +804,21 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_log_01.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_log_02.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_log_03.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_model_01.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_model_02.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_model_03.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_model_04_animal.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_model_04_child.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_model_04_human.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_model_04_main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_model_04_parrot.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_model_04_whistler.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_str_01.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_strbuf_01.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_tiler_01.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_value_01.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_value_02.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_value_03.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff --git a/libraries/eina/src/examples/eina_accessor_01.c b/libraries/eina/src/examples/eina_accessor_01.c index c48fdc6..da413c6 100644 --- a/libraries/eina/src/examples/eina_accessor_01.c +++ b/libraries/eina/src/examples/eina_accessor_01.c @@ -1,5 +1,5 @@ //Compile with: -//gcc -g `pkg-config --cflags --libs eina` eina_accessor_01.c -o eina_accessor_01 +//gcc -g eina_accessor_01.c -o eina_accessor_01 `pkg-config --cflags --libs eina` #include diff --git a/libraries/eina/src/examples/eina_array_01.c b/libraries/eina/src/examples/eina_array_01.c index d93eb35..1bae809 100644 --- a/libraries/eina/src/examples/eina_array_01.c +++ b/libraries/eina/src/examples/eina_array_01.c @@ -1,5 +1,5 @@ //Compile with: -//gcc -g `pkg-config --cflags --libs eina` eina_array_01.c -o eina_array_01 +//gcc -g eina_array_01.c -o eina_array_01 `pkg-config --cflags --libs eina` #include #include diff --git a/libraries/eina/src/examples/eina_array_02.c b/libraries/eina/src/examples/eina_array_02.c index e897321..6b2903b 100644 --- a/libraries/eina/src/examples/eina_array_02.c +++ b/libraries/eina/src/examples/eina_array_02.c @@ -1,5 +1,5 @@ //Compile with: -//gcc -g `pkg-config --cflags --libs eina` eina_array_02.c -o eina_array_02 +//gcc -g eina_array_02.c -o eina_array_02 `pkg-config --cflags --libs eina` #include #include diff --git a/libraries/eina/src/examples/eina_error_01.c b/libraries/eina/src/examples/eina_error_01.c index 90e845d..e264aee 100644 --- a/libraries/eina/src/examples/eina_error_01.c +++ b/libraries/eina/src/examples/eina_error_01.c @@ -1,5 +1,5 @@ //Compile with: -//gcc -g `pkg-config --cflags --libs eina` eina_error_01.c -o eina_error_01 +//gcc -g eina_error_01.c -o eina_error_01 `pkg-config --cflags --libs eina` #include #include @@ -77,4 +77,4 @@ int main(void) eina_shutdown(); return EXIT_SUCCESS; -} \ No newline at end of file +} diff --git a/libraries/eina/src/examples/eina_file_01.c b/libraries/eina/src/examples/eina_file_01.c index 6490b62..2c945b3 100644 --- a/libraries/eina/src/examples/eina_file_01.c +++ b/libraries/eina/src/examples/eina_file_01.c @@ -1,5 +1,5 @@ //Compile with: -//gcc -g `pkg-config --cflags --libs eina` eina_file_01.c -o eina_file_01 +//gcc -g eina_file_01.c -o eina_file_01 `pkg-config --cflags --libs eina` #include #include diff --git a/libraries/eina/src/examples/eina_hash_01.c b/libraries/eina/src/examples/eina_hash_01.c index 549ca80..16418fe 100644 --- a/libraries/eina/src/examples/eina_hash_01.c +++ b/libraries/eina/src/examples/eina_hash_01.c @@ -1,3 +1,6 @@ +//Compile with: +//gcc -g eina_hash_01.c -o eina_hash_01 `pkg-config --cflags --libs eina` + #include #include #include diff --git a/libraries/eina/src/examples/eina_hash_02.c b/libraries/eina/src/examples/eina_hash_02.c index d43d7a3..7baec93 100644 --- a/libraries/eina/src/examples/eina_hash_02.c +++ b/libraries/eina/src/examples/eina_hash_02.c @@ -1,3 +1,6 @@ +//Compile with: +//gcc -g eina_hash_02.c -o eina_hash_02 `pkg-config --cflags --libs eina` + #include #include #include diff --git a/libraries/eina/src/examples/eina_hash_03.c b/libraries/eina/src/examples/eina_hash_03.c index 719d0d7..ba543d4 100644 --- a/libraries/eina/src/examples/eina_hash_03.c +++ b/libraries/eina/src/examples/eina_hash_03.c @@ -1,3 +1,6 @@ +//Compile with: +//gcc -g eina_hash_03.c -o eina_hash_03 `pkg-config --cflags --libs eina` + #include #include #include diff --git a/libraries/eina/src/examples/eina_hash_04.c b/libraries/eina/src/examples/eina_hash_04.c index e900475..da73e04 100644 --- a/libraries/eina/src/examples/eina_hash_04.c +++ b/libraries/eina/src/examples/eina_hash_04.c @@ -1,3 +1,6 @@ +//Compile with: +//gcc -g eina_hash_04.c -o eina_hash_04 `pkg-config --cflags --libs eina` + #include #include #include diff --git a/libraries/eina/src/examples/eina_hash_05.c b/libraries/eina/src/examples/eina_hash_05.c index f8dbf78..6666ce2 100644 --- a/libraries/eina/src/examples/eina_hash_05.c +++ b/libraries/eina/src/examples/eina_hash_05.c @@ -1,3 +1,6 @@ +//Compile with: +//gcc -g eina_hash_05.c -o eina_hash_05 `pkg-config --cflags --libs eina` + #include #include #include diff --git a/libraries/eina/src/examples/eina_hash_06.c b/libraries/eina/src/examples/eina_hash_06.c index 99a2bd7..6e3c451 100644 --- a/libraries/eina/src/examples/eina_hash_06.c +++ b/libraries/eina/src/examples/eina_hash_06.c @@ -1,3 +1,6 @@ +//Compile with: +//gcc -g eina_hash_06.c -o eina_hash_06 `pkg-config --cflags --libs eina` + #include #include #include diff --git a/libraries/eina/src/examples/eina_hash_07.c b/libraries/eina/src/examples/eina_hash_07.c index b3e486a..1464e6b 100644 --- a/libraries/eina/src/examples/eina_hash_07.c +++ b/libraries/eina/src/examples/eina_hash_07.c @@ -1,3 +1,6 @@ +//Compile with: +//gcc -g eina_hash_07.c -o eina_hash_07 `pkg-config --cflags --libs eina` + #include #include #include diff --git a/libraries/eina/src/examples/eina_hash_08.c b/libraries/eina/src/examples/eina_hash_08.c index 368a2fb..ed45f7f 100644 --- a/libraries/eina/src/examples/eina_hash_08.c +++ b/libraries/eina/src/examples/eina_hash_08.c @@ -1,3 +1,6 @@ +//Compile with: +//gcc -g eina_hash_08.c -o eina_hash_08 `pkg-config --cflags --libs eina` + #include #include #include diff --git a/libraries/eina/src/examples/eina_inlist_01.c b/libraries/eina/src/examples/eina_inlist_01.c index fa51553..6c6c794 100644 --- a/libraries/eina/src/examples/eina_inlist_01.c +++ b/libraries/eina/src/examples/eina_inlist_01.c @@ -1,5 +1,6 @@ // Compile with: -// gcc -g `pkg-config --cflags --libs eina` eina_inlist_01.c -o eina_inlist_01 +// gcc -g eina_inlist_01.c -o eina_inlist_01 `pkg-config --cflags --libs eina` + #include #include diff --git a/libraries/eina/src/examples/eina_inlist_02.c b/libraries/eina/src/examples/eina_inlist_02.c index 7d23f13..4c16ec6 100644 --- a/libraries/eina/src/examples/eina_inlist_02.c +++ b/libraries/eina/src/examples/eina_inlist_02.c @@ -1,5 +1,6 @@ // Compile with: -// gcc -g `pkg-config --cflags --libs eina` eina_inlist_01.c -o eina_inlist_01 +// gcc -g eina_inlist_02.c -o eina_inlist_02 `pkg-config --cflags --libs eina` + #include #include diff --git a/libraries/eina/src/examples/eina_inlist_03.c b/libraries/eina/src/examples/eina_inlist_03.c index a39a784..28706d5 100644 --- a/libraries/eina/src/examples/eina_inlist_03.c +++ b/libraries/eina/src/examples/eina_inlist_03.c @@ -1,5 +1,6 @@ // Compile with: -// gcc -g `pkg-config --cflags --libs eina` eina_inlist_01.c -o eina_inlist_01 +// gcc -g eina_inlist_03.c -o eina_inlist_03 `pkg-config --cflags --libs eina` + #include #include diff --git a/libraries/eina/src/examples/eina_iterator_01.c b/libraries/eina/src/examples/eina_iterator_01.c index f467f90..88c40cc 100644 --- a/libraries/eina/src/examples/eina_iterator_01.c +++ b/libraries/eina/src/examples/eina_iterator_01.c @@ -1,5 +1,5 @@ //Compile with: -//gcc -g `pkg-config --cflags --libs eina` eina_iterator_01.c -o eina_iterator_01 +//gcc -g eina_iterator_01.c -o eina_iterator_01 `pkg-config --cflags --libs eina` #include diff --git a/libraries/eina/src/examples/eina_list_01.c b/libraries/eina/src/examples/eina_list_01.c index 7807791..4fcb020 100644 --- a/libraries/eina/src/examples/eina_list_01.c +++ b/libraries/eina/src/examples/eina_list_01.c @@ -1,5 +1,5 @@ //Compile with: -//gcc -g `pkg-config --cflags --libs eina` eina_list_01.c -o eina_list_01 +//gcc -g eina_list_01.c -o eina_list_01 `pkg-config --cflags --libs eina` #include #include diff --git a/libraries/eina/src/examples/eina_list_02.c b/libraries/eina/src/examples/eina_list_02.c index 7def475..5fe31e8 100644 --- a/libraries/eina/src/examples/eina_list_02.c +++ b/libraries/eina/src/examples/eina_list_02.c @@ -1,5 +1,5 @@ //Compile with: -//gcc -g `pkg-config --cflags --libs eina` eina_list_02.c -o eina_list_02 +//gcc -g eina_list_02.c -o eina_list_02 `pkg-config --cflags --libs eina` #include #include diff --git a/libraries/eina/src/examples/eina_list_03.c b/libraries/eina/src/examples/eina_list_03.c index 8e15b91..db53148 100644 --- a/libraries/eina/src/examples/eina_list_03.c +++ b/libraries/eina/src/examples/eina_list_03.c @@ -1,5 +1,5 @@ //Compile with: -//gcc -g `pkg-config --cflags --libs eina` eina_list_03.c -o eina_list_03 +//gcc -g eina_list_03.c -o eina_list_03 `pkg-config --cflags --libs eina` #include #include diff --git a/libraries/eina/src/examples/eina_list_04.c b/libraries/eina/src/examples/eina_list_04.c index c153c06..d92a607 100644 --- a/libraries/eina/src/examples/eina_list_04.c +++ b/libraries/eina/src/examples/eina_list_04.c @@ -1,5 +1,5 @@ //Compile with: -//gcc -g `pkg-config --cflags --libs eina` eina_list_04.c -o eina_list_04 +//gcc -g eina_list_04.c -o eina_list_04 `pkg-config --cflags --libs eina` #include #include diff --git a/libraries/eina/src/examples/eina_tiler_01.c b/libraries/eina/src/examples/eina_tiler_01.c index b2ff8be..6202a88 100644 --- a/libraries/eina/src/examples/eina_tiler_01.c +++ b/libraries/eina/src/examples/eina_tiler_01.c @@ -1,5 +1,5 @@ //Compile with: -//gcc `pkg-config --cflags --libs ecore-evas ecore evas` eina_tiler_01.c -o eina_tiler_01 +//gcc eina_tiler_01.c -o eina_tiler_01 `pkg-config --cflags --libs ecore-evas ecore evas eina` #include #include diff --git a/libraries/eina/src/include/Eina.h b/libraries/eina/src/include/Eina.h index 721a991..d99b129 100644 --- a/libraries/eina/src/include/Eina.h +++ b/libraries/eina/src/include/Eina.h @@ -1,5 +1,5 @@ /* EINA - EFL data type library - * Copyright (C) 2008-2011 Enlightenment Developers: + * Copyright (C) 2008-2012 Enlightenment Developers: * Albin "Lutin" Tonnerre * Alexandre "diaxen" Becoulet * Andre Dieb @@ -16,6 +16,7 @@ * Tilman Sauerbeck * Vincent "caro" Torri * Tom Hacohen + * Jonas M. Gastal * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -46,7 +47,7 @@ * @mainpage Eina * * @version 1.1 - * @date 2008-2011 + * @date 2008-2012 * * @section eina_intro_sec Introduction * @@ -72,6 +73,8 @@ * @li @ref Eina_Stringshare_Group saves memory by sharing read-only string references. * @li @ref Eina_Tiler_Group split, merge and navigates into 2D tiled regions. * @li @ref Eina_Trash_Group container of unused but allocated data. + * @li @ref Eina_Value_Group container for generic value storage and access. + * @li @ref Eina_Model_Group container for data with user defined hierarchy/structure. * * The tools that are available are (see @ref Eina_Tools_Group): * @li @ref Eina_Benchmark_Group helper to write benchmarks. @@ -101,6 +104,31 @@ * their elements with an @ref Eina_Iterator_Group, or eventually an * @ref Eina_Accessor_Group. * + * The containers in eina are designed with performance in mind, one consequence + * of this is that they @b don't check the validity of data structures given to + * them(@ref Eina_Magic_Group). + * + * The choice of which container to use in each situation is very important in + * achieving good performance and readable code. The most common container types + * to be used are: + * @li List + * @li Inline list + * @li Array + * @li Inline array + * @li Hash + * + * All types have virtues and vices. The following considerations are good + * starting point in deciding which container to use: + * @li Hashes are appropriate for datasets which will be searched often; + * @li arrays are good when accessing members by position; + * @li lists provide good versatility for adding elements in any position with + * minimal overhead; + * @li inline arrays use very little memory and don't cause fragmentation and + * therefore are a good option in memory constrained systems; + * @li inline lists are the appropriate type to use when the flexibility of a + * list is required but the overhead of pointer indirection is not acceptable. + * @warning These are general considerations, every situation is different, + * don't follow these recommendations blindly. * * @defgroup Eina_Tools_Group Tools * @@ -120,15 +148,22 @@ * @author Carsten Haitzler * @author Cedric Bail * @author Corey "atmos" Donohoe + * @author Vincent "caro" Torri * @author Fabiano Fidêncio * @author Gustavo Chaves * @author Gustavo Sverzut Barbieri * @author Jorge Luis "turran" Zapata + * @author Tilman Sauerbeck * @author Peter "pfritz" Wehrfritz * @author Raphael Kubo da Costa - * @author Tilman Sauerbeck - * @author Vincent "caro" Torri * @author Tom Hacohen + * @author Brett Nash + * @author Sebastian Dransfeld + * @author Myungjae Lee + * @author Youness Alaoui + * @author Boris "billiob" Faure + * @author Sung W. Park + * @author Guillaume Friloux * * Please contact to get in * contact with the developers and maintainers. @@ -189,6 +224,7 @@ extern "C" { #include "eina_mmap.h" #include "eina_xattr.h" #include "eina_value.h" +#include "eina_model.h" #ifdef __cplusplus } diff --git a/libraries/eina/src/include/Makefile.am b/libraries/eina/src/include/Makefile.am index a818d5f..31ef71e 100644 --- a/libraries/eina/src/include/Makefile.am +++ b/libraries/eina/src/include/Makefile.am @@ -64,7 +64,8 @@ eina_refcount.h \ eina_mmap.h \ eina_xattr.h \ eina_value.h \ -eina_inline_value.x +eina_inline_value.x \ +eina_model.h # Will be back for developper after 1.1. # eina_object.h diff --git a/libraries/eina/src/include/Makefile.in b/libraries/eina/src/include/Makefile.in index ea922e5..7e819b8 100644 --- a/libraries/eina/src/include/Makefile.in +++ b/libraries/eina/src/include/Makefile.in @@ -46,20 +46,24 @@ DIST_COMMON = $(am__dist_installed_headers_DATA_DIST) \ $(dist_installed_mainheader_DATA) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/eina_config.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ - $(top_srcdir)/m4/efl_benchmark.m4 \ - $(top_srcdir)/m4/efl_compiler_flag.m4 \ - $(top_srcdir)/m4/efl_coverage.m4 $(top_srcdir)/m4/efl_cpu.m4 \ - $(top_srcdir)/m4/efl_doxygen.m4 \ - $(top_srcdir)/m4/efl_examples.m4 \ - $(top_srcdir)/m4/efl_fnmatch.m4 \ - $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ - $(top_srcdir)/m4/efl_threads.m4 \ - $(top_srcdir)/m4/efl_voltron.m4 $(top_srcdir)/m4/eina_bench.m4 \ - $(top_srcdir)/m4/eina_check.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/eina/eina_bench.m4 \ + $(top_srcdir)/m4/eina/eina_check.m4 \ + $(top_srcdir)/m4/common/efl_attribute.m4 \ + $(top_srcdir)/m4/common/efl_benchmark.m4 \ + $(top_srcdir)/m4/common/efl_compiler_flag.m4 \ + $(top_srcdir)/m4/common/efl_coverage.m4 \ + $(top_srcdir)/m4/common/efl_cpu.m4 \ + $(top_srcdir)/m4/common/efl_doxygen.m4 \ + $(top_srcdir)/m4/common/efl_examples.m4 \ + $(top_srcdir)/m4/common/efl_fnmatch.m4 \ + $(top_srcdir)/m4/common/efl_path_max.m4 \ + $(top_srcdir)/m4/common/efl_tests.m4 \ + $(top_srcdir)/m4/common/efl_threads.m4 \ + $(top_srcdir)/m4/common/efl_voltron.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -93,9 +97,9 @@ am__dist_installed_headers_DATA_DIST = eina_safety_checks.h \ eina_inline_str.x eina_strbuf.h eina_ustrbuf.h eina_unicode.h \ eina_quadtree.h eina_simple_xml_parser.h eina_lock.h \ eina_prefix.h eina_refcount.h eina_mmap.h eina_xattr.h \ - eina_value.h eina_inline_value.x eina_inline_lock_wince.x \ - eina_inline_lock_win32.x eina_inline_lock_posix.x \ - eina_inline_lock_void.x + eina_value.h eina_inline_value.x eina_model.h \ + eina_inline_lock_wince.x eina_inline_lock_win32.x \ + eina_inline_lock_posix.x eina_inline_lock_void.x am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -167,13 +171,13 @@ EINA_CONFIGURE_DEFAULT_MEMPOOL = @EINA_CONFIGURE_DEFAULT_MEMPOOL@ EINA_CONFIGURE_ENABLE_LOG = @EINA_CONFIGURE_ENABLE_LOG@ EINA_CONFIGURE_HAVE_DEBUG_THREADS = @EINA_CONFIGURE_HAVE_DEBUG_THREADS@ EINA_CONFIGURE_HAVE_DIRENT_H = @EINA_CONFIGURE_HAVE_DIRENT_H@ +EINA_CONFIGURE_HAVE_EXOTIC = @EINA_CONFIGURE_HAVE_EXOTIC@ EINA_CONFIGURE_HAVE_INTTYPES_H = @EINA_CONFIGURE_HAVE_INTTYPES_H@ EINA_CONFIGURE_HAVE_ON_OFF_THREADS = @EINA_CONFIGURE_HAVE_ON_OFF_THREADS@ EINA_CONFIGURE_HAVE_STDINT_H = @EINA_CONFIGURE_HAVE_STDINT_H@ EINA_CONFIGURE_HAVE_THREADS = @EINA_CONFIGURE_HAVE_THREADS@ EINA_CONFIGURE_MAGIC_DEBUG = @EINA_CONFIGURE_MAGIC_DEBUG@ EINA_CONFIGURE_SAFETY_CHECKS = @EINA_CONFIGURE_SAFETY_CHECKS@ -EINA_CPPFLAGS = @EINA_CPPFLAGS@ EINA_LIBS = @EINA_LIBS@ EINA_SIZEOF_WCHAR_T = @EINA_SIZEOF_WCHAR_T@ EMEMOA_CFLAGS = @EMEMOA_CFLAGS@ @@ -183,6 +187,8 @@ ESCAPE_LIBS = @ESCAPE_LIBS@ EVIL_CFLAGS = @EVIL_CFLAGS@ EVIL_LIBS = @EVIL_LIBS@ EXEEXT = @EXEEXT@ +EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ +EXOTIC_LIBS = @EXOTIC_LIBS@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ @@ -218,6 +224,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -311,8 +319,8 @@ EINAHEADERS = eina_safety_checks.h eina_error.h eina_log.h \ eina_ustrbuf.h eina_unicode.h eina_quadtree.h \ eina_simple_xml_parser.h eina_lock.h eina_prefix.h \ eina_refcount.h eina_mmap.h eina_xattr.h eina_value.h \ - eina_inline_value.x $(am__append_1) $(am__append_2) \ - $(am__append_3) $(am__append_4) + eina_inline_value.x eina_model.h $(am__append_1) \ + $(am__append_2) $(am__append_3) $(am__append_4) installed_mainheaderdir = $(includedir)/eina-@VMAJ@ dist_installed_mainheader_DATA = Eina.h eina_config.h installed_headersdir = $(includedir)/eina-@VMAJ@/eina diff --git a/libraries/eina/src/include/eina_array.h b/libraries/eina/src/include/eina_array.h index 53183b4..4ab3b50 100644 --- a/libraries/eina/src/include/eina_array.h +++ b/libraries/eina/src/include/eina_array.h @@ -351,7 +351,7 @@ static inline void *eina_array_data_get(const Eina_Array *array, static inline void eina_array_data_set(const Eina_Array *array, unsigned int idx, const void *data) EINA_ARG_NONNULL(1); -static inline unsigned int eina_array_count_get(const Eina_Array *array) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT EINA_DEPRECATED; +static inline unsigned int eina_array_count_get(const Eina_Array *array) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; static inline unsigned int eina_array_count(const Eina_Array *array) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT; /** diff --git a/libraries/eina/src/include/eina_config.h b/libraries/eina/src/include/eina_config.h index 474edaa..b1108b6 100644 --- a/libraries/eina/src/include/eina_config.h +++ b/libraries/eina/src/include/eina_config.h @@ -19,6 +19,15 @@ #ifndef EINA_CONFIG_H_ #define EINA_CONFIG_H_ +#ifdef EINA_HAVE_EXOTIC_H +# undef EINA_HAVE_EXOTIC_H +#endif + + +#ifdef EINA_HAVE_EXOTIC +# include +#endif + #ifdef EINA_MAGIC_DEBUG # undef EINA_MAGIC_DEBUG #endif diff --git a/libraries/eina/src/include/eina_config.h.in b/libraries/eina/src/include/eina_config.h.in index 2459ace..937d208 100644 --- a/libraries/eina/src/include/eina_config.h.in +++ b/libraries/eina/src/include/eina_config.h.in @@ -19,6 +19,15 @@ #ifndef EINA_CONFIG_H_ #define EINA_CONFIG_H_ +#ifdef EINA_HAVE_EXOTIC_H +# undef EINA_HAVE_EXOTIC_H +#endif +@EINA_CONFIGURE_HAVE_EXOTIC@ + +#ifdef EINA_HAVE_EXOTIC +# include +#endif + #ifdef EINA_MAGIC_DEBUG # undef EINA_MAGIC_DEBUG #endif diff --git a/libraries/eina/src/include/eina_error.h b/libraries/eina/src/include/eina_error.h index 2b0ae77..dd87edf 100644 --- a/libraries/eina/src/include/eina_error.h +++ b/libraries/eina/src/include/eina_error.h @@ -180,7 +180,7 @@ EAPI const char *eina_error_msg_get(Eina_Error error) EINA_PURE; /** * @brief Find the #Eina_Error corresponding to a message string - * @param msg The error message string to match (NOT #NULL) + * @param msg The error message string to match (NOT @c NULL) * @return The #Eina_Error matching @p msg, or 0 on failure * This function attempts to match @p msg with its corresponding #Eina_Error value. * If no such value is found, 0 is returned. diff --git a/libraries/eina/src/include/eina_file.h b/libraries/eina/src/include/eina_file.h index 422fb65..1af22af 100644 --- a/libraries/eina/src/include/eina_file.h +++ b/libraries/eina/src/include/eina_file.h @@ -22,6 +22,7 @@ #include #include +#include #include "eina_types.h" #include "eina_array.h" @@ -91,6 +92,13 @@ typedef struct _Eina_File_Direct_Info Eina_File_Direct_Info; /** + * @typedef Eina_Stat + * A typedef to #_Eina_Stat. + * @since 1.2 + */ +typedef struct _Eina_Stat Eina_Stat; + +/** * @typedef Eina_File_Dir_List_Cb * Type for a callback to be called when iterating over the files of a * directory. @@ -149,6 +157,31 @@ struct _Eina_File_Direct_Info }; /** + * @struct _Eina_Stat + * A structure to store informations of a path. + * @since 1.2 + */ +struct _Eina_Stat +{ + unsigned long int dev; + unsigned long int ino; + unsigned int mode; + unsigned int nlink; + unsigned int uid; + unsigned int gid; + unsigned long int rdev; + unsigned long int size; + unsigned long int blksize; + unsigned long int blocks; + unsigned long int atime; + unsigned long int atimensec; + unsigned long int mtime; + unsigned long int mtimensec; + unsigned long int ctime; + unsigned long int ctimensec; +}; + +/** * @def EINA_FILE_DIR_LIST_CB * @brief cast to an #Eina_File_Dir_List_Cb. * @@ -247,6 +280,24 @@ EAPI Eina_Iterator *eina_file_ls(const char *dir) EINA_WARN_UNUSED_RESULT EINA_A EAPI Eina_Iterator *eina_file_stat_ls(const char *dir) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_MALLOC; /** + * @brief Use information provided by Eina_Iterator of eina_file_stat_ls or eina_file_direct_ls + * to call stat in the most efficient way on your system. + * + * @param container The container returned by the Eina_Iterator using eina_iterator_container_get(). + * @param info The content of the current Eina_File_Direct_Info provided by the Eina_Iterator + * @param buf Where to put the result of the stat + * @return On success 0 is returned, On error -1 is returned and errno is set appropriately. + * + * This function calls fstatat or stat depending on what your system supports. This makes it efficient and simple + * to use on your side without complex detection already done inside Eina on what the system can do. + * + * @see eina_file_direct_ls() + * @see eina_file_stat_ls() + * @since 1.2 + */ +EAPI int eina_file_statat(void *container, Eina_File_Direct_Info *info, Eina_Stat *buf) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2, 3); + +/** * @brief Get an iterator to list the content of a directory, with direct * information. * diff --git a/libraries/eina/src/include/eina_inarray.h b/libraries/eina/src/include/eina_inarray.h index d37c76b..079f1e3 100644 --- a/libraries/eina/src/include/eina_inarray.h +++ b/libraries/eina/src/include/eina_inarray.h @@ -24,6 +24,131 @@ #include "eina_accessor.h" /** + * @page eina_inarray_example_01 Eina inline array usage + * @dontinclude eina_inarray_01.c + * + * This example will create an inline array of chars, add some elements, print + * it, re-purpose the array to store ints, add some elements and print that. + * + * We'll start with a function to compare ints we need this because the '>' + * operator is not a function and can't be used where Eina_Compare_Cb is needed. + * @skip int + * @until } + * + * And then move on to the code we actually care about, starting with variable + * declarations and eina initialization: + * @until eina_init + * + * Creating an inline array is very simple, we just need to know what type we + * want to store: + * @until inarray_new + * @note The second parameter(the step) is left at zero which means that eina + * will choose an appropriate value, this should @b only be changed if it's + * known, beforehand, how many elements the array will have. + * + * Once we have an array we can start adding elements to it. Because the + * insertion function expect a memory address we have to put the value we want + * to store in a variable(this should be no problem since in real world usage + * that's usually where the value will be anyways): + * @until append + * @note Because the inline array copies the value given to it we can later + * change @c ch, which we do, without affecting the contents of the array. + * + * So let's add some more elements: + * @until append + * @until append + * @until append + * + * We will then iterate over our array and print every position of it. The thing + * to note here is not so much the values which will be the expected 'a', 'b', + * 'c' and 'd', but rather the memory address of these values, they are + * sequential: + * @until printf + * @until printf + * + * We'll now use our array to store ints, so we need to first erase every member + * currently on the array: + * @until _flush + * + * And then to be able to store a different type on the same array we use the + * eina_array_setup() function, which is just like the eina_inarray_new() + * function except it receives already allocated memory. This time we're going + * to ask eina to use a step of size 4 because that's how many elements we'll be + * putting on the array: + * @until _setup + * @note Strictly speaking the reason to call eina_inarray_setup() is not + * because we're storing different type, but rather because our types have + * different sizes. Eina inline arrays don't actually know anything about types, + * they only deal in blocks of memory of a given size. + * @note Since eina_array_setup() receives already allocated memory you can(and + * it is in fact good practice) use inline arrays not declared as pointers: + * @code + * Eina_Inarray arr; + * eina_inarray_setup(&arr, sizeof(int), 4); + * @endcode + * + * And now to add our integer values to the array: + * @until append + * @until append + * @until append + * + * Just to change things up a bit we've left out the 99 value, but will still + * add it in such a way to keep the array ordered. There are many ways to do + * this, we could use eina_inarray_insert_at(), or we could change the value + * of the last member using eina_inarray_replace_at() and then append the values + * in the right order, but for no particular reason we're going to use + * eina_inarray_insert_sorted() instead: + * @until insert_sorted + * + * We then print the size of our array, and the array itself, much like last + * time the values are not surprising, and neither should it be that the memory + * addresses are contiguous: + * @until printf + * @until printf + * + * Once done we free our array and shutdown eina: + * @until } + * + * The source for this example: @ref eina_inarray_01_c + */ + +/** + * @page eina_inarray_01_c eina_inarray_01.c + * @include eina_inarray_01.c + * @example eina_inarray_01.c + */ + +/** + * @page eina_inarray_example_02 Eina inline array of strings + * @dontinclude eina_inarray_02.c + * + * This example will create an inline array of strings, add some elements and + * then print them. This example is based on @ref eina_array_01_example_page and + * @ref eina_inarray_example_01. + * + * We start with some variable declarations and eina initialization: + * @skip int + * @until eina_init + * + * We then create the array much like we did on @ref eina_inarray_example_01: + * @until inarray_new + * + * The point were this example significantly differs from the first eina inline + * array example. We'll not be adding the strings themselves to the array since + * their size varies, we'll store pointer to the strings instead. We therefore + * use @c char** to populate our inline array: + * @until } + * + * The source for this example: @ref eina_inarray_02_c + */ + +/** + * @page eina_inarray_02_c eina_inarray_02.c + * @include eina_inarray_02.c + * @example eina_inarray_02.c + */ + +/** * @addtogroup Eina_Data_Types_Group Data Types * * @since 1.2 @@ -40,6 +165,19 @@ /** * @defgroup Eina_Inline_Array_Group Inline Array * + * Inline array is a container that stores the data itself not pointers to data, + * this means there is no memory fragmentation, also for small data types(such + * as char, short, int, etc.) it's more memory efficient. + * + * Usage of the inline array is very similar to that of other + * @ref Eina_Containers_Group, like all arrays adding elements to the beginning + * of the array is a lot more costly than appending, so those operations should + * be minimized. + * + * Examples: + * @li @ref eina_inarray_example_01 + * @li @ref eina_inarray_example_02 + * * @{ */ @@ -531,8 +669,8 @@ EAPI Eina_Accessor *eina_inarray_accessor_new(const Eina_Inarray *array) EINA_MA * @since 1.2 */ #define EINA_INARRAY_FOREACH(array, itr) \ - for ((itr) = array->members; \ - (itr) < (((typeof(*itr)*)array->members) + array->len); \ + for ((itr) = (array)->members; \ + (itr) < (((typeof(*itr)*)(array)->members) + (array)->len); \ (itr)++) /** @@ -552,9 +690,9 @@ EAPI Eina_Accessor *eina_inarray_accessor_new(const Eina_Inarray *array) EINA_MA * @since 1.2 */ #define EINA_INARRAY_REVERSE_FOREACH(array, itr) \ - for ((itr) = ((((typeof(*(itr))*)array->members) + array->len) - 1); \ - (((itr) >= (typeof(*(itr))*)array->members) \ - && (array->members != NULL)); \ + for ((itr) = ((((typeof(*(itr))*)(array)->members) + (array)->len) - 1); \ + (((itr) >= (typeof(*(itr))*)(array)->members) \ + && ((array)->members != NULL)); \ (itr)--) /** diff --git a/libraries/eina/src/include/eina_inline_lock_win32.x b/libraries/eina/src/include/eina_inline_lock_win32.x index e8363d5..1988724 100644 --- a/libraries/eina/src/include/eina_inline_lock_win32.x +++ b/libraries/eina/src/include/eina_inline_lock_win32.x @@ -23,6 +23,9 @@ typedef CRITICAL_SECTION Eina_Lock; typedef struct _Eina_Condition Eina_Condition; +typedef struct _Eina_RWLock Eina_RWLock; +typedef DWORD Eina_TLS; +typedef HANDLE Eina_Semaphore; #if _WIN32_WINNT >= 0x0600 struct _Eina_Condition @@ -30,6 +33,13 @@ struct _Eina_Condition CRITICAL_SECTION *mutex; CONDITION_VARIABLE condition; }; + +struct _Eina_RWLock +{ + SRWLOCK mutex; + + Eina_Bool is_read_mode : 1; +}; #else struct _Eina_Condition { @@ -40,28 +50,24 @@ struct _Eina_Condition HANDLE waiters_done; Eina_Bool was_broadcast; }; -#endif -typedef struct _Eina_Win32_RWLock Eina_RWLock; - -struct _Eina_Win32_RWLock +struct _Eina_RWLock { - LONG readers_count; - LONG writers_count; - int readers; - int writers; + LONG readers_count; + LONG writers_count; + int readers; + int writers; Eina_Lock mutex; Eina_Condition cond_read; Eina_Condition cond_write; }; +#endif -typedef DWORD Eina_TLS; - -typedef HANDLE Eina_Semaphore; EAPI extern Eina_Bool _eina_threads_activated; + static inline Eina_Bool eina_lock_new(Eina_Lock *mutex) { @@ -143,9 +149,9 @@ eina_condition_new(Eina_Condition *cond, Eina_Lock *mutex) CloseHandle(cond->semaphore); return EINA_FALSE; } +#endif return EINA_TRUE; -#endif } static inline void @@ -153,6 +159,7 @@ eina_condition_free(Eina_Condition *cond) { #if _WIN32_WINNT >= 0x0600 /* Nothing to do */ + (void)cond; #else CloseHandle(cond->waiters_done); DeleteCriticalSection(&cond->waiters_count_lock); @@ -309,20 +316,29 @@ eina_condition_signal(Eina_Condition *cond) if (!ReleaseSemaphore(cond->semaphore, 1, 0)) return EINA_FALSE; } +#endif return EINA_TRUE; -#endif } static inline Eina_Bool eina_rwlock_new(Eina_RWLock *mutex) { +#if _WIN32_WINNT >= 0x0600 + InitializeSRWLock(&mutex->mutex); + return EINA_TRUE; +#else if (!eina_lock_new(&(mutex->mutex))) return EINA_FALSE; if (!eina_condition_new(&(mutex->cond_read), &(mutex->mutex))) goto on_error1; if (!eina_condition_new(&(mutex->cond_write), &(mutex->mutex))) goto on_error2; + mutex->readers_count = 0; + mutex->writers_count = 0; + mutex->readers = 0; + mutex->writers = 0; + return EINA_TRUE; on_error2: @@ -330,20 +346,29 @@ eina_rwlock_new(Eina_RWLock *mutex) on_error1: eina_lock_free(&(mutex->mutex)); return EINA_FALSE; +#endif } static inline void eina_rwlock_free(Eina_RWLock *mutex) { +#if _WIN32_WINNT >= 0x0600 + (void)mutex; +#else eina_condition_free(&(mutex->cond_read)); eina_condition_free(&(mutex->cond_write)); eina_lock_free(&(mutex->mutex)); +#endif } static inline Eina_Lock_Result eina_rwlock_take_read(Eina_RWLock *mutex) { - DWORD res; +#if _WIN32_WINNT >= 0x0600 + AcquireSRWLockShared(&mutex->mutex); + mutex->is_read_mode = EINA_TRUE; +#else + DWORD res = 0; if (eina_lock_take(&(mutex->mutex)) == EINA_LOCK_FAIL) return EINA_LOCK_FAIL; @@ -364,6 +389,7 @@ eina_rwlock_take_read(Eina_RWLock *mutex) if (res == 0) mutex->readers++; eina_lock_release(&(mutex->mutex)); +#endif return EINA_LOCK_SUCCEED; } @@ -371,7 +397,11 @@ eina_rwlock_take_read(Eina_RWLock *mutex) static inline Eina_Lock_Result eina_rwlock_take_write(Eina_RWLock *mutex) { - DWORD res; +#if _WIN32_WINNT >= 0x0600 + AcquireSRWLockExclusive(&mutex->mutex); + mutex->is_read_mode = EINA_FALSE; +#else + DWORD res = 0; if (eina_lock_take(&(mutex->mutex)) == EINA_LOCK_FAIL) return EINA_LOCK_FAIL; @@ -389,8 +419,9 @@ eina_rwlock_take_write(Eina_RWLock *mutex) } mutex->writers_count--; } - if (res == 0) mutex->writers_count = 1; + if (res == 0) mutex->writers = 1; eina_lock_release(&(mutex->mutex)); +#endif return EINA_LOCK_SUCCEED; } @@ -398,6 +429,12 @@ eina_rwlock_take_write(Eina_RWLock *mutex) static inline Eina_Lock_Result eina_rwlock_release(Eina_RWLock *mutex) { +#if _WIN32_WINNT >= 0x0600 + if (mutex->is_read_mode) + ReleaseSRWLockShared(&mutex->mutex); + else + ReleaseSRWLockExclusive(&mutex->mutex); +#else if (eina_lock_take(&(mutex->mutex)) == EINA_LOCK_FAIL) return EINA_LOCK_FAIL; @@ -433,6 +470,7 @@ eina_rwlock_release(Eina_RWLock *mutex) } } eina_lock_release(&(mutex->mutex)); +#endif return EINA_LOCK_SUCCEED; } diff --git a/libraries/eina/src/include/eina_inline_stringshare.x b/libraries/eina/src/include/eina_inline_stringshare.x index bfd7677..19827c5 100644 --- a/libraries/eina/src/include/eina_inline_stringshare.x +++ b/libraries/eina/src/include/eina_inline_stringshare.x @@ -43,7 +43,7 @@ * #EINA_FALSE if the strings were the same after shared. */ static inline Eina_Bool -eina_stringshare_replace(const char **p_str, const char *news) +eina_stringshare_replace(Eina_Stringshare **p_str, const char *news) { if (*p_str == news) return EINA_FALSE; @@ -72,7 +72,7 @@ eina_stringshare_replace(const char **p_str, const char *news) * #EINA_FALSE if the strings were the same after shared. */ static inline Eina_Bool -eina_stringshare_replace_length(const char **p_str, const char *news, unsigned int slen) +eina_stringshare_replace_length(Eina_Stringshare **p_str, const char *news, unsigned int slen) { if (*p_str == news) return EINA_FALSE; diff --git a/libraries/eina/src/include/eina_inline_value.x b/libraries/eina/src/include/eina_inline_value.x index 59ec315..33c83f5 100644 --- a/libraries/eina/src/include/eina_inline_value.x +++ b/libraries/eina/src/include/eina_inline_value.x @@ -19,8 +19,8 @@ #ifndef EINA_INLINE_VALUE_X_ #define EINA_INLINE_VALUE_X_ +#include #include -#include #include "eina_stringshare.h" @@ -210,7 +210,7 @@ eina_value_compare(const Eina_Value *a, const Eina_Value *b) return 1; return 0; } - else if (type == EINA_VALUE_TYPE_ULONG) + else if ((type == EINA_VALUE_TYPE_ULONG) || (type == EINA_VALUE_TYPE_TIMESTAMP)) { unsigned long *ta = (unsigned long *) pa, *tb = (unsigned long *) pb; if (*ta < *tb) @@ -362,7 +362,7 @@ eina_value_vset(Eina_Value *value, va_list args) *tmem = va_arg(args, unsigned int); return EINA_TRUE; } - else if (type == EINA_VALUE_TYPE_ULONG) + else if ((type == EINA_VALUE_TYPE_ULONG) || (type == EINA_VALUE_TYPE_TIMESTAMP)) { unsigned long *tmem = (unsigned long *) mem; *tmem = va_arg(args, unsigned long); @@ -424,17 +424,22 @@ eina_value_vset(Eina_Value *value, va_list args) else if (type == EINA_VALUE_TYPE_STRING) { const char *str = (const char *) va_arg(args, const char *); - free(value->value.ptr); + if (value->value.ptr == str) return EINA_TRUE; if (!str) - value->value.ptr = NULL; + { + free(value->value.ptr); + value->value.ptr = NULL; + } else { - value->value.ptr = strdup(str); - if (!value->value.ptr) + char *tmp = strdup(str); + if (!tmp) { eina_error_set(EINA_ERROR_OUT_OF_MEMORY); return EINA_FALSE; } + free(value->value.ptr); + value->value.ptr = tmp; } return EINA_TRUE; } @@ -494,18 +499,22 @@ eina_value_pset(Eina_Value *value, const void *ptr) { const char * const * pstr = (const char * const *) ptr; const char *str = *pstr; - - free(value->value.ptr); + if (value->value.ptr == str) return EINA_TRUE; if (!str) - value->value.ptr = NULL; + { + free(value->value.ptr); + value->value.ptr = NULL; + } else { - value->value.ptr = strdup(str); - if (!value->value.ptr) + char *tmp = strdup(str); + if (!tmp) { eina_error_set(EINA_ERROR_OUT_OF_MEMORY); return EINA_FALSE; } + free(value->value.ptr); + value->value.ptr = tmp; } return EINA_TRUE; } @@ -607,16 +616,7 @@ eina_value_array_vset(Eina_Value *value, unsigned int position, va_list args) if (!mem) return EINA_FALSE; - eina_value_type_flush(desc.subtype, mem); - - if (!eina_value_type_setup(desc.subtype, mem)) goto error_setup; - if (!eina_value_type_vset(desc.subtype, mem, args)) goto error_set; - return EINA_TRUE; - - error_set: - eina_value_type_flush(desc.subtype, mem); - error_setup: - return EINA_FALSE; + return eina_value_type_vset(desc.subtype, mem, args); } static inline Eina_Bool @@ -749,16 +749,7 @@ eina_value_array_pset(Eina_Value *value, unsigned int position, const void *ptr) if (!mem) return EINA_FALSE; - eina_value_type_flush(desc.subtype, mem); - - if (!eina_value_type_setup(desc.subtype, mem)) goto error_setup; - if (!eina_value_type_pset(desc.subtype, mem, ptr)) goto error_set; - return EINA_TRUE; - - error_set: - eina_value_type_flush(desc.subtype, mem); - error_setup: - return EINA_FALSE; + return eina_value_type_pset(desc.subtype, mem, ptr); } static inline Eina_Bool @@ -832,6 +823,29 @@ eina_value_array_pappend(Eina_Value *value, const void *ptr) return EINA_FALSE; } +static inline Eina_Bool +eina_value_array_value_get(const Eina_Value *src, unsigned int position, Eina_Value *dst) +{ + Eina_Value_Array desc; + + EINA_VALUE_TYPE_ARRAY_CHECK_RETURN_VAL(src, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(dst, EINA_FALSE); + + if (!eina_value_pget(src, &desc)) + return EINA_FALSE; + if (position >= eina_inarray_count(desc.array)) + return EINA_FALSE; + if (!eina_value_setup(dst, desc.subtype)) + return EINA_FALSE; + if (!eina_value_pset(dst, eina_inarray_nth(desc.array, position))) + { + eina_value_flush(dst); + return EINA_FALSE; + } + + return EINA_TRUE; +} + #undef EINA_VALUE_TYPE_ARRAY_CHECK_RETURN_VAL #define EINA_VALUE_TYPE_LIST_CHECK_RETURN_VAL(value, retval) \ @@ -929,16 +943,7 @@ eina_value_list_vset(Eina_Value *value, unsigned int position, va_list args) if (!mem) return EINA_FALSE; - eina_value_type_flush(desc->subtype, mem); - - if (!eina_value_type_setup(desc->subtype, mem)) goto error_setup; - if (!eina_value_type_vset(desc->subtype, mem, args)) goto error_set; - return EINA_TRUE; - - error_set: - eina_value_type_flush(desc->subtype, mem); - error_setup: - return EINA_FALSE; + return eina_value_type_vset(desc->subtype, mem, args); } static inline Eina_Bool @@ -1105,16 +1110,7 @@ eina_value_list_pset(Eina_Value *value, unsigned int position, const void *ptr) if (!mem) return EINA_FALSE; - eina_value_type_flush(desc->subtype, mem); - - if (!eina_value_type_setup(desc->subtype, mem)) goto error_setup; - if (!eina_value_type_pset(desc->subtype, mem, ptr)) goto error_set; - return EINA_TRUE; - - error_set: - eina_value_type_flush(desc->subtype, mem); - error_setup: - return EINA_FALSE; + return eina_value_type_pset(desc->subtype, mem, ptr); } static inline Eina_Bool @@ -1284,9 +1280,7 @@ eina_value_hash_vset(Eina_Value *value, const char *key, va_list args) return EINA_FALSE; mem = eina_hash_find(desc->hash, key); - if (mem) - eina_value_type_flush(desc->subtype, mem); - else + if (!mem) { mem = malloc(desc->subtype->value_size); if (!mem) @@ -1299,18 +1293,15 @@ eina_value_hash_vset(Eina_Value *value, const char *key, va_list args) free(mem); return EINA_FALSE; } + if (!eina_value_type_setup(desc->subtype, mem)) + { + eina_value_type_flush(desc->subtype, mem); + eina_hash_del_by_key(desc->hash, key); + free(mem); + } } - if (!eina_value_type_setup(desc->subtype, mem)) goto error_setup; - if (!eina_value_type_vset(desc->subtype, mem, args)) goto error_set; - return EINA_TRUE; - - error_set: - eina_value_type_flush(desc->subtype, mem); - error_setup: - eina_hash_del_by_key(desc->hash, key); - free(mem); - return EINA_FALSE; + return eina_value_type_vset(desc->subtype, mem, args); } static inline Eina_Bool @@ -1371,9 +1362,7 @@ eina_value_hash_pset(Eina_Value *value, const char *key, const void *ptr) return EINA_FALSE; mem = eina_hash_find(desc->hash, key); - if (mem) - eina_value_type_flush(desc->subtype, mem); - else + if (!mem) { mem = malloc(desc->subtype->value_size); if (!mem) @@ -1386,18 +1375,15 @@ eina_value_hash_pset(Eina_Value *value, const char *key, const void *ptr) free(mem); return EINA_FALSE; } + if (!eina_value_type_setup(desc->subtype, mem)) + { + eina_value_type_flush(desc->subtype, mem); + eina_hash_del_by_key(desc->hash, key); + free(mem); + } } - if (!eina_value_type_setup(desc->subtype, mem)) goto error_setup; - if (!eina_value_type_pset(desc->subtype, mem, ptr)) goto error_set; - return EINA_TRUE; - - error_set: - eina_value_type_flush(desc->subtype, mem); - error_setup: - eina_hash_del_by_key(desc->hash, key); - free(mem); - return EINA_FALSE; + return eina_value_type_pset(desc->subtype, mem, ptr); } static inline Eina_Bool @@ -1474,15 +1460,7 @@ eina_value_struct_vset(Eina_Value *value, const char *name, va_list args) if (!mem) return EINA_FALSE; - eina_value_type_flush(member->type, mem); - if (!eina_value_type_setup(member->type, mem)) goto error_setup; - if (!eina_value_type_vset(member->type, mem, args)) goto error_set; - return EINA_TRUE; - - error_set: - eina_value_type_flush(member->type, mem); - error_setup: - return EINA_FALSE; + return eina_value_type_vset(member->type, mem, args); } static inline Eina_Bool @@ -1540,8 +1518,9 @@ eina_value_struct_pset(Eina_Value *value, const char *name, const void *ptr) Eina_Value_Struct *st; void *mem; - EINA_VALUE_TYPE_STRUCT_CHECK_RETURN_VAL(value, 0); + EINA_VALUE_TYPE_STRUCT_CHECK_RETURN_VAL(value, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ptr, EINA_FALSE); st = (Eina_Value_Struct *)eina_value_memory_get(value); if (!st) return EINA_FALSE; @@ -1552,15 +1531,7 @@ eina_value_struct_pset(Eina_Value *value, const char *name, const void *ptr) if (!mem) return EINA_FALSE; - eina_value_type_flush(member->type, mem); - if (!eina_value_type_setup(member->type, mem)) goto error_setup; - if (!eina_value_type_pset(member->type, mem, ptr)) goto error_set; - return EINA_TRUE; - - error_set: - eina_value_type_flush(member->type, mem); - error_setup: - return EINA_FALSE; + return eina_value_type_pset(member->type, mem, ptr); } static inline Eina_Bool @@ -1571,8 +1542,9 @@ eina_value_struct_pget(const Eina_Value *value, const char *name, void *ptr) const void *mem; Eina_Bool ret; - EINA_VALUE_TYPE_STRUCT_CHECK_RETURN_VAL(value, 0); + EINA_VALUE_TYPE_STRUCT_CHECK_RETURN_VAL(value, EINA_FALSE); EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(ptr, EINA_FALSE); st = (const Eina_Value_Struct *)eina_value_memory_get(value); if (!st) return EINA_FALSE; @@ -1586,6 +1558,119 @@ eina_value_struct_pget(const Eina_Value *value, const char *name, void *ptr) ret = eina_value_type_pget(member->type, mem, ptr); return ret; } + +static inline Eina_Bool +eina_value_struct_value_get(const Eina_Value *src, const char *name, Eina_Value *dst) +{ + const Eina_Value_Struct_Member *member; + const Eina_Value_Struct *st; + const void *mem; + + EINA_VALUE_TYPE_STRUCT_CHECK_RETURN_VAL(src, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(dst, EINA_FALSE); + st = (const Eina_Value_Struct *)eina_value_memory_get(src); + if (!st) + return EINA_FALSE; + member = eina_value_struct_member_find(st, name); + if (!member) + return EINA_FALSE; + mem = eina_value_struct_member_memory_get(st, member); + if (!mem) + return EINA_FALSE; + if (!eina_value_setup(dst, member->type)) + return EINA_FALSE; + if (!eina_value_pset(dst, mem)) + { + eina_value_flush(dst); + return EINA_FALSE; + } + return EINA_TRUE; +} + +static inline Eina_Bool +eina_value_struct_value_set(Eina_Value *dst, const char *name, const Eina_Value *src) +{ + const Eina_Value_Struct_Member *member; + Eina_Value_Struct *st; + void *mem; + const void *ptr; + + EINA_VALUE_TYPE_STRUCT_CHECK_RETURN_VAL(dst, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(name, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(src, EINA_FALSE); + + st = (Eina_Value_Struct *)eina_value_memory_get(dst); + if (!st) + return EINA_FALSE; + member = eina_value_struct_member_find(st, name); + if (!member) + return EINA_FALSE; + EINA_SAFETY_ON_FALSE_RETURN_VAL(src->type == member->type, EINA_FALSE); + + mem = eina_value_struct_member_memory_get(st, member); + if (!mem) + return EINA_FALSE; + + ptr = eina_value_memory_get(src); + if (!ptr) + return EINA_FALSE; + + return eina_value_type_pset(member->type, mem, ptr); +} + +static inline Eina_Bool +eina_value_struct_member_value_get(const Eina_Value *src, const Eina_Value_Struct_Member *member, Eina_Value *dst) +{ + const Eina_Value_Struct *st; + const void *mem; + + EINA_VALUE_TYPE_STRUCT_CHECK_RETURN_VAL(src, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(member, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(dst, EINA_FALSE); + st = (const Eina_Value_Struct *)eina_value_memory_get(src); + if (!st) + return EINA_FALSE; + mem = eina_value_struct_member_memory_get(st, member); + if (!mem) + return EINA_FALSE; + if (!eina_value_setup(dst, member->type)) + return EINA_FALSE; + if (!eina_value_pset(dst, mem)) + { + eina_value_flush(dst); + return EINA_FALSE; + } + return EINA_TRUE; +} + +static inline Eina_Bool +eina_value_struct_member_value_set(Eina_Value *dst, const Eina_Value_Struct_Member *member, const Eina_Value *src) +{ + Eina_Value_Struct *st; + void *mem; + const void *ptr; + + EINA_VALUE_TYPE_STRUCT_CHECK_RETURN_VAL(dst, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(member, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(src, EINA_FALSE); + + st = (Eina_Value_Struct *)eina_value_memory_get(dst); + if (!st) + return EINA_FALSE; + EINA_SAFETY_ON_FALSE_RETURN_VAL(src->type == member->type, EINA_FALSE); + + mem = eina_value_struct_member_memory_get(st, member); + if (!mem) + return EINA_FALSE; + + ptr = eina_value_memory_get(src); + if (!ptr) + return EINA_FALSE; + + return eina_value_type_pset(member->type, mem, ptr); +} + #undef EINA_VALUE_TYPE_STRUCT_CHECK_RETURN_VAL diff --git a/libraries/eina/src/include/eina_list.h b/libraries/eina/src/include/eina_list.h index db65e17..c8ef06d 100644 --- a/libraries/eina/src/include/eina_list.h +++ b/libraries/eina/src/include/eina_list.h @@ -881,13 +881,13 @@ EAPI Eina_List *eina_list_clone(const Eina_List *list) EINA_WARN_UNUS * @brief Sort a list according to the ordering func will return. * * @param list The list handle to sort. - * @param size The length of the list to sort. + * @param limit The maximum number of list elements to sort. * @param func A function pointer that can handle comparing the list data * nodes. * @return the new head of list. * * This function sorts @p list. @p size if the number of the first - * element to sort. If @p size is 0 or greater than the number of + * element to sort. If @p limit is 0 or greater than the number of * elements in @p list, all the elements are sorted. @p func is used to * compare two elements of @p list. If @p list or @p func are @c NULL, * this function returns @c NULL. @@ -920,7 +920,7 @@ EAPI Eina_List *eina_list_clone(const Eina_List *list) EINA_WARN_UNUS * * @warning @p list must be a pointer to the first element of the list. */ -EAPI Eina_List *eina_list_sort(Eina_List *list, unsigned int size, Eina_Compare_Cb func) EINA_ARG_NONNULL(3) EINA_WARN_UNUSED_RESULT; +EAPI Eina_List *eina_list_sort(Eina_List *list, unsigned int limit, Eina_Compare_Cb func) EINA_ARG_NONNULL(3) EINA_WARN_UNUSED_RESULT; /** diff --git a/libraries/eina/src/include/eina_stringshare.h b/libraries/eina/src/include/eina_stringshare.h index 862b2b2..8edadd2 100644 --- a/libraries/eina/src/include/eina_stringshare.h +++ b/libraries/eina/src/include/eina_stringshare.h @@ -126,6 +126,20 @@ * string creation/destruction speed, reduces memory use and decreases * memory fragmentation, so a win all-around. * + * Using eina stringshares usually boils down to: + * @code + * const char *str = eina_stringshare_add("My string"); + * ... + * //Use str + * ... + * eina_stringshare_del(str); + * @endcode + * @note It's very important to note that string shares are @b @c const, + * changing them will result in undefined behavior. + * @note eina_stringshare_del() @b doesn't guarantee the string share will be + * freed, it releases a reference to it, but if other references to it still + * exist the string share will live until those are released. + * * The following diagram gives an idea of what happens as you create strings * with eina_stringshare_add(): * @@ -148,6 +162,15 @@ * @{ */ +/** + * @typedef Eina_Stringshare + * + * Interchangeable with "const char *" but still a good visual hint for the + * purpose. Maybe in the far far future we'll even add strict type checking. + * + * @since 1.2.0 + */ +typedef const char Eina_Stringshare; /** * @brief Retrieve an instance of a string for use in a program. @@ -168,7 +191,7 @@ * * @see eina_share_common_add() */ -EAPI const char *eina_stringshare_add_length(const char *str, unsigned int slen) EINA_WARN_UNUSED_RESULT; +EAPI Eina_Stringshare *eina_stringshare_add_length(const char *str, unsigned int slen) EINA_WARN_UNUSED_RESULT; /** * @brief Retrieve an instance of a string for use in a program. @@ -188,7 +211,7 @@ EAPI const char *eina_stringshare_add_length(const char *str, unsigned in * * @see eina_stringshare_add_length() */ -EAPI const char *eina_stringshare_add(const char *str) EINA_WARN_UNUSED_RESULT; +EAPI Eina_Stringshare *eina_stringshare_add(const char *str) EINA_WARN_UNUSED_RESULT; /** * @brief Retrieve an instance of a string for use in a program @@ -209,7 +232,7 @@ EAPI const char *eina_stringshare_add(const char *str) EINA_WARN_UNUSED_R * * @see eina_stringshare_nprintf() */ -EAPI const char *eina_stringshare_printf(const char *fmt, ...) EINA_WARN_UNUSED_RESULT EINA_PRINTF(1, 2); +EAPI Eina_Stringshare *eina_stringshare_printf(const char *fmt, ...) EINA_WARN_UNUSED_RESULT EINA_PRINTF(1, 2); /** * @brief Retrieve an instance of a string for use in a program @@ -231,7 +254,7 @@ EAPI const char *eina_stringshare_printf(const char *fmt, ...) EINA_WARN_ * * @see eina_stringshare_nprintf() */ -EAPI const char *eina_stringshare_vprintf(const char *fmt, va_list args) EINA_WARN_UNUSED_RESULT; +EAPI Eina_Stringshare *eina_stringshare_vprintf(const char *fmt, va_list args) EINA_WARN_UNUSED_RESULT; /** * @brief Retrieve an instance of a string for use in a program @@ -251,7 +274,7 @@ EAPI const char *eina_stringshare_vprintf(const char *fmt, va_list args) * * @see eina_stringshare_printf() */ -EAPI const char *eina_stringshare_nprintf(unsigned int len, const char *fmt, ...) EINA_WARN_UNUSED_RESULT EINA_PRINTF(2, 3); +EAPI Eina_Stringshare *eina_stringshare_nprintf(unsigned int len, const char *fmt, ...) EINA_WARN_UNUSED_RESULT EINA_PRINTF(2, 3); /** * Increment references of the given shared string. @@ -267,7 +290,7 @@ EAPI const char *eina_stringshare_nprintf(unsigned int len, const char *f * * There is no unref since this is the work of eina_share_common_del(). */ -EAPI const char *eina_stringshare_ref(const char *str); +EAPI Eina_Stringshare *eina_stringshare_ref(Eina_Stringshare *str); /** * @brief Note that the given string has lost an instance. @@ -282,7 +305,7 @@ EAPI const char *eina_stringshare_ref(const char *str); * Note that if the given pointer is not shared or NULL, bad things * will happen, likely a segmentation fault. */ -EAPI void eina_stringshare_del(const char *str); +EAPI void eina_stringshare_del(Eina_Stringshare *str); /** * @brief Note that the given string @b must be shared. @@ -296,7 +319,7 @@ EAPI void eina_stringshare_del(const char *str); * things will happen, likely a segmentation fault. If in doubt, try * strlen(). */ -EAPI int eina_stringshare_strlen(const char *str) EINA_PURE EINA_WARN_UNUSED_RESULT; +EAPI int eina_stringshare_strlen(Eina_Stringshare *str) EINA_PURE EINA_WARN_UNUSED_RESULT; /** * @brief Dump the contents of the share_common. @@ -306,8 +329,8 @@ EAPI int eina_stringshare_strlen(const char *str) EINA_PURE EINA_ */ EAPI void eina_stringshare_dump(void); -static inline Eina_Bool eina_stringshare_replace(const char **p_str, const char *news) EINA_ARG_NONNULL(1); -static inline Eina_Bool eina_stringshare_replace_length(const char **p_str, const char *news, unsigned int slen) EINA_ARG_NONNULL(1); +static inline Eina_Bool eina_stringshare_replace(Eina_Stringshare **p_str, const char *news) EINA_ARG_NONNULL(1); +static inline Eina_Bool eina_stringshare_replace_length(Eina_Stringshare **p_str, const char *news, unsigned int slen) EINA_ARG_NONNULL(1); #include "eina_inline_stringshare.x" diff --git a/libraries/eina/src/include/eina_types.h b/libraries/eina/src/include/eina_types.h index 1653949..b0a7cf8 100644 --- a/libraries/eina/src/include/eina_types.h +++ b/libraries/eina/src/include/eina_types.h @@ -98,13 +98,13 @@ #ifdef __GNUC__ # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# define EINA_WARN_UNUSED_RESULT __attribute__ ((warn_unused_result)) +# define EINA_WARN_UNUSED_RESULT __attribute__ ((__warn_unused_result__)) # else # define EINA_WARN_UNUSED_RESULT # endif # if (!defined(EINA_SAFETY_CHECKS)) && (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) -# define EINA_ARG_NONNULL(idx, ...) __attribute__ ((nonnull(idx, ## __VA_ARGS__))) +# define EINA_ARG_NONNULL(idx, ...) __attribute__ ((__nonnull__(idx, ## __VA_ARGS__))) # else # define EINA_ARG_NONNULL(idx, ...) # endif @@ -116,19 +116,23 @@ # endif # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) -# define EINA_MALLOC __attribute__ ((malloc)) -# define EINA_PURE __attribute__ ((pure)) +# define EINA_MALLOC __attribute__ ((__malloc__)) +# define EINA_PURE __attribute__ ((__pure__)) # else # define EINA_MALLOC # define EINA_PURE # endif # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) -# define EINA_PRINTF(fmt, arg) __attribute__((format (printf, fmt, arg))) -# define EINA_SCANF(fmt, arg) __attribute__((format (scanf, fmt, arg))) -# define EINA_FORMAT(fmt) __attribute__((format_arg(fmt))) -# define EINA_CONST __attribute__((const)) -# define EINA_NOINSTRUMENT __attribute__((no_instrument_function)) +# if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 3) +# define EINA_PRINTF(fmt, arg) __attribute__((__format__ (__gnu_printf__, fmt, arg))) +# else +# define EINA_PRINTF(fmt, arg) __attribute__((__format__ (__printf__, fmt, arg))) +# endif +# define EINA_SCANF(fmt, arg) __attribute__((__format__ (__scanf__, fmt, arg))) +# define EINA_FORMAT(fmt) __attribute__((__format_arg__(fmt))) +# define EINA_CONST __attribute__((__const__)) +# define EINA_NOINSTRUMENT __attribute__((__no_instrument_function__)) # define EINA_UNLIKELY(exp) __builtin_expect((exp), 0) # define EINA_LIKELY(exp) __builtin_expect((exp), 1) # else @@ -276,6 +280,16 @@ typedef void (*Eina_Free_Cb)(void *data); #define EINA_FREE_CB(Function) ((Eina_Free_Cb)Function) /** + * @def EINA_C_ARRAY_LENGTH + * Macro to return the array length of a standard c array. + * For example: + * int foo[] = { 0, 1, 2, 3 }; + * would return 4 and not 4 * sizeof(int). + * @since 1.2.0 + */ +#define EINA_C_ARRAY_LENGTH(arr) (sizeof(arr) / sizeof((arr)[0])) + +/** * @} */ diff --git a/libraries/eina/src/include/eina_value.h b/libraries/eina/src/include/eina_value.h index 846c4ef..341781f 100644 --- a/libraries/eina/src/include/eina_value.h +++ b/libraries/eina/src/include/eina_value.h @@ -19,12 +19,244 @@ #ifndef EINA_VALUE_H_ #define EINA_VALUE_H_ +#include + #include "eina_types.h" #include "eina_fp.h" /* defines int64_t and uint64_t */ #include "eina_inarray.h" #include "eina_list.h" #include "eina_hash.h" -#include + +/** + * @page eina_value_example_01_page Eina_Value usage + * @dontinclude eina_value_01.c + * + * This very simple example shows how to use some of the basic features of eina + * value: setting and getting values, converting between types and printing a + * value as a string. + * + * Our main function starts out with the basic, declaring some variables and + * initializing eina: + * @until eina_init + * + * Now we can jump into using eina value. We set a value, get this value and + * then print it: + * @until printf + * + * In the above snippet of code we printed an @c int value, we can however print + * the value as a string: + * @until free + * + * And once done with a value it's good practice to destroy it: + * @until eina_value_flush + * + * We now reuse @c v to store a string, get its value and print it: + * @until printf + * @note Since @c s is the value and not returned by @c eina_value_to_string() + * we don't need to free it. + * + * Just because we stored a string doesn't mean we can't use the @c + * eina_value_to_string() function, we can and it's important to note that it + * will return not the stored string but rather a copy of it(one we have to + * free): + * @until eina_value_flush + * + * And now to explore conversions between two type we'll create another value: + * @until eina_value_setup + * + * And make sure @c v and @c otherv have different types: + * @until eina_value_setup + * + * We then set a value to @c v and have it converted, to do this we don't need + * to tell to which type we want to convert, we just say were we want to store + * the converted value and eina value will figure out what to convert to, and + * how: + * @until eina_value_convert + * + * And now let's check the conversion worked: + * @until printf + * + * But converting to strings is not particularly exciting, @c + * eina_value_to_string() already did that, so now let's make the conversion the + * other way around, from string to @c int: + * @until printf + * + * And once done, destroy the values: + * @until } + * + * Full source code: @ref eina_value_01_c + */ + +/** + * @page eina_value_01_c eina_value_01.c + * @include eina_value_01.c + * @example eina_value_01.c + */ + +/** + * @page eina_value_example_02_page Eina_Value struct usage + * @dontinclude eina_value_02.c + * + * This example will examine a hypothetical situation in which we had a + * structure(which represented parameters) with two fields, and then need to add + * a third field to our structure. If using structs directly we'd need to + * rewrite every piece of code that touches the struct, by using eina value, and + * thus having the compiler not even know the struct, we can reduce the amount + * of changes needed and retain interoperability between the old and new format. + * + * Our example will start with a function that creates descriptions of both of + * our structs for eina value usage. The first step is to create a struct and + * describe its members: + * @until v1_members[1] + * @note We can't pass the types of the members to EINA_VALUE_STRUCT_MEMBER + * macro because they are not constant initializers. + * + * So far it should be pretty easy to understand, we said @c My_Struct_V1 has + * two members, one of type @c int and another of type @c char. We now create + * the description of the actual struct, again nothing overly complex, we signal + * which version of EINA_VALUE_STRUCT we're using, we declare no special + * operations, our members and our size: + * @until V1_DESC + * + * We now repeat the process for the second version of our struct, the only + * difference is the addition of a third parameter of type @c int : + * @until V2_DESC + * @until } + * + * We'll now look at a function that sets the values of our structs. For + * simplicity's sake we initialize it we random values, a real world case would + * read these values from a file, a database or even from the network. The + * fundamental detail here is that this function works for both V1 and V2 + * structs, this is because setting a parameter that a struct that doesn't have + * does nothing without throwing any errors: + * @until } + * @note While using eina_value_struct_set() with an in-existing parameter + * causes no error, it does return #EINA_FALSE, to notify it was not possible + * to set the value. This could be used to determine that we're handling a V1 + * struct and take some action based on that. + * + * The next thing is to do is see what a function that uses the values of the + * struct looks like. We'll again be very simplistic in our usage, we'll just + * print the values, but a real world case, might send these values to another + * process use them to open a network/database connection or anything else. + * Since all versions of the struct have @c param1 and @c param2 we'll + * unconditionally use them: + * @until printf + * + * The next step is to conditionally use @c param3, which can fortunately be + * done in the same step in which we get it's value: + * @until } + * + * There we've now got functions that can both populate and use values from both + * our structs, so now let's actually use them in our main function by creating + * a struct of each type, initializing them and them using them: + * @until } + * + * This concludes our example. For the full source code see @ref + * eina_value_02_c. + */ + +/** + * @page eina_value_02_c eina_value_02.c + * @include eina_value_02.c + * @example eina_value_02.c + */ + +/** + * @page eina_value_example_03_page Eina value custom type example + * @dontinclude eina_value_03.c + * + * For this example we'll be creating our own custom type of eina value. Eina + * value can already store struct timeval(man gettimeofday for more information) + * but it has no type to store struct timezone, so that's what this example will + * do. + * @note struct timezone is actually obsolete, so using it in real world + * programs is probably not a good idea, but this is an example so, bear with + * us. + * + * To create our own custom eina value type we need to define functions to + * do the following operations on it: + * @li Setup + * @li Flush + * @li Copy + * @li Compare + * @li Set + * @li Get + * @li Conversion + * + * Most of this functions are very simple, so let's look at them, starting with + * setup which only clear the memory so that we can be certain we won't be using + * stale data: + * @until } + * + * Now the flush function, which is even simpler, it does nothing, that's + * because there is nothing we need to do, all the necessary steps are taken by + * eina value itself: + * @until } + * + * Our next function, copy, is a bit more interesting, but not much, it just + * casts our void pointers to struct timezone pointers and does the copy: + * @until } + * @note By now you might be wondering why our functions receive void pointers + * instead of pointers to struct timezone, and this is a good point. The reason + * for this is that eina value doesn't know anything about our type so it must + * use a generic void pointer, casting that pointer into a proper value is the + * job of the implementor of the new type. + * + * Next we have the comparison function, which compares the @c tz_minuteswest + * field of struct timezone, we don't compare @c tz_dsttime because that field + * is not used in linux: + * @until } + * + * Next we have setting, this however requires not one but rather two functions, + * the reason for this is because to be able to receive arguments of any type + * eina value uses @ref https://wikipedia.org/wiki/Variadic_functions "variadic + * functions", so we need a function to get the argument from a va_list and + * another to actually to the setting. + * + * Lets first look at the pset function which sets the received value to a + * pointer: + * @until } + * + * Next we have the vset function which get the argument from the va_list and + * passes it to the pset function: + * @until } + * + * And now the function to get the value, a very simple copying of the value to + * the given pointer: + * @until } + * + * And finally our conversion function, this is our longest and most interesting + * one. For numeric type we simply assign the value of @c tz_minuteswest to the + * new type and call a set function using it: + * @until EINA_VALUE_TYPE_DOUBLE + * @until return + * @note It would be a good idea to add checks for over and underflow for these + * types and return #EINA_FALSE in thoses cases, we omit this here for brevity. + * + * For string types we use @c snprintf() to format our @c tz_minuteswest field + * and put it in a string(again @c tz_dsttime is ignored because it's not used): + * @until } + * + * Finally we handle any other types by returning an error in that case: + * @until } + * + * Now that we have all the functions, we can populate an @c Eina_Value_Type to + * later use it with @c eina_value_setup(): + * @until } + * + * We can now finally use our new TZ_TYPE with eina value, so lets conclude our + * example by practicing that by setting its value and printing it: + * @until } + * + * For the full source code see @ref eina_value_03_c. + */ + +/** + * @page eina_value_03_c eina_value_03.c + * @include eina_value_03.c + * @example eina_value_03.c + */ /** * @addtogroup Eina_Data_Types_Group Data Types @@ -43,6 +275,24 @@ /** * @defgroup Eina_Value_Group Generic Value Storage * + * Abstracts generic data storage and access to it in an extensible + * and efficient way. + * + * It comes with pre-defined types for numbers, array, list, hash, + * blob and structs. It is able to convert between data types, + * including to string. + * + * It is meant for simple data types, providing uniform access and + * release functions, useful to exchange data preserving their + * types. For more complex hierarchical data, with properties and + * children, reference counting, inheritance and interfaces, see @ref + * Eina_Model_Group. + * + * Examples of usage of the Eina_Value API: + * @li @ref eina_value_example_01_page + * @li @ref eina_value_example_02_page + * @li @ref eina_value_example_03_page + * * @{ */ @@ -67,6 +317,9 @@ typedef struct _Eina_Value_Type Eina_Value_Type; * @typedef Eina_Value_Union * Union of all known value types. * + * This is only used to specify the minimum payload memory for #Eina_Value. + * + * @internal * @since 1.2 */ typedef union _Eina_Value_Union Eina_Value_Union; @@ -75,6 +328,9 @@ typedef union _Eina_Value_Union Eina_Value_Union; * @union _Eina_Value_Union * All possible value types. * + * This is only used to specify the minimum payload memory for #Eina_Value. + * + * @internal * @since 1.2 */ union _Eina_Value_Union @@ -117,6 +373,15 @@ EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_UINT; EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_ULONG; /** + * @var EINA_VALUE_TYPE_TIMESTAMP + * manages unsigned long type used for timestamps. + * @note this is identical in function to EINA_VALUE_TYPE_ULONG + * + * @since 1.2 + */ +EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_TIMESTAMP; + +/** * @var EINA_VALUE_TYPE_UINT64 * manages unsigned integer of 64 bits type. * @@ -206,10 +471,11 @@ EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_STRING; * @li eina_value_array_pget() and eina_value_array_pset() * * eina_value_set() takes an #Eina_Value_Array where just @c subtype - * and @c step are used. If there is an @c array, it will be adopted - * and its contents must be properly configurable as @c subtype - * expects. eina_value_pset() takes a pointer to an #Eina_Value_Array. - * For your convenience, use eina_value_array_setup(). + * and @c step are used. If there is an @c array, it will be copied + * (including each item) and its contents must be properly + * configurable as @c subtype expects. eina_value_pset() takes a + * pointer to an #Eina_Value_Array. For your convenience, use + * eina_value_array_setup(). * * eina_value_get() and eina_value_pget() takes a pointer to * #Eina_Value_Array, it's an exact copy of the current structure in @@ -228,10 +494,11 @@ EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_ARRAY; * @li eina_value_list_pget() and eina_value_list_pset() * * eina_value_set() takes an #Eina_Value_List where just @c subtype is - * used. If there is an @c list, it will be adopted and its contents - * must be properly configurable as @c subtype - * expects. eina_value_pset() takes a pointer to an #Eina_Value_List. - * For your convenience, use eina_value_list_setup(). + * used. If there is an @c list, it will be copied (including each + * item) and its contents must be properly configurable as @c + * subtype expects. eina_value_pset() takes a pointer to an + * #Eina_Value_List. For your convenience, use + * eina_value_list_setup(). * * eina_value_get() and eina_value_pget() takes a pointer to * #Eina_Value_List, it's an exact copy of the current structure in @@ -251,9 +518,9 @@ EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_LIST; * * eina_value_set() takes an #Eina_Value_Hash where just @c subtype * and @c buckets_power_size are used. If there is an @c hash, it will - * be adopted and its contents must be properly configurable as @c - * subtype expects. eina_value_pset() takes a pointer to an - * #Eina_Value_Hash. For your convenience, use + * be copied (including each item) and its contents must be + * properly configurable as @c subtype expects. eina_value_pset() + * takes a pointer to an #Eina_Value_Hash. For your convenience, use * eina_value_hash_setup(). * * eina_value_get() and eina_value_pget() takes a pointer to @@ -310,9 +577,10 @@ EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_BLOB; * @li eina_value_struct_pget() and eina_value_struct_pset() * * eina_value_set() takes an #Eina_Value_Struct where just @c desc is - * used. If there is an @c memory, it will be adopted and its contents - * must be properly configurable as @c desc expects. eina_value_pset() - * takes a pointer to an #Eina_Value_Struct. For your convenience, use + * used. If there is an @c memory, it will be copied (including each + * member) and its contents must be properly configurable as @c desc + * expects. eina_value_pset() takes a pointer to an + * #Eina_Value_Struct. For your convenience, use * eina_value_struct_setup(). * * eina_value_get() and eina_value_pget() takes a pointer to @@ -324,6 +592,23 @@ EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_BLOB; EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_STRUCT; /** + * @var EINA_VALUE_TYPE_MODEL + * + * manages Eina_Model type. Use the value get/set to change the model + * in use, it will increase the reference while in use by the value. + * + * eina_value_set() takes a pointer to #Eina_Model, increasing the + * reference. + * + * eina_value_get() takes a pointer to pointer to #Eina_Model, it's an + * exact copy of the current model, no copies are done, no references + * are increased. + * + * @since 1.2 + */ +EAPI extern const Eina_Value_Type *EINA_VALUE_TYPE_MODEL; + +/** * @var EINA_ERROR_VALUE_FAILED * Error identifier corresponding to value check failure. * @@ -435,7 +720,7 @@ static inline void eina_value_flush(Eina_Value *value) EINA_ARG_NONNULL(1); * @param copy destination value object * @return #EINA_TRUE on success, #EINA_FALSE otherwise. * - * The @a copy object is considered internalized and its existing + * The @a copy object is considered uninitialized and its existing * contents are overwritten (just as if eina_value_flush() was called on * it). * @@ -812,8 +1097,9 @@ static inline const Eina_Value_Type *eina_value_type_get(const Eina_Value *value /** * @typedef Eina_Value_Array - * Value type for #EINA_VALUE_TYPE_ARRAY + * Value type for #EINA_VALUE_TYPE_ARRAY. * + * @see #_Eina_Value_Array explains fields. * @since 1.2 */ typedef struct _Eina_Value_Array Eina_Value_Array; @@ -821,6 +1107,7 @@ typedef struct _Eina_Value_Array Eina_Value_Array; /** * @struct _Eina_Value_Array * Used to store the array and its subtype. + * @since 1.2 */ struct _Eina_Value_Array { @@ -1433,6 +1720,22 @@ static inline Eina_Bool eina_value_array_pappend(Eina_Value *value, const void *ptr) EINA_ARG_NONNULL(1); /** + * @brief Retrieves a value from the array as an Eina_Value copy. + * @param value source value object + * @param position index of the member + * @param dst where to return the array member + * @return #EINA_TRUE on success, #EINA_FALSE otherwise. + * + * The argument @a dst is considered uninitialized and it's setup to + * the type of the member. + * + * @since 1.2 + */ +static inline Eina_Bool eina_value_array_value_get(const Eina_Value *src, + unsigned int position, + Eina_Value *dst) EINA_ARG_NONNULL(1, 3); + +/** * @} */ @@ -1446,8 +1749,9 @@ static inline Eina_Bool eina_value_array_pappend(Eina_Value *value, /** * @typedef Eina_Value_List - * Value type for #EINA_VALUE_TYPE_LIST + * Value type for #EINA_VALUE_TYPE_LIST. * + * @see #_Eina_Value_List explains fields. * @since 1.2 */ typedef struct _Eina_Value_List Eina_Value_List; @@ -1455,6 +1759,7 @@ typedef struct _Eina_Value_List Eina_Value_List; /** * @struct _Eina_Value_List * Used to store the list and its subtype. + * @since 1.2 */ struct _Eina_Value_List { @@ -2067,8 +2372,9 @@ static inline Eina_Bool eina_value_list_pappend(Eina_Value *value, /** * @typedef Eina_Value_Hash - * Value type for #EINA_VALUE_TYPE_HASH + * Value type for #EINA_VALUE_TYPE_HASH. * + * @see #_Eina_Value_Hash explains fields. * @since 1.2 */ typedef struct _Eina_Value_Hash Eina_Value_Hash; @@ -2076,6 +2382,7 @@ typedef struct _Eina_Value_Hash Eina_Value_Hash; /** * @struct _Eina_Value_Hash * Used to store the hash and its subtype. + * @since 1.2 */ struct _Eina_Value_Hash { @@ -2409,19 +2716,25 @@ static inline Eina_Bool eina_value_hash_pget(const Eina_Value *value, /** * @typedef Eina_Value_Blob_Operations * How to manage blob. Any @c NULL callback is ignored. + * @see #_Eina_Value_Blob_Operations explains fields. * @since 1.2 */ typedef struct _Eina_Value_Blob_Operations Eina_Value_Blob_Operations; /** + * @def EINA_VALUE_BLOB_OPERATIONS_VERSION + * Current API version, used to validate #_Eina_Value_Blob_Operations. + */ +#define EINA_VALUE_BLOB_OPERATIONS_VERSION (1) + +/** * @struct _Eina_Value_Blob_Operations * How to manage blob. Any @c NULL callback is ignored. * @since 1.2 */ struct _Eina_Value_Blob_Operations { -#define EINA_VALUE_BLOB_OPERATIONS_VERSION (1) - unsigned int version; /**< must be EINA_VALUE_BLOB_OPERATIONS_VERSION */ + unsigned int version; /**< must be #EINA_VALUE_BLOB_OPERATIONS_VERSION */ void (*free)(const Eina_Value_Blob_Operations *ops, void *memory, size_t size); void *(*copy)(const Eina_Value_Blob_Operations *ops, const void *memory, size_t size); int (*compare)(const Eina_Value_Blob_Operations *ops, const void *data1, size_t size_data1, const void *data2, size_t size_data2); @@ -2441,12 +2754,16 @@ EAPI extern const Eina_Value_Blob_Operations *EINA_VALUE_BLOB_OPERATIONS_MALLOC; /** * @typedef Eina_Value_Blob + * Value type for #EINA_VALUE_TYPE_BLOB. + * + * @see #_Eina_Value_Blob explains fields. * @since 1.2 */ typedef struct _Eina_Value_Blob Eina_Value_Blob; /** * @struct _Eina_Value_Blob + * Used to store the blob information and management operations. * @since 1.2 */ struct _Eina_Value_Blob @@ -2469,6 +2786,11 @@ struct _Eina_Value_Blob /** * @typedef Eina_Value_Struct_Operations * How to manage struct. Any @c NULL callback is ignored. + * + * A structure can specify alternative methods to allocate, free and + * copy itself. See structure definition for all methods. + * + * @see #_Eina_Value_Struct_Operations explains fields. * @since 1.2 */ typedef struct _Eina_Value_Struct_Operations Eina_Value_Struct_Operations; @@ -2476,6 +2798,12 @@ typedef struct _Eina_Value_Struct_Operations Eina_Value_Struct_Operations; /** * @typedef Eina_Value_Struct_Member * Describes a single member of struct. + * + * The member holds a name, type and its byte offset within the struct + * memory. Most Eina_Value_Struct functions takes the member name as + * parameter, as in eina_value_struct_set(). + * + * @see #_Eina_Value_Struct_Member explains fields. * @since 1.2 */ typedef struct _Eina_Value_Struct_Member Eina_Value_Struct_Member; @@ -2483,30 +2811,39 @@ typedef struct _Eina_Value_Struct_Member Eina_Value_Struct_Member; /** * @typedef Eina_Value_Struct_Desc * Describes the struct by listing its size, members and operations. + * @see #_Eina_Value_Struct_Desc explains fields. * @since 1.2 */ typedef struct _Eina_Value_Struct_Desc Eina_Value_Struct_Desc; /** * @typedef Eina_Value_Struct + * Value type for #EINA_VALUE_TYPE_STRUCT. + * + * @see #_Eina_Value_Struct explains fields. * @since 1.2 */ typedef struct _Eina_Value_Struct Eina_Value_Struct; /** + * @def EINA_VALUE_STRUCT_OPERATIONS_VERSION + * Current API version, used to validate #_Eina_Value_Struct_Operations. + */ +#define EINA_VALUE_STRUCT_OPERATIONS_VERSION (1) + +/** * @struct _Eina_Value_Struct_Operations * How to manage struct. Any @c NULL callback is ignored. * @since 1.2 */ struct _Eina_Value_Struct_Operations { -#define EINA_VALUE_STRUCT_OPERATIONS_VERSION (1) - unsigned int version; /**< must be EINA_VALUE_STRUCT_OPERATIONS_VERSION */ - void *(*alloc)(const Eina_Value_Struct_Operations *ops, const Eina_Value_Struct_Desc *desc); - void (*free)(const Eina_Value_Struct_Operations *ops, const Eina_Value_Struct_Desc *desc, void *memory); - void *(*copy)(const Eina_Value_Struct_Operations *ops, const Eina_Value_Struct_Desc *desc, const void *memory); - int (*compare)(const Eina_Value_Struct_Operations *ops, const Eina_Value_Struct_Desc *desc, const void *data1, const void *data2); - const Eina_Value_Struct_Member *(*find_member)(const Eina_Value_Struct_Operations *ops, const Eina_Value_Struct_Desc *desc, const char *name); /**< replace the function to find description for member. For huge structures consider using binary search, stringshared, hash or gperf. The default function does linear search using strcmp(). */ + unsigned int version; /**< must be #EINA_VALUE_STRUCT_OPERATIONS_VERSION */ + void *(*alloc)(const Eina_Value_Struct_Operations *ops, const Eina_Value_Struct_Desc *desc); /**< How to allocate struct memory to be managed by the Eina_Value */ + void (*free)(const Eina_Value_Struct_Operations *ops, const Eina_Value_Struct_Desc *desc, void *memory); /**< How to release memory managed by the Eina_Value */ + void *(*copy)(const Eina_Value_Struct_Operations *ops, const Eina_Value_Struct_Desc *desc, const void *memory); /**< How to copy struct memory from an existing Eina_Value, if not provided alloc() will be used, then every member is copied using eina_value_type_copy() with member's type. */ + int (*compare)(const Eina_Value_Struct_Operations *ops, const Eina_Value_Struct_Desc *desc, const void *data1, const void *data2); /**< How to compare two struct memories */ + const Eina_Value_Struct_Member *(*find_member)(const Eina_Value_Struct_Operations *ops, const Eina_Value_Struct_Desc *desc, const char *name); /**< How to find description for member. For huge structures consider using binary search, stringshared, hash or gperf. The default function does linear search using strcmp(). */ }; /** @@ -2539,23 +2876,48 @@ EAPI extern const Eina_Value_Struct_Operations *EINA_VALUE_STRUCT_OPERATIONS_STR /** * @struct _Eina_Value_Struct_Member + * Describes a single member of struct. + * + * The name is used to lookup the member description. This is done as + * specified as _Eina_Value_Struct_Operations::find_member(). For + * structures with huge number of members, consider using a better + * find_member function to quickly finding it! There are two helper + * operations provided to help this: + * #EINA_VALUE_STRUCT_OPERATIONS_BINSEARCH and + * #EINA_VALUE_STRUCT_OPERATIONS_STRINGSHARE, both depend on properly + * set #_Eina_Value_Struct_Desc and #_Eina_Value_Struct_Member. + * + * @see #EINA_VALUE_STRUCT_MEMBER + * @see #EINA_VALUE_STRUCT_MEMBER_SENTINEL + * * @since 1.2 */ struct _Eina_Value_Struct_Member { - const char *name; - const Eina_Value_Type *type; - unsigned int offset; + const char *name; /**< member name, used in lookups such as eina_value_struct_get() */ + const Eina_Value_Type *type; /**< how to use this member */ + unsigned int offset; /**< where this member is located within the structure memory */ }; /** + * @def EINA_VALUE_STRUCT_DESC_VERSION + * Current API version, used to validate #_Eina_Value_Struct_Desc. + */ +#define EINA_VALUE_STRUCT_DESC_VERSION (1) + +/** * @struct _Eina_Value_Struct_Desc + * Describes the struct by listing its size, members and operations. + * + * This is the root of Eina_Value knowledge about the memory it's + * handling as a structure. It adds introspection, saying the byte + * size of the structure, its members and how to manage such members. + * * @since 1.2 */ struct _Eina_Value_Struct_Desc { -#define EINA_VALUE_STRUCT_DESC_VERSION (1) - unsigned int version; /**< must be EINA_VALUE_STRUCT_DESC_VERSION */ + unsigned int version; /**< must be #EINA_VALUE_STRUCT_DESC_VERSION */ const Eina_Value_Struct_Operations *ops; /**< operations, if @c NULL defaults will be used. You may use operations to optimize member lookup using binary search or gperf hash. */ const Eina_Value_Struct_Member *members; /**< array of member descriptions, if @c member_count is zero, then it must be @c NULL terminated. */ unsigned int member_count; /**< if > 0, specifies number of members. If zero then @c members must be NULL terminated. */ @@ -2586,12 +2948,13 @@ struct _Eina_Value_Struct_Desc /** * @struct _Eina_Value_Struct + * Used to store the memory and its description. * @since 1.2 */ struct _Eina_Value_Struct { - const Eina_Value_Struct_Desc *desc; - void *memory; + const Eina_Value_Struct_Desc *desc; /**< How to manage the structure */ + void *memory; /**< The managed structure memory */ }; /** @@ -2702,7 +3065,7 @@ static inline Eina_Bool eina_value_struct_setup(Eina_Value *value, */ static inline Eina_Bool eina_value_struct_set(Eina_Value *value, const char *name, - ...) EINA_ARG_NONNULL(1); + ...) EINA_ARG_NONNULL(1, 2); /** * @brief Get the generic value from an struct member. @@ -2770,7 +3133,7 @@ static inline Eina_Bool eina_value_struct_set(Eina_Value *value, */ static inline Eina_Bool eina_value_struct_get(const Eina_Value *value, const char *name, - ...) EINA_ARG_NONNULL(1); + ...) EINA_ARG_NONNULL(1, 2); /** * @brief Set the generic value in an struct member. @@ -2786,7 +3149,7 @@ static inline Eina_Bool eina_value_struct_get(const Eina_Value *value, */ static inline Eina_Bool eina_value_struct_vset(Eina_Value *value, const char *name, - va_list args) EINA_ARG_NONNULL(1); + va_list args) EINA_ARG_NONNULL(1, 2); /** * @brief Get the generic value from an struct member. @@ -2808,7 +3171,7 @@ static inline Eina_Bool eina_value_struct_vset(Eina_Value *value, */ static inline Eina_Bool eina_value_struct_vget(const Eina_Value *value, const char *name, - va_list args) EINA_ARG_NONNULL(1); + va_list args) EINA_ARG_NONNULL(1, 2); /** * @brief Set the generic value in an struct member from pointer. @@ -2875,7 +3238,7 @@ static inline Eina_Bool eina_value_struct_vget(const Eina_Value *value, */ static inline Eina_Bool eina_value_struct_pset(Eina_Value *value, const char *name, - const void *ptr) EINA_ARG_NONNULL(1, 3); + const void *ptr) EINA_ARG_NONNULL(1, 2, 3); /** * @brief Get the generic value to pointer from an struct member. @@ -2944,7 +3307,62 @@ static inline Eina_Bool eina_value_struct_pset(Eina_Value *value, */ static inline Eina_Bool eina_value_struct_pget(const Eina_Value *value, const char *name, - void *ptr) EINA_ARG_NONNULL(1, 3); + void *ptr) EINA_ARG_NONNULL(1, 2, 3); + +/** + * @brief Get the member as Eina_Value copy + * @param src source value object + * @param name name to find the member + * @param dst where to return the member value. + * + * The argument @a dst is considered uninitialized and it's setup to + * the type of the member. + * + * @since 1.2 + */ +static inline Eina_Bool eina_value_struct_value_get(const Eina_Value *src, + const char *name, + Eina_Value *dst) EINA_ARG_NONNULL(1, 2, 3); + +/** + * @brief Set the member from Eina_Value source + * @param dst destination value object + * @param name name to find the member + * @param src source value + * + * @since 1.2 + */ +static inline Eina_Bool eina_value_struct_value_set(Eina_Value *dst, + const char *name, + const Eina_Value *src) EINA_ARG_NONNULL(1, 2, 3); + +/** + * @brief Get the member as Eina_Value copy given its member description. + * @param src source value object + * @param member the member description to use + * @param dst where to return the member value. + * + * The argument @a dst is considered uninitialized and it's setup to + * the type of the member. + * + * @since 1.2 + */ +static inline Eina_Bool eina_value_struct_member_value_get(const Eina_Value *src, + const Eina_Value_Struct_Member *member, + Eina_Value *dst) EINA_ARG_NONNULL(1, 2, 3); + +/** + * @brief Set the member from Eina_Value source + * @param dst destination value object + * @param member the member description to use + * @param src source value + * + * @since 1.2 + */ +static inline Eina_Bool eina_value_struct_member_value_set(Eina_Value *dst, + const Eina_Value_Struct_Member *member, + const Eina_Value *src) EINA_ARG_NONNULL(1, 2, 3); + /** * @} @@ -2958,6 +3376,12 @@ static inline Eina_Bool eina_value_struct_pget(const Eina_Value *value, */ /** + * @def EINA_VALUE_TYPE_VERSION + * Current API version, used to validate type. + */ +#define EINA_VALUE_TYPE_VERSION (1) + +/** * @struct _Eina_Value_Type * API to access values. * @@ -2965,11 +3389,6 @@ static inline Eina_Bool eina_value_struct_pget(const Eina_Value *value, */ struct _Eina_Value_Type { - /** - * @def EINA_VALUE_TYPE_VERSION - * Current API version, used to validate type. - */ -#define EINA_VALUE_TYPE_VERSION (1) unsigned int version; /**< must be #EINA_VALUE_TYPE_VERSION */ unsigned int value_size; /**< byte size of value */ const char *name; /**< name for debug and introspection */ diff --git a/libraries/eina/src/lib/Makefile.am b/libraries/eina/src/lib/Makefile.am index d8c9d20..5de2848 100644 --- a/libraries/eina/src/lib/Makefile.am +++ b/libraries/eina/src/lib/Makefile.am @@ -6,8 +6,8 @@ AM_CPPFLAGS = \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ -@EINA_CPPFLAGS@ \ -@EFL_EINA_BUILD@ +@EFL_EINA_BUILD@ \ +@VALGRIND_CFLAGS@ base_sources = \ eina_accessor.c \ @@ -33,6 +33,7 @@ eina_main.c \ eina_matrixsparse.c \ eina_mempool.c \ eina_mmap.c \ +eina_model.c \ eina_module.c \ eina_prefix.c \ eina_quadtree.c \ diff --git a/libraries/eina/src/lib/Makefile.in b/libraries/eina/src/lib/Makefile.in index 878bcbe..f15bb00 100644 --- a/libraries/eina/src/lib/Makefile.in +++ b/libraries/eina/src/lib/Makefile.in @@ -49,20 +49,24 @@ host_triplet = @host@ subdir = src/lib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ - $(top_srcdir)/m4/efl_benchmark.m4 \ - $(top_srcdir)/m4/efl_compiler_flag.m4 \ - $(top_srcdir)/m4/efl_coverage.m4 $(top_srcdir)/m4/efl_cpu.m4 \ - $(top_srcdir)/m4/efl_doxygen.m4 \ - $(top_srcdir)/m4/efl_examples.m4 \ - $(top_srcdir)/m4/efl_fnmatch.m4 \ - $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ - $(top_srcdir)/m4/efl_threads.m4 \ - $(top_srcdir)/m4/efl_voltron.m4 $(top_srcdir)/m4/eina_bench.m4 \ - $(top_srcdir)/m4/eina_check.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/eina/eina_bench.m4 \ + $(top_srcdir)/m4/eina/eina_check.m4 \ + $(top_srcdir)/m4/common/efl_attribute.m4 \ + $(top_srcdir)/m4/common/efl_benchmark.m4 \ + $(top_srcdir)/m4/common/efl_compiler_flag.m4 \ + $(top_srcdir)/m4/common/efl_coverage.m4 \ + $(top_srcdir)/m4/common/efl_cpu.m4 \ + $(top_srcdir)/m4/common/efl_doxygen.m4 \ + $(top_srcdir)/m4/common/efl_examples.m4 \ + $(top_srcdir)/m4/common/efl_fnmatch.m4 \ + $(top_srcdir)/m4/common/efl_path_max.m4 \ + $(top_srcdir)/m4/common/efl_tests.m4 \ + $(top_srcdir)/m4/common/efl_threads.m4 \ + $(top_srcdir)/m4/common/efl_voltron.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -99,13 +103,13 @@ am__libeina_la_SOURCES_DIST = eina_accessor.c eina_array.c \ eina_hamster.c eina_hash.c eina_inarray.c eina_inlist.c \ eina_iterator.c eina_lalloc.c eina_list.c eina_log.c \ eina_magic.c eina_main.c eina_matrixsparse.c eina_mempool.c \ - eina_mmap.c eina_module.c eina_prefix.c eina_quadtree.c \ - eina_rbtree.c eina_rectangle.c eina_safety_checks.c \ - eina_sched.c eina_share_common.c eina_simple_xml_parser.c \ - eina_str.c eina_strbuf.c eina_strbuf_common.c \ - eina_stringshare.c eina_tiler.c eina_unicode.c eina_ustrbuf.c \ - eina_ustringshare.c eina_value.c eina_xattr.c \ - eina_file_win32.c eina_file.c \ + eina_mmap.c eina_model.c eina_module.c eina_prefix.c \ + eina_quadtree.c eina_rbtree.c eina_rectangle.c \ + eina_safety_checks.c eina_sched.c eina_share_common.c \ + eina_simple_xml_parser.c eina_str.c eina_strbuf.c \ + eina_strbuf_common.c eina_stringshare.c eina_tiler.c \ + eina_unicode.c eina_ustrbuf.c eina_ustringshare.c eina_value.c \ + eina_xattr.c eina_file_win32.c eina_file.c \ $(top_srcdir)/src/modules/mp/buddy/eina_buddy.c \ $(top_srcdir)/src/modules/mp/chained_pool/eina_chained_mempool.c \ $(top_srcdir)/src/modules/mp/ememoa_fixed/eina_ememoa_fixed.c \ @@ -135,11 +139,11 @@ am__objects_10 = libeina_la-eina_accessor.lo libeina_la-eina_array.lo \ libeina_la-eina_list.lo libeina_la-eina_log.lo \ libeina_la-eina_magic.lo libeina_la-eina_main.lo \ libeina_la-eina_matrixsparse.lo libeina_la-eina_mempool.lo \ - libeina_la-eina_mmap.lo libeina_la-eina_module.lo \ - libeina_la-eina_prefix.lo libeina_la-eina_quadtree.lo \ - libeina_la-eina_rbtree.lo libeina_la-eina_rectangle.lo \ - libeina_la-eina_safety_checks.lo libeina_la-eina_sched.lo \ - libeina_la-eina_share_common.lo \ + libeina_la-eina_mmap.lo libeina_la-eina_model.lo \ + libeina_la-eina_module.lo libeina_la-eina_prefix.lo \ + libeina_la-eina_quadtree.lo libeina_la-eina_rbtree.lo \ + libeina_la-eina_rectangle.lo libeina_la-eina_safety_checks.lo \ + libeina_la-eina_sched.lo libeina_la-eina_share_common.lo \ libeina_la-eina_simple_xml_parser.lo libeina_la-eina_str.lo \ libeina_la-eina_strbuf.lo libeina_la-eina_strbuf_common.lo \ libeina_la-eina_stringshare.lo libeina_la-eina_tiler.lo \ @@ -236,13 +240,13 @@ EINA_CONFIGURE_DEFAULT_MEMPOOL = @EINA_CONFIGURE_DEFAULT_MEMPOOL@ EINA_CONFIGURE_ENABLE_LOG = @EINA_CONFIGURE_ENABLE_LOG@ EINA_CONFIGURE_HAVE_DEBUG_THREADS = @EINA_CONFIGURE_HAVE_DEBUG_THREADS@ EINA_CONFIGURE_HAVE_DIRENT_H = @EINA_CONFIGURE_HAVE_DIRENT_H@ +EINA_CONFIGURE_HAVE_EXOTIC = @EINA_CONFIGURE_HAVE_EXOTIC@ EINA_CONFIGURE_HAVE_INTTYPES_H = @EINA_CONFIGURE_HAVE_INTTYPES_H@ EINA_CONFIGURE_HAVE_ON_OFF_THREADS = @EINA_CONFIGURE_HAVE_ON_OFF_THREADS@ EINA_CONFIGURE_HAVE_STDINT_H = @EINA_CONFIGURE_HAVE_STDINT_H@ EINA_CONFIGURE_HAVE_THREADS = @EINA_CONFIGURE_HAVE_THREADS@ EINA_CONFIGURE_MAGIC_DEBUG = @EINA_CONFIGURE_MAGIC_DEBUG@ EINA_CONFIGURE_SAFETY_CHECKS = @EINA_CONFIGURE_SAFETY_CHECKS@ -EINA_CPPFLAGS = @EINA_CPPFLAGS@ EINA_LIBS = @EINA_LIBS@ EINA_SIZEOF_WCHAR_T = @EINA_SIZEOF_WCHAR_T@ EMEMOA_CFLAGS = @EMEMOA_CFLAGS@ @@ -252,6 +256,8 @@ ESCAPE_LIBS = @ESCAPE_LIBS@ EVIL_CFLAGS = @EVIL_CFLAGS@ EVIL_LIBS = @EVIL_LIBS@ EXEEXT = @EXEEXT@ +EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ +EXOTIC_LIBS = @EXOTIC_LIBS@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ @@ -287,6 +293,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -367,23 +375,24 @@ AM_CPPFLAGS = \ -DPACKAGE_BIN_DIR=\"$(bindir)\" \ -DPACKAGE_LIB_DIR=\"$(libdir)\" \ -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ -@EINA_CPPFLAGS@ \ -@EFL_EINA_BUILD@ +@EFL_EINA_BUILD@ \ +@VALGRIND_CFLAGS@ base_sources = eina_accessor.c eina_array.c eina_benchmark.c \ eina_binbuf.c eina_binshare.c eina_convert.c eina_counter.c \ eina_cpu.c eina_error.c eina_fp.c eina_hamster.c eina_hash.c \ eina_inarray.c eina_inlist.c eina_iterator.c eina_lalloc.c \ eina_list.c eina_log.c eina_magic.c eina_main.c \ - eina_matrixsparse.c eina_mempool.c eina_mmap.c eina_module.c \ - eina_prefix.c eina_quadtree.c eina_rbtree.c eina_rectangle.c \ - eina_safety_checks.c eina_sched.c eina_share_common.c \ - eina_simple_xml_parser.c eina_str.c eina_strbuf.c \ - eina_strbuf_common.c eina_stringshare.c eina_tiler.c \ - eina_unicode.c eina_ustrbuf.c eina_ustringshare.c eina_value.c \ - eina_xattr.c $(am__append_1) $(am__append_2) $(am__append_3) \ - $(am__append_4) $(am__append_5) $(am__append_6) \ - $(am__append_7) $(am__append_8) $(am__append_9) + eina_matrixsparse.c eina_mempool.c eina_mmap.c eina_model.c \ + eina_module.c eina_prefix.c eina_quadtree.c eina_rbtree.c \ + eina_rectangle.c eina_safety_checks.c eina_sched.c \ + eina_share_common.c eina_simple_xml_parser.c eina_str.c \ + eina_strbuf.c eina_strbuf_common.c eina_stringshare.c \ + eina_tiler.c eina_unicode.c eina_ustrbuf.c eina_ustringshare.c \ + eina_value.c eina_xattr.c $(am__append_1) $(am__append_2) \ + $(am__append_3) $(am__append_4) $(am__append_5) \ + $(am__append_6) $(am__append_7) $(am__append_8) \ + $(am__append_9) EXTRA_DIST = \ eina_share_common.h \ eina_private.h \ @@ -502,6 +511,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeina_la-eina_matrixsparse.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeina_la-eina_mempool.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeina_la-eina_mmap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeina_la-eina_model.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeina_la-eina_module.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeina_la-eina_one_big.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libeina_la-eina_pass_through.Plo@am__quote@ @@ -732,6 +742,14 @@ libeina_la-eina_mmap.lo: eina_mmap.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeina_la_CFLAGS) $(CFLAGS) -c -o libeina_la-eina_mmap.lo `test -f 'eina_mmap.c' || echo '$(srcdir)/'`eina_mmap.c +libeina_la-eina_model.lo: eina_model.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeina_la_CFLAGS) $(CFLAGS) -MT libeina_la-eina_model.lo -MD -MP -MF $(DEPDIR)/libeina_la-eina_model.Tpo -c -o libeina_la-eina_model.lo `test -f 'eina_model.c' || echo '$(srcdir)/'`eina_model.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeina_la-eina_model.Tpo $(DEPDIR)/libeina_la-eina_model.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='eina_model.c' object='libeina_la-eina_model.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeina_la_CFLAGS) $(CFLAGS) -c -o libeina_la-eina_model.lo `test -f 'eina_model.c' || echo '$(srcdir)/'`eina_model.c + libeina_la-eina_module.lo: eina_module.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libeina_la_CFLAGS) $(CFLAGS) -MT libeina_la-eina_module.lo -MD -MP -MF $(DEPDIR)/libeina_la-eina_module.Tpo -c -o libeina_la-eina_module.lo `test -f 'eina_module.c' || echo '$(srcdir)/'`eina_module.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libeina_la-eina_module.Tpo $(DEPDIR)/libeina_la-eina_module.Plo diff --git a/libraries/eina/src/lib/eina_binshare.c b/libraries/eina/src/lib/eina_binshare.c index 68a82fc..01e8046 100644 --- a/libraries/eina/src/lib/eina_binshare.c +++ b/libraries/eina/src/lib/eina_binshare.c @@ -21,9 +21,18 @@ */ -#include "eina_share_common.h" -#include "eina_unicode.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "eina_config.h" #include "eina_private.h" +#include "eina_unicode.h" +#include "eina_log.h" +#include "eina_share_common.h" + +/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ +#include "eina_safety_checks.h" #include "eina_binshare.h" /*============================================================================* @@ -34,6 +43,23 @@ * @cond LOCAL */ +#ifdef CRITICAL +#undef CRITICAL +#endif +#define CRITICAL(...) EINA_LOG_DOM_CRIT(_eina_share_binshare_log_dom, __VA_ARGS__) + +#ifdef ERR +#undef ERR +#endif +#define ERR(...) EINA_LOG_DOM_ERR(_eina_share_binshare_log_dom, __VA_ARGS__) + +#ifdef DBG +#undef DBG +#endif +#define DBG(...) EINA_LOG_DOM_DBG(_eina_share_binshare_log_dom, __VA_ARGS__) + +static int _eina_share_binshare_log_dom = -1; + /* The actual share */ static Eina_Share *binshare_share; static const char EINA_MAGIC_BINSHARE_NODE_STR[] = "Eina Binshare Node"; @@ -42,7 +68,6 @@ static const char EINA_MAGIC_BINSHARE_NODE_STR[] = "Eina Binshare Node"; * @endcond */ - /*============================================================================* * Global * *============================================================================*/ @@ -61,9 +86,31 @@ static const char EINA_MAGIC_BINSHARE_NODE_STR[] = "Eina Binshare Node"; EAPI Eina_Bool eina_binshare_init(void) { - return eina_share_common_init(&binshare_share, - EINA_MAGIC_BINSHARE_NODE, - EINA_MAGIC_BINSHARE_NODE_STR); + Eina_Bool ret; + + if (_eina_share_binshare_log_dom < 0) + { + _eina_share_binshare_log_dom = eina_log_domain_register + ("eina_binshare", EINA_LOG_COLOR_DEFAULT); + + if (_eina_share_binshare_log_dom < 0) + { + EINA_LOG_ERR("Could not register log domain: eina_binshare"); + return EINA_FALSE; + } + } + + ret = eina_share_common_init(&binshare_share, + EINA_MAGIC_BINSHARE_NODE, + EINA_MAGIC_BINSHARE_NODE_STR); + + if (!ret) + { + eina_log_domain_unregister(_eina_share_binshare_log_dom); + _eina_share_binshare_log_dom = -1; + } + + return ret; } /** @@ -82,6 +129,13 @@ eina_binshare_shutdown(void) { Eina_Bool ret; ret = eina_share_common_shutdown(&binshare_share); + + if (_eina_share_binshare_log_dom > 0) + { + eina_log_domain_unregister(_eina_share_binshare_log_dom); + _eina_share_binshare_log_dom = -1; + } + return ret; } @@ -96,7 +150,8 @@ eina_binshare_del(const void *obj) if (!obj) return; - eina_share_common_del(binshare_share, obj); + if (!eina_share_common_del(binshare_share, obj)) + CRITICAL("EEEK trying to del non-shared binshare %p", obj); } EAPI const void * diff --git a/libraries/eina/src/lib/eina_file.c b/libraries/eina/src/lib/eina_file.c index 0b836b3..c465301 100644 --- a/libraries/eina/src/lib/eina_file.c +++ b/libraries/eina/src/lib/eina_file.c @@ -362,41 +362,15 @@ _eina_file_direct_ls_iterator_free(Eina_File_Direct_Iterator *it) static Eina_Bool _eina_file_stat_ls_iterator_next(Eina_File_Direct_Iterator *it, void **data) { - struct stat st; + Eina_Stat st; if (!_eina_file_direct_ls_iterator_next(it, data)) return EINA_FALSE; if (it->info.type == EINA_FILE_UNKNOWN) { -#ifdef HAVE_FSTATAT - int fd; - - fd = dirfd(it->dirp); - if (fstatat(fd, it->info.path + it->info.name_start, &st, 0)) -#else - if (stat(it->info.path, &st)) -#endif + if (eina_file_statat(it->dirp, &it->info, &st) != 0) it->info.type = EINA_FILE_UNKNOWN; - else - { - if (S_ISREG(st.st_mode)) - it->info.type = EINA_FILE_REG; - else if (S_ISDIR(st.st_mode)) - it->info.type = EINA_FILE_DIR; - else if (S_ISCHR(st.st_mode)) - it->info.type = EINA_FILE_CHR; - else if (S_ISBLK(st.st_mode)) - it->info.type = EINA_FILE_BLK; - else if (S_ISFIFO(st.st_mode)) - it->info.type = EINA_FILE_FIFO; - else if (S_ISLNK(st.st_mode)) - it->info.type = EINA_FILE_LNK; - else if (S_ISSOCK(st.st_mode)) - it->info.type = EINA_FILE_SOCK; - else - it->info.type = EINA_FILE_UNKNOWN; - } } return EINA_TRUE; @@ -593,6 +567,14 @@ _eina_file_escape(const char *path, int *length) return result; } +/** + * @endcond + */ + +/*============================================================================* + * Global * + *============================================================================*/ + Eina_Bool eina_file_init(void) { @@ -641,13 +623,60 @@ eina_file_shutdown(void) return EINA_TRUE; } -/** - * @endcond - */ +void +eina_file_mmap_faulty(void *addr, long page_size) +{ + Eina_File_Map *m; + Eina_File *f; + Eina_Iterator *itf; + Eina_Iterator *itm; -/*============================================================================* - * Global * - *============================================================================*/ + /* NOTE: I actually don't know if other thread are running, I will try to take the lock. + It may be possible that if other thread are not running and they were in the middle of + accessing an Eina_File this lock are still taken and we will result as a deadlock. */ + eina_lock_take(&_eina_file_lock_cache); + + itf = eina_hash_iterator_data_new(_eina_file_cache); + EINA_ITERATOR_FOREACH(itf, f) + { + Eina_Bool faulty = EINA_FALSE; + + eina_lock_take(&f->lock); + + if (f->global_map) + { + if ((unsigned char *) addr < (((unsigned char *)f->global_map) + f->length) && + (((unsigned char *) addr) + page_size) >= (unsigned char *) f->global_map) + { + f->global_faulty = EINA_TRUE; + faulty = EINA_TRUE; + } + } + + if (!faulty) + { + itm = eina_hash_iterator_data_new(f->map); + EINA_ITERATOR_FOREACH(itm, m) + { + if ((unsigned char *) addr < (((unsigned char *)m->map) + m->length) && + (((unsigned char *) addr) + page_size) >= (unsigned char *) m->map) + { + m->faulty = EINA_TRUE; + faulty = EINA_TRUE; + break; + } + } + eina_iterator_free(itm); + } + + eina_lock_release(&f->lock); + + if (faulty) break; + } + eina_iterator_free(itf); + + eina_lock_release(&_eina_file_lock_cache); +} /*============================================================================* * API * @@ -950,7 +979,7 @@ eina_file_open(const char *path, Eina_Bool shared) eina_lock_take(&_eina_file_lock_cache); file = eina_hash_find(_eina_file_cache, filename); - if ((file) && _eina_file_timestamp_compare(file, &file_stat)) + if ((file) && !_eina_file_timestamp_compare(file, &file_stat)) { file->delete_me = EINA_TRUE; eina_hash_del(_eina_file_cache, file->filename, file); @@ -1029,7 +1058,7 @@ eina_file_close(Eina_File *file) eina_hash_del(_eina_file_cache, file->filename, file); _eina_file_real_close(file); - + eina_lock_release(&_eina_file_lock_cache); } @@ -1196,7 +1225,7 @@ eina_file_map_free(Eina_File *file, void *map) unsigned long int key[2]; em = eina_hash_find(file->rmap, &map); - if (!em) return ; + if (!em) goto on_exit; em->refcount--; @@ -1217,17 +1246,25 @@ EAPI Eina_Bool eina_file_map_faulted(Eina_File *file, void *map) { Eina_File_Map *em; + Eina_Bool r = EINA_FALSE; EINA_SAFETY_ON_NULL_RETURN_VAL(file, EINA_FALSE); eina_lock_take(&file->lock); - if (file->global_map == map) return file->global_faulty; + if (file->global_map == map) + { + r = file->global_faulty; + } + else + { + em = eina_hash_find(file->rmap, &map); + if (em) r = em->faulty; + } - em = eina_hash_find(file->rmap, &map); - if (!em) return EINA_FALSE; + eina_lock_release(&file->lock); - return em->faulty; + return r; } EAPI Eina_Iterator * @@ -1246,58 +1283,77 @@ eina_file_xattr_value_get(Eina_File *file) return eina_xattr_value_fd_ls(file->fd); } -void -eina_file_mmap_faulty(void *addr, long page_size) +EAPI int +eina_file_statat(void *container, Eina_File_Direct_Info *info, Eina_Stat *st) { - Eina_File_Map *m; - Eina_File *f; - Eina_Iterator *itf; - Eina_Iterator *itm; + struct stat buf; +#ifdef HAVE_FSTATAT + int fd; +#endif - /* NOTE: I actually don't know if other thread are running, I will try to take the lock. - It may be possible that if other thread are not running and they were in the middle of - accessing an Eina_File this lock are still taken and we will result as a deadlock. */ - eina_lock_take(&_eina_file_lock_cache); + EINA_SAFETY_ON_NULL_RETURN_VAL(info, -1); + EINA_SAFETY_ON_NULL_RETURN_VAL(st, -1); - itf = eina_hash_iterator_data_new(_eina_file_cache); - EINA_ITERATOR_FOREACH(itf, f) +#ifdef HAVE_FSTATAT + fd = dirfd((DIR*) container); + if (fstatat(fd, info->path + info->name_start, &buf, 0)) +#else + (void)container; + if (stat(info->path, &buf)) +#endif { - Eina_Bool faulty = EINA_FALSE; - - eina_lock_take(&f->lock); - - if (f->global_map) - { - if ((unsigned char *) addr < (((unsigned char *)f->global_map) + f->length) && - (((unsigned char *) addr) + page_size) >= (unsigned char *) f->global_map) - { - f->global_faulty = EINA_TRUE; - faulty = EINA_TRUE; - } - } - - if (!faulty) - { - itm = eina_hash_iterator_data_new(f->map); - EINA_ITERATOR_FOREACH(itm, m) - { - if ((unsigned char *) addr < (((unsigned char *)m->map) + m->length) && - (((unsigned char *) addr) + page_size) >= (unsigned char *) m->map) - { - m->faulty = EINA_TRUE; - faulty = EINA_TRUE; - break; - } - } - eina_iterator_free(itm); - } - - eina_lock_release(&f->lock); + if (info->type != EINA_FILE_LNK) + info->type = EINA_FILE_UNKNOWN; + return -1; + } - if (faulty) break; + if (info->type == EINA_FILE_UNKNOWN) + { + if (S_ISREG(buf.st_mode)) + info->type = EINA_FILE_REG; + else if (S_ISDIR(buf.st_mode)) + info->type = EINA_FILE_DIR; + else if (S_ISCHR(buf.st_mode)) + info->type = EINA_FILE_CHR; + else if (S_ISBLK(buf.st_mode)) + info->type = EINA_FILE_BLK; + else if (S_ISFIFO(buf.st_mode)) + info->type = EINA_FILE_FIFO; + else if (S_ISLNK(buf.st_mode)) + info->type = EINA_FILE_LNK; + else if (S_ISSOCK(buf.st_mode)) + info->type = EINA_FILE_SOCK; + else + info->type = EINA_FILE_UNKNOWN; } - eina_iterator_free(itf); - eina_lock_release(&_eina_file_lock_cache); + st->dev = buf.st_dev; + st->ino = buf.st_ino; + st->mode = buf.st_mode; + st->nlink = buf.st_nlink; + st->uid = buf.st_uid; + st->gid = buf.st_gid; + st->rdev = buf.st_rdev; + st->size = buf.st_size; + st->blksize = buf.st_blksize; + st->blocks = buf.st_blocks; + st->atime = buf.st_atime; + st->mtime = buf.st_mtime; + st->ctime = buf.st_ctime; +#ifdef _STAT_VER_LINUX +# if (defined __USE_MISC && defined st_mtime) + st->atimensec = buf.st_atim.tv_nsec; + st->mtimensec = buf.st_mtim.tv_nsec; + st->ctimensec = buf.st_ctim.tv_nsec; +# else + st->atimensec = buf.st_atimensec; + st->mtimensec = buf.st_mtimensec; + st->ctimensec = buf.st_ctimensec; +# endif +#else + st->atimensec = 0; + st->mtimensec = 0; + st->ctimensec = 0; +#endif + return 0; } - diff --git a/libraries/eina/src/lib/eina_file_win32.c b/libraries/eina/src/lib/eina_file_win32.c index 1cd8665..5c20fdd 100644 --- a/libraries/eina/src/lib/eina_file_win32.c +++ b/libraries/eina/src/lib/eina_file_win32.c @@ -1,1021 +1,1214 @@ -/* EINA - EFL data type library - * Copyright (C) 2010 Vincent Torri - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; - * if not, see . - */ - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#ifdef HAVE_ALLOCA_H -# include -#elif defined __GNUC__ -# define alloca __builtin_alloca -#elif defined _AIX -# define alloca __alloca -#elif defined _MSC_VER -# include -# define alloca _alloca -#else -# include -# ifdef __cplusplus -extern "C" -# endif -void *alloca (size_t); -#endif - -#define WIN32_LEAN_AND_MEAN -#include -#undef WIN32_LEAN_AND_MEAN - -//#include - -#include "eina_config.h" -#include "eina_private.h" - -/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ -#include "eina_safety_checks.h" -#include "eina_file.h" -#include "eina_stringshare.h" -#include "eina_hash.h" -#include "eina_list.h" - -/*============================================================================* - * Local * - *============================================================================*/ - -/** - * @cond LOCAL - */ - -#ifndef EINA_LOG_COLOR_DEFAULT -#define EINA_LOG_COLOR_DEFAULT EINA_COLOR_CYAN -#endif - -#ifdef ERR -#undef ERR -#endif -#define ERR(...) EINA_LOG_DOM_ERR(_eina_file_log_dom, __VA_ARGS__) - -#ifdef WRN -#undef WRN -#endif -#define WRN(...) EINA_LOG_DOM_WARN(_eina_file_log_dom, __VA_ARGS__) - -#ifdef DBG -#undef DBG -#endif -#define DBG(...) EINA_LOG_DOM_DBG(_eina_file_log_dom, __VA_ARGS__) - -#ifdef MAP_FAILED -# undef MAP_FAILED -#endif -#define MAP_FAILED ((void *)-1) - -typedef struct _Eina_File_Iterator Eina_File_Iterator; -typedef struct _Eina_File_Direct_Iterator Eina_File_Direct_Iterator; -typedef struct _Eina_File_Map Eina_File_Map; - -struct _Eina_File_Iterator -{ - Eina_Iterator iterator; - - WIN32_FIND_DATA data; - HANDLE handle; - size_t length; - Eina_Bool is_last : 1; - - char dir[1]; -}; - -struct _Eina_File_Direct_Iterator -{ - Eina_Iterator iterator; - - WIN32_FIND_DATA data; - HANDLE handle; - size_t length; - Eina_Bool is_last : 1; - - Eina_File_Direct_Info info; - - char dir[1]; -}; - -struct _Eina_File -{ - const char *filename; - - Eina_Hash *map; - Eina_Hash *rmap; - void *global_map; - - ULONGLONG length; - ULONGLONG mtime; - - int refcount; - int global_refcount; - - HANDLE handle; - HANDLE fm; - - Eina_Bool shared : 1; - Eina_Bool delete_me : 1; -}; - -struct _Eina_File_Map -{ - void *map; - - unsigned long int offset; - unsigned long int length; - - int refcount; -}; - -static Eina_Hash *_eina_file_cache = NULL; -static Eina_List *_eina_file_cache_lru = NULL; -static Eina_List *_eina_file_cache_delete = NULL; - -static int _eina_file_log_dom = -1; - -static void -_eina_file_win32_backslash_change(char *dir) -{ - char *tmp; - - tmp = dir; - while (*tmp) - { - if (*tmp == '/') *tmp = '\\'; - tmp++; - } -} - -static Eina_Bool -_eina_file_win32_is_dir(const char *dir) -{ -#ifdef UNICODE - wchar_t *wdir = NULL; -#endif - DWORD attr; - - /* check if it's a directory */ -#ifdef UNICODE - wdir = evil_char_to_wchar(dir); - if (!wdir) - return EINA_FALSE; - - attr = GetFileAttributes(wdir); - free(wdir); -#else - attr = GetFileAttributes(dir); -#endif - - if (attr == 0xFFFFFFFF) - return EINA_FALSE; - - if (!(attr & FILE_ATTRIBUTE_DIRECTORY)) - return EINA_FALSE; - - return EINA_TRUE; -} - -static char * -_eina_file_win32_dir_new(const char *dir) -{ - char *new_dir; - size_t length; - - length = strlen(dir); - - new_dir = (char *)malloc(sizeof(char) * length + 5); - if (!new_dir) - return NULL; - - memcpy(new_dir, dir, length); - memcpy(new_dir + length, "\\*.*", 5); - _eina_file_win32_backslash_change(new_dir); - - return new_dir; -} - -static HANDLE -_eina_file_win32_first_file(const char *dir, WIN32_FIND_DATA *fd) -{ - HANDLE h; -#ifdef UNICODE - wchar_t *wdir = NULL; - - wdir = evil_char_to_wchar(dir); - if (!wdir) - return NULL; - - h = FindFirstFile(wdir, fd); - free(wdir); -#else - h = FindFirstFile(dir, fd); -#endif - - if (!h) - return NULL; - - while ((fd->cFileName[0] == '.') && - ((fd->cFileName[1] == '\0') || - ((fd->cFileName[1] == '.') && (fd->cFileName[2] == '\0')))) - { - if (!FindNextFile(h, fd)) - return NULL; - } - - return h; -} - -static Eina_Bool -_eina_file_win32_ls_iterator_next(Eina_File_Iterator *it, void **data) -{ -#ifdef UNICODE - wchar_t *old_name; -#else - char *old_name; -#endif - char *name; - char *cname; - size_t length; - Eina_Bool is_last; - Eina_Bool res = EINA_TRUE; - - if (it->handle == INVALID_HANDLE_VALUE) - return EINA_FALSE; - - is_last = it->is_last; -#ifdef UNICODE - old_name = _wcsdup(it->data.cFileName); -#else - old_name = _strdup(it->data.cFileName); -#endif - if (!old_name) - return EINA_FALSE; - - do { - if (!FindNextFile(it->handle, &it->data)) - { - if (GetLastError() == ERROR_NO_MORE_FILES) - it->is_last = EINA_TRUE; - else - res = EINA_FALSE; - } - } while ((it->data.cFileName[0] == '.') && - ((it->data.cFileName[1] == '\0') || - ((it->data.cFileName[1] == '.') && (it->data.cFileName[2] == '\0')))); /* FIXME: what about UNICODE ? */ - -#ifdef UNICODE - cname = evil_wchar_to_char(old_name); - if (!cname) - return EINA_FALSE; -#else - cname = old_name; -#endif - - length = strlen(cname); - name = alloca(length + 2 + it->length); - - memcpy(name, it->dir, it->length); - memcpy(name + it->length, "\\", 1); - memcpy(name + it->length + 1, cname, length + 1); - - *data = (char *)eina_stringshare_add(name); - -#ifdef UNICODE - free(cname); -#endif - free(old_name); - - if (is_last) - res = EINA_FALSE; - - return res; -} - -static HANDLE -_eina_file_win32_ls_iterator_container(Eina_File_Iterator *it) -{ - return it->handle; -} - -static void -_eina_file_win32_ls_iterator_free(Eina_File_Iterator *it) -{ - if (it->handle != INVALID_HANDLE_VALUE) - FindClose(it->handle); - - EINA_MAGIC_SET(&it->iterator, 0); - free(it); -} - -static Eina_Bool -_eina_file_win32_direct_ls_iterator_next(Eina_File_Direct_Iterator *it, void **data) -{ -#ifdef UNICODE - wchar_t *old_name; -#else - char *old_name; -#endif - char *cname; - size_t length; - DWORD attr; - Eina_Bool is_last; - Eina_Bool res = EINA_TRUE; - - if (it->handle == INVALID_HANDLE_VALUE) - return EINA_FALSE; - - attr = it->data.dwFileAttributes; - is_last = it->is_last; -#ifdef UNICODE - old_name = _wcsdup(it->data.cFileName); -#else - old_name = _strdup(it->data.cFileName); -#endif - if (!old_name) - return EINA_FALSE; - - do { - if (!FindNextFile(it->handle, &it->data)) - { - if (GetLastError() == ERROR_NO_MORE_FILES) - it->is_last = EINA_TRUE; - else - res = EINA_FALSE; - } - -#ifdef UNICODE - length = wcslen(old_name); -#else - length = strlen(old_name); -#endif - if (it->info.name_start + length + 1 >= PATH_MAX) - { - free(old_name); -#ifdef UNICODE - old_name = _wcsdup(it->data.cFileName); -#else - old_name = _strdup(it->data.cFileName); -#endif - continue; - } - - } while ((it->data.cFileName[0] == '.') && - ((it->data.cFileName[1] == '\0') || - ((it->data.cFileName[1] == '.') && (it->data.cFileName[2] == '\0')))); /* FIXME: what about UNICODE ? */ - -#ifdef UNICODE - cname = evil_wchar_to_char(old_name); - if (!cname) - return EINA_FALSE; -#else - cname = old_name; -#endif - - memcpy(it->info.path + it->info.name_start, cname, length); - it->info.name_length = length; - it->info.path_length = it->info.name_start + length; - it->info.path[it->info.path_length] = '\0'; - - if (attr & FILE_ATTRIBUTE_DIRECTORY) - it->info.type = EINA_FILE_DIR; - else if (attr & FILE_ATTRIBUTE_REPARSE_POINT) - it->info.type = EINA_FILE_LNK; - else if (attr & (FILE_ATTRIBUTE_ARCHIVE | - FILE_ATTRIBUTE_COMPRESSED | - FILE_ATTRIBUTE_COMPRESSED | - FILE_ATTRIBUTE_HIDDEN | - FILE_ATTRIBUTE_NORMAL | - FILE_ATTRIBUTE_SPARSE_FILE | - FILE_ATTRIBUTE_TEMPORARY)) - it->info.type = EINA_FILE_REG; - else - it->info.type = EINA_FILE_UNKNOWN; - - *data = &it->info; - -#ifdef UNICODE - free(cname); -#endif - - free(old_name); - - if (is_last) - res = EINA_FALSE; - - return res; -} - -static HANDLE -_eina_file_win32_direct_ls_iterator_container(Eina_File_Direct_Iterator *it) -{ - return it->handle; -} - -static void -_eina_file_win32_direct_ls_iterator_free(Eina_File_Direct_Iterator *it) -{ - if (it->handle != INVALID_HANDLE_VALUE) - FindClose(it->handle); - - EINA_MAGIC_SET(&it->iterator, 0); - free(it); -} - -static void -_eina_file_real_close(Eina_File *file) -{ - eina_hash_free(file->rmap); - eina_hash_free(file->map); - - if (file->global_map != MAP_FAILED) - UnmapViewOfFile(file->global_map); - - CloseHandle(file->fm); - CloseHandle(file->handle); - - eina_stringshare_del(file->filename); - - free(file); -} - -static void -_eina_file_map_close(Eina_File_Map *map) -{ - if (map->map != MAP_FAILED) - UnmapViewOfFile(map->map); - free(map); -} - -static unsigned int -_eina_file_map_key_length(const void *key __UNUSED__) -{ - return sizeof (unsigned long int) * 2; -} - -static int -_eina_file_map_key_cmp(const unsigned long int *key1, int key1_length __UNUSED__, - const unsigned long int *key2, int key2_length __UNUSED__) -{ - if (key1[0] - key2[0] == 0) return key1[1] - key2[1]; - return key1[0] - key2[0]; -} - -static int -_eina_file_map_key_hash(const unsigned long int *key, int key_length __UNUSED__) -{ - return eina_hash_int64(&key[0], sizeof (unsigned long int)) - ^ eina_hash_int64(&key[1], sizeof (unsigned long int)); -} - -Eina_Bool -eina_file_init(void) -{ - _eina_file_log_dom = eina_log_domain_register("eina_file", - EINA_LOG_COLOR_DEFAULT); - if (_eina_file_log_dom < 0) - { - EINA_LOG_ERR("Could not register log domain: eina_file"); - return EINA_FALSE; - } - - _eina_file_cache = eina_hash_string_djb2_new(EINA_FREE_CB(_eina_file_real_close)); - if (!_eina_file_cache) - { - ERR("Could not create cache."); - eina_log_domain_unregister(_eina_file_log_dom); - _eina_file_log_dom = -1; - return EINA_FALSE; - } - - return EINA_TRUE; -} - -Eina_Bool -eina_file_shutdown(void) -{ - Eina_File *f; - Eina_List *l; - - EINA_LIST_FREE(_eina_file_cache_delete, f) - _eina_file_real_close(f); - - EINA_LIST_FOREACH(_eina_file_cache_lru, l, f) - eina_hash_del(_eina_file_cache, f->filename, f); - - if (eina_hash_population(_eina_file_cache) > 0) - { - Eina_Iterator *it; - const char *key; - - it = eina_hash_iterator_key_new(_eina_file_cache); - EINA_ITERATOR_FOREACH(it, key) - ERR("File [%s] still open !", key); - eina_iterator_free(it); - } - - eina_hash_free(_eina_file_cache); - - eina_log_domain_unregister(_eina_file_log_dom); - _eina_file_log_dom = -1; - return EINA_TRUE; -} - - -/** - * @endcond - */ - -/*============================================================================* - * Global * - *============================================================================*/ - -/*============================================================================* - * API * - *============================================================================*/ - -EAPI Eina_Bool -eina_file_dir_list(const char *dir, - Eina_Bool recursive, - Eina_File_Dir_List_Cb cb, - void *data) -{ - WIN32_FIND_DATA file; - HANDLE h; - char *new_dir; - - EINA_SAFETY_ON_NULL_RETURN_VAL(cb, EINA_FALSE); - EINA_SAFETY_ON_NULL_RETURN_VAL(dir, EINA_FALSE); - EINA_SAFETY_ON_TRUE_RETURN_VAL(dir[0] == '\0', EINA_FALSE); - - if (!_eina_file_win32_is_dir(dir)) - return EINA_FALSE; - - new_dir = _eina_file_win32_dir_new(dir); - if (!new_dir) - return EINA_FALSE; - - h = _eina_file_win32_first_file(new_dir, &file); - - if (h == INVALID_HANDLE_VALUE) - return EINA_FALSE; - - do - { - char *filename; - -# ifdef UNICODE - filename = evil_wchar_to_char(file.cFileName); -# else - filename = file.cFileName; -# endif /* ! UNICODE */ - if (!strcmp(filename, ".") || !strcmp(filename, "..")) - continue; - - cb(filename, dir, data); - - if (recursive == EINA_TRUE) - { - char *path; - - path = alloca(strlen(dir) + strlen(filename) + 2); - strcpy(path, dir); - strcat(path, "/"); - strcat(path, filename); - - if (!(file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) - continue; - - eina_file_dir_list(path, recursive, cb, data); - } - -# ifdef UNICODE - free(filename); -# endif /* UNICODE */ - - } while (FindNextFile(h, &file)); - FindClose(h); - - return EINA_TRUE; -} - -EAPI Eina_Array * -eina_file_split(char *path) -{ - Eina_Array *ea; - char *current; - size_t length; - - EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL); - - ea = eina_array_new(16); - - if (!ea) - return NULL; - - for (current = strchr(path, '\\'); - current; - path = current + 1, current = strchr(path, '\\')) - { - length = current - path; - - if (length <= 0) - continue; - - eina_array_push(ea, path); - *current = '\0'; - } - - if (*path != '\0') - eina_array_push(ea, path); - - return ea; -} - -EAPI Eina_Iterator * -eina_file_ls(const char *dir) -{ - Eina_File_Iterator *it; - char *new_dir; - size_t length; - - if (!dir || !*dir) - return NULL; - - if (!_eina_file_win32_is_dir(dir)) - return NULL; - - length = strlen(dir); - - it = calloc(1, sizeof (Eina_File_Iterator) + length); - if (!it) - return NULL; - - EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); - - new_dir = _eina_file_win32_dir_new(dir); - if (!new_dir) - goto free_it; - - it->handle = _eina_file_win32_first_file(new_dir, &it->data); - free(new_dir); - if (it->handle == INVALID_HANDLE_VALUE) - goto free_it; - - memcpy(it->dir, dir, length + 1); - if (dir[length - 1] != '\\') - it->length = length; - else - it->length = length - 1; - _eina_file_win32_backslash_change(it->dir); - - it->iterator.version = EINA_ITERATOR_VERSION; - it->iterator.next = FUNC_ITERATOR_NEXT(_eina_file_win32_ls_iterator_next); - it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_eina_file_win32_ls_iterator_container); - it->iterator.free = FUNC_ITERATOR_FREE(_eina_file_win32_ls_iterator_free); - - return &it->iterator; - - free_it: - free(it); - - return NULL; -} - -EAPI Eina_Iterator * -eina_file_direct_ls(const char *dir) -{ - Eina_File_Direct_Iterator *it; - char *new_dir; - size_t length; - - if (!dir || !*dir) - return NULL; - - length = strlen(dir); - - if (length + 12 + 2 >= MAX_PATH) - return NULL; - - it = calloc(1, sizeof(Eina_File_Direct_Iterator) + length); - if (!it) - return NULL; - - EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); - - new_dir = _eina_file_win32_dir_new(dir); - if (!new_dir) - goto free_it; - - it->handle = _eina_file_win32_first_file(new_dir, &it->data); - free(new_dir); - if (it->handle == INVALID_HANDLE_VALUE) - goto free_it; - - memcpy(it->dir, dir, length + 1); - it->length = length; - _eina_file_win32_backslash_change(it->dir); - - memcpy(it->info.path, dir, length); - if (dir[length - 1] == '\\') - it->info.name_start = length; - else - { - it->info.path[length] = '\\'; - it->info.name_start = length + 1; - } - _eina_file_win32_backslash_change(it->info.path); - - it->iterator.version = EINA_ITERATOR_VERSION; - it->iterator.next = FUNC_ITERATOR_NEXT(_eina_file_win32_direct_ls_iterator_next); - it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_eina_file_win32_direct_ls_iterator_container); - it->iterator.free = FUNC_ITERATOR_FREE(_eina_file_win32_direct_ls_iterator_free); - - return &it->iterator; - - free_it: - free(it); - - return NULL; -} - -EAPI Eina_Iterator * -eina_file_stat_ls(const char *dir) -{ - return eina_file_direct_ls(dir); -} - -EAPI Eina_File * -eina_file_open(const char *filename, Eina_Bool shared) -{ - Eina_File *file; - Eina_File *n; - HANDLE handle; - HANDLE fm; - WIN32_FILE_ATTRIBUTE_DATA fad; - ULARGE_INTEGER length; - ULARGE_INTEGER mtime; - Eina_Bool create = EINA_FALSE; - - /* FIXME: always open absolute path (need to fix filename according to current - directory) */ - - /* FIXME: how to emulate shm_open ? Just OpenFileMapping ? */ -#if 0 - if (shared) - handle = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, - NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, - NULL); - else -#endif - handle = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, - NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, - NULL); - - if (handle == INVALID_HANDLE_VALUE) - return NULL; - - fm = CreateFileMapping(handle, NULL, PAGE_READONLY, 0, 0, NULL); - if (!fm) - goto close_handle; - - if (!GetFileAttributesEx(filename, GetFileExInfoStandard, &fad)) - goto close_fm; - - length.u.LowPart = fad.nFileSizeLow; - length.u.HighPart = fad.nFileSizeHigh; - mtime.u.LowPart = fad.ftLastWriteTime.dwLowDateTime; - mtime.u.HighPart = fad.ftLastWriteTime.dwHighDateTime; - - file = eina_hash_find(_eina_file_cache, filename); - if (file && - (file->mtime != mtime.QuadPart || file->length != length.QuadPart)) - { - create = EINA_TRUE; - - if (file->refcount == 0) - { - _eina_file_cache_lru = eina_list_prepend(_eina_file_cache_lru, file); - eina_hash_del(_eina_file_cache, file->filename, file); - - file = NULL; - } - else if (!file->delete_me) - { - file->delete_me = EINA_TRUE; - _eina_file_cache_delete = eina_list_prepend(_eina_file_cache_delete, file); - } - } - - if (!file || create) - { - n = calloc(1, sizeof (Eina_File)); - if (!n) - goto close_fm; - - n->filename = eina_stringshare_add(filename); - n->map = eina_hash_new(EINA_KEY_LENGTH(_eina_file_map_key_length), - EINA_KEY_CMP(_eina_file_map_key_cmp), - EINA_KEY_HASH(_eina_file_map_key_hash), - EINA_FREE_CB(_eina_file_map_close), - 3); - n->rmap = eina_hash_pointer_new(NULL); - n->global_map = MAP_FAILED; - n->length = length.QuadPart; - n->mtime = mtime.QuadPart; - n->refcount = 0; - n->handle = handle; - n->fm = fm; - n->shared = shared; - n->delete_me = EINA_FALSE; - - eina_hash_set(_eina_file_cache, filename, n); - } - else - { - CloseHandle(fm); - CloseHandle(handle); - - n = file; - - if (n->refcount == 0) - _eina_file_cache_lru = eina_list_remove(_eina_file_cache_lru, n); - } - - n->refcount++; - - return n; - - close_fm: - CloseHandle(fm); - close_handle: - CloseHandle(handle); - - return NULL; -} - -EAPI void -eina_file_close(Eina_File *file) -{ - file->refcount--; - - if (file->refcount != 0) return ; - - if (file->delete_me) - { - _eina_file_cache_delete = eina_list_remove(_eina_file_cache_delete, file); - _eina_file_real_close(file); - } - else - { - _eina_file_cache_lru = eina_list_prepend(_eina_file_cache_lru, file); - } -} - -EAPI size_t -eina_file_size_get(Eina_File *file) -{ - return file->length; -} - -EAPI time_t -eina_file_mtime_get(Eina_File *file) -{ - return file->mtime; -} - -EAPI const char * -eina_file_filename_get(Eina_File *file) -{ - return file->filename; -} - -EAPI void * -eina_file_map_all(Eina_File *file, Eina_File_Populate rule __UNUSED__) -{ - if (file->global_map == MAP_FAILED) - { - void *data; - - data = MapViewOfFile(file->fm, FILE_MAP_READ, - 0, 0, file->length); - if (!data) - file->global_map = MAP_FAILED; - else - file->global_map = data; - } - - if (file->global_map != MAP_FAILED) - { - file->global_refcount++; - return file->global_map; - } - - return NULL; -} - -EAPI void * -eina_file_map_new(Eina_File *file, Eina_File_Populate rule, - unsigned long int offset, unsigned long int length) -{ - Eina_File_Map *map; - unsigned long int key[2]; - - if (offset > file->length) - return NULL; - if (offset + length > file->length) - return NULL; - - if (offset == 0 && length == file->length) - return eina_file_map_all(file, rule); - - key[0] = offset; - key[1] = length; - - map = eina_hash_find(file->map, &key); - if (!map) - { - void *data; - - map = malloc(sizeof (Eina_File_Map)); - if (!map) return NULL; - - data = MapViewOfFile(file->fm, FILE_MAP_READ, - offset & 0xffff0000, - offset & 0x0000ffff, - length); - if (!data) - map->map = MAP_FAILED; - else - map->map = data; - - map->offset = offset; - map->length = length; - map->refcount = 0; - - if (map->map == MAP_FAILED) - { - free(map); - return NULL; - } - - eina_hash_add(file->map, &key, map); - eina_hash_direct_add(file->rmap, map->map, map); - } - - map->refcount++; - - return map->map; -} - -EAPI void -eina_file_map_free(Eina_File *file, void *map) -{ - if (file->global_map == map) - { - file->global_refcount--; - - if (file->global_refcount > 0) return ; - - /* FIXME: are we sure that file->global_map != MAP_FAILED ? */ - if (file->global_map != MAP_FAILED) - UnmapViewOfFile(file->global_map); - file->global_map = MAP_FAILED; - } - else - { - Eina_File_Map *em; - unsigned long int key[2]; - - em = eina_hash_find(file->rmap, &map); - if (!em) return ; - - em->refcount--; - - if (em->refcount > 0) return ; - - key[0] = em->offset; - key[1] = em->length; - - eina_hash_del(file->rmap, &map, em); - eina_hash_del(file->map, &key, em); - } -} +/* EINA - EFL data type library + * Copyright (C) 2010 Vincent Torri + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; + * if not, see . + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#ifdef HAVE_ALLOCA_H +# include +#elif defined __GNUC__ +# define alloca __builtin_alloca +#elif defined _AIX +# define alloca __alloca +#elif defined _MSC_VER +# include +# define alloca _alloca +#else +# include +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +#endif + +#include +#include + +#define WIN32_LEAN_AND_MEAN +#include +#undef WIN32_LEAN_AND_MEAN + +#include + +#include "eina_config.h" +#include "eina_private.h" + +/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ +#include "eina_safety_checks.h" +#include "eina_file.h" +#include "eina_stringshare.h" +#include "eina_hash.h" +#include "eina_list.h" +#include "eina_lock.h" +#include "eina_log.h" + +/*============================================================================* + * Local * + *============================================================================*/ + +/** + * @cond LOCAL + */ + +#ifndef EINA_LOG_COLOR_DEFAULT +#define EINA_LOG_COLOR_DEFAULT EINA_COLOR_CYAN +#endif + +#ifdef ERR +#undef ERR +#endif +#define ERR(...) EINA_LOG_DOM_ERR(_eina_file_log_dom, __VA_ARGS__) + +#ifdef WRN +#undef WRN +#endif +#define WRN(...) EINA_LOG_DOM_WARN(_eina_file_log_dom, __VA_ARGS__) + +#ifdef DBG +#undef DBG +#endif +#define DBG(...) EINA_LOG_DOM_DBG(_eina_file_log_dom, __VA_ARGS__) + +#ifdef MAP_FAILED +# undef MAP_FAILED +#endif +#define MAP_FAILED ((void *)-1) + +typedef struct _Eina_File_Iterator Eina_File_Iterator; +typedef struct _Eina_File_Direct_Iterator Eina_File_Direct_Iterator; +typedef struct _Eina_File_Map Eina_File_Map; + +struct _Eina_File_Iterator +{ + Eina_Iterator iterator; + + WIN32_FIND_DATA data; + HANDLE handle; + size_t length; + Eina_Bool is_last : 1; + + char dir[1]; +}; + +struct _Eina_File_Direct_Iterator +{ + Eina_Iterator iterator; + + WIN32_FIND_DATA data; + HANDLE handle; + size_t length; + Eina_Bool is_last : 1; + + Eina_File_Direct_Info info; + + char dir[1]; +}; + +struct _Eina_File +{ + const char *filename; + + Eina_Hash *map; + Eina_Hash *rmap; + void *global_map; + + Eina_Lock lock; + + ULONGLONG length; + ULONGLONG mtime; + + int refcount; + int global_refcount; + + HANDLE handle; + HANDLE fm; + + Eina_Bool shared : 1; + Eina_Bool delete_me : 1; +}; + +struct _Eina_File_Map +{ + void *map; + + unsigned long int offset; + unsigned long int length; + + int refcount; +}; + +static Eina_Hash *_eina_file_cache = NULL; +static Eina_Lock _eina_file_lock_cache; + +static int _eina_file_log_dom = -1; + +static void +_eina_file_win32_backslash_change(char *dir) +{ + char *tmp; + + tmp = dir; + while (*tmp) + { + if (*tmp == '/') *tmp = '\\'; + tmp++; + } +} + +static Eina_Bool +_eina_file_win32_is_dir(const char *dir) +{ +#ifdef UNICODE + wchar_t *wdir = NULL; +#endif + DWORD attr; + + /* check if it's a directory */ +#ifdef UNICODE + wdir = evil_char_to_wchar(dir); + if (!wdir) + return EINA_FALSE; + + attr = GetFileAttributes(wdir); + free(wdir); +#else + attr = GetFileAttributes(dir); +#endif + + if (attr == 0xFFFFFFFF) + return EINA_FALSE; + + if (!(attr & FILE_ATTRIBUTE_DIRECTORY)) + return EINA_FALSE; + + return EINA_TRUE; +} + +static char * +_eina_file_win32_dir_new(const char *dir) +{ + char *new_dir; + size_t length; + + length = strlen(dir); + + new_dir = (char *)malloc(sizeof(char) * length + 5); + if (!new_dir) + return NULL; + + memcpy(new_dir, dir, length); + memcpy(new_dir + length, "\\*.*", 5); + _eina_file_win32_backslash_change(new_dir); + + return new_dir; +} + +static HANDLE +_eina_file_win32_first_file(const char *dir, WIN32_FIND_DATA *fd) +{ + HANDLE h; +#ifdef UNICODE + wchar_t *wdir = NULL; + + wdir = evil_char_to_wchar(dir); + if (!wdir) + return NULL; + + h = FindFirstFile(wdir, fd); + free(wdir); +#else + h = FindFirstFile(dir, fd); +#endif + + if (!h) + return NULL; + + while ((fd->cFileName[0] == '.') && + ((fd->cFileName[1] == '\0') || + ((fd->cFileName[1] == '.') && (fd->cFileName[2] == '\0')))) + { + if (!FindNextFile(h, fd)) + return NULL; + } + + return h; +} + +static Eina_Bool +_eina_file_win32_ls_iterator_next(Eina_File_Iterator *it, void **data) +{ +#ifdef UNICODE + wchar_t *old_name; +#else + char *old_name; +#endif + char *name; + char *cname; + size_t length; + Eina_Bool is_last; + Eina_Bool res = EINA_TRUE; + + if (it->handle == INVALID_HANDLE_VALUE) + return EINA_FALSE; + + is_last = it->is_last; +#ifdef UNICODE + old_name = _wcsdup(it->data.cFileName); +#else + old_name = _strdup(it->data.cFileName); +#endif + if (!old_name) + return EINA_FALSE; + + do { + if (!FindNextFile(it->handle, &it->data)) + { + if (GetLastError() == ERROR_NO_MORE_FILES) + it->is_last = EINA_TRUE; + else + res = EINA_FALSE; + } + } while ((it->data.cFileName[0] == '.') && + ((it->data.cFileName[1] == '\0') || + ((it->data.cFileName[1] == '.') && (it->data.cFileName[2] == '\0')))); /* FIXME: what about UNICODE ? */ + +#ifdef UNICODE + cname = evil_wchar_to_char(old_name); + if (!cname) + return EINA_FALSE; +#else + cname = old_name; +#endif + + length = strlen(cname); + name = alloca(length + 2 + it->length); + + memcpy(name, it->dir, it->length); + memcpy(name + it->length, "\\", 1); + memcpy(name + it->length + 1, cname, length + 1); + + *data = (char *)eina_stringshare_add(name); + +#ifdef UNICODE + free(cname); +#endif + free(old_name); + + if (is_last) + res = EINA_FALSE; + + return res; +} + +static HANDLE +_eina_file_win32_ls_iterator_container(Eina_File_Iterator *it) +{ + return it->handle; +} + +static void +_eina_file_win32_ls_iterator_free(Eina_File_Iterator *it) +{ + if (it->handle != INVALID_HANDLE_VALUE) + FindClose(it->handle); + + EINA_MAGIC_SET(&it->iterator, 0); + free(it); +} + +static Eina_Bool +_eina_file_win32_direct_ls_iterator_next(Eina_File_Direct_Iterator *it, void **data) +{ +#ifdef UNICODE + wchar_t *old_name; +#else + char *old_name; +#endif + char *cname; + size_t length; + DWORD attr; + Eina_Bool is_last; + Eina_Bool res = EINA_TRUE; + + if (it->handle == INVALID_HANDLE_VALUE) + return EINA_FALSE; + + attr = it->data.dwFileAttributes; + is_last = it->is_last; +#ifdef UNICODE + old_name = _wcsdup(it->data.cFileName); +#else + old_name = _strdup(it->data.cFileName); +#endif + if (!old_name) + return EINA_FALSE; + + do { + if (!FindNextFile(it->handle, &it->data)) + { + if (GetLastError() == ERROR_NO_MORE_FILES) + it->is_last = EINA_TRUE; + else + res = EINA_FALSE; + } + +#ifdef UNICODE + length = wcslen(old_name); +#else + length = strlen(old_name); +#endif + if (it->info.name_start + length + 1 >= PATH_MAX) + { + free(old_name); +#ifdef UNICODE + old_name = _wcsdup(it->data.cFileName); +#else + old_name = _strdup(it->data.cFileName); +#endif + continue; + } + + } while ((it->data.cFileName[0] == '.') && + ((it->data.cFileName[1] == '\0') || + ((it->data.cFileName[1] == '.') && (it->data.cFileName[2] == '\0')))); /* FIXME: what about UNICODE ? */ + +#ifdef UNICODE + cname = evil_wchar_to_char(old_name); + if (!cname) + return EINA_FALSE; +#else + cname = old_name; +#endif + + memcpy(it->info.path + it->info.name_start, cname, length); + it->info.name_length = length; + it->info.path_length = it->info.name_start + length; + it->info.path[it->info.path_length] = '\0'; + + if (attr & FILE_ATTRIBUTE_DIRECTORY) + it->info.type = EINA_FILE_DIR; + else if (attr & FILE_ATTRIBUTE_REPARSE_POINT) + it->info.type = EINA_FILE_LNK; + else if (attr & (FILE_ATTRIBUTE_ARCHIVE | + FILE_ATTRIBUTE_COMPRESSED | + FILE_ATTRIBUTE_COMPRESSED | + FILE_ATTRIBUTE_HIDDEN | + FILE_ATTRIBUTE_NORMAL | + FILE_ATTRIBUTE_SPARSE_FILE | + FILE_ATTRIBUTE_TEMPORARY)) + it->info.type = EINA_FILE_REG; + else + it->info.type = EINA_FILE_UNKNOWN; + + *data = &it->info; + +#ifdef UNICODE + free(cname); +#endif + + free(old_name); + + if (is_last) + res = EINA_FALSE; + + return res; +} + +static HANDLE +_eina_file_win32_direct_ls_iterator_container(Eina_File_Direct_Iterator *it) +{ + return it->handle; +} + +static void +_eina_file_win32_direct_ls_iterator_free(Eina_File_Direct_Iterator *it) +{ + if (it->handle != INVALID_HANDLE_VALUE) + FindClose(it->handle); + + EINA_MAGIC_SET(&it->iterator, 0); + free(it); +} + +static void +_eina_file_real_close(Eina_File *file) +{ + eina_hash_free(file->rmap); + eina_hash_free(file->map); + + if (file->global_map != MAP_FAILED) + UnmapViewOfFile(file->global_map); + + CloseHandle(file->fm); + CloseHandle(file->handle); + + free(file); +} + +static void +_eina_file_map_close(Eina_File_Map *map) +{ + if (map->map != MAP_FAILED) + UnmapViewOfFile(map->map); + free(map); +} + +static unsigned int +_eina_file_map_key_length(const void *key __UNUSED__) +{ + return sizeof (unsigned long int) * 2; +} + +static int +_eina_file_map_key_cmp(const unsigned long int *key1, int key1_length __UNUSED__, + const unsigned long int *key2, int key2_length __UNUSED__) +{ + if (key1[0] - key2[0] == 0) return key1[1] - key2[1]; + return key1[0] - key2[0]; +} + +static int +_eina_file_map_key_hash(const unsigned long int *key, int key_length __UNUSED__) +{ + return eina_hash_int64(&key[0], sizeof (unsigned long int)) + ^ eina_hash_int64(&key[1], sizeof (unsigned long int)); +} + +static char * +_eina_file_win32_escape(const char *path, size_t *length) +{ + char *result = strdup(path ? path : ""); + char *p = result; + char *q = result; + size_t len; + + if (!result) + return NULL; + + if (length) len = *length; + else len = strlen(result); + + while ((p = strchr(p, '/'))) + { + // remove double `/' + if (p[1] == '/') + { + memmove(p, p + 1, --len - (p - result)); + result[len] = '\0'; + } + else + if (p[1] == '.' + && p[2] == '.') + { + // remove `/../' + if (p[3] == '/') + { + char tmp; + + len -= p + 3 - q; + memmove(q, p + 3, len - (q - result)); + result[len] = '\0'; + p = q; + + /* Update q correctly. */ + tmp = *p; + *p = '\0'; + q = strrchr(result, '/'); + if (!q) q = result; + *p = tmp; + } + else + // remove '/..$' + if (p[3] == '\0') + { + len -= p + 2 - q; + result[len] = '\0'; + q = p; + ++p; + } + else + { + q = p; + ++p; + } + } + else + { + q = p; + ++p; + } + } + + if (length) + *length = len; + + return result; +} + + +/** + * @endcond + */ + +/*============================================================================* + * Global * + *============================================================================*/ + +Eina_Bool +eina_file_init(void) +{ + _eina_file_log_dom = eina_log_domain_register("eina_file", + EINA_LOG_COLOR_DEFAULT); + if (_eina_file_log_dom < 0) + { + EINA_LOG_ERR("Could not register log domain: eina_file"); + return EINA_FALSE; + } + + _eina_file_cache = eina_hash_string_djb2_new(NULL); + if (!_eina_file_cache) + { + ERR("Could not create cache."); + eina_log_domain_unregister(_eina_file_log_dom); + _eina_file_log_dom = -1; + return EINA_FALSE; + } + + eina_lock_new(&_eina_file_lock_cache); + + return EINA_TRUE; +} + +Eina_Bool +eina_file_shutdown(void) +{ + if (eina_hash_population(_eina_file_cache) > 0) + { + Eina_Iterator *it; + const char *key; + + it = eina_hash_iterator_key_new(_eina_file_cache); + EINA_ITERATOR_FOREACH(it, key) + ERR("File [%s] still open !", key); + eina_iterator_free(it); + } + + eina_hash_free(_eina_file_cache); + + eina_lock_free(&_eina_file_lock_cache); + + eina_log_domain_unregister(_eina_file_log_dom); + _eina_file_log_dom = -1; + return EINA_TRUE; +} + +/*============================================================================* + * API * + *============================================================================*/ + + +EAPI char * +eina_file_path_sanitize(const char *path) +{ + char *result = NULL; + size_t len; + + if (!path) return NULL; + + len = strlen(path); + if (len < 3) return NULL; + + if (!evil_path_is_absolute(path)) + { + DWORD l; + + l = GetCurrentDirectory(0, NULL); + if (l > 0) + { + char *cwd; + DWORD l2; + + cwd = alloca(sizeof(char) * (l + 1)); + l2 = GetCurrentDirectory(l + 1, cwd); + if (l2 == l) + { + char *tmp; + + len += l + 2; + tmp = alloca(sizeof (char) * len); + snprintf(tmp, len, "%s/%s", cwd, path); + tmp[len - 1] = '\0'; + result = tmp; + } + } + } + + return _eina_file_win32_escape(result ? result : path, &len); +} + +EAPI Eina_Bool +eina_file_dir_list(const char *dir, + Eina_Bool recursive, + Eina_File_Dir_List_Cb cb, + void *data) +{ + WIN32_FIND_DATA file; + HANDLE h; + char *new_dir; + + EINA_SAFETY_ON_NULL_RETURN_VAL(cb, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(dir, EINA_FALSE); + EINA_SAFETY_ON_TRUE_RETURN_VAL(dir[0] == '\0', EINA_FALSE); + + if (!_eina_file_win32_is_dir(dir)) + return EINA_FALSE; + + new_dir = _eina_file_win32_dir_new(dir); + if (!new_dir) + return EINA_FALSE; + + h = _eina_file_win32_first_file(new_dir, &file); + + if (h == INVALID_HANDLE_VALUE) + return EINA_FALSE; + + do + { + char *filename; + +# ifdef UNICODE + filename = evil_wchar_to_char(file.cFileName); +# else + filename = file.cFileName; +# endif /* ! UNICODE */ + if (!strcmp(filename, ".") || !strcmp(filename, "..")) + continue; + + cb(filename, dir, data); + + if (recursive == EINA_TRUE) + { + char *path; + + path = alloca(strlen(dir) + strlen(filename) + 2); + strcpy(path, dir); + strcat(path, "/"); + strcat(path, filename); + + if (!(file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) + continue; + + eina_file_dir_list(path, recursive, cb, data); + } + +# ifdef UNICODE + free(filename); +# endif /* UNICODE */ + + } while (FindNextFile(h, &file)); + FindClose(h); + + return EINA_TRUE; +} + +EAPI Eina_Array * +eina_file_split(char *path) +{ + Eina_Array *ea; + char *current; + size_t length; + + EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL); + + ea = eina_array_new(16); + + if (!ea) + return NULL; + + for (current = strchr(path, '\\'); + current; + path = current + 1, current = strchr(path, '\\')) + { + length = current - path; + + if (length <= 0) + continue; + + eina_array_push(ea, path); + *current = '\0'; + } + + if (*path != '\0') + eina_array_push(ea, path); + + return ea; +} + +EAPI Eina_Iterator * +eina_file_ls(const char *dir) +{ + Eina_File_Iterator *it; + char *new_dir; + size_t length; + + EINA_SAFETY_ON_NULL_RETURN_VAL(dir, NULL); + + if (!dir || !*dir) + return NULL; + + if (!_eina_file_win32_is_dir(dir)) + return NULL; + + length = strlen(dir); + + it = calloc(1, sizeof (Eina_File_Iterator) + length); + if (!it) + return NULL; + + EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); + + new_dir = _eina_file_win32_dir_new(dir); + if (!new_dir) + goto free_it; + + it->handle = _eina_file_win32_first_file(new_dir, &it->data); + free(new_dir); + if (it->handle == INVALID_HANDLE_VALUE) + goto free_it; + + memcpy(it->dir, dir, length + 1); + if (dir[length - 1] != '\\') + it->length = length; + else + it->length = length - 1; + _eina_file_win32_backslash_change(it->dir); + + it->iterator.version = EINA_ITERATOR_VERSION; + it->iterator.next = FUNC_ITERATOR_NEXT(_eina_file_win32_ls_iterator_next); + it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_eina_file_win32_ls_iterator_container); + it->iterator.free = FUNC_ITERATOR_FREE(_eina_file_win32_ls_iterator_free); + + return &it->iterator; + + free_it: + free(it); + + return NULL; +} + +EAPI Eina_Iterator * +eina_file_direct_ls(const char *dir) +{ + Eina_File_Direct_Iterator *it; + char *new_dir; + size_t length; + + EINA_SAFETY_ON_NULL_RETURN_VAL(dir, NULL); + + if (!dir || !*dir) + return NULL; + + length = strlen(dir); + + if (length + 12 + 2 >= MAX_PATH) + return NULL; + + it = calloc(1, sizeof(Eina_File_Direct_Iterator) + length); + if (!it) + return NULL; + + EINA_MAGIC_SET(&it->iterator, EINA_MAGIC_ITERATOR); + + new_dir = _eina_file_win32_dir_new(dir); + if (!new_dir) + goto free_it; + + it->handle = _eina_file_win32_first_file(new_dir, &it->data); + free(new_dir); + if (it->handle == INVALID_HANDLE_VALUE) + goto free_it; + + memcpy(it->dir, dir, length + 1); + it->length = length; + _eina_file_win32_backslash_change(it->dir); + + memcpy(it->info.path, dir, length); + if (dir[length - 1] == '\\') + it->info.name_start = length; + else + { + it->info.path[length] = '\\'; + it->info.name_start = length + 1; + } + _eina_file_win32_backslash_change(it->info.path); + + it->iterator.version = EINA_ITERATOR_VERSION; + it->iterator.next = FUNC_ITERATOR_NEXT(_eina_file_win32_direct_ls_iterator_next); + it->iterator.get_container = FUNC_ITERATOR_GET_CONTAINER(_eina_file_win32_direct_ls_iterator_container); + it->iterator.free = FUNC_ITERATOR_FREE(_eina_file_win32_direct_ls_iterator_free); + + return &it->iterator; + + free_it: + free(it); + + return NULL; +} + +EAPI Eina_Iterator * +eina_file_stat_ls(const char *dir) +{ + return eina_file_direct_ls(dir); +} + +EAPI Eina_File * +eina_file_open(const char *path, Eina_Bool shared) +{ + Eina_File *file; + Eina_File *n; + char *filename; + HANDLE handle; + HANDLE fm; + WIN32_FILE_ATTRIBUTE_DATA fad; + ULARGE_INTEGER length; + ULARGE_INTEGER mtime; + + EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL); + + filename = eina_file_path_sanitize(path); + if (!filename) return NULL; + + /* FIXME: how to emulate shm_open ? Just OpenFileMapping ? */ +#if 0 + if (shared) + handle = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, + NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, + NULL); + else +#endif + handle = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, + NULL, OPEN_EXISTING, FILE_ATTRIBUTE_READONLY, + NULL); + + if (handle == INVALID_HANDLE_VALUE) + return NULL; + + fm = CreateFileMapping(handle, NULL, PAGE_READONLY, 0, 0, NULL); + if (!fm) + goto close_handle; + + if (!GetFileAttributesEx(filename, GetFileExInfoStandard, &fad)) + goto close_fm; + + length.u.LowPart = fad.nFileSizeLow; + length.u.HighPart = fad.nFileSizeHigh; + mtime.u.LowPart = fad.ftLastWriteTime.dwLowDateTime; + mtime.u.HighPart = fad.ftLastWriteTime.dwHighDateTime; + + eina_lock_take(&_eina_file_lock_cache); + + file = eina_hash_find(_eina_file_cache, filename); + if (file && + (file->mtime != mtime.QuadPart || file->length != length.QuadPart)) + { + file->delete_me = EINA_TRUE; + eina_hash_del(_eina_file_cache, file->filename, file); + _eina_file_real_close(file); + file = NULL; + } + + if (!file) + { + n = malloc(sizeof (Eina_File) + strlen(filename) + 1); + if (!n) + { + eina_lock_release(&_eina_file_lock_cache); + goto close_fm; + } + + n->filename = (char*) (n + 1); + strcpy((char*) n->filename, filename); + n->map = eina_hash_new(EINA_KEY_LENGTH(_eina_file_map_key_length), + EINA_KEY_CMP(_eina_file_map_key_cmp), + EINA_KEY_HASH(_eina_file_map_key_hash), + EINA_FREE_CB(_eina_file_map_close), + 3); + n->rmap = eina_hash_pointer_new(NULL); + n->global_map = MAP_FAILED; + n->global_refcount = 0; + n->length = length.QuadPart; + n->mtime = mtime.QuadPart; + n->refcount = 0; + n->handle = handle; + n->fm = fm; + n->shared = shared; + n->delete_me = EINA_FALSE; + eina_lock_new(&n->lock); + eina_hash_direct_add(_eina_file_cache, n->filename, n); + } + else + { + CloseHandle(fm); + CloseHandle(handle); + + n = file; + } + eina_lock_take(&n->lock); + n->refcount++; + eina_lock_release(&n->lock); + + eina_lock_release(&_eina_file_lock_cache); + + free(filename); + + return n; + + close_fm: + CloseHandle(fm); + close_handle: + CloseHandle(handle); + + return NULL; +} + +EAPI void +eina_file_close(Eina_File *file) +{ + EINA_SAFETY_ON_NULL_RETURN(file); + + eina_lock_take(&file->lock); + file->refcount--; + eina_lock_release(&file->lock); + + if (file->refcount != 0) return ; + eina_lock_take(&_eina_file_lock_cache); + + eina_hash_del(_eina_file_cache, file->filename, file); + _eina_file_real_close(file); + + eina_lock_release(&_eina_file_lock_cache); +} + +EAPI size_t +eina_file_size_get(Eina_File *file) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(file, 0); + return file->length; +} + +EAPI time_t +eina_file_mtime_get(Eina_File *file) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(file, 0); + return file->mtime; +} + +EAPI const char * +eina_file_filename_get(Eina_File *file) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(file, NULL); + return file->filename; +} + +EAPI Eina_Iterator *eina_file_xattr_get(Eina_File *file __UNUSED__) +{ + return NULL; +} + +EAPI Eina_Iterator *eina_file_xattr_value_get(Eina_File *file __UNUSED__) +{ + return NULL; +} + +EAPI void * +eina_file_map_all(Eina_File *file, Eina_File_Populate rule __UNUSED__) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(file, NULL); + + eina_lock_take(&file->lock); + if (file->global_map == MAP_FAILED) + { + void *data; + + data = MapViewOfFile(file->fm, FILE_MAP_READ, + 0, 0, file->length); + if (!data) + file->global_map = MAP_FAILED; + else + file->global_map = data; + } + + if (file->global_map != MAP_FAILED) + { + file->global_refcount++; + return file->global_map; + } + + eina_lock_release(&file->lock); + return NULL; +} + +EAPI void * +eina_file_map_new(Eina_File *file, Eina_File_Populate rule, + unsigned long int offset, unsigned long int length) +{ + Eina_File_Map *map; + unsigned long int key[2]; + + EINA_SAFETY_ON_NULL_RETURN_VAL(file, NULL); + + if (offset > file->length) + return NULL; + if (offset + length > file->length) + return NULL; + + if (offset == 0 && length == file->length) + return eina_file_map_all(file, rule); + + key[0] = offset; + key[1] = length; + + eina_lock_take(&file->lock); + + map = eina_hash_find(file->map, &key); + if (!map) + { + void *data; + + map = malloc(sizeof (Eina_File_Map)); + if (!map) + { + eina_lock_release(&file->lock); + return NULL; + } + + data = MapViewOfFile(file->fm, FILE_MAP_READ, + offset & 0xffff0000, + offset & 0x0000ffff, + length); + if (!data) + map->map = MAP_FAILED; + else + map->map = data; + + map->offset = offset; + map->length = length; + map->refcount = 0; + + if (map->map == MAP_FAILED) + { + free(map); + eina_lock_release(&file->lock); + return NULL; + } + + eina_hash_add(file->map, &key, map); + eina_hash_direct_add(file->rmap, map->map, map); + } + + map->refcount++; + + eina_lock_release(&file->lock); + + return map->map; +} + +EAPI void +eina_file_map_free(Eina_File *file, void *map) +{ + EINA_SAFETY_ON_NULL_RETURN(file); + + eina_lock_take(&file->lock); + + if (file->global_map == map) + { + file->global_refcount--; + + if (file->global_refcount > 0) goto on_exit; + + UnmapViewOfFile(file->global_map); + file->global_map = MAP_FAILED; + } + else + { + Eina_File_Map *em; + unsigned long int key[2]; + + em = eina_hash_find(file->rmap, &map); + if (!em) goto on_exit; + + em->refcount--; + + if (em->refcount > 0) goto on_exit; + + key[0] = em->offset; + key[1] = em->length; + + eina_hash_del(file->rmap, &map, em); + eina_hash_del(file->map, &key, em); + } + + on_exit: + eina_lock_release(&file->lock); +} + +EAPI int +eina_file_statat(void *container __UNUSED__, Eina_File_Direct_Info *info, Eina_Stat *st) +{ + struct __stat64 buf; + + EINA_SAFETY_ON_NULL_RETURN_VAL(info, -1); + EINA_SAFETY_ON_NULL_RETURN_VAL(st, -1); + + if (stat64(info->path, &buf)) + { + if (info->type != EINA_FILE_LNK) + info->type = EINA_FILE_UNKNOWN; + return -1; + } + + if (info->type == EINA_FILE_UNKNOWN) + { + if (S_ISREG(buf.st_mode)) + info->type = EINA_FILE_REG; + else if (S_ISDIR(buf.st_mode)) + info->type = EINA_FILE_DIR; + else + info->type = EINA_FILE_UNKNOWN; + } + + st->dev = buf.st_dev; + st->ino = buf.st_ino; + st->mode = buf.st_mode; + st->nlink = buf.st_nlink; + st->uid = buf.st_uid; + st->gid = buf.st_gid; + st->rdev = buf.st_rdev; + st->size = buf.st_size; + st->blksize = 0; + st->blocks = 0; + st->atime = buf.st_atime; + st->mtime = buf.st_mtime; + st->ctime = buf.st_ctime; + st->atimensec = 0; + st->mtimensec = 0; + st->ctimensec = 0; + + return 0; +} diff --git a/libraries/eina/src/lib/eina_inlist.c b/libraries/eina/src/lib/eina_inlist.c index 75a2cc1..c80f87b 100644 --- a/libraries/eina/src/lib/eina_inlist.c +++ b/libraries/eina/src/lib/eina_inlist.c @@ -430,6 +430,8 @@ eina_inlist_find(Eina_Inlist *list, Eina_Inlist *item) { Eina_Inlist *l; + EINA_SAFETY_ON_NULL_RETURN_VAL(item, NULL); + for (l = list; l; l = l->next) { if (l == item) return item; @@ -559,6 +561,9 @@ eina_inlist_sorted_insert(Eina_Inlist *list, int cur = 0; int count; + EINA_SAFETY_ON_NULL_RETURN_VAL(item, list); + EINA_SAFETY_ON_NULL_RETURN_VAL(func, list); + if (!list) return eina_inlist_append(NULL, item); if (!list->next) diff --git a/libraries/eina/src/lib/eina_list.c b/libraries/eina/src/lib/eina_list.c index d45cffd..c85855f 100644 --- a/libraries/eina/src/lib/eina_list.c +++ b/libraries/eina/src/lib/eina_list.c @@ -1026,7 +1026,7 @@ eina_list_clone(const Eina_List *list) } EAPI Eina_List * -eina_list_sort(Eina_List *list, unsigned int size, Eina_Compare_Cb func) +eina_list_sort(Eina_List *list, unsigned int limit, Eina_Compare_Cb func) { unsigned int i = 0; unsigned int n = 0; @@ -1040,14 +1040,14 @@ eina_list_sort(Eina_List *list, unsigned int size, Eina_Compare_Cb func) EINA_MAGIC_CHECK_LIST(list, NULL); - /* if the caller specified an invalid size, sort the whole list */ - if ((size == 0) || - (size > list->accounting->count)) - size = list->accounting->count; + /* if the caller specified an invalid limit, sort the whole list */ + if ((limit == 0) || + (limit > list->accounting->count)) + limit = list->accounting->count; - if (size != list->accounting->count) + if (limit != list->accounting->count) { - unsort = eina_list_nth_list(list, size); + unsort = eina_list_nth_list(list, limit); if (unsort) unsort->prev->next = NULL; } @@ -1172,6 +1172,7 @@ eina_list_split_list(Eina_List *list, Eina_List *relative, Eina_List **right) next->prev = NULL; next->accounting = _eina_list_mempool_accounting_new(next); next->accounting->last = list->accounting->last; + next->accounting->count = 0; *right = next; itr = next; diff --git a/libraries/eina/src/lib/eina_magic.c b/libraries/eina/src/lib/eina_magic.c index d1f71cc..a42db2d 100644 --- a/libraries/eina/src/lib/eina_magic.c +++ b/libraries/eina/src/lib/eina_magic.c @@ -102,13 +102,8 @@ _eina_magic_strings_alloc(void) tmp = realloc(_eina_magic_strings, sizeof(Eina_Magic_String) * size); if (!tmp) { -#ifdef _WIN32 - ERR("could not realloc magic_strings from %Iu to %Iu buckets.", - _eina_magic_strings_allocated, size); -#else ERR("could not realloc magic_strings from %zu to %zu buckets.", _eina_magic_strings_allocated, size); -#endif return NULL; } diff --git a/libraries/eina/src/lib/eina_main.c b/libraries/eina/src/lib/eina_main.c index 79f8a36..f233929 100644 --- a/libraries/eina/src/lib/eina_main.c +++ b/libraries/eina/src/lib/eina_main.c @@ -69,6 +69,7 @@ #include "eina_inlist.h" #include "eina_inarray.h" #include "eina_value.h" +#include "eina_model.h" /*============================================================================* * Local * @@ -153,6 +154,7 @@ EAPI Eina_Inlist *_eina_tracking = NULL; S(file); S(prefix); S(value); + S(model); #undef S struct eina_desc_setup @@ -189,7 +191,8 @@ static const struct eina_desc_setup _eina_desc_setup[] = { S(simple_xml), S(file), S(prefix), - S(value) + S(value), + S(model) #undef S }; static const size_t _eina_desc_setup_len = sizeof(_eina_desc_setup) / diff --git a/libraries/eina/src/lib/eina_matrixsparse.c b/libraries/eina/src/lib/eina_matrixsparse.c index 3ac0439..59cd66b 100644 --- a/libraries/eina/src/lib/eina_matrixsparse.c +++ b/libraries/eina/src/lib/eina_matrixsparse.c @@ -1078,6 +1078,8 @@ eina_matrixsparse_size_set(Eina_Matrixsparse *m, r = r->next; _eina_matrixsparse_row_free(r_aux, free_func, user_data); + if ((update_last_used_row) && (m->last_used == r_aux)) + m->last_used = r; } else { diff --git a/libraries/eina/src/lib/eina_module.c b/libraries/eina/src/lib/eina_module.c index 26df980..f4f3242 100644 --- a/libraries/eina/src/lib/eina_module.c +++ b/libraries/eina/src/lib/eina_module.c @@ -58,6 +58,10 @@ void *alloca (size_t); # include #endif +#ifdef HAVE_EXOTIC_H +# include +#endif + #include "eina_config.h" #include "eina_private.h" #include "eina_error.h" diff --git a/libraries/eina/src/lib/eina_prefix.c b/libraries/eina/src/lib/eina_prefix.c index 5b4b0c0..2322311 100644 --- a/libraries/eina/src/lib/eina_prefix.c +++ b/libraries/eina/src/lib/eina_prefix.c @@ -30,15 +30,15 @@ #endif #ifdef HAVE_ALLOCA_H # include -#elif defined __GNUC__ -# define alloca __builtin_alloca -#elif defined _AIX -# define alloca __alloca -#elif defined _MSC_VER -# include -# define alloca _alloca -#else -# ifndef HAVE_ALLOCA +#elif !defined alloca +# ifdef __GNUC__ +# define alloca __builtin_alloca +# elif defined _AIX +# define alloca __alloca +# elif defined _MSC_VER +# include +# define alloca _alloca +# elif !defined HAVE_ALLOCA # ifdef __cplusplus extern "C" # endif @@ -237,7 +237,7 @@ _try_argv(Eina_Prefix *pfx, const char *argv0) DBG("Try argv0 = %s", argv0); /* 1. is argv0 abs path? */ #ifdef _WIN32 - if (argv0[0] && (argv0[1] == ':')) + if (evil_path_is_absolute(argv0)) #else if (argv0[0] == DSEP_C) #endif @@ -533,7 +533,7 @@ eina_prefix_new(const char *argv0, void *symbol, const char *envprefix, { DBG("Dlinfo dli_fname = %s", info_dl.dli_fname); # ifdef _WIN32 - if (info_dl.dli_fname[0] && (info_dl.dli_fname[1] == ':')) + if (evil_path_is_absolute(info_dl.dli_fname)) # else if (info_dl.dli_fname[0] == DSEP_C) # endif diff --git a/libraries/eina/src/lib/eina_private.h b/libraries/eina/src/lib/eina_private.h index e31ab47..49df565 100644 --- a/libraries/eina/src/lib/eina_private.h +++ b/libraries/eina/src/lib/eina_private.h @@ -95,6 +95,8 @@ #define EINA_MAGIC_INARRAY_ITERATOR 0x98761271 #define EINA_MAGIC_INARRAY_ACCESSOR 0x98761272 +#define EINA_MAGIC_MODEL 0x98761280 + #define EINA_MAGIC_CLASS 0x9877CB30 /* undef the following, we want out version */ diff --git a/libraries/eina/src/lib/eina_rbtree.c b/libraries/eina/src/lib/eina_rbtree.c index 5f1232c..a9d777a 100644 --- a/libraries/eina/src/lib/eina_rbtree.c +++ b/libraries/eina/src/lib/eina_rbtree.c @@ -1,5 +1,6 @@ /* EINA - EFL data type library * Copyright (C) 2008 Cedric Bail + * Copyright (C) 2011 Alexandre Becoulet * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -23,6 +24,7 @@ #include #include #include +#include #include "eina_config.h" #include "eina_private.h" @@ -244,9 +246,9 @@ static inline Eina_Rbtree * _eina_rbtree_inline_single_rotation(Eina_Rbtree *node, Eina_Rbtree_Direction dir) { - Eina_Rbtree *save = node->son[!dir]; + Eina_Rbtree *save = node->son[dir ^ 1]; - node->son[!dir] = save->son[dir]; + node->son[dir ^ 1] = save->son[dir]; save->son[dir] = node; node->color = EINA_RBTREE_RED; @@ -259,7 +261,7 @@ static inline Eina_Rbtree * _eina_rbtree_inline_double_rotation(Eina_Rbtree *node, Eina_Rbtree_Direction dir) { - node->son[!dir] = _eina_rbtree_inline_single_rotation(node->son[!dir], !dir); + node->son[dir ^ 1] = _eina_rbtree_inline_single_rotation(node->son[dir ^ 1], dir ^ 1); return _eina_rbtree_inline_single_rotation(node, dir); } @@ -277,87 +279,64 @@ eina_rbtree_inline_insert(Eina_Rbtree *root, Eina_Rbtree_Cmp_Node_Cb cmp, const void *data) { - Eina_Rbtree head; - Eina_Rbtree *g, *t; /* Grandparent & parent */ - Eina_Rbtree *p, *q; /* Iterator & parent */ - /* WARNING: - Compiler is not able to understand the underlying algorithm and don't know that - first top node is always black, so it will never use last before running the loop - one time. - */ - Eina_Rbtree_Direction dir, last; + Eina_Rbtree **r = &root; + Eina_Rbtree *q = root; + uintptr_t stack[48]; + unsigned int s = 0; EINA_SAFETY_ON_NULL_RETURN_VAL(node, root); EINA_SAFETY_ON_NULL_RETURN_VAL( cmp, root); - if (!node) - return root; - - _eina_rbtree_node_init(node); - - if (!root) - { - root = node; - goto end_add; - } - - memset(&head, 0, sizeof (Eina_Rbtree)); - last = dir = EINA_RBTREE_LEFT; - - /* Set up helpers */ - t = &head; - g = p = NULL; - q = t->son[1] = root; - - /* Search down the tree */ - for (;; ) - { - if (!q) - /* Insert new node at the bottom */ - p->son[dir] = q = node; - else if (_eina_rbtree_is_red(q->son[0]) - && _eina_rbtree_is_red(q->son[1])) - { - /* Color flip */ - q->color = EINA_RBTREE_RED; - q->son[0]->color = EINA_RBTREE_BLACK; - q->son[1]->color = EINA_RBTREE_BLACK; - } - - /* Fix red violation */ - if (_eina_rbtree_is_red(q) && _eina_rbtree_is_red(p)) - { - Eina_Rbtree_Direction dir2; + /* Find insertion leaf */ + while (q != NULL) + { + Eina_Rbtree_Direction dir = cmp(q, node, (void *)data); - dir2 = (t->son[1] == g) ? EINA_RBTREE_RIGHT : EINA_RBTREE_LEFT; + /* Keep path in stack */ + stack[s++] = (uintptr_t)r | dir; - if (q == p->son[last]) - t->son[dir2] = _eina_rbtree_inline_single_rotation(g, !last); - else - t->son[dir2] = _eina_rbtree_inline_double_rotation(g, !last); - } - - /* Stop if found */ - if (q == node) - break; - - last = dir; - dir = cmp(q, node, (void *)data); + r = q->son + dir; + q = *r; + } - /* Update helpers */ - if ( g ) - t = g; - - g = p, p = q; - q = q->son[dir]; - } + /* Insert */ + *r = node; + _eina_rbtree_node_init(node); - root = head.son[1]; + /* Rebalance */ + while (s > 0) + { + Eina_Rbtree *a, *b; + uintptr_t top = stack[--s]; /* Pop link pointer and direction */ + Eina_Rbtree_Direction dir = top & 1; + + r = (Eina_Rbtree **)(top & ~(uintptr_t)1); + q = *r; + + a = q->son[dir]; + /* Rebalance done ? */ + if (a == NULL || a->color == EINA_RBTREE_BLACK) + break; + + b = q->son[dir ^ 1]; + if (b != NULL && b->color == EINA_RBTREE_RED) + { + q->color = EINA_RBTREE_RED; + b->color = a->color = EINA_RBTREE_BLACK; + } + else + { + Eina_Rbtree *c = a->son[dir]; + Eina_Rbtree *d = a->son[dir ^ 1]; + + if (c != NULL && c->color == EINA_RBTREE_RED) + *r = _eina_rbtree_inline_single_rotation(*r, dir ^ 1); + else if (d != NULL && d->color == EINA_RBTREE_RED) + *r = _eina_rbtree_inline_double_rotation(*r, dir ^ 1); + } + } -end_add: - /* Make root black */ root->color = EINA_RBTREE_BLACK; - return root; } @@ -367,122 +346,144 @@ eina_rbtree_inline_remove(Eina_Rbtree *root, Eina_Rbtree_Cmp_Node_Cb cmp, const void *data) { - Eina_Rbtree head; - Eina_Rbtree *q, *p; - Eina_Rbtree *f = NULL; + Eina_Rbtree *l0, *l1, *r, **rt = &root; Eina_Rbtree_Direction dir; + uintptr_t stack[48]; + unsigned int s = 0; EINA_SAFETY_ON_NULL_RETURN_VAL(node, root); EINA_SAFETY_ON_NULL_RETURN_VAL( cmp, root); - if (!root || !node) - return root; - - memset(&head, 0, sizeof(Eina_Rbtree)); - - dir = EINA_RBTREE_RIGHT; - q = &head; - p = NULL; - q->son[EINA_RBTREE_RIGHT] = root; - - /* Search and push a red down */ - while (q->son[dir]) - { - Eina_Rbtree_Direction last = dir; - Eina_Rbtree *g; - - /* Update helpers */ - g = p; p = q; - q = q->son[dir]; - dir = cmp(q, node, (void *)data); - - /* Save parent node found */ - if (q == node) - f = p; + /* Item search loop */ + for (r = *rt; r != NULL; r = *rt) + { + if (r == node) + goto found; - /* Push the red node down */ - if (!_eina_rbtree_is_red(q) - && !_eina_rbtree_is_red(q->son[dir])) - { - if (_eina_rbtree_is_red(q->son[!dir])) - q = p->son[last] = _eina_rbtree_inline_single_rotation(q, dir); - else if (!_eina_rbtree_is_red(q->son[!dir])) - { - Eina_Rbtree *s = p->son[!last]; - - if (s) - { - if (!_eina_rbtree_is_red(s->son[EINA_RBTREE_LEFT]) - && !_eina_rbtree_is_red(s->son[EINA_RBTREE_RIGHT])) - { -/* Color flip */ - p->color = EINA_RBTREE_BLACK; - p->son[EINA_RBTREE_LEFT]->color = EINA_RBTREE_RED; - p->son[EINA_RBTREE_RIGHT]->color = EINA_RBTREE_RED; - } - else - { - Eina_Rbtree_Direction dir2; - - dir2 = g->son[1] == - p ? EINA_RBTREE_RIGHT : EINA_RBTREE_LEFT; - - if (_eina_rbtree_is_red(s->son[last])) - { - g->son[dir2] = - _eina_rbtree_inline_double_rotation(p, last); - if (f == g) - { - p = g->son[dir2]->son[last]; - f = g->son[dir2]; - } - } - else if (_eina_rbtree_is_red(s->son[!last])) - { - g->son[dir2] = - _eina_rbtree_inline_single_rotation(p, last); - if (f == g) - { - p = g->son[dir2]->son[last]; - f = g->son[dir2]; - } - } - -/* Ensure correct coloring */ - q->color = g->son[dir2]->color = EINA_RBTREE_RED; - g->son[dir2]->son[EINA_RBTREE_LEFT]->color = - EINA_RBTREE_BLACK; - g->son[dir2]->son[EINA_RBTREE_RIGHT]->color = - EINA_RBTREE_BLACK; - } - } - } - } - } - - /* Replace and remove if found */ - if (f) - { - /* 'q' should take the place of 'node' parent */ - f->son[f->son[1] == node] = q; - - /* Switch the link from the parent to q's son */ - p->son[p->son[1] == q] = q->son[!q->son[0]]; - - /* Put q at the place of node */ - q->son[0] = node->son[0]; - q->son[1] = node->son[1]; - q->color = node->color; - - /* Reset node link */ - node->son[0] = NULL; - node->son[1] = NULL; - } + dir = cmp(r, node, (void*)data); + stack[s++] = (uintptr_t)rt | dir; + rt = r->son + dir; + } + return root; - root = head.son[1]; - if (root) + found: + /* remove entry */ + l0 = node->son[0]; + l1 = node->son[1]; + + if (l0 != NULL && l1 != NULL) /* two links case */ + { + Eina_Rbtree *q, **t, **p; + uintptr_t ss; + + stack[s++] = (uintptr_t)rt | 1; + ss = s; /* keep predecessor right link stack index */ + + /* find predecessor */ + p = node->son + 1; + q = *p; + + while (1) + { + t = q->son; + q = *t; + if (q == NULL) + break; + stack[s++] = (uintptr_t)p | 0; + p = t; + } + + /* detach predecessor */ + q = *p; + *p = q->son[1]; + + int c = q->color; + + /* replace entry by predecessor */ + memcpy(q, node, sizeof(Eina_Rbtree)); + *rt = q; + + if (c == EINA_RBTREE_RED) + goto end; + + /* fix stack for replaced entry */ + if (s > ss) + stack[ss] = (uintptr_t)(q->son + 1) | 0; + } + else /* single link case */ + { + if (l0 == NULL) + l0 = l1; + + *rt = l0; + + if (node->color == EINA_RBTREE_RED) + goto end; /* removed red */ + + if (l0 != NULL && l0->color == EINA_RBTREE_RED) + { + /* red child replace removed black */ + l0->color = EINA_RBTREE_BLACK; + goto end; + } + } + + /* rebalance */ + while (s > 0) + { + Eina_Rbtree *q; + uintptr_t st = stack[--s]; + + rt = (Eina_Rbtree**)(st & ~(uintptr_t)1); + dir = st & 1; + r = *rt; + q = r->son[dir ^ 1]; + + if (q != NULL && q->color == EINA_RBTREE_RED) + { + *rt = _eina_rbtree_inline_single_rotation(*rt, dir); + q = r->son[dir ^ 1]; + rt = (*rt)->son + dir; + } + + if (q != NULL) + { + int r_color = r->color; + Eina_Rbtree *nd = q->son[dir ^ 1]; + + if (nd != NULL && nd->color == EINA_RBTREE_RED) + { + *rt = _eina_rbtree_inline_single_rotation(*rt, dir); + } + else + { + Eina_Rbtree *d = q->son[dir]; + + if (d != NULL && d->color == EINA_RBTREE_RED) + { + *rt = _eina_rbtree_inline_double_rotation(*rt, dir); + } + else + { + r->color = EINA_RBTREE_BLACK; + q->color = EINA_RBTREE_RED; + if (r_color == EINA_RBTREE_RED) + break; + continue; + } + } + + r = *rt; + r->color = r_color; + r->son[1]->color = r->son[0]->color = EINA_RBTREE_BLACK; + + break; + } + } + + end: + if (root != NULL) root->color = EINA_RBTREE_BLACK; - return root; } diff --git a/libraries/eina/src/lib/eina_sched.c b/libraries/eina/src/lib/eina_sched.c index 8c7f7fe..b8e7000 100644 --- a/libraries/eina/src/lib/eina_sched.c +++ b/libraries/eina/src/lib/eina_sched.c @@ -41,7 +41,7 @@ #include "eina_sched.h" #include "eina_log.h" -#define RTNICENESS 5 +#define RTNICENESS 1 #define NICENESS 5 EAPI void @@ -62,10 +62,14 @@ eina_sched_prio_drop(void) if (EINA_UNLIKELY(pol == SCHED_RR || pol == SCHED_FIFO)) { - prio = sched_get_priority_max(pol); - param.sched_priority += RTNICENESS; - if (prio > 0 && param.sched_priority > prio) - param.sched_priority = prio; + param.sched_priority -= RTNICENESS; + + /* We don't change the policy */ + if (param.sched_priority < 1) + { + EINA_LOG_INFO("RT prio < 1, setting to 1 instead"); + param.sched_priority = 1; + } pthread_setschedparam(pthread_id, pol, ¶m); } @@ -78,7 +82,10 @@ eina_sched_prio_drop(void) { prio += NICENESS; if (prio > 19) - prio = 19; + { + EINA_LOG_INFO("Max niceness reached; keeping max (19)"); + prio = 19; + } setpriority(PRIO_PROCESS, 0, prio); } diff --git a/libraries/eina/src/lib/eina_share_common.c b/libraries/eina/src/lib/eina_share_common.c index 90e1868..776e429 100644 --- a/libraries/eina/src/lib/eina_share_common.c +++ b/libraries/eina/src/lib/eina_share_common.c @@ -76,7 +76,6 @@ #include "eina_hash.h" #include "eina_rbtree.h" #include "eina_error.h" -#include "eina_log.h" #include "eina_lock.h" /* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ @@ -126,8 +125,6 @@ typedef struct _Eina_Share_Common Eina_Share_Common; typedef struct _Eina_Share_Common_Node Eina_Share_Common_Node; typedef struct _Eina_Share_Common_Head Eina_Share_Common_Head; -int _eina_share_common_log_dom = -1; - struct _Eina_Share { Eina_Share_Common *share; @@ -600,28 +597,8 @@ eina_share_common_init(Eina_Share **_share, share = *_share = calloc(sizeof(Eina_Share), 1); if (!share) goto on_error; - if (_eina_share_common_log_dom < 0) /*Only register if not already */ - _eina_share_common_log_dom = eina_log_domain_register( - "eina_share", - EINA_LOG_COLOR_DEFAULT); - - if (_eina_share_common_log_dom < 0) - { - EINA_LOG_ERR("Could not register log domain: eina_share_common"); - goto on_error; - } - share->share = calloc(1, sizeof(Eina_Share_Common)); - if (!share->share) - { - if (_eina_share_common_log_dom > 0) - { - eina_log_domain_unregister(_eina_share_common_log_dom); - _eina_share_common_log_dom = -1; - } - - goto on_error; - } + if (!share->share) goto on_error; share->node_magic = node_magic; #define EMS(n) eina_magic_string_static_set(n, n ## _STR) @@ -678,11 +655,6 @@ eina_share_common_shutdown(Eina_Share **_share) MAGIC_FREE(share->share); _eina_share_common_population_shutdown(share); - if (_eina_share_common_log_dom > 0) /* Only free if necessary */ - { - eina_log_domain_unregister(_eina_share_common_log_dom); - _eina_share_common_log_dom = -1; - } eina_lock_release(&_mutex_big); @@ -833,7 +805,7 @@ eina_share_common_ref(Eina_Share *share, const char *str) } -void +Eina_Bool eina_share_common_del(Eina_Share *share, const char *str) { unsigned int slen; @@ -843,7 +815,7 @@ eina_share_common_del(Eina_Share *share, const char *str) int hash_num, hash; if (!str) - return; + return EINA_TRUE; eina_lock_take(&_mutex_big); @@ -857,7 +829,7 @@ eina_share_common_del(Eina_Share *share, const char *str) { node->references--; eina_lock_release(&_mutex_big); - return; + return EINA_TRUE; } node->references = 0; @@ -871,7 +843,7 @@ eina_share_common_del(Eina_Share *share, const char *str) if (!ed) goto on_error; - EINA_MAGIC_CHECK_SHARE_COMMON_HEAD(ed, eina_lock_release(&_mutex_big)); + EINA_MAGIC_CHECK_SHARE_COMMON_HEAD(ed, eina_lock_release(&_mutex_big), EINA_FALSE); if (!_eina_share_common_head_remove_node(ed, node)) goto on_error; @@ -886,12 +858,12 @@ eina_share_common_del(Eina_Share *share, const char *str) eina_lock_release(&_mutex_big); - return; + return EINA_TRUE; on_error: eina_lock_release(&_mutex_big); /* possible segfault happened before here, but... */ - CRITICAL("EEEK trying to del non-shared share_common \"%s\"", str); + return EINA_FALSE; } int diff --git a/libraries/eina/src/lib/eina_share_common.h b/libraries/eina/src/lib/eina_share_common.h index 002c652..6bc11ef 100644 --- a/libraries/eina/src/lib/eina_share_common.h +++ b/libraries/eina/src/lib/eina_share_common.h @@ -71,7 +71,7 @@ const char *eina_share_common_add_length(Eina_Share *share, unsigned int null_size) EINA_WARN_UNUSED_RESULT; const char *eina_share_common_ref(Eina_Share *share, const char *str); -void eina_share_common_del(Eina_Share *share, const char *str); +Eina_Bool eina_share_common_del(Eina_Share *share, const char *str) EINA_WARN_UNUSED_RESULT; int eina_share_common_length(Eina_Share *share, const char *str) EINA_CONST EINA_WARN_UNUSED_RESULT; @@ -83,21 +83,4 @@ void eina_share_common_dump(Eina_Share *share, void (*additional_dump)( void eina_share_common_population_add(Eina_Share *share, int slen); void eina_share_common_population_del(Eina_Share *share, int slen); -/* Share logging */ -#ifdef CRITICAL -#undef CRITICAL -#endif -#define CRITICAL(...) EINA_LOG_DOM_CRIT(_eina_share_common_log_dom, __VA_ARGS__) - -#ifdef ERR -#undef ERR -#endif -#define ERR(...) EINA_LOG_DOM_ERR(_eina_share_common_log_dom, __VA_ARGS__) - -#ifdef DBG -#undef DBG -#endif -#define DBG(...) EINA_LOG_DOM_DBG(_eina_share_common_log_dom, __VA_ARGS__) -extern int _eina_share_common_log_dom; - -#endif /* EINA_STRINGSHARE_H_ */ +#endif /* EINA_SHARE_COMMON_H_ */ diff --git a/libraries/eina/src/lib/eina_stringshare.c b/libraries/eina/src/lib/eina_stringshare.c index 478b300..f371fcd 100644 --- a/libraries/eina/src/lib/eina_stringshare.c +++ b/libraries/eina/src/lib/eina_stringshare.c @@ -55,12 +55,30 @@ void *alloca (size_t); #include "eina_private.h" #include "eina_error.h" #include "eina_log.h" -#include "eina_stringshare.h" #include "eina_lock.h" +#include "eina_share_common.h" /* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ #include "eina_safety_checks.h" -#include "eina_share_common.h" +#include "eina_stringshare.h" + + +#ifdef CRITICAL +#undef CRITICAL +#endif +#define CRITICAL(...) EINA_LOG_DOM_CRIT(_eina_share_stringshare_log_dom, __VA_ARGS__) + +#ifdef ERR +#undef ERR +#endif +#define ERR(...) EINA_LOG_DOM_ERR(_eina_share_stringshare_log_dom, __VA_ARGS__) + +#ifdef DBG +#undef DBG +#endif +#define DBG(...) EINA_LOG_DOM_DBG(_eina_share_stringshare_log_dom, __VA_ARGS__) + +static int _eina_share_stringshare_log_dom = -1; /* The actual share */ static Eina_Share *stringshare_share; @@ -447,11 +465,8 @@ _eina_stringshare_small_bucket_dump(Eina_Stringshare_Small_Bucket *bucket, for (i = 0; i < bucket->count; i++, s++, l++, r++) { int dups; -#ifdef _WIN32 - printf("DDD: %5hu %5hu '%s'\n", *l, *r, *s); -#else + printf("DDD: %5hhu %5hu '%s'\n", *l, *r, *s); -#endif dups = (*r - 1); @@ -500,11 +515,29 @@ Eina_Bool eina_stringshare_init(void) { Eina_Bool ret; + + if (_eina_share_stringshare_log_dom < 0) + { + _eina_share_stringshare_log_dom = eina_log_domain_register + ("eina_stringshare", EINA_LOG_COLOR_DEFAULT); + + if (_eina_share_stringshare_log_dom < 0) + { + EINA_LOG_ERR("Could not register log domain: eina_stringshare"); + return EINA_FALSE; + } + } + ret = eina_share_common_init(&stringshare_share, EINA_MAGIC_STRINGSHARE_NODE, EINA_MAGIC_STRINGSHARE_NODE_STR); if (ret) _eina_stringshare_small_init(); + else + { + eina_log_domain_unregister(_eina_share_stringshare_log_dom); + _eina_share_stringshare_log_dom = -1; + } return ret; } @@ -526,6 +559,13 @@ eina_stringshare_shutdown(void) Eina_Bool ret; _eina_stringshare_small_shutdown(); ret = eina_share_common_shutdown(&stringshare_share); + + if (_eina_share_stringshare_log_dom >= 0) + { + eina_log_domain_unregister(_eina_share_stringshare_log_dom); + _eina_share_stringshare_log_dom = -1; + } + return ret; } @@ -534,7 +574,7 @@ eina_stringshare_shutdown(void) *============================================================================*/ EAPI void -eina_stringshare_del(const char *str) +eina_stringshare_del(Eina_Stringshare *str) { int slen; @@ -564,16 +604,17 @@ eina_stringshare_del(const char *str) return; } - eina_share_common_del(stringshare_share, str); + if (!eina_share_common_del(stringshare_share, str)) + CRITICAL("EEEK trying to del non-shared stringshare \"%s\"", str); } -EAPI const char * +EAPI Eina_Stringshare * eina_stringshare_add_length(const char *str, unsigned int slen) { if ((!str) || (slen <= 0)) return ""; else if (slen == 1) - return (const char *)_eina_stringshare_single + ((*str) << 1); + return (Eina_Stringshare *) _eina_stringshare_single + ((*str) << 1); else if (slen < 4) { const char *s; @@ -588,7 +629,7 @@ eina_stringshare_add_length(const char *str, unsigned int slen) sizeof(char), sizeof(char)); } -EAPI const char * +EAPI Eina_Stringshare * eina_stringshare_add(const char *str) { int slen; @@ -609,7 +650,7 @@ eina_stringshare_add(const char *str) return eina_stringshare_add_length(str, slen); } -EAPI const char * +EAPI Eina_Stringshare * eina_stringshare_printf(const char *fmt, ...) { va_list args; @@ -633,7 +674,7 @@ eina_stringshare_printf(const char *fmt, ...) return ret; } -EAPI const char * +EAPI Eina_Stringshare * eina_stringshare_vprintf(const char *fmt, va_list args) { char *tmp; @@ -654,7 +695,7 @@ eina_stringshare_vprintf(const char *fmt, va_list args) return ret; } -EAPI const char * +EAPI Eina_Stringshare * eina_stringshare_nprintf(unsigned int len, const char *fmt, ...) { va_list args; @@ -679,8 +720,8 @@ eina_stringshare_nprintf(unsigned int len, const char *fmt, ...) return eina_stringshare_add_length(tmp, len); } -EAPI const char * -eina_stringshare_ref(const char *str) +EAPI Eina_Stringshare * +eina_stringshare_ref(Eina_Stringshare *str) { int slen; @@ -721,7 +762,7 @@ eina_stringshare_ref(const char *str) } EAPI int -eina_stringshare_strlen(const char *str) +eina_stringshare_strlen(Eina_Stringshare *str) { int len; /* special cases */ @@ -737,7 +778,7 @@ eina_stringshare_strlen(const char *str) if (str[3] == '\0') return 3; - len = eina_share_common_length(stringshare_share, (const char *)str); + len = eina_share_common_length(stringshare_share, (Eina_Stringshare *) str); len = (len > 0) ? len / (int)sizeof(char) : -1; return len; } diff --git a/libraries/eina/src/lib/eina_unicode.c b/libraries/eina/src/lib/eina_unicode.c index 342e3cb..7505906 100644 --- a/libraries/eina/src/lib/eina_unicode.c +++ b/libraries/eina/src/lib/eina_unicode.c @@ -15,10 +15,18 @@ * You should have received a copy of the GNU Lesser General Public * License along with this library; * if not, see . - */ -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "eina_config.h" +#include "eina_private.h" +#include + +/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ +#include "eina_safety_checks.h" #include "eina_unicode.h" /* FIXME: check if sizeof(wchar_t) == sizeof(Eina_Unicode) if so, @@ -30,6 +38,9 @@ EAPI const Eina_Unicode *EINA_UNICODE_EMPTY_STRING = _EINA_UNICODE_EMPTY_STRING; EAPI int eina_unicode_strcmp(const Eina_Unicode *a, const Eina_Unicode *b) { + EINA_SAFETY_ON_NULL_RETURN_VAL(a, -1); + EINA_SAFETY_ON_NULL_RETURN_VAL(b, -1); + for (; *a && *a == *b; a++, b++) ; if (*a == *b) @@ -45,6 +56,9 @@ eina_unicode_strcpy(Eina_Unicode *dest, const Eina_Unicode *source) { Eina_Unicode *ret = dest; + EINA_SAFETY_ON_NULL_RETURN_VAL(dest, NULL); + EINA_SAFETY_ON_NULL_RETURN_VAL(source, NULL); + while (*source) *dest++ = *source++; *dest = 0; @@ -56,6 +70,9 @@ eina_unicode_strncpy(Eina_Unicode *dest, const Eina_Unicode *source, size_t n) { Eina_Unicode *ret = dest; + EINA_SAFETY_ON_NULL_RETURN_VAL(dest, NULL); + EINA_SAFETY_ON_NULL_RETURN_VAL(source, NULL); + for ( ; n && *source ; n--) *dest++ = *source++; for (; n; n--) @@ -67,6 +84,9 @@ EAPI size_t eina_unicode_strlen(const Eina_Unicode *ustr) { const Eina_Unicode *end; + + EINA_SAFETY_ON_NULL_RETURN_VAL(ustr, 0); + for (end = ustr; *end; end++) ; return end - ustr; @@ -77,6 +97,9 @@ eina_unicode_strnlen(const Eina_Unicode *ustr, int n) { const Eina_Unicode *end; const Eina_Unicode *last = ustr + n; /* technically not portable ;-) */ + + EINA_SAFETY_ON_NULL_RETURN_VAL(ustr, 0); + for (end = ustr; end < last && *end; end++) ; return end - ustr; @@ -90,7 +113,9 @@ eina_unicode_strndup(const Eina_Unicode *text, size_t n) { Eina_Unicode *ustr; - ustr = (Eina_Unicode *) malloc((n + 1) * sizeof(Eina_Unicode)); + EINA_SAFETY_ON_NULL_RETURN_VAL(text, NULL); + + ustr = malloc((n + 1) * sizeof(Eina_Unicode)); memcpy(ustr, text, n * sizeof(Eina_Unicode)); ustr[n] = 0; return ustr; @@ -101,6 +126,8 @@ eina_unicode_strdup(const Eina_Unicode *text) { size_t len; + EINA_SAFETY_ON_NULL_RETURN_VAL(text, NULL); + len = eina_unicode_strlen(text); return eina_unicode_strndup(text, len); } @@ -110,6 +137,9 @@ eina_unicode_strstr(const Eina_Unicode *haystack, const Eina_Unicode *needle) { const Eina_Unicode *i, *j; + EINA_SAFETY_ON_NULL_RETURN_VAL(haystack, NULL); + EINA_SAFETY_ON_NULL_RETURN_VAL(needle, NULL); + for (i = haystack; *i; i++) { haystack = i; /* set this location as the base position */ @@ -131,6 +161,8 @@ eina_unicode_escape(const Eina_Unicode *str) Eina_Unicode *s2, *d; const Eina_Unicode *s; + EINA_SAFETY_ON_NULL_RETURN_VAL(str, NULL); + s2 = malloc((eina_unicode_strlen(str) * 2) + 1); if (!s2) return NULL; @@ -165,6 +197,9 @@ eina_unicode_utf8_get_next(const char *buf, int *iindex) Eina_Unicode r; unsigned char d; + EINA_SAFETY_ON_NULL_RETURN_VAL(buf, 0); + EINA_SAFETY_ON_NULL_RETURN_VAL(iindex, 0); + /* if this char is the null terminator, exit */ if ((d = buf[ind++]) == 0) return 0; @@ -266,8 +301,12 @@ error: EAPI Eina_Unicode eina_unicode_utf8_get_prev(const char *buf, int *iindex) { - int r; - int ind = *iindex; + int r, ind; + + EINA_SAFETY_ON_NULL_RETURN_VAL(buf, 0); + EINA_SAFETY_ON_NULL_RETURN_VAL(iindex, 0); + + ind = *iindex; /* First obtain the codepoint at iindex */ r = eina_unicode_utf8_get_next(buf, &ind); @@ -292,6 +331,8 @@ eina_unicode_utf8_get_len(const char *buf) /* returns the number of utf8 characters (not bytes) in the string */ int i = 0, len = 0; + EINA_SAFETY_ON_NULL_RETURN_VAL(buf, 0); + while (eina_unicode_utf8_get_next(buf, &i)) len++; @@ -306,6 +347,8 @@ eina_unicode_utf8_to_unicode(const char *utf, int *_len) int ind; Eina_Unicode *buf, *uind; + EINA_SAFETY_ON_NULL_RETURN_VAL(utf, NULL); + len = eina_unicode_utf8_get_len(utf); if (_len) *_len = len; @@ -328,6 +371,8 @@ eina_unicode_unicode_to_utf8(const Eina_Unicode *uni, int *_len) char *ind; int ulen, len; + EINA_SAFETY_ON_NULL_RETURN_VAL(uni, NULL); + ulen = eina_unicode_strlen(uni); buf = (char *) calloc(ulen + 1, EINA_UNICODE_UTF8_BYTES_PER_CHAR); diff --git a/libraries/eina/src/lib/eina_ustringshare.c b/libraries/eina/src/lib/eina_ustringshare.c index 3992dc6..33be242 100644 --- a/libraries/eina/src/lib/eina_ustringshare.c +++ b/libraries/eina/src/lib/eina_ustringshare.c @@ -27,11 +27,38 @@ * */ -#include "eina_share_common.h" -#include "eina_unicode.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include "eina_config.h" #include "eina_private.h" +#include "eina_unicode.h" +#include "eina_log.h" +#include "eina_share_common.h" + +/* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ +#include "eina_safety_checks.h" #include "eina_ustringshare.h" + +#ifdef CRITICAL +#undef CRITICAL +#endif +#define CRITICAL(...) EINA_LOG_DOM_CRIT(_eina_share_ustringshare_log_dom, __VA_ARGS__) + +#ifdef ERR +#undef ERR +#endif +#define ERR(...) EINA_LOG_DOM_ERR(_eina_share_ustringshare_log_dom, __VA_ARGS__) + +#ifdef DBG +#undef DBG +#endif +#define DBG(...) EINA_LOG_DOM_DBG(_eina_share_ustringshare_log_dom, __VA_ARGS__) + +static int _eina_share_ustringshare_log_dom = -1; + /* The actual share */ static Eina_Share *ustringshare_share; static const char EINA_MAGIC_USTRINGSHARE_NODE_STR[] = "Eina UStringshare Node"; @@ -54,9 +81,31 @@ static const char EINA_MAGIC_USTRINGSHARE_NODE_STR[] = "Eina UStringshare Node"; Eina_Bool eina_ustringshare_init(void) { - return eina_share_common_init(&ustringshare_share, - EINA_MAGIC_USTRINGSHARE_NODE, - EINA_MAGIC_USTRINGSHARE_NODE_STR); + Eina_Bool ret; + + if (_eina_share_ustringshare_log_dom < 0) + { + _eina_share_ustringshare_log_dom = eina_log_domain_register + ("eina_ustringshare", EINA_LOG_COLOR_DEFAULT); + + if (_eina_share_ustringshare_log_dom < 0) + { + EINA_LOG_ERR("Could not register log domain: eina_ustringshare"); + return EINA_FALSE; + } + } + + ret = eina_share_common_init(&ustringshare_share, + EINA_MAGIC_USTRINGSHARE_NODE, + EINA_MAGIC_USTRINGSHARE_NODE_STR); + + if (!ret) + { + eina_log_domain_unregister(_eina_share_ustringshare_log_dom); + _eina_share_ustringshare_log_dom = -1; + } + + return ret; } /** @@ -75,6 +124,13 @@ eina_ustringshare_shutdown(void) { Eina_Bool ret; ret = eina_share_common_shutdown(&ustringshare_share); + + if (_eina_share_ustringshare_log_dom >= 0) + { + eina_log_domain_unregister(_eina_share_ustringshare_log_dom); + _eina_share_ustringshare_log_dom = -1; + } + return ret; } @@ -88,7 +144,8 @@ eina_ustringshare_del(const Eina_Unicode *str) if (!str) return; - eina_share_common_del(ustringshare_share,(const char *)str); + if (!eina_share_common_del(ustringshare_share, (const char *)str)) + CRITICAL("EEEK trying to del non-shared ustringshare \"%s\"", (const char *)str); } EAPI const Eina_Unicode * diff --git a/libraries/eina/src/lib/eina_value.c b/libraries/eina/src/lib/eina_value.c index ba8af52..b8df693 100644 --- a/libraries/eina/src/lib/eina_value.c +++ b/libraries/eina/src/lib/eina_value.c @@ -49,6 +49,10 @@ void *alloca (size_t); #include /* PRId64 and PRIu64 */ #include /* struct timeval */ +#ifdef HAVE_EVIL +# include +#endif + #include "eina_config.h" #include "eina_private.h" #include "eina_error.h" @@ -60,6 +64,7 @@ void *alloca (size_t); /* undefs EINA_ARG_NONULL() so NULL checks are not compiled out! */ #include "eina_safety_checks.h" #include "eina_value.h" +#include "eina_model.h" /* uses eina_value.h */ /*============================================================================* * Local * @@ -168,7 +173,7 @@ _eina_value_type_uchar_convert_to(const Eina_Value_Type *type __UNUSED__, const unsigned int other_mem = v; return eina_value_type_pset(convert, convert_mem, &other_mem); } - else if (convert == EINA_VALUE_TYPE_ULONG) + else if ((convert == EINA_VALUE_TYPE_ULONG) || (convert == EINA_VALUE_TYPE_TIMESTAMP)) { unsigned long other_mem = v; return eina_value_type_pset(convert, convert_mem, &other_mem); @@ -317,7 +322,7 @@ _eina_value_type_ushort_convert_to(const Eina_Value_Type *type __UNUSED__, const unsigned int other_mem = v; return eina_value_type_pset(convert, convert_mem, &other_mem); } - else if (convert == EINA_VALUE_TYPE_ULONG) + else if ((convert == EINA_VALUE_TYPE_ULONG) || (convert == EINA_VALUE_TYPE_TIMESTAMP)) { unsigned long other_mem = v; return eina_value_type_pset(convert, convert_mem, &other_mem); @@ -470,7 +475,7 @@ _eina_value_type_uint_convert_to(const Eina_Value_Type *type __UNUSED__, const E unsigned int other_mem = v; return eina_value_type_pset(convert, convert_mem, &other_mem); } - else if (convert == EINA_VALUE_TYPE_ULONG) + else if ((convert == EINA_VALUE_TYPE_ULONG) || (convert == EINA_VALUE_TYPE_TIMESTAMP)) { unsigned long other_mem = v; return eina_value_type_pset(convert, convert_mem, &other_mem); @@ -627,7 +632,7 @@ _eina_value_type_ulong_convert_to(const Eina_Value_Type *type __UNUSED__, const return EINA_FALSE; return eina_value_type_pset(convert, convert_mem, &other_mem); } - else if (convert == EINA_VALUE_TYPE_ULONG) + else if ((convert == EINA_VALUE_TYPE_ULONG) || (convert == EINA_VALUE_TYPE_TIMESTAMP)) { unsigned long other_mem = v; return eina_value_type_pset(convert, convert_mem, &other_mem); @@ -786,7 +791,7 @@ _eina_value_type_uint64_convert_to(const Eina_Value_Type *type __UNUSED__, const return EINA_FALSE; return eina_value_type_pset(convert, convert_mem, &other_mem); } - else if (convert == EINA_VALUE_TYPE_ULONG) + else if ((convert == EINA_VALUE_TYPE_ULONG) || (convert == EINA_VALUE_TYPE_TIMESTAMP)) { unsigned long other_mem = v; if (EINA_UNLIKELY((sizeof(other_mem) != sizeof(v)) && @@ -950,7 +955,7 @@ _eina_value_type_char_convert_to(const Eina_Value_Type *type __UNUSED__, const E return EINA_FALSE; return eina_value_type_pset(convert, convert_mem, &other_mem); } - else if (convert == EINA_VALUE_TYPE_ULONG) + else if ((convert == EINA_VALUE_TYPE_ULONG) || (convert == EINA_VALUE_TYPE_TIMESTAMP)) { unsigned long other_mem = v; if (EINA_UNLIKELY(v < 0)) @@ -1107,7 +1112,7 @@ _eina_value_type_short_convert_to(const Eina_Value_Type *type __UNUSED__, const return EINA_FALSE; return eina_value_type_pset(convert, convert_mem, &other_mem); } - else if (convert == EINA_VALUE_TYPE_ULONG) + else if ((convert == EINA_VALUE_TYPE_ULONG) || (convert == EINA_VALUE_TYPE_TIMESTAMP)) { unsigned long other_mem = v; if (EINA_UNLIKELY(v < 0)) @@ -1270,7 +1275,7 @@ _eina_value_type_int_convert_to(const Eina_Value_Type *type __UNUSED__, const Ei return EINA_FALSE; return eina_value_type_pset(convert, convert_mem, &other_mem); } - else if (convert == EINA_VALUE_TYPE_ULONG) + else if ((convert == EINA_VALUE_TYPE_ULONG) || (convert == EINA_VALUE_TYPE_TIMESTAMP)) { unsigned long other_mem = v; if (EINA_UNLIKELY(v < 0)) @@ -1439,7 +1444,7 @@ _eina_value_type_long_convert_to(const Eina_Value_Type *type __UNUSED__, const E return EINA_FALSE; return eina_value_type_pset(convert, convert_mem, &other_mem); } - else if (convert == EINA_VALUE_TYPE_ULONG) + else if ((convert == EINA_VALUE_TYPE_ULONG) || (convert == EINA_VALUE_TYPE_TIMESTAMP)) { unsigned long other_mem = v; if (EINA_UNLIKELY(v < 0)) @@ -1612,7 +1617,7 @@ _eina_value_type_int64_convert_to(const Eina_Value_Type *type __UNUSED__, const return EINA_FALSE; return eina_value_type_pset(convert, convert_mem, &other_mem); } - else if (convert == EINA_VALUE_TYPE_ULONG) + else if ((convert == EINA_VALUE_TYPE_ULONG) || (convert == EINA_VALUE_TYPE_TIMESTAMP)) { unsigned long other_mem = v; if (EINA_UNLIKELY(v < 0)) @@ -1792,7 +1797,7 @@ _eina_value_type_float_convert_to(const Eina_Value_Type *type __UNUSED__, const return EINA_FALSE; return eina_value_type_pset(convert, convert_mem, &other_mem); } - else if (convert == EINA_VALUE_TYPE_ULONG) + else if ((convert == EINA_VALUE_TYPE_ULONG) || (convert == EINA_VALUE_TYPE_TIMESTAMP)) { unsigned long other_mem = v; if (EINA_UNLIKELY(v < 0)) @@ -1978,7 +1983,7 @@ _eina_value_type_double_convert_to(const Eina_Value_Type *type __UNUSED__, const return EINA_FALSE; return eina_value_type_pset(convert, convert_mem, &other_mem); } - else if (convert == EINA_VALUE_TYPE_ULONG) + else if ((convert == EINA_VALUE_TYPE_ULONG) || (convert == EINA_VALUE_TYPE_TIMESTAMP)) { unsigned long other_mem = v; if (EINA_UNLIKELY(v < 0)) @@ -2146,7 +2151,7 @@ _eina_value_type_string_common_convert_to(const Eina_Value_Type *type __UNUSED__ return EINA_FALSE; return eina_value_type_pset(convert, convert_mem, &other_mem); } - else if (convert == EINA_VALUE_TYPE_ULONG) + else if ((convert == EINA_VALUE_TYPE_ULONG) || (convert == EINA_VALUE_TYPE_TIMESTAMP)) { unsigned long other_mem; if ((sscanf(v, "%lu", &other_mem) != 1) && @@ -2248,7 +2253,11 @@ static Eina_Bool _eina_value_type_stringshare_flush(const Eina_Value_Type *type __UNUSED__, void *mem) { const char **tmem = mem; - if (*tmem) eina_stringshare_del(*tmem); + if (*tmem) + { + eina_stringshare_del(*tmem); + *tmem = NULL; + } return EINA_TRUE; } @@ -2257,8 +2266,7 @@ _eina_value_type_stringshare_copy(const Eina_Value_Type *type __UNUSED__, const { const char * const*s = src; const char **d = dst; - *d = *s; - eina_stringshare_ref(*d); + *d = eina_stringshare_add(*s); return EINA_TRUE; } @@ -2280,7 +2288,11 @@ static Eina_Bool _eina_value_type_string_flush(const Eina_Value_Type *type __UNUSED__, void *mem) { char **tmem = mem; - if (*tmem) free(*tmem); + if (*tmem) + { + free(*tmem); + *tmem = NULL; + } return EINA_TRUE; } @@ -2308,19 +2320,24 @@ _eina_value_type_string_vset(const Eina_Value_Type *type __UNUSED__, void *mem, { char **tmem = mem; const char *str = va_arg(args, const char *); - free(*tmem); - if (str == NULL) - *tmem = NULL; + eina_error_set(0); + if (str == *tmem) return EINA_TRUE; + if (!str) + { + free(*tmem); + *tmem = NULL; + } else { - *tmem = strdup(str); - if (*tmem == NULL) + char *tmp = strdup(str); + if (!tmp) { eina_error_set(EINA_ERROR_OUT_OF_MEMORY); return EINA_FALSE; } + free(*tmem); + *tmem = tmp; } - eina_error_set(0); return EINA_TRUE; } @@ -2329,19 +2346,24 @@ _eina_value_type_string_pset(const Eina_Value_Type *type __UNUSED__, void *mem, { char **tmem = mem; const char * const *str = ptr; - free(*tmem); - if (*str == NULL) - *tmem = NULL; + eina_error_set(0); + if (*str == *tmem) return EINA_TRUE; + if (!*str) + { + free(*tmem); + *tmem = NULL; + } else { - *tmem = strdup(*str); - if (*tmem == NULL) + char *tmp = strdup(*str); + if (!tmp) { eina_error_set(EINA_ERROR_OUT_OF_MEMORY); return EINA_FALSE; } + free(*tmem); + *tmem = tmp; } - eina_error_set(0); return EINA_TRUE; } @@ -2505,12 +2527,13 @@ _eina_value_type_array_convert_to(const Eina_Value_Type *type __UNUSED__, const (convert == EINA_VALUE_TYPE_STRINGSHARE)) { Eina_Strbuf *str = eina_strbuf_new(); + const char *ptr; if (!tmem->array) eina_strbuf_append(str, "[]"); else { const Eina_Value_Type *subtype = tmem->subtype; unsigned char sz; - const char *ptr, *ptr_end; + const char *ptr_end; Eina_Value tmp; Eina_Bool first = EINA_TRUE; @@ -2551,10 +2574,10 @@ _eina_value_type_array_convert_to(const Eina_Value_Type *type __UNUSED__, const } eina_strbuf_append_char(str, ']'); - ptr = eina_strbuf_string_get(str); - ret = eina_value_type_pset(convert, convert_mem, &ptr); - eina_strbuf_free(str); } + ptr = eina_strbuf_string_get(str); + ret = eina_value_type_pset(convert, convert_mem, &ptr); + eina_strbuf_free(str); } else if ((tmem->array) && (tmem->array->len == 1)) { @@ -2606,43 +2629,51 @@ _eina_value_type_array_convert_from(const Eina_Value_Type *type, const Eina_Valu } static Eina_Bool -_eina_value_type_array_pset(const Eina_Value_Type *type __UNUSED__, void *mem, const void *ptr) +_eina_value_type_array_pset(const Eina_Value_Type *type, void *mem, const void *ptr) { Eina_Value_Array *tmem = mem; const Eina_Value_Array *desc = ptr; Eina_Inarray *desc_array; + eina_error_set(0); if ((!tmem->subtype) && (!desc->subtype)) return EINA_TRUE; desc_array = desc->array; if (desc_array) { + Eina_Value_Array tmp; + EINA_SAFETY_ON_FALSE_RETURN_VAL (desc_array->member_size == desc->subtype->value_size, EINA_FALSE); + + if (desc_array == tmem->array) + { + tmem->subtype = desc->subtype; + return EINA_TRUE; + } + + if (!_eina_value_type_array_copy(type, desc, &tmp)) + return EINA_FALSE; + + _eina_value_type_array_flush(type, tmem); + memcpy(tmem, &tmp, sizeof(tmp)); + return EINA_TRUE; } if (tmem->array) { _eina_value_type_array_flush_elements(tmem); - if (desc_array) - eina_inarray_free(tmem->array); - else - eina_inarray_setup(tmem->array, desc->subtype->value_size, - desc->step); + eina_inarray_setup(tmem->array, desc->subtype->value_size, desc->step); } - else if (!desc_array) + else { tmem->array = eina_inarray_new(desc->subtype->value_size, desc->step); if (!tmem->array) return EINA_FALSE; } - if (desc_array) - tmem->array = desc_array; - tmem->subtype = desc->subtype; - return EINA_TRUE; } @@ -2821,13 +2852,13 @@ _eina_value_type_list_convert_to(const Eina_Value_Type *type __UNUSED__, const E (convert == EINA_VALUE_TYPE_STRINGSHARE)) { Eina_Strbuf *str = eina_strbuf_new(); + const char *s; if (!tmem->list) eina_strbuf_append(str, "[]"); else { const Eina_Value_Type *subtype = tmem->subtype; const Eina_List *node; Eina_Value tmp; - const char *s; Eina_Bool first = EINA_TRUE; eina_value_setup(&tmp, EINA_VALUE_TYPE_STRING); @@ -2867,10 +2898,10 @@ _eina_value_type_list_convert_to(const Eina_Value_Type *type __UNUSED__, const E } eina_strbuf_append_char(str, ']'); - s = eina_strbuf_string_get(str); - ret = eina_value_type_pset(convert, convert_mem, &s); - eina_strbuf_free(str); } + s = eina_strbuf_string_get(str); + ret = eina_value_type_pset(convert, convert_mem, &s); + eina_strbuf_free(str); } else if ((tmem->list) && (tmem->list->next == NULL)) { @@ -2932,18 +2963,36 @@ _eina_value_type_list_convert_from(const Eina_Value_Type *type, const Eina_Value } static Eina_Bool -_eina_value_type_list_pset(const Eina_Value_Type *type __UNUSED__, void *mem, const void *ptr) +_eina_value_type_list_pset(const Eina_Value_Type *type, void *mem, const void *ptr) { Eina_Value_List *tmem = mem; const Eina_Value_List *desc = ptr; + eina_error_set(0); if ((!tmem->subtype) && (!desc->subtype)) return EINA_TRUE; + if ((tmem->list) && (tmem->list == desc->list)) + { + tmem->subtype = desc->subtype; + return EINA_TRUE; + } + + if (desc->list) + { + Eina_Value_List tmp; + + if (!_eina_value_type_list_copy(type, desc, &tmp)) + return EINA_FALSE; + + _eina_value_type_list_flush(type, tmem); + memcpy(tmem, &tmp, sizeof(tmp)); + return EINA_TRUE; + } + _eina_value_type_list_flush_elements(tmem); - tmem->subtype = desc->subtype; - tmem->list = desc->list; + tmem->subtype = desc->subtype; return EINA_TRUE; } @@ -2995,6 +3044,7 @@ _eina_value_type_hash_flush_each(const Eina_Hash *hash __UNUSED__, const void *k { struct _eina_value_type_hash_flush_each_ctx *ctx = user_data; ctx->ret &= eina_value_type_flush(ctx->subtype, mem); + free(mem); return EINA_TRUE; } @@ -3239,11 +3289,11 @@ _eina_value_type_hash_convert_to(const Eina_Value_Type *type __UNUSED__, const E (convert == EINA_VALUE_TYPE_STRINGSHARE)) { Eina_Strbuf *str = eina_strbuf_new(); + const char *s; if (!tmem->hash) eina_strbuf_append(str, "{}"); else { struct _eina_value_type_hash_convert_to_string_each_ctx ctx; - const char *s; ctx.subtype = tmem->subtype; ctx.str = str; @@ -3257,10 +3307,10 @@ _eina_value_type_hash_convert_to(const Eina_Value_Type *type __UNUSED__, const E &ctx); eina_strbuf_append_char(str, '}'); - s = eina_strbuf_string_get(str); - ret = eina_value_type_pset(convert, convert_mem, &s); - eina_strbuf_free(str); } + s = eina_strbuf_string_get(str); + ret = eina_value_type_pset(convert, convert_mem, &s); + eina_strbuf_free(str); } else if ((tmem->hash) && (eina_hash_population(tmem->hash) == 1)) { @@ -3288,22 +3338,38 @@ _eina_value_type_hash_convert_to(const Eina_Value_Type *type __UNUSED__, const E } static Eina_Bool -_eina_value_type_hash_pset(const Eina_Value_Type *type __UNUSED__, void *mem, const void *ptr) +_eina_value_type_hash_pset(const Eina_Value_Type *type, void *mem, const void *ptr) { Eina_Value_Hash *tmem = mem; const Eina_Value_Hash *desc = ptr; + eina_error_set(0); if ((!tmem->subtype) && (!desc->subtype)) return EINA_TRUE; - if (tmem->hash) _eina_value_type_hash_flush_elements(tmem); + if ((tmem->hash) && (tmem->hash == desc->hash)) + { + tmem->subtype = desc->subtype; + return EINA_TRUE; + } if (desc->hash) - tmem->hash = desc->hash; - else if (!_eina_value_type_hash_create(tmem)) - return EINA_FALSE; + { + Eina_Value_Hash tmp; + + if (!_eina_value_type_hash_copy(type, desc, &tmp)) + return EINA_FALSE; + + _eina_value_type_hash_flush(type, tmem); + memcpy(tmem, &tmp, sizeof(tmp)); + return EINA_TRUE; + } + + if (tmem->hash) _eina_value_type_hash_flush_elements(tmem); tmem->subtype = desc->subtype; + if (!_eina_value_type_hash_create(tmem)) + return EINA_FALSE; return EINA_TRUE; } @@ -3424,7 +3490,7 @@ _eina_value_type_timeval_convert_to(const Eina_Value_Type *type __UNUSED__, cons return EINA_FALSE; return eina_value_type_pset(convert, convert_mem, &other_mem); } - else if (convert == EINA_VALUE_TYPE_ULONG) + else if ((convert == EINA_VALUE_TYPE_ULONG) || (convert == EINA_VALUE_TYPE_TIMESTAMP)) { unsigned long other_mem = v.tv_sec; if (EINA_UNLIKELY(v.tv_sec < 0)) @@ -3570,6 +3636,8 @@ _eina_value_type_blob_flush(const Eina_Value_Type *type __UNUSED__, void *mem) Eina_Value_Blob *tmem = mem; if ((ops) && (ops->free)) ops->free(ops, (void *)tmem->memory, tmem->size); + tmem->memory = NULL; + tmem->size = 0; return EINA_TRUE; } @@ -3776,6 +3844,14 @@ _eina_value_type_blob_pset(const Eina_Value_Type *type __UNUSED__, void *mem, co Eina_Value_Blob *tmem = mem; const Eina_Value_Blob *desc = ptr; + eina_error_set(0); + if ((tmem->memory) && (tmem->memory == desc->memory)) + { + tmem->ops = desc->ops; + tmem->size = desc->size; + return EINA_TRUE; + } + if ((ops) && (ops->free)) ops->free(ops, (void *)tmem->memory, tmem->size); @@ -3872,6 +3948,7 @@ _eina_value_struct_operations_stringshare_find_member(const Eina_Value_Struct_Op return itr; } + itr = desc->members; name = eina_stringshare_add(name); eina_stringshare_del(name); /* we'll not use the contents, this is fine */ /* stringshare and look again */ @@ -3955,6 +4032,13 @@ _eina_value_type_struct_setup(const Eina_Value_Type *type __UNUSED__, void *mem) } static Eina_Bool +_eina_value_type_struct_setup_member(const Eina_Value_Struct_Member *member, Eina_Value_Struct *st) +{ + unsigned char *base = st->memory; + return eina_value_type_setup(member->type, base + member->offset); +} + +static Eina_Bool _eina_value_type_struct_flush_member(const Eina_Value_Struct_Member *member, Eina_Value_Struct *st) { unsigned char *base = st->memory; @@ -3969,6 +4053,9 @@ _eina_value_type_struct_flush(const Eina_Value_Type *type __UNUSED__, void *mem) Eina_Value_Struct *tmem = mem; Eina_Bool ret = EINA_TRUE; + if ((!tmem->desc) || (!tmem->memory)) + return EINA_TRUE; + itr = tmem->desc->members; if (tmem->desc->member_count > 0) { @@ -3989,6 +4076,9 @@ _eina_value_type_struct_flush(const Eina_Value_Type *type __UNUSED__, void *mem) else free(tmem->memory); + tmem->memory = NULL; + tmem->desc = NULL; + return ret; } @@ -4012,6 +4102,9 @@ _eina_value_type_struct_copy(const Eina_Value_Type *type __UNUSED__, const void *d = *s; + if ((!s->desc) || (!s->memory)) + return EINA_TRUE; + ops = _eina_value_type_struct_ops_get(src); if ((ops) && (ops->copy)) { @@ -4021,7 +4114,10 @@ _eina_value_type_struct_copy(const Eina_Value_Type *type __UNUSED__, const void return EINA_TRUE; } - d->memory = malloc(s->desc->size); + if ((ops) && (ops->alloc)) + d->memory = ops->alloc(ops, s->desc); + else + d->memory = malloc(s->desc->size); if (!d->memory) { eina_error_set(EINA_ERROR_OUT_OF_MEMORY); @@ -4043,14 +4139,17 @@ _eina_value_type_struct_copy(const Eina_Value_Type *type __UNUSED__, const void goto error; } - return EINA_TRUE; error: itr--; for (; itr >= s->desc->members; itr--) _eina_value_type_struct_flush_member(itr, d); - free(d->memory); + + if ((ops) && (ops->free)) + ops->free(ops, s->desc, d->memory); + else + free(d->memory); return EINA_FALSE; } @@ -4072,7 +4171,9 @@ _eina_value_type_struct_compare(const Eina_Value_Type *type __UNUSED__, const vo const Eina_Value_Struct_Member *itr; int cmp = 0; - if (ta->desc != tb->desc) + if ((!ta->desc) && (!tb->desc)) + return 0; + else if (ta->desc != tb->desc) { eina_error_set(EINA_ERROR_VALUE_FAILED); return -1; @@ -4236,11 +4337,12 @@ _eina_value_type_struct_desc_check(const Eina_Value_Struct_Desc *desc) } static Eina_Bool -_eina_value_type_struct_pset(const Eina_Value_Type *type __UNUSED__, void *mem, const void *ptr) +_eina_value_type_struct_pset(const Eina_Value_Type *type, void *mem, const void *ptr) { - const Eina_Value_Struct_Operations *ops = _eina_value_type_struct_ops_get(mem); + const Eina_Value_Struct_Operations *ops; Eina_Value_Struct *tmem = mem; const Eina_Value_Struct *desc = ptr; + const Eina_Value_Struct_Member *itr; if (!_eina_value_type_struct_desc_check(desc->desc)) { @@ -4248,30 +4350,71 @@ _eina_value_type_struct_pset(const Eina_Value_Type *type __UNUSED__, void *mem, return EINA_FALSE; } - if ((ops) && (ops->free)) - ops->free(ops, tmem->desc, tmem->memory); - else - free(tmem->memory); + eina_error_set(0); + if ((tmem->memory) && (tmem->memory == desc->memory)) + { + tmem->desc = desc->desc; + return EINA_TRUE; + } - *tmem = *desc; + if (desc->memory) + { + Eina_Value_Struct tmp; + + if (!_eina_value_type_struct_copy(type, desc, &tmp)) + return EINA_FALSE; + + _eina_value_type_struct_flush(type, tmem); + memcpy(tmem, &tmp, sizeof(tmp)); + return EINA_TRUE; + } + + if (tmem->memory) _eina_value_type_struct_flush(type, mem); + + tmem->desc = desc->desc; ops = _eina_value_type_struct_ops_get(desc); + if ((ops) && (ops->alloc)) + tmem->memory = ops->alloc(ops, tmem->desc); + else + tmem->memory = malloc(tmem->desc->size); + if (!tmem->memory) { - if ((ops) && (ops->alloc)) - tmem->memory = ops->alloc(ops, tmem->desc); - else - tmem->memory = malloc(tmem->desc->size); + eina_error_set(EINA_ERROR_OUT_OF_MEMORY); + return EINA_FALSE; + } - if (!tmem->memory) - { - eina_error_set(EINA_ERROR_OUT_OF_MEMORY); - return EINA_FALSE; - } + itr = tmem->desc->members; + if (tmem->desc->member_count > 0) + { + const Eina_Value_Struct_Member *itr_end; + itr_end = itr + tmem->desc->member_count; + for (; itr < itr_end; itr++) + if (!_eina_value_type_struct_setup_member(itr, tmem)) + goto error; + } + else + { + for (; itr->name != NULL; itr++) + if (!_eina_value_type_struct_setup_member(itr, tmem)) + goto error; } - eina_error_set(0); return EINA_TRUE; + + error: + itr--; + for (; itr >= tmem->desc->members; itr--) + _eina_value_type_struct_flush_member(itr, tmem); + + if ((ops) && (ops->free)) + ops->free(ops, tmem->desc, tmem->memory); + else + free(tmem->memory); + tmem->memory = NULL; + tmem->desc = NULL; + return EINA_FALSE; } static Eina_Bool @@ -4304,6 +4447,130 @@ static const Eina_Value_Type _EINA_VALUE_TYPE_STRUCT = { _eina_value_type_struct_pget }; +static Eina_Bool +_eina_value_type_model_setup(const Eina_Value_Type *type __UNUSED__, void *mem) +{ + Eina_Model **tmem = mem; + *tmem = NULL; + return EINA_TRUE; +} + +static Eina_Bool +_eina_value_type_model_flush(const Eina_Value_Type *type __UNUSED__, void *mem) +{ + Eina_Model **tmem = mem; + if (*tmem) + { + eina_model_unref(*tmem); + *tmem = NULL; + } + return EINA_TRUE; +} + +static Eina_Bool +_eina_value_type_model_copy(const Eina_Value_Type *type __UNUSED__, const void *src, void *dst) +{ + const Eina_Model * const *s = src; + Eina_Model **d = dst; + if (*s) + *d = eina_model_copy(*s); /* is it better to deep-copy? */ + else + *d = NULL; + return EINA_TRUE; +} + +static int +_eina_value_type_model_compare(const Eina_Value_Type *type __UNUSED__, const void *a, const void *b) +{ + const Eina_Model * const *ta = a; + const Eina_Model * const *tb = b; + + if ((!*ta) && (!*tb)) return 0; + else if (!*ta) return 1; + else if (!*tb) return -1; + else return eina_model_compare(*ta, *tb); +} + +static Eina_Bool +_eina_value_type_model_convert_to(const Eina_Value_Type *type __UNUSED__, const Eina_Value_Type *convert, const void *type_mem, void *convert_mem) +{ + const Eina_Model *v = *(const Eina_Model **)type_mem; + + eina_error_set(0); + + if (convert == EINA_VALUE_TYPE_STRINGSHARE || + convert == EINA_VALUE_TYPE_STRING) + { + char *other_mem = v ? eina_model_to_string(v) : NULL; + Eina_Bool ret = eina_value_type_pset(convert, convert_mem, &other_mem); + free(other_mem); + return ret; + } + else + { + eina_error_set(EINA_ERROR_VALUE_FAILED); + return EINA_FALSE; + } + + return EINA_TRUE; +} + +static Eina_Bool +_eina_value_type_model_vset(const Eina_Value_Type *type __UNUSED__, void *mem, va_list args) +{ + Eina_Model **tmem = mem, *tmp; + + tmp = va_arg(args, Eina_Model *); + + if (tmp) eina_model_ref(tmp); + if (*tmem) eina_model_unref(*tmem); + + *tmem = tmp; + + return EINA_TRUE; +} + +static Eina_Bool +_eina_value_type_model_pset(const Eina_Value_Type *type __UNUSED__, void *mem, const void *ptr) +{ + Eina_Model **tmem = mem; + Eina_Model **p = (Eina_Model **)ptr; + + eina_error_set(0); + if (*tmem == *p) return EINA_TRUE; + + if (*p) eina_model_ref(*p); + if (*tmem) eina_model_unref(*tmem); + + *tmem = *p; + + return EINA_TRUE; +} + +static Eina_Bool +_eina_value_type_model_pget(const Eina_Value_Type *type __UNUSED__, const void *mem, void *ptr) +{ + Eina_Model **tmem = (Eina_Model **)mem; + Eina_Model **p = ptr; + *p = *tmem; + return EINA_TRUE; +} + +static const Eina_Value_Type _EINA_VALUE_TYPE_MODEL = { + EINA_VALUE_TYPE_VERSION, + sizeof(Eina_Model *), + "Eina_Model", + _eina_value_type_model_setup, + _eina_value_type_model_flush, + _eina_value_type_model_copy, + _eina_value_type_model_compare, + _eina_value_type_model_convert_to, + NULL, /* no convert from */ + _eina_value_type_model_vset, + _eina_value_type_model_pset, + _eina_value_type_model_pget +}; + /* keep all basic types inlined in an array so we can compare if it's * a basic type using pointer arithmetic. * @@ -4506,6 +4773,20 @@ static const Eina_Value_Type _EINA_VALUE_TYPE_BASICS[] = { _eina_value_type_string_vset, _eina_value_type_string_pset, _eina_value_type_string_common_pget + }, + { + EINA_VALUE_TYPE_VERSION, + sizeof(unsigned long), + "timestamp", + _eina_value_type_ulong_setup, + _eina_value_type_ulong_flush, + _eina_value_type_ulong_copy, + _eina_value_type_ulong_compare, + _eina_value_type_ulong_convert_to, + NULL, /* no convert from */ + _eina_value_type_ulong_vset, + _eina_value_type_ulong_pset, + _eina_value_type_ulong_pget } }; @@ -4722,11 +5003,12 @@ eina_value_init(void) EINA_VALUE_TYPE_DOUBLE = _EINA_VALUE_TYPE_BASICS + 11; EINA_VALUE_TYPE_STRINGSHARE = _EINA_VALUE_TYPE_BASICS + 12; EINA_VALUE_TYPE_STRING = _EINA_VALUE_TYPE_BASICS + 13; + EINA_VALUE_TYPE_TIMESTAMP = _EINA_VALUE_TYPE_BASICS + 14; _EINA_VALUE_TYPE_BASICS_START = _EINA_VALUE_TYPE_BASICS + 0; - _EINA_VALUE_TYPE_BASICS_END = _EINA_VALUE_TYPE_BASICS + 13; + _EINA_VALUE_TYPE_BASICS_END = _EINA_VALUE_TYPE_BASICS + 14; - EINA_SAFETY_ON_FALSE_RETURN_VAL((sizeof(_EINA_VALUE_TYPE_BASICS)/sizeof(_EINA_VALUE_TYPE_BASICS[0])) == 14, EINA_FALSE); + EINA_SAFETY_ON_FALSE_RETURN_VAL((sizeof(_EINA_VALUE_TYPE_BASICS)/sizeof(_EINA_VALUE_TYPE_BASICS[0])) == 15, EINA_FALSE); EINA_VALUE_TYPE_ARRAY = &_EINA_VALUE_TYPE_ARRAY; @@ -4735,6 +5017,7 @@ eina_value_init(void) EINA_VALUE_TYPE_TIMEVAL = &_EINA_VALUE_TYPE_TIMEVAL; EINA_VALUE_TYPE_BLOB = &_EINA_VALUE_TYPE_BLOB; EINA_VALUE_TYPE_STRUCT = &_EINA_VALUE_TYPE_STRUCT; + EINA_VALUE_TYPE_MODEL = &_EINA_VALUE_TYPE_MODEL; EINA_VALUE_BLOB_OPERATIONS_MALLOC = &_EINA_VALUE_BLOB_OPERATIONS_MALLOC; @@ -4800,6 +5083,7 @@ EAPI const Eina_Value_Type *EINA_VALUE_TYPE_UCHAR = NULL; EAPI const Eina_Value_Type *EINA_VALUE_TYPE_USHORT = NULL; EAPI const Eina_Value_Type *EINA_VALUE_TYPE_UINT = NULL; EAPI const Eina_Value_Type *EINA_VALUE_TYPE_ULONG = NULL; +EAPI const Eina_Value_Type *EINA_VALUE_TYPE_TIMESTAMP = NULL; EAPI const Eina_Value_Type *EINA_VALUE_TYPE_UINT64 = NULL; EAPI const Eina_Value_Type *EINA_VALUE_TYPE_CHAR = NULL; EAPI const Eina_Value_Type *EINA_VALUE_TYPE_SHORT = NULL; @@ -4816,6 +5100,7 @@ EAPI const Eina_Value_Type *EINA_VALUE_TYPE_HASH = NULL; EAPI const Eina_Value_Type *EINA_VALUE_TYPE_TIMEVAL = NULL; EAPI const Eina_Value_Type *EINA_VALUE_TYPE_BLOB = NULL; EAPI const Eina_Value_Type *EINA_VALUE_TYPE_STRUCT = NULL; +EAPI const Eina_Value_Type *EINA_VALUE_TYPE_MODEL = NULL; EAPI const Eina_Value_Blob_Operations *EINA_VALUE_BLOB_OPERATIONS_MALLOC = NULL; diff --git a/libraries/eina/src/modules/Makefile.in b/libraries/eina/src/modules/Makefile.in index 1ee8386..62d4a09 100644 --- a/libraries/eina/src/modules/Makefile.in +++ b/libraries/eina/src/modules/Makefile.in @@ -36,20 +36,24 @@ host_triplet = @host@ subdir = src/modules DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ - $(top_srcdir)/m4/efl_benchmark.m4 \ - $(top_srcdir)/m4/efl_compiler_flag.m4 \ - $(top_srcdir)/m4/efl_coverage.m4 $(top_srcdir)/m4/efl_cpu.m4 \ - $(top_srcdir)/m4/efl_doxygen.m4 \ - $(top_srcdir)/m4/efl_examples.m4 \ - $(top_srcdir)/m4/efl_fnmatch.m4 \ - $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ - $(top_srcdir)/m4/efl_threads.m4 \ - $(top_srcdir)/m4/efl_voltron.m4 $(top_srcdir)/m4/eina_bench.m4 \ - $(top_srcdir)/m4/eina_check.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/eina/eina_bench.m4 \ + $(top_srcdir)/m4/eina/eina_check.m4 \ + $(top_srcdir)/m4/common/efl_attribute.m4 \ + $(top_srcdir)/m4/common/efl_benchmark.m4 \ + $(top_srcdir)/m4/common/efl_compiler_flag.m4 \ + $(top_srcdir)/m4/common/efl_coverage.m4 \ + $(top_srcdir)/m4/common/efl_cpu.m4 \ + $(top_srcdir)/m4/common/efl_doxygen.m4 \ + $(top_srcdir)/m4/common/efl_examples.m4 \ + $(top_srcdir)/m4/common/efl_fnmatch.m4 \ + $(top_srcdir)/m4/common/efl_path_max.m4 \ + $(top_srcdir)/m4/common/efl_tests.m4 \ + $(top_srcdir)/m4/common/efl_threads.m4 \ + $(top_srcdir)/m4/common/efl_voltron.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -150,13 +154,13 @@ EINA_CONFIGURE_DEFAULT_MEMPOOL = @EINA_CONFIGURE_DEFAULT_MEMPOOL@ EINA_CONFIGURE_ENABLE_LOG = @EINA_CONFIGURE_ENABLE_LOG@ EINA_CONFIGURE_HAVE_DEBUG_THREADS = @EINA_CONFIGURE_HAVE_DEBUG_THREADS@ EINA_CONFIGURE_HAVE_DIRENT_H = @EINA_CONFIGURE_HAVE_DIRENT_H@ +EINA_CONFIGURE_HAVE_EXOTIC = @EINA_CONFIGURE_HAVE_EXOTIC@ EINA_CONFIGURE_HAVE_INTTYPES_H = @EINA_CONFIGURE_HAVE_INTTYPES_H@ EINA_CONFIGURE_HAVE_ON_OFF_THREADS = @EINA_CONFIGURE_HAVE_ON_OFF_THREADS@ EINA_CONFIGURE_HAVE_STDINT_H = @EINA_CONFIGURE_HAVE_STDINT_H@ EINA_CONFIGURE_HAVE_THREADS = @EINA_CONFIGURE_HAVE_THREADS@ EINA_CONFIGURE_MAGIC_DEBUG = @EINA_CONFIGURE_MAGIC_DEBUG@ EINA_CONFIGURE_SAFETY_CHECKS = @EINA_CONFIGURE_SAFETY_CHECKS@ -EINA_CPPFLAGS = @EINA_CPPFLAGS@ EINA_LIBS = @EINA_LIBS@ EINA_SIZEOF_WCHAR_T = @EINA_SIZEOF_WCHAR_T@ EMEMOA_CFLAGS = @EMEMOA_CFLAGS@ @@ -166,6 +170,8 @@ ESCAPE_LIBS = @ESCAPE_LIBS@ EVIL_CFLAGS = @EVIL_CFLAGS@ EVIL_LIBS = @EVIL_LIBS@ EXEEXT = @EXEEXT@ +EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ +EXOTIC_LIBS = @EXOTIC_LIBS@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ @@ -201,6 +207,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/libraries/eina/src/modules/mp/Makefile.in b/libraries/eina/src/modules/mp/Makefile.in index d3a6dd9..7283b72 100644 --- a/libraries/eina/src/modules/mp/Makefile.in +++ b/libraries/eina/src/modules/mp/Makefile.in @@ -43,20 +43,24 @@ host_triplet = @host@ subdir = src/modules/mp DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ - $(top_srcdir)/m4/efl_benchmark.m4 \ - $(top_srcdir)/m4/efl_compiler_flag.m4 \ - $(top_srcdir)/m4/efl_coverage.m4 $(top_srcdir)/m4/efl_cpu.m4 \ - $(top_srcdir)/m4/efl_doxygen.m4 \ - $(top_srcdir)/m4/efl_examples.m4 \ - $(top_srcdir)/m4/efl_fnmatch.m4 \ - $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ - $(top_srcdir)/m4/efl_threads.m4 \ - $(top_srcdir)/m4/efl_voltron.m4 $(top_srcdir)/m4/eina_bench.m4 \ - $(top_srcdir)/m4/eina_check.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/eina/eina_bench.m4 \ + $(top_srcdir)/m4/eina/eina_check.m4 \ + $(top_srcdir)/m4/common/efl_attribute.m4 \ + $(top_srcdir)/m4/common/efl_benchmark.m4 \ + $(top_srcdir)/m4/common/efl_compiler_flag.m4 \ + $(top_srcdir)/m4/common/efl_coverage.m4 \ + $(top_srcdir)/m4/common/efl_cpu.m4 \ + $(top_srcdir)/m4/common/efl_doxygen.m4 \ + $(top_srcdir)/m4/common/efl_examples.m4 \ + $(top_srcdir)/m4/common/efl_fnmatch.m4 \ + $(top_srcdir)/m4/common/efl_path_max.m4 \ + $(top_srcdir)/m4/common/efl_tests.m4 \ + $(top_srcdir)/m4/common/efl_threads.m4 \ + $(top_srcdir)/m4/common/efl_voltron.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -158,13 +162,13 @@ EINA_CONFIGURE_DEFAULT_MEMPOOL = @EINA_CONFIGURE_DEFAULT_MEMPOOL@ EINA_CONFIGURE_ENABLE_LOG = @EINA_CONFIGURE_ENABLE_LOG@ EINA_CONFIGURE_HAVE_DEBUG_THREADS = @EINA_CONFIGURE_HAVE_DEBUG_THREADS@ EINA_CONFIGURE_HAVE_DIRENT_H = @EINA_CONFIGURE_HAVE_DIRENT_H@ +EINA_CONFIGURE_HAVE_EXOTIC = @EINA_CONFIGURE_HAVE_EXOTIC@ EINA_CONFIGURE_HAVE_INTTYPES_H = @EINA_CONFIGURE_HAVE_INTTYPES_H@ EINA_CONFIGURE_HAVE_ON_OFF_THREADS = @EINA_CONFIGURE_HAVE_ON_OFF_THREADS@ EINA_CONFIGURE_HAVE_STDINT_H = @EINA_CONFIGURE_HAVE_STDINT_H@ EINA_CONFIGURE_HAVE_THREADS = @EINA_CONFIGURE_HAVE_THREADS@ EINA_CONFIGURE_MAGIC_DEBUG = @EINA_CONFIGURE_MAGIC_DEBUG@ EINA_CONFIGURE_SAFETY_CHECKS = @EINA_CONFIGURE_SAFETY_CHECKS@ -EINA_CPPFLAGS = @EINA_CPPFLAGS@ EINA_LIBS = @EINA_LIBS@ EINA_SIZEOF_WCHAR_T = @EINA_SIZEOF_WCHAR_T@ EMEMOA_CFLAGS = @EMEMOA_CFLAGS@ @@ -174,6 +178,8 @@ ESCAPE_LIBS = @ESCAPE_LIBS@ EVIL_CFLAGS = @EVIL_CFLAGS@ EVIL_LIBS = @EVIL_LIBS@ EXEEXT = @EXEEXT@ +EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ +EXOTIC_LIBS = @EXOTIC_LIBS@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ @@ -209,6 +215,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ diff --git a/libraries/eina/src/modules/mp/buddy/Makefile.am b/libraries/eina/src/modules/mp/buddy/Makefile.am index c699c9d..c0a6cd7 100644 --- a/libraries/eina/src/modules/mp/buddy/Makefile.am +++ b/libraries/eina/src/modules/mp/buddy/Makefile.am @@ -6,7 +6,6 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/include \ -I$(top_srcdir)/src/lib \ -I$(top_builddir)/src/lib \ -@EINA_CPPFLAGS@ \ @EFL_EINA_BUILD@ controllerdir = $(libdir)/eina/modules/mp/buddy/$(MODULE_ARCH) diff --git a/libraries/eina/src/modules/mp/buddy/Makefile.in b/libraries/eina/src/modules/mp/buddy/Makefile.in index 5619b2c..449c511 100644 --- a/libraries/eina/src/modules/mp/buddy/Makefile.in +++ b/libraries/eina/src/modules/mp/buddy/Makefile.in @@ -37,20 +37,24 @@ host_triplet = @host@ subdir = src/modules/mp/buddy DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ - $(top_srcdir)/m4/efl_benchmark.m4 \ - $(top_srcdir)/m4/efl_compiler_flag.m4 \ - $(top_srcdir)/m4/efl_coverage.m4 $(top_srcdir)/m4/efl_cpu.m4 \ - $(top_srcdir)/m4/efl_doxygen.m4 \ - $(top_srcdir)/m4/efl_examples.m4 \ - $(top_srcdir)/m4/efl_fnmatch.m4 \ - $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ - $(top_srcdir)/m4/efl_threads.m4 \ - $(top_srcdir)/m4/efl_voltron.m4 $(top_srcdir)/m4/eina_bench.m4 \ - $(top_srcdir)/m4/eina_check.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/eina/eina_bench.m4 \ + $(top_srcdir)/m4/eina/eina_check.m4 \ + $(top_srcdir)/m4/common/efl_attribute.m4 \ + $(top_srcdir)/m4/common/efl_benchmark.m4 \ + $(top_srcdir)/m4/common/efl_compiler_flag.m4 \ + $(top_srcdir)/m4/common/efl_coverage.m4 \ + $(top_srcdir)/m4/common/efl_cpu.m4 \ + $(top_srcdir)/m4/common/efl_doxygen.m4 \ + $(top_srcdir)/m4/common/efl_examples.m4 \ + $(top_srcdir)/m4/common/efl_fnmatch.m4 \ + $(top_srcdir)/m4/common/efl_path_max.m4 \ + $(top_srcdir)/m4/common/efl_tests.m4 \ + $(top_srcdir)/m4/common/efl_threads.m4 \ + $(top_srcdir)/m4/common/efl_voltron.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -166,13 +170,13 @@ EINA_CONFIGURE_DEFAULT_MEMPOOL = @EINA_CONFIGURE_DEFAULT_MEMPOOL@ EINA_CONFIGURE_ENABLE_LOG = @EINA_CONFIGURE_ENABLE_LOG@ EINA_CONFIGURE_HAVE_DEBUG_THREADS = @EINA_CONFIGURE_HAVE_DEBUG_THREADS@ EINA_CONFIGURE_HAVE_DIRENT_H = @EINA_CONFIGURE_HAVE_DIRENT_H@ +EINA_CONFIGURE_HAVE_EXOTIC = @EINA_CONFIGURE_HAVE_EXOTIC@ EINA_CONFIGURE_HAVE_INTTYPES_H = @EINA_CONFIGURE_HAVE_INTTYPES_H@ EINA_CONFIGURE_HAVE_ON_OFF_THREADS = @EINA_CONFIGURE_HAVE_ON_OFF_THREADS@ EINA_CONFIGURE_HAVE_STDINT_H = @EINA_CONFIGURE_HAVE_STDINT_H@ EINA_CONFIGURE_HAVE_THREADS = @EINA_CONFIGURE_HAVE_THREADS@ EINA_CONFIGURE_MAGIC_DEBUG = @EINA_CONFIGURE_MAGIC_DEBUG@ EINA_CONFIGURE_SAFETY_CHECKS = @EINA_CONFIGURE_SAFETY_CHECKS@ -EINA_CPPFLAGS = @EINA_CPPFLAGS@ EINA_LIBS = @EINA_LIBS@ EINA_SIZEOF_WCHAR_T = @EINA_SIZEOF_WCHAR_T@ EMEMOA_CFLAGS = @EMEMOA_CFLAGS@ @@ -182,6 +186,8 @@ ESCAPE_LIBS = @ESCAPE_LIBS@ EVIL_CFLAGS = @EVIL_CFLAGS@ EVIL_LIBS = @EVIL_LIBS@ EXEEXT = @EXEEXT@ +EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ +EXOTIC_LIBS = @EXOTIC_LIBS@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ @@ -217,6 +223,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -297,7 +305,6 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/include \ -I$(top_srcdir)/src/lib \ -I$(top_builddir)/src/lib \ -@EINA_CPPFLAGS@ \ @EFL_EINA_BUILD@ controllerdir = $(libdir)/eina/modules/mp/buddy/$(MODULE_ARCH) diff --git a/libraries/eina/src/modules/mp/chained_pool/Makefile.am b/libraries/eina/src/modules/mp/chained_pool/Makefile.am index 815bab7..42d0d7e 100644 --- a/libraries/eina/src/modules/mp/chained_pool/Makefile.am +++ b/libraries/eina/src/modules/mp/chained_pool/Makefile.am @@ -6,7 +6,6 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/include \ -I$(top_srcdir)/src/lib \ -I$(top_builddir)/src/lib \ -@EINA_CPPFLAGS@ \ @EFL_EINA_BUILD@ \ @VALGRIND_CFLAGS@ diff --git a/libraries/eina/src/modules/mp/chained_pool/Makefile.in b/libraries/eina/src/modules/mp/chained_pool/Makefile.in index 03b639f..78299a4 100644 --- a/libraries/eina/src/modules/mp/chained_pool/Makefile.in +++ b/libraries/eina/src/modules/mp/chained_pool/Makefile.in @@ -37,20 +37,24 @@ host_triplet = @host@ subdir = src/modules/mp/chained_pool DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ - $(top_srcdir)/m4/efl_benchmark.m4 \ - $(top_srcdir)/m4/efl_compiler_flag.m4 \ - $(top_srcdir)/m4/efl_coverage.m4 $(top_srcdir)/m4/efl_cpu.m4 \ - $(top_srcdir)/m4/efl_doxygen.m4 \ - $(top_srcdir)/m4/efl_examples.m4 \ - $(top_srcdir)/m4/efl_fnmatch.m4 \ - $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ - $(top_srcdir)/m4/efl_threads.m4 \ - $(top_srcdir)/m4/efl_voltron.m4 $(top_srcdir)/m4/eina_bench.m4 \ - $(top_srcdir)/m4/eina_check.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/eina/eina_bench.m4 \ + $(top_srcdir)/m4/eina/eina_check.m4 \ + $(top_srcdir)/m4/common/efl_attribute.m4 \ + $(top_srcdir)/m4/common/efl_benchmark.m4 \ + $(top_srcdir)/m4/common/efl_compiler_flag.m4 \ + $(top_srcdir)/m4/common/efl_coverage.m4 \ + $(top_srcdir)/m4/common/efl_cpu.m4 \ + $(top_srcdir)/m4/common/efl_doxygen.m4 \ + $(top_srcdir)/m4/common/efl_examples.m4 \ + $(top_srcdir)/m4/common/efl_fnmatch.m4 \ + $(top_srcdir)/m4/common/efl_path_max.m4 \ + $(top_srcdir)/m4/common/efl_tests.m4 \ + $(top_srcdir)/m4/common/efl_threads.m4 \ + $(top_srcdir)/m4/common/efl_voltron.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -166,13 +170,13 @@ EINA_CONFIGURE_DEFAULT_MEMPOOL = @EINA_CONFIGURE_DEFAULT_MEMPOOL@ EINA_CONFIGURE_ENABLE_LOG = @EINA_CONFIGURE_ENABLE_LOG@ EINA_CONFIGURE_HAVE_DEBUG_THREADS = @EINA_CONFIGURE_HAVE_DEBUG_THREADS@ EINA_CONFIGURE_HAVE_DIRENT_H = @EINA_CONFIGURE_HAVE_DIRENT_H@ +EINA_CONFIGURE_HAVE_EXOTIC = @EINA_CONFIGURE_HAVE_EXOTIC@ EINA_CONFIGURE_HAVE_INTTYPES_H = @EINA_CONFIGURE_HAVE_INTTYPES_H@ EINA_CONFIGURE_HAVE_ON_OFF_THREADS = @EINA_CONFIGURE_HAVE_ON_OFF_THREADS@ EINA_CONFIGURE_HAVE_STDINT_H = @EINA_CONFIGURE_HAVE_STDINT_H@ EINA_CONFIGURE_HAVE_THREADS = @EINA_CONFIGURE_HAVE_THREADS@ EINA_CONFIGURE_MAGIC_DEBUG = @EINA_CONFIGURE_MAGIC_DEBUG@ EINA_CONFIGURE_SAFETY_CHECKS = @EINA_CONFIGURE_SAFETY_CHECKS@ -EINA_CPPFLAGS = @EINA_CPPFLAGS@ EINA_LIBS = @EINA_LIBS@ EINA_SIZEOF_WCHAR_T = @EINA_SIZEOF_WCHAR_T@ EMEMOA_CFLAGS = @EMEMOA_CFLAGS@ @@ -182,6 +186,8 @@ ESCAPE_LIBS = @ESCAPE_LIBS@ EVIL_CFLAGS = @EVIL_CFLAGS@ EVIL_LIBS = @EVIL_LIBS@ EXEEXT = @EXEEXT@ +EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ +EXOTIC_LIBS = @EXOTIC_LIBS@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ @@ -217,6 +223,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -297,7 +305,6 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/include \ -I$(top_srcdir)/src/lib \ -I$(top_builddir)/src/lib \ -@EINA_CPPFLAGS@ \ @EFL_EINA_BUILD@ \ @VALGRIND_CFLAGS@ diff --git a/libraries/eina/src/modules/mp/chained_pool/eina_chained_mempool.c b/libraries/eina/src/modules/mp/chained_pool/eina_chained_mempool.c index 020d0ad..e56df4c 100644 --- a/libraries/eina/src/modules/mp/chained_pool/eina_chained_mempool.c +++ b/libraries/eina/src/modules/mp/chained_pool/eina_chained_mempool.c @@ -52,7 +52,7 @@ #include "eina_private.h" #ifndef NVALGRIND -# include +# include #endif #if defined DEBUG || defined EINA_DEBUG_MALLOC diff --git a/libraries/eina/src/modules/mp/ememoa_fixed/Makefile.am b/libraries/eina/src/modules/mp/ememoa_fixed/Makefile.am index 4a27b3e..242b446 100644 --- a/libraries/eina/src/modules/mp/ememoa_fixed/Makefile.am +++ b/libraries/eina/src/modules/mp/ememoa_fixed/Makefile.am @@ -6,7 +6,6 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/include \ -I$(top_srcdir)/src/lib \ -I$(top_builddir)/src/lib \ -@EINA_CPPFLAGS@ \ @EMEMOA_CFLAGS@ \ @EFL_EINA_BUILD@ diff --git a/libraries/eina/src/modules/mp/ememoa_fixed/Makefile.in b/libraries/eina/src/modules/mp/ememoa_fixed/Makefile.in index ccc4f1a..d16d123 100644 --- a/libraries/eina/src/modules/mp/ememoa_fixed/Makefile.in +++ b/libraries/eina/src/modules/mp/ememoa_fixed/Makefile.in @@ -37,20 +37,24 @@ host_triplet = @host@ subdir = src/modules/mp/ememoa_fixed DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ - $(top_srcdir)/m4/efl_benchmark.m4 \ - $(top_srcdir)/m4/efl_compiler_flag.m4 \ - $(top_srcdir)/m4/efl_coverage.m4 $(top_srcdir)/m4/efl_cpu.m4 \ - $(top_srcdir)/m4/efl_doxygen.m4 \ - $(top_srcdir)/m4/efl_examples.m4 \ - $(top_srcdir)/m4/efl_fnmatch.m4 \ - $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ - $(top_srcdir)/m4/efl_threads.m4 \ - $(top_srcdir)/m4/efl_voltron.m4 $(top_srcdir)/m4/eina_bench.m4 \ - $(top_srcdir)/m4/eina_check.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/eina/eina_bench.m4 \ + $(top_srcdir)/m4/eina/eina_check.m4 \ + $(top_srcdir)/m4/common/efl_attribute.m4 \ + $(top_srcdir)/m4/common/efl_benchmark.m4 \ + $(top_srcdir)/m4/common/efl_compiler_flag.m4 \ + $(top_srcdir)/m4/common/efl_coverage.m4 \ + $(top_srcdir)/m4/common/efl_cpu.m4 \ + $(top_srcdir)/m4/common/efl_doxygen.m4 \ + $(top_srcdir)/m4/common/efl_examples.m4 \ + $(top_srcdir)/m4/common/efl_fnmatch.m4 \ + $(top_srcdir)/m4/common/efl_path_max.m4 \ + $(top_srcdir)/m4/common/efl_tests.m4 \ + $(top_srcdir)/m4/common/efl_threads.m4 \ + $(top_srcdir)/m4/common/efl_voltron.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -166,13 +170,13 @@ EINA_CONFIGURE_DEFAULT_MEMPOOL = @EINA_CONFIGURE_DEFAULT_MEMPOOL@ EINA_CONFIGURE_ENABLE_LOG = @EINA_CONFIGURE_ENABLE_LOG@ EINA_CONFIGURE_HAVE_DEBUG_THREADS = @EINA_CONFIGURE_HAVE_DEBUG_THREADS@ EINA_CONFIGURE_HAVE_DIRENT_H = @EINA_CONFIGURE_HAVE_DIRENT_H@ +EINA_CONFIGURE_HAVE_EXOTIC = @EINA_CONFIGURE_HAVE_EXOTIC@ EINA_CONFIGURE_HAVE_INTTYPES_H = @EINA_CONFIGURE_HAVE_INTTYPES_H@ EINA_CONFIGURE_HAVE_ON_OFF_THREADS = @EINA_CONFIGURE_HAVE_ON_OFF_THREADS@ EINA_CONFIGURE_HAVE_STDINT_H = @EINA_CONFIGURE_HAVE_STDINT_H@ EINA_CONFIGURE_HAVE_THREADS = @EINA_CONFIGURE_HAVE_THREADS@ EINA_CONFIGURE_MAGIC_DEBUG = @EINA_CONFIGURE_MAGIC_DEBUG@ EINA_CONFIGURE_SAFETY_CHECKS = @EINA_CONFIGURE_SAFETY_CHECKS@ -EINA_CPPFLAGS = @EINA_CPPFLAGS@ EINA_LIBS = @EINA_LIBS@ EINA_SIZEOF_WCHAR_T = @EINA_SIZEOF_WCHAR_T@ EMEMOA_CFLAGS = @EMEMOA_CFLAGS@ @@ -182,6 +186,8 @@ ESCAPE_LIBS = @ESCAPE_LIBS@ EVIL_CFLAGS = @EVIL_CFLAGS@ EVIL_LIBS = @EVIL_LIBS@ EXEEXT = @EXEEXT@ +EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ +EXOTIC_LIBS = @EXOTIC_LIBS@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ @@ -217,6 +223,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -297,7 +305,6 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/include \ -I$(top_srcdir)/src/lib \ -I$(top_builddir)/src/lib \ -@EINA_CPPFLAGS@ \ @EMEMOA_CFLAGS@ \ @EFL_EINA_BUILD@ diff --git a/libraries/eina/src/modules/mp/ememoa_unknown/Makefile.am b/libraries/eina/src/modules/mp/ememoa_unknown/Makefile.am index 2814e31..249541a 100644 --- a/libraries/eina/src/modules/mp/ememoa_unknown/Makefile.am +++ b/libraries/eina/src/modules/mp/ememoa_unknown/Makefile.am @@ -6,7 +6,6 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/include \ -I$(top_srcdir)/src/lib \ -I$(top_builddir)/src/lib \ -@EINA_CPPFLAGS@ \ @EMEMOA_CFLAGS@ \ @EFL_EINA_BUILD@ diff --git a/libraries/eina/src/modules/mp/ememoa_unknown/Makefile.in b/libraries/eina/src/modules/mp/ememoa_unknown/Makefile.in index 8b0ec6e..18a43a5 100644 --- a/libraries/eina/src/modules/mp/ememoa_unknown/Makefile.in +++ b/libraries/eina/src/modules/mp/ememoa_unknown/Makefile.in @@ -37,20 +37,24 @@ host_triplet = @host@ subdir = src/modules/mp/ememoa_unknown DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ - $(top_srcdir)/m4/efl_benchmark.m4 \ - $(top_srcdir)/m4/efl_compiler_flag.m4 \ - $(top_srcdir)/m4/efl_coverage.m4 $(top_srcdir)/m4/efl_cpu.m4 \ - $(top_srcdir)/m4/efl_doxygen.m4 \ - $(top_srcdir)/m4/efl_examples.m4 \ - $(top_srcdir)/m4/efl_fnmatch.m4 \ - $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ - $(top_srcdir)/m4/efl_threads.m4 \ - $(top_srcdir)/m4/efl_voltron.m4 $(top_srcdir)/m4/eina_bench.m4 \ - $(top_srcdir)/m4/eina_check.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/eina/eina_bench.m4 \ + $(top_srcdir)/m4/eina/eina_check.m4 \ + $(top_srcdir)/m4/common/efl_attribute.m4 \ + $(top_srcdir)/m4/common/efl_benchmark.m4 \ + $(top_srcdir)/m4/common/efl_compiler_flag.m4 \ + $(top_srcdir)/m4/common/efl_coverage.m4 \ + $(top_srcdir)/m4/common/efl_cpu.m4 \ + $(top_srcdir)/m4/common/efl_doxygen.m4 \ + $(top_srcdir)/m4/common/efl_examples.m4 \ + $(top_srcdir)/m4/common/efl_fnmatch.m4 \ + $(top_srcdir)/m4/common/efl_path_max.m4 \ + $(top_srcdir)/m4/common/efl_tests.m4 \ + $(top_srcdir)/m4/common/efl_threads.m4 \ + $(top_srcdir)/m4/common/efl_voltron.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -166,13 +170,13 @@ EINA_CONFIGURE_DEFAULT_MEMPOOL = @EINA_CONFIGURE_DEFAULT_MEMPOOL@ EINA_CONFIGURE_ENABLE_LOG = @EINA_CONFIGURE_ENABLE_LOG@ EINA_CONFIGURE_HAVE_DEBUG_THREADS = @EINA_CONFIGURE_HAVE_DEBUG_THREADS@ EINA_CONFIGURE_HAVE_DIRENT_H = @EINA_CONFIGURE_HAVE_DIRENT_H@ +EINA_CONFIGURE_HAVE_EXOTIC = @EINA_CONFIGURE_HAVE_EXOTIC@ EINA_CONFIGURE_HAVE_INTTYPES_H = @EINA_CONFIGURE_HAVE_INTTYPES_H@ EINA_CONFIGURE_HAVE_ON_OFF_THREADS = @EINA_CONFIGURE_HAVE_ON_OFF_THREADS@ EINA_CONFIGURE_HAVE_STDINT_H = @EINA_CONFIGURE_HAVE_STDINT_H@ EINA_CONFIGURE_HAVE_THREADS = @EINA_CONFIGURE_HAVE_THREADS@ EINA_CONFIGURE_MAGIC_DEBUG = @EINA_CONFIGURE_MAGIC_DEBUG@ EINA_CONFIGURE_SAFETY_CHECKS = @EINA_CONFIGURE_SAFETY_CHECKS@ -EINA_CPPFLAGS = @EINA_CPPFLAGS@ EINA_LIBS = @EINA_LIBS@ EINA_SIZEOF_WCHAR_T = @EINA_SIZEOF_WCHAR_T@ EMEMOA_CFLAGS = @EMEMOA_CFLAGS@ @@ -182,6 +186,8 @@ ESCAPE_LIBS = @ESCAPE_LIBS@ EVIL_CFLAGS = @EVIL_CFLAGS@ EVIL_LIBS = @EVIL_LIBS@ EXEEXT = @EXEEXT@ +EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ +EXOTIC_LIBS = @EXOTIC_LIBS@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ @@ -217,6 +223,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -297,7 +305,6 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/include \ -I$(top_srcdir)/src/lib \ -I$(top_builddir)/src/lib \ -@EINA_CPPFLAGS@ \ @EMEMOA_CFLAGS@ \ @EFL_EINA_BUILD@ diff --git a/libraries/eina/src/modules/mp/fixed_bitmap/Makefile.am b/libraries/eina/src/modules/mp/fixed_bitmap/Makefile.am index caf239e..1f2527b 100644 --- a/libraries/eina/src/modules/mp/fixed_bitmap/Makefile.am +++ b/libraries/eina/src/modules/mp/fixed_bitmap/Makefile.am @@ -6,7 +6,6 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/include \ -I$(top_srcdir)/src/lib \ -I$(top_builddir)/src/lib \ -@EINA_CPPFLAGS@ \ @EFL_EINA_BUILD@ controllerdir = $(libdir)/eina/modules/mp/fixed_bitmap/$(MODULE_ARCH) diff --git a/libraries/eina/src/modules/mp/fixed_bitmap/Makefile.in b/libraries/eina/src/modules/mp/fixed_bitmap/Makefile.in index 337f820..2a6b782 100644 --- a/libraries/eina/src/modules/mp/fixed_bitmap/Makefile.in +++ b/libraries/eina/src/modules/mp/fixed_bitmap/Makefile.in @@ -37,20 +37,24 @@ host_triplet = @host@ subdir = src/modules/mp/fixed_bitmap DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ - $(top_srcdir)/m4/efl_benchmark.m4 \ - $(top_srcdir)/m4/efl_compiler_flag.m4 \ - $(top_srcdir)/m4/efl_coverage.m4 $(top_srcdir)/m4/efl_cpu.m4 \ - $(top_srcdir)/m4/efl_doxygen.m4 \ - $(top_srcdir)/m4/efl_examples.m4 \ - $(top_srcdir)/m4/efl_fnmatch.m4 \ - $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ - $(top_srcdir)/m4/efl_threads.m4 \ - $(top_srcdir)/m4/efl_voltron.m4 $(top_srcdir)/m4/eina_bench.m4 \ - $(top_srcdir)/m4/eina_check.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/eina/eina_bench.m4 \ + $(top_srcdir)/m4/eina/eina_check.m4 \ + $(top_srcdir)/m4/common/efl_attribute.m4 \ + $(top_srcdir)/m4/common/efl_benchmark.m4 \ + $(top_srcdir)/m4/common/efl_compiler_flag.m4 \ + $(top_srcdir)/m4/common/efl_coverage.m4 \ + $(top_srcdir)/m4/common/efl_cpu.m4 \ + $(top_srcdir)/m4/common/efl_doxygen.m4 \ + $(top_srcdir)/m4/common/efl_examples.m4 \ + $(top_srcdir)/m4/common/efl_fnmatch.m4 \ + $(top_srcdir)/m4/common/efl_path_max.m4 \ + $(top_srcdir)/m4/common/efl_tests.m4 \ + $(top_srcdir)/m4/common/efl_threads.m4 \ + $(top_srcdir)/m4/common/efl_voltron.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -166,13 +170,13 @@ EINA_CONFIGURE_DEFAULT_MEMPOOL = @EINA_CONFIGURE_DEFAULT_MEMPOOL@ EINA_CONFIGURE_ENABLE_LOG = @EINA_CONFIGURE_ENABLE_LOG@ EINA_CONFIGURE_HAVE_DEBUG_THREADS = @EINA_CONFIGURE_HAVE_DEBUG_THREADS@ EINA_CONFIGURE_HAVE_DIRENT_H = @EINA_CONFIGURE_HAVE_DIRENT_H@ +EINA_CONFIGURE_HAVE_EXOTIC = @EINA_CONFIGURE_HAVE_EXOTIC@ EINA_CONFIGURE_HAVE_INTTYPES_H = @EINA_CONFIGURE_HAVE_INTTYPES_H@ EINA_CONFIGURE_HAVE_ON_OFF_THREADS = @EINA_CONFIGURE_HAVE_ON_OFF_THREADS@ EINA_CONFIGURE_HAVE_STDINT_H = @EINA_CONFIGURE_HAVE_STDINT_H@ EINA_CONFIGURE_HAVE_THREADS = @EINA_CONFIGURE_HAVE_THREADS@ EINA_CONFIGURE_MAGIC_DEBUG = @EINA_CONFIGURE_MAGIC_DEBUG@ EINA_CONFIGURE_SAFETY_CHECKS = @EINA_CONFIGURE_SAFETY_CHECKS@ -EINA_CPPFLAGS = @EINA_CPPFLAGS@ EINA_LIBS = @EINA_LIBS@ EINA_SIZEOF_WCHAR_T = @EINA_SIZEOF_WCHAR_T@ EMEMOA_CFLAGS = @EMEMOA_CFLAGS@ @@ -182,6 +186,8 @@ ESCAPE_LIBS = @ESCAPE_LIBS@ EVIL_CFLAGS = @EVIL_CFLAGS@ EVIL_LIBS = @EVIL_LIBS@ EXEEXT = @EXEEXT@ +EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ +EXOTIC_LIBS = @EXOTIC_LIBS@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ @@ -217,6 +223,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -297,7 +305,6 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/include \ -I$(top_srcdir)/src/lib \ -I$(top_builddir)/src/lib \ -@EINA_CPPFLAGS@ \ @EFL_EINA_BUILD@ controllerdir = $(libdir)/eina/modules/mp/fixed_bitmap/$(MODULE_ARCH) diff --git a/libraries/eina/src/modules/mp/one_big/Makefile.am b/libraries/eina/src/modules/mp/one_big/Makefile.am index 8ca1a62..35069a2 100644 --- a/libraries/eina/src/modules/mp/one_big/Makefile.am +++ b/libraries/eina/src/modules/mp/one_big/Makefile.am @@ -6,7 +6,6 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/include \ -I$(top_srcdir)/src/lib \ -I$(top_builddir)/src/lib \ -@EINA_CPPFLAGS@ \ @EFL_EINA_BUILD@ \ @VALGRIND_CFLAGS@ diff --git a/libraries/eina/src/modules/mp/one_big/Makefile.in b/libraries/eina/src/modules/mp/one_big/Makefile.in index c8560c9..4a2c229 100644 --- a/libraries/eina/src/modules/mp/one_big/Makefile.in +++ b/libraries/eina/src/modules/mp/one_big/Makefile.in @@ -37,20 +37,24 @@ host_triplet = @host@ subdir = src/modules/mp/one_big DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ - $(top_srcdir)/m4/efl_benchmark.m4 \ - $(top_srcdir)/m4/efl_compiler_flag.m4 \ - $(top_srcdir)/m4/efl_coverage.m4 $(top_srcdir)/m4/efl_cpu.m4 \ - $(top_srcdir)/m4/efl_doxygen.m4 \ - $(top_srcdir)/m4/efl_examples.m4 \ - $(top_srcdir)/m4/efl_fnmatch.m4 \ - $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ - $(top_srcdir)/m4/efl_threads.m4 \ - $(top_srcdir)/m4/efl_voltron.m4 $(top_srcdir)/m4/eina_bench.m4 \ - $(top_srcdir)/m4/eina_check.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/eina/eina_bench.m4 \ + $(top_srcdir)/m4/eina/eina_check.m4 \ + $(top_srcdir)/m4/common/efl_attribute.m4 \ + $(top_srcdir)/m4/common/efl_benchmark.m4 \ + $(top_srcdir)/m4/common/efl_compiler_flag.m4 \ + $(top_srcdir)/m4/common/efl_coverage.m4 \ + $(top_srcdir)/m4/common/efl_cpu.m4 \ + $(top_srcdir)/m4/common/efl_doxygen.m4 \ + $(top_srcdir)/m4/common/efl_examples.m4 \ + $(top_srcdir)/m4/common/efl_fnmatch.m4 \ + $(top_srcdir)/m4/common/efl_path_max.m4 \ + $(top_srcdir)/m4/common/efl_tests.m4 \ + $(top_srcdir)/m4/common/efl_threads.m4 \ + $(top_srcdir)/m4/common/efl_voltron.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -166,13 +170,13 @@ EINA_CONFIGURE_DEFAULT_MEMPOOL = @EINA_CONFIGURE_DEFAULT_MEMPOOL@ EINA_CONFIGURE_ENABLE_LOG = @EINA_CONFIGURE_ENABLE_LOG@ EINA_CONFIGURE_HAVE_DEBUG_THREADS = @EINA_CONFIGURE_HAVE_DEBUG_THREADS@ EINA_CONFIGURE_HAVE_DIRENT_H = @EINA_CONFIGURE_HAVE_DIRENT_H@ +EINA_CONFIGURE_HAVE_EXOTIC = @EINA_CONFIGURE_HAVE_EXOTIC@ EINA_CONFIGURE_HAVE_INTTYPES_H = @EINA_CONFIGURE_HAVE_INTTYPES_H@ EINA_CONFIGURE_HAVE_ON_OFF_THREADS = @EINA_CONFIGURE_HAVE_ON_OFF_THREADS@ EINA_CONFIGURE_HAVE_STDINT_H = @EINA_CONFIGURE_HAVE_STDINT_H@ EINA_CONFIGURE_HAVE_THREADS = @EINA_CONFIGURE_HAVE_THREADS@ EINA_CONFIGURE_MAGIC_DEBUG = @EINA_CONFIGURE_MAGIC_DEBUG@ EINA_CONFIGURE_SAFETY_CHECKS = @EINA_CONFIGURE_SAFETY_CHECKS@ -EINA_CPPFLAGS = @EINA_CPPFLAGS@ EINA_LIBS = @EINA_LIBS@ EINA_SIZEOF_WCHAR_T = @EINA_SIZEOF_WCHAR_T@ EMEMOA_CFLAGS = @EMEMOA_CFLAGS@ @@ -182,6 +186,8 @@ ESCAPE_LIBS = @ESCAPE_LIBS@ EVIL_CFLAGS = @EVIL_CFLAGS@ EVIL_LIBS = @EVIL_LIBS@ EXEEXT = @EXEEXT@ +EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ +EXOTIC_LIBS = @EXOTIC_LIBS@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ @@ -217,6 +223,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -297,7 +305,6 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/include \ -I$(top_srcdir)/src/lib \ -I$(top_builddir)/src/lib \ -@EINA_CPPFLAGS@ \ @EFL_EINA_BUILD@ \ @VALGRIND_CFLAGS@ diff --git a/libraries/eina/src/modules/mp/one_big/eina_one_big.c b/libraries/eina/src/modules/mp/one_big/eina_one_big.c index dadec65..1159378 100644 --- a/libraries/eina/src/modules/mp/one_big/eina_one_big.c +++ b/libraries/eina/src/modules/mp/one_big/eina_one_big.c @@ -42,7 +42,7 @@ #include "eina_lock.h" #ifndef NVALGRIND -# include +# include #endif #include "eina_private.h" diff --git a/libraries/eina/src/modules/mp/pass_through/Makefile.am b/libraries/eina/src/modules/mp/pass_through/Makefile.am index 8f48974..33bd58c 100644 --- a/libraries/eina/src/modules/mp/pass_through/Makefile.am +++ b/libraries/eina/src/modules/mp/pass_through/Makefile.am @@ -6,7 +6,6 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/include \ -I$(top_srcdir)/src/lib \ -I$(top_builddir)/src/lib \ -@EINA_CPPFLAGS@ \ @EFL_EINA_BUILD@ controllerdir = $(libdir)//eina/modules/mp/pass_through/$(MODULE_ARCH) diff --git a/libraries/eina/src/modules/mp/pass_through/Makefile.in b/libraries/eina/src/modules/mp/pass_through/Makefile.in index f5664be..5c84e6b 100644 --- a/libraries/eina/src/modules/mp/pass_through/Makefile.in +++ b/libraries/eina/src/modules/mp/pass_through/Makefile.in @@ -37,20 +37,24 @@ host_triplet = @host@ subdir = src/modules/mp/pass_through DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ - $(top_srcdir)/m4/efl_benchmark.m4 \ - $(top_srcdir)/m4/efl_compiler_flag.m4 \ - $(top_srcdir)/m4/efl_coverage.m4 $(top_srcdir)/m4/efl_cpu.m4 \ - $(top_srcdir)/m4/efl_doxygen.m4 \ - $(top_srcdir)/m4/efl_examples.m4 \ - $(top_srcdir)/m4/efl_fnmatch.m4 \ - $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ - $(top_srcdir)/m4/efl_threads.m4 \ - $(top_srcdir)/m4/efl_voltron.m4 $(top_srcdir)/m4/eina_bench.m4 \ - $(top_srcdir)/m4/eina_check.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/eina/eina_bench.m4 \ + $(top_srcdir)/m4/eina/eina_check.m4 \ + $(top_srcdir)/m4/common/efl_attribute.m4 \ + $(top_srcdir)/m4/common/efl_benchmark.m4 \ + $(top_srcdir)/m4/common/efl_compiler_flag.m4 \ + $(top_srcdir)/m4/common/efl_coverage.m4 \ + $(top_srcdir)/m4/common/efl_cpu.m4 \ + $(top_srcdir)/m4/common/efl_doxygen.m4 \ + $(top_srcdir)/m4/common/efl_examples.m4 \ + $(top_srcdir)/m4/common/efl_fnmatch.m4 \ + $(top_srcdir)/m4/common/efl_path_max.m4 \ + $(top_srcdir)/m4/common/efl_tests.m4 \ + $(top_srcdir)/m4/common/efl_threads.m4 \ + $(top_srcdir)/m4/common/efl_voltron.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -166,13 +170,13 @@ EINA_CONFIGURE_DEFAULT_MEMPOOL = @EINA_CONFIGURE_DEFAULT_MEMPOOL@ EINA_CONFIGURE_ENABLE_LOG = @EINA_CONFIGURE_ENABLE_LOG@ EINA_CONFIGURE_HAVE_DEBUG_THREADS = @EINA_CONFIGURE_HAVE_DEBUG_THREADS@ EINA_CONFIGURE_HAVE_DIRENT_H = @EINA_CONFIGURE_HAVE_DIRENT_H@ +EINA_CONFIGURE_HAVE_EXOTIC = @EINA_CONFIGURE_HAVE_EXOTIC@ EINA_CONFIGURE_HAVE_INTTYPES_H = @EINA_CONFIGURE_HAVE_INTTYPES_H@ EINA_CONFIGURE_HAVE_ON_OFF_THREADS = @EINA_CONFIGURE_HAVE_ON_OFF_THREADS@ EINA_CONFIGURE_HAVE_STDINT_H = @EINA_CONFIGURE_HAVE_STDINT_H@ EINA_CONFIGURE_HAVE_THREADS = @EINA_CONFIGURE_HAVE_THREADS@ EINA_CONFIGURE_MAGIC_DEBUG = @EINA_CONFIGURE_MAGIC_DEBUG@ EINA_CONFIGURE_SAFETY_CHECKS = @EINA_CONFIGURE_SAFETY_CHECKS@ -EINA_CPPFLAGS = @EINA_CPPFLAGS@ EINA_LIBS = @EINA_LIBS@ EINA_SIZEOF_WCHAR_T = @EINA_SIZEOF_WCHAR_T@ EMEMOA_CFLAGS = @EMEMOA_CFLAGS@ @@ -182,6 +186,8 @@ ESCAPE_LIBS = @ESCAPE_LIBS@ EVIL_CFLAGS = @EVIL_CFLAGS@ EVIL_LIBS = @EVIL_LIBS@ EXEEXT = @EXEEXT@ +EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ +EXOTIC_LIBS = @EXOTIC_LIBS@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ @@ -217,6 +223,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -297,7 +305,6 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/include \ -I$(top_srcdir)/src/lib \ -I$(top_builddir)/src/lib \ -@EINA_CPPFLAGS@ \ @EFL_EINA_BUILD@ controllerdir = $(libdir)//eina/modules/mp/pass_through/$(MODULE_ARCH) diff --git a/libraries/eina/src/tests/Makefile.am b/libraries/eina/src/tests/Makefile.am index 7e05ba9..cf500f5 100644 --- a/libraries/eina/src/tests/Makefile.am +++ b/libraries/eina/src/tests/Makefile.am @@ -66,7 +66,8 @@ eina_test_strbuf.c \ eina_test_str.c \ eina_test_quadtree.c \ eina_test_simple_xml_parser.c \ -eina_test_value.c +eina_test_value.c \ +eina_test_model.c eina_suite_LDADD = @CHECK_LIBS@ $(top_builddir)/src/lib/libeina.la -lm diff --git a/libraries/eina/src/tests/Makefile.in b/libraries/eina/src/tests/Makefile.in index c56211a..81e58ba 100644 --- a/libraries/eina/src/tests/Makefile.in +++ b/libraries/eina/src/tests/Makefile.in @@ -43,20 +43,24 @@ host_triplet = @host@ subdir = src/tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \ - $(top_srcdir)/m4/efl_benchmark.m4 \ - $(top_srcdir)/m4/efl_compiler_flag.m4 \ - $(top_srcdir)/m4/efl_coverage.m4 $(top_srcdir)/m4/efl_cpu.m4 \ - $(top_srcdir)/m4/efl_doxygen.m4 \ - $(top_srcdir)/m4/efl_examples.m4 \ - $(top_srcdir)/m4/efl_fnmatch.m4 \ - $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \ - $(top_srcdir)/m4/efl_threads.m4 \ - $(top_srcdir)/m4/efl_voltron.m4 $(top_srcdir)/m4/eina_bench.m4 \ - $(top_srcdir)/m4/eina_check.m4 $(top_srcdir)/m4/libtool.m4 \ - $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ - $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/eina/eina_bench.m4 \ + $(top_srcdir)/m4/eina/eina_check.m4 \ + $(top_srcdir)/m4/common/efl_attribute.m4 \ + $(top_srcdir)/m4/common/efl_benchmark.m4 \ + $(top_srcdir)/m4/common/efl_compiler_flag.m4 \ + $(top_srcdir)/m4/common/efl_coverage.m4 \ + $(top_srcdir)/m4/common/efl_cpu.m4 \ + $(top_srcdir)/m4/common/efl_doxygen.m4 \ + $(top_srcdir)/m4/common/efl_examples.m4 \ + $(top_srcdir)/m4/common/efl_fnmatch.m4 \ + $(top_srcdir)/m4/common/efl_path_max.m4 \ + $(top_srcdir)/m4/common/efl_tests.m4 \ + $(top_srcdir)/m4/common/efl_threads.m4 \ + $(top_srcdir)/m4/common/efl_voltron.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -159,7 +163,8 @@ am__eina_suite_SOURCES_DIST = eina_suite.c eina_test_fp.c \ eina_test_rectangle.c eina_test_list.c \ eina_test_matrixsparse.c eina_test_tiler.c eina_test_strbuf.c \ eina_test_str.c eina_test_quadtree.c \ - eina_test_simple_xml_parser.c eina_test_value.c + eina_test_simple_xml_parser.c eina_test_value.c \ + eina_test_model.c @EFL_ENABLE_TESTS_TRUE@am_eina_suite_OBJECTS = eina_suite.$(OBJEXT) \ @EFL_ENABLE_TESTS_TRUE@ eina_test_fp.$(OBJEXT) \ @EFL_ENABLE_TESTS_TRUE@ eina_test_stringshare.$(OBJEXT) \ @@ -195,7 +200,8 @@ am__eina_suite_SOURCES_DIST = eina_suite.c eina_test_fp.c \ @EFL_ENABLE_TESTS_TRUE@ eina_test_str.$(OBJEXT) \ @EFL_ENABLE_TESTS_TRUE@ eina_test_quadtree.$(OBJEXT) \ @EFL_ENABLE_TESTS_TRUE@ eina_test_simple_xml_parser.$(OBJEXT) \ -@EFL_ENABLE_TESTS_TRUE@ eina_test_value.$(OBJEXT) +@EFL_ENABLE_TESTS_TRUE@ eina_test_value.$(OBJEXT) \ +@EFL_ENABLE_TESTS_TRUE@ eina_test_model.$(OBJEXT) eina_suite_OBJECTS = $(am_eina_suite_OBJECTS) @EFL_ENABLE_TESTS_TRUE@eina_suite_DEPENDENCIES = \ @EFL_ENABLE_TESTS_TRUE@ $(top_builddir)/src/lib/libeina.la @@ -296,13 +302,13 @@ EINA_CONFIGURE_DEFAULT_MEMPOOL = @EINA_CONFIGURE_DEFAULT_MEMPOOL@ EINA_CONFIGURE_ENABLE_LOG = @EINA_CONFIGURE_ENABLE_LOG@ EINA_CONFIGURE_HAVE_DEBUG_THREADS = @EINA_CONFIGURE_HAVE_DEBUG_THREADS@ EINA_CONFIGURE_HAVE_DIRENT_H = @EINA_CONFIGURE_HAVE_DIRENT_H@ +EINA_CONFIGURE_HAVE_EXOTIC = @EINA_CONFIGURE_HAVE_EXOTIC@ EINA_CONFIGURE_HAVE_INTTYPES_H = @EINA_CONFIGURE_HAVE_INTTYPES_H@ EINA_CONFIGURE_HAVE_ON_OFF_THREADS = @EINA_CONFIGURE_HAVE_ON_OFF_THREADS@ EINA_CONFIGURE_HAVE_STDINT_H = @EINA_CONFIGURE_HAVE_STDINT_H@ EINA_CONFIGURE_HAVE_THREADS = @EINA_CONFIGURE_HAVE_THREADS@ EINA_CONFIGURE_MAGIC_DEBUG = @EINA_CONFIGURE_MAGIC_DEBUG@ EINA_CONFIGURE_SAFETY_CHECKS = @EINA_CONFIGURE_SAFETY_CHECKS@ -EINA_CPPFLAGS = @EINA_CPPFLAGS@ EINA_LIBS = @EINA_LIBS@ EINA_SIZEOF_WCHAR_T = @EINA_SIZEOF_WCHAR_T@ EMEMOA_CFLAGS = @EMEMOA_CFLAGS@ @@ -312,6 +318,8 @@ ESCAPE_LIBS = @ESCAPE_LIBS@ EVIL_CFLAGS = @EVIL_CFLAGS@ EVIL_LIBS = @EVIL_LIBS@ EXEEXT = @EXEEXT@ +EXOTIC_CFLAGS = @EXOTIC_CFLAGS@ +EXOTIC_LIBS = @EXOTIC_LIBS@ FGREP = @FGREP@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ @@ -347,6 +355,8 @@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ @@ -465,7 +475,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_srcdir)/src/include \ @EFL_ENABLE_TESTS_TRUE@eina_test_str.c \ @EFL_ENABLE_TESTS_TRUE@eina_test_quadtree.c \ @EFL_ENABLE_TESTS_TRUE@eina_test_simple_xml_parser.c \ -@EFL_ENABLE_TESTS_TRUE@eina_test_value.c +@EFL_ENABLE_TESTS_TRUE@eina_test_value.c \ +@EFL_ENABLE_TESTS_TRUE@eina_test_model.c @EFL_ENABLE_TESTS_TRUE@eina_suite_LDADD = @CHECK_LIBS@ $(top_builddir)/src/lib/libeina.la -lm @EFL_ENABLE_TESTS_TRUE@cxx_compile_test_SOURCES = cxx_compile_test.cxx @@ -704,6 +715,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_test_main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_test_matrixsparse.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_test_mempool.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_test_model.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_test_module.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_test_quadtree.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_test_rbtree.Po@am__quote@ diff --git a/libraries/eina/src/tests/eina_suite.c b/libraries/eina/src/tests/eina_suite.c index 648a717..b34d016 100644 --- a/libraries/eina/src/tests/eina_suite.c +++ b/libraries/eina/src/tests/eina_suite.c @@ -68,6 +68,7 @@ static const Eina_Test_Case etc[] = { { "Sched", eina_test_sched }, { "Simple Xml Parser", eina_test_simple_xml_parser}, { "Value", eina_test_value }, + { "Model", eina_test_model }, { NULL, NULL } }; @@ -137,6 +138,8 @@ static void _mempool_init(void) static void _mempool_shutdown(void) { eina_module_list_free(_modules); + if (_modules) + eina_array_free(_modules); /* TODO delete the list */ eina_shutdown(); } diff --git a/libraries/eina/src/tests/eina_suite.h b/libraries/eina/src/tests/eina_suite.h index 6eaaec7..d399298 100644 --- a/libraries/eina/src/tests/eina_suite.h +++ b/libraries/eina/src/tests/eina_suite.h @@ -56,5 +56,6 @@ void eina_test_fp(TCase *tc); void eina_test_sched(TCase *tc); void eina_test_simple_xml_parser(TCase *tc); void eina_test_value(TCase *tc); +void eina_test_model(TCase *tc); #endif /* EINA_SUITE_H_ */ diff --git a/libraries/eina/src/tests/eina_test_clist.c b/libraries/eina/src/tests/eina_test_clist.c index 901c0e8..115afc2 100644 --- a/libraries/eina/src/tests/eina_test_clist.c +++ b/libraries/eina/src/tests/eina_test_clist.c @@ -6,7 +6,7 @@ #include #include -#include +#include "Eina.h" #include "eina_suite.h" Eina_Clist string_list = EINA_CLIST_INIT(string_list); diff --git a/libraries/eina/src/tests/eina_test_counter.c b/libraries/eina/src/tests/eina_test_counter.c index 2a3f30d..4d956fd 100644 --- a/libraries/eina/src/tests/eina_test_counter.c +++ b/libraries/eina/src/tests/eina_test_counter.c @@ -27,6 +27,43 @@ #include "Eina.h" #include "eina_safety_checks.h" +#ifdef EINA_SAFETY_CHECKS +struct log_ctx { + const char *msg; + const char *fnc; + Eina_Bool did; +}; + +/* tests should not output on success, just uncomment this for debugging */ +//#define SHOW_LOG 1 + +static void +_eina_test_safety_print_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const char *file, const char *fnc, int line, const char *fmt, void *data, va_list args __UNUSED__) +{ + struct log_ctx *ctx = data; + va_list cp_args; + const char *str; + + va_copy(cp_args, args); + str = va_arg(cp_args, const char *); + va_end(cp_args); + + ck_assert_int_eq(level, EINA_LOG_LEVEL_ERR); + ck_assert_str_eq(fmt, "%s"); + ck_assert_str_eq(ctx->msg, str); + ck_assert_str_eq(ctx->fnc, fnc); + ctx->did = EINA_TRUE; + +#ifdef SHOW_LOG + eina_log_print_cb_stderr(d, level, file, fnc, line, fmt, NULL, args); +#else + (void)d; + (void)file; + (void)line; +#endif +} +#endif + START_TEST(eina_counter_simple) { Eina_Counter *cnt; @@ -61,6 +98,7 @@ START_TEST(eina_counter_simple) dump = eina_counter_dump(cnt); fail_if(!dump); + /* TODO: parse dump and check if it's right */ fprintf(stderr, "%s", dump); free(dump); @@ -86,13 +124,65 @@ START_TEST(eina_counter_break) #ifdef EINA_SAFETY_CHECKS { + struct log_ctx ctx; char *dump; +#define TEST_MAGIC_SAFETY(fn, _msg) \ + ctx.msg = _msg; \ + ctx.fnc = fn; \ + ctx.did = EINA_FALSE + + eina_log_print_cb_set(_eina_test_safety_print_cb, &ctx); + +#ifdef SHOW_LOG fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_counter_new", + "safety check failed: name == NULL"); + cnt = eina_counter_new(NULL); + fail_if(cnt); + fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); + fail_unless(ctx.did); + +#ifdef SHOW_LOG + fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_counter_free", + "safety check failed: counter == NULL"); + eina_counter_free(NULL); + fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); + fail_unless(ctx.did); + +#ifdef SHOW_LOG + fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_counter_start", + "safety check failed: counter == NULL"); + eina_counter_start(NULL); + fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); + fail_unless(ctx.did); + +#ifdef SHOW_LOG + fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_counter_stop", + "safety check failed: counter == NULL"); + eina_counter_stop(NULL, 0); + fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); + fail_unless(ctx.did); + + +#ifdef SHOW_LOG + fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_counter_dump", + "safety check failed: counter == NULL"); dump = eina_counter_dump(NULL); fail_if(dump); fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); - free(dump); + fail_unless(ctx.did); + + eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); } #endif diff --git a/libraries/eina/src/tests/eina_test_error.c b/libraries/eina/src/tests/eina_test_error.c index 506f406..57f6950 100644 --- a/libraries/eina/src/tests/eina_test_error.c +++ b/libraries/eina/src/tests/eina_test_error.c @@ -33,6 +33,41 @@ #define TEST_TEXT "The big test\n" +struct log_ctx { + const char *msg; + const char *fnc; + Eina_Bool did; +}; + +/* tests should not output on success, just uncomment this for debugging */ +//#define SHOW_LOG 1 + +static void +_eina_test_safety_print_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const char *file, const char *fnc, int line, const char *fmt, void *data, va_list args __UNUSED__) +{ + struct log_ctx *ctx = data; + va_list cp_args; + const char *str; + + va_copy(cp_args, args); + str = va_arg(cp_args, const char *); + va_end(cp_args); + + ck_assert_int_eq(level, EINA_LOG_LEVEL_ERR); + ck_assert_str_eq(fmt, "%s"); + ck_assert_str_eq(ctx->msg, str); + ck_assert_str_eq(ctx->fnc, fnc); + ctx->did = EINA_TRUE; + +#ifdef SHOW_LOG + eina_log_print_cb_stderr(d, level, file, fnc, line, fmt, NULL, args); +#else + (void)d; + (void)file; + (void)line; +#endif +} + START_TEST(eina_error_errno) { int test; @@ -52,8 +87,157 @@ START_TEST(eina_error_errno) } END_TEST +START_TEST(eina_error_test_find) +{ + int test, r; + const char *str; + + eina_init(); + + test = eina_error_msg_register(TEST_TEXT); + ck_assert_int_ne(test, 0); + + str = eina_error_msg_get(test); + fail_unless(str != NULL); + ck_assert_str_eq(str, TEST_TEXT); + + eina_error_set(test); + fail_if(eina_error_get() != test); + + r = eina_error_find(TEST_TEXT); + ck_assert_int_eq(r, test); + + eina_shutdown(); +} +END_TEST + +START_TEST(eina_error_test_modify) +{ + int test, r; + const char *str, smsg[] = "Do not copy this string"; + + eina_init(); + + test = eina_error_msg_register("Some Test Error"); + ck_assert_int_ne(test, 0); + + str = eina_error_msg_get(test); + fail_unless(str != NULL); + ck_assert_str_eq(str, "Some Test Error"); + + eina_error_set(test); + fail_if(eina_error_get() != test); + + fail_unless(eina_error_msg_modify(test, "ABCDE")); + + r = eina_error_find("ABCDE"); + ck_assert_int_eq(r, test); + + test = eina_error_msg_static_register(smsg); + ck_assert_int_ne(test, 0); + + str = eina_error_msg_get(test); + fail_unless(str != NULL); + fail_unless(str == smsg); + + fail_unless(eina_error_msg_modify(test, "Change that!")); + r = eina_error_find("Change that!"); + ck_assert_int_eq(r, test); + + eina_shutdown(); +} +END_TEST + +START_TEST(eina_error_test_lots) +{ + char buf[64]; + int codes[512]; + unsigned int i; + + eina_init(); + + for (i = 0; i < sizeof(codes)/sizeof(codes[0]); i++) + { + snprintf(buf, sizeof(buf), "myerr-%d", i); + codes[i] = eina_error_msg_register(buf); + ck_assert_int_ne(codes[i], 0); + } + + for (i = 0; i < sizeof(codes)/sizeof(codes[0]); i++) + { + int found; + + snprintf(buf, sizeof(buf), "myerr-%d", i); + + found = eina_error_find(buf); + ck_assert_int_eq(codes[i], found); + } + + eina_shutdown(); +} +END_TEST + +#ifdef EINA_SAFETY_CHECKS +START_TEST(eina_error_test_failures) +{ + struct log_ctx ctx; + + eina_init(); + + eina_log_print_cb_set(_eina_test_safety_print_cb, &ctx); + +#define TEST_MAGIC_SAFETY(fn, _msg) \ + ctx.msg = _msg; \ + ctx.fnc = fn; \ + ctx.did = EINA_FALSE + + TEST_MAGIC_SAFETY("eina_error_msg_register", + "safety check failed: msg == NULL"); + ck_assert_int_eq(eina_error_msg_register(NULL), 0); + fail_unless(ctx.did); + + TEST_MAGIC_SAFETY("eina_error_msg_static_register", + "safety check failed: msg == NULL"); + ck_assert_int_eq(eina_error_msg_static_register(NULL), 0); + fail_unless(ctx.did); + + ck_assert_int_eq(eina_error_msg_modify(0, "X"), EINA_FALSE); + ck_assert_int_eq(eina_error_msg_modify(4096, "X"), EINA_FALSE); + + TEST_MAGIC_SAFETY("eina_error_msg_modify", + "safety check failed: msg == NULL"); + ck_assert_int_eq(eina_error_msg_modify(EINA_ERROR_OUT_OF_MEMORY, NULL), + EINA_FALSE); + fail_unless(ctx.did); + + ck_assert_str_eq(eina_error_msg_get(EINA_ERROR_OUT_OF_MEMORY), + "Out of memory"); + + TEST_MAGIC_SAFETY("eina_error_find", + "safety check failed: msg == NULL"); + ck_assert_int_eq(eina_error_find(NULL), 0); + fail_unless(ctx.did); + + ck_assert_int_eq(eina_error_find("Non-existent Error..."), 0); + + fail_if(eina_error_msg_get(0)); + fail_if(eina_error_msg_get(4096)); + + eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); + + eina_shutdown(); +} +END_TEST +#endif + void eina_test_error(TCase *tc) { tcase_add_test(tc, eina_error_errno); + tcase_add_test(tc, eina_error_test_find); + tcase_add_test(tc, eina_error_test_modify); + tcase_add_test(tc, eina_error_test_lots); +#ifdef EINA_SAFETY_CHECKS + tcase_add_test(tc, eina_error_test_failures); +#endif } diff --git a/libraries/eina/src/tests/eina_test_file.c b/libraries/eina/src/tests/eina_test_file.c index 55e9976..a3ba998 100644 --- a/libraries/eina/src/tests/eina_test_file.c +++ b/libraries/eina/src/tests/eina_test_file.c @@ -28,6 +28,44 @@ #include "Eina.h" #include "eina_safety_checks.h" +#ifdef EINA_SAFETY_CHECKS +struct log_ctx { + const char *msg; + const char *fnc; + Eina_Bool did; +}; + +/* tests should not output on success, just uncomment this for debugging */ +//#define SHOW_LOG 1 + +static void +_eina_test_safety_print_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const char *file, const char *fnc, int line, const char *fmt, void *data, va_list args __UNUSED__) +{ + struct log_ctx *ctx = data; + va_list cp_args; + const char *str; + + va_copy(cp_args, args); + str = va_arg(cp_args, const char *); + va_end(cp_args); + + ck_assert_int_eq(level, EINA_LOG_LEVEL_ERR); + ck_assert_str_eq(fmt, "%s"); + ck_assert_str_eq(ctx->msg, str); + ck_assert_str_eq(ctx->fnc, fnc); + ctx->did = EINA_TRUE; + +#ifdef SHOW_LOG + eina_log_print_cb_stderr(d, level, file, fnc, line, fmt, NULL, args); +#else + (void)d; + (void)file; + (void)line; +#endif +} +#endif + + START_TEST(eina_file_split_simple) { Eina_Array *ea; @@ -35,10 +73,26 @@ START_TEST(eina_file_split_simple) eina_init(); #ifdef EINA_SAFETY_CHECKS +#ifdef SHOW_LOG fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + struct log_ctx ctx; + +#define TEST_MAGIC_SAFETY(fn, _msg) \ + ctx.msg = _msg; \ + ctx.fnc = fn; \ + ctx.did = EINA_FALSE + + eina_log_print_cb_set(_eina_test_safety_print_cb, &ctx); + + TEST_MAGIC_SAFETY("eina_file_split", "safety check failed: path == NULL"); ea = eina_file_split(NULL); fail_if(ea); fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); + fail_unless(ctx.did); + + eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); +#undef TEST_MAGIC_SAFETY #endif #ifdef _WIN32 diff --git a/libraries/eina/src/tests/eina_test_inlist.c b/libraries/eina/src/tests/eina_test_inlist.c index c27f393..a8631e7 100644 --- a/libraries/eina/src/tests/eina_test_inlist.c +++ b/libraries/eina/src/tests/eina_test_inlist.c @@ -34,6 +34,43 @@ struct _Eina_Test_Inlist EINA_INLIST; }; +#ifdef EINA_SAFETY_CHECKS +struct log_ctx { + const char *msg; + const char *fnc; + Eina_Bool did; +}; + +/* tests should not output on success, just uncomment this for debugging */ +//#define SHOW_LOG 1 + +static void +_eina_test_safety_print_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const char *file, const char *fnc, int line, const char *fmt, void *data, va_list args __UNUSED__) +{ + struct log_ctx *ctx = data; + va_list cp_args; + const char *str; + + va_copy(cp_args, args); + str = va_arg(cp_args, const char *); + va_end(cp_args); + + ck_assert_int_eq(level, EINA_LOG_LEVEL_ERR); + ck_assert_str_eq(fmt, "%s"); + ck_assert_str_eq(ctx->msg, str); + ck_assert_str_eq(ctx->fnc, fnc); + ctx->did = EINA_TRUE; + +#ifdef SHOW_LOG + eina_log_print_cb_stderr(d, level, file, fnc, line, fmt, NULL, args); +#else + (void)d; + (void)file; + (void)line; +#endif +} +#endif + static Eina_Test_Inlist * _eina_test_inlist_build(int i) { @@ -52,6 +89,10 @@ START_TEST(eina_inlist_simple) Eina_Test_Inlist *tmp; Eina_Test_Inlist *prev; int i = 0; +#ifdef EINA_SAFETY_CHECKS + Eina_Inlist *bkp; + struct log_ctx ctx; +#endif fail_if(!eina_init()); @@ -106,16 +147,142 @@ START_TEST(eina_inlist_simple) } #ifdef EINA_SAFETY_CHECKS + bkp = lst; + eina_log_print_cb_set(_eina_test_safety_print_cb, &ctx); + +#define TEST_MAGIC_SAFETY(fn, _msg) \ + ctx.msg = _msg; \ + ctx.fnc = fn; \ + ctx.did = EINA_FALSE + +#ifdef SHOW_LOG fprintf(stderr, "you should have a safety check failure below:\n"); +#endif { - Eina_Inlist *tmp2 = eina_inlist_remove(NULL, EINA_INLIST_GET(tmp)); + Eina_Inlist *tmp2; + + TEST_MAGIC_SAFETY("eina_inlist_remove", + "safety check failed: list == NULL"); + + tmp2 = eina_inlist_remove(NULL, EINA_INLIST_GET(tmp)); fail_if(tmp2 != NULL); fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); + fail_unless(ctx.did); } - fprintf(stderr, "you should have a safety check failure below:\n"); +#ifdef SHOW_LOG + fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_inlist_remove", + "safety check failed: item == NULL"); lst = eina_inlist_remove(lst, NULL); fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); + fail_unless(ctx.did); + +#ifdef SHOW_LOG + fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_inlist_append", + "safety check failed: new_l == NULL"); + lst = eina_inlist_append(lst, NULL); + fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); + fail_unless(ctx.did); + +#ifdef SHOW_LOG + fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_inlist_append_relative", + "safety check failed: new_l == NULL"); + lst = eina_inlist_append_relative(lst, NULL, NULL); + fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); + fail_unless(ctx.did); + +#ifdef SHOW_LOG + fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_inlist_prepend", + "safety check failed: new_l == NULL"); + lst = eina_inlist_prepend(lst, NULL); + fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); + fail_unless(ctx.did); + +#ifdef SHOW_LOG + fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_inlist_prepend_relative", + "safety check failed: new_l == NULL"); + lst = eina_inlist_prepend_relative(lst, NULL, NULL); + fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); + fail_unless(ctx.did); + +#ifdef SHOW_LOG + fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_inlist_find", + "safety check failed: item == NULL"); + lst = eina_inlist_find(lst, NULL); + fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); + fail_unless(ctx.did); + +#ifdef SHOW_LOG + fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_inlist_demote", + "safety check failed: list == NULL"); + lst = eina_inlist_demote(NULL, NULL); + fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); + fail_unless(ctx.did); + +#ifdef SHOW_LOG + fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_inlist_demote", + "safety check failed: item == NULL"); + lst = eina_inlist_demote((void*)1L, NULL); + fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); + fail_unless(ctx.did); + lst = NULL; + +#ifdef SHOW_LOG + fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_inlist_promote", + "safety check failed: list == NULL"); + lst = eina_inlist_promote(NULL, NULL); + fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); + fail_unless(ctx.did); + +#ifdef SHOW_LOG + fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_inlist_promote", + "safety check failed: item == NULL"); + lst = eina_inlist_promote((void*)1L, NULL); + fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); + fail_unless(ctx.did); + lst = NULL; + +#ifdef SHOW_LOG + fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_inlist_sorted_insert", + "safety check failed: item == NULL"); + lst = eina_inlist_sorted_insert(NULL, NULL, NULL); + fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); + fail_unless(ctx.did); + +#ifdef SHOW_LOG + fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_inlist_sorted_insert", + "safety check failed: func == NULL"); + lst = eina_inlist_sorted_insert(NULL, (void*)1L, NULL); + fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); + fail_unless(ctx.did); + lst = NULL; + + eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); + lst = bkp; #endif tmp = EINA_INLIST_CONTAINER_GET(lst, Eina_Test_Inlist); diff --git a/libraries/eina/src/tests/eina_test_list.c b/libraries/eina/src/tests/eina_test_list.c index 6e08847..ce70d03 100644 --- a/libraries/eina/src/tests/eina_test_list.c +++ b/libraries/eina/src/tests/eina_test_list.c @@ -338,10 +338,50 @@ START_TEST(eina_test_sorted_insert) } END_TEST +START_TEST(eina_test_list_split) +{ + Eina_List *left = NULL, *right = NULL ; + Eina_List *list = NULL; + Eina_List *l; + void *list_data; + int i; + + eina_init(); + + list = eina_list_append(list, "tigh"); + list = eina_list_append(list, "adar"); + list = eina_list_append(list, "baltar"); + list = eina_list_append(list, "roslin"); + list = eina_list_append(list, "baltar"); + list = eina_list_append(list, "roslin"); + list = eina_list_append(list, "baltar"); + list = eina_list_append(list, "roslin"); + + fail_if(list == NULL); + fail_if(eina_list_count(list) != 8); + + for ( i = 0; i < 200; i++) + { + left = eina_list_split_list(list, eina_list_nth_list(list, i % 2), &right); + + if (i % 2 == 0) + fail_if(eina_list_count(left) == 1 && eina_list_count(right) + eina_list_count(left) == i + 7); + else + fail_if(eina_list_count(left) == 2 && eina_list_count(right) + eina_list_count(left) == i + 7); + + list = eina_list_merge(left, right); + list = eina_list_append(list, "roslin"); + } + + eina_shutdown(); +} +END_TEST + void eina_test_list(TCase *tc) { tcase_add_test(tc, eina_test_simple); tcase_add_test(tc, eina_test_merge); tcase_add_test(tc, eina_test_sorted_insert); + tcase_add_test(tc, eina_test_list_split); } diff --git a/libraries/eina/src/tests/eina_test_log.c b/libraries/eina/src/tests/eina_test_log.c index ba17d5f..e0f0363 100644 --- a/libraries/eina/src/tests/eina_test_log.c +++ b/libraries/eina/src/tests/eina_test_log.c @@ -27,18 +27,119 @@ #include "eina_suite.h" #include "Eina.h" - START_TEST(eina_log_macro) +struct log_ctx { + int level; + int line; + const char *msg; + const char *fnc; + const char *dom; + Eina_Bool did; +}; + +/* tests should not output on success, just uncomment this for debugging */ +//#define SHOW_LOG 1 + +static void +_eina_test_log(const Eina_Log_Domain *d, Eina_Log_Level level, const char *file, const char *fnc, int line, const char *fmt, void *data, va_list args __UNUSED__) { + struct log_ctx *ctx = data; + ck_assert_int_eq(ctx->level, level); + ck_assert_int_eq(ctx->line, line); + ck_assert_str_eq(ctx->msg, fmt); + ck_assert_str_eq(ctx->fnc, fnc); + ck_assert_str_eq(file, __FILE__); + ctx->did = EINA_TRUE; +#ifdef SHOW_LOG + eina_log_print_cb_stderr(d, level, file, fnc, line, fmt, NULL, args); +#else + (void)d; +#endif +} + +static void +_eina_test_log_domain(const Eina_Log_Domain *d, Eina_Log_Level level, const char *file, const char *fnc, int line, const char *fmt, void *data, va_list args __UNUSED__) +{ + struct log_ctx *ctx = data; + ck_assert_int_eq(ctx->level, level); + ck_assert_int_eq(ctx->line, line); + ck_assert_str_eq(ctx->msg, fmt); + ck_assert_str_eq(ctx->fnc, fnc); + ck_assert_str_eq(file, __FILE__); + ck_assert_str_eq(ctx->dom, d->name); + ctx->did = EINA_TRUE; +#ifdef SHOW_LOG + eina_log_print_cb_stderr(d, level, file, fnc, line, fmt, NULL, args); +#endif +} + +static void +_eina_test_log_safety(const Eina_Log_Domain *d, Eina_Log_Level level, const char *file, const char *fnc, int line, const char *fmt, void *data, va_list args __UNUSED__) +{ + struct log_ctx *ctx = data; + va_list cp_args; + const char *str; + + va_copy(cp_args, args); + str = va_arg(cp_args, const char *); + va_end(cp_args); + + ck_assert_int_eq(ctx->level, level); + ck_assert_str_eq(fmt, "%s"); + ck_assert_str_eq(ctx->msg, str); + ck_assert_str_eq(ctx->fnc, fnc); + ctx->did = EINA_TRUE; + +#ifdef SHOW_LOG + eina_log_print_cb_stderr(d, level, file, fnc, line, fmt, NULL, args); +#else + (void)d; + (void)file; + (void)line; +#endif +} + +START_TEST(eina_log_macro) +{ + struct log_ctx ctx; + int oldlevel; + fail_if(!eina_init()); + oldlevel = eina_log_level_get(); eina_log_level_set(EINA_LOG_LEVEL_DBG); - eina_log_print_cb_set(eina_log_print_cb_file, stderr); + eina_log_print_cb_set(_eina_test_log, &ctx); + +#define TEST_LOG_CTX(lvl, _msg) \ + ctx.level = lvl; \ + ctx.line = __LINE__ + 1; \ + ctx.msg = _msg; \ + ctx.fnc = __FUNCTION__; \ + ctx.did = EINA_FALSE + + TEST_LOG_CTX(EINA_LOG_LEVEL_CRITICAL, "Critical message"); + EINA_LOG_CRIT("Critical message"); + fail_unless(ctx.did); + + TEST_LOG_CTX(EINA_LOG_LEVEL_ERR, "An error"); + EINA_LOG_ERR("An error"); + fail_unless(ctx.did); - EINA_LOG_CRIT("Critical message\n"); - EINA_LOG_ERR("An error\n"); - EINA_LOG_INFO("An info\n"); - EINA_LOG_WARN("A warning\n"); - EINA_LOG_DBG("A debug\n"); + TEST_LOG_CTX(EINA_LOG_LEVEL_WARN, "A warning"); + EINA_LOG_WARN("A warning"); + fail_unless(ctx.did); + + TEST_LOG_CTX(EINA_LOG_LEVEL_INFO, "An info"); + EINA_LOG_INFO("An info"); + fail_unless(ctx.did); + + TEST_LOG_CTX(EINA_LOG_LEVEL_DBG, "A debug"); + EINA_LOG_DBG("A debug"); + fail_unless(ctx.did); + +#undef TEST_LOG_CTX + + eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); + eina_log_level_set(oldlevel); eina_shutdown(); } @@ -46,16 +147,54 @@ END_TEST START_TEST(eina_log_domains_macros) { + struct log_ctx ctx; + int oldlevel; + fail_if(!eina_init()); + /* make global log level blocker */ + oldlevel = eina_log_level_get(); + eina_log_level_set(EINA_LOG_LEVEL_CRITICAL); + eina_log_print_cb_set(_eina_test_log_domain, &ctx); + int d = eina_log_domain_register("MyDomain", EINA_COLOR_GREEN); fail_if(d < 0); - EINA_LOG_DOM_CRIT(d, "A critical message\n"); - EINA_LOG_DOM_ERR(d, "An error\n"); - EINA_LOG_DOM_WARN(d, "A warning\n"); - EINA_LOG_DOM_DBG(d, "A debug\n"); - EINA_LOG_DOM_INFO(d, "An info\n"); + /* make specific domain permissive */ + eina_log_domain_level_set("MyDomain", EINA_LOG_LEVEL_DBG); + +#define TEST_LOG_CTX(lvl, _msg) \ + ctx.level = lvl; \ + ctx.line = __LINE__ + 1; \ + ctx.msg = _msg; \ + ctx.fnc = __FUNCTION__; \ + ctx.dom = "MyDomain"; \ + ctx.did = EINA_FALSE + + TEST_LOG_CTX(EINA_LOG_LEVEL_CRITICAL, "A critical message"); + EINA_LOG_DOM_CRIT(d, "A critical message"); + fail_unless(ctx.did); + + TEST_LOG_CTX(EINA_LOG_LEVEL_ERR, "An error"); + EINA_LOG_DOM_ERR(d, "An error"); + fail_unless(ctx.did); + + TEST_LOG_CTX(EINA_LOG_LEVEL_WARN, "A warning"); + EINA_LOG_DOM_WARN(d, "A warning"); + fail_unless(ctx.did); + + TEST_LOG_CTX(EINA_LOG_LEVEL_INFO, "An info"); + EINA_LOG_DOM_INFO(d, "An info"); + fail_unless(ctx.did); + + TEST_LOG_CTX(EINA_LOG_LEVEL_DBG, "A debug"); + EINA_LOG_DOM_DBG(d, "A debug"); + fail_unless(ctx.did); + +#undef TEST_LOG_CTX + + eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); + eina_log_level_set(oldlevel); eina_shutdown(); } @@ -120,6 +259,8 @@ END_TEST START_TEST(eina_log_level_indexes) { + struct log_ctx ctx; + fail_if(!eina_init()); fail_if(!eina_threads_init()); fail_if(!eina_threads_init()); @@ -127,11 +268,41 @@ START_TEST(eina_log_level_indexes) int d = eina_log_domain_register("Levels", EINA_COLOR_GREEN); fail_if(d < 0); + eina_log_print_cb_set(_eina_test_log_domain, &ctx); + +#define TEST_LOG_CTX(lvl, _msg) \ + ctx.level = lvl; \ + ctx.line = __LINE__ + 1; \ + ctx.msg = _msg; \ + ctx.fnc = __FUNCTION__; \ + ctx.dom = "Levels"; \ + ctx.did = EINA_FALSE; + // Displayed unless user sets level lower than -1 - EINA_LOG(d, -1, "Negative index message\n"); + eina_log_domain_level_set("Levels", -1); + TEST_LOG_CTX(-1, "Negative index message"); + EINA_LOG(d, -1, "Negative index message"); + fail_unless(ctx.did); + + eina_log_domain_level_set("Levels", -2); + TEST_LOG_CTX(-1, "Negative index message"); + EINA_LOG(d, -1, "Negative index message"); + fail_if(ctx.did); // Displayed only if user sets level 6 or higher - EINA_LOG(d, 6, "Higher level debug\n"); + eina_log_domain_level_set("Levels", 6); + TEST_LOG_CTX(6, "Higher level debug"); + EINA_LOG(d, 6, "Higher level debug"); + fail_unless(ctx.did); + + eina_log_domain_level_set("Levels", 5); + TEST_LOG_CTX(6, "Higher level debug"); + EINA_LOG(d, 6, "Higher level debug"); + fail_if(ctx.did); + +#undef TEST_LOG_CTX + + eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); eina_threads_shutdown(); eina_threads_shutdown(); @@ -141,6 +312,7 @@ END_TEST START_TEST(eina_log_customize) { + struct log_ctx ctx; int d; /* please don't define EINA_LOG_LEVELS for it */ @@ -182,11 +354,28 @@ START_TEST(eina_log_customize) fail_if(eina_log_domain_registered_level_get(d) != 890); eina_log_domain_unregister(d); + +#ifdef EINA_SAFETY_CHECKS +#ifdef SHOW_LOG fputs("NOTE: You should see a failed safety check or " "a crash if compiled without safety checks support.\n", stderr); +#endif eina_log_abort_on_critical_set(EINA_FALSE); + eina_log_function_disable_set(EINA_FALSE); + + eina_log_print_cb_set(_eina_test_log_safety, &ctx); + ctx.level = EINA_LOG_LEVEL_ERR; + ctx.msg = "safety check failed: _log_domains[domain].deleted is true"; + ctx.fnc = "eina_log_domain_registered_level_get"; + ctx.did = EINA_FALSE; fail_if(eina_log_domain_registered_level_get(d) != EINA_LOG_LEVEL_UNKNOWN); + fail_unless(ctx.did); + + eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); +#else +#warning "Compiled without safety checks" +#endif #undef test_set_get_bool #undef test_set_get diff --git a/libraries/eina/src/tests/eina_test_magic.c b/libraries/eina/src/tests/eina_test_magic.c index d2c3d49..d0a374e 100644 --- a/libraries/eina/src/tests/eina_test_magic.c +++ b/libraries/eina/src/tests/eina_test_magic.c @@ -40,21 +40,95 @@ struct _Eina_Magic_Struct EINA_MAGIC }; +struct log_ctx { + const char *msg; + const char *fnc; + Eina_Bool did; +}; + +/* tests should not output on success, just uncomment this for debugging */ +//#define SHOW_LOG 1 + +static void +_eina_test_safety_print_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const char *file, const char *fnc, int line, const char *fmt, void *data, va_list args __UNUSED__) +{ + struct log_ctx *ctx = data; + va_list cp_args; + const char *str; + + va_copy(cp_args, args); + str = va_arg(cp_args, const char *); + va_end(cp_args); + + ck_assert_int_eq(level, EINA_LOG_LEVEL_ERR); + ck_assert_str_eq(fmt, "%s"); + ck_assert_str_eq(ctx->msg, str); + ck_assert_str_eq(ctx->fnc, fnc); + ctx->did = EINA_TRUE; + +#ifdef SHOW_LOG + eina_log_print_cb_stderr(d, level, file, fnc, line, fmt, NULL, args); +#else + (void)d; + (void)file; + (void)line; +#endif +} + +static void +_eina_test_magic_print_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const char *file, const char *fnc, int line, const char *fmt, void *data, va_list args __UNUSED__) +{ + struct log_ctx *ctx = data; + + ck_assert_int_eq(level, EINA_LOG_LEVEL_CRITICAL); + ck_assert_str_eq(ctx->msg, fmt); + ck_assert_str_eq(ctx->fnc, fnc); + ctx->did = EINA_TRUE; + +#ifdef SHOW_LOG + eina_log_print_cb_stderr(d, level, file, fnc, line, fmt, NULL, args); +#else + (void)d; + (void)file; + (void)line; +#endif +} + +#ifdef EINA_SAFETY_CHECKS +#define TEST_MAGIC_SAFETY(fn, _msg) \ + ctx.msg = _msg; \ + ctx.fnc = fn; \ + ctx.did = EINA_FALSE +#endif + START_TEST(eina_magic_simple) { Eina_Magic_Struct *ems = NULL; + struct log_ctx ctx; eina_init(); + eina_log_print_cb_set(_eina_test_safety_print_cb, &ctx); + eina_magic_string_set(EINA_MAGIC_TEST, EINA_MAGIC_STRING); #ifdef EINA_SAFETY_CHECKS +#ifdef SHOW_LOG fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_magic_string_set", + "safety check failed: magic_name == NULL"); eina_magic_string_set(EINA_MAGIC_TEST2, NULL); fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); + fail_unless(ctx.did); +#ifdef SHOW_LOG fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_magic_string_set", + "safety check failed: magic_name == NULL"); eina_magic_string_set(EINA_MAGIC_TEST2, NULL); + fail_unless(ctx.did); fail_if(eina_error_get() != EINA_ERROR_SAFETY_FAILED); #endif @@ -64,10 +138,22 @@ START_TEST(eina_magic_simple) fail_if(strcmp(eina_magic_string_get( EINA_MAGIC_TEST), EINA_MAGIC_STRING) != 0); + eina_log_print_cb_set(_eina_test_magic_print_cb, &ctx); + #ifdef EINA_MAGIC_DEBUG fail_if(EINA_MAGIC_CHECK(ems, EINA_MAGIC_TEST)); +#ifdef SHOW_LOG fprintf(stderr, "you should see 'Input handle pointer is NULL' below\n"); +#endif + TEST_MAGIC_SAFETY(__FUNCTION__, + "*** Eina Magic Check Failed !!!\n" + " Input handle pointer is NULL !\n" + "*** NAUGHTY PROGRAMMER!!!\n" + "*** SPANK SPANK SPANK!!!\n" + "*** Now go fix your code. Tut tut tut!\n" + "\n"); EINA_MAGIC_FAIL(ems, EINA_MAGIC_TEST); + fail_unless(ctx.did); ems = malloc(sizeof (Eina_Magic_Struct)); fail_if(!ems); @@ -76,15 +162,39 @@ START_TEST(eina_magic_simple) fail_if(!EINA_MAGIC_CHECK(ems, EINA_MAGIC_TEST)); EINA_MAGIC_SET(ems, EINA_MAGIC_NONE); +#ifdef SHOW_LOG fprintf(stderr, "you should see 'Input handle has already been freed' below\n"); +#endif + TEST_MAGIC_SAFETY(__FUNCTION__, + "*** Eina Magic Check Failed !!!\n" + " Input handle has already been freed!\n" + "*** NAUGHTY PROGRAMMER!!!\n" + "*** SPANK SPANK SPANK!!!\n" + "*** Now go fix your code. Tut tut tut!\n" + "\n"); EINA_MAGIC_FAIL(ems, EINA_MAGIC_TEST); + fail_unless(ctx.did); EINA_MAGIC_SET(ems, 42424242); +#ifdef SHOW_LOG fprintf(stderr, "you should see 'Input handle is wrong type' below\n"); +#endif + TEST_MAGIC_SAFETY(__FUNCTION__, + "*** Eina Magic Check Failed !!!\n" + " Input handle is wrong type\n" + " Expected: %08x - %s\n" + " Supplied: %08x - %s\n" + "*** NAUGHTY PROGRAMMER!!!\n" + "*** SPANK SPANK SPANK!!!\n" + "*** Now go fix your code. Tut tut tut!\n" + "\n"); EINA_MAGIC_FAIL(ems, EINA_MAGIC_TEST); + fail_unless(ctx.did); #endif + eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); + eina_shutdown(); } END_TEST diff --git a/libraries/eina/src/tests/eina_test_simple_xml_parser.c b/libraries/eina/src/tests/eina_test_simple_xml_parser.c index 94e6a2a..7093019 100644 --- a/libraries/eina/src/tests/eina_test_simple_xml_parser.c +++ b/libraries/eina/src/tests/eina_test_simple_xml_parser.c @@ -44,15 +44,17 @@ START_TEST(eina_simple_xml_parser_node_dump) char *buf; fseek(f, 0, SEEK_SET); - buf = malloc(sz); + buf = malloc(sz + 1); if (buf) { if (fread(buf, 1, sz, f)) { Eina_Simple_XML_Node_Root *root = eina_simple_xml_node_load (buf, sz, EINA_TRUE); + buf[sz] = '\0'; char *out = eina_simple_xml_node_dump(&root->base, " "); - puts(out); + //puts(out); + ck_assert_str_eq(out, buf); free(out); eina_simple_xml_node_root_free(root); free(buf); diff --git a/libraries/eina/src/tests/eina_test_ustr.c b/libraries/eina/src/tests/eina_test_ustr.c index eaeba9d..75126cc 100644 --- a/libraries/eina/src/tests/eina_test_ustr.c +++ b/libraries/eina/src/tests/eina_test_ustr.c @@ -28,6 +28,43 @@ #include "eina_suite.h" #include "Eina.h" +#ifdef EINA_SAFETY_CHECKS +struct log_ctx { + const char *msg; + const char *fnc; + Eina_Bool did; +}; + +/* tests should not output on success, just uncomment this for debugging */ +//#define SHOW_LOG 1 + +static void +_eina_test_safety_print_cb(const Eina_Log_Domain *d, Eina_Log_Level level, const char *file, const char *fnc, int line, const char *fmt, void *data, va_list args __UNUSED__) +{ + struct log_ctx *ctx = data; + va_list cp_args; + const char *str; + + va_copy(cp_args, args); + str = va_arg(cp_args, const char *); + va_end(cp_args); + + ck_assert_int_eq(level, EINA_LOG_LEVEL_ERR); + ck_assert_str_eq(fmt, "%s"); + ck_assert_str_eq(ctx->msg, str); + ck_assert_str_eq(ctx->fnc, fnc); + ctx->did = EINA_TRUE; + +#ifdef SHOW_LOG + eina_log_print_cb_stderr(d, level, file, fnc, line, fmt, NULL, args); +#else + (void)d; + (void)file; + (void)line; +#endif +} +#endif + static const Eina_Unicode STR1[] = {'P', 'a', 'n', 't', 's',' ', 'O', 'n', 0}; static const Eina_Unicode STR2[] = {'P', 'a', 'n', 't', 's',' ', 'O', 'f', 'f', 0}; static const Eina_Unicode STR3[] = {'P', 'a', 'n', 't', 's',' ', 'O', 'n', 0}; @@ -126,14 +163,42 @@ START_TEST(eina_unicode_strncpy_test) rv = eina_unicode_strncpy(buf, STR1, 0); fail_if(buf[0] != '7'); - /* may segfault */ - buf[0] = '7'; - rv = eina_unicode_strncpy(buf, NULL, 0); - fail_if(buf[0] != '7'); +#ifdef EINA_SAFETY_CHECKS + { + struct log_ctx ctx; + +#define TEST_MAGIC_SAFETY(fn, _msg) \ + ctx.msg = _msg; \ + ctx.fnc = fn; \ + ctx.did = EINA_FALSE + + eina_log_print_cb_set(_eina_test_safety_print_cb, &ctx); - /* Hopefully won't segfault */ - rv = eina_unicode_strncpy(NULL, STR1, 0); - fail_if(rv != NULL); + /* may segfault */ + buf[0] = '7'; +#ifdef SHOW_LOG + fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_unicode_strncpy", + "safety check failed: source == NULL"); + rv = eina_unicode_strncpy(buf, NULL, 0); + fail_if(buf[0] != '7'); + fail_unless(ctx.did); + + /* Hopefully won't segfault */ +#ifdef SHOW_LOG + fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_unicode_strncpy", + "safety check failed: dest == NULL"); + rv = eina_unicode_strncpy(NULL, STR1, 0); + fail_if(rv != NULL); + fail_unless(ctx.did); + + eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); +#undef TEST_MAGIC_SAFETY + } +#endif eina_shutdown(); } @@ -151,8 +216,30 @@ START_TEST(eina_ustr_strlen_test) fail_if(eina_unicode_strlen(STR3) != 8); fail_if(eina_unicode_strlen(STR4) != 1); fail_if(eina_unicode_strlen(EMPTYSTR) != 0); - /* Eina unicode doesn't take NULL */ - // fail_if(eina_unicode_strlen(NULL)); + +#ifdef EINA_SAFETY_CHECKS + { + struct log_ctx ctx; + +#define TEST_MAGIC_SAFETY(fn, _msg) \ + ctx.msg = _msg; \ + ctx.fnc = fn; \ + ctx.did = EINA_FALSE + + eina_log_print_cb_set(_eina_test_safety_print_cb, &ctx); + +#ifdef SHOW_LOG + fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_unicode_strlen", + "safety check failed: ustr == NULL"); + fail_if(eina_unicode_strlen(NULL)); + fail_unless(ctx.did); + + eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); +#undef TEST_MAGIC_SAFETY + } +#endif eina_shutdown(); } @@ -174,7 +261,30 @@ START_TEST(eina_unicode_strnlen_test) fail_if(eina_unicode_strnlen(STR2,3) != 3); fail_if(eina_unicode_strnlen(STR3,3) != 3); fail_if(eina_unicode_strnlen(EMPTYSTR,1) != 0); - fail_if(eina_unicode_strnlen(NULL,0) != 0); + +#ifdef EINA_SAFETY_CHECKS + { + struct log_ctx ctx; + +#define TEST_MAGIC_SAFETY(fn, _msg) \ + ctx.msg = _msg; \ + ctx.fnc = fn; \ + ctx.did = EINA_FALSE + + eina_log_print_cb_set(_eina_test_safety_print_cb, &ctx); + +#ifdef SHOW_LOG + fprintf(stderr, "you should have a safety check failure below:\n"); +#endif + TEST_MAGIC_SAFETY("eina_unicode_strnlen", + "safety check failed: ustr == NULL"); + fail_if(eina_unicode_strnlen(NULL,0) != 0); + fail_unless(ctx.did); + + eina_log_print_cb_set(eina_log_print_cb_stderr, NULL); +#undef TEST_MAGIC_SAFETY + } +#endif eina_shutdown(); } diff --git a/libraries/eina/src/tests/eina_test_value.c b/libraries/eina/src/tests/eina_test_value.c index 2d04c2f..94a5ab7 100644 --- a/libraries/eina/src/tests/eina_test_value.c +++ b/libraries/eina/src/tests/eina_test_value.c @@ -1140,8 +1140,10 @@ START_TEST(eina_value_test_array) fail_unless(eina_inarray_append(inarray, &c) >= 0); desc.subtype = EINA_VALUE_TYPE_CHAR; desc.step = 0; - desc.array = inarray; /* will be adopted and freed by value */ + desc.array = inarray; fail_unless(eina_value_set(value, desc)); /* manually configure */ + eina_inarray_free(inarray); + fail_unless(eina_value_array_get(value, 0, &c)); fail_unless(c == 11); fail_unless(eina_value_array_get(value, 1, &c)); @@ -1242,11 +1244,13 @@ START_TEST(eina_value_test_list) desc.subtype = EINA_VALUE_TYPE_STRING; desc.list = NULL; - desc.list = eina_list_append(desc.list, strdup("hello")); - desc.list = eina_list_append(desc.list, strdup("world")); - desc.list = eina_list_append(desc.list, strdup("eina")); + desc.list = eina_list_append(desc.list, "hello"); + desc.list = eina_list_append(desc.list, "world"); + desc.list = eina_list_append(desc.list, "eina"); fail_unless(eina_list_count(desc.list) == 3); fail_unless(eina_value_set(value, desc)); + eina_list_free(desc.list); + fail_unless(eina_value_list_get(value, 0, &s)); fail_unless(s != NULL); fail_unless(strcmp(s, "hello") == 0); @@ -1351,14 +1355,17 @@ START_TEST(eina_value_test_hash) fail_unless(desc.hash != NULL); /* watch out hash pointer is to a size of subtype->value_size! */ ptr = malloc(sizeof(char *)); - *ptr = strdup("there"); + *ptr = "there"; fail_unless(eina_hash_add(desc.hash, "hi", ptr)); ptr = malloc(sizeof(char *)); - *ptr = strdup("y"); + *ptr = "y"; fail_unless(eina_hash_add(desc.hash, "x", ptr)); - fail_unless(eina_value_set(value, desc)); + free(eina_hash_find(desc.hash, "hi")); + free(eina_hash_find(desc.hash, "x")); + eina_hash_free(desc.hash); + fail_unless(eina_value_hash_get(value, "hi", &s)); fail_unless(s != NULL); fail_unless(strcmp(s, "there") == 0); @@ -1606,6 +1613,20 @@ START_TEST(eina_value_test_struct) fail_unless(eina_value_struct_get(value, "c", &c)); fail_unless(c == 0xf); + fail_unless(eina_value_struct_member_value_get + (value, myst_members + 0, &other)); + fail_unless(other.type == EINA_VALUE_TYPE_INT); + fail_unless(eina_value_get(&other, &i)); + fail_unless(i == 5678); + eina_value_flush(&other); + + fail_unless(eina_value_struct_member_value_get + (value, myst_members + 1, &other)); + fail_unless(other.type == EINA_VALUE_TYPE_CHAR); + fail_unless(eina_value_get(&other, &c)); + fail_unless(c = 0xf); + eina_value_flush(&other); + str = eina_value_to_string(value); fail_unless(str != NULL); fail_unless(strcmp(str, "{i: 5678, c: 15}") == 0); @@ -1704,6 +1725,7 @@ START_TEST(eina_value_test_struct) fail_unless(strcmp(str, "{a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8, i: 9, j: 10, k: 12, l: 13, m: 14, n: 15, o: 16, p: 17, q: 18, r: 19, s: 20, t: 21, u: 22, v: 23, x: 24}") == 0); free(str); + eina_value_flush(&other); eina_value_free(value); eina_shutdown(); } @@ -1728,7 +1750,7 @@ START_TEST(eina_value_test_array_of_struct) EINA_VALUE_STRUCT_OPERATIONS_BINSEARCH, myst_members, 4, sizeof(struct myst) }; - Eina_Value *value; + Eina_Value *value, array_item; char *str; int i; @@ -1740,20 +1762,17 @@ START_TEST(eina_value_test_array_of_struct) for (i = 0; i < 10; i++) { Eina_Value_Struct desc; - struct myst *st; + struct myst st; char buf[64]; snprintf(buf, sizeof(buf), "item%02d", i); - st = malloc(sizeof(struct myst)); - fail_unless(st != NULL); - st->a = i; - st->b = i * 10; - st->c = i * 100; - st->s = strdup(buf); - fail_unless(st->s != NULL); + st.a = i; + st.b = i * 10; + st.c = i * 100; + st.s = buf; desc.desc = &myst_desc; - desc.memory = st; + desc.memory = &st; fail_unless(eina_value_array_append(value, desc)); } @@ -1773,11 +1792,66 @@ START_TEST(eina_value_test_array_of_struct) "]") == 0); free(str); + eina_value_array_value_get(value, 2, &array_item); + eina_value_struct_get(&array_item, "a", &i); + ck_assert_int_eq(i, 2); + eina_value_struct_get(&array_item, "b", &i); + ck_assert_int_eq(i, 20); + eina_value_struct_get(&array_item, "c", &i); + ck_assert_int_eq(i, 200); + eina_value_struct_get(&array_item, "s", &str); + ck_assert_str_eq(str, "item02"); + eina_value_flush(&array_item); + eina_value_free(value); eina_shutdown(); } END_TEST + +START_TEST(eina_value_test_model) +{ + Eina_Value *value, inv; + Eina_Model *model, *m; + char *str; + + eina_init(); + + value = eina_value_new(EINA_VALUE_TYPE_MODEL); + fail_unless(value != NULL); + + model = eina_model_new(EINA_MODEL_TYPE_GENERIC); + fail_unless(model != NULL); + + fail_unless(eina_value_setup(&inv, EINA_VALUE_TYPE_INT)); + fail_unless(eina_value_set(&inv, 1234)); + fail_unless(eina_model_property_set(model, "i", &inv)); + eina_value_flush(&inv); + + fail_unless(eina_value_set(value, model)); + fail_unless(eina_model_refcount(model) == 2); + + fail_unless(eina_value_get(value, &m)); + fail_unless(m == model); + fail_unless(eina_model_refcount(m) == 2); + + fail_unless(eina_value_pset(value, &model)); + fail_unless(eina_model_refcount(model) == 2); + + str = eina_value_to_string(value); + fail_unless(str != NULL); + fail_unless(strcmp(str, "Eina_Model_Type_Generic({i: 1234}, [])") == 0); + free(str); + + eina_value_free(value); + + fail_unless(eina_model_refcount(model) == 1); + eina_model_unref(model); + + eina_shutdown(); +} +END_TEST + void eina_test_value(TCase *tc) { @@ -1796,4 +1870,5 @@ eina_test_value(TCase *tc) tcase_add_test(tc, eina_value_test_blob); tcase_add_test(tc, eina_value_test_struct); tcase_add_test(tc, eina_value_test_array_of_struct); + tcase_add_test(tc, eina_value_test_model); } -- cgit v1.1