summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore12
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac6
-rw-r--r--description3
-rw-r--r--doc/Makefile.am4
-rw-r--r--doc/amnesia.148
-rw-r--r--doc/skeleton.150
-rw-r--r--m4/efl.m4123
-rw-r--r--packaging/pkgbuild/PKGBUILD13
-rw-r--r--packaging/slackware/slack-desc22
-rw-r--r--po/POTFILES.in4
-rw-r--r--src/bin/Makefile.am10
-rw-r--r--src/bin/amnesia_main.c (renamed from src/bin/skeleton_main.c)26
-rw-r--r--src/bin/amnesia_private.h (renamed from src/bin/skeleton_private.h)4
-rw-r--r--src/lib/Amnesia.h (renamed from src/lib/Skeleton.h)44
-rw-r--r--src/lib/Makefile.am16
-rw-r--r--src/lib/amnesia.c64
-rw-r--r--src/lib/amnesia_private.h27
-rw-r--r--src/lib/skeleton.c64
-rw-r--r--src/lib/skeleton_private.h27
-rw-r--r--src/tests/Makefile.am14
-rw-r--r--src/tests/test_amnesia.c (renamed from src/tests/test_skeleton.c)24
22 files changed, 364 insertions, 243 deletions
diff --git a/.gitignore b/.gitignore
index 97f4e33..6f0caa5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,17 +9,17 @@
9*.gcno 9*.gcno
10*.gcda 10*.gcda
11 11
12/src/bin/skeleton 12/src/bin/amnesia
13/src/tests/skeleton_tests 13/src/tests/amnesia_tests
14packaging/slackware/skeleton-*.txz 14packaging/slackware/amnesia-*.txz
15skeleton-*.tar.?z* 15amnesia-*.tar.?z*
16po/*.gmo 16po/*.gmo
17po/POTFILES 17po/POTFILES
18.libs 18.libs
19 19
20# autotools crap 20# autotools crap
21m4/*.m4 21m4/*.m4
22!m4/efl_*.m4 22!m4/efl*.m4
23Makefile 23Makefile
24Makefile.in 24Makefile.in
25aclocal.m4 25aclocal.m4
@@ -58,6 +58,6 @@ po/remove-potcdate.sin
58po/stamp-po 58po/stamp-po
59 59
60/coverage/ 60/coverage/
61/src/tests/skeleton_tests.* 61/src/tests/amnesia_tests.*
62/src/tests/test-suite.log 62/src/tests/test-suite.log
63/src/tests/check-results.xml 63/src/tests/check-results.xml
diff --git a/Makefile.am b/Makefile.am
index 1a63d3c..45bb187 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -73,7 +73,7 @@ endif
73 73
74if EFL_HAVE_TESTS 74if EFL_HAVE_TESTS
75 75
76TESTS = src/tests/skeleton_tests 76TESTS = src/tests/amnesia_tests
77 77
78lcov-check: 78lcov-check:
79if EFL_HAVE_LCOV 79if EFL_HAVE_LCOV
diff --git a/configure.ac b/configure.ac
index 66e6a88..8291633 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
1### Skeleton autotools to write an EFL based application 1### Amnesia autotools to write an EFL based application
2### Don't forget to put your email as a maintainer ;-) 2### Don't forget to put your email as a maintainer ;-)
3EFL_VERSION([1], [8], [99], [dev]) 3EFL_VERSION([1], [8], [99], [dev])
4AC_INIT([skeleton], [efl_version], [enlightenment-devel@lists.sourceforge.net]) 4AC_INIT([amnesia], [efl_version], [enlightenment-devel@lists.sourceforge.net])
5 5
6AC_PREREQ([2.65]) 6AC_PREREQ([2.65])
7AC_CONFIG_SRCDIR([configure.ac]) 7AC_CONFIG_SRCDIR([configure.ac])
@@ -30,7 +30,7 @@ EFL_COMPILER_FLAG([-W])
30EFL_CHECK_PATH_MAX 30EFL_CHECK_PATH_MAX
31 31
32# Check for EFL 32# Check for EFL
33PKG_CHECK_MODULES([SKELETON], 33PKG_CHECK_MODULES([AMNESIA],
34[ 34[
35 eina >= 1.8.0 35 eina >= 1.8.0
36 evas >= 1.8.0 36 evas >= 1.8.0
diff --git a/description b/description
index 9d02d59..35c51ef 100644
--- a/description
+++ b/description
@@ -1 +1,2 @@
1This application is a skeleton application for whoever want to do a Elementary/EFL application/library/server. 1The purpose of this application is to track all the memory used in a set of application with as little performance impact as possible.
2
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 75ffa0d..20f112e 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -1,7 +1,7 @@
1MAINTAINERCLEANFILES = Makefile.in 1MAINTAINERCLEANFILES = Makefile.in
2EXTRA_DIST = skeleton.1 2EXTRA_DIST = amnesia.1
3 3
4man_MANS = skeleton.1 4man_MANS = amnesia.1
5 5
6 6
7.PHONY: doc 7.PHONY: doc
diff --git a/doc/amnesia.1 b/doc/amnesia.1
new file mode 100644
index 0000000..fedcef4
--- /dev/null
+++ b/doc/amnesia.1
@@ -0,0 +1,48 @@
1.TH AMNESIA 1 "21 Mar 2013" "amnesia 0.2.3"
2
3.SH NAME
4amnesia \- a multiprocess memory profiler.
5
6.SH SYNOPSIS
7.B amnesia
8[-L][-C][-V][-h]
9
10.SH DESCRIPTION
11
12Amnesia is a multiprocess memory profiler that does track per page usage and is able
13to detect what is shared accross other process and what is not. Helping identifying
14every source of memory use. It does take advantage of EFL integration to pinpoint which
15part of the code is the source of the allocation.
16
17.SH OPTIONS
18
19.TP
20.B -L, --license
21Show license.
22
23.TP
24.B -C, --copyright
25Show copyright.
26
27.TP
28.B -V, --version
29Show program version.
30
31.TP
32.B -h, --help
33Print list of options with short description.
34
35
36.SH BUGS
37
38Reports are welcome.
39
40
41.SH HOMEPAGE
42
43http://enlightenment.org
44
45
46.SH AUTHORS
47
48Cedric Bail <cedric.bail@samsung.com> and various contributors.
diff --git a/doc/skeleton.1 b/doc/skeleton.1
deleted file mode 100644
index 5f76970..0000000
--- a/doc/skeleton.1
+++ /dev/null
@@ -1,50 +0,0 @@
1.TH SKELETON 1 "21 Mar 2013" "skeleton 0.2.3"
2
3.SH NAME
4skeleton \- a minesweeper clone based on the EFL
5
6.SH SYNOPSIS
7.B skeleton
8[-d] [-f] [-t=THEME] [-m=MINES] [-L] [-C] [-V] [-h]
9
10.SH DESCRIPTION
11
12Skeleton is a demo application to show how to integrate EFL and autotools into a
13cross platform build. You should be able to generate an executable easily for all
14target supported by EFL with this skeleton.
15
16With no option, the program starts and display an Hello World.
17
18
19.SH OPTIONS
20
21.TP
22.B -L, --license
23Show license.
24
25.TP
26.B -C, --copyright
27Show copyright.
28
29.TP
30.B -V, --version
31Show program version.
32
33.TP
34.B -h, --help
35Print list of options with short description.
36
37
38.SH BUGS
39
40Reports are welcome.
41
42
43.SH HOMEPAGE
44
45http://enlightenment.org
46
47
48.SH AUTHORS
49
50Cedric Bail <cedric.bail@samsung.com> and various contributors.
diff --git a/m4/efl.m4 b/m4/efl.m4
new file mode 100644
index 0000000..098722f
--- /dev/null
+++ b/m4/efl.m4
@@ -0,0 +1,123 @@
1dnl file to manage modules in efl
2
3dnl EFL_VERSION(major, minor, micro, release)
4dnl This setup EFL version information and should be called BEFORE AC_INIT().
5dnl
6dnl release parameter is 'dev' to use from SVN or libtool -release field.
7dnl It may be empty if not dev (svn/live build) and no -release is to be used.
8dnl
9dnl Examples:
10dnl EFL_VERSION(1, 7, 99, dev)
11dnl EFL_VERSION(1, 7, 99, ver-1234)
12dnl This will define couple of m4 symbols:
13dnl v_maj = given major number (first parameter)
14dnl v_min = given minor number (second parameter)
15dnl v_mic = given micro number (third parameter)
16dnl v_rev = if release, it's 0, otherwise it's dev_version.
17dnl v_rel = if release, it's -release followed by fourth parameter,
18dnl otherwise it's empty. (mostly for libtool)
19dnl efl_version = if release, it's major.minor.micro, otherwise it's
20dnl major.minor.micro.dev_version
21dnl dev_version = development version (svn revision).
22dnl def_build_profile = dev or release based on 'dev' release parameter.
23AC_DEFUN([EFL_VERSION],
24[dnl
25m4_define([v_maj], [$1])dnl
26m4_define([v_min], [$2])dnl
27m4_define([v_mic], [$3])dnl
28m4_define([dev_version], m4_esyscmd([(git rev-list --count HEAD 2>/dev/null || echo 0) | tr -d '\n']))dnl
29m4_define([v_rev], m4_if($4, dev, [dev_version], [0]))dnl
30m4_define([v_rel], [])dnl
31m4_define([def_build_profile], m4_if($4, dev, [dev], [release]))dnl
32m4_define([efl_version], m4_if($4, dev, [v_maj.v_min.v_mic.v_rev], [v_maj.v_min.v_mic]))dnl
33m4_define([efl_version], [v_maj.v_min.v_mic])dnl
34])
35
36dnl EFL_COLOR
37dnl will check if terminal supports color and if color is wanted by user.
38dnl
39dnl Used Variables:
40dnl WANT_COLOR: if no, forces no color output.
41dnl TERM: used to check if color should be enabled.
42dnl
43dnl Defined Variables:
44dnl COLOR_YES: to be used in positive/yes conditions
45dnl COLOR_NO: to be used in negative/no conditions
46dnl COLOR_OTHER: to be used to highlight some other condition
47dnl COLOR_RESET: to reset color
48dnl want_color: yes or no
49AC_DEFUN([EFL_COLOR],
50[dnl
51case "$TERM" in
52 xterm|xterm-color|xterm-256color|Eterm|aterm|kterm|rxvt*|screen|gnome|interix)
53 want_color="${WANT_COLOR:-yes}"
54 ;;
55 *)
56 want_color="no"
57 ;;
58esac
59
60if test "${want_color}" = "yes"; then
61 if test `echo -e x` = x; then
62 echoopt=-e
63 else
64 echoopt=
65 fi
66
67 COLOR_YES=`echo $echoopt "\033@<:@1;32m"`
68 COLOR_NO=`echo $echoopt "\033@<:@1;31m"`
69 COLOR_OTHER=`echo $echoopt "\033@<:@1;36m"`
70 COLOR_RESET=`echo $echoopt "\033@<:@0m"`
71
72else
73 COLOR_YES=""
74 COLOR_NO=""
75 COLOR_OTHER=""
76 COLOR_RESET=""
77fi
78])
79
80dnl EFL_INIT()
81dnl Will AC_DEFINE() the following:
82dnl VMAJ = v_maj
83dnl VMIN = v_min
84dnl VMIC = v_mic
85dnl VREV = v_rev
86dnl Will AC_SUBST() the following:
87dnl VMAJ = v_maj
88dnl VMIN = v_min
89dnl VMIC = v_mic
90dnl EFL_LTLIBRARY_FLAGS="-no-undefined -version-info ..."
91dnl EFL_LTMODULE_FLAGS="-no-undefined -avoid-version"
92dnl Will define the following m4:
93dnl lt_cur = libtool 'current' field of libtool's -version-info
94dnl lt_rev = libtool 'revision' field of libtool's -version-info
95dnl lt_age = libtool 'age' field of libtool's -version-info
96AC_DEFUN([EFL_INIT],
97[dnl
98AC_REQUIRE([EFL_COLOR])dnl
99AC_DEFINE_UNQUOTED([VMAJ], [v_maj], [Major version])dnl
100AC_DEFINE_UNQUOTED([VMIN], [v_min], [Minor version])dnl
101AC_DEFINE_UNQUOTED([VMIC], [v_mic], [Micro version])dnl
102AC_DEFINE_UNQUOTED([VREV], [v_rev], [Revison])dnl
103VMAJ=v_maj
104VMIN=v_min
105VMIC=v_mic
106AC_SUBST([VMAJ])dnl
107AC_SUBST([VMIN])dnl
108AC_SUBST([VMIC])dnl
109dnl
110dnl TODO: warning - lt_cur:
111dnl the previous code assumed v_maj + v_min, but this will be a problem when
112dnl we bump v_maj and reset v_min. 1 + 7 == 7 + 1, so if v_maj is bumped
113dnl we multiply it by 100.
114m4_define([lt_cur], m4_if(m4_cmp(v_maj, 1), 0, m4_eval(v_maj + v_min), m4_eval(v_maj * 100 + v_min)))dnl
115m4_define([lt_rev], v_mic)dnl
116m4_define([lt_age], v_min)dnl
117dnl
118EFL_LTLIBRARY_FLAGS="-no-undefined -version-info lt_cur:lt_rev:lt_age v_rel"
119AC_SUBST(EFL_LTLIBRARY_FLAGS)dnl
120EFL_LTMODULE_FLAGS="-no-undefined -avoid-version"
121AC_SUBST([EFL_LTMODULE_FLAGS])dnl
122AC_MSG_NOTICE([Initialized AC_PACKAGE_NAME (AC_PACKAGE_VERSION) development=dev_version v_rel])
123])
diff --git a/packaging/pkgbuild/PKGBUILD b/packaging/pkgbuild/PKGBUILD
index f61d994..94af99e 100644
--- a/packaging/pkgbuild/PKGBUILD
+++ b/packaging/pkgbuild/PKGBUILD
@@ -1,16 +1,15 @@
1# Maintainer: Enlightenment Developers <enlightenment-devel@enlightenment.org> 1# Maintainer: Enlightenment Developers <enlightenment-devel@enlightenment.org>
2pkgname=('skeleton-git' 'skeleton_doc-git') 2pkgname=('amnesia-git' 'amnesia_doc-git')
3pkgver=1.8.99.8967.a1cfce6 3pkgver=1.8.99.8967.a1cfce6
4pkgrel=1 4pkgrel=1
5pkgdesc="Enlightenment toolkit skeleton - GIT development snapshot" 5pkgdesc="Amnesia Enlightenment Foundation Library memory profiler - GIT development snapshot"
6arch=('i686' 'x86_64' 'arm') 6arch=('i686' 'x86_64' 'arm')
7url="http://www.enlightenment.org" 7url="http://www.enlightenment.org"
8license=('WTFPL') 8license=('WTFPL')
9makedepends=('doxygen' 'imagemagick' 'git') 9makedepends=('doxygen' 'imagemagick' 'git')
10depends=('elementary-git') 10depends=('elementary-git')
11optdepends=('emotion_generic_players' 'evas_generic_loaders')
12options=('!libtool' 'debug') 11options=('!libtool' 'debug')
13provides=('skeleton') 12provides=('amnesia')
14 13
15pkgver() { 14pkgver() {
16 cd "../.." 15 cd "../.."
@@ -34,7 +33,7 @@ build() {
34 make doc 33 make doc
35} 34}
36 35
37package_skeleton-git() { 36package_amnesia-git() {
38 cd "../.." 37 cd "../.."
39 make -j1 DESTDIR="$pkgdir/" install 38 make -j1 DESTDIR="$pkgdir/" install
40 install -Dm644 README "$pkgdir/usr/share/$pkgname/README" 39 install -Dm644 README "$pkgdir/usr/share/$pkgname/README"
@@ -48,8 +47,8 @@ package_skeleton-git() {
48 ln -s "../licenses/$pkgname/COPYING.images" "$pkgdir/usr/share/$pkgname/COPYING.images" 47 ln -s "../licenses/$pkgname/COPYING.images" "$pkgdir/usr/share/$pkgname/COPYING.images"
49} 48}
50 49
51package_skeleton_doc-git() { 50package_amnesia_doc-git() {
52 pkgdesc="Documentation for Skeleton" 51 pkgdesc="Documentation for Amnesia"
53 arch=('any') 52 arch=('any')
54 unset depends optdepends 53 unset depends optdepends
55 54
diff --git a/packaging/slackware/slack-desc b/packaging/slackware/slack-desc
index 893a343..6836ccc 100644
--- a/packaging/slackware/slack-desc
+++ b/packaging/slackware/slack-desc
@@ -6,14 +6,14 @@
6# customary to leave one space after the ':'. 6# customary to leave one space after the ':'.
7 7
8 |-----handy-ruler------------------------------------------------------| 8 |-----handy-ruler------------------------------------------------------|
9skeleton: skeleton 9amnesia: amnesia
10skeleton: 10amnesia:
11skeleton: Skeleton is an example of application written using the Enlightenment 11amnesia: Amnesia is a multiprocess memory profiler integratting itself with Enlightenment
12skeleton: Foundation Libraries. 12amnesia: Foundation Libraries.
13skeleton: 13amnesia:
14skeleton: It requires elementary. 14amnesia: It requires elementary.
15skeleton: 15amnesia:
16skeleton: skeleton was written by Cedric Bail <cedric.bail@samsung.com> 16amnesia: amnesia was written by Cedric Bail <cedric.bail@samsung.com>
17skeleton: website: <http://enlightenment.org/> 17amnesia: website: <http://enlightenment.org/>
18skeleton: 18amnesia:
19skeleton: 19amnesia:
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 099f1a0..ff8391f 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,2 +1,2 @@
1src/bin/skeleton_main.c 1src/bin/amnesia_main.c
2src/bin/skeleton_private.h 2src/bin/amnesia_private.h
diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am
index a4f97af..76cdc5f 100644
--- a/src/bin/Makefile.am
+++ b/src/bin/Makefile.am
@@ -1,19 +1,19 @@
1MAINTAINERCLEANFILES = Makefile.in 1MAINTAINERCLEANFILES = Makefile.in
2 2
3bin_PROGRAMS = skeleton 3bin_PROGRAMS = amnesia
4 4
5AM_CPPFLAGS = -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ 5AM_CPPFLAGS = -DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
6-I$(top_builddir)/src/bin/ \ 6-I$(top_builddir)/src/bin/ \
7-I$(top_srcdir)/src/bin/ \ 7-I$(top_srcdir)/src/bin/ \
8-I$(top_builddir)/src/lib/ \ 8-I$(top_builddir)/src/lib/ \
9-I$(top_srcdir)/src/lib/ \ 9-I$(top_srcdir)/src/lib/ \
10@SKELETON_CFLAGS@ 10@AMNESIA_CFLAGS@
11 11
12skeleton_SOURCES = skeleton_main.c 12amnesia_SOURCES = amnesia_main.c
13skeleton_LDADD = @SKELETON_LIBS@ $(top_builddir)/src/lib/libskeleton.la 13amnesia_LDADD = @AMNESIA_LIBS@ $(top_builddir)/src/lib/libamnesia.la
14 14
15localedir = $(datadir)/locale 15localedir = $(datadir)/locale
16DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@ 16DEFS = -DLOCALEDIR=\"$(localedir)\" @DEFS@
17 17
18EXTRA_DIST = skeleton_private.h 18EXTRA_DIST = amnesia_private.h
19 19
diff --git a/src/bin/skeleton_main.c b/src/bin/amnesia_main.c
index 84ebe45..3ba021c 100644
--- a/src/bin/skeleton_main.c
+++ b/src/bin/amnesia_main.c
@@ -11,30 +11,30 @@
11 11
12#include "gettext.h" 12#include "gettext.h"
13 13
14#include "Skeleton.h" 14#include "Amnesia.h"
15 15
16#include "skeleton_private.h" 16#include "amnesia_private.h"
17 17
18// FIXME: Don't forget to put your name below instead of mine ;-) And remove the comment when done ! 18// FIXME: Don't forget to put your name below instead of mine ;-) And remove the comment when done !
19#define COPYRIGHT "Copyright © 2013 Cedric BAIL <cedric.bail@samsung.com> and various contributors (see AUTHORS)." 19#define COPYRIGHT "Copyright © 2013 Cedric BAIL <cedric.bail@samsung.com> and various contributors (see AUTHORS)."
20 20
21static void 21static void
22_skeleton_win_del(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 22_amnesia_win_del(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
23{ 23{
24 elm_exit(); 24 elm_exit();
25} 25}
26 26
27static Evas_Object * 27static Evas_Object *
28skeleton_win_setup(void) 28amnesia_win_setup(void)
29{ 29{
30 Evas_Object *win; 30 Evas_Object *win;
31 Evas_Object *label; 31 Evas_Object *label;
32 32
33 win = elm_win_util_standard_add("main", "Skeleton"); 33 win = elm_win_util_standard_add("main", "Amnesia");
34 if (!win) return NULL; 34 if (!win) return NULL;
35 35
36 elm_win_focus_highlight_enabled_set(win, EINA_TRUE); 36 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
37 evas_object_smart_callback_add(win, "delete,request", _skeleton_win_del, NULL); 37 evas_object_smart_callback_add(win, "delete,request", _amnesia_win_del, NULL);
38 38
39 label = elm_label_add(win); 39 label = elm_label_add(win);
40 elm_object_text_set(label, " Hello World !"); 40 elm_object_text_set(label, " Hello World !");
@@ -50,12 +50,12 @@ skeleton_win_setup(void)
50} 50}
51 51
52static const Ecore_Getopt optdesc = { 52static const Ecore_Getopt optdesc = {
53 "skeleton", 53 "amnesia",
54 "%prog [options]", 54 "%prog [options]",
55 PACKAGE_VERSION, 55 PACKAGE_VERSION,
56 COPYRIGHT, 56 COPYRIGHT,
57 "BSD with advertisement clause", 57 "BSD with advertisement clause",
58 "An EFL skeleton program", 58 "An EFL amnesia program",
59 0, 59 0,
60 { 60 {
61 ECORE_GETOPT_LICENSE('L', "license"), 61 ECORE_GETOPT_LICENSE('L', "license"),
@@ -88,7 +88,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
88 textdomain(PACKAGE); 88 textdomain(PACKAGE);
89#endif 89#endif
90 90
91 skeleton_init(); 91 amnesia_init();
92 92
93 args = ecore_getopt_parse(&optdesc, values, argc, argv); 93 args = ecore_getopt_parse(&optdesc, values, argc, argv);
94 if (args < 0) 94 if (args < 0)
@@ -101,17 +101,17 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
101 goto end; 101 goto end;
102 } 102 }
103 103
104 elm_app_info_set(elm_main, "skeleton", "images/logo.png"); 104 elm_app_info_set(elm_main, "amnesia", "images/logo.png");
105 105
106 if (!(win = skeleton_win_setup())) 106 if (!(win = amnesia_win_setup()))
107 goto end; 107 goto end;
108 108
109 skeleton_library_call(); 109 amnesia_library_call();
110 110
111 elm_run(); 111 elm_run();
112 112
113 end: 113 end:
114 skeleton_shutdown(); 114 amnesia_shutdown();
115 elm_shutdown(); 115 elm_shutdown();
116 116
117 return 0; 117 return 0;
diff --git a/src/bin/skeleton_private.h b/src/bin/amnesia_private.h
index f12d682..2193727 100644
--- a/src/bin/skeleton_private.h
+++ b/src/bin/amnesia_private.h
@@ -1,5 +1,5 @@
1#ifndef SKELETON_PRIVATE_H_ 1#ifndef AMNESIA_PRIVATE_H_
2# define SKELETON_PRIVATE_H_ 2# define AMNESIA_PRIVATE_H_
3 3
4// FIXME: put some private stuff related to your binary 4// FIXME: put some private stuff related to your binary
5 5
diff --git a/src/lib/Skeleton.h b/src/lib/Amnesia.h
index 83470cf..0cf64df 100644
--- a/src/lib/Skeleton.h
+++ b/src/lib/Amnesia.h
@@ -1,5 +1,5 @@
1#ifndef SKELETON_H_ 1#ifndef AMNESIA_H_
2# define SKELETON_H_ 2# define AMNESIA_H_
3 3
4#include <Elementary.h> 4#include <Elementary.h>
5 5
@@ -8,7 +8,7 @@
8#endif 8#endif
9 9
10#ifdef _WIN32 10#ifdef _WIN32
11# ifdef EFL_SKELETON_BUILD 11# ifdef EFL_AMNESIA_BUILD
12# ifdef DLL_EXPORT 12# ifdef DLL_EXPORT
13# define EAPI __declspec(dllexport) 13# define EAPI __declspec(dllexport)
14# else 14# else
@@ -16,7 +16,7 @@
16# endif /* ! DLL_EXPORT */ 16# endif /* ! DLL_EXPORT */
17# else 17# else
18# define EAPI __declspec(dllimport) 18# define EAPI __declspec(dllimport)
19# endif /* ! EFL_SKELETON_BUILD */ 19# endif /* ! EFL_AMNESIA_BUILD */
20#else 20#else
21# ifdef __GNUC__ 21# ifdef __GNUC__
22# if __GNUC__ >= 4 22# if __GNUC__ >= 4
@@ -35,7 +35,7 @@ extern "C" {
35 35
36/** 36/**
37 * @file 37 * @file
38 * @brief These routines are used for Skeleton library interaction. 38 * @brief These routines are used for Amnesia library interaction.
39 */ 39 */
40 40
41/** 41/**
@@ -47,42 +47,42 @@ extern "C" {
47 * Functions of obligatory usage, handling proper initialization 47 * Functions of obligatory usage, handling proper initialization
48 * and shutdown routines. 48 * and shutdown routines.
49 * 49 *
50 * Before the usage of any other function, Skeleton should be properly 50 * Before the usage of any other function, Amnesia should be properly
51 * initialized with @ref skeleton_init() and the last call to Skeleton's 51 * initialized with @ref amnesia_init() and the last call to Amnesia's
52 * functions should be @ref skeleton_shutdown(), so everything will 52 * functions should be @ref amnesia_shutdown(), so everything will
53 * be correctly freed. 53 * be correctly freed.
54 * 54 *
55 * Skeleton logs everything with Eina Log, using the "skeleton" log domain. 55 * Amnesia logs everything with Eina Log, using the "amnesia" log domain.
56 * 56 *
57 */ 57 */
58 58
59/** 59/**
60 * Initialize Skeleton. 60 * Initialize Amnesia.
61 * 61 *
62 * Initializes Skeleton, its dependencies and modules. Should be the first 62 * Initializes Amnesia, its dependencies and modules. Should be the first
63 * function of Skeleton to be called. 63 * function of Amnesia to be called.
64 * 64 *
65 * @return The init counter value. 65 * @return The init counter value.
66 * 66 *
67 * @see skeleton_shutdown(). 67 * @see amnesia_shutdown().
68 * 68 *
69 * @ingroup Init 69 * @ingroup Init
70 */ 70 */
71EAPI int skeleton_init(void); 71EAPI int amnesia_init(void);
72 72
73/** 73/**
74 * Shutdown Skeleton 74 * Shutdown Amnesia
75 * 75 *
76 * Shutdown Skeleton. If init count reaches 0, all the internal structures will 76 * Shutdown Amnesia. If init count reaches 0, all the internal structures will
77 * be freed. Any Skeleton library call after this point will leads to an error. 77 * be freed. Any Amnesia library call after this point will leads to an error.
78 * 78 *
79 * @return Skeleton's init counter value. 79 * @return Amnesia's init counter value.
80 * 80 *
81 * @see skeleton_init(). 81 * @see amnesia_init().
82 * 82 *
83 * @ingroup Init 83 * @ingroup Init
84 */ 84 */
85EAPI int skeleton_shutdown(void); 85EAPI int amnesia_shutdown(void);
86 86
87/** 87/**
88 * @} 88 * @}
@@ -98,7 +98,7 @@ EAPI int skeleton_shutdown(void);
98 * 98 *
99 * @ingroup Main 99 * @ingroup Main
100 */ 100 */
101EAPI void skeleton_library_call(void); 101EAPI void amnesia_library_call(void);
102 102
103/** 103/**
104 * @} 104 * @}
@@ -108,4 +108,4 @@ EAPI void skeleton_library_call(void);
108} 108}
109#endif 109#endif
110 110
111#endif /* SKELETON_H_ */ 111#endif /* AMNESIA_H_ */
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index fc1f0bb..d191c5a 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -5,14 +5,14 @@ AM_CPPFLAGS = \
5-I$(top_builddir)/src/lib \ 5-I$(top_builddir)/src/lib \
6-DPACKAGE_LIB_DIR=\"$(libdir)\" \ 6-DPACKAGE_LIB_DIR=\"$(libdir)\" \
7-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \ 7-DPACKAGE_DATA_DIR=\"$(datadir)/$(PACKAGE)\" \
8@SKELETON_CFLAGS@ \ 8@AMNESIA_CFLAGS@ \
9-DEFL_SKELETON_BUILD 9-DEFL_AMNESIA_BUILD
10 10
11lib_LTLIBRARIES = libskeleton.la 11lib_LTLIBRARIES = libamnesia.la
12 12
13includes_HEADERS = Skeleton.h 13includes_HEADERS = Amnesia.h
14includesdir = $(includedir)/skeleton-@VMAJ@ 14includesdir = $(includedir)/amnesia-@VMAJ@
15 15
16libskeleton_la_SOURCES = skeleton.c 16libamnesia_la_SOURCES = amnesia.c
17libskeleton_la_LIBADD = @SKELETON_LIBS@ -lm 17libamnesia_la_LIBADD = @AMNESIA_LIBS@ -lm
18libskeleton_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@ 18libamnesia_la_LDFLAGS = @EFL_LTLIBRARY_FLAGS@
diff --git a/src/lib/amnesia.c b/src/lib/amnesia.c
new file mode 100644
index 0000000..9cb5350
--- /dev/null
+++ b/src/lib/amnesia.c
@@ -0,0 +1,64 @@
1#ifdef HAVE_CONFIG
2# include "config.h"
3#endif
4
5#include "Amnesia.h"
6
7#include "amnesia_private.h"
8
9static int _amnesia_init = 0;
10int _amnesia_lib_log_dom = -1;
11
12EAPI int
13amnesia_init(void)
14{
15 _amnesia_init++;
16 if (_amnesia_init > 1) return _amnesia_init;
17
18 eina_init();
19
20 _amnesia_lib_log_dom = eina_log_domain_register("amnesia", EINA_COLOR_CYAN);
21 if (_amnesia_lib_log_dom < 0)
22 {
23 EINA_LOG_ERR("Amnesia can not create its log domain.");
24 goto shutdown_eina;
25 }
26
27 // Put here your initialization logic of your library
28
29 eina_log_timing(_amnesia_lib_log_dom, EINA_LOG_STATE_STOP, EINA_LOG_STATE_INIT);
30
31 return _amnesia_init;
32
33 shutdown_eina:
34 eina_shutdown();
35 _amnesia_init--;
36
37 return _amnesia_init;
38}
39
40EAPI int
41amnesia_shutdown(void)
42{
43 _amnesia_init--;
44 if (_amnesia_init != 0) return _amnesia_init;
45
46 eina_log_timing(_amnesia_lib_log_dom,
47 EINA_LOG_STATE_START,
48 EINA_LOG_STATE_SHUTDOWN);
49
50 // Put here your shutdown logic
51
52 eina_log_domain_unregister(_amnesia_lib_log_dom);
53 _amnesia_lib_log_dom = -1;
54
55 eina_shutdown();
56
57 return _amnesia_init;
58}
59
60EAPI void
61amnesia_library_call(void)
62{
63 INF("Not really doing anything useful.");
64}
diff --git a/src/lib/amnesia_private.h b/src/lib/amnesia_private.h
new file mode 100644
index 0000000..96c945c
--- /dev/null
+++ b/src/lib/amnesia_private.h
@@ -0,0 +1,27 @@
1#ifndef AMNESIA_PRIVATE_H
2# define AMNESIA_PRIVATE_H
3
4extern int _amnesia_lib_log_dom;
5
6#ifdef ERR
7# undef ERR
8#endif
9#define ERR(...) EINA_LOG_DOM_ERR(_amnesia_lib_log_dom, __VA_ARGS__)
10#ifdef INF
11# undef INF
12#endif
13#define INF(...) EINA_LOG_DOM_INFO(_amnesia_lib_log_dom, __VA_ARGS__)
14#ifdef WRN
15# undef WRN
16#endif
17#define WRN(...) EINA_LOG_DOM_WARN(_amnesia_lib_log_dom, __VA_ARGS__)
18#ifdef CRIT
19# undef CRIT
20#endif
21#define CRIT(...) EINA_LOG_DOM_CRIT(_amnesia_lib_log_dom, __VA_ARGS__)
22#ifdef DBG
23# undef DBG
24#endif
25#define DBG(...) EINA_LOG_DOM_DBG(_amnesia_lib_log_dom, __VA_ARGS__)
26
27#endif
diff --git a/src/lib/skeleton.c b/src/lib/skeleton.c
deleted file mode 100644
index d16fa72..0000000
--- a/src/lib/skeleton.c
+++ /dev/null
@@ -1,64 +0,0 @@
1#ifdef HAVE_CONFIG
2# include "config.h"
3#endif
4
5#include "Skeleton.h"
6
7#include "skeleton_private.h"
8
9static int _skeleton_init = 0;
10int _skeleton_lib_log_dom = -1;
11
12EAPI int
13skeleton_init(void)
14{
15 _skeleton_init++;
16 if (_skeleton_init > 1) return _skeleton_init;
17
18 eina_init();
19
20 _skeleton_lib_log_dom = eina_log_domain_register("skeleton", EINA_COLOR_CYAN);
21 if (_skeleton_lib_log_dom < 0)
22 {
23 EINA_LOG_ERR("Skeleton can not create its log domain.");
24 goto shutdown_eina;
25 }
26
27 // Put here your initialization logic of your library
28
29 eina_log_timing(_skeleton_lib_log_dom, EINA_LOG_STATE_STOP, EINA_LOG_STATE_INIT);
30
31 return _skeleton_init;
32
33 shutdown_eina:
34 eina_shutdown();
35 _skeleton_init--;
36
37 return _skeleton_init;
38}
39
40EAPI int
41skeleton_shutdown(void)
42{
43 _skeleton_init--;
44 if (_skeleton_init != 0) return _skeleton_init;
45
46 eina_log_timing(_skeleton_lib_log_dom,
47 EINA_LOG_STATE_START,
48 EINA_LOG_STATE_SHUTDOWN);
49
50 // Put here your shutdown logic
51
52 eina_log_domain_unregister(_skeleton_lib_log_dom);
53 _skeleton_lib_log_dom = -1;
54
55 eina_shutdown();
56
57 return _skeleton_init;
58}
59
60EAPI void
61skeleton_library_call(void)
62{
63 INF("Not really doing anything useful.");
64}
diff --git a/src/lib/skeleton_private.h b/src/lib/skeleton_private.h
deleted file mode 100644
index a1045da..0000000
--- a/src/lib/skeleton_private.h
+++ /dev/null
@@ -1,27 +0,0 @@
1#ifndef SKELETON_PRIVATE_H
2# define SKELETON_PRIVATE_H
3
4extern int _skeleton_lib_log_dom;
5
6#ifdef ERR
7# undef ERR
8#endif
9#define ERR(...) EINA_LOG_DOM_ERR(_skeleton_lib_log_dom, __VA_ARGS__)
10#ifdef INF
11# undef INF
12#endif
13#define INF(...) EINA_LOG_DOM_INFO(_skeleton_lib_log_dom, __VA_ARGS__)
14#ifdef WRN
15# undef WRN
16#endif
17#define WRN(...) EINA_LOG_DOM_WARN(_skeleton_lib_log_dom, __VA_ARGS__)
18#ifdef CRIT
19# undef CRIT
20#endif
21#define CRIT(...) EINA_LOG_DOM_CRIT(_skeleton_lib_log_dom, __VA_ARGS__)
22#ifdef DBG
23# undef DBG
24#endif
25#define DBG(...) EINA_LOG_DOM_DBG(_skeleton_lib_log_dom, __VA_ARGS__)
26
27#endif
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index 2cb4e1d..fe4fd1e 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -1,17 +1,17 @@
1 1
2if EFL_HAVE_TESTS 2if EFL_HAVE_TESTS
3 3
4check_PROGRAMS = skeleton_tests 4check_PROGRAMS = amnesia_tests
5 5
6skeleton_tests_SOURCES = test_skeleton.c 6amnesia_tests_SOURCES = test_amnesia.c
7skeleton_tests_CPPFLAGS = -I$(top_builddir)/src/lib/ \ 7amnesia_tests_CPPFLAGS = -I$(top_builddir)/src/lib/ \
8-DPACKAGE_TESTS_DIR=\"$(top_srcdir)/src/tests/\" \ 8-DPACKAGE_TESTS_DIR=\"$(top_srcdir)/src/tests/\" \
9-DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)/src/tests/\" \ 9-DPACKAGE_BUILD_DIR=\"`pwd`/$(top_builddir)/src/tests/\" \
10@SKELETON_CFLAGS@ \ 10@AMNESIA_CFLAGS@ \
11@CHECK_CFLAGS@ 11@CHECK_CFLAGS@
12skeleton_tests_LDADD = @CHECK_LIBS@ $(top_builddir)/src/lib/libskeleton.la 12amnesia_tests_LDADD = @CHECK_LIBS@ $(top_builddir)/src/lib/libamnesia.la
13skeleton_tests_DEPENDENCIES = $(top_builddir)/src/lib/libskeleton.la 13amnesia_tests_DEPENDENCIES = $(top_builddir)/src/lib/libamnesia.la
14 14
15endif 15endif
16 16
17EXTRA_DIST = test_skeleton.c 17EXTRA_DIST = test_amnesia.c
diff --git a/src/tests/test_skeleton.c b/src/tests/test_amnesia.c
index a9cfa5f..b98419f 100644
--- a/src/tests/test_skeleton.c
+++ b/src/tests/test_amnesia.c
@@ -5,42 +5,42 @@
5#include <Ecore_Getopt.h> 5#include <Ecore_Getopt.h>
6#include <check.h> 6#include <check.h>
7 7
8#include "Skeleton.h" 8#include "Amnesia.h"
9 9
10#define COPYRIGHT "Copyright © 2013 Cedric BAIL <cedric.bail@samsung.com> and various contributors (see AUTHORS)." 10#define COPYRIGHT "Copyright © 2013 Cedric BAIL <cedric.bail@samsung.com> and various contributors (see AUTHORS)."
11 11
12static void skeleton_test_basic(TCase *tc); 12static void amnesia_test_basic(TCase *tc);
13 13
14static const struct { 14static const struct {
15 const char *name; 15 const char *name;
16 void (*build)(TCase *tc); 16 void (*build)(TCase *tc);
17} tests[] = { 17} tests[] = {
18 { "basic", skeleton_test_basic } 18 { "basic", amnesia_test_basic }
19}; 19};
20 20
21START_TEST(skeleton_initialization) 21START_TEST(amnesia_initialization)
22{ 22{
23 fail_if(skeleton_init() != 1); 23 fail_if(amnesia_init() != 1);
24 24
25 skeleton_library_call(); 25 amnesia_library_call();
26 26
27 fail_if(skeleton_shutdown() != 0); 27 fail_if(amnesia_shutdown() != 0);
28} 28}
29END_TEST 29END_TEST
30 30
31static void 31static void
32skeleton_test_basic(TCase *tc) 32amnesia_test_basic(TCase *tc)
33{ 33{
34 tcase_add_test(tc, skeleton_initialization); 34 tcase_add_test(tc, amnesia_initialization);
35} 35}
36 36
37static const Ecore_Getopt optdesc = { 37static const Ecore_Getopt optdesc = {
38 "skeleton", 38 "amnesia",
39 "%prog [options]", 39 "%prog [options]",
40 PACKAGE_VERSION, 40 PACKAGE_VERSION,
41 COPYRIGHT, 41 COPYRIGHT,
42 "BSD with advertisement clause", 42 "BSD with advertisement clause",
43 "An EFL skeleton program", 43 "An EFL amnesia program",
44 0, 44 0,
45 { 45 {
46 ECORE_GETOPT_STORE_TRUE('l', "list", "list available tests"), 46 ECORE_GETOPT_STORE_TRUE('l', "list", "list available tests"),
@@ -96,7 +96,7 @@ main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
96 goto end; 96 goto end;
97 } 97 }
98 98
99 s = suite_create("Skeleton"); 99 s = suite_create("Amnesia");
100 100
101 for (i = 0; i < sizeof (tests) / sizeof (tests[0]); i++) 101 for (i = 0; i < sizeof (tests) / sizeof (tests[0]); i++)
102 { 102 {