aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/eina/src/examples
diff options
context:
space:
mode:
authorDavid Walter Seikel2012-01-04 18:41:13 +1000
committerDavid Walter Seikel2012-01-04 18:41:13 +1000
commitdd7595a3475407a7fa96a97393bae8c5220e8762 (patch)
treee341e911d7eb911a51684a7412ef7f7c7605d28e /libraries/eina/src/examples
parentAdd the skeleton. (diff)
downloadSledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.zip
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.gz
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.bz2
SledjHamr-dd7595a3475407a7fa96a97393bae8c5220e8762.tar.xz
Add the base Enlightenment Foundation Libraries - eina, eet, evas, ecore, embryo, and edje.
Note that embryo wont be used, but I'm not sure yet if you can build edje without it.
Diffstat (limited to '')
-rw-r--r--libraries/eina/src/examples/Makefile.am84
-rw-r--r--libraries/eina/src/examples/Makefile.in954
-rw-r--r--libraries/eina/src/examples/eina_accessor_01.c55
-rw-r--r--libraries/eina/src/examples/eina_array_01.c51
-rw-r--r--libraries/eina/src/examples/eina_array_02.c57
-rw-r--r--libraries/eina/src/examples/eina_error_01.c80
-rw-r--r--libraries/eina/src/examples/eina_file_01.c45
-rw-r--r--libraries/eina/src/examples/eina_hash_01.c195
-rw-r--r--libraries/eina/src/examples/eina_hash_02.c144
-rw-r--r--libraries/eina/src/examples/eina_hash_03.c195
-rw-r--r--libraries/eina/src/examples/eina_hash_04.c195
-rw-r--r--libraries/eina/src/examples/eina_hash_05.c198
-rw-r--r--libraries/eina/src/examples/eina_hash_06.c198
-rw-r--r--libraries/eina/src/examples/eina_hash_07.c219
-rw-r--r--libraries/eina/src/examples/eina_hash_08.c125
-rw-r--r--libraries/eina/src/examples/eina_inlist_01.c96
-rw-r--r--libraries/eina/src/examples/eina_inlist_02.c64
-rw-r--r--libraries/eina/src/examples/eina_inlist_03.c73
-rw-r--r--libraries/eina/src/examples/eina_iterator_01.c66
-rw-r--r--libraries/eina/src/examples/eina_list_01.c44
-rw-r--r--libraries/eina/src/examples/eina_list_02.c55
-rw-r--r--libraries/eina/src/examples/eina_list_03.c45
-rw-r--r--libraries/eina/src/examples/eina_list_04.c36
-rw-r--r--libraries/eina/src/examples/eina_log_01.c27
-rw-r--r--libraries/eina/src/examples/eina_log_02.c38
-rw-r--r--libraries/eina/src/examples/eina_log_03.c78
-rw-r--r--libraries/eina/src/examples/eina_str_01.c65
-rw-r--r--libraries/eina/src/examples/eina_strbuf_01.c41
-rw-r--r--libraries/eina/src/examples/eina_tiler_01.c316
29 files changed, 3839 insertions, 0 deletions
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 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3pkglibdir = $(datadir)/$(PACKAGE)/examples
4
5AM_CPPFLAGS = \
6-I. \
7-I$(top_srcdir)/src/include \
8-I$(top_builddir)/src/include
9
10LDADD = \
11 $(top_builddir)/src/lib/libeina.la
12
13SRCS = \
14 eina_accessor_01.c \
15 eina_array_01.c \
16 eina_array_02.c \
17 eina_error_01.c \
18 eina_file_01.c \
19 eina_hash_01.c \
20 eina_hash_02.c \
21 eina_hash_03.c \
22 eina_hash_04.c \
23 eina_hash_05.c \
24 eina_hash_06.c \
25 eina_hash_07.c \
26 eina_hash_08.c \
27 eina_iterator_01.c \
28 eina_list_01.c \
29 eina_list_02.c \
30 eina_list_03.c \
31 eina_list_04.c \
32 eina_log_01.c \
33 eina_log_02.c \
34 eina_log_03.c \
35 eina_inlist_01.c \
36 eina_inlist_02.c \
37 eina_inlist_03.c \
38 eina_str_01.c \
39 eina_strbuf_01.c \
40 eina_tiler_01.c
41
42pkglib_PROGRAMS =
43
44if EFL_INSTALL_EXAMPLES
45filesdir = $(datadir)/$(PACKAGE)/examples
46files_DATA = $(SRCS)
47endif
48
49if EFL_BUILD_EXAMPLES
50pkglib_PROGRAMS += \
51 eina_accessor_01 \
52 eina_array_01 \
53 eina_array_02 \
54 eina_error_01 \
55 eina_file_01 \
56 eina_hash_01 \
57 eina_hash_02 \
58 eina_hash_03 \
59 eina_hash_04 \
60 eina_hash_05 \
61 eina_hash_06 \
62 eina_hash_07 \
63 eina_hash_08 \
64 eina_iterator_01 \
65 eina_list_01 \
66 eina_list_02 \
67 eina_list_03 \
68 eina_list_04 \
69 eina_log_01 \
70 eina_log_02 \
71 eina_log_03 \
72 eina_inlist_01 \
73 eina_inlist_02 \
74 eina_inlist_03 \
75 eina_str_01 \
76 eina_strbuf_01
77
78if BUILD_TILER_EXAMPLE
79AM_CPPFLAGS += @ECORE_EVAS_CFLAGS@
80pkglib_PROGRAMS += eina_tiler_01
81eina_tiler_01_LDADD = $(top_builddir)/src/lib/libeina.la @ECORE_EVAS_LIBS@
82endif
83
84endif
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 @@
1# Makefile.in generated by automake 1.11.1 from Makefile.am.
2# @configure_input@
3
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
6# Inc.
7# This Makefile.in is free software; the Free Software Foundation
8# gives unlimited permission to copy and/or distribute it,
9# with or without modifications, as long as this notice is preserved.
10
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
13# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
14# PARTICULAR PURPOSE.
15
16@SET_MAKE@
17
18
19VPATH = @srcdir@
20pkgdatadir = $(datadir)/@PACKAGE@
21pkgincludedir = $(includedir)/@PACKAGE@
22pkglibexecdir = $(libexecdir)/@PACKAGE@
23am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
24install_sh_DATA = $(install_sh) -c -m 644
25install_sh_PROGRAM = $(install_sh) -c
26install_sh_SCRIPT = $(install_sh) -c
27INSTALL_HEADER = $(INSTALL_DATA)
28transform = $(program_transform_name)
29NORMAL_INSTALL = :
30PRE_INSTALL = :
31POST_INSTALL = :
32NORMAL_UNINSTALL = :
33PRE_UNINSTALL = :
34POST_UNINSTALL = :
35build_triplet = @build@
36host_triplet = @host@
37pkglib_PROGRAMS = $(am__EXEEXT_1) $(am__EXEEXT_2)
38@EFL_BUILD_EXAMPLES_TRUE@am__append_1 = \
39@EFL_BUILD_EXAMPLES_TRUE@ eina_accessor_01 \
40@EFL_BUILD_EXAMPLES_TRUE@ eina_array_01 \
41@EFL_BUILD_EXAMPLES_TRUE@ eina_array_02 \
42@EFL_BUILD_EXAMPLES_TRUE@ eina_error_01 \
43@EFL_BUILD_EXAMPLES_TRUE@ eina_file_01 \
44@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_01 \
45@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_02 \
46@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_03 \
47@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_04 \
48@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_05 \
49@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_06 \
50@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_07 \
51@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_08 \
52@EFL_BUILD_EXAMPLES_TRUE@ eina_iterator_01 \
53@EFL_BUILD_EXAMPLES_TRUE@ eina_list_01 \
54@EFL_BUILD_EXAMPLES_TRUE@ eina_list_02 \
55@EFL_BUILD_EXAMPLES_TRUE@ eina_list_03 \
56@EFL_BUILD_EXAMPLES_TRUE@ eina_list_04 \
57@EFL_BUILD_EXAMPLES_TRUE@ eina_log_01 \
58@EFL_BUILD_EXAMPLES_TRUE@ eina_log_02 \
59@EFL_BUILD_EXAMPLES_TRUE@ eina_log_03 \
60@EFL_BUILD_EXAMPLES_TRUE@ eina_inlist_01 \
61@EFL_BUILD_EXAMPLES_TRUE@ eina_inlist_02 \
62@EFL_BUILD_EXAMPLES_TRUE@ eina_inlist_03 \
63@EFL_BUILD_EXAMPLES_TRUE@ eina_str_01 \
64@EFL_BUILD_EXAMPLES_TRUE@ eina_strbuf_01
65
66@BUILD_TILER_EXAMPLE_TRUE@@EFL_BUILD_EXAMPLES_TRUE@am__append_2 = @ECORE_EVAS_CFLAGS@
67@BUILD_TILER_EXAMPLE_TRUE@@EFL_BUILD_EXAMPLES_TRUE@am__append_3 = eina_tiler_01
68subdir = src/examples
69DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
70ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
71am__aclocal_m4_deps = $(top_srcdir)/m4/efl_attribute.m4 \
72 $(top_srcdir)/m4/efl_benchmark.m4 \
73 $(top_srcdir)/m4/efl_compiler_flag.m4 \
74 $(top_srcdir)/m4/efl_coverage.m4 $(top_srcdir)/m4/efl_cpu.m4 \
75 $(top_srcdir)/m4/efl_doxygen.m4 \
76 $(top_srcdir)/m4/efl_examples.m4 \
77 $(top_srcdir)/m4/efl_fnmatch.m4 \
78 $(top_srcdir)/m4/efl_path_max.m4 $(top_srcdir)/m4/efl_tests.m4 \
79 $(top_srcdir)/m4/efl_threads.m4 \
80 $(top_srcdir)/m4/efl_voltron.m4 $(top_srcdir)/m4/eina_bench.m4 \
81 $(top_srcdir)/m4/eina_check.m4 $(top_srcdir)/m4/libtool.m4 \
82 $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
83 $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
84 $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
85am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
86 $(ACLOCAL_M4)
87mkinstalldirs = $(install_sh) -d
88CONFIG_HEADER = $(top_builddir)/config.h
89CONFIG_CLEAN_FILES =
90CONFIG_CLEAN_VPATH_FILES =
91@EFL_BUILD_EXAMPLES_TRUE@am__EXEEXT_1 = eina_accessor_01$(EXEEXT) \
92@EFL_BUILD_EXAMPLES_TRUE@ eina_array_01$(EXEEXT) \
93@EFL_BUILD_EXAMPLES_TRUE@ eina_array_02$(EXEEXT) \
94@EFL_BUILD_EXAMPLES_TRUE@ eina_error_01$(EXEEXT) \
95@EFL_BUILD_EXAMPLES_TRUE@ eina_file_01$(EXEEXT) \
96@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_01$(EXEEXT) \
97@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_02$(EXEEXT) \
98@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_03$(EXEEXT) \
99@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_04$(EXEEXT) \
100@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_05$(EXEEXT) \
101@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_06$(EXEEXT) \
102@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_07$(EXEEXT) \
103@EFL_BUILD_EXAMPLES_TRUE@ eina_hash_08$(EXEEXT) \
104@EFL_BUILD_EXAMPLES_TRUE@ eina_iterator_01$(EXEEXT) \
105@EFL_BUILD_EXAMPLES_TRUE@ eina_list_01$(EXEEXT) \
106@EFL_BUILD_EXAMPLES_TRUE@ eina_list_02$(EXEEXT) \
107@EFL_BUILD_EXAMPLES_TRUE@ eina_list_03$(EXEEXT) \
108@EFL_BUILD_EXAMPLES_TRUE@ eina_list_04$(EXEEXT) \
109@EFL_BUILD_EXAMPLES_TRUE@ eina_log_01$(EXEEXT) \
110@EFL_BUILD_EXAMPLES_TRUE@ eina_log_02$(EXEEXT) \
111@EFL_BUILD_EXAMPLES_TRUE@ eina_log_03$(EXEEXT) \
112@EFL_BUILD_EXAMPLES_TRUE@ eina_inlist_01$(EXEEXT) \
113@EFL_BUILD_EXAMPLES_TRUE@ eina_inlist_02$(EXEEXT) \
114@EFL_BUILD_EXAMPLES_TRUE@ eina_inlist_03$(EXEEXT) \
115@EFL_BUILD_EXAMPLES_TRUE@ eina_str_01$(EXEEXT) \
116@EFL_BUILD_EXAMPLES_TRUE@ eina_strbuf_01$(EXEEXT)
117@BUILD_TILER_EXAMPLE_TRUE@@EFL_BUILD_EXAMPLES_TRUE@am__EXEEXT_2 = eina_tiler_01$(EXEEXT)
118am__installdirs = "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(filesdir)"
119PROGRAMS = $(pkglib_PROGRAMS)
120eina_accessor_01_SOURCES = eina_accessor_01.c
121eina_accessor_01_OBJECTS = eina_accessor_01.$(OBJEXT)
122eina_accessor_01_LDADD = $(LDADD)
123eina_accessor_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
124AM_V_lt = $(am__v_lt_$(V))
125am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
126am__v_lt_0 = --silent
127eina_array_01_SOURCES = eina_array_01.c
128eina_array_01_OBJECTS = eina_array_01.$(OBJEXT)
129eina_array_01_LDADD = $(LDADD)
130eina_array_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
131eina_array_02_SOURCES = eina_array_02.c
132eina_array_02_OBJECTS = eina_array_02.$(OBJEXT)
133eina_array_02_LDADD = $(LDADD)
134eina_array_02_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
135eina_error_01_SOURCES = eina_error_01.c
136eina_error_01_OBJECTS = eina_error_01.$(OBJEXT)
137eina_error_01_LDADD = $(LDADD)
138eina_error_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
139eina_file_01_SOURCES = eina_file_01.c
140eina_file_01_OBJECTS = eina_file_01.$(OBJEXT)
141eina_file_01_LDADD = $(LDADD)
142eina_file_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
143eina_hash_01_SOURCES = eina_hash_01.c
144eina_hash_01_OBJECTS = eina_hash_01.$(OBJEXT)
145eina_hash_01_LDADD = $(LDADD)
146eina_hash_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
147eina_hash_02_SOURCES = eina_hash_02.c
148eina_hash_02_OBJECTS = eina_hash_02.$(OBJEXT)
149eina_hash_02_LDADD = $(LDADD)
150eina_hash_02_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
151eina_hash_03_SOURCES = eina_hash_03.c
152eina_hash_03_OBJECTS = eina_hash_03.$(OBJEXT)
153eina_hash_03_LDADD = $(LDADD)
154eina_hash_03_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
155eina_hash_04_SOURCES = eina_hash_04.c
156eina_hash_04_OBJECTS = eina_hash_04.$(OBJEXT)
157eina_hash_04_LDADD = $(LDADD)
158eina_hash_04_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
159eina_hash_05_SOURCES = eina_hash_05.c
160eina_hash_05_OBJECTS = eina_hash_05.$(OBJEXT)
161eina_hash_05_LDADD = $(LDADD)
162eina_hash_05_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
163eina_hash_06_SOURCES = eina_hash_06.c
164eina_hash_06_OBJECTS = eina_hash_06.$(OBJEXT)
165eina_hash_06_LDADD = $(LDADD)
166eina_hash_06_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
167eina_hash_07_SOURCES = eina_hash_07.c
168eina_hash_07_OBJECTS = eina_hash_07.$(OBJEXT)
169eina_hash_07_LDADD = $(LDADD)
170eina_hash_07_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
171eina_hash_08_SOURCES = eina_hash_08.c
172eina_hash_08_OBJECTS = eina_hash_08.$(OBJEXT)
173eina_hash_08_LDADD = $(LDADD)
174eina_hash_08_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
175eina_inlist_01_SOURCES = eina_inlist_01.c
176eina_inlist_01_OBJECTS = eina_inlist_01.$(OBJEXT)
177eina_inlist_01_LDADD = $(LDADD)
178eina_inlist_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
179eina_inlist_02_SOURCES = eina_inlist_02.c
180eina_inlist_02_OBJECTS = eina_inlist_02.$(OBJEXT)
181eina_inlist_02_LDADD = $(LDADD)
182eina_inlist_02_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
183eina_inlist_03_SOURCES = eina_inlist_03.c
184eina_inlist_03_OBJECTS = eina_inlist_03.$(OBJEXT)
185eina_inlist_03_LDADD = $(LDADD)
186eina_inlist_03_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
187eina_iterator_01_SOURCES = eina_iterator_01.c
188eina_iterator_01_OBJECTS = eina_iterator_01.$(OBJEXT)
189eina_iterator_01_LDADD = $(LDADD)
190eina_iterator_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
191eina_list_01_SOURCES = eina_list_01.c
192eina_list_01_OBJECTS = eina_list_01.$(OBJEXT)
193eina_list_01_LDADD = $(LDADD)
194eina_list_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
195eina_list_02_SOURCES = eina_list_02.c
196eina_list_02_OBJECTS = eina_list_02.$(OBJEXT)
197eina_list_02_LDADD = $(LDADD)
198eina_list_02_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
199eina_list_03_SOURCES = eina_list_03.c
200eina_list_03_OBJECTS = eina_list_03.$(OBJEXT)
201eina_list_03_LDADD = $(LDADD)
202eina_list_03_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
203eina_list_04_SOURCES = eina_list_04.c
204eina_list_04_OBJECTS = eina_list_04.$(OBJEXT)
205eina_list_04_LDADD = $(LDADD)
206eina_list_04_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
207eina_log_01_SOURCES = eina_log_01.c
208eina_log_01_OBJECTS = eina_log_01.$(OBJEXT)
209eina_log_01_LDADD = $(LDADD)
210eina_log_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
211eina_log_02_SOURCES = eina_log_02.c
212eina_log_02_OBJECTS = eina_log_02.$(OBJEXT)
213eina_log_02_LDADD = $(LDADD)
214eina_log_02_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
215eina_log_03_SOURCES = eina_log_03.c
216eina_log_03_OBJECTS = eina_log_03.$(OBJEXT)
217eina_log_03_LDADD = $(LDADD)
218eina_log_03_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
219eina_str_01_SOURCES = eina_str_01.c
220eina_str_01_OBJECTS = eina_str_01.$(OBJEXT)
221eina_str_01_LDADD = $(LDADD)
222eina_str_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
223eina_strbuf_01_SOURCES = eina_strbuf_01.c
224eina_strbuf_01_OBJECTS = eina_strbuf_01.$(OBJEXT)
225eina_strbuf_01_LDADD = $(LDADD)
226eina_strbuf_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
227eina_tiler_01_SOURCES = eina_tiler_01.c
228eina_tiler_01_OBJECTS = eina_tiler_01.$(OBJEXT)
229@BUILD_TILER_EXAMPLE_TRUE@@EFL_BUILD_EXAMPLES_TRUE@eina_tiler_01_DEPENDENCIES = $(top_builddir)/src/lib/libeina.la
230DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
231depcomp = $(SHELL) $(top_srcdir)/depcomp
232am__depfiles_maybe = depfiles
233am__mv = mv -f
234COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
235 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
236LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
237 $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
238 $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
239 $(AM_CFLAGS) $(CFLAGS)
240AM_V_CC = $(am__v_CC_$(V))
241am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY))
242am__v_CC_0 = @echo " CC " $@;
243AM_V_at = $(am__v_at_$(V))
244am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY))
245am__v_at_0 = @
246CCLD = $(CC)
247LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
248 $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
249 $(AM_LDFLAGS) $(LDFLAGS) -o $@
250AM_V_CCLD = $(am__v_CCLD_$(V))
251am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY))
252am__v_CCLD_0 = @echo " CCLD " $@;
253AM_V_GEN = $(am__v_GEN_$(V))
254am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY))
255am__v_GEN_0 = @echo " GEN " $@;
256SOURCES = eina_accessor_01.c eina_array_01.c eina_array_02.c \
257 eina_error_01.c eina_file_01.c eina_hash_01.c eina_hash_02.c \
258 eina_hash_03.c eina_hash_04.c eina_hash_05.c eina_hash_06.c \
259 eina_hash_07.c eina_hash_08.c eina_inlist_01.c \
260 eina_inlist_02.c eina_inlist_03.c eina_iterator_01.c \
261 eina_list_01.c eina_list_02.c eina_list_03.c eina_list_04.c \
262 eina_log_01.c eina_log_02.c eina_log_03.c eina_str_01.c \
263 eina_strbuf_01.c eina_tiler_01.c
264DIST_SOURCES = eina_accessor_01.c eina_array_01.c eina_array_02.c \
265 eina_error_01.c eina_file_01.c eina_hash_01.c eina_hash_02.c \
266 eina_hash_03.c eina_hash_04.c eina_hash_05.c eina_hash_06.c \
267 eina_hash_07.c eina_hash_08.c eina_inlist_01.c \
268 eina_inlist_02.c eina_inlist_03.c eina_iterator_01.c \
269 eina_list_01.c eina_list_02.c eina_list_03.c eina_list_04.c \
270 eina_log_01.c eina_log_02.c eina_log_03.c eina_str_01.c \
271 eina_strbuf_01.c eina_tiler_01.c
272am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
273am__vpath_adj = case $$p in \
274 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
275 *) f=$$p;; \
276 esac;
277am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
278am__install_max = 40
279am__nobase_strip_setup = \
280 srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
281am__nobase_strip = \
282 for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
283am__nobase_list = $(am__nobase_strip_setup); \
284 for p in $$list; do echo "$$p $$p"; done | \
285 sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
286 $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
287 if (++n[$$2] == $(am__install_max)) \
288 { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
289 END { for (dir in files) print dir, files[dir] }'
290am__base_list = \
291 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
292 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
293DATA = $(files_DATA)
294ETAGS = etags
295CTAGS = ctags
296DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
297pkglibdir = $(datadir)/$(PACKAGE)/examples
298ACLOCAL = @ACLOCAL@
299ALLOCA = @ALLOCA@
300AMTAR = @AMTAR@
301AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
302AR = @AR@
303AS = @AS@
304AUTOCONF = @AUTOCONF@
305AUTOHEADER = @AUTOHEADER@
306AUTOMAKE = @AUTOMAKE@
307AWK = @AWK@
308CC = @CC@
309CCDEPMODE = @CCDEPMODE@
310CFLAGS = @CFLAGS@
311CHECK_CFLAGS = @CHECK_CFLAGS@
312CHECK_LIBS = @CHECK_LIBS@
313CPP = @CPP@
314CPPFLAGS = @CPPFLAGS@
315CXX = @CXX@
316CXXCPP = @CXXCPP@
317CXXDEPMODE = @CXXDEPMODE@
318CXXFLAGS = @CXXFLAGS@
319CYGPATH_W = @CYGPATH_W@
320DEFS = @DEFS@
321DEPDIR = @DEPDIR@
322DLLTOOL = @DLLTOOL@
323DSYMUTIL = @DSYMUTIL@
324DUMPBIN = @DUMPBIN@
325ECHO_C = @ECHO_C@
326ECHO_N = @ECHO_N@
327ECHO_T = @ECHO_T@
328ECORE_EVAS_CFLAGS = @ECORE_EVAS_CFLAGS@
329ECORE_EVAS_LIBS = @ECORE_EVAS_LIBS@
330EFL_COVERAGE_CFLAGS = @EFL_COVERAGE_CFLAGS@
331EFL_COVERAGE_LIBS = @EFL_COVERAGE_LIBS@
332EFL_EINA_BUILD = @EFL_EINA_BUILD@
333EFL_FNMATCH_LIBS = @EFL_FNMATCH_LIBS@
334EFL_PTHREAD_CFLAGS = @EFL_PTHREAD_CFLAGS@
335EFL_PTHREAD_LIBS = @EFL_PTHREAD_LIBS@
336EFL_SIMD_FLAGS = @EFL_SIMD_FLAGS@
337EGREP = @EGREP@
338EINA_CFLAGS = @EINA_CFLAGS@
339EINA_CONFIGURE_DEFAULT_MEMPOOL = @EINA_CONFIGURE_DEFAULT_MEMPOOL@
340EINA_CONFIGURE_HAVE_DEBUG_THREADS = @EINA_CONFIGURE_HAVE_DEBUG_THREADS@
341EINA_CONFIGURE_HAVE_INTTYPES_H = @EINA_CONFIGURE_HAVE_INTTYPES_H@
342EINA_CONFIGURE_HAVE_ON_OFF_THREADS = @EINA_CONFIGURE_HAVE_ON_OFF_THREADS@
343EINA_CONFIGURE_HAVE_STDINT_H = @EINA_CONFIGURE_HAVE_STDINT_H@
344EINA_CONFIGURE_HAVE_THREADS = @EINA_CONFIGURE_HAVE_THREADS@
345EINA_CONFIGURE_MAGIC_DEBUG = @EINA_CONFIGURE_MAGIC_DEBUG@
346EINA_CONFIGURE_SAFETY_CHECKS = @EINA_CONFIGURE_SAFETY_CHECKS@
347EINA_CPPFLAGS = @EINA_CPPFLAGS@
348EINA_LIBS = @EINA_LIBS@
349EINA_SIZEOF_WCHAR_T = @EINA_SIZEOF_WCHAR_T@
350EMEMOA_CFLAGS = @EMEMOA_CFLAGS@
351EMEMOA_LIBS = @EMEMOA_LIBS@
352ESCAPE_CFLAGS = @ESCAPE_CFLAGS@
353ESCAPE_LIBS = @ESCAPE_LIBS@
354EVIL_CFLAGS = @EVIL_CFLAGS@
355EVIL_LIBS = @EVIL_LIBS@
356EXEEXT = @EXEEXT@
357FGREP = @FGREP@
358GLIB_CFLAGS = @GLIB_CFLAGS@
359GLIB_LIBS = @GLIB_LIBS@
360GREP = @GREP@
361INSTALL = @INSTALL@
362INSTALL_DATA = @INSTALL_DATA@
363INSTALL_PROGRAM = @INSTALL_PROGRAM@
364INSTALL_SCRIPT = @INSTALL_SCRIPT@
365INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
366LD = @LD@
367LDFLAGS = @LDFLAGS@
368LIBOBJS = @LIBOBJS@
369LIBS = @LIBS@
370LIBTOOL = @LIBTOOL@
371LIPO = @LIPO@
372LN_S = @LN_S@
373LTLIBOBJS = @LTLIBOBJS@
374MAKEINFO = @MAKEINFO@
375MKDIR_P = @MKDIR_P@
376MODULE_ARCH = @MODULE_ARCH@
377NM = @NM@
378NMEDIT = @NMEDIT@
379OBJDUMP = @OBJDUMP@
380OBJEXT = @OBJEXT@
381OTOOL = @OTOOL@
382OTOOL64 = @OTOOL64@
383PACKAGE = @PACKAGE@
384PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
385PACKAGE_NAME = @PACKAGE_NAME@
386PACKAGE_STRING = @PACKAGE_STRING@
387PACKAGE_TARNAME = @PACKAGE_TARNAME@
388PACKAGE_URL = @PACKAGE_URL@
389PACKAGE_VERSION = @PACKAGE_VERSION@
390PATH_SEPARATOR = @PATH_SEPARATOR@
391PKG_CONFIG = @PKG_CONFIG@
392PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
393PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
394RANLIB = @RANLIB@
395SED = @SED@
396SET_MAKE = @SET_MAKE@
397SHELL = @SHELL@
398STRIP = @STRIP@
399VALGRIND_CFLAGS = @VALGRIND_CFLAGS@
400VALGRIND_LIBS = @VALGRIND_LIBS@
401VERSION = @VERSION@
402VMAJ = @VMAJ@
403abs_builddir = @abs_builddir@
404abs_srcdir = @abs_srcdir@
405abs_top_builddir = @abs_top_builddir@
406abs_top_srcdir = @abs_top_srcdir@
407ac_ct_CC = @ac_ct_CC@
408ac_ct_CXX = @ac_ct_CXX@
409ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
410am__include = @am__include@
411am__leading_dot = @am__leading_dot@
412am__quote = @am__quote@
413am__tar = @am__tar@
414am__untar = @am__untar@
415bindir = @bindir@
416build = @build@
417build_alias = @build_alias@
418build_cpu = @build_cpu@
419build_os = @build_os@
420build_vendor = @build_vendor@
421builddir = @builddir@
422datadir = @datadir@
423datarootdir = @datarootdir@
424dlopen_libs = @dlopen_libs@
425docdir = @docdir@
426dvidir = @dvidir@
427efl_doxygen = @efl_doxygen@
428efl_have_doxygen = @efl_have_doxygen@
429exec_prefix = @exec_prefix@
430have_lcov = @have_lcov@
431host = @host@
432host_alias = @host_alias@
433host_cpu = @host_cpu@
434host_os = @host_os@
435host_vendor = @host_vendor@
436htmldir = @htmldir@
437iconv_libs = @iconv_libs@
438includedir = @includedir@
439infodir = @infodir@
440install_sh = @install_sh@
441libdir = @libdir@
442libexecdir = @libexecdir@
443localedir = @localedir@
444localstatedir = @localstatedir@
445lt_ECHO = @lt_ECHO@
446lt_enable_auto_import = @lt_enable_auto_import@
447mandir = @mandir@
448mkdir_p = @mkdir_p@
449oldincludedir = @oldincludedir@
450pdfdir = @pdfdir@
451pkgconfig_requires_private = @pkgconfig_requires_private@
452prefix = @prefix@
453program_transform_name = @program_transform_name@
454psdir = @psdir@
455release_info = @release_info@
456requirement_eina = @requirement_eina@
457rt_libs = @rt_libs@
458sbindir = @sbindir@
459sharedstatedir = @sharedstatedir@
460srcdir = @srcdir@
461sysconfdir = @sysconfdir@
462target_alias = @target_alias@
463top_build_prefix = @top_build_prefix@
464top_builddir = @top_builddir@
465top_srcdir = @top_srcdir@
466version_info = @version_info@
467MAINTAINERCLEANFILES = Makefile.in
468AM_CPPFLAGS = -I. -I$(top_srcdir)/src/include \
469 -I$(top_builddir)/src/include $(am__append_2)
470LDADD = \
471 $(top_builddir)/src/lib/libeina.la
472
473SRCS = \
474 eina_accessor_01.c \
475 eina_array_01.c \
476 eina_array_02.c \
477 eina_error_01.c \
478 eina_file_01.c \
479 eina_hash_01.c \
480 eina_hash_02.c \
481 eina_hash_03.c \
482 eina_hash_04.c \
483 eina_hash_05.c \
484 eina_hash_06.c \
485 eina_hash_07.c \
486 eina_hash_08.c \
487 eina_iterator_01.c \
488 eina_list_01.c \
489 eina_list_02.c \
490 eina_list_03.c \
491 eina_list_04.c \
492 eina_log_01.c \
493 eina_log_02.c \
494 eina_log_03.c \
495 eina_inlist_01.c \
496 eina_inlist_02.c \
497 eina_inlist_03.c \
498 eina_str_01.c \
499 eina_strbuf_01.c \
500 eina_tiler_01.c
501
502@EFL_INSTALL_EXAMPLES_TRUE@filesdir = $(datadir)/$(PACKAGE)/examples
503@EFL_INSTALL_EXAMPLES_TRUE@files_DATA = $(SRCS)
504@BUILD_TILER_EXAMPLE_TRUE@@EFL_BUILD_EXAMPLES_TRUE@eina_tiler_01_LDADD = $(top_builddir)/src/lib/libeina.la @ECORE_EVAS_LIBS@
505all: all-am
506
507.SUFFIXES:
508.SUFFIXES: .c .lo .o .obj
509$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
510 @for dep in $?; do \
511 case '$(am__configure_deps)' in \
512 *$$dep*) \
513 ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
514 && { if test -f $@; then exit 0; else break; fi; }; \
515 exit 1;; \
516 esac; \
517 done; \
518 echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/examples/Makefile'; \
519 $(am__cd) $(top_srcdir) && \
520 $(AUTOMAKE) --gnu src/examples/Makefile
521.PRECIOUS: Makefile
522Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
523 @case '$?' in \
524 *config.status*) \
525 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
526 *) \
527 echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
528 cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
529 esac;
530
531$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
532 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
533
534$(top_srcdir)/configure: $(am__configure_deps)
535 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
536$(ACLOCAL_M4): $(am__aclocal_m4_deps)
537 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
538$(am__aclocal_m4_deps):
539install-pkglibPROGRAMS: $(pkglib_PROGRAMS)
540 @$(NORMAL_INSTALL)
541 test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
542 @list='$(pkglib_PROGRAMS)'; test -n "$(pkglibdir)" || list=; \
543 for p in $$list; do echo "$$p $$p"; done | \
544 sed 's/$(EXEEXT)$$//' | \
545 while read p p1; do if test -f $$p || test -f $$p1; \
546 then echo "$$p"; echo "$$p"; else :; fi; \
547 done | \
548 sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
549 -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
550 sed 'N;N;N;s,\n, ,g' | \
551 $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
552 { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
553 if ($$2 == $$4) files[d] = files[d] " " $$1; \
554 else { print "f", $$3 "/" $$4, $$1; } } \
555 END { for (d in files) print "f", d, files[d] }' | \
556 while read type dir files; do \
557 if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
558 test -z "$$files" || { \
559 echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(pkglibdir)$$dir'"; \
560 $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(pkglibdir)$$dir" || exit $$?; \
561 } \
562 ; done
563
564uninstall-pkglibPROGRAMS:
565 @$(NORMAL_UNINSTALL)
566 @list='$(pkglib_PROGRAMS)'; test -n "$(pkglibdir)" || list=; \
567 files=`for p in $$list; do echo "$$p"; done | \
568 sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
569 -e 's/$$/$(EXEEXT)/' `; \
570 test -n "$$list" || exit 0; \
571 echo " ( cd '$(DESTDIR)$(pkglibdir)' && rm -f" $$files ")"; \
572 cd "$(DESTDIR)$(pkglibdir)" && rm -f $$files
573
574clean-pkglibPROGRAMS:
575 @list='$(pkglib_PROGRAMS)'; test -n "$$list" || exit 0; \
576 echo " rm -f" $$list; \
577 rm -f $$list || exit $$?; \
578 test -n "$(EXEEXT)" || exit 0; \
579 list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
580 echo " rm -f" $$list; \
581 rm -f $$list
582eina_accessor_01$(EXEEXT): $(eina_accessor_01_OBJECTS) $(eina_accessor_01_DEPENDENCIES)
583 @rm -f eina_accessor_01$(EXEEXT)
584 $(AM_V_CCLD)$(LINK) $(eina_accessor_01_OBJECTS) $(eina_accessor_01_LDADD) $(LIBS)
585eina_array_01$(EXEEXT): $(eina_array_01_OBJECTS) $(eina_array_01_DEPENDENCIES)
586 @rm -f eina_array_01$(EXEEXT)
587 $(AM_V_CCLD)$(LINK) $(eina_array_01_OBJECTS) $(eina_array_01_LDADD) $(LIBS)
588eina_array_02$(EXEEXT): $(eina_array_02_OBJECTS) $(eina_array_02_DEPENDENCIES)
589 @rm -f eina_array_02$(EXEEXT)
590 $(AM_V_CCLD)$(LINK) $(eina_array_02_OBJECTS) $(eina_array_02_LDADD) $(LIBS)
591eina_error_01$(EXEEXT): $(eina_error_01_OBJECTS) $(eina_error_01_DEPENDENCIES)
592 @rm -f eina_error_01$(EXEEXT)
593 $(AM_V_CCLD)$(LINK) $(eina_error_01_OBJECTS) $(eina_error_01_LDADD) $(LIBS)
594eina_file_01$(EXEEXT): $(eina_file_01_OBJECTS) $(eina_file_01_DEPENDENCIES)
595 @rm -f eina_file_01$(EXEEXT)
596 $(AM_V_CCLD)$(LINK) $(eina_file_01_OBJECTS) $(eina_file_01_LDADD) $(LIBS)
597eina_hash_01$(EXEEXT): $(eina_hash_01_OBJECTS) $(eina_hash_01_DEPENDENCIES)
598 @rm -f eina_hash_01$(EXEEXT)
599 $(AM_V_CCLD)$(LINK) $(eina_hash_01_OBJECTS) $(eina_hash_01_LDADD) $(LIBS)
600eina_hash_02$(EXEEXT): $(eina_hash_02_OBJECTS) $(eina_hash_02_DEPENDENCIES)
601 @rm -f eina_hash_02$(EXEEXT)
602 $(AM_V_CCLD)$(LINK) $(eina_hash_02_OBJECTS) $(eina_hash_02_LDADD) $(LIBS)
603eina_hash_03$(EXEEXT): $(eina_hash_03_OBJECTS) $(eina_hash_03_DEPENDENCIES)
604 @rm -f eina_hash_03$(EXEEXT)
605 $(AM_V_CCLD)$(LINK) $(eina_hash_03_OBJECTS) $(eina_hash_03_LDADD) $(LIBS)
606eina_hash_04$(EXEEXT): $(eina_hash_04_OBJECTS) $(eina_hash_04_DEPENDENCIES)
607 @rm -f eina_hash_04$(EXEEXT)
608 $(AM_V_CCLD)$(LINK) $(eina_hash_04_OBJECTS) $(eina_hash_04_LDADD) $(LIBS)
609eina_hash_05$(EXEEXT): $(eina_hash_05_OBJECTS) $(eina_hash_05_DEPENDENCIES)
610 @rm -f eina_hash_05$(EXEEXT)
611 $(AM_V_CCLD)$(LINK) $(eina_hash_05_OBJECTS) $(eina_hash_05_LDADD) $(LIBS)
612eina_hash_06$(EXEEXT): $(eina_hash_06_OBJECTS) $(eina_hash_06_DEPENDENCIES)
613 @rm -f eina_hash_06$(EXEEXT)
614 $(AM_V_CCLD)$(LINK) $(eina_hash_06_OBJECTS) $(eina_hash_06_LDADD) $(LIBS)
615eina_hash_07$(EXEEXT): $(eina_hash_07_OBJECTS) $(eina_hash_07_DEPENDENCIES)
616 @rm -f eina_hash_07$(EXEEXT)
617 $(AM_V_CCLD)$(LINK) $(eina_hash_07_OBJECTS) $(eina_hash_07_LDADD) $(LIBS)
618eina_hash_08$(EXEEXT): $(eina_hash_08_OBJECTS) $(eina_hash_08_DEPENDENCIES)
619 @rm -f eina_hash_08$(EXEEXT)
620 $(AM_V_CCLD)$(LINK) $(eina_hash_08_OBJECTS) $(eina_hash_08_LDADD) $(LIBS)
621eina_inlist_01$(EXEEXT): $(eina_inlist_01_OBJECTS) $(eina_inlist_01_DEPENDENCIES)
622 @rm -f eina_inlist_01$(EXEEXT)
623 $(AM_V_CCLD)$(LINK) $(eina_inlist_01_OBJECTS) $(eina_inlist_01_LDADD) $(LIBS)
624eina_inlist_02$(EXEEXT): $(eina_inlist_02_OBJECTS) $(eina_inlist_02_DEPENDENCIES)
625 @rm -f eina_inlist_02$(EXEEXT)
626 $(AM_V_CCLD)$(LINK) $(eina_inlist_02_OBJECTS) $(eina_inlist_02_LDADD) $(LIBS)
627eina_inlist_03$(EXEEXT): $(eina_inlist_03_OBJECTS) $(eina_inlist_03_DEPENDENCIES)
628 @rm -f eina_inlist_03$(EXEEXT)
629 $(AM_V_CCLD)$(LINK) $(eina_inlist_03_OBJECTS) $(eina_inlist_03_LDADD) $(LIBS)
630eina_iterator_01$(EXEEXT): $(eina_iterator_01_OBJECTS) $(eina_iterator_01_DEPENDENCIES)
631 @rm -f eina_iterator_01$(EXEEXT)
632 $(AM_V_CCLD)$(LINK) $(eina_iterator_01_OBJECTS) $(eina_iterator_01_LDADD) $(LIBS)
633eina_list_01$(EXEEXT): $(eina_list_01_OBJECTS) $(eina_list_01_DEPENDENCIES)
634 @rm -f eina_list_01$(EXEEXT)
635 $(AM_V_CCLD)$(LINK) $(eina_list_01_OBJECTS) $(eina_list_01_LDADD) $(LIBS)
636eina_list_02$(EXEEXT): $(eina_list_02_OBJECTS) $(eina_list_02_DEPENDENCIES)
637 @rm -f eina_list_02$(EXEEXT)
638 $(AM_V_CCLD)$(LINK) $(eina_list_02_OBJECTS) $(eina_list_02_LDADD) $(LIBS)
639eina_list_03$(EXEEXT): $(eina_list_03_OBJECTS) $(eina_list_03_DEPENDENCIES)
640 @rm -f eina_list_03$(EXEEXT)
641 $(AM_V_CCLD)$(LINK) $(eina_list_03_OBJECTS) $(eina_list_03_LDADD) $(LIBS)
642eina_list_04$(EXEEXT): $(eina_list_04_OBJECTS) $(eina_list_04_DEPENDENCIES)
643 @rm -f eina_list_04$(EXEEXT)
644 $(AM_V_CCLD)$(LINK) $(eina_list_04_OBJECTS) $(eina_list_04_LDADD) $(LIBS)
645eina_log_01$(EXEEXT): $(eina_log_01_OBJECTS) $(eina_log_01_DEPENDENCIES)
646 @rm -f eina_log_01$(EXEEXT)
647 $(AM_V_CCLD)$(LINK) $(eina_log_01_OBJECTS) $(eina_log_01_LDADD) $(LIBS)
648eina_log_02$(EXEEXT): $(eina_log_02_OBJECTS) $(eina_log_02_DEPENDENCIES)
649 @rm -f eina_log_02$(EXEEXT)
650 $(AM_V_CCLD)$(LINK) $(eina_log_02_OBJECTS) $(eina_log_02_LDADD) $(LIBS)
651eina_log_03$(EXEEXT): $(eina_log_03_OBJECTS) $(eina_log_03_DEPENDENCIES)
652 @rm -f eina_log_03$(EXEEXT)
653 $(AM_V_CCLD)$(LINK) $(eina_log_03_OBJECTS) $(eina_log_03_LDADD) $(LIBS)
654eina_str_01$(EXEEXT): $(eina_str_01_OBJECTS) $(eina_str_01_DEPENDENCIES)
655 @rm -f eina_str_01$(EXEEXT)
656 $(AM_V_CCLD)$(LINK) $(eina_str_01_OBJECTS) $(eina_str_01_LDADD) $(LIBS)
657eina_strbuf_01$(EXEEXT): $(eina_strbuf_01_OBJECTS) $(eina_strbuf_01_DEPENDENCIES)
658 @rm -f eina_strbuf_01$(EXEEXT)
659 $(AM_V_CCLD)$(LINK) $(eina_strbuf_01_OBJECTS) $(eina_strbuf_01_LDADD) $(LIBS)
660eina_tiler_01$(EXEEXT): $(eina_tiler_01_OBJECTS) $(eina_tiler_01_DEPENDENCIES)
661 @rm -f eina_tiler_01$(EXEEXT)
662 $(AM_V_CCLD)$(LINK) $(eina_tiler_01_OBJECTS) $(eina_tiler_01_LDADD) $(LIBS)
663
664mostlyclean-compile:
665 -rm -f *.$(OBJEXT)
666
667distclean-compile:
668 -rm -f *.tab.c
669
670@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_accessor_01.Po@am__quote@
671@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_array_01.Po@am__quote@
672@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_array_02.Po@am__quote@
673@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_error_01.Po@am__quote@
674@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_file_01.Po@am__quote@
675@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_hash_01.Po@am__quote@
676@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_hash_02.Po@am__quote@
677@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_hash_03.Po@am__quote@
678@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_hash_04.Po@am__quote@
679@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_hash_05.Po@am__quote@
680@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_hash_06.Po@am__quote@
681@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_hash_07.Po@am__quote@
682@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_hash_08.Po@am__quote@
683@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_inlist_01.Po@am__quote@
684@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_inlist_02.Po@am__quote@
685@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_inlist_03.Po@am__quote@
686@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_iterator_01.Po@am__quote@
687@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_list_01.Po@am__quote@
688@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_list_02.Po@am__quote@
689@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_list_03.Po@am__quote@
690@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_list_04.Po@am__quote@
691@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_log_01.Po@am__quote@
692@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_log_02.Po@am__quote@
693@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_log_03.Po@am__quote@
694@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_str_01.Po@am__quote@
695@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_strbuf_01.Po@am__quote@
696@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eina_tiler_01.Po@am__quote@
697
698.c.o:
699@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
700@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
701@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
702@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
703@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
704@am__fastdepCC_FALSE@ $(COMPILE) -c $<
705
706.c.obj:
707@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
708@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
709@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
710@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
711@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
712@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
713
714.c.lo:
715@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
716@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
717@am__fastdepCC_FALSE@ $(AM_V_CC) @AM_BACKSLASH@
718@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
719@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
720@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
721
722mostlyclean-libtool:
723 -rm -f *.lo
724
725clean-libtool:
726 -rm -rf .libs _libs
727install-filesDATA: $(files_DATA)
728 @$(NORMAL_INSTALL)
729 test -z "$(filesdir)" || $(MKDIR_P) "$(DESTDIR)$(filesdir)"
730 @list='$(files_DATA)'; test -n "$(filesdir)" || list=; \
731 for p in $$list; do \
732 if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
733 echo "$$d$$p"; \
734 done | $(am__base_list) | \
735 while read files; do \
736 echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(filesdir)'"; \
737 $(INSTALL_DATA) $$files "$(DESTDIR)$(filesdir)" || exit $$?; \
738 done
739
740uninstall-filesDATA:
741 @$(NORMAL_UNINSTALL)
742 @list='$(files_DATA)'; test -n "$(filesdir)" || list=; \
743 files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
744 test -n "$$files" || exit 0; \
745 echo " ( cd '$(DESTDIR)$(filesdir)' && rm -f" $$files ")"; \
746 cd "$(DESTDIR)$(filesdir)" && rm -f $$files
747
748ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
749 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
750 unique=`for i in $$list; do \
751 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
752 done | \
753 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
754 END { if (nonempty) { for (i in files) print i; }; }'`; \
755 mkid -fID $$unique
756tags: TAGS
757
758TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
759 $(TAGS_FILES) $(LISP)
760 set x; \
761 here=`pwd`; \
762 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
763 unique=`for i in $$list; do \
764 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
765 done | \
766 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
767 END { if (nonempty) { for (i in files) print i; }; }'`; \
768 shift; \
769 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
770 test -n "$$unique" || unique=$$empty_fix; \
771 if test $$# -gt 0; then \
772 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
773 "$$@" $$unique; \
774 else \
775 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
776 $$unique; \
777 fi; \
778 fi
779ctags: CTAGS
780CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
781 $(TAGS_FILES) $(LISP)
782 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
783 unique=`for i in $$list; do \
784 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
785 done | \
786 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
787 END { if (nonempty) { for (i in files) print i; }; }'`; \
788 test -z "$(CTAGS_ARGS)$$unique" \
789 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
790 $$unique
791
792GTAGS:
793 here=`$(am__cd) $(top_builddir) && pwd` \
794 && $(am__cd) $(top_srcdir) \
795 && gtags -i $(GTAGS_ARGS) "$$here"
796
797distclean-tags:
798 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
799
800distdir: $(DISTFILES)
801 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
802 topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
803 list='$(DISTFILES)'; \
804 dist_files=`for file in $$list; do echo $$file; done | \
805 sed -e "s|^$$srcdirstrip/||;t" \
806 -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
807 case $$dist_files in \
808 */*) $(MKDIR_P) `echo "$$dist_files" | \
809 sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
810 sort -u` ;; \
811 esac; \
812 for file in $$dist_files; do \
813 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
814 if test -d $$d/$$file; then \
815 dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
816 if test -d "$(distdir)/$$file"; then \
817 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
818 fi; \
819 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
820 cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
821 find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
822 fi; \
823 cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
824 else \
825 test -f "$(distdir)/$$file" \
826 || cp -p $$d/$$file "$(distdir)/$$file" \
827 || exit 1; \
828 fi; \
829 done
830check-am: all-am
831check: check-am
832all-am: Makefile $(PROGRAMS) $(DATA)
833installdirs:
834 for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(filesdir)"; do \
835 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
836 done
837install: install-am
838install-exec: install-exec-am
839install-data: install-data-am
840uninstall: uninstall-am
841
842install-am: all-am
843 @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
844
845installcheck: installcheck-am
846install-strip:
847 $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
848 install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
849 `test -z '$(STRIP)' || \
850 echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
851mostlyclean-generic:
852
853clean-generic:
854
855distclean-generic:
856 -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
857 -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
858
859maintainer-clean-generic:
860 @echo "This command is intended for maintainers to use"
861 @echo "it deletes files that may require special tools to rebuild."
862 -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
863clean: clean-am
864
865clean-am: clean-generic clean-libtool clean-pkglibPROGRAMS \
866 mostlyclean-am
867
868distclean: distclean-am
869 -rm -rf ./$(DEPDIR)
870 -rm -f Makefile
871distclean-am: clean-am distclean-compile distclean-generic \
872 distclean-tags
873
874dvi: dvi-am
875
876dvi-am:
877
878html: html-am
879
880html-am:
881
882info: info-am
883
884info-am:
885
886install-data-am: install-filesDATA
887
888install-dvi: install-dvi-am
889
890install-dvi-am:
891
892install-exec-am: install-pkglibPROGRAMS
893
894install-html: install-html-am
895
896install-html-am:
897
898install-info: install-info-am
899
900install-info-am:
901
902install-man:
903
904install-pdf: install-pdf-am
905
906install-pdf-am:
907
908install-ps: install-ps-am
909
910install-ps-am:
911
912installcheck-am:
913
914maintainer-clean: maintainer-clean-am
915 -rm -rf ./$(DEPDIR)
916 -rm -f Makefile
917maintainer-clean-am: distclean-am maintainer-clean-generic
918
919mostlyclean: mostlyclean-am
920
921mostlyclean-am: mostlyclean-compile mostlyclean-generic \
922 mostlyclean-libtool
923
924pdf: pdf-am
925
926pdf-am:
927
928ps: ps-am
929
930ps-am:
931
932uninstall-am: uninstall-filesDATA uninstall-pkglibPROGRAMS
933
934.MAKE: install-am install-strip
935
936.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
937 clean-libtool clean-pkglibPROGRAMS ctags distclean \
938 distclean-compile distclean-generic distclean-libtool \
939 distclean-tags distdir dvi dvi-am html html-am info info-am \
940 install install-am install-data install-data-am install-dvi \
941 install-dvi-am install-exec install-exec-am install-filesDATA \
942 install-html install-html-am install-info install-info-am \
943 install-man install-pdf install-pdf-am install-pkglibPROGRAMS \
944 install-ps install-ps-am install-strip installcheck \
945 installcheck-am installdirs maintainer-clean \
946 maintainer-clean-generic mostlyclean mostlyclean-compile \
947 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
948 tags uninstall uninstall-am uninstall-filesDATA \
949 uninstall-pkglibPROGRAMS
950
951
952# Tell versions [3.59,3.63) of GNU make to not export all variables.
953# Otherwise a system limit (for SysV at least) may be exceeded.
954.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 @@
1//Compile with:
2//gcc -g `pkg-config --cflags --libs eina` eina_accessor_01.c -o eina_accessor_01
3
4#include <stdio.h>
5
6#include <Eina.h>
7
8int
9main(int argc, char **argv)
10{
11 const char *strings[] = {
12 "even", "odd", "even", "odd", "even", "odd", "even", "odd", "even", "odd"
13 };
14 const char *more_strings[] = {
15 "0", "1", "2", "3", "4", "5", "6", "7", "8", "9"
16 };
17 Eina_Array *array;
18 Eina_List *list = NULL;
19 Eina_Accessor *acc;
20 unsigned short int i;
21 void *data;
22
23 eina_init();
24
25 array = eina_array_new(10);
26
27 for (i = 0; i < 10; i++)
28 {
29 eina_array_push(array, strings[i]);
30 list = eina_list_append(list, more_strings[i]);
31 }
32
33 acc = eina_array_accessor_new(array);
34 for(i = 1; i < 10; i += 2)
35 {
36 eina_accessor_data_get(acc, i, &data);
37 printf("%s\n", (const char *)data);
38 }
39 eina_accessor_free(acc);
40 eina_array_free(array);
41
42 acc = eina_list_accessor_new(list);
43 for(i = 1; i < 10; i += 2)
44 {
45 eina_accessor_data_get(acc, i, &data);
46 printf("%s\n", (const char *)data);
47 }
48
49 eina_list_free(eina_accessor_container_get(acc));
50 eina_accessor_free(acc);
51
52 eina_shutdown();
53
54 return 0;
55}
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 @@
1//Compile with:
2//gcc -g `pkg-config --cflags --libs eina` eina_array_01.c -o eina_array_01
3
4#include <stdio.h>
5#include <string.h>
6
7#include <Eina.h>
8
9static Eina_Bool
10_print(const void *container, void *data, void *fdata)
11{
12 printf("%s\n", data);
13 return EINA_TRUE;
14}
15
16int
17main(int argc, char **argv)
18{
19 const char* strings[] = {
20 "helo", "hera", "starbuck", "kat", "boomer",
21 "hotdog", "longshot", "jammer", "crashdown", "hardball",
22 "duck", "racetrack", "apolo", "husker", "freaker",
23 "skulls", "bulldog", "flat top", "hammerhead", "gonzo"
24 };
25 Eina_Array *array;
26 Eina_Array_Iterator iterator;
27 char *item;
28 unsigned int i;
29
30 eina_init();
31
32 array = eina_array_new(10);
33 eina_array_step_set(array, sizeof(*array), 20);
34
35 for (i = 0; i < 20; i++)
36 eina_array_push(array, strdup(strings[i]));
37
38 printf("array count: %d\n", eina_array_count_get(array));
39 eina_array_foreach(array, _print, NULL);
40
41 printf("Top gun: %s\n", (char*)eina_array_data_get(array, 2));
42
43 while (eina_array_count_get(array))
44 free(eina_array_pop(array));
45
46 eina_array_free(array);
47
48 eina_shutdown();
49
50 return 0;
51}
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 @@
1//Compile with:
2//gcc -g `pkg-config --cflags --libs eina` eina_array_02.c -o eina_array_02
3
4#include <stdio.h>
5#include <string.h>
6
7#include <Eina.h>
8
9Eina_Bool keep(void *data, void *gdata)
10{
11 if (strlen((const char*)data) <= 5)
12 return EINA_TRUE;
13 return EINA_FALSE;
14}
15
16int
17main(int argc, char **argv)
18{
19 const char* strs[] = {
20 "one", "two", "three", "four", "five", "six", "seven", "eight", "nine",
21 "ten", "eleven", "twelve", "thirteen", "fourtenn", "fifteen", "sixteen",
22 "seventeen", "eighteen", "nineteen", "twenty"
23 };
24 const char* strings[] = {
25 "helo", "hera", "starbuck", "kat", "boomer",
26 "hotdog", "longshot", "jammer", "crashdown", "hardball",
27 "duck", "racetrack", "apolo", "husker", "freaker",
28 "skulls", "bulldog", "flat top", "hammerhead", "gonzo"
29 };
30 Eina_Array *array;
31 Eina_Array_Iterator iterator;
32 const char *item;
33 unsigned int i;
34
35 eina_init();
36
37 array = eina_array_new(10);
38
39 for (i = 0; i < 20; i++)
40 eina_array_push(array, strs[i]);
41
42 eina_array_clean(array);
43 for (i = 0; i < 20; i++)
44 eina_array_push(array, strings[i]);
45
46 eina_array_data_set(array, 17, "flattop");
47
48 eina_array_remove(array, keep, NULL);
49 EINA_ARRAY_ITER_NEXT(array, i, item, iterator)
50 printf("item #%d: %s\n", i, item);
51
52 eina_array_free(array);
53
54 eina_shutdown();
55
56 return 0;
57}
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 @@
1//Compile with:
2//gcc -g `pkg-config --cflags --libs eina` eina_error_01.c -o eina_error_01
3
4#include <stdlib.h>
5#include <stdio.h>
6
7#include <eina_error.h>
8
9Eina_Error MY_ERROR_NEGATIVE;
10Eina_Error MY_ERROR_NULL;
11
12void *data_new()
13{
14 eina_error_set(0);
15
16 eina_error_set(MY_ERROR_NULL);
17 return NULL;
18}
19
20int test(int n)
21{
22 eina_error_set(0);
23
24 if (n < 0)
25 {
26 eina_error_set(MY_ERROR_NEGATIVE);
27 return 0;
28 }
29
30 return 1;
31}
32
33int main(void)
34{
35 void *data;
36
37 if (!eina_init())
38 {
39 printf ("Error during the initialization of eina_error module\n");
40 return EXIT_FAILURE;
41 }
42
43 MY_ERROR_NEGATIVE = eina_error_msg_static_register("Negative number");
44 MY_ERROR_NULL = eina_error_msg_static_register("NULL pointer");
45
46 data = data_new();
47 if (!data)
48 {
49 Eina_Error err;
50
51 err = eina_error_get();
52 if (err)
53 printf("Error during memory allocation: %s\n",
54 eina_error_msg_get(err));
55 }
56
57 if (!test(0))
58 {
59 Eina_Error err;
60
61 err = eina_error_get();
62 if (err)
63 printf("Error during test function: %s\n",
64 eina_error_msg_get(err));
65 }
66
67 if (!test(-1))
68 {
69 Eina_Error err;
70
71 err = eina_error_get();
72 if (err)
73 printf("Error during test function: %s\n",
74 eina_error_msg_get(err));
75 }
76
77 eina_shutdown();
78
79 return EXIT_SUCCESS;
80} \ 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 @@
1//Compile with:
2//gcc -g `pkg-config --cflags --libs eina` eina_file_01.c -o eina_file_01
3
4#include <stdio.h>
5#include <Eina.h>
6
7static void
8_print_cb(const char *name, const char *path, void *data)
9{
10 printf("file %s in %s\n", name, path);
11}
12
13int
14main(int argc, char **argv)
15{
16 Eina_Iterator *it;
17 const char *f_name;
18 const Eina_File_Direct_Info *f_info;
19
20 eina_init();
21
22 eina_file_dir_list("/home/", EINA_FALSE, _print_cb, NULL);
23
24 it = eina_file_ls("/home/");
25 EINA_ITERATOR_FOREACH(it, f_name)
26 {
27 printf("%s\n", f_name);
28 eina_stringshare_del(f_name);
29 }
30 eina_iterator_free(it);
31
32 it = eina_file_stat_ls("/home/");
33 EINA_ITERATOR_FOREACH(it, f_info)
34 printf("%s if of type %d\n", f_info->path, f_info->type);
35 eina_iterator_free(it);
36
37 it = eina_file_direct_ls("/home/");
38 EINA_ITERATOR_FOREACH(it, f_info)
39 printf("%s if of type %d\n", f_info->path, f_info->type);
40 eina_iterator_free(it);
41
42 eina_shutdown();
43
44 return 0;
45}
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 @@
1#include <stdio.h>
2#include <string.h>
3#include <Eina.h>
4
5/*
6 * Eina Hash - phonebook
7 *
8 * This example demonstrate the use of Eina Hash by implementing a phonebook
9 * that stores its contact data into the hash.
10 *
11 * It indexes the phone numbers by Contact Full Name, so it's a hash with
12 * string keys.
13 */
14
15struct _Phone_Entry {
16 const char *name; // Full name.
17 const char *number; // Phone number.
18};
19
20typedef struct _Phone_Entry Phone_Entry;
21
22static Phone_Entry _start_entries[] = {
23 { "Wolfgang Amadeus Mozart", "+01 23 456-78910" },
24 { "Ludwig van Beethoven", "+12 34 567-89101" },
25 { "Richard Georg Strauss", "+23 45 678-91012" },
26 { "Heitor Villa-Lobos", "+34 56 789-10123" },
27 { NULL, NULL }
28}; // _start_entries
29
30static void
31_phone_entry_free_cb(void *data)
32{
33 free(data);
34}
35
36static Eina_Bool
37_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
38 void *data, void *fdata)
39{
40 const char *name = key;
41 const char *number = data;
42 printf("%s: %s\n", name, number);
43
44 // Return EINA_FALSE to stop this callback from being called
45 return EINA_TRUE;
46}
47
48int
49main(int argc, const char *argv[])
50{
51 Eina_Hash *phone_book = NULL;
52 int i;
53 const char *entry_name = "Heitor Villa-Lobos";
54 char *phone = NULL;
55 Eina_Bool r;
56 Eina_Iterator *it;
57 void *data;
58
59 eina_init();
60
61 phone_book = eina_hash_string_superfast_new(_phone_entry_free_cb);
62
63 // Add initial entries to our hash
64 for (i = 0; _start_entries[i].name != NULL; i++)
65 {
66 eina_hash_add(phone_book, _start_entries[i].name,
67 strdup(_start_entries[i].number));
68 }
69
70 // Look for a specific entry and get its phone number
71 phone = eina_hash_find(phone_book, entry_name);
72 if (phone)
73 {
74 printf("Printing entry.\n");
75 printf("Name: %s\n", entry_name);
76 printf("Number: %s\n\n", phone);
77 }
78
79 // Delete this entry
80 r = eina_hash_del(phone_book, entry_name, NULL);
81 printf("Hash entry successfully deleted? %d\n\n", r);
82
83 // Modify the pointer data of an entry and free the old one
84 phone = eina_hash_modify(phone_book, "Richard Georg Strauss",
85 strdup("+23 45 111-11111"));
86 free(phone);
87
88 // Modify or add an entry to the hash with eina_hash_set
89 // Let's first add a new entry
90 eina_error_set(0);
91 phone = eina_hash_set(phone_book, "Raul Seixas",
92 strdup("+55 01 234-56789"));
93 if (!phone)
94 {
95 Eina_Error err = eina_error_get();
96 if (!err)
97 {
98 printf("No previous phone found for Raul Seixas. ");
99 printf("Creating new entry.\n");
100 }
101 else
102 printf("Error when setting phone for Raul Seixas\n");
103 }
104 else
105 {
106 printf("Old phone for Raul Seixas was %s\n", phone);
107 free(phone);
108 }
109
110 printf("\n");
111
112 // Now change the phone number
113 eina_error_set(0);
114 phone = eina_hash_set(phone_book, "Raul Seixas",
115 strdup("+55 02 222-22222"));
116 if (phone)
117 {
118 printf("Changing phone for Raul Seixas to +55 02 222-22222. ");
119 printf("Old phone was %s\n", phone);
120 free(phone);
121 }
122 else
123 {
124 Eina_Error err = eina_error_get();
125 if (err)
126 printf("Error when changing phone for Raul Seixas\n");
127 else
128 {
129 printf("No previous phone found for Raul Seixas. ");
130 printf("Creating new entry.\n");
131 }
132 }
133
134 // There are many ways to iterate over our Phone book.
135 // First, iterate showing the names and associated numbers.
136 printf("List of phones:\n");
137 eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL);
138 printf("\n");
139
140 // Now iterate using an iterator
141 printf("List of phones:\n");
142 it = eina_hash_iterator_tuple_new(phone_book);
143 while (eina_iterator_next(it, &data))
144 {
145 Eina_Hash_Tuple *t = data;
146 const char *name = t->key;
147 const char *number = t->data;
148 printf("%s: %s\n", name, number);
149 }
150 eina_iterator_free(it); // Always free the iterator after its use
151 printf("\n");
152
153 // Just iterate over the keys (names)
154 printf("List of names in the phone book:\n");
155 it = eina_hash_iterator_key_new(phone_book);
156 while (eina_iterator_next(it, &data))
157 {
158 const char *name = data;
159 printf("%s\n", name);
160 }
161 eina_iterator_free(it);
162 printf("\n");
163
164 // Just iterate over the data (numbers)
165 printf("List of numbers in the phone book:\n");
166 it = eina_hash_iterator_data_new(phone_book);
167 while (eina_iterator_next(it, &data))
168 {
169 const char *number = data;
170 printf("%s\n", number);
171 }
172 eina_iterator_free(it);
173 printf("\n");
174
175 // Check how many items are in the phone book
176 printf("There are %d items in the hash.\n\n",
177 eina_hash_population(phone_book));
178
179 // Change the name (key) on an entry
180 eina_hash_move(phone_book, "Raul Seixas", "Alceu Valenca");
181 printf("List of phones after change:\n");
182 eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL);
183 printf("\n");
184
185 // Empty the phone book, but don't destroy it
186 eina_hash_free_buckets(phone_book);
187 printf("There are %d items in the hash.\n\n",
188 eina_hash_population(phone_book));
189
190 // Phone book could still be used, but we are freeing it since we are
191 // done for now
192 eina_hash_free(phone_book);
193
194 eina_shutdown();
195}
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 @@
1#include <stdio.h>
2#include <string.h>
3#include <Eina.h>
4
5/*
6 * Eina Hash - Two more types of hash
7 *
8 * This example demonstrate two other types of hash in action - using
9 * eina_hash_stringshared_new and eina_hash_new.
10 *
11 * It indexes the phone numbers by Contact Full Name, so it's a hash with string
12 * keys, exactly the same as the other example.
13 */
14
15struct _Phone_Entry {
16 const char *name; // Full name.
17 const char *number; // Phone number.
18};
19
20typedef struct _Phone_Entry Phone_Entry;
21
22static Phone_Entry _start_entries[] = {
23 { "Wolfgang Amadeus Mozart", "+01 23 456-78910" },
24 { "Ludwig van Beethoven", "+12 34 567-89101" },
25 { "Richard Georg Strauss", "+23 45 678-91012" },
26 { "Heitor Villa-Lobos", "+34 56 789-10123" },
27 { NULL, NULL }
28};
29
30static void
31_phone_entry_free_cb(void *data)
32{
33 free(data);
34}
35
36static void
37_phone_book_stringshared_free_cb(void *data)
38{
39 Phone_Entry *e = data;
40 eina_stringshare_del(e->name);
41 eina_stringshare_del(e->number);
42 free(e);
43}
44
45static Eina_Bool
46_phone_book_stringshared_foreach_cb(const Eina_Hash *phone_book,
47 const void *key, void *data, void *fdata)
48{
49 Phone_Entry *e = data;
50 const char *name = e->name; // e->name == key
51 const char *number = e->number;
52 printf("%s: %s\n", name, number);
53
54 return EINA_TRUE;
55}
56
57static void
58example_hash_stringshared(void)
59{
60 Eina_Hash *phone_book = NULL;
61 int i;
62
63 // Create the hash as before
64 phone_book = eina_hash_stringshared_new(_phone_book_stringshared_free_cb);
65
66 // Add initial entries to our hash, using direct_add
67 for (i = 0; _start_entries[i].name != NULL; i++)
68 {
69 Phone_Entry *e = malloc(sizeof(Phone_Entry));
70 e->name = eina_stringshare_add(_start_entries[i].name);
71 e->number = eina_stringshare_add(_start_entries[i].number);
72 // Since we are storing the key (name) in our struct, we can use
73 // eina_hash_direct_add. It could be used in the previous example
74 // too, since each key is already stored in the _start_entries
75 // static array, but we started it with the default add function.
76 eina_hash_direct_add(phone_book, e->name, e);
77 }
78
79 // Iterate over the elements
80 printf("List of phones:\n");
81 eina_hash_foreach(phone_book, _phone_book_stringshared_foreach_cb, NULL);
82 printf("\n");
83
84 eina_hash_free(phone_book);
85}
86
87static unsigned int
88_phone_book_string_key_length(const char *key)
89{
90 if (!key)
91 return 0;
92
93 return (int)strlen(key) + 1;
94}
95
96static int
97_phone_book_string_key_cmp(const char *key1, int key1_length,
98 const char *key2, int key2_length)
99{
100 return strcmp(key1, key2);
101}
102
103static void
104example_hash_big(void)
105{
106 Eina_Hash *phone_book = NULL;
107 int i;
108 const char *phone;
109
110 // Create the same hash as used in eina_hash_01.c, but
111 // use 1024 (2 ^ 10) buckets.
112 phone_book = eina_hash_new(EINA_KEY_LENGTH(_phone_book_string_key_length),
113 EINA_KEY_CMP(_phone_book_string_key_cmp),
114 EINA_KEY_HASH(eina_hash_superfast),
115 _phone_entry_free_cb,
116 10);
117 for (i = 0; _start_entries[i].name != NULL; i++)
118 {
119 eina_hash_add(phone_book, _start_entries[i].name,
120 strdup(_start_entries[i].number));
121 }
122
123 // Look for a specific entry and get its phone number
124 phone = eina_hash_find(phone_book, "Heitor Villa-Lobos");
125 if (phone)
126 {
127 printf("Printing entry.\n");
128 printf("Name: Heitor Villa-Lobos\n");
129 printf("Number: %s\n\n", phone);
130 }
131
132 eina_hash_free(phone_book);
133}
134
135int
136main(int argc, const char *argv[])
137{
138 eina_init();
139
140 example_hash_stringshared();
141 example_hash_big();
142
143 eina_shutdown();
144}
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 @@
1#include <stdio.h>
2#include <string.h>
3#include <Eina.h>
4
5/*
6 * Eina Hash - phonebook
7 *
8 * This example demonstrate the use of Eina Hash by implementing a phonebook
9 * that stores its contact data into the hash.
10 *
11 * It indexes the phone numbers by Contact Full Name, so it's a hash with
12 * string keys.
13 */
14
15struct _Phone_Entry {
16 const char *name; // Full name.
17 const char *number; // Phone number.
18};
19
20typedef struct _Phone_Entry Phone_Entry;
21
22static Phone_Entry _start_entries[] = {
23 { "Wolfgang Amadeus Mozart", "+01 23 456-78910" },
24 { "Ludwig van Beethoven", "+12 34 567-89101" },
25 { "Richard Georg Strauss", "+23 45 678-91012" },
26 { "Heitor Villa-Lobos", "+34 56 789-10123" },
27 { NULL, NULL }
28}; // _start_entries
29
30static void
31_phone_entry_free_cb(void *data)
32{
33 free(data);
34}
35
36static Eina_Bool
37_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
38 void *data, void *fdata)
39{
40 const char *name = key;
41 const char *number = data;
42 printf("%s: %s\n", name, number);
43
44 // Return EINA_FALSE to stop this callback from being called
45 return EINA_TRUE;
46}
47
48int
49main(int argc, const char *argv[])
50{
51 Eina_Hash *phone_book = NULL;
52 int i;
53 const char *entry_name = "Heitor Villa-Lobos";
54 char *phone = NULL;
55 Eina_Bool r;
56 Eina_Iterator *it;
57 void *data;
58
59 eina_init();
60
61 phone_book = eina_hash_string_small_new(_phone_entry_free_cb);
62
63 // Add initial entries to our hash
64 for (i = 0; _start_entries[i].name != NULL; i++)
65 {
66 eina_hash_add(phone_book, _start_entries[i].name,
67 strdup(_start_entries[i].number));
68 }
69
70 // Look for a specific entry and get its phone number
71 phone = eina_hash_find(phone_book, entry_name);
72 if (phone)
73 {
74 printf("Printing entry.\n");
75 printf("Name: %s\n", entry_name);
76 printf("Number: %s\n\n", phone);
77 }
78
79 // Delete this entry
80 r = eina_hash_del(phone_book, entry_name, NULL);
81 printf("Hash entry successfully deleted? %d\n\n", r);
82
83 // Modify the pointer data of an entry and free the old one
84 phone = eina_hash_modify(phone_book, "Richard Georg Strauss",
85 strdup("+23 45 111-11111"));
86 free(phone);
87
88 // Modify or add an entry to the hash with eina_hash_set
89 // Let's first add a new entry
90 eina_error_set(0);
91 phone = eina_hash_set(phone_book, "Raul Seixas",
92 strdup("+55 01 234-56789"));
93 if (!phone)
94 {
95 Eina_Error err = eina_error_get();
96 if (!err)
97 {
98 printf("No previous phone found for Raul Seixas. ");
99 printf("Creating new entry.\n");
100 }
101 else
102 printf("Error when setting phone for Raul Seixas\n");
103 }
104 else
105 {
106 printf("Old phone for Raul Seixas was %s\n", phone);
107 free(phone);
108 }
109
110 printf("\n");
111
112 // Now change the phone number
113 eina_error_set(0);
114 phone = eina_hash_set(phone_book, "Raul Seixas",
115 strdup("+55 02 222-22222"));
116 if (phone)
117 {
118 printf("Changing phone for Raul Seixas to +55 02 222-22222. ");
119 printf("Old phone was %s\n", phone);
120 free(phone);
121 }
122 else
123 {
124 Eina_Error err = eina_error_get();
125 if (err)
126 printf("Error when changing phone for Raul Seixas\n");
127 else
128 {
129 printf("No previous phone found for Raul Seixas. ");
130 printf("Creating new entry.\n");
131 }
132 }
133
134 // There are many ways to iterate over our Phone book.
135 // First, iterate showing the names and associated numbers.
136 printf("List of phones:\n");
137 eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL);
138 printf("\n");
139
140 // Now iterate using an iterator
141 printf("List of phones:\n");
142 it = eina_hash_iterator_tuple_new(phone_book);
143 while (eina_iterator_next(it, &data))
144 {
145 Eina_Hash_Tuple *t = data;
146 const char *name = t->key;
147 const char *number = t->data;
148 printf("%s: %s\n", name, number);
149 }
150 eina_iterator_free(it); // Always free the iterator after its use
151 printf("\n");
152
153 // Just iterate over the keys (names)
154 printf("List of names in the phone book:\n");
155 it = eina_hash_iterator_key_new(phone_book);
156 while (eina_iterator_next(it, &data))
157 {
158 const char *name = data;
159 printf("%s\n", name);
160 }
161 eina_iterator_free(it);
162 printf("\n");
163
164 // Just iterate over the data (numbers)
165 printf("List of numbers in the phone book:\n");
166 it = eina_hash_iterator_data_new(phone_book);
167 while (eina_iterator_next(it, &data))
168 {
169 const char *number = data;
170 printf("%s\n", number);
171 }
172 eina_iterator_free(it);
173 printf("\n");
174
175 // Check how many items are in the phone book
176 printf("There are %d items in the hash.\n\n",
177 eina_hash_population(phone_book));
178
179 // Change the name (key) on an entry
180 eina_hash_move(phone_book, "Raul Seixas", "Alceu Valenca");
181 printf("List of phones after change:\n");
182 eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL);
183 printf("\n");
184
185 // Empty the phone book, but don't destroy it
186 eina_hash_free_buckets(phone_book);
187 printf("There are %d items in the hash.\n\n",
188 eina_hash_population(phone_book));
189
190 // Phone book could still be used, but we are freeing it since we are
191 // done for now
192 eina_hash_free(phone_book);
193
194 eina_shutdown();
195}
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 @@
1#include <stdio.h>
2#include <string.h>
3#include <Eina.h>
4
5/*
6 * Eina Hash - phonebook
7 *
8 * This example demonstrate the use of Eina Hash by implementing a phonebook
9 * that stores its contact data into the hash.
10 *
11 * It indexes the phone numbers by Contact Full Name, so it's a hash with
12 * string keys.
13 */
14
15struct _Phone_Entry {
16 const char *name; // Full name.
17 const char *number; // Phone number.
18};
19
20typedef struct _Phone_Entry Phone_Entry;
21
22static Phone_Entry _start_entries[] = {
23 { "Wolfgang Amadeus Mozart", "+01 23 456-78910" },
24 { "Ludwig van Beethoven", "+12 34 567-89101" },
25 { "Richard Georg Strauss", "+23 45 678-91012" },
26 { "Heitor Villa-Lobos", "+34 56 789-10123" },
27 { NULL, NULL }
28}; // _start_entries
29
30static void
31_phone_entry_free_cb(void *data)
32{
33 free(data);
34}
35
36static Eina_Bool
37_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
38 void *data, void *fdata)
39{
40 const char *name = key;
41 const char *number = data;
42 printf("%s: %s\n", name, number);
43
44 // Return EINA_FALSE to stop this callback from being called
45 return EINA_TRUE;
46}
47
48int
49main(int argc, const char *argv[])
50{
51 Eina_Hash *phone_book = NULL;
52 int i;
53 const char *entry_name = "Heitor Villa-Lobos";
54 char *phone = NULL;
55 Eina_Bool r;
56 Eina_Iterator *it;
57 void *data;
58
59 eina_init();
60
61 phone_book = eina_hash_string_djb2_new(_phone_entry_free_cb);
62
63 // Add initial entries to our hash
64 for (i = 0; _start_entries[i].name != NULL; i++)
65 {
66 eina_hash_add(phone_book, _start_entries[i].name,
67 strdup(_start_entries[i].number));
68 }
69
70 // Look for a specific entry and get its phone number
71 phone = eina_hash_find(phone_book, entry_name);
72 if (phone)
73 {
74 printf("Printing entry.\n");
75 printf("Name: %s\n", entry_name);
76 printf("Number: %s\n\n", phone);
77 }
78
79 // Delete this entry
80 r = eina_hash_del(phone_book, entry_name, NULL);
81 printf("Hash entry successfully deleted? %d\n\n", r);
82
83 // Modify the pointer data of an entry and free the old one
84 phone = eina_hash_modify(phone_book, "Richard Georg Strauss",
85 strdup("+23 45 111-11111"));
86 free(phone);
87
88 // Modify or add an entry to the hash with eina_hash_set
89 // Let's first add a new entry
90 eina_error_set(0);
91 phone = eina_hash_set(phone_book, "Raul Seixas",
92 strdup("+55 01 234-56789"));
93 if (!phone)
94 {
95 Eina_Error err = eina_error_get();
96 if (!err)
97 {
98 printf("No previous phone found for Raul Seixas. ");
99 printf("Creating new entry.\n");
100 }
101 else
102 printf("Error when setting phone for Raul Seixas\n");
103 }
104 else
105 {
106 printf("Old phone for Raul Seixas was %s\n", phone);
107 free(phone);
108 }
109
110 printf("\n");
111
112 // Now change the phone number
113 eina_error_set(0);
114 phone = eina_hash_set(phone_book, "Raul Seixas",
115 strdup("+55 02 222-22222"));
116 if (phone)
117 {
118 printf("Changing phone for Raul Seixas to +55 02 222-22222. ");
119 printf("Old phone was %s\n", phone);
120 free(phone);
121 }
122 else
123 {
124 Eina_Error err = eina_error_get();
125 if (err)
126 printf("Error when changing phone for Raul Seixas\n");
127 else
128 {
129 printf("No previous phone found for Raul Seixas. ");
130 printf("Creating new entry.\n");
131 }
132 }
133
134 // There are many ways to iterate over our Phone book.
135 // First, iterate showing the names and associated numbers.
136 printf("List of phones:\n");
137 eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL);
138 printf("\n");
139
140 // Now iterate using an iterator
141 printf("List of phones:\n");
142 it = eina_hash_iterator_tuple_new(phone_book);
143 while (eina_iterator_next(it, &data))
144 {
145 Eina_Hash_Tuple *t = data;
146 const char *name = t->key;
147 const char *number = t->data;
148 printf("%s: %s\n", name, number);
149 }
150 eina_iterator_free(it); // Always free the iterator after its use
151 printf("\n");
152
153 // Just iterate over the keys (names)
154 printf("List of names in the phone book:\n");
155 it = eina_hash_iterator_key_new(phone_book);
156 while (eina_iterator_next(it, &data))
157 {
158 const char *name = data;
159 printf("%s\n", name);
160 }
161 eina_iterator_free(it);
162 printf("\n");
163
164 // Just iterate over the data (numbers)
165 printf("List of numbers in the phone book:\n");
166 it = eina_hash_iterator_data_new(phone_book);
167 while (eina_iterator_next(it, &data))
168 {
169 const char *number = data;
170 printf("%s\n", number);
171 }
172 eina_iterator_free(it);
173 printf("\n");
174
175 // Check how many items are in the phone book
176 printf("There are %d items in the hash.\n\n",
177 eina_hash_population(phone_book));
178
179 // Change the name (key) on an entry
180 eina_hash_move(phone_book, "Raul Seixas", "Alceu Valenca");
181 printf("List of phones after change:\n");
182 eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL);
183 printf("\n");
184
185 // Empty the phone book, but don't destroy it
186 eina_hash_free_buckets(phone_book);
187 printf("There are %d items in the hash.\n\n",
188 eina_hash_population(phone_book));
189
190 // Phone book could still be used, but we are freeing it since we are
191 // done for now
192 eina_hash_free(phone_book);
193
194 eina_shutdown();
195}
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 @@
1#include <stdio.h>
2#include <string.h>
3#include <Eina.h>
4
5/*
6 * Eina Hash - phonebook
7 *
8 * This example demonstrate the use of Eina Hash by implementing a phonebook
9 * that stores its contact data into the hash.
10 *
11 * It indexes the phone numbers by Contact Full Name, so it's a hash with
12 * string keys.
13 */
14
15struct _Phone_Entry {
16 int32_t id; // Full name.
17 const char *number; // Phone number.
18};
19
20typedef struct _Phone_Entry Phone_Entry;
21
22static Phone_Entry _start_entries[] = {
23 { 1, "+01 23 456-78910" },
24 { 2, "+12 34 567-89101" },
25 { 3, "+23 45 678-91012" },
26 { 4, "+34 56 789-10123" },
27 { -1, NULL }
28}; // _start_entries
29
30static void
31_phone_entry_free_cb(void *data)
32{
33 free(data);
34}
35
36static Eina_Bool
37_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
38 void *data, void *fdata)
39{
40 const int32_t *id = key;
41 const char *number = data;
42 printf("%d: %s\n", *id, number);
43
44 // Return EINA_FALSE to stop this callback from being called
45 return EINA_TRUE;
46}
47
48int
49main(int argc, const char *argv[])
50{
51 Eina_Hash *phone_book = NULL;
52 int i;
53 int32_t entry_id = 4;
54 char *phone = NULL;
55 Eina_Bool r;
56 Eina_Iterator *it;
57 void *data;
58
59 eina_init();
60
61 phone_book = eina_hash_int32_new(_phone_entry_free_cb);
62
63 // Add initial entries to our hash
64 for (i = 0; _start_entries[i].id != -1; i++)
65 {
66 eina_hash_add(phone_book, &_start_entries[i].id,
67 strdup(_start_entries[i].number));
68 }
69
70 // Look for a specific entry and get its phone number
71 phone = eina_hash_find(phone_book, &entry_id);
72 if (phone)
73 {
74 printf("Printing entry.\n");
75 printf("Id: %d\n", entry_id);
76 printf("Number: %s\n\n", phone);
77 }
78
79 // Delete this entry
80 r = eina_hash_del(phone_book, &entry_id, NULL);
81 printf("Hash entry successfully deleted? %d\n\n", r);
82
83 // Modify the pointer data of an entry and free the old one
84 int32_t id3 = 3;
85 phone = eina_hash_modify(phone_book, &id3,
86 strdup("+23 45 111-11111"));
87 free(phone);
88
89 // Modify or add an entry to the hash with eina_hash_set
90 // Let's first add a new entry
91 int32_t id5 = 5;
92 eina_error_set(0);
93 phone = eina_hash_set(phone_book, &id5,
94 strdup("+55 01 234-56789"));
95 if (!phone)
96 {
97 Eina_Error err = eina_error_get();
98 if (!err)
99 {
100 printf("No previous phone found for id5. ");
101 printf("Creating new entry.\n");
102 }
103 else
104 printf("Error when setting phone for Raul Seixas\n");
105 }
106 else
107 {
108 printf("Old phone for id5 was %s\n", phone);
109 free(phone);
110 }
111
112 printf("\n");
113
114 // Now change the phone number
115 eina_error_set(0);
116 phone = eina_hash_set(phone_book, &id5,
117 strdup("+55 02 222-22222"));
118 if (phone)
119 {
120 printf("Changing phone for id5 to +55 02 222-22222. ");
121 printf("Old phone was %s\n", phone);
122 free(phone);
123 }
124 else
125 {
126 Eina_Error err = eina_error_get();
127 if (err)
128 printf("Error when changing phone for id5\n");
129 else
130 {
131 printf("No previous phone found for id5. ");
132 printf("Creating new entry.\n");
133 }
134 }
135
136 // There are many ways to iterate over our Phone book.
137 // First, iterate showing the names and associated numbers.
138 printf("List of phones:\n");
139 eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL);
140 printf("\n");
141
142 // Now iterate using an iterator
143 printf("List of phones:\n");
144 it = eina_hash_iterator_tuple_new(phone_book);
145 while (eina_iterator_next(it, &data))
146 {
147 Eina_Hash_Tuple *t = data;
148 const int32_t *id = t->key;
149 const char *number = t->data;
150 printf("%d: %s\n", *id, number);
151 }
152 eina_iterator_free(it); // Always free the iterator after its use
153 printf("\n");
154
155 // Just iterate over the keys (names)
156 printf("List of ids in the phone book:\n");
157 it = eina_hash_iterator_key_new(phone_book);
158 while (eina_iterator_next(it, &data))
159 {
160 const int32_t *id = data;
161 printf("%d\n", *id);
162 }
163 eina_iterator_free(it);
164 printf("\n");
165
166 // Just iterate over the data (numbers)
167 printf("List of numbers in the phone book:\n");
168 it = eina_hash_iterator_data_new(phone_book);
169 while (eina_iterator_next(it, &data))
170 {
171 const char *number = data;
172 printf("%s\n", number);
173 }
174 eina_iterator_free(it);
175 printf("\n");
176
177 // Check how many items are in the phone book
178 printf("There are %d items in the hash.\n\n",
179 eina_hash_population(phone_book));
180
181 // Change the name (key) on an entry
182 int32_t id6 = 6;
183 eina_hash_move(phone_book, &id5, &id6);
184 printf("List of phones after change:\n");
185 eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL);
186 printf("\n");
187
188 // Empty the phone book, but don't destroy it
189 eina_hash_free_buckets(phone_book);
190 printf("There are %d items in the hash.\n\n",
191 eina_hash_population(phone_book));
192
193 // Phone book could still be used, but we are freeing it since we are
194 // done for now
195 eina_hash_free(phone_book);
196
197 eina_shutdown();
198}
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 @@
1#include <stdio.h>
2#include <string.h>
3#include <Eina.h>
4
5/*
6 * Eina Hash - phonebook
7 *
8 * This example demonstrate the use of Eina Hash by implementing a phonebook
9 * that stores its contact data into the hash.
10 *
11 * It indexes the phone numbers by Contact Full Name, so it's a hash with
12 * string keys.
13 */
14
15struct _Phone_Entry {
16 int64_t id; // Full name.
17 const char *number; // Phone number.
18};
19
20typedef struct _Phone_Entry Phone_Entry;
21
22static Phone_Entry _start_entries[] = {
23 { 1, "+01 23 456-78910" },
24 { 2, "+12 34 567-89101" },
25 { 3, "+23 45 678-91012" },
26 { 4, "+34 56 789-10123" },
27 { -1, NULL }
28}; // _start_entries
29
30static void
31_phone_entry_free_cb(void *data)
32{
33 free(data);
34}
35
36static Eina_Bool
37_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
38 void *data, void *fdata)
39{
40 const int64_t *id = key;
41 const char *number = data;
42 printf("%ld: %s\n", *id, number);
43
44 // Return EINA_FALSE to stop this callback from being called
45 return EINA_TRUE;
46}
47
48int
49main(int argc, const char *argv[])
50{
51 Eina_Hash *phone_book = NULL;
52 int i;
53 int64_t entry_id = 4;
54 char *phone = NULL;
55 Eina_Bool r;
56 Eina_Iterator *it;
57 void *data;
58
59 eina_init();
60
61 phone_book = eina_hash_int64_new(_phone_entry_free_cb);
62
63 // Add initial entries to our hash
64 for (i = 0; _start_entries[i].id != -1; i++)
65 {
66 eina_hash_add(phone_book, &_start_entries[i].id,
67 strdup(_start_entries[i].number));
68 }
69
70 // Look for a specific entry and get its phone number
71 phone = eina_hash_find(phone_book, &entry_id);
72 if (phone)
73 {
74 printf("Printing entry.\n");
75 printf("Id: %ld\n", entry_id);
76 printf("Number: %s\n\n", phone);
77 }
78
79 // Delete this entry
80 r = eina_hash_del(phone_book, &entry_id, NULL);
81 printf("Hash entry successfully deleted? %d\n\n", r);
82
83 // Modify the pointer data of an entry and free the old one
84 int64_t id3 = 3;
85 phone = eina_hash_modify(phone_book, &id3,
86 strdup("+23 45 111-11111"));
87 free(phone);
88
89 // Modify or add an entry to the hash with eina_hash_set
90 // Let's first add a new entry
91 int64_t id5 = 5;
92 eina_error_set(0);
93 phone = eina_hash_set(phone_book, &id5,
94 strdup("+55 01 234-56789"));
95 if (!phone)
96 {
97 Eina_Error err = eina_error_get();
98 if (!err)
99 {
100 printf("No previous phone found for id5. ");
101 printf("Creating new entry.\n");
102 }
103 else
104 printf("Error when setting phone for Raul Seixas\n");
105 }
106 else
107 {
108 printf("Old phone for id5 was %s\n", phone);
109 free(phone);
110 }
111
112 printf("\n");
113
114 // Now change the phone number
115 eina_error_set(0);
116 phone = eina_hash_set(phone_book, &id5,
117 strdup("+55 02 222-22222"));
118 if (phone)
119 {
120 printf("Changing phone for id5 to +55 02 222-22222. ");
121 printf("Old phone was %s\n", phone);
122 free(phone);
123 }
124 else
125 {
126 Eina_Error err = eina_error_get();
127 if (err)
128 printf("Error when changing phone for id5\n");
129 else
130 {
131 printf("No previous phone found for id5. ");
132 printf("Creating new entry.\n");
133 }
134 }
135
136 // There are many ways to iterate over our Phone book.
137 // First, iterate showing the names and associated numbers.
138 printf("List of phones:\n");
139 eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL);
140 printf("\n");
141
142 // Now iterate using an iterator
143 printf("List of phones:\n");
144 it = eina_hash_iterator_tuple_new(phone_book);
145 while (eina_iterator_next(it, &data))
146 {
147 Eina_Hash_Tuple *t = data;
148 const int64_t *id = t->key;
149 const char *number = t->data;
150 printf("%ld: %s\n", *id, number);
151 }
152 eina_iterator_free(it); // Always free the iterator after its use
153 printf("\n");
154
155 // Just iterate over the keys (names)
156 printf("List of ids in the phone book:\n");
157 it = eina_hash_iterator_key_new(phone_book);
158 while (eina_iterator_next(it, &data))
159 {
160 const int64_t *id = data;
161 printf("%ld\n", *id);
162 }
163 eina_iterator_free(it);
164 printf("\n");
165
166 // Just iterate over the data (numbers)
167 printf("List of numbers in the phone book:\n");
168 it = eina_hash_iterator_data_new(phone_book);
169 while (eina_iterator_next(it, &data))
170 {
171 const char *number = data;
172 printf("%s\n", number);
173 }
174 eina_iterator_free(it);
175 printf("\n");
176
177 // Check how many items are in the phone book
178 printf("There are %d items in the hash.\n\n",
179 eina_hash_population(phone_book));
180
181 // Change the name (key) on an entry
182 int64_t id6 = 6;
183 eina_hash_move(phone_book, &id5, &id6);
184 printf("List of phones after change:\n");
185 eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL);
186 printf("\n");
187
188 // Empty the phone book, but don't destroy it
189 eina_hash_free_buckets(phone_book);
190 printf("There are %d items in the hash.\n\n",
191 eina_hash_population(phone_book));
192
193 // Phone book could still be used, but we are freeing it since we are
194 // done for now
195 eina_hash_free(phone_book);
196
197 eina_shutdown();
198}
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 @@
1#include <stdio.h>
2#include <string.h>
3#include <Eina.h>
4
5/*
6 * Eina Hash - phonebook
7 *
8 * This example demonstrate the use of Eina Hash by implementing a phonebook
9 * that stores its contact data into the hash.
10 *
11 * It indexes the phone numbers by Contact Full Name, so it's a hash with
12 * string keys.
13 */
14
15struct _Phone_Entry {
16 const char *name; // Full name.
17 const char *number; // Phone number.
18};
19
20typedef struct _Phone_Entry Phone_Entry;
21
22static Phone_Entry _start_entries[] = {
23 { "Wolfgang Amadeus Mozart", "+01 23 456-78910" },
24 { "Ludwig van Beethoven", "+12 34 567-89101" },
25 { "Richard Georg Strauss", "+23 45 678-91012" },
26 { "Heitor Villa-Lobos", "+34 56 789-10123" },
27 { NULL, NULL }
28}; // _start_entries
29
30static const char *_nicknames[] = {
31 "mozzart",
32 "betho",
33 "george",
34 "hector",
35 NULL
36};
37
38static void
39_phone_entry_free_cb(void *data)
40{
41 free(data);
42}
43
44static Eina_Bool
45_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
46 void *data, void *fdata)
47{
48 Phone_Entry **pe = (Phone_Entry **)key;
49 const char *nick = data;
50 printf("%s: %s, nick=%s\n", (*pe)->name, (*pe)->number, nick);
51
52 // Return EINA_FALSE to stop this callback from being called
53 return EINA_TRUE;
54}
55
56int
57main(int argc, const char *argv[])
58{
59 Eina_Hash *phone_book = NULL;
60 int i;
61 Phone_Entry *entry_vl = &_start_entries[3];
62 Phone_Entry *p = NULL;
63 char *nick = NULL;
64 Eina_Bool r;
65 Eina_Iterator *it;
66 void *data;
67
68 eina_init();
69
70 phone_book = eina_hash_pointer_new(_phone_entry_free_cb);
71
72 // Add initial entries to our hash
73 for (i = 0; _start_entries[i].name != NULL; i++)
74 {
75 p = &_start_entries[i];
76 eina_hash_add(phone_book, &p,
77 strdup(_nicknames[i]));
78 }
79 printf("Phonebook:\n");
80 eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL);
81 printf("\n");
82
83 // Look for a specific entry and get its nickname
84 nick = eina_hash_find(phone_book, &entry_vl);
85 if (nick)
86 {
87 printf("Printing entry.\n");
88 printf("Name: %s\n", entry_vl->name);
89 printf("Number: %s\n", entry_vl->number);
90 printf("Nick: %s\n\n", nick);
91 }
92
93 // Delete this entry
94 r = eina_hash_del(phone_book, &entry_vl, NULL);
95 printf("Hash entry successfully deleted? %d\n\n", r);
96
97 // Modify the pointer data of an entry and free the old one
98 p = &_start_entries[2];
99 nick = eina_hash_modify(phone_book, &p,
100 strdup("el jorge"));
101 free(nick);
102
103 // Modify or add an entry to the hash with eina_hash_set
104 // Let's first add a new entry
105 eina_error_set(0);
106 Phone_Entry *p1 = malloc(sizeof(*p1));
107 p1->name = "Raul Seixas";
108 p1->number = "+55 01 234-56789";
109 nick = eina_hash_set(phone_book, &p1,
110 strdup("raulzito"));
111 if (!nick)
112 {
113 Eina_Error err = eina_error_get();
114 if (!err)
115 {
116 printf("No previous nick found for Raul Seixas. ");
117 printf("Creating new entry.\n");
118 }
119 else
120 printf("Error when setting nick for Raul Seixas\n");
121 }
122 else
123 {
124 printf("Old nick for Raul Seixas was %s\n", nick);
125 free(nick);
126 }
127
128 printf("\n");
129
130 // Now change the nick
131 eina_error_set(0);
132 nick = eina_hash_set(phone_book, &p1,
133 strdup("raulzao"));
134 if (nick)
135 {
136 printf("Changing nick for Raul Seixas to raulzao. ");
137 printf("Old nick was %s\n", nick);
138 free(nick);
139 }
140 else
141 {
142 Eina_Error err = eina_error_get();
143 if (err)
144 printf("Error when changing nick for Raul Seixas\n");
145 else
146 {
147 printf("No previous nick found for Raul Seixas. ");
148 printf("Creating new entry.\n");
149 }
150 }
151
152 // There are many ways to iterate over our Phone book.
153 // First, iterate showing the names, phones and associated nicks.
154 printf("Phonebook:\n");
155 eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL);
156 printf("\n");
157
158 // Now iterate using an iterator
159 printf("Phonebook:\n");
160 it = eina_hash_iterator_tuple_new(phone_book);
161 while (eina_iterator_next(it, &data))
162 {
163 Eina_Hash_Tuple *t = data;
164 Phone_Entry **pe = (Phone_Entry **)t->key;
165 nick = t->data;
166 printf("%s: %s, nick=%s\n", (*pe)->name, (*pe)->number, nick);
167 }
168 eina_iterator_free(it); // Always free the iterator after its use
169 printf("\n");
170
171 // Just iterate over the keys (names)
172 printf("List of names/numbers in the phone book:\n");
173 it = eina_hash_iterator_key_new(phone_book);
174 while (eina_iterator_next(it, &data))
175 {
176 Phone_Entry **pe = (Phone_Entry **)data;
177 printf("%s: %s\n", (*pe)->name, (*pe)->number);
178 }
179 eina_iterator_free(it);
180 printf("\n");
181
182 // Just iterate over the data (nicks)
183 printf("List of nicks in the phone book:\n");
184 it = eina_hash_iterator_data_new(phone_book);
185 while (eina_iterator_next(it, &data))
186 {
187 nick = data;
188 printf("%s\n", nick);
189 }
190 eina_iterator_free(it);
191 printf("\n");
192
193 // Check how many items are in the phone book
194 printf("There are %d items in the hash.\n\n",
195 eina_hash_population(phone_book));
196
197 // Change the name (key) on an entry
198 Phone_Entry *p2 = malloc(sizeof(*p2));
199 p2->name = "Alceu Valenca";
200 p2->number = "000000000000";
201 eina_hash_move(phone_book, p1, p2);
202 printf("List of phones after change:\n");
203 eina_hash_foreach(phone_book, _phone_book_foreach_cb, NULL);
204 printf("\n");
205
206 // Empty the phone book, but don't destroy it
207 eina_hash_free_buckets(phone_book);
208 printf("There are %d items in the hash.\n\n",
209 eina_hash_population(phone_book));
210
211 // Phone book could still be used, but we are freeing it since we are
212 // done for now
213 eina_hash_free(phone_book);
214
215 free(p1);
216 free(p2);
217
218 eina_shutdown();
219}
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 @@
1#include <stdio.h>
2#include <string.h>
3#include <Eina.h>
4
5/*
6 * Eina Hash - phonebook
7 *
8 * This example demonstrate the use of Eina Hash by implementing a phonebook
9 * that stores its contact data into the hash.
10 *
11 * It indexes the phone numbers by Contact Full Name, so it's a hash with
12 * string keys.
13 */
14
15struct _Phone_Entry {
16 const char *name; // Full name.
17 const char *number; // Phone number.
18};
19
20typedef struct _Phone_Entry Phone_Entry;
21
22static Phone_Entry _start_entries[] = {
23 { "Wolfgang Amadeus Mozart", "+01 23 456-78910" },
24 { "Ludwig van Beethoven", "+12 34 567-89101" },
25 { "Richard Georg Strauss", "+23 45 678-91012" },
26 { "Heitor Villa-Lobos", "+34 56 789-10123" },
27 { NULL, NULL }
28}; // _start_entries
29
30static void
31_phone_entry_free_cb(void *data)
32{
33 free(data);
34}
35
36static Eina_Bool
37_phone_book_foreach_cb(const Eina_Hash *phone_book, const void *key,
38 void *data, void *fdata)
39{
40 const char *name = key;
41 const char *number = data;
42 printf("%s: %s\n", name, number);
43
44 // Return EINA_FALSE to stop this callback from being called
45 return EINA_TRUE;
46}
47
48int
49main(int argc, const char *argv[])
50{
51 Eina_Hash *phone_book = NULL;
52 int i;
53 const char *entry_name = "Heitor Villa-Lobos";
54 int entry_size;
55 const char *saved_entry_name = "Alceu Valenca";
56 int saved_entry_size = sizeof("Alceu Valenca");
57 const char *phone = NULL;
58 Eina_Bool r;
59 Eina_Iterator *it;
60 void *data;
61
62 eina_init();
63
64 phone_book = eina_hash_string_superfast_new(_phone_entry_free_cb);
65
66 // Add initial entries to our hash
67 for (i = 0; _start_entries[i].name != NULL; i++)
68 {
69 eina_hash_add(phone_book, _start_entries[i].name,
70 strdup(_start_entries[i].number));
71 }
72
73 // Delete entries
74 r = eina_hash_del(phone_book, entry_name, NULL);
75 printf("Hash entry successfully deleted? %d\n\n", r);
76
77 int hash = eina_hash_superfast("Ludwig van Beethoven",
78 sizeof("Ludwig van Beethoven"));
79
80 r = eina_hash_del_by_key_hash(phone_book, "Ludwig van Beethoven",
81 sizeof("Ludwig van Beethoven"), hash);
82 printf("Hash entry successfully deleted? %d\n\n", r);
83
84 r = eina_hash_del_by_key(phone_book, "Richard Georg Strauss");
85 printf("Hash entry successfully deleted? %d\n\n", r);
86
87 // add entry by hash
88 entry_name = "Raul_Seixas";
89 entry_size = sizeof("Raul Seixas");
90 phone = strdup("+33 33 333-33333");
91 hash = eina_hash_superfast(entry_name, entry_size);
92 eina_hash_add_by_hash(phone_book, entry_name, entry_size, hash, phone);
93
94 // don't need to free 'phone' after the next del:
95 r = eina_hash_del_by_data(phone_book, phone);
96 printf("Hash entry successfully deleted? %d\n\n", r);
97
98 // add entry by hash directly - no copy of the key will be done
99 hash = eina_hash_superfast(saved_entry_name, saved_entry_size);
100 phone = strdup("+44 44 444-44444");
101 eina_hash_direct_add_by_hash(phone_book, saved_entry_name,
102 saved_entry_size, hash, phone);
103
104 // find the added entry by its hash:
105 phone = eina_hash_find_by_hash(phone_book, saved_entry_name,
106 saved_entry_size, hash);
107 if (phone)
108 {
109 char *newphone = strdup("+55 55 555-55555");
110 phone = eina_hash_modify_by_hash(phone_book, saved_entry_name,
111 saved_entry_size, hash, newphone);
112 if (phone)
113 printf("changing phone to %s, old one was %s\n", newphone, phone);
114 else
115 printf("couldn't modify entry identified by %d\n", hash);
116 }
117 else
118 {
119 printf("couldn't find entry identified by %d\n", hash);
120 }
121
122 eina_hash_free(phone_book);
123
124 eina_shutdown();
125}
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 @@
1// Compile with:
2// gcc -g `pkg-config --cflags --libs eina` eina_inlist_01.c -o eina_inlist_01
3#include <Eina.h>
4#include <stdio.h>
5
6struct my_struct {
7 EINA_INLIST;
8 int a, b;
9};
10
11int
12sort_cb(const void *d1, const void *d2)
13{
14 const Eina_Inlist *l1, *l2;
15 const struct my_struct *x1, *x2;
16
17 l1 = d1;
18 l2 = d2;
19
20 x1 = EINA_INLIST_CONTAINER_GET(l1, struct my_struct);
21 x2 = EINA_INLIST_CONTAINER_GET(l2, struct my_struct);
22
23 return x1->a - x2->a;
24}
25
26int
27main(void)
28{
29 struct my_struct *d, *cur;
30 Eina_Inlist *list, *itr, *tmp;
31
32 eina_init();
33
34 d = malloc(sizeof(*d));
35 d->a = 1;
36 d->b = 10;
37 list = eina_inlist_append(NULL, EINA_INLIST_GET(d));
38
39 d = malloc(sizeof(*d));
40 d->a = 2;
41 d->b = 20;
42 list = eina_inlist_append(list, EINA_INLIST_GET(d));
43
44 d = malloc(sizeof(*d));
45 d->a = 3;
46 d->b = 30;
47 list = eina_inlist_prepend(list, EINA_INLIST_GET(d));
48
49 printf("list=%p\n", list);
50 EINA_INLIST_FOREACH(list, cur)
51 printf("\ta=%d, b=%d\n", cur->a, cur->b);
52
53 list = eina_inlist_promote(list, EINA_INLIST_GET(d));
54
55 d = malloc(sizeof(*d));
56 d->a = 4;
57 d->b = 40;
58 list = eina_inlist_append_relative(list, EINA_INLIST_GET(d), list);
59
60 list = eina_inlist_demote(list, EINA_INLIST_GET(d));
61
62 list = eina_inlist_sort(list, sort_cb);
63
64 printf("list after sort=%p\n", list);
65 EINA_INLIST_FOREACH(list, cur)
66 printf("\ta=%d, b=%d\n", cur->a, cur->b);
67
68 tmp = eina_inlist_find(list, EINA_INLIST_GET(d));
69 if (tmp)
70 cur = EINA_INLIST_CONTAINER_GET(tmp, struct my_struct);
71 else
72 cur = NULL;
73
74 if (d != cur)
75 printf("wrong node! cur=%p\n", cur);
76
77 list = eina_inlist_remove(list, EINA_INLIST_GET(d));
78 free(d);
79 printf("list=%p\n", list);
80 for (itr = list; itr != NULL; itr = itr->next)
81 {
82 cur = EINA_INLIST_CONTAINER_GET(itr, struct my_struct);
83 printf("\ta=%d, b=%d\n", cur->a, cur->b);
84 }
85
86 while (list)
87 {
88 Eina_Inlist *aux = list;
89 list = eina_inlist_remove(list, list);
90 free(aux);
91 }
92
93 eina_shutdown();
94
95 return 0;
96}
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 @@
1// Compile with:
2// gcc -g `pkg-config --cflags --libs eina` eina_inlist_01.c -o eina_inlist_01
3#include <Eina.h>
4#include <stdio.h>
5
6struct my_struct {
7 EINA_INLIST;
8 int a, b;
9};
10
11int
12main(void)
13{
14 struct my_struct *d, *cur;
15 int i;
16
17 Eina_Inlist *inlist = NULL;
18 Eina_List *list = NULL, *l_itr, *l_next;
19
20 eina_init();
21
22 for (i = 0; i < 100; i++)
23 {
24 d = malloc(sizeof(*d));
25 d->a = i;
26 d->b = i * 10;
27 inlist = eina_inlist_append(inlist, EINA_INLIST_GET(d));
28 if ((i % 2) == 0)
29 list = eina_list_prepend(list, d);
30 }
31
32 printf("inlist=%p\n", inlist);
33 EINA_INLIST_FOREACH(inlist, cur)
34 printf("\ta=%d, b=%d\n", cur->a, cur->b);
35
36 printf("list=%p\n", list);
37 EINA_LIST_FOREACH(list, l_itr, cur)
38 printf("\ta=%d, b=%d\n", cur->a, cur->b);
39
40 printf("inlist count=%d\n", eina_inlist_count(inlist));
41 printf("list count=%d\n\n", eina_list_count(list));
42
43 EINA_LIST_FOREACH_SAFE(list, l_itr, l_next, cur)
44 {
45 if ((cur->a % 3) == 0)
46 list = eina_list_remove_list(list, l_itr);
47 }
48
49 printf("inlist count=%d\n", eina_inlist_count(inlist));
50 printf("list count=%d\n\n", eina_list_count(list));
51
52 eina_list_free(list);
53
54 while (inlist)
55 {
56 Eina_Inlist *aux = inlist;
57 inlist = eina_inlist_remove(inlist, inlist);
58 free(aux);
59 }
60
61 eina_shutdown();
62
63 return 0;
64}
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 @@
1// Compile with:
2// gcc -g `pkg-config --cflags --libs eina` eina_inlist_01.c -o eina_inlist_01
3#include <Eina.h>
4#include <stdio.h>
5
6struct my_struct {
7 EINA_INLIST;
8 Eina_Inlist even;
9 int a, b;
10};
11
12#define EVEN_INLIST_GET(Inlist) (& ((Inlist)->even))
13
14#define EVEN_INLIST_CONTAINER_GET(ptr, type) \
15 ((type *)((char *)ptr - offsetof(type, even)))
16
17int
18main(void)
19{
20 struct my_struct *d, *cur;
21 int i;
22
23 Eina_Inlist *list = NULL, *list_even = NULL, *itr;
24
25 eina_init();
26
27 for (i = 0; i < 100; i++)
28 {
29 d = malloc(sizeof(*d));
30 d->a = i;
31 d->b = i * 10;
32 list = eina_inlist_append(list, EINA_INLIST_GET(d));
33 if ((i % 2) == 0)
34 list_even = eina_inlist_prepend(list_even, EVEN_INLIST_GET(d));
35 }
36
37 printf("list=%p\n", list);
38 EINA_INLIST_FOREACH(list, cur)
39 printf("\ta=%d, b=%d\n", cur->a, cur->b);
40
41 printf("list_even=%p\n", list_even);
42 for (itr = list_even; itr != NULL; itr = itr->next)
43 {
44 cur = EVEN_INLIST_CONTAINER_GET(itr, struct my_struct);
45 printf("\ta=%d, b=%d\n", cur->a, cur->b);
46 }
47
48 printf("list count=%d\n", eina_inlist_count(list));
49 printf("list_even count=%d\n\n", eina_inlist_count(list_even));
50
51 itr = list_even;
52 while (itr)
53 {
54 Eina_Inlist *next = itr->next;
55 cur = EVEN_INLIST_CONTAINER_GET(itr, struct my_struct);
56 if ((cur->a % 3) == 0)
57 list_even = eina_inlist_remove(list_even, itr);
58 itr = next;
59 }
60 printf("list count=%d\n", eina_inlist_count(list));
61 printf("list_even count=%d\n\n", eina_inlist_count(list_even));
62
63 while (list)
64 {
65 Eina_Inlist *aux = list;
66 list = eina_inlist_remove(list, list);
67 free(aux);
68 }
69
70 eina_shutdown();
71
72 return 0;
73}
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 @@
1//Compile with:
2//gcc -g `pkg-config --cflags --libs eina` eina_iterator_01.c -o eina_iterator_01
3
4#include <stdio.h>
5
6#include <Eina.h>
7
8static Eina_Bool
9print_one(const void *container, void *data, void *fdata)
10{
11 printf("%s\n", (char*)data);
12 return EINA_TRUE;
13}
14
15static void
16print_eina_container(Eina_Iterator *it)
17{
18 eina_iterator_foreach(it, print_one, NULL);
19 printf("\n");
20}
21
22int
23main(int argc, char **argv)
24{
25 const char *strings[] = {
26 "unintersting string", "husker", "starbuck", "husker"
27 };
28 const char *more_strings[] = {
29 "very unintersting string",
30 "what do your hear?",
31 "nothing but the rain",
32 "then grab your gun and bring the cat in"
33 };
34 Eina_Array *array;
35 Eina_List *list = NULL;
36 Eina_Iterator *it;
37 unsigned short int i;
38 char *uninteresting;
39
40 eina_init();
41
42 array = eina_array_new(4);
43
44 for (i = 0; i < 4; i++)
45 {
46 eina_array_push(array, strings[i]);
47 list = eina_list_append(list, more_strings[i]);
48 }
49
50 it = eina_array_iterator_new(array);
51 eina_iterator_next(it, &uninteresting);
52 print_eina_container(it);
53 eina_array_free(eina_iterator_container_get(it));
54 eina_iterator_free(it);
55
56 it = eina_list_iterator_new(list);
57 eina_iterator_next(it, &uninteresting);
58 print_eina_container(it);
59 eina_iterator_free(it);
60
61 eina_list_free(list);
62
63 eina_shutdown();
64
65 return 0;
66}
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 @@
1//Compile with:
2//gcc -g `pkg-config --cflags --libs eina` eina_list_01.c -o eina_list_01
3
4#include <stdio.h>
5#include <Eina.h>
6
7int
8main(int argc, char **argv)
9{
10 Eina_List *list = NULL;
11 Eina_List *l;
12 void *list_data;
13
14 eina_init();
15
16 list = eina_list_append(list, "tigh");
17 list = eina_list_append(list, "adar");
18 list = eina_list_append(list, "baltar");
19 list = eina_list_append(list, "roslin");
20
21 EINA_LIST_FOREACH(list, l, list_data)
22 printf("%s\n", (char*)list_data);
23 printf("\n");
24
25 l = eina_list_nth_list(list, 1);
26 list = eina_list_append_relative_list(list, "cain", l);
27
28 list = eina_list_append_relative(list, "zarek", "cain");
29
30 list = eina_list_prepend(list, "adama");
31
32 list = eina_list_prepend_relative(list, "gaeta", "cain");
33
34 list = eina_list_prepend_relative_list(list, "lampkin", l);
35
36 EINA_LIST_FOREACH(list, l, list_data)
37 printf("%s\n", (char*)list_data);
38
39 eina_list_free(list);
40
41 eina_shutdown();
42
43 return 0;
44}
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 @@
1//Compile with:
2//gcc -g `pkg-config --cflags --libs eina` eina_list_02.c -o eina_list_02
3
4#include <stdio.h>
5#include <string.h>
6#include <Eina.h>
7
8int
9main(int argc, char **argv)
10{
11 Eina_List *list = NULL, *other_list = NULL;
12 Eina_List *l;
13 void *data;
14 int cmp_result;
15 Eina_Compare_Cb cmp_func = (Eina_Compare_Cb)strcmp;
16
17 eina_init();
18
19 list = eina_list_append(list, "starbuck");
20 list = eina_list_append(list, "appolo");
21 list = eina_list_append(list, "boomer");
22
23 data = eina_list_search_unsorted(list, cmp_func, "boomer");
24 l = eina_list_search_unsorted_list(list, cmp_func, "boomer");
25 if (l->data != data)
26 return 1;
27
28 list = eina_list_sort(list, 0, cmp_func);
29
30 data = eina_list_search_sorted(list, cmp_func, "starbuck");
31 l = eina_list_search_sorted_list(list, cmp_func, "starbuck");
32 if (l->data != data)
33 return 1;
34
35 list = eina_list_sorted_insert(list, cmp_func, "helo");
36
37 l = eina_list_search_sorted_near_list(list, cmp_func, "hera", &cmp_result);
38 if (cmp_result > 0)
39 list = eina_list_prepend_relative_list(list, "hera", l);
40 else if (cmp_result < 0)
41 list = eina_list_append_relative_list(list, "hera", l);
42
43 l = eina_list_search_sorted_list(list, cmp_func, "boomer");
44 list = eina_list_split_list(list, l, &other_list);
45
46 other_list = eina_list_sort(other_list, 0, cmp_func);
47
48 list = eina_list_sorted_merge(list, other_list, cmp_func);
49
50 eina_list_free(list);
51
52 eina_shutdown();
53
54 return 0;
55}
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 @@
1//Compile with:
2//gcc -g `pkg-config --cflags --libs eina` eina_list_03.c -o eina_list_03
3
4#include <stdio.h>
5#include <Eina.h>
6
7int
8main(int argc, char **argv)
9{
10 Eina_List *list = NULL, *r_list;
11 Eina_List *l;
12 Eina_Iterator *itr;
13 void *list_data;
14
15 eina_init();
16
17 list = eina_list_append(list, "caprica");
18 list = eina_list_append(list, "sagitarius");
19 list = eina_list_append(list, "aerilon");
20 list = eina_list_append(list, "gemenon");
21
22 list = eina_list_promote_list(list, eina_list_nth_list(list, 2));
23 list = eina_list_demote_list(list, eina_list_nth_list(list, 2));
24
25 list = eina_list_remove(list, "sagitarius");
26
27 l = eina_list_data_find_list(list, "aerilon");
28 eina_list_data_set(l, "aquarius");
29
30 printf("size: %d\n", eina_list_count(list));
31
32 r_list = eina_list_reverse_clone(list);
33
34 itr = eina_list_iterator_new(r_list);
35 EINA_ITERATOR_FOREACH(itr, list_data)
36 printf("%s\n", (char*)list_data);
37 eina_iterator_free(itr);
38
39 eina_list_free(list);
40 eina_list_free(r_list);
41
42 eina_shutdown();
43
44 return 0;
45}
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 @@
1//Compile with:
2//gcc -g `pkg-config --cflags --libs eina` eina_list_04.c -o eina_list_04
3
4#include <stdio.h>
5#include <Eina.h>
6
7int
8main(int argc, char **argv)
9{
10 Eina_List *list = NULL;
11 Eina_List *l;
12 void *list_data;
13
14 eina_init();
15
16 list = eina_list_append(list, eina_stringshare_add("calvin"));
17 list = eina_list_append(list, eina_stringshare_add("Leoben"));
18 list = eina_list_append(list, eina_stringshare_add("D'Anna"));
19 list = eina_list_append(list, eina_stringshare_add("Simon"));
20 list = eina_list_append(list, eina_stringshare_add("Doral"));
21 list = eina_list_append(list, eina_stringshare_add("Six"));
22 list = eina_list_append(list, eina_stringshare_add("Sharon"));
23
24 for(l = list; l; l = eina_list_next(l))
25 printf("%s\n", (char*)l->data);
26
27 for(l = eina_list_last(list); l; l = eina_list_prev(l))
28 printf("%s\n", (char*)eina_list_data_get(l));
29
30 EINA_LIST_FREE(list, list_data)
31 eina_stringshare_del(list_data);
32
33 eina_shutdown();
34
35 return 0;
36}
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 @@
1//Compile with:
2//gcc -Wall -o eina_log_01 eina_log_01.c `pkg-config --cflags --libs eina`
3
4#include <stdlib.h>
5#include <stdio.h>
6
7#include <Eina.h>
8
9void test_warn(void)
10{
11 EINA_LOG_WARN("Here is a warning message");
12}
13
14int main(void)
15{
16 if (!eina_init())
17 {
18 printf("log during the initialization of Eina_Log module\n");
19 return EXIT_FAILURE;
20 }
21
22 test_warn();
23
24 eina_shutdown();
25
26 return EXIT_SUCCESS;
27}
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 @@
1//Compile with:
2//gcc -Wall -o eina_log_02 eina_log_02.c `pkg-config --cflags --libs eina`
3
4#include <stdlib.h>
5#include <stdio.h>
6
7#include <Eina.h>
8
9void test(int i)
10{
11 EINA_LOG_DBG("Entering test");
12
13 if (i < 0)
14 {
15 EINA_LOG_ERR("Argument is negative");
16 return;
17 }
18
19 EINA_LOG_INFO("argument non negative");
20
21 EINA_LOG_DBG("Exiting test");
22}
23
24int main(void)
25{
26 if (!eina_init())
27 {
28 printf("log during the initialization of Eina_Log module\n");
29 return EXIT_FAILURE;
30 }
31
32 test(-1);
33 test(0);
34
35 eina_shutdown();
36
37 return EXIT_SUCCESS;
38}
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 @@
1//Compile with:
2//gcc -Wall -o eina_log_03 eina_log_03.c `pkg-config --cflags --libs eina`
3
4#include <stdlib.h>
5#include <stdio.h>
6
7#include <Eina.h>
8
9#define log(fmt, ...) \
10 eina_log_print(EINA_LOG_LEVEL_ERR, __FILE__, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
11
12typedef struct _Data Data;
13
14struct _Data
15{
16 int to_stderr;
17};
18
19void print_cb(const Eina_Log_Domain *domain,
20 Eina_Log_Level level,
21 const char *file,
22 const char *fnc,
23 int line,
24 const char *fmt,
25 void *data,
26 va_list args)
27{
28 Data *d;
29 FILE *output;
30 char *str;
31
32 d = (Data*)data;
33 if (d->to_stderr)
34 {
35 output = stderr;
36 str = "stderr";
37 }
38 else
39 {
40 output = stdout;
41 str = "stdout";
42 }
43
44 fprintf(output, "%s:%s:%s (%d) %s: ",
45 domain->domain_str, file, fnc, line, str);
46 vfprintf(output, fmt, args);
47 putc('\n', output);
48}
49
50void test(Data *data, int i)
51{
52 if (i < 0)
53 data->to_stderr = 0;
54 else
55 data->to_stderr = 1;
56
57 EINA_LOG_INFO("Log message...");
58}
59
60int main(void)
61{
62 Data data;
63
64 if (!eina_init())
65 {
66 printf("log during the initialization of Eina_Log module\n");
67 return EXIT_FAILURE;
68 }
69
70 eina_log_print_cb_set(print_cb, &data);
71
72 test(&data, -1);
73 test(&data, 0);
74
75 eina_shutdown();
76
77 return EXIT_SUCCESS;
78}
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 @@
1//Compile with:
2//gcc -Wall -o eina_str_01 eina_str_01.c `pkg-config --cflags --libs eina`
3
4#include <stdio.h>
5#include <Eina.h>
6
7int main(int argc, char **argv)
8{
9 char *names = "Calvin;Leoben;D'anna;Simon;Doral;Six;Daniel;Sharon";
10 char *str;
11 char *tmp;
12 char *prologue;
13 char *part1 = "The Cylons were created by man. They evolved. They rebelled.";
14 char *part2 = "There are many copies. And they have a plan.";
15 char **arr;
16 int i;
17
18 eina_init();
19
20 arr = eina_str_split(names, ";", 0);
21 for (i = 0; arr[i]; i++)
22 printf("%s\n", arr[i]);
23
24 free(arr[0]);
25 free(arr);
26
27 str = malloc(sizeof(char) * 4);
28 strcpy(str, "bsd");
29
30 eina_str_toupper((char **)&str);
31 printf("%s\n", str);
32 eina_str_tolower(&str);
33 printf("%s\n", str);
34
35 if (eina_str_has_prefix(names, "Calvin"))
36 printf("Starts with 'Calvin'\n");
37 if (eina_str_has_suffix(names, "sharon"))
38 printf("Ends with 'sharon'\n");
39 if (eina_str_has_extension(names, "sharon"))
40 printf("Has extension 'sharon'\n");
41
42 tmp = eina_str_escape("They'll start going ripe on us pretty soon.");
43 printf("%s\n", tmp);
44 free(tmp);
45
46 prologue = malloc(sizeof(char) * 106);
47 eina_str_join_len(prologue, 106, ' ', part1, strlen(part1), part2, strlen(part2));
48 printf("%s\n", prologue);
49
50 eina_strlcpy(str, prologue, 4);
51 printf("%s\n", str);
52
53 free(prologue);
54 free(str);
55
56 str = malloc(sizeof(char) * 14);
57 sprintf(str, "%s", "cylons+");
58 eina_strlcat(str, "humans", 14);
59 printf("%s\n", str);
60 free(str);
61
62 eina_shutdown();
63
64 return 0;
65}
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 @@
1//Compile with:
2//gcc -Wall -o eina_strbuf_01 eina_strbuf_01.c `pkg-config --cflags --libs eina`
3
4#include <stdio.h>
5#include <Eina.h>
6
7int main(int argc, char **argv)
8{
9 Eina_Strbuf *buf;
10
11 eina_init();
12
13 buf = eina_strbuf_new();
14
15 eina_strbuf_append_length(buf, "buffe", 5);
16 eina_strbuf_append_char(buf, 'r');
17 printf("%s\n", eina_strbuf_string_get(buf));
18
19 eina_strbuf_insert_escaped(buf, "my ", 0);
20 printf("%s\n", eina_strbuf_string_get(buf));
21 eina_strbuf_reset(buf);
22
23 eina_strbuf_append_escaped(buf, "my buffer");
24 printf("%s\n", eina_strbuf_string_get(buf));
25 eina_strbuf_reset(buf);
26
27 eina_strbuf_append_printf(buf, "%s%c", "buffe", 'r');
28 eina_strbuf_insert_printf(buf, " %s: %d", 6, "length", eina_strbuf_length_get(buf));
29 printf("%s\n", eina_strbuf_string_get(buf));
30
31 eina_strbuf_remove(buf, 0, 7);
32 printf("%s\n", eina_strbuf_string_get(buf));
33
34 eina_strbuf_replace_all(buf, "length", "size");
35 printf("%s\n", eina_strbuf_string_get(buf));
36
37 eina_strbuf_free(buf);
38 eina_shutdown();
39
40 return 0;
41}
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 @@
1//Compile with:
2//gcc `pkg-config --cflags --libs ecore-evas ecore evas` eina_tiler_01.c -o eina_tiler_01
3
4#include <Ecore_Evas.h>
5#include <Ecore.h>
6#include <Evas.h>
7#include <Eina.h>
8
9#define WINDOW_PAD (20)
10
11static Eina_Tiler *tiler;
12static Eina_Rectangle *input_rects;
13static unsigned int input_count;
14static unsigned int input_idx = 0, input_color_idx = 0, output_color_idx = 0;
15static Eina_List *output_objs = NULL;
16static Evas_Coord maxw, maxh, winw, winh;
17static Evas *evas;
18
19static const struct color {
20 unsigned char r, g, b;
21} colors[] = {
22 {255, 0, 0},
23 {0, 255, 0},
24 {0, 0, 255},
25
26 {255, 128, 0},
27 {0, 255, 128},
28 {128, 0, 255},
29
30 {255, 255, 0},
31 {0, 255, 255},
32 {255, 0, 255},
33
34 {255, 0, 128},
35 {128, 255, 0},
36 {0, 128, 255},
37
38 {128, 128, 0},
39 {0, 128, 128},
40 {128, 0, 128},
41
42 {128, 0, 0},
43 {0, 128, 0},
44 {0, 0, 128},
45
46 {255, 128, 0},
47 {0, 255, 128},
48 {128, 0, 255},
49
50 {64, 64, 0},
51 {0, 64, 64},
52 {64, 0, 64},
53
54 {128, 128, 0},
55 {0, 128, 128},
56 {128, 0, 128},
57
58 {255, 0, 128},
59 {128, 255, 0},
60 {0, 128, 255},
61
62 {128, 64, 0},
63 {0, 128, 64},
64 {64, 0, 128},
65
66 {128, 0, 64},
67 {64, 128, 0},
68 {0, 64, 128}
69};
70
71#define MAX_COLORS (sizeof(colors) / sizeof(colors[0]))
72
73static void
74add_text(const char *text, int x, int y, int w)
75{
76 Evas_Object *o = evas_object_text_add(evas);
77 evas_object_color_set(o, 0, 0, 0, 255);
78 evas_object_move(o, x, y);
79 evas_object_resize(o, w, WINDOW_PAD);
80 evas_object_text_font_set(o, "Sans", 10);
81 evas_object_text_text_set(o, text);
82 evas_object_show(o);
83}
84
85static void
86output_rects_reset(void)
87{
88 Evas_Object *o;
89 EINA_LIST_FREE(output_objs, o)
90 evas_object_del(o);
91 output_color_idx = 0;
92}
93
94static void
95add_input_rect(const Eina_Rectangle *r)
96{
97 Evas_Object *o;
98 Evas_Coord bx, by;
99
100 bx = WINDOW_PAD;
101 by = WINDOW_PAD;
102
103 o = evas_object_rectangle_add(evas);
104#define C(comp) (((int)colors[input_color_idx].comp * 128) / 255)
105 evas_object_color_set(o, C(r), C(g), C(b), 128);
106#undef C
107 evas_object_move(o, r->x + bx, r->y + by);
108 evas_object_resize(o, r->w, r->h);
109 evas_object_show(o);
110
111 input_color_idx = (input_color_idx + 1) % MAX_COLORS;
112
113 bx += maxw + WINDOW_PAD;
114
115 o = evas_object_rectangle_add(evas);
116 evas_object_color_set(o, 32, 32, 32, 128);
117 evas_object_move(o, r->x + bx, r->y + by);
118 evas_object_resize(o, r->w, 1);
119 evas_object_layer_set(o, EVAS_LAYER_MAX);
120 evas_object_show(o);
121
122 o = evas_object_rectangle_add(evas);
123 evas_object_color_set(o, 32, 32, 32, 128);
124 evas_object_move(o, r->x + bx, r->y + by);
125 evas_object_resize(o, 1, r->h);
126 evas_object_layer_set(o, EVAS_LAYER_MAX);
127 evas_object_show(o);
128
129 o = evas_object_rectangle_add(evas);
130 evas_object_color_set(o, 32, 32, 32, 128);
131 evas_object_move(o, r->x + bx, r->y + by + r->h);
132 evas_object_resize(o, r->w, 1);
133 evas_object_layer_set(o, EVAS_LAYER_MAX);
134 evas_object_show(o);
135
136 o = evas_object_rectangle_add(evas);
137 evas_object_color_set(o, 32, 32, 32, 128);
138 evas_object_move(o, r->x + bx + r->w, r->y + by);
139 evas_object_resize(o, 1, r->h);
140 evas_object_layer_set(o, EVAS_LAYER_MAX);
141 evas_object_show(o);
142}
143
144static void
145add_output_rect(const Eina_Rectangle *r)
146{
147 Evas_Object *o = evas_object_rectangle_add(evas);
148#define C(comp) (((int)colors[output_color_idx].comp * 128) / 255)
149 evas_object_color_set(o, C(r), C(g), C(b), 128);
150#undef C
151 evas_object_move(o, r->x + maxw + 2 * WINDOW_PAD, r->y + WINDOW_PAD);
152 evas_object_resize(o, r->w, r->h);
153 evas_object_show(o);
154
155 output_color_idx = (output_color_idx + 1) % MAX_COLORS;
156
157 output_objs = eina_list_append(output_objs, o);
158}
159
160static Eina_Bool
161process_input(void *data)
162{
163 Eina_Iterator *itr;
164 Eina_Rectangle r, *r1;
165 unsigned int out = 0;
166
167 if (input_idx == input_count)
168 {
169 add_text("Done. Close the window to exit",
170 WINDOW_PAD, winh - WINDOW_PAD, winw - 2 * WINDOW_PAD);
171 return EINA_FALSE;
172 }
173
174 output_rects_reset();
175
176 r = input_rects[input_idx];
177 printf("Iteration #%u: %dx%d%+d%+d\n", input_idx, r.w, r.h, r.x, r.y);
178 input_idx++;
179 add_input_rect(&r);
180
181 eina_tiler_rect_add(tiler, &r);
182 itr = eina_tiler_iterator_new(tiler);
183 EINA_ITERATOR_FOREACH(itr, r1)
184 {
185 printf("\tOutput #%u: %dx%d%+d%+d\n", out, r1->w, r1->h, r1->x, r1->y);
186 add_output_rect(r1);
187 out++;
188 }
189 eina_iterator_free(itr);
190
191 return EINA_TRUE;
192}
193
194static void
195usage(const char *progname)
196{
197 fprintf(stderr,
198 "Usage:\n\n"
199 "\t%s <rect1> ... <rectN>\n\n"
200 "with rectangles being in the format:\n"
201 "\tWIDTHxHEIGHT<+->X<+->Y\n"
202 "examples:\n"
203 "\t100x100+10+10 - width=100, height=100 at x=10, y=10\n"
204 "\t150x50+5+6 - width=150, height=50 at x=5, y=6\n",
205 progname);
206}
207
208int
209main(int argc, char *argv[])
210{
211 Ecore_Evas *ee;
212 Evas_Object *o;
213 int i;
214
215 if (argc < 2)
216 {
217 usage(argv[0]);
218 return -2;
219 }
220
221 input_rects = calloc(argc - 1, sizeof(Eina_Rectangle));
222 input_count = 0;
223 maxw = 0;
224 maxh = 0;
225 for (i = 1; i < argc; i++)
226 {
227 Eina_Rectangle *r = input_rects + input_count;
228 char sx, sy;
229
230 if (sscanf(argv[i], "%dx%d%c%d%c%d",
231 &(r->w), &(r->h), &sx, &(r->x), &sy, &(r->y)) == 6)
232 {
233 if (sx == '-') r->x *= -1;
234 if (sy == '-') r->y *= -1;
235
236 if (maxw < r->x + r->w) maxw = r->x + r->w;
237 if (maxh < r->y + r->h) maxh = r->y + r->h;
238 input_count++;
239 }
240 else
241 fprintf(stderr, "ERROR: invalid rectangle ignored: %s\n", argv[i]);
242 }
243
244 if (input_count == 0)
245 {
246 fputs("ERROR: Could not find any valid rectangle. Exit!\n", stderr);
247 usage(argv[0]);
248 free(input_rects);
249 return -3;
250 }
251
252 if ((maxw == 0) || (maxh == 0))
253 {
254 fputs("ERROR: All rectangles with size 0x0. Exit!\n", stderr);
255 usage(argv[0]);
256 free(input_rects);
257 return -3;
258 }
259
260 ecore_evas_init();
261 ecore_init();
262 evas_init();
263 eina_init();
264
265 winw = 2 * maxw + 3 * WINDOW_PAD;
266 winh = maxh + 2 * WINDOW_PAD;
267
268 ee = ecore_evas_new(NULL, 0, 0, winw, winh, NULL);
269 if (!ee)
270 {
271 fputs("ERROR: Could not create window. Check ecore-evas install.\n",
272 stderr);
273 goto end;
274 }
275
276 evas = ecore_evas_get(ee);
277
278 o = evas_object_rectangle_add(evas);
279 evas_object_color_set(o, 255, 255, 255, 255);
280 evas_object_resize(o, winw, winh);
281 evas_object_show(o);
282
283 add_text("Input", WINDOW_PAD, 0, maxw);
284 o = evas_object_rectangle_add(evas);
285 evas_object_color_set(o, 200, 200, 200, 255);
286 evas_object_move(o, WINDOW_PAD, WINDOW_PAD);
287 evas_object_resize(o, maxw, maxh);
288 evas_object_show(o);
289
290 add_text("Output", maxw + 2 * WINDOW_PAD, 0, maxw);
291 o = evas_object_rectangle_add(evas);
292 evas_object_color_set(o, 200, 200, 200, 255);
293 evas_object_move(o, maxw + 2 * WINDOW_PAD, WINDOW_PAD);
294 evas_object_resize(o, maxw, maxh);
295 evas_object_show(o);
296
297 tiler = eina_tiler_new(maxw, maxh);
298 ecore_timer_add(2.0, process_input, NULL);
299
300 ecore_evas_show(ee);
301 ecore_main_loop_begin();
302
303 eina_list_free(output_objs);
304 eina_tiler_free(tiler);
305 ecore_evas_free(ee);
306
307 end:
308 free(input_rects);
309
310 eina_shutdown();
311 evas_shutdown();
312 ecore_shutdown();
313 ecore_evas_shutdown();
314
315 return 0;
316}