summaryrefslogtreecommitdiff
path: root/src/lib/elput/elput.c
diff options
context:
space:
mode:
authorChris Michael <cpmichael@osg.samsung.com>2016-03-24 11:19:31 -0400
committerChris Michael <cpmichael@osg.samsung.com>2016-04-13 14:16:17 -0400
commitf8964fcf2e4681ab77e0cf37c96e9994d25b19fd (patch)
tree4a70ed38cc391e045f5e333ee94fdddf7f4cc851 /src/lib/elput/elput.c
parentc23a61a49caebca1244fad484cae403bf7a0a0fd (diff)
elput: Initial checkin of elput library
The elput library is an efl abstraction for the libinput library which can be used by various other subsystems (ecore_fb, ecore_drm, etc) to handle interfacing with libinput without having to duplicate the code in each subsystem. Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
Diffstat (limited to 'src/lib/elput/elput.c')
-rw-r--r--src/lib/elput/elput.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/lib/elput/elput.c b/src/lib/elput/elput.c
new file mode 100644
index 0000000000..1b5613fc3a
--- /dev/null
+++ b/src/lib/elput/elput.c
@@ -0,0 +1,55 @@
1#include "elput_private.h"
2
3/* local variables */
4static int _elput_init_count = 0;
5
6/* external variables */
7int _elput_log_dom = -1;
8
9EAPI int
10elput_init(void)
11{
12 if (++_elput_init_count != 1) return _elput_init_count;
13
14 if (!eina_init()) goto eina_err;
15 if (!ecore_init()) goto ecore_err;
16 if (!ecore_event_init()) goto ecore_event_err;
17 if (!eeze_init()) goto eeze_err;
18
19 _elput_log_dom = eina_log_domain_register("elput", ELPUT_DEFAULT_LOG_COLOR);
20 if (!_elput_log_dom)
21 {
22 EINA_LOG_ERR("Could not create logging domain for Elput");
23 goto log_err;
24 }
25
26 return _elput_init_count;
27
28log_err:
29 eeze_shutdown();
30eeze_err:
31 ecore_event_shutdown();
32ecore_event_err:
33 ecore_shutdown();
34ecore_err:
35 eina_shutdown();
36eina_err:
37 return --_elput_init_count;
38}
39
40EAPI int
41elput_shutdown(void)
42{
43 if (_elput_init_count < 1) return 0;
44 if (--_elput_init_count != 0) return _elput_init_count;
45
46 eina_log_domain_unregister(_elput_log_dom);
47 _elput_log_dom = -1;
48
49 eeze_shutdown();
50 ecore_event_shutdown();
51 ecore_shutdown();
52 eina_shutdown();
53
54 return _elput_init_count;
55}