summaryrefslogtreecommitdiff
path: root/src/lib/elput/elput_manager.c
diff options
context:
space:
mode:
authorChris Michael <cpmichael@osg.samsung.com>2016-04-01 09:12:36 -0400
committerChris Michael <cpmichael@osg.samsung.com>2016-04-13 14:16:17 -0400
commit1ce6cd438244d644a63e6d1ab1dde88633bba34e (patch)
tree699b444d7f4e88a102964fe88ec48922ff08aa11 /src/lib/elput/elput_manager.c
parented3a1f39587187c8acf305fd793f92218995c486 (diff)
elput: Add API functions to open and close an input device
This adds new API functions which can be called to open or close an input device and take control (or release control) of said device Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
Diffstat (limited to 'src/lib/elput/elput_manager.c')
-rw-r--r--src/lib/elput/elput_manager.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lib/elput/elput_manager.c b/src/lib/elput/elput_manager.c
index 2073ff78f9..3dc67d9594 100644
--- a/src/lib/elput/elput_manager.c
+++ b/src/lib/elput/elput_manager.c
@@ -37,3 +37,28 @@ elput_manager_disconnect(Elput_Manager *manager)
37 if (manager->interface->disconnect) 37 if (manager->interface->disconnect)
38 manager->interface->disconnect(manager); 38 manager->interface->disconnect(manager);
39} 39}
40
41EAPI int
42elput_manager_open(Elput_Manager *manager, const char *path, int flags)
43{
44 EINA_SAFETY_ON_NULL_RETURN_VAL(manager, -1);
45 EINA_SAFETY_ON_NULL_RETURN_VAL(manager->interface, -1);
46 EINA_SAFETY_ON_NULL_RETURN_VAL(path, -1);
47
48 if (flags < 0) flags = O_RDWR;
49
50 if (manager->interface->open)
51 return manager->interface->open(manager, path, flags);
52
53 return -1;
54}
55
56EAPI void
57elput_manager_close(Elput_Manager *manager, int fd)
58{
59 EINA_SAFETY_ON_NULL_RETURN(manager);
60 EINA_SAFETY_ON_NULL_RETURN(manager->interface);
61
62 if (manager->interface->close)
63 manager->interface->close(manager, fd);
64}