summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac1
-rw-r--r--src/Makefile.am1
-rw-r--r--src/examples/emile/Makefile.am51
-rw-r--r--src/examples/emile/Makefile.examples14
-rw-r--r--src/examples/emile/emile_base64.c29
5 files changed, 96 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index facdb5f3c3..27981df22e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5064,6 +5064,7 @@ src/examples/eldbus/Makefile
5064src/examples/ephysics/Makefile 5064src/examples/ephysics/Makefile
5065src/examples/edje/Makefile 5065src/examples/edje/Makefile
5066src/examples/emotion/Makefile 5066src/examples/emotion/Makefile
5067src/examples/emile/Makefile
5067src/examples/ethumb_client/Makefile 5068src/examples/ethumb_client/Makefile
5068src/examples/elua/Makefile 5069src/examples/elua/Makefile
5069src/examples/eolian_cxx/Makefile 5070src/examples/eolian_cxx/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index 248711bc34..dacb79c78a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -118,6 +118,7 @@ examples/eldbus \
118examples/ephysics \ 118examples/ephysics \
119examples/edje \ 119examples/edje \
120examples/emotion \ 120examples/emotion \
121examples/emile \
121examples/elocation \ 122examples/elocation \
122examples/ethumb_client 123examples/ethumb_client
123 124
diff --git a/src/examples/emile/Makefile.am b/src/examples/emile/Makefile.am
new file mode 100644
index 0000000000..3377a87fa5
--- /dev/null
+++ b/src/examples/emile/Makefile.am
@@ -0,0 +1,51 @@
1MAINTAINERCLEANFILES = Makefile.in
2
3AM_CPPFLAGS = \
4-I. \
5-I$(top_srcdir)/src/lib/efl \
6-I$(top_builddir)/src/lib/efl \
7-I$(top_builddir)/src/lib/efl/interfaces \
8-I$(top_srcdir)/src/lib/eina \
9-I$(top_builddir)/src/lib/eina \
10-I$(top_srcdir)/src/lib/emile \
11-I$(top_builddir)/src/lib/emile
12
13LDADD = $(top_builddir)/src/lib/eina/libeina.la @EMILE_LDFLAGS@
14
15SRCS = \
16emile_base64.c
17
18EXTRA_PROGRAMS = \
19emile_base64
20
21emile_base64_CPPFLAGS = \
22-I$(top_srcdir)/src/lib/efl \
23-I$(top_srcdir)/src/lib/eina \
24-I$(top_builddir)/src/lib/efl \
25-I$(top_builddir)/src/lib/efl/interfaces \
26-I$(top_builddir)/src/lib/eina \
27-I$(top_srcdir)/src/lib/emile \
28@EMILE_CFLAGS@
29
30emile_base64_LDADD = \
31$(top_builddir)/src/lib/eina/libeina.la \
32$(top_builddir)/src/lib/emile/libemile.la \
33@EMILE_LDFLAGS@
34
35examples: $(EXTRA_PROGRAMS)
36
37clean-local:
38 rm -f $(EXTRA_PROGRAMS)
39
40install-examples:
41 $(MKDIR_P) $(datadir)/emile/examples
42 cd $(srcdir) && $(install_sh_DATA) -c $(SRCS) $(DATA_FILES) $(datadir)/emile/examples
43
44uninstall-local:
45 for f in $(SRCS) $(DATA_FILES); do \
46 rm -f $(datadir)/emile/examples/$$f ; \
47 done
48
49if ALWAYS_BUILD_EXAMPLES
50noinst_PROGRAMS = $(EXTRA_PROGRAMS)
51endif
diff --git a/src/examples/emile/Makefile.examples b/src/examples/emile/Makefile.examples
new file mode 100644
index 0000000000..3634a2d2a2
--- /dev/null
+++ b/src/examples/emile/Makefile.examples
@@ -0,0 +1,14 @@
1CC=gcc
2COMMON_FLAGS=`pkg-config --libs --cflags eina, emile`
3
4EXAMPLES= emile_base64
5
6all: examples
7examples: $(EXAMPLES)
8
9$(EXAMPLES):
10 $(CC) -o $@ $@.c $(COMMON_FLAGS)
11
12clean:
13 @echo "Cleaning up built objects..."
14 @rm -Rf $(EXAMPLES)
diff --git a/src/examples/emile/emile_base64.c b/src/examples/emile/emile_base64.c
new file mode 100644
index 0000000000..0f175abe93
--- /dev/null
+++ b/src/examples/emile/emile_base64.c
@@ -0,0 +1,29 @@
1//Compile with:
2//gcc -Wall -o emile_base64 emile_base64.c `pkg-config --cflags --libs eina emile`
3
4#include <stdio.h>
5#include <Eina.h>
6#include <Emile.h>
7
8int main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
9{
10 Eina_Strbuf *b64;
11 Eina_Binbuf *decoded;
12 Eina_Binbuf *str;
13
14 eina_init();
15
16 str = eina_binbuf_new();
17 eina_binbuf_append_length(str, (unsigned char *)"Enlightenment", 13);
18 b64 = emile_base64_encode(str);
19 printf("%s\n", eina_strbuf_string_get(b64));
20 decoded = emile_base64_decode(b64);
21 printf("decoded string: %s\n", eina_binbuf_string_get(decoded));
22 eina_strbuf_free(b64);
23 eina_binbuf_free(decoded);
24
25 eina_binbuf_free(str);
26 eina_shutdown();
27
28 return 0;
29}