From dd7595a3475407a7fa96a97393bae8c5220e8762 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Wed, 4 Jan 2012 18:41:13 +1000 Subject: Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje. Note that embryo wont be used, but I'm not sure yet if you can build edje without it. --- libraries/eina/src/examples/Makefile.am | 84 +++ libraries/eina/src/examples/Makefile.in | 954 +++++++++++++++++++++++++ libraries/eina/src/examples/eina_accessor_01.c | 55 ++ libraries/eina/src/examples/eina_array_01.c | 51 ++ libraries/eina/src/examples/eina_array_02.c | 57 ++ libraries/eina/src/examples/eina_error_01.c | 80 +++ libraries/eina/src/examples/eina_file_01.c | 45 ++ libraries/eina/src/examples/eina_hash_01.c | 195 +++++ libraries/eina/src/examples/eina_hash_02.c | 144 ++++ libraries/eina/src/examples/eina_hash_03.c | 195 +++++ libraries/eina/src/examples/eina_hash_04.c | 195 +++++ libraries/eina/src/examples/eina_hash_05.c | 198 +++++ libraries/eina/src/examples/eina_hash_06.c | 198 +++++ libraries/eina/src/examples/eina_hash_07.c | 219 ++++++ libraries/eina/src/examples/eina_hash_08.c | 125 ++++ libraries/eina/src/examples/eina_inlist_01.c | 96 +++ libraries/eina/src/examples/eina_inlist_02.c | 64 ++ libraries/eina/src/examples/eina_inlist_03.c | 73 ++ libraries/eina/src/examples/eina_iterator_01.c | 66 ++ libraries/eina/src/examples/eina_list_01.c | 44 ++ libraries/eina/src/examples/eina_list_02.c | 55 ++ libraries/eina/src/examples/eina_list_03.c | 45 ++ libraries/eina/src/examples/eina_list_04.c | 36 + libraries/eina/src/examples/eina_log_01.c | 27 + libraries/eina/src/examples/eina_log_02.c | 38 + libraries/eina/src/examples/eina_log_03.c | 78 ++ libraries/eina/src/examples/eina_str_01.c | 65 ++ libraries/eina/src/examples/eina_strbuf_01.c | 41 ++ libraries/eina/src/examples/eina_tiler_01.c | 316 ++++++++ 29 files changed, 3839 insertions(+) create mode 100644 libraries/eina/src/examples/Makefile.am create mode 100644 libraries/eina/src/examples/Makefile.in create mode 100644 libraries/eina/src/examples/eina_accessor_01.c create mode 100644 libraries/eina/src/examples/eina_array_01.c create mode 100644 libraries/eina/src/examples/eina_array_02.c create mode 100644 libraries/eina/src/examples/eina_error_01.c create mode 100644 libraries/eina/src/examples/eina_file_01.c create mode 100644 libraries/eina/src/examples/eina_hash_01.c create mode 100644 libraries/eina/src/examples/eina_hash_02.c create mode 100644 libraries/eina/src/examples/eina_hash_03.c create mode 100644 libraries/eina/src/examples/eina_hash_04.c create mode 100644 libraries/eina/src/examples/eina_hash_05.c create mode 100644 libraries/eina/src/examples/eina_hash_06.c create mode 100644 libraries/eina/src/examples/eina_hash_07.c create mode 100644 libraries/eina/src/examples/eina_hash_08.c create mode 100644 libraries/eina/src/examples/eina_inlist_01.c create mode 100644 libraries/eina/src/examples/eina_inlist_02.c create mode 100644 libraries/eina/src/examples/eina_inlist_03.c create mode 100644 libraries/eina/src/examples/eina_iterator_01.c create mode 100644 libraries/eina/src/examples/eina_list_01.c create mode 100644 libraries/eina/src/examples/eina_list_02.c create mode 100644 libraries/eina/src/examples/eina_list_03.c create mode 100644 libraries/eina/src/examples/eina_list_04.c create mode 100644 libraries/eina/src/examples/eina_log_01.c create mode 100644 libraries/eina/src/examples/eina_log_02.c create mode 100644 libraries/eina/src/examples/eina_log_03.c create mode 100644 libraries/eina/src/examples/eina_str_01.c create mode 100644 libraries/eina/src/examples/eina_strbuf_01.c create mode 100644 libraries/eina/src/examples/eina_tiler_01.c (limited to 'libraries/eina/src/examples') diff --git a/libraries/eina/src/examples/Makefile.am b/libraries/eina/src/examples/Makefile.am new file mode 100644 index 0000000..ea5ca6a --- /dev/null +++ b/libraries/eina/src/examples/Makefile.am @@ -0,0 +1,84 @@ +MAINTAINERCLEANFILES = Makefile.in + +pkglibdir = $(datadir)/$(PACKAGE)/examples + +AM_CPPFLAGS = \ +-I. \ +-I$(top_srcdir)/src/include \ +-I$(top_builddir)/src/include + +LDADD = \ + $(top_builddir)/src/lib/libeina.la + +SRCS = \ + 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_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_inlist_01.c \ + eina_inlist_02.c \ + eina_inlist_03.c \ + eina_str_01.c \ + eina_strbuf_01.c \ + eina_tiler_01.c + +pkglib_PROGRAMS = + +if EFL_INSTALL_EXAMPLES +filesdir = $(datadir)/$(PACKAGE)/examples +files_DATA = $(SRCS) +endif + +if EFL_BUILD_EXAMPLES +pkglib_PROGRAMS += \ + eina_accessor_01 \ + eina_array_01 \ + eina_array_02 \ + eina_error_01 \ + eina_file_01 \ + eina_hash_01 \ + eina_hash_02 \ + eina_hash_03 \ + eina_hash_04 \ + eina_hash_05 \ + eina_hash_06 \ + eina_hash_07 \ + eina_hash_08 \ + eina_iterator_01 \ + eina_list_01 \ + eina_list_02 \ + eina_list_03 \ + eina_list_04 \ + eina_log_01 \ + eina_log_02 \ + eina_log_03 \ + eina_inlist_01 \ + eina_inlist_02 \ + eina_inlist_03 \ + eina_str_01 \ + eina_strbuf_01 + +if BUILD_TILER_EXAMPLE +AM_CPPFLAGS += @ECORE_EVAS_CFLAGS@ +pkglib_PROGRAMS += eina_tiler_01 +eina_tiler_01_LDADD = $(top_builddir)/src/lib/libeina.la @ECORE_EVAS_LIBS@ +endif + +endif diff --git a/libraries/eina/src/examples/Makefile.in b/libraries/eina/src/examples/Makefile.in new file mode 100644 index 0000000..3379e55 --- /dev/null +++ b/libraries/eina/src/examples/Makefile.in @@ -0,0 +1,954 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +pkglib_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2) +@EFL_BUILD_EXAMPLES_TRUE@am__append_1 = \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_accessor_01 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_array_01 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_array_02 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_error_01 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_file_01 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_01 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_02 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_03 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_04 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_05 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_06 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_07 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_08 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_iterator_01 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_list_01 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_list_02 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_list_03 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_list_04 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_log_01 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_log_02 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_log_03 \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_inlist_01 \ +@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 + +@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__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +@EFL_BUILD_EXAMPLES_TRUE@am__EXEEXT_1 = eina_accessor_01$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_array_01$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_array_02$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_error_01$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_file_01$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_01$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_02$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_03$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_04$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_05$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_06$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_07$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_08$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_iterator_01$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_list_01$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_list_02$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_list_03$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_list_04$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_log_01$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_log_02$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_log_03$(EXEEXT) \ +@EFL_BUILD_EXAMPLES_TRUE@ eina_inlist_01$(EXEEXT) \ +@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) +@BUILD_TILER_EXAMPLE_TRUE@@EFL_BUILD_EXAMPLES_TRUE@am__EXEEXT_2 = eina_tiler_01$(EXEEXT) +am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(filesdir)" +PROGRAMS = $(pkglib_PROGRAMS) +eina_accessor_01_SOURCES = eina_accessor_01.c +eina_accessor_01_OBJECTS = eina_accessor_01.$(OBJEXT) +eina_accessor_01_LDADD = $(LDADD) +eina_accessor_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +eina_array_01_SOURCES = eina_array_01.c +eina_array_01_OBJECTS = eina_array_01.$(OBJEXT) +eina_array_01_LDADD = $(LDADD) +eina_array_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_array_02_SOURCES = eina_array_02.c +eina_array_02_OBJECTS = eina_array_02.$(OBJEXT) +eina_array_02_LDADD = $(LDADD) +eina_array_02_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_error_01_SOURCES = eina_error_01.c +eina_error_01_OBJECTS = eina_error_01.$(OBJEXT) +eina_error_01_LDADD = $(LDADD) +eina_error_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_file_01_SOURCES = eina_file_01.c +eina_file_01_OBJECTS = eina_file_01.$(OBJEXT) +eina_file_01_LDADD = $(LDADD) +eina_file_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_hash_01_SOURCES = eina_hash_01.c +eina_hash_01_OBJECTS = eina_hash_01.$(OBJEXT) +eina_hash_01_LDADD = $(LDADD) +eina_hash_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_hash_02_SOURCES = eina_hash_02.c +eina_hash_02_OBJECTS = eina_hash_02.$(OBJEXT) +eina_hash_02_LDADD = $(LDADD) +eina_hash_02_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_hash_03_SOURCES = eina_hash_03.c +eina_hash_03_OBJECTS = eina_hash_03.$(OBJEXT) +eina_hash_03_LDADD = $(LDADD) +eina_hash_03_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_hash_04_SOURCES = eina_hash_04.c +eina_hash_04_OBJECTS = eina_hash_04.$(OBJEXT) +eina_hash_04_LDADD = $(LDADD) +eina_hash_04_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_hash_05_SOURCES = eina_hash_05.c +eina_hash_05_OBJECTS = eina_hash_05.$(OBJEXT) +eina_hash_05_LDADD = $(LDADD) +eina_hash_05_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_hash_06_SOURCES = eina_hash_06.c +eina_hash_06_OBJECTS = eina_hash_06.$(OBJEXT) +eina_hash_06_LDADD = $(LDADD) +eina_hash_06_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_hash_07_SOURCES = eina_hash_07.c +eina_hash_07_OBJECTS = eina_hash_07.$(OBJEXT) +eina_hash_07_LDADD = $(LDADD) +eina_hash_07_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +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_inlist_01_SOURCES = eina_inlist_01.c +eina_inlist_01_OBJECTS = eina_inlist_01.$(OBJEXT) +eina_inlist_01_LDADD = $(LDADD) +eina_inlist_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_inlist_02_SOURCES = eina_inlist_02.c +eina_inlist_02_OBJECTS = eina_inlist_02.$(OBJEXT) +eina_inlist_02_LDADD = $(LDADD) +eina_inlist_02_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_inlist_03_SOURCES = eina_inlist_03.c +eina_inlist_03_OBJECTS = eina_inlist_03.$(OBJEXT) +eina_inlist_03_LDADD = $(LDADD) +eina_inlist_03_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_iterator_01_SOURCES = eina_iterator_01.c +eina_iterator_01_OBJECTS = eina_iterator_01.$(OBJEXT) +eina_iterator_01_LDADD = $(LDADD) +eina_iterator_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_list_01_SOURCES = eina_list_01.c +eina_list_01_OBJECTS = eina_list_01.$(OBJEXT) +eina_list_01_LDADD = $(LDADD) +eina_list_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_list_02_SOURCES = eina_list_02.c +eina_list_02_OBJECTS = eina_list_02.$(OBJEXT) +eina_list_02_LDADD = $(LDADD) +eina_list_02_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_list_03_SOURCES = eina_list_03.c +eina_list_03_OBJECTS = eina_list_03.$(OBJEXT) +eina_list_03_LDADD = $(LDADD) +eina_list_03_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_list_04_SOURCES = eina_list_04.c +eina_list_04_OBJECTS = eina_list_04.$(OBJEXT) +eina_list_04_LDADD = $(LDADD) +eina_list_04_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_log_01_SOURCES = eina_log_01.c +eina_log_01_OBJECTS = eina_log_01.$(OBJEXT) +eina_log_01_LDADD = $(LDADD) +eina_log_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_log_02_SOURCES = eina_log_02.c +eina_log_02_OBJECTS = eina_log_02.$(OBJEXT) +eina_log_02_LDADD = $(LDADD) +eina_log_02_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +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_str_01_SOURCES = eina_str_01.c +eina_str_01_OBJECTS = eina_str_01.$(OBJEXT) +eina_str_01_LDADD = $(LDADD) +eina_str_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la +eina_strbuf_01_SOURCES = eina_strbuf_01.c +eina_strbuf_01_OBJECTS = eina_strbuf_01.$(OBJEXT) +eina_strbuf_01_LDADD = $(LDADD) +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 +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +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 +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 +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +DATA = $(files_DATA) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +pkglibdir = $(datadir)/$(PACKAGE)/examples +ACLOCAL = @ACLOCAL@ +ALLOCA = @ALLOCA@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +AR = @AR@ +AS = @AS@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECK_CFLAGS = @CHECK_CFLAGS@ +CHECK_LIBS = @CHECK_LIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@ +ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@ +EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@ +EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@ +EFL_EINA_BUILD = @EFL_EINA_BUILD@ +EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@ +EFL_PTHREAD_CFLAGS = @EFL_PTHREAD_CFLAGS@ +EFL_PTHREAD_LIBS = @EFL_PTHREAD_LIBS@ +EFL_SIMD_FLAGS = @EFL_SIMD_FLAGS@ +EGREP = @EGREP@ +EINA_CFLAGS = @EINA_CFLAGS@ +EINA_CONFIGURE_DEFAULT_MEMPOOL = @EINA_CONFIGURE_DEFAULT_MEMPOOL@ +EINA_CONFIGURE_HAVE_DEBUG_THREADS = @EINA_CONFIGURE_HAVE_DEBUG_THREADS@ +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@ +EMEMOA_LIBS = @EMEMOA_LIBS@ +ESCAPE_CFLAGS = @ESCAPE_CFLAGS@ +ESCAPE_LIBS = @ESCAPE_LIBS@ +EVIL_CFLAGS = @EVIL_CFLAGS@ +EVIL_LIBS = @EVIL_LIBS@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GLIB_CFLAGS = @GLIB_CFLAGS@ +GLIB_LIBS = @GLIB_LIBS@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULE_ARCH = @MODULE_ARCH@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +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@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ +VALGRIND_LIBS = @VALGRIND_LIBS@ +VERSION = @VERSION@ +VMAJ = @VMAJ@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +dlopen_libs = @dlopen_libs@ +docdir = @docdir@ +dvidir = @dvidir@ +efl_doxygen = @efl_doxygen@ +efl_have_doxygen = @efl_have_doxygen@ +exec_prefix = @exec_prefix@ +have_lcov = @have_lcov@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +iconv_libs = @iconv_libs@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +lt_enable_auto_import = @lt_enable_auto_import@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgconfig_requires_private = @pkgconfig_requires_private@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +release_info = @release_info@ +requirement_eina = @requirement_eina@ +rt_libs = @rt_libs@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +version_info = @version_info@ +MAINTAINERCLEANFILES = Makefile.in +AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include \ + -I$(top_builddir)/src/include $(am__append_2) +LDADD = \ + $(top_builddir)/src/lib/libeina.la + +SRCS = \ + 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_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_inlist_01.c \ + eina_inlist_02.c \ + eina_inlist_03.c \ + eina_str_01.c \ + eina_strbuf_01.c \ + eina_tiler_01.c + +@EFL_INSTALL_EXAMPLES_TRUE@filesdir = $(datadir)/$(PACKAGE)/examples +@EFL_INSTALL_EXAMPLES_TRUE@files_DATA = $(SRCS) +@BUILD_TILER_EXAMPLE_TRUE@@EFL_BUILD_EXAMPLES_TRUE@eina_tiler_01_LDADD = $(top_builddir)/src/lib/libeina.la @ECORE_EVAS_LIBS@ +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/examples/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu src/examples/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): +install-pkglibPROGRAMS: $(pkglib_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" + @list='$(pkglib_PROGRAMS)'; test -n "$(pkglibdir)" || list=; \ + for p in $$list; do echo "$$p $$p"; done | \ + sed 's/$(EXEEXT)$$//' | \ + while read p p1; do if test -f $$p || test -f $$p1; \ + then echo "$$p"; echo "$$p"; else :; fi; \ + done | \ + sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ + -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ + sed 'N;N;N;s,\n, ,g' | \ + $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ + { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ + if ($$2 == $$4) files[d] = files[d] " " $$1; \ + else { print "f", $$3 "/" $$4, $$1; } } \ + END { for (d in files) print "f", d, files[d] }' | \ + while read type dir files; do \ + if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ + test -z "$$files" || { \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(pkglibdir)$$dir'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkglibdir)$$dir" || exit $$?; \ + } \ + ; done + +uninstall-pkglibPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_PROGRAMS)'; test -n "$(pkglibdir)" || list=; \ + files=`for p in $$list; do echo "$$p"; done | \ + sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ + -e 's/$$/$(EXEEXT)/' `; \ + test -n "$$list" || exit 0; \ + echo " ( cd '$(DESTDIR)$(pkglibdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(pkglibdir)" && rm -f $$files + +clean-pkglibPROGRAMS: + @list='$(pkglib_PROGRAMS)'; test -n "$$list" || exit 0; \ + echo " rm -f" $$list; \ + rm -f $$list || exit $$?; \ + test -n "$(EXEEXT)" || exit 0; \ + list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f" $$list; \ + rm -f $$list +eina_accessor_01$(EXEEXT): $(eina_accessor_01_OBJECTS) $(eina_accessor_01_DEPENDENCIES) + @rm -f eina_accessor_01$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_accessor_01_OBJECTS) $(eina_accessor_01_LDADD) $(LIBS) +eina_array_01$(EXEEXT): $(eina_array_01_OBJECTS) $(eina_array_01_DEPENDENCIES) + @rm -f eina_array_01$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_array_01_OBJECTS) $(eina_array_01_LDADD) $(LIBS) +eina_array_02$(EXEEXT): $(eina_array_02_OBJECTS) $(eina_array_02_DEPENDENCIES) + @rm -f eina_array_02$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_array_02_OBJECTS) $(eina_array_02_LDADD) $(LIBS) +eina_error_01$(EXEEXT): $(eina_error_01_OBJECTS) $(eina_error_01_DEPENDENCIES) + @rm -f eina_error_01$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_error_01_OBJECTS) $(eina_error_01_LDADD) $(LIBS) +eina_file_01$(EXEEXT): $(eina_file_01_OBJECTS) $(eina_file_01_DEPENDENCIES) + @rm -f eina_file_01$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_file_01_OBJECTS) $(eina_file_01_LDADD) $(LIBS) +eina_hash_01$(EXEEXT): $(eina_hash_01_OBJECTS) $(eina_hash_01_DEPENDENCIES) + @rm -f eina_hash_01$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_hash_01_OBJECTS) $(eina_hash_01_LDADD) $(LIBS) +eina_hash_02$(EXEEXT): $(eina_hash_02_OBJECTS) $(eina_hash_02_DEPENDENCIES) + @rm -f eina_hash_02$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_hash_02_OBJECTS) $(eina_hash_02_LDADD) $(LIBS) +eina_hash_03$(EXEEXT): $(eina_hash_03_OBJECTS) $(eina_hash_03_DEPENDENCIES) + @rm -f eina_hash_03$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_hash_03_OBJECTS) $(eina_hash_03_LDADD) $(LIBS) +eina_hash_04$(EXEEXT): $(eina_hash_04_OBJECTS) $(eina_hash_04_DEPENDENCIES) + @rm -f eina_hash_04$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_hash_04_OBJECTS) $(eina_hash_04_LDADD) $(LIBS) +eina_hash_05$(EXEEXT): $(eina_hash_05_OBJECTS) $(eina_hash_05_DEPENDENCIES) + @rm -f eina_hash_05$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_hash_05_OBJECTS) $(eina_hash_05_LDADD) $(LIBS) +eina_hash_06$(EXEEXT): $(eina_hash_06_OBJECTS) $(eina_hash_06_DEPENDENCIES) + @rm -f eina_hash_06$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_hash_06_OBJECTS) $(eina_hash_06_LDADD) $(LIBS) +eina_hash_07$(EXEEXT): $(eina_hash_07_OBJECTS) $(eina_hash_07_DEPENDENCIES) + @rm -f eina_hash_07$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_hash_07_OBJECTS) $(eina_hash_07_LDADD) $(LIBS) +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_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) +eina_inlist_02$(EXEEXT): $(eina_inlist_02_OBJECTS) $(eina_inlist_02_DEPENDENCIES) + @rm -f eina_inlist_02$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_inlist_02_OBJECTS) $(eina_inlist_02_LDADD) $(LIBS) +eina_inlist_03$(EXEEXT): $(eina_inlist_03_OBJECTS) $(eina_inlist_03_DEPENDENCIES) + @rm -f eina_inlist_03$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_inlist_03_OBJECTS) $(eina_inlist_03_LDADD) $(LIBS) +eina_iterator_01$(EXEEXT): $(eina_iterator_01_OBJECTS) $(eina_iterator_01_DEPENDENCIES) + @rm -f eina_iterator_01$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_iterator_01_OBJECTS) $(eina_iterator_01_LDADD) $(LIBS) +eina_list_01$(EXEEXT): $(eina_list_01_OBJECTS) $(eina_list_01_DEPENDENCIES) + @rm -f eina_list_01$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_list_01_OBJECTS) $(eina_list_01_LDADD) $(LIBS) +eina_list_02$(EXEEXT): $(eina_list_02_OBJECTS) $(eina_list_02_DEPENDENCIES) + @rm -f eina_list_02$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_list_02_OBJECTS) $(eina_list_02_LDADD) $(LIBS) +eina_list_03$(EXEEXT): $(eina_list_03_OBJECTS) $(eina_list_03_DEPENDENCIES) + @rm -f eina_list_03$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_list_03_OBJECTS) $(eina_list_03_LDADD) $(LIBS) +eina_list_04$(EXEEXT): $(eina_list_04_OBJECTS) $(eina_list_04_DEPENDENCIES) + @rm -f eina_list_04$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_list_04_OBJECTS) $(eina_list_04_LDADD) $(LIBS) +eina_log_01$(EXEEXT): $(eina_log_01_OBJECTS) $(eina_log_01_DEPENDENCIES) + @rm -f eina_log_01$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_log_01_OBJECTS) $(eina_log_01_LDADD) $(LIBS) +eina_log_02$(EXEEXT): $(eina_log_02_OBJECTS) $(eina_log_02_DEPENDENCIES) + @rm -f eina_log_02$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_log_02_OBJECTS) $(eina_log_02_LDADD) $(LIBS) +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_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) +eina_strbuf_01$(EXEEXT): $(eina_strbuf_01_OBJECTS) $(eina_strbuf_01_DEPENDENCIES) + @rm -f eina_strbuf_01$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(eina_strbuf_01_OBJECTS) $(eina_strbuf_01_LDADD) $(LIBS) +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) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_accessor_01.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_array_01.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_array_02.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_error_01.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_file_01.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_hash_01.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_hash_02.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_hash_03.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_hash_04.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_hash_05.Po@am__quote@ +@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_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@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_iterator_01.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_list_01.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_list_02.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_list_03.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_list_04.Po@am__quote@ +@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_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@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs +install-filesDATA: $(files_DATA) + @$(NORMAL_INSTALL) + test -z "$(filesdir)" || $(MKDIR_P) "$(DESTDIR)$(filesdir)" + @list='$(files_DATA)'; test -n "$(filesdir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(filesdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(filesdir)" || exit $$?; \ + done + +uninstall-filesDATA: + @$(NORMAL_UNINSTALL) + @list='$(files_DATA)'; test -n "$(filesdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + test -n "$$files" || exit 0; \ + echo " ( cd '$(DESTDIR)$(filesdir)' && rm -f" $$files ")"; \ + cd "$(DESTDIR)$(filesdir)" && rm -f $$files + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) $(DATA) +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(filesdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-generic clean-libtool clean-pkglibPROGRAMS \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-filesDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-pkglibPROGRAMS + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-filesDATA uninstall-pkglibPROGRAMS + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-pkglibPROGRAMS ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-filesDATA \ + install-html install-html-am install-info install-info-am \ + install-man install-pdf install-pdf-am install-pkglibPROGRAMS \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-filesDATA \ + uninstall-pkglibPROGRAMS + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/libraries/eina/src/examples/eina_accessor_01.c b/libraries/eina/src/examples/eina_accessor_01.c new file mode 100644 index 0000000..c48fdc6 --- /dev/null +++ b/libraries/eina/src/examples/eina_accessor_01.c @@ -0,0 +1,55 @@ +//Compile with: +//gcc -g `pkg-config --cflags --libs eina` eina_accessor_01.c -o eina_accessor_01 + +#include + +#include + +int +main(int argc, char **argv) +{ + const char *strings[] = { + "even", "odd", "even", "odd", "even", "odd", "even", "odd", "even", "odd" + }; + const char *more_strings[] = { + "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" + }; + Eina_Array *array; + Eina_List *list = NULL; + Eina_Accessor *acc; + unsigned short int i; + void *data; + + eina_init(); + + array = eina_array_new(10); + + for (i = 0; i < 10; i++) + { + eina_array_push(array, strings[i]); + list = eina_list_append(list, more_strings[i]); + } + + acc = eina_array_accessor_new(array); + for(i = 1; i < 10; i += 2) + { + eina_accessor_data_get(acc, i, &data); + printf("%s\n", (const char *)data); + } + eina_accessor_free(acc); + eina_array_free(array); + + acc = eina_list_accessor_new(list); + for(i = 1; i < 10; i += 2) + { + eina_accessor_data_get(acc, i, &data); + printf("%s\n", (const char *)data); + } + + eina_list_free(eina_accessor_container_get(acc)); + eina_accessor_free(acc); + + eina_shutdown(); + + return 0; +} diff --git a/libraries/eina/src/examples/eina_array_01.c b/libraries/eina/src/examples/eina_array_01.c new file mode 100644 index 0000000..25e0944 --- /dev/null +++ b/libraries/eina/src/examples/eina_array_01.c @@ -0,0 +1,51 @@ +//Compile with: +//gcc -g `pkg-config --cflags --libs eina` eina_array_01.c -o eina_array_01 + +#include +#include + +#include + +static Eina_Bool +_print(const void *container, void *data, void *fdata) +{ + printf("%s\n", data); + return EINA_TRUE; +} + +int +main(int argc, char **argv) +{ + const char* strings[] = { + "helo", "hera", "starbuck", "kat", "boomer", + "hotdog", "longshot", "jammer", "crashdown", "hardball", + "duck", "racetrack", "apolo", "husker", "freaker", + "skulls", "bulldog", "flat top", "hammerhead", "gonzo" + }; + Eina_Array *array; + Eina_Array_Iterator iterator; + char *item; + unsigned int i; + + eina_init(); + + array = eina_array_new(10); + eina_array_step_set(array, sizeof(*array), 20); + + for (i = 0; i < 20; i++) + eina_array_push(array, strdup(strings[i])); + + printf("array count: %d\n", eina_array_count_get(array)); + eina_array_foreach(array, _print, NULL); + + printf("Top gun: %s\n", (char*)eina_array_data_get(array, 2)); + + while (eina_array_count_get(array)) + free(eina_array_pop(array)); + + eina_array_free(array); + + eina_shutdown(); + + return 0; +} diff --git a/libraries/eina/src/examples/eina_array_02.c b/libraries/eina/src/examples/eina_array_02.c new file mode 100644 index 0000000..e897321 --- /dev/null +++ b/libraries/eina/src/examples/eina_array_02.c @@ -0,0 +1,57 @@ +//Compile with: +//gcc -g `pkg-config --cflags --libs eina` eina_array_02.c -o eina_array_02 + +#include +#include + +#include + +Eina_Bool keep(void *data, void *gdata) +{ + if (strlen((const char*)data) <= 5) + return EINA_TRUE; + return EINA_FALSE; +} + +int +main(int argc, char **argv) +{ + const char* strs[] = { + "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", + "ten", "eleven", "twelve", "thirteen", "fourtenn", "fifteen", "sixteen", + "seventeen", "eighteen", "nineteen", "twenty" + }; + const char* strings[] = { + "helo", "hera", "starbuck", "kat", "boomer", + "hotdog", "longshot", "jammer", "crashdown", "hardball", + "duck", "racetrack", "apolo", "husker", "freaker", + "skulls", "bulldog", "flat top", "hammerhead", "gonzo" + }; + Eina_Array *array; + Eina_Array_Iterator iterator; + const char *item; + unsigned int i; + + eina_init(); + + array = eina_array_new(10); + + for (i = 0; i < 20; i++) + eina_array_push(array, strs[i]); + + eina_array_clean(array); + for (i = 0; i < 20; i++) + eina_array_push(array, strings[i]); + + eina_array_data_set(array, 17, "flattop"); + + eina_array_remove(array, keep, NULL); + EINA_ARRAY_ITER_NEXT(array, i, item, iterator) + printf("item #%d: %s\n", i, item); + + eina_array_free(array); + + eina_shutdown(); + + return 0; +} diff --git a/libraries/eina/src/examples/eina_error_01.c b/libraries/eina/src/examples/eina_error_01.c new file mode 100644 index 0000000..90e845d --- /dev/null +++ b/libraries/eina/src/examples/eina_error_01.c @@ -0,0 +1,80 @@ +//Compile with: +//gcc -g `pkg-config --cflags --libs eina` eina_error_01.c -o eina_error_01 + +#include +#include + +#include + +Eina_Error MY_ERROR_NEGATIVE; +Eina_Error MY_ERROR_NULL; + +void *data_new() +{ + eina_error_set(0); + + eina_error_set(MY_ERROR_NULL); + return NULL; +} + +int test(int n) +{ + eina_error_set(0); + + if (n < 0) + { + eina_error_set(MY_ERROR_NEGATIVE); + return 0; + } + + return 1; +} + +int main(void) +{ + void *data; + + if (!eina_init()) + { + printf ("Error during the initialization of eina_error module\n"); + return EXIT_FAILURE; + } + + MY_ERROR_NEGATIVE = eina_error_msg_static_register("Negative number"); + MY_ERROR_NULL = eina_error_msg_static_register("NULL pointer"); + + data = data_new(); + if (!data) + { + Eina_Error err; + + err = eina_error_get(); + if (err) + printf("Error during memory allocation: %s\n", + eina_error_msg_get(err)); + } + + if (!test(0)) + { + Eina_Error err; + + err = eina_error_get(); + if (err) + printf("Error during test function: %s\n", + eina_error_msg_get(err)); + } + + if (!test(-1)) + { + Eina_Error err; + + err = eina_error_get(); + if (err) + printf("Error during test function: %s\n", + eina_error_msg_get(err)); + } + + 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 new file mode 100644 index 0000000..6490b62 --- /dev/null +++ b/libraries/eina/src/examples/eina_file_01.c @@ -0,0 +1,45 @@ +//Compile with: +//gcc -g `pkg-config --cflags --libs eina` eina_file_01.c -o eina_file_01 + +#include +#include + +static void +_print_cb(const char *name, const char *path, void *data) +{ + printf("file %s in %s\n", name, path); +} + +int +main(int argc, char **argv) +{ + Eina_Iterator *it; + const char *f_name; + const Eina_File_Direct_Info *f_info; + + eina_init(); + + eina_file_dir_list("/home/", EINA_FALSE, _print_cb, NULL); + + it = eina_file_ls("/home/"); + EINA_ITERATOR_FOREACH(it, f_name) + { + printf("%s\n", f_name); + eina_stringshare_del(f_name); + } + eina_iterator_free(it); + + it = eina_file_stat_ls("/home/"); + EINA_ITERATOR_FOREACH(it, f_info) + printf("%s if of type %d\n", f_info->path, f_info->type); + eina_iterator_free(it); + + it = eina_file_direct_ls("/home/"); + EINA_ITERATOR_FOREACH(it, f_info) + printf("%s if of type %d\n", f_info->path, f_info->type); + eina_iterator_free(it); + + eina_shutdown(); + + return 0; +} diff --git a/libraries/eina/src/examples/eina_hash_01.c b/libraries/eina/src/examples/eina_hash_01.c new file mode 100644 index 0000000..549ca80 --- /dev/null +++ b/libraries/eina/src/examples/eina_hash_01.c @@ -0,0 +1,195 @@ +#include +#include +#include + +/* + * Eina Hash - phonebook + * + * This example demonstrate the use of Eina Hash by implementing a phonebook + * that stores its contact data into the hash. + * + * It indexes the phone numbers by Contact Full Name, so it's a hash with + * string keys. + */ + +struct _Phone_Entry { + const char *name; // Full name. + const char *number; // Phone number. +}; + +typedef struct _Phone_Entry Phone_Entry; + +static Phone_Entry _start_entries[] = { + { "Wolfgang Amadeus Mozart", "+01 23 456-78910" }, + { "Ludwig van Beethoven", "+12 34 567-89101" }, + { "Richard Georg Strauss", "+23 45 678-91012" }, + { "Heitor Villa-Lobos", "+34 56 789-10123" }, + { NULL, NULL } +}; // _start_entries + +static void +_phone_entry_free_cb(void *data) +{ + free(data); +} + +static Eina_Bool +_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key, + void *data, void *fdata) +{ + const char *name = key; + const char *number = data; + printf("%s: %s\n", name, number); + + // Return EINA_FALSE to stop this callback from being called + return EINA_TRUE; +} + +int +main(int argc, const char *argv[]) +{ + Eina_Hash *phone_book = NULL; + int i; + const char *entry_name = "Heitor Villa-Lobos"; + char *phone = NULL; + Eina_Bool r; + Eina_Iterator *it; + void *data; + + eina_init(); + + phone_book = eina_hash_string_superfast_new(_phone_entry_free_cb); + + // Add initial entries to our hash + for (i = 0; _start_entries[i].name != NULL; i++) + { + eina_hash_add(phone_book, _start_entries[i].name, + strdup(_start_entries[i].number)); + } + + // Look for a specific entry and get its phone number + phone = eina_hash_find(phone_book, entry_name); + if (phone) + { + printf("Printing entry.\n"); + printf("Name: %s\n", entry_name); + printf("Number: %s\n\n", phone); + } + + // Delete this entry + r = eina_hash_del(phone_book, entry_name, NULL); + printf("Hash entry successfully deleted? %d\n\n", r); + + // Modify the pointer data of an entry and free the old one + phone = eina_hash_modify(phone_book, "Richard Georg Strauss", + strdup("+23 45 111-11111")); + free(phone); + + // Modify or add an entry to the hash with eina_hash_set + // Let's first add a new entry + eina_error_set(0); + phone = eina_hash_set(phone_book, "Raul Seixas", + strdup("+55 01 234-56789")); + if (!phone) + { + Eina_Error err = eina_error_get(); + if (!err) + { + printf("No previous phone found for Raul Seixas. "); + printf("Creating new entry.\n"); + } + else + printf("Error when setting phone for Raul Seixas\n"); + } + else + { + printf("Old phone for Raul Seixas was %s\n", phone); + free(phone); + } + + printf("\n"); + + // Now change the phone number + eina_error_set(0); + phone = eina_hash_set(phone_book, "Raul Seixas", + strdup("+55 02 222-22222")); + if (phone) + { + printf("Changing phone for Raul Seixas to +55 02 222-22222. "); + printf("Old phone was %s\n", phone); + free(phone); + } + else + { + Eina_Error err = eina_error_get(); + if (err) + printf("Error when changing phone for Raul Seixas\n"); + else + { + printf("No previous phone found for Raul Seixas. "); + printf("Creating new entry.\n"); + } + } + + // There are many ways to iterate over our Phone book. + // First, iterate showing the names and associated numbers. + printf("List of phones:\n"); + eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL); + printf("\n"); + + // Now iterate using an iterator + printf("List of phones:\n"); + it = eina_hash_iterator_tuple_new(phone_book); + while (eina_iterator_next(it, &data)) + { + Eina_Hash_Tuple *t = data; + const char *name = t->key; + const char *number = t->data; + printf("%s: %s\n", name, number); + } + eina_iterator_free(it); // Always free the iterator after its use + printf("\n"); + + // Just iterate over the keys (names) + printf("List of names in the phone book:\n"); + it = eina_hash_iterator_key_new(phone_book); + while (eina_iterator_next(it, &data)) + { + const char *name = data; + printf("%s\n", name); + } + eina_iterator_free(it); + printf("\n"); + + // Just iterate over the data (numbers) + printf("List of numbers in the phone book:\n"); + it = eina_hash_iterator_data_new(phone_book); + while (eina_iterator_next(it, &data)) + { + const char *number = data; + printf("%s\n", number); + } + eina_iterator_free(it); + printf("\n"); + + // Check how many items are in the phone book + printf("There are %d items in the hash.\n\n", + eina_hash_population(phone_book)); + + // Change the name (key) on an entry + eina_hash_move(phone_book, "Raul Seixas", "Alceu Valenca"); + printf("List of phones after change:\n"); + eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL); + printf("\n"); + + // Empty the phone book, but don't destroy it + eina_hash_free_buckets(phone_book); + printf("There are %d items in the hash.\n\n", + eina_hash_population(phone_book)); + + // Phone book could still be used, but we are freeing it since we are + // done for now + eina_hash_free(phone_book); + + eina_shutdown(); +} diff --git a/libraries/eina/src/examples/eina_hash_02.c b/libraries/eina/src/examples/eina_hash_02.c new file mode 100644 index 0000000..d43d7a3 --- /dev/null +++ b/libraries/eina/src/examples/eina_hash_02.c @@ -0,0 +1,144 @@ +#include +#include +#include + +/* + * Eina Hash - Two more types of hash + * + * This example demonstrate two other types of hash in action - using + * eina_hash_stringshared_new and eina_hash_new. + * + * It indexes the phone numbers by Contact Full Name, so it's a hash with string + * keys, exactly the same as the other example. + */ + +struct _Phone_Entry { + const char *name; // Full name. + const char *number; // Phone number. +}; + +typedef struct _Phone_Entry Phone_Entry; + +static Phone_Entry _start_entries[] = { + { "Wolfgang Amadeus Mozart", "+01 23 456-78910" }, + { "Ludwig van Beethoven", "+12 34 567-89101" }, + { "Richard Georg Strauss", "+23 45 678-91012" }, + { "Heitor Villa-Lobos", "+34 56 789-10123" }, + { NULL, NULL } +}; + +static void +_phone_entry_free_cb(void *data) +{ + free(data); +} + +static void +_phone_book_stringshared_free_cb(void *data) +{ + Phone_Entry *e = data; + eina_stringshare_del(e->name); + eina_stringshare_del(e->number); + free(e); +} + +static Eina_Bool +_phone_book_stringshared_foreach_cb(const Eina_Hash *phone_book, + const void *key, void *data, void *fdata) +{ + Phone_Entry *e = data; + const char *name = e->name; // e->name == key + const char *number = e->number; + printf("%s: %s\n", name, number); + + return EINA_TRUE; +} + +static void +example_hash_stringshared(void) +{ + Eina_Hash *phone_book = NULL; + int i; + + // Create the hash as before + phone_book = eina_hash_stringshared_new(_phone_book_stringshared_free_cb); + + // Add initial entries to our hash, using direct_add + for (i = 0; _start_entries[i].name != NULL; i++) + { + Phone_Entry *e = malloc(sizeof(Phone_Entry)); + e->name = eina_stringshare_add(_start_entries[i].name); + e->number = eina_stringshare_add(_start_entries[i].number); + // Since we are storing the key (name) in our struct, we can use + // eina_hash_direct_add. It could be used in the previous example + // too, since each key is already stored in the _start_entries + // static array, but we started it with the default add function. + eina_hash_direct_add(phone_book, e->name, e); + } + + // Iterate over the elements + printf("List of phones:\n"); + eina_hash_foreach(phone_book, _phone_book_stringshared_foreach_cb, NULL); + printf("\n"); + + eina_hash_free(phone_book); +} + +static unsigned int +_phone_book_string_key_length(const char *key) +{ + if (!key) + return 0; + + return (int)strlen(key) + 1; +} + +static int +_phone_book_string_key_cmp(const char *key1, int key1_length, + const char *key2, int key2_length) +{ + return strcmp(key1, key2); +} + +static void +example_hash_big(void) +{ + Eina_Hash *phone_book = NULL; + int i; + const char *phone; + + // Create the same hash as used in eina_hash_01.c, but + // use 1024 (2 ^ 10) buckets. + phone_book = eina_hash_new(EINA_KEY_LENGTH(_phone_book_string_key_length), + EINA_KEY_CMP(_phone_book_string_key_cmp), + EINA_KEY_HASH(eina_hash_superfast), + _phone_entry_free_cb, + 10); + for (i = 0; _start_entries[i].name != NULL; i++) + { + eina_hash_add(phone_book, _start_entries[i].name, + strdup(_start_entries[i].number)); + } + + // Look for a specific entry and get its phone number + phone = eina_hash_find(phone_book, "Heitor Villa-Lobos"); + if (phone) + { + printf("Printing entry.\n"); + printf("Name: Heitor Villa-Lobos\n"); + printf("Number: %s\n\n", phone); + } + + eina_hash_free(phone_book); +} + +int +main(int argc, const char *argv[]) +{ + eina_init(); + + example_hash_stringshared(); + example_hash_big(); + + eina_shutdown(); +} diff --git a/libraries/eina/src/examples/eina_hash_03.c b/libraries/eina/src/examples/eina_hash_03.c new file mode 100644 index 0000000..719d0d7 --- /dev/null +++ b/libraries/eina/src/examples/eina_hash_03.c @@ -0,0 +1,195 @@ +#include +#include +#include + +/* + * Eina Hash - phonebook + * + * This example demonstrate the use of Eina Hash by implementing a phonebook + * that stores its contact data into the hash. + * + * It indexes the phone numbers by Contact Full Name, so it's a hash with + * string keys. + */ + +struct _Phone_Entry { + const char *name; // Full name. + const char *number; // Phone number. +}; + +typedef struct _Phone_Entry Phone_Entry; + +static Phone_Entry _start_entries[] = { + { "Wolfgang Amadeus Mozart", "+01 23 456-78910" }, + { "Ludwig van Beethoven", "+12 34 567-89101" }, + { "Richard Georg Strauss", "+23 45 678-91012" }, + { "Heitor Villa-Lobos", "+34 56 789-10123" }, + { NULL, NULL } +}; // _start_entries + +static void +_phone_entry_free_cb(void *data) +{ + free(data); +} + +static Eina_Bool +_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key, + void *data, void *fdata) +{ + const char *name = key; + const char *number = data; + printf("%s: %s\n", name, number); + + // Return EINA_FALSE to stop this callback from being called + return EINA_TRUE; +} + +int +main(int argc, const char *argv[]) +{ + Eina_Hash *phone_book = NULL; + int i; + const char *entry_name = "Heitor Villa-Lobos"; + char *phone = NULL; + Eina_Bool r; + Eina_Iterator *it; + void *data; + + eina_init(); + + phone_book = eina_hash_string_small_new(_phone_entry_free_cb); + + // Add initial entries to our hash + for (i = 0; _start_entries[i].name != NULL; i++) + { + eina_hash_add(phone_book, _start_entries[i].name, + strdup(_start_entries[i].number)); + } + + // Look for a specific entry and get its phone number + phone = eina_hash_find(phone_book, entry_name); + if (phone) + { + printf("Printing entry.\n"); + printf("Name: %s\n", entry_name); + printf("Number: %s\n\n", phone); + } + + // Delete this entry + r = eina_hash_del(phone_book, entry_name, NULL); + printf("Hash entry successfully deleted? %d\n\n", r); + + // Modify the pointer data of an entry and free the old one + phone = eina_hash_modify(phone_book, "Richard Georg Strauss", + strdup("+23 45 111-11111")); + free(phone); + + // Modify or add an entry to the hash with eina_hash_set + // Let's first add a new entry + eina_error_set(0); + phone = eina_hash_set(phone_book, "Raul Seixas", + strdup("+55 01 234-56789")); + if (!phone) + { + Eina_Error err = eina_error_get(); + if (!err) + { + printf("No previous phone found for Raul Seixas. "); + printf("Creating new entry.\n"); + } + else + printf("Error when setting phone for Raul Seixas\n"); + } + else + { + printf("Old phone for Raul Seixas was %s\n", phone); + free(phone); + } + + printf("\n"); + + // Now change the phone number + eina_error_set(0); + phone = eina_hash_set(phone_book, "Raul Seixas", + strdup("+55 02 222-22222")); + if (phone) + { + printf("Changing phone for Raul Seixas to +55 02 222-22222. "); + printf("Old phone was %s\n", phone); + free(phone); + } + else + { + Eina_Error err = eina_error_get(); + if (err) + printf("Error when changing phone for Raul Seixas\n"); + else + { + printf("No previous phone found for Raul Seixas. "); + printf("Creating new entry.\n"); + } + } + + // There are many ways to iterate over our Phone book. + // First, iterate showing the names and associated numbers. + printf("List of phones:\n"); + eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL); + printf("\n"); + + // Now iterate using an iterator + printf("List of phones:\n"); + it = eina_hash_iterator_tuple_new(phone_book); + while (eina_iterator_next(it, &data)) + { + Eina_Hash_Tuple *t = data; + const char *name = t->key; + const char *number = t->data; + printf("%s: %s\n", name, number); + } + eina_iterator_free(it); // Always free the iterator after its use + printf("\n"); + + // Just iterate over the keys (names) + printf("List of names in the phone book:\n"); + it = eina_hash_iterator_key_new(phone_book); + while (eina_iterator_next(it, &data)) + { + const char *name = data; + printf("%s\n", name); + } + eina_iterator_free(it); + printf("\n"); + + // Just iterate over the data (numbers) + printf("List of numbers in the phone book:\n"); + it = eina_hash_iterator_data_new(phone_book); + while (eina_iterator_next(it, &data)) + { + const char *number = data; + printf("%s\n", number); + } + eina_iterator_free(it); + printf("\n"); + + // Check how many items are in the phone book + printf("There are %d items in the hash.\n\n", + eina_hash_population(phone_book)); + + // Change the name (key) on an entry + eina_hash_move(phone_book, "Raul Seixas", "Alceu Valenca"); + printf("List of phones after change:\n"); + eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL); + printf("\n"); + + // Empty the phone book, but don't destroy it + eina_hash_free_buckets(phone_book); + printf("There are %d items in the hash.\n\n", + eina_hash_population(phone_book)); + + // Phone book could still be used, but we are freeing it since we are + // done for now + eina_hash_free(phone_book); + + eina_shutdown(); +} diff --git a/libraries/eina/src/examples/eina_hash_04.c b/libraries/eina/src/examples/eina_hash_04.c new file mode 100644 index 0000000..e900475 --- /dev/null +++ b/libraries/eina/src/examples/eina_hash_04.c @@ -0,0 +1,195 @@ +#include +#include +#include + +/* + * Eina Hash - phonebook + * + * This example demonstrate the use of Eina Hash by implementing a phonebook + * that stores its contact data into the hash. + * + * It indexes the phone numbers by Contact Full Name, so it's a hash with + * string keys. + */ + +struct _Phone_Entry { + const char *name; // Full name. + const char *number; // Phone number. +}; + +typedef struct _Phone_Entry Phone_Entry; + +static Phone_Entry _start_entries[] = { + { "Wolfgang Amadeus Mozart", "+01 23 456-78910" }, + { "Ludwig van Beethoven", "+12 34 567-89101" }, + { "Richard Georg Strauss", "+23 45 678-91012" }, + { "Heitor Villa-Lobos", "+34 56 789-10123" }, + { NULL, NULL } +}; // _start_entries + +static void +_phone_entry_free_cb(void *data) +{ + free(data); +} + +static Eina_Bool +_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key, + void *data, void *fdata) +{ + const char *name = key; + const char *number = data; + printf("%s: %s\n", name, number); + + // Return EINA_FALSE to stop this callback from being called + return EINA_TRUE; +} + +int +main(int argc, const char *argv[]) +{ + Eina_Hash *phone_book = NULL; + int i; + const char *entry_name = "Heitor Villa-Lobos"; + char *phone = NULL; + Eina_Bool r; + Eina_Iterator *it; + void *data; + + eina_init(); + + phone_book = eina_hash_string_djb2_new(_phone_entry_free_cb); + + // Add initial entries to our hash + for (i = 0; _start_entries[i].name != NULL; i++) + { + eina_hash_add(phone_book, _start_entries[i].name, + strdup(_start_entries[i].number)); + } + + // Look for a specific entry and get its phone number + phone = eina_hash_find(phone_book, entry_name); + if (phone) + { + printf("Printing entry.\n"); + printf("Name: %s\n", entry_name); + printf("Number: %s\n\n", phone); + } + + // Delete this entry + r = eina_hash_del(phone_book, entry_name, NULL); + printf("Hash entry successfully deleted? %d\n\n", r); + + // Modify the pointer data of an entry and free the old one + phone = eina_hash_modify(phone_book, "Richard Georg Strauss", + strdup("+23 45 111-11111")); + free(phone); + + // Modify or add an entry to the hash with eina_hash_set + // Let's first add a new entry + eina_error_set(0); + phone = eina_hash_set(phone_book, "Raul Seixas", + strdup("+55 01 234-56789")); + if (!phone) + { + Eina_Error err = eina_error_get(); + if (!err) + { + printf("No previous phone found for Raul Seixas. "); + printf("Creating new entry.\n"); + } + else + printf("Error when setting phone for Raul Seixas\n"); + } + else + { + printf("Old phone for Raul Seixas was %s\n", phone); + free(phone); + } + + printf("\n"); + + // Now change the phone number + eina_error_set(0); + phone = eina_hash_set(phone_book, "Raul Seixas", + strdup("+55 02 222-22222")); + if (phone) + { + printf("Changing phone for Raul Seixas to +55 02 222-22222. "); + printf("Old phone was %s\n", phone); + free(phone); + } + else + { + Eina_Error err = eina_error_get(); + if (err) + printf("Error when changing phone for Raul Seixas\n"); + else + { + printf("No previous phone found for Raul Seixas. "); + printf("Creating new entry.\n"); + } + } + + // There are many ways to iterate over our Phone book. + // First, iterate showing the names and associated numbers. + printf("List of phones:\n"); + eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL); + printf("\n"); + + // Now iterate using an iterator + printf("List of phones:\n"); + it = eina_hash_iterator_tuple_new(phone_book); + while (eina_iterator_next(it, &data)) + { + Eina_Hash_Tuple *t = data; + const char *name = t->key; + const char *number = t->data; + printf("%s: %s\n", name, number); + } + eina_iterator_free(it); // Always free the iterator after its use + printf("\n"); + + // Just iterate over the keys (names) + printf("List of names in the phone book:\n"); + it = eina_hash_iterator_key_new(phone_book); + while (eina_iterator_next(it, &data)) + { + const char *name = data; + printf("%s\n", name); + } + eina_iterator_free(it); + printf("\n"); + + // Just iterate over the data (numbers) + printf("List of numbers in the phone book:\n"); + it = eina_hash_iterator_data_new(phone_book); + while (eina_iterator_next(it, &data)) + { + const char *number = data; + printf("%s\n", number); + } + eina_iterator_free(it); + printf("\n"); + + // Check how many items are in the phone book + printf("There are %d items in the hash.\n\n", + eina_hash_population(phone_book)); + + // Change the name (key) on an entry + eina_hash_move(phone_book, "Raul Seixas", "Alceu Valenca"); + printf("List of phones after change:\n"); + eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL); + printf("\n"); + + // Empty the phone book, but don't destroy it + eina_hash_free_buckets(phone_book); + printf("There are %d items in the hash.\n\n", + eina_hash_population(phone_book)); + + // Phone book could still be used, but we are freeing it since we are + // done for now + eina_hash_free(phone_book); + + eina_shutdown(); +} diff --git a/libraries/eina/src/examples/eina_hash_05.c b/libraries/eina/src/examples/eina_hash_05.c new file mode 100644 index 0000000..f8dbf78 --- /dev/null +++ b/libraries/eina/src/examples/eina_hash_05.c @@ -0,0 +1,198 @@ +#include +#include +#include + +/* + * Eina Hash - phonebook + * + * This example demonstrate the use of Eina Hash by implementing a phonebook + * that stores its contact data into the hash. + * + * It indexes the phone numbers by Contact Full Name, so it's a hash with + * string keys. + */ + +struct _Phone_Entry { + int32_t id; // Full name. + const char *number; // Phone number. +}; + +typedef struct _Phone_Entry Phone_Entry; + +static Phone_Entry _start_entries[] = { + { 1, "+01 23 456-78910" }, + { 2, "+12 34 567-89101" }, + { 3, "+23 45 678-91012" }, + { 4, "+34 56 789-10123" }, + { -1, NULL } +}; // _start_entries + +static void +_phone_entry_free_cb(void *data) +{ + free(data); +} + +static Eina_Bool +_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key, + void *data, void *fdata) +{ + const int32_t *id = key; + const char *number = data; + printf("%d: %s\n", *id, number); + + // Return EINA_FALSE to stop this callback from being called + return EINA_TRUE; +} + +int +main(int argc, const char *argv[]) +{ + Eina_Hash *phone_book = NULL; + int i; + int32_t entry_id = 4; + char *phone = NULL; + Eina_Bool r; + Eina_Iterator *it; + void *data; + + eina_init(); + + phone_book = eina_hash_int32_new(_phone_entry_free_cb); + + // Add initial entries to our hash + for (i = 0; _start_entries[i].id != -1; i++) + { + eina_hash_add(phone_book, &_start_entries[i].id, + strdup(_start_entries[i].number)); + } + + // Look for a specific entry and get its phone number + phone = eina_hash_find(phone_book, &entry_id); + if (phone) + { + printf("Printing entry.\n"); + printf("Id: %d\n", entry_id); + printf("Number: %s\n\n", phone); + } + + // Delete this entry + r = eina_hash_del(phone_book, &entry_id, NULL); + printf("Hash entry successfully deleted? %d\n\n", r); + + // Modify the pointer data of an entry and free the old one + int32_t id3 = 3; + phone = eina_hash_modify(phone_book, &id3, + strdup("+23 45 111-11111")); + free(phone); + + // Modify or add an entry to the hash with eina_hash_set + // Let's first add a new entry + int32_t id5 = 5; + eina_error_set(0); + phone = eina_hash_set(phone_book, &id5, + strdup("+55 01 234-56789")); + if (!phone) + { + Eina_Error err = eina_error_get(); + if (!err) + { + printf("No previous phone found for id5. "); + printf("Creating new entry.\n"); + } + else + printf("Error when setting phone for Raul Seixas\n"); + } + else + { + printf("Old phone for id5 was %s\n", phone); + free(phone); + } + + printf("\n"); + + // Now change the phone number + eina_error_set(0); + phone = eina_hash_set(phone_book, &id5, + strdup("+55 02 222-22222")); + if (phone) + { + printf("Changing phone for id5 to +55 02 222-22222. "); + printf("Old phone was %s\n", phone); + free(phone); + } + else + { + Eina_Error err = eina_error_get(); + if (err) + printf("Error when changing phone for id5\n"); + else + { + printf("No previous phone found for id5. "); + printf("Creating new entry.\n"); + } + } + + // There are many ways to iterate over our Phone book. + // First, iterate showing the names and associated numbers. + printf("List of phones:\n"); + eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL); + printf("\n"); + + // Now iterate using an iterator + printf("List of phones:\n"); + it = eina_hash_iterator_tuple_new(phone_book); + while (eina_iterator_next(it, &data)) + { + Eina_Hash_Tuple *t = data; + const int32_t *id = t->key; + const char *number = t->data; + printf("%d: %s\n", *id, number); + } + eina_iterator_free(it); // Always free the iterator after its use + printf("\n"); + + // Just iterate over the keys (names) + printf("List of ids in the phone book:\n"); + it = eina_hash_iterator_key_new(phone_book); + while (eina_iterator_next(it, &data)) + { + const int32_t *id = data; + printf("%d\n", *id); + } + eina_iterator_free(it); + printf("\n"); + + // Just iterate over the data (numbers) + printf("List of numbers in the phone book:\n"); + it = eina_hash_iterator_data_new(phone_book); + while (eina_iterator_next(it, &data)) + { + const char *number = data; + printf("%s\n", number); + } + eina_iterator_free(it); + printf("\n"); + + // Check how many items are in the phone book + printf("There are %d items in the hash.\n\n", + eina_hash_population(phone_book)); + + // Change the name (key) on an entry + int32_t id6 = 6; + eina_hash_move(phone_book, &id5, &id6); + printf("List of phones after change:\n"); + eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL); + printf("\n"); + + // Empty the phone book, but don't destroy it + eina_hash_free_buckets(phone_book); + printf("There are %d items in the hash.\n\n", + eina_hash_population(phone_book)); + + // Phone book could still be used, but we are freeing it since we are + // done for now + eina_hash_free(phone_book); + + eina_shutdown(); +} diff --git a/libraries/eina/src/examples/eina_hash_06.c b/libraries/eina/src/examples/eina_hash_06.c new file mode 100644 index 0000000..99a2bd7 --- /dev/null +++ b/libraries/eina/src/examples/eina_hash_06.c @@ -0,0 +1,198 @@ +#include +#include +#include + +/* + * Eina Hash - phonebook + * + * This example demonstrate the use of Eina Hash by implementing a phonebook + * that stores its contact data into the hash. + * + * It indexes the phone numbers by Contact Full Name, so it's a hash with + * string keys. + */ + +struct _Phone_Entry { + int64_t id; // Full name. + const char *number; // Phone number. +}; + +typedef struct _Phone_Entry Phone_Entry; + +static Phone_Entry _start_entries[] = { + { 1, "+01 23 456-78910" }, + { 2, "+12 34 567-89101" }, + { 3, "+23 45 678-91012" }, + { 4, "+34 56 789-10123" }, + { -1, NULL } +}; // _start_entries + +static void +_phone_entry_free_cb(void *data) +{ + free(data); +} + +static Eina_Bool +_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key, + void *data, void *fdata) +{ + const int64_t *id = key; + const char *number = data; + printf("%ld: %s\n", *id, number); + + // Return EINA_FALSE to stop this callback from being called + return EINA_TRUE; +} + +int +main(int argc, const char *argv[]) +{ + Eina_Hash *phone_book = NULL; + int i; + int64_t entry_id = 4; + char *phone = NULL; + Eina_Bool r; + Eina_Iterator *it; + void *data; + + eina_init(); + + phone_book = eina_hash_int64_new(_phone_entry_free_cb); + + // Add initial entries to our hash + for (i = 0; _start_entries[i].id != -1; i++) + { + eina_hash_add(phone_book, &_start_entries[i].id, + strdup(_start_entries[i].number)); + } + + // Look for a specific entry and get its phone number + phone = eina_hash_find(phone_book, &entry_id); + if (phone) + { + printf("Printing entry.\n"); + printf("Id: %ld\n", entry_id); + printf("Number: %s\n\n", phone); + } + + // Delete this entry + r = eina_hash_del(phone_book, &entry_id, NULL); + printf("Hash entry successfully deleted? %d\n\n", r); + + // Modify the pointer data of an entry and free the old one + int64_t id3 = 3; + phone = eina_hash_modify(phone_book, &id3, + strdup("+23 45 111-11111")); + free(phone); + + // Modify or add an entry to the hash with eina_hash_set + // Let's first add a new entry + int64_t id5 = 5; + eina_error_set(0); + phone = eina_hash_set(phone_book, &id5, + strdup("+55 01 234-56789")); + if (!phone) + { + Eina_Error err = eina_error_get(); + if (!err) + { + printf("No previous phone found for id5. "); + printf("Creating new entry.\n"); + } + else + printf("Error when setting phone for Raul Seixas\n"); + } + else + { + printf("Old phone for id5 was %s\n", phone); + free(phone); + } + + printf("\n"); + + // Now change the phone number + eina_error_set(0); + phone = eina_hash_set(phone_book, &id5, + strdup("+55 02 222-22222")); + if (phone) + { + printf("Changing phone for id5 to +55 02 222-22222. "); + printf("Old phone was %s\n", phone); + free(phone); + } + else + { + Eina_Error err = eina_error_get(); + if (err) + printf("Error when changing phone for id5\n"); + else + { + printf("No previous phone found for id5. "); + printf("Creating new entry.\n"); + } + } + + // There are many ways to iterate over our Phone book. + // First, iterate showing the names and associated numbers. + printf("List of phones:\n"); + eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL); + printf("\n"); + + // Now iterate using an iterator + printf("List of phones:\n"); + it = eina_hash_iterator_tuple_new(phone_book); + while (eina_iterator_next(it, &data)) + { + Eina_Hash_Tuple *t = data; + const int64_t *id = t->key; + const char *number = t->data; + printf("%ld: %s\n", *id, number); + } + eina_iterator_free(it); // Always free the iterator after its use + printf("\n"); + + // Just iterate over the keys (names) + printf("List of ids in the phone book:\n"); + it = eina_hash_iterator_key_new(phone_book); + while (eina_iterator_next(it, &data)) + { + const int64_t *id = data; + printf("%ld\n", *id); + } + eina_iterator_free(it); + printf("\n"); + + // Just iterate over the data (numbers) + printf("List of numbers in the phone book:\n"); + it = eina_hash_iterator_data_new(phone_book); + while (eina_iterator_next(it, &data)) + { + const char *number = data; + printf("%s\n", number); + } + eina_iterator_free(it); + printf("\n"); + + // Check how many items are in the phone book + printf("There are %d items in the hash.\n\n", + eina_hash_population(phone_book)); + + // Change the name (key) on an entry + int64_t id6 = 6; + eina_hash_move(phone_book, &id5, &id6); + printf("List of phones after change:\n"); + eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL); + printf("\n"); + + // Empty the phone book, but don't destroy it + eina_hash_free_buckets(phone_book); + printf("There are %d items in the hash.\n\n", + eina_hash_population(phone_book)); + + // Phone book could still be used, but we are freeing it since we are + // done for now + eina_hash_free(phone_book); + + eina_shutdown(); +} diff --git a/libraries/eina/src/examples/eina_hash_07.c b/libraries/eina/src/examples/eina_hash_07.c new file mode 100644 index 0000000..b3e486a --- /dev/null +++ b/libraries/eina/src/examples/eina_hash_07.c @@ -0,0 +1,219 @@ +#include +#include +#include + +/* + * Eina Hash - phonebook + * + * This example demonstrate the use of Eina Hash by implementing a phonebook + * that stores its contact data into the hash. + * + * It indexes the phone numbers by Contact Full Name, so it's a hash with + * string keys. + */ + +struct _Phone_Entry { + const char *name; // Full name. + const char *number; // Phone number. +}; + +typedef struct _Phone_Entry Phone_Entry; + +static Phone_Entry _start_entries[] = { + { "Wolfgang Amadeus Mozart", "+01 23 456-78910" }, + { "Ludwig van Beethoven", "+12 34 567-89101" }, + { "Richard Georg Strauss", "+23 45 678-91012" }, + { "Heitor Villa-Lobos", "+34 56 789-10123" }, + { NULL, NULL } +}; // _start_entries + +static const char *_nicknames[] = { + "mozzart", + "betho", + "george", + "hector", + NULL +}; + +static void +_phone_entry_free_cb(void *data) +{ + free(data); +} + +static Eina_Bool +_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key, + void *data, void *fdata) +{ + Phone_Entry **pe = (Phone_Entry **)key; + const char *nick = data; + printf("%s: %s, nick=%s\n", (*pe)->name, (*pe)->number, nick); + + // Return EINA_FALSE to stop this callback from being called + return EINA_TRUE; +} + +int +main(int argc, const char *argv[]) +{ + Eina_Hash *phone_book = NULL; + int i; + Phone_Entry *entry_vl = &_start_entries[3]; + Phone_Entry *p = NULL; + char *nick = NULL; + Eina_Bool r; + Eina_Iterator *it; + void *data; + + eina_init(); + + phone_book = eina_hash_pointer_new(_phone_entry_free_cb); + + // Add initial entries to our hash + for (i = 0; _start_entries[i].name != NULL; i++) + { + p = &_start_entries[i]; + eina_hash_add(phone_book, &p, + strdup(_nicknames[i])); + } + printf("Phonebook:\n"); + eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL); + printf("\n"); + + // Look for a specific entry and get its nickname + nick = eina_hash_find(phone_book, &entry_vl); + if (nick) + { + printf("Printing entry.\n"); + printf("Name: %s\n", entry_vl->name); + printf("Number: %s\n", entry_vl->number); + printf("Nick: %s\n\n", nick); + } + + // Delete this entry + r = eina_hash_del(phone_book, &entry_vl, NULL); + printf("Hash entry successfully deleted? %d\n\n", r); + + // Modify the pointer data of an entry and free the old one + p = &_start_entries[2]; + nick = eina_hash_modify(phone_book, &p, + strdup("el jorge")); + free(nick); + + // Modify or add an entry to the hash with eina_hash_set + // Let's first add a new entry + eina_error_set(0); + Phone_Entry *p1 = malloc(sizeof(*p1)); + p1->name = "Raul Seixas"; + p1->number = "+55 01 234-56789"; + nick = eina_hash_set(phone_book, &p1, + strdup("raulzito")); + if (!nick) + { + Eina_Error err = eina_error_get(); + if (!err) + { + printf("No previous nick found for Raul Seixas. "); + printf("Creating new entry.\n"); + } + else + printf("Error when setting nick for Raul Seixas\n"); + } + else + { + printf("Old nick for Raul Seixas was %s\n", nick); + free(nick); + } + + printf("\n"); + + // Now change the nick + eina_error_set(0); + nick = eina_hash_set(phone_book, &p1, + strdup("raulzao")); + if (nick) + { + printf("Changing nick for Raul Seixas to raulzao. "); + printf("Old nick was %s\n", nick); + free(nick); + } + else + { + Eina_Error err = eina_error_get(); + if (err) + printf("Error when changing nick for Raul Seixas\n"); + else + { + printf("No previous nick found for Raul Seixas. "); + printf("Creating new entry.\n"); + } + } + + // There are many ways to iterate over our Phone book. + // First, iterate showing the names, phones and associated nicks. + printf("Phonebook:\n"); + eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL); + printf("\n"); + + // Now iterate using an iterator + printf("Phonebook:\n"); + it = eina_hash_iterator_tuple_new(phone_book); + while (eina_iterator_next(it, &data)) + { + Eina_Hash_Tuple *t = data; + Phone_Entry **pe = (Phone_Entry **)t->key; + nick = t->data; + printf("%s: %s, nick=%s\n", (*pe)->name, (*pe)->number, nick); + } + eina_iterator_free(it); // Always free the iterator after its use + printf("\n"); + + // Just iterate over the keys (names) + printf("List of names/numbers in the phone book:\n"); + it = eina_hash_iterator_key_new(phone_book); + while (eina_iterator_next(it, &data)) + { + Phone_Entry **pe = (Phone_Entry **)data; + printf("%s: %s\n", (*pe)->name, (*pe)->number); + } + eina_iterator_free(it); + printf("\n"); + + // Just iterate over the data (nicks) + printf("List of nicks in the phone book:\n"); + it = eina_hash_iterator_data_new(phone_book); + while (eina_iterator_next(it, &data)) + { + nick = data; + printf("%s\n", nick); + } + eina_iterator_free(it); + printf("\n"); + + // Check how many items are in the phone book + printf("There are %d items in the hash.\n\n", + eina_hash_population(phone_book)); + + // Change the name (key) on an entry + Phone_Entry *p2 = malloc(sizeof(*p2)); + p2->name = "Alceu Valenca"; + p2->number = "000000000000"; + eina_hash_move(phone_book, p1, p2); + printf("List of phones after change:\n"); + eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL); + printf("\n"); + + // Empty the phone book, but don't destroy it + eina_hash_free_buckets(phone_book); + printf("There are %d items in the hash.\n\n", + eina_hash_population(phone_book)); + + // Phone book could still be used, but we are freeing it since we are + // done for now + eina_hash_free(phone_book); + + free(p1); + free(p2); + + eina_shutdown(); +} diff --git a/libraries/eina/src/examples/eina_hash_08.c b/libraries/eina/src/examples/eina_hash_08.c new file mode 100644 index 0000000..368a2fb --- /dev/null +++ b/libraries/eina/src/examples/eina_hash_08.c @@ -0,0 +1,125 @@ +#include +#include +#include + +/* + * Eina Hash - phonebook + * + * This example demonstrate the use of Eina Hash by implementing a phonebook + * that stores its contact data into the hash. + * + * It indexes the phone numbers by Contact Full Name, so it's a hash with + * string keys. + */ + +struct _Phone_Entry { + const char *name; // Full name. + const char *number; // Phone number. +}; + +typedef struct _Phone_Entry Phone_Entry; + +static Phone_Entry _start_entries[] = { + { "Wolfgang Amadeus Mozart", "+01 23 456-78910" }, + { "Ludwig van Beethoven", "+12 34 567-89101" }, + { "Richard Georg Strauss", "+23 45 678-91012" }, + { "Heitor Villa-Lobos", "+34 56 789-10123" }, + { NULL, NULL } +}; // _start_entries + +static void +_phone_entry_free_cb(void *data) +{ + free(data); +} + +static Eina_Bool +_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key, + void *data, void *fdata) +{ + const char *name = key; + const char *number = data; + printf("%s: %s\n", name, number); + + // Return EINA_FALSE to stop this callback from being called + return EINA_TRUE; +} + +int +main(int argc, const char *argv[]) +{ + Eina_Hash *phone_book = NULL; + int i; + const char *entry_name = "Heitor Villa-Lobos"; + int entry_size; + const char *saved_entry_name = "Alceu Valenca"; + int saved_entry_size = sizeof("Alceu Valenca"); + const char *phone = NULL; + Eina_Bool r; + Eina_Iterator *it; + void *data; + + eina_init(); + + phone_book = eina_hash_string_superfast_new(_phone_entry_free_cb); + + // Add initial entries to our hash + for (i = 0; _start_entries[i].name != NULL; i++) + { + eina_hash_add(phone_book, _start_entries[i].name, + strdup(_start_entries[i].number)); + } + + // Delete entries + r = eina_hash_del(phone_book, entry_name, NULL); + printf("Hash entry successfully deleted? %d\n\n", r); + + int hash = eina_hash_superfast("Ludwig van Beethoven", + sizeof("Ludwig van Beethoven")); + + r = eina_hash_del_by_key_hash(phone_book, "Ludwig van Beethoven", + sizeof("Ludwig van Beethoven"), hash); + printf("Hash entry successfully deleted? %d\n\n", r); + + r = eina_hash_del_by_key(phone_book, "Richard Georg Strauss"); + printf("Hash entry successfully deleted? %d\n\n", r); + + // add entry by hash + entry_name = "Raul_Seixas"; + entry_size = sizeof("Raul Seixas"); + phone = strdup("+33 33 333-33333"); + hash = eina_hash_superfast(entry_name, entry_size); + eina_hash_add_by_hash(phone_book, entry_name, entry_size, hash, phone); + + // don't need to free 'phone' after the next del: + r = eina_hash_del_by_data(phone_book, phone); + printf("Hash entry successfully deleted? %d\n\n", r); + + // add entry by hash directly - no copy of the key will be done + hash = eina_hash_superfast(saved_entry_name, saved_entry_size); + phone = strdup("+44 44 444-44444"); + eina_hash_direct_add_by_hash(phone_book, saved_entry_name, + saved_entry_size, hash, phone); + + // find the added entry by its hash: + phone = eina_hash_find_by_hash(phone_book, saved_entry_name, + saved_entry_size, hash); + if (phone) + { + char *newphone = strdup("+55 55 555-55555"); + phone = eina_hash_modify_by_hash(phone_book, saved_entry_name, + saved_entry_size, hash, newphone); + if (phone) + printf("changing phone to %s, old one was %s\n", newphone, phone); + else + printf("couldn't modify entry identified by %d\n", hash); + } + else + { + printf("couldn't find entry identified by %d\n", hash); + } + + eina_hash_free(phone_book); + + eina_shutdown(); +} diff --git a/libraries/eina/src/examples/eina_inlist_01.c b/libraries/eina/src/examples/eina_inlist_01.c new file mode 100644 index 0000000..fa51553 --- /dev/null +++ b/libraries/eina/src/examples/eina_inlist_01.c @@ -0,0 +1,96 @@ +// Compile with: +// gcc -g `pkg-config --cflags --libs eina` eina_inlist_01.c -o eina_inlist_01 +#include +#include + +struct my_struct { + EINA_INLIST; + int a, b; +}; + +int +sort_cb(const void *d1, const void *d2) +{ + const Eina_Inlist *l1, *l2; + const struct my_struct *x1, *x2; + + l1 = d1; + l2 = d2; + + x1 = EINA_INLIST_CONTAINER_GET(l1, struct my_struct); + x2 = EINA_INLIST_CONTAINER_GET(l2, struct my_struct); + + return x1->a - x2->a; +} + +int +main(void) +{ + struct my_struct *d, *cur; + Eina_Inlist *list, *itr, *tmp; + + eina_init(); + + d = malloc(sizeof(*d)); + d->a = 1; + d->b = 10; + list = eina_inlist_append(NULL, EINA_INLIST_GET(d)); + + d = malloc(sizeof(*d)); + d->a = 2; + d->b = 20; + list = eina_inlist_append(list, EINA_INLIST_GET(d)); + + d = malloc(sizeof(*d)); + d->a = 3; + d->b = 30; + list = eina_inlist_prepend(list, EINA_INLIST_GET(d)); + + printf("list=%p\n", list); + EINA_INLIST_FOREACH(list, cur) + printf("\ta=%d, b=%d\n", cur->a, cur->b); + + list = eina_inlist_promote(list, EINA_INLIST_GET(d)); + + d = malloc(sizeof(*d)); + d->a = 4; + d->b = 40; + list = eina_inlist_append_relative(list, EINA_INLIST_GET(d), list); + + list = eina_inlist_demote(list, EINA_INLIST_GET(d)); + + list = eina_inlist_sort(list, sort_cb); + + printf("list after sort=%p\n", list); + EINA_INLIST_FOREACH(list, cur) + printf("\ta=%d, b=%d\n", cur->a, cur->b); + + tmp = eina_inlist_find(list, EINA_INLIST_GET(d)); + if (tmp) + cur = EINA_INLIST_CONTAINER_GET(tmp, struct my_struct); + else + cur = NULL; + + if (d != cur) + printf("wrong node! cur=%p\n", cur); + + list = eina_inlist_remove(list, EINA_INLIST_GET(d)); + free(d); + printf("list=%p\n", list); + for (itr = list; itr != NULL; itr = itr->next) + { + cur = EINA_INLIST_CONTAINER_GET(itr, struct my_struct); + printf("\ta=%d, b=%d\n", cur->a, cur->b); + } + + while (list) + { + Eina_Inlist *aux = list; + list = eina_inlist_remove(list, list); + free(aux); + } + + eina_shutdown(); + + return 0; +} diff --git a/libraries/eina/src/examples/eina_inlist_02.c b/libraries/eina/src/examples/eina_inlist_02.c new file mode 100644 index 0000000..7d23f13 --- /dev/null +++ b/libraries/eina/src/examples/eina_inlist_02.c @@ -0,0 +1,64 @@ +// Compile with: +// gcc -g `pkg-config --cflags --libs eina` eina_inlist_01.c -o eina_inlist_01 +#include +#include + +struct my_struct { + EINA_INLIST; + int a, b; +}; + +int +main(void) +{ + struct my_struct *d, *cur; + int i; + + Eina_Inlist *inlist = NULL; + Eina_List *list = NULL, *l_itr, *l_next; + + eina_init(); + + for (i = 0; i < 100; i++) + { + d = malloc(sizeof(*d)); + d->a = i; + d->b = i * 10; + inlist = eina_inlist_append(inlist, EINA_INLIST_GET(d)); + if ((i % 2) == 0) + list = eina_list_prepend(list, d); + } + + printf("inlist=%p\n", inlist); + EINA_INLIST_FOREACH(inlist, cur) + printf("\ta=%d, b=%d\n", cur->a, cur->b); + + printf("list=%p\n", list); + EINA_LIST_FOREACH(list, l_itr, cur) + printf("\ta=%d, b=%d\n", cur->a, cur->b); + + printf("inlist count=%d\n", eina_inlist_count(inlist)); + printf("list count=%d\n\n", eina_list_count(list)); + + EINA_LIST_FOREACH_SAFE(list, l_itr, l_next, cur) + { + if ((cur->a % 3) == 0) + list = eina_list_remove_list(list, l_itr); + } + + printf("inlist count=%d\n", eina_inlist_count(inlist)); + printf("list count=%d\n\n", eina_list_count(list)); + + eina_list_free(list); + + while (inlist) + { + Eina_Inlist *aux = inlist; + inlist = eina_inlist_remove(inlist, inlist); + free(aux); + } + + eina_shutdown(); + + return 0; +} diff --git a/libraries/eina/src/examples/eina_inlist_03.c b/libraries/eina/src/examples/eina_inlist_03.c new file mode 100644 index 0000000..a39a784 --- /dev/null +++ b/libraries/eina/src/examples/eina_inlist_03.c @@ -0,0 +1,73 @@ +// Compile with: +// gcc -g `pkg-config --cflags --libs eina` eina_inlist_01.c -o eina_inlist_01 +#include +#include + +struct my_struct { + EINA_INLIST; + Eina_Inlist even; + int a, b; +}; + +#define EVEN_INLIST_GET(Inlist) (& ((Inlist)->even)) + +#define EVEN_INLIST_CONTAINER_GET(ptr, type) \ + ((type *)((char *)ptr - offsetof(type, even))) + +int +main(void) +{ + struct my_struct *d, *cur; + int i; + + Eina_Inlist *list = NULL, *list_even = NULL, *itr; + + eina_init(); + + for (i = 0; i < 100; i++) + { + d = malloc(sizeof(*d)); + d->a = i; + d->b = i * 10; + list = eina_inlist_append(list, EINA_INLIST_GET(d)); + if ((i % 2) == 0) + list_even = eina_inlist_prepend(list_even, EVEN_INLIST_GET(d)); + } + + printf("list=%p\n", list); + EINA_INLIST_FOREACH(list, cur) + printf("\ta=%d, b=%d\n", cur->a, cur->b); + + printf("list_even=%p\n", list_even); + for (itr = list_even; itr != NULL; itr = itr->next) + { + cur = EVEN_INLIST_CONTAINER_GET(itr, struct my_struct); + printf("\ta=%d, b=%d\n", cur->a, cur->b); + } + + printf("list count=%d\n", eina_inlist_count(list)); + printf("list_even count=%d\n\n", eina_inlist_count(list_even)); + + itr = list_even; + while (itr) + { + Eina_Inlist *next = itr->next; + cur = EVEN_INLIST_CONTAINER_GET(itr, struct my_struct); + if ((cur->a % 3) == 0) + list_even = eina_inlist_remove(list_even, itr); + itr = next; + } + printf("list count=%d\n", eina_inlist_count(list)); + printf("list_even count=%d\n\n", eina_inlist_count(list_even)); + + while (list) + { + Eina_Inlist *aux = list; + list = eina_inlist_remove(list, list); + free(aux); + } + + eina_shutdown(); + + return 0; +} diff --git a/libraries/eina/src/examples/eina_iterator_01.c b/libraries/eina/src/examples/eina_iterator_01.c new file mode 100644 index 0000000..f467f90 --- /dev/null +++ b/libraries/eina/src/examples/eina_iterator_01.c @@ -0,0 +1,66 @@ +//Compile with: +//gcc -g `pkg-config --cflags --libs eina` eina_iterator_01.c -o eina_iterator_01 + +#include + +#include + +static Eina_Bool +print_one(const void *container, void *data, void *fdata) +{ + printf("%s\n", (char*)data); + return EINA_TRUE; +} + +static void +print_eina_container(Eina_Iterator *it) +{ + eina_iterator_foreach(it, print_one, NULL); + printf("\n"); +} + +int +main(int argc, char **argv) +{ + const char *strings[] = { + "unintersting string", "husker", "starbuck", "husker" + }; + const char *more_strings[] = { + "very unintersting string", + "what do your hear?", + "nothing but the rain", + "then grab your gun and bring the cat in" + }; + Eina_Array *array; + Eina_List *list = NULL; + Eina_Iterator *it; + unsigned short int i; + char *uninteresting; + + eina_init(); + + array = eina_array_new(4); + + for (i = 0; i < 4; i++) + { + eina_array_push(array, strings[i]); + list = eina_list_append(list, more_strings[i]); + } + + it = eina_array_iterator_new(array); + eina_iterator_next(it, &uninteresting); + print_eina_container(it); + eina_array_free(eina_iterator_container_get(it)); + eina_iterator_free(it); + + it = eina_list_iterator_new(list); + eina_iterator_next(it, &uninteresting); + print_eina_container(it); + eina_iterator_free(it); + + eina_list_free(list); + + eina_shutdown(); + + return 0; +} diff --git a/libraries/eina/src/examples/eina_list_01.c b/libraries/eina/src/examples/eina_list_01.c new file mode 100644 index 0000000..7807791 --- /dev/null +++ b/libraries/eina/src/examples/eina_list_01.c @@ -0,0 +1,44 @@ +//Compile with: +//gcc -g `pkg-config --cflags --libs eina` eina_list_01.c -o eina_list_01 + +#include +#include + +int +main(int argc, char **argv) +{ + Eina_List *list = NULL; + Eina_List *l; + void *list_data; + + 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"); + + EINA_LIST_FOREACH(list, l, list_data) + printf("%s\n", (char*)list_data); + printf("\n"); + + l = eina_list_nth_list(list, 1); + list = eina_list_append_relative_list(list, "cain", l); + + list = eina_list_append_relative(list, "zarek", "cain"); + + list = eina_list_prepend(list, "adama"); + + list = eina_list_prepend_relative(list, "gaeta", "cain"); + + list = eina_list_prepend_relative_list(list, "lampkin", l); + + EINA_LIST_FOREACH(list, l, list_data) + printf("%s\n", (char*)list_data); + + eina_list_free(list); + + eina_shutdown(); + + return 0; +} diff --git a/libraries/eina/src/examples/eina_list_02.c b/libraries/eina/src/examples/eina_list_02.c new file mode 100644 index 0000000..7def475 --- /dev/null +++ b/libraries/eina/src/examples/eina_list_02.c @@ -0,0 +1,55 @@ +//Compile with: +//gcc -g `pkg-config --cflags --libs eina` eina_list_02.c -o eina_list_02 + +#include +#include +#include + +int +main(int argc, char **argv) +{ + Eina_List *list = NULL, *other_list = NULL; + Eina_List *l; + void *data; + int cmp_result; + Eina_Compare_Cb cmp_func = (Eina_Compare_Cb)strcmp; + + eina_init(); + + list = eina_list_append(list, "starbuck"); + list = eina_list_append(list, "appolo"); + list = eina_list_append(list, "boomer"); + + data = eina_list_search_unsorted(list, cmp_func, "boomer"); + l = eina_list_search_unsorted_list(list, cmp_func, "boomer"); + if (l->data != data) + return 1; + + list = eina_list_sort(list, 0, cmp_func); + + data = eina_list_search_sorted(list, cmp_func, "starbuck"); + l = eina_list_search_sorted_list(list, cmp_func, "starbuck"); + if (l->data != data) + return 1; + + list = eina_list_sorted_insert(list, cmp_func, "helo"); + + l = eina_list_search_sorted_near_list(list, cmp_func, "hera", &cmp_result); + if (cmp_result > 0) + list = eina_list_prepend_relative_list(list, "hera", l); + else if (cmp_result < 0) + list = eina_list_append_relative_list(list, "hera", l); + + l = eina_list_search_sorted_list(list, cmp_func, "boomer"); + list = eina_list_split_list(list, l, &other_list); + + other_list = eina_list_sort(other_list, 0, cmp_func); + + list = eina_list_sorted_merge(list, other_list, cmp_func); + + eina_list_free(list); + + eina_shutdown(); + + return 0; +} diff --git a/libraries/eina/src/examples/eina_list_03.c b/libraries/eina/src/examples/eina_list_03.c new file mode 100644 index 0000000..8e15b91 --- /dev/null +++ b/libraries/eina/src/examples/eina_list_03.c @@ -0,0 +1,45 @@ +//Compile with: +//gcc -g `pkg-config --cflags --libs eina` eina_list_03.c -o eina_list_03 + +#include +#include + +int +main(int argc, char **argv) +{ + Eina_List *list = NULL, *r_list; + Eina_List *l; + Eina_Iterator *itr; + void *list_data; + + eina_init(); + + list = eina_list_append(list, "caprica"); + list = eina_list_append(list, "sagitarius"); + list = eina_list_append(list, "aerilon"); + list = eina_list_append(list, "gemenon"); + + list = eina_list_promote_list(list, eina_list_nth_list(list, 2)); + list = eina_list_demote_list(list, eina_list_nth_list(list, 2)); + + list = eina_list_remove(list, "sagitarius"); + + l = eina_list_data_find_list(list, "aerilon"); + eina_list_data_set(l, "aquarius"); + + printf("size: %d\n", eina_list_count(list)); + + r_list = eina_list_reverse_clone(list); + + itr = eina_list_iterator_new(r_list); + EINA_ITERATOR_FOREACH(itr, list_data) + printf("%s\n", (char*)list_data); + eina_iterator_free(itr); + + eina_list_free(list); + eina_list_free(r_list); + + eina_shutdown(); + + return 0; +} diff --git a/libraries/eina/src/examples/eina_list_04.c b/libraries/eina/src/examples/eina_list_04.c new file mode 100644 index 0000000..c153c06 --- /dev/null +++ b/libraries/eina/src/examples/eina_list_04.c @@ -0,0 +1,36 @@ +//Compile with: +//gcc -g `pkg-config --cflags --libs eina` eina_list_04.c -o eina_list_04 + +#include +#include + +int +main(int argc, char **argv) +{ + Eina_List *list = NULL; + Eina_List *l; + void *list_data; + + eina_init(); + + list = eina_list_append(list, eina_stringshare_add("calvin")); + list = eina_list_append(list, eina_stringshare_add("Leoben")); + list = eina_list_append(list, eina_stringshare_add("D'Anna")); + list = eina_list_append(list, eina_stringshare_add("Simon")); + list = eina_list_append(list, eina_stringshare_add("Doral")); + list = eina_list_append(list, eina_stringshare_add("Six")); + list = eina_list_append(list, eina_stringshare_add("Sharon")); + + for(l = list; l; l = eina_list_next(l)) + printf("%s\n", (char*)l->data); + + for(l = eina_list_last(list); l; l = eina_list_prev(l)) + printf("%s\n", (char*)eina_list_data_get(l)); + + EINA_LIST_FREE(list, list_data) + eina_stringshare_del(list_data); + + eina_shutdown(); + + return 0; +} diff --git a/libraries/eina/src/examples/eina_log_01.c b/libraries/eina/src/examples/eina_log_01.c new file mode 100644 index 0000000..7a20ca9 --- /dev/null +++ b/libraries/eina/src/examples/eina_log_01.c @@ -0,0 +1,27 @@ +//Compile with: +//gcc -Wall -o eina_log_01 eina_log_01.c `pkg-config --cflags --libs eina` + +#include +#include + +#include + +void test_warn(void) +{ + EINA_LOG_WARN("Here is a warning message"); +} + +int main(void) +{ + if (!eina_init()) + { + printf("log during the initialization of Eina_Log module\n"); + return EXIT_FAILURE; + } + + test_warn(); + + eina_shutdown(); + + return EXIT_SUCCESS; +} diff --git a/libraries/eina/src/examples/eina_log_02.c b/libraries/eina/src/examples/eina_log_02.c new file mode 100644 index 0000000..a056729 --- /dev/null +++ b/libraries/eina/src/examples/eina_log_02.c @@ -0,0 +1,38 @@ +//Compile with: +//gcc -Wall -o eina_log_02 eina_log_02.c `pkg-config --cflags --libs eina` + +#include +#include + +#include + +void test(int i) +{ + EINA_LOG_DBG("Entering test"); + + if (i < 0) + { + EINA_LOG_ERR("Argument is negative"); + return; + } + + EINA_LOG_INFO("argument non negative"); + + EINA_LOG_DBG("Exiting test"); +} + +int main(void) +{ + if (!eina_init()) + { + printf("log during the initialization of Eina_Log module\n"); + return EXIT_FAILURE; + } + + test(-1); + test(0); + + eina_shutdown(); + + return EXIT_SUCCESS; +} diff --git a/libraries/eina/src/examples/eina_log_03.c b/libraries/eina/src/examples/eina_log_03.c new file mode 100644 index 0000000..8dbe19e --- /dev/null +++ b/libraries/eina/src/examples/eina_log_03.c @@ -0,0 +1,78 @@ +//Compile with: +//gcc -Wall -o eina_log_03 eina_log_03.c `pkg-config --cflags --libs eina` + +#include +#include + +#include + +#define log(fmt, ...) \ + eina_log_print(EINA_LOG_LEVEL_ERR, __FILE__, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__) + +typedef struct _Data Data; + +struct _Data +{ + int to_stderr; +}; + +void print_cb(const Eina_Log_Domain *domain, + Eina_Log_Level level, + const char *file, + const char *fnc, + int line, + const char *fmt, + void *data, + va_list args) +{ + Data *d; + FILE *output; + char *str; + + d = (Data*)data; + if (d->to_stderr) + { + output = stderr; + str = "stderr"; + } + else + { + output = stdout; + str = "stdout"; + } + + fprintf(output, "%s:%s:%s (%d) %s: ", + domain->domain_str, file, fnc, line, str); + vfprintf(output, fmt, args); + putc('\n', output); +} + +void test(Data *data, int i) +{ + if (i < 0) + data->to_stderr = 0; + else + data->to_stderr = 1; + + EINA_LOG_INFO("Log message..."); +} + +int main(void) +{ + Data data; + + if (!eina_init()) + { + printf("log during the initialization of Eina_Log module\n"); + return EXIT_FAILURE; + } + + eina_log_print_cb_set(print_cb, &data); + + test(&data, -1); + test(&data, 0); + + eina_shutdown(); + + return EXIT_SUCCESS; +} diff --git a/libraries/eina/src/examples/eina_str_01.c b/libraries/eina/src/examples/eina_str_01.c new file mode 100644 index 0000000..089a766 --- /dev/null +++ b/libraries/eina/src/examples/eina_str_01.c @@ -0,0 +1,65 @@ +//Compile with: +//gcc -Wall -o eina_str_01 eina_str_01.c `pkg-config --cflags --libs eina` + +#include +#include + +int main(int argc, char **argv) +{ + char *names = "Calvin;Leoben;D'anna;Simon;Doral;Six;Daniel;Sharon"; + char *str; + char *tmp; + char *prologue; + char *part1 = "The Cylons were created by man. They evolved. They rebelled."; + char *part2 = "There are many copies. And they have a plan."; + char **arr; + int i; + + eina_init(); + + arr = eina_str_split(names, ";", 0); + for (i = 0; arr[i]; i++) + printf("%s\n", arr[i]); + + free(arr[0]); + free(arr); + + str = malloc(sizeof(char) * 4); + strcpy(str, "bsd"); + + eina_str_toupper((char **)&str); + printf("%s\n", str); + eina_str_tolower(&str); + printf("%s\n", str); + + if (eina_str_has_prefix(names, "Calvin")) + printf("Starts with 'Calvin'\n"); + if (eina_str_has_suffix(names, "sharon")) + printf("Ends with 'sharon'\n"); + if (eina_str_has_extension(names, "sharon")) + printf("Has extension 'sharon'\n"); + + tmp = eina_str_escape("They'll start going ripe on us pretty soon."); + printf("%s\n", tmp); + free(tmp); + + prologue = malloc(sizeof(char) * 106); + eina_str_join_len(prologue, 106, ' ', part1, strlen(part1), part2, strlen(part2)); + printf("%s\n", prologue); + + eina_strlcpy(str, prologue, 4); + printf("%s\n", str); + + free(prologue); + free(str); + + str = malloc(sizeof(char) * 14); + sprintf(str, "%s", "cylons+"); + eina_strlcat(str, "humans", 14); + printf("%s\n", str); + free(str); + + eina_shutdown(); + + return 0; +} diff --git a/libraries/eina/src/examples/eina_strbuf_01.c b/libraries/eina/src/examples/eina_strbuf_01.c new file mode 100644 index 0000000..eddfccf --- /dev/null +++ b/libraries/eina/src/examples/eina_strbuf_01.c @@ -0,0 +1,41 @@ +//Compile with: +//gcc -Wall -o eina_strbuf_01 eina_strbuf_01.c `pkg-config --cflags --libs eina` + +#include +#include + +int main(int argc, char **argv) +{ + Eina_Strbuf *buf; + + eina_init(); + + buf = eina_strbuf_new(); + + eina_strbuf_append_length(buf, "buffe", 5); + eina_strbuf_append_char(buf, 'r'); + printf("%s\n", eina_strbuf_string_get(buf)); + + eina_strbuf_insert_escaped(buf, "my ", 0); + printf("%s\n", eina_strbuf_string_get(buf)); + eina_strbuf_reset(buf); + + eina_strbuf_append_escaped(buf, "my buffer"); + printf("%s\n", eina_strbuf_string_get(buf)); + eina_strbuf_reset(buf); + + eina_strbuf_append_printf(buf, "%s%c", "buffe", 'r'); + eina_strbuf_insert_printf(buf, " %s: %d", 6, "length", eina_strbuf_length_get(buf)); + printf("%s\n", eina_strbuf_string_get(buf)); + + eina_strbuf_remove(buf, 0, 7); + printf("%s\n", eina_strbuf_string_get(buf)); + + eina_strbuf_replace_all(buf, "length", "size"); + printf("%s\n", eina_strbuf_string_get(buf)); + + eina_strbuf_free(buf); + eina_shutdown(); + + return 0; +} diff --git a/libraries/eina/src/examples/eina_tiler_01.c b/libraries/eina/src/examples/eina_tiler_01.c new file mode 100644 index 0000000..b2ff8be --- /dev/null +++ b/libraries/eina/src/examples/eina_tiler_01.c @@ -0,0 +1,316 @@ +//Compile with: +//gcc `pkg-config --cflags --libs ecore-evas ecore evas` eina_tiler_01.c -o eina_tiler_01 + +#include +#include +#include +#include + +#define WINDOW_PAD (20) + +static Eina_Tiler *tiler; +static Eina_Rectangle *input_rects; +static unsigned int input_count; +static unsigned int input_idx = 0, input_color_idx = 0, output_color_idx = 0; +static Eina_List *output_objs = NULL; +static Evas_Coord maxw, maxh, winw, winh; +static Evas *evas; + +static const struct color { + unsigned char r, g, b; +} colors[] = { + {255, 0, 0}, + {0, 255, 0}, + {0, 0, 255}, + + {255, 128, 0}, + {0, 255, 128}, + {128, 0, 255}, + + {255, 255, 0}, + {0, 255, 255}, + {255, 0, 255}, + + {255, 0, 128}, + {128, 255, 0}, + {0, 128, 255}, + + {128, 128, 0}, + {0, 128, 128}, + {128, 0, 128}, + + {128, 0, 0}, + {0, 128, 0}, + {0, 0, 128}, + + {255, 128, 0}, + {0, 255, 128}, + {128, 0, 255}, + + {64, 64, 0}, + {0, 64, 64}, + {64, 0, 64}, + + {128, 128, 0}, + {0, 128, 128}, + {128, 0, 128}, + + {255, 0, 128}, + {128, 255, 0}, + {0, 128, 255}, + + {128, 64, 0}, + {0, 128, 64}, + {64, 0, 128}, + + {128, 0, 64}, + {64, 128, 0}, + {0, 64, 128} +}; + +#define MAX_COLORS (sizeof(colors) / sizeof(colors[0])) + +static void +add_text(const char *text, int x, int y, int w) +{ + Evas_Object *o = evas_object_text_add(evas); + evas_object_color_set(o, 0, 0, 0, 255); + evas_object_move(o, x, y); + evas_object_resize(o, w, WINDOW_PAD); + evas_object_text_font_set(o, "Sans", 10); + evas_object_text_text_set(o, text); + evas_object_show(o); +} + +static void +output_rects_reset(void) +{ + Evas_Object *o; + EINA_LIST_FREE(output_objs, o) + evas_object_del(o); + output_color_idx = 0; +} + +static void +add_input_rect(const Eina_Rectangle *r) +{ + Evas_Object *o; + Evas_Coord bx, by; + + bx = WINDOW_PAD; + by = WINDOW_PAD; + + o = evas_object_rectangle_add(evas); +#define C(comp) (((int)colors[input_color_idx].comp * 128) / 255) + evas_object_color_set(o, C(r), C(g), C(b), 128); +#undef C + evas_object_move(o, r->x + bx, r->y + by); + evas_object_resize(o, r->w, r->h); + evas_object_show(o); + + input_color_idx = (input_color_idx + 1) % MAX_COLORS; + + bx += maxw + WINDOW_PAD; + + o = evas_object_rectangle_add(evas); + evas_object_color_set(o, 32, 32, 32, 128); + evas_object_move(o, r->x + bx, r->y + by); + evas_object_resize(o, r->w, 1); + evas_object_layer_set(o, EVAS_LAYER_MAX); + evas_object_show(o); + + o = evas_object_rectangle_add(evas); + evas_object_color_set(o, 32, 32, 32, 128); + evas_object_move(o, r->x + bx, r->y + by); + evas_object_resize(o, 1, r->h); + evas_object_layer_set(o, EVAS_LAYER_MAX); + evas_object_show(o); + + o = evas_object_rectangle_add(evas); + evas_object_color_set(o, 32, 32, 32, 128); + evas_object_move(o, r->x + bx, r->y + by + r->h); + evas_object_resize(o, r->w, 1); + evas_object_layer_set(o, EVAS_LAYER_MAX); + evas_object_show(o); + + o = evas_object_rectangle_add(evas); + evas_object_color_set(o, 32, 32, 32, 128); + evas_object_move(o, r->x + bx + r->w, r->y + by); + evas_object_resize(o, 1, r->h); + evas_object_layer_set(o, EVAS_LAYER_MAX); + evas_object_show(o); +} + +static void +add_output_rect(const Eina_Rectangle *r) +{ + Evas_Object *o = evas_object_rectangle_add(evas); +#define C(comp) (((int)colors[output_color_idx].comp * 128) / 255) + evas_object_color_set(o, C(r), C(g), C(b), 128); +#undef C + evas_object_move(o, r->x + maxw + 2 * WINDOW_PAD, r->y + WINDOW_PAD); + evas_object_resize(o, r->w, r->h); + evas_object_show(o); + + output_color_idx = (output_color_idx + 1) % MAX_COLORS; + + output_objs = eina_list_append(output_objs, o); +} + +static Eina_Bool +process_input(void *data) +{ + Eina_Iterator *itr; + Eina_Rectangle r, *r1; + unsigned int out = 0; + + if (input_idx == input_count) + { + add_text("Done. Close the window to exit", + WINDOW_PAD, winh - WINDOW_PAD, winw - 2 * WINDOW_PAD); + return EINA_FALSE; + } + + output_rects_reset(); + + r = input_rects[input_idx]; + printf("Iteration #%u: %dx%d%+d%+d\n", input_idx, r.w, r.h, r.x, r.y); + input_idx++; + add_input_rect(&r); + + eina_tiler_rect_add(tiler, &r); + itr = eina_tiler_iterator_new(tiler); + EINA_ITERATOR_FOREACH(itr, r1) + { + printf("\tOutput #%u: %dx%d%+d%+d\n", out, r1->w, r1->h, r1->x, r1->y); + add_output_rect(r1); + out++; + } + eina_iterator_free(itr); + + return EINA_TRUE; +} + +static void +usage(const char *progname) +{ + fprintf(stderr, + "Usage:\n\n" + "\t%s ... \n\n" + "with rectangles being in the format:\n" + "\tWIDTHxHEIGHT<+->X<+->Y\n" + "examples:\n" + "\t100x100+10+10 - width=100, height=100 at x=10, y=10\n" + "\t150x50+5+6 - width=150, height=50 at x=5, y=6\n", + progname); +} + +int +main(int argc, char *argv[]) +{ + Ecore_Evas *ee; + Evas_Object *o; + int i; + + if (argc < 2) + { + usage(argv[0]); + return -2; + } + + input_rects = calloc(argc - 1, sizeof(Eina_Rectangle)); + input_count = 0; + maxw = 0; + maxh = 0; + for (i = 1; i < argc; i++) + { + Eina_Rectangle *r = input_rects + input_count; + char sx, sy; + + if (sscanf(argv[i], "%dx%d%c%d%c%d", + &(r->w), &(r->h), &sx, &(r->x), &sy, &(r->y)) == 6) + { + if (sx == '-') r->x *= -1; + if (sy == '-') r->y *= -1; + + if (maxw < r->x + r->w) maxw = r->x + r->w; + if (maxh < r->y + r->h) maxh = r->y + r->h; + input_count++; + } + else + fprintf(stderr, "ERROR: invalid rectangle ignored: %s\n", argv[i]); + } + + if (input_count == 0) + { + fputs("ERROR: Could not find any valid rectangle. Exit!\n", stderr); + usage(argv[0]); + free(input_rects); + return -3; + } + + if ((maxw == 0) || (maxh == 0)) + { + fputs("ERROR: All rectangles with size 0x0. Exit!\n", stderr); + usage(argv[0]); + free(input_rects); + return -3; + } + + ecore_evas_init(); + ecore_init(); + evas_init(); + eina_init(); + + winw = 2 * maxw + 3 * WINDOW_PAD; + winh = maxh + 2 * WINDOW_PAD; + + ee = ecore_evas_new(NULL, 0, 0, winw, winh, NULL); + if (!ee) + { + fputs("ERROR: Could not create window. Check ecore-evas install.\n", + stderr); + goto end; + } + + evas = ecore_evas_get(ee); + + o = evas_object_rectangle_add(evas); + evas_object_color_set(o, 255, 255, 255, 255); + evas_object_resize(o, winw, winh); + evas_object_show(o); + + add_text("Input", WINDOW_PAD, 0, maxw); + o = evas_object_rectangle_add(evas); + evas_object_color_set(o, 200, 200, 200, 255); + evas_object_move(o, WINDOW_PAD, WINDOW_PAD); + evas_object_resize(o, maxw, maxh); + evas_object_show(o); + + add_text("Output", maxw + 2 * WINDOW_PAD, 0, maxw); + o = evas_object_rectangle_add(evas); + evas_object_color_set(o, 200, 200, 200, 255); + evas_object_move(o, maxw + 2 * WINDOW_PAD, WINDOW_PAD); + evas_object_resize(o, maxw, maxh); + evas_object_show(o); + + tiler = eina_tiler_new(maxw, maxh); + ecore_timer_add(2.0, process_input, NULL); + + ecore_evas_show(ee); + ecore_main_loop_begin(); + + eina_list_free(output_objs); + eina_tiler_free(tiler); + ecore_evas_free(ee); + + end: + free(input_rects); + + eina_shutdown(); + evas_shutdown(); + ecore_shutdown(); + ecore_evas_shutdown(); + + return 0; +} -- cgit v1.1