aboutsummaryrefslogtreecommitdiffhomepage
path: root/evdev.c
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2024-01-24 19:29:42 +0300
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2024-01-24 19:29:42 +0300
commitd444a5d7405016a5094e26050cfb453bcd6f882a (patch)
tree64e64cdc97dc128b5cf4a7aebeec32ef5bf47e63 /evdev.c
parentb45726451da90bba61d75f817982d2abdfbb0542 (diff)
downloadapplause2-d444a5d7405016a5094e26050cfb453bcd6f882a.tar.gz
evdev: access struct dirent via helper function applause_dirent_name() instead directly from Lua
* the structure is highly platform-dependant and might even differ between 32-bit and 64-bit systems * in particular this fixes EvdevStream on FreeBSD
Diffstat (limited to 'evdev.c')
-rw-r--r--evdev.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/evdev.c b/evdev.c
index 8cc4aa4..6b9d494 100644
--- a/evdev.c
+++ b/evdev.c
@@ -6,6 +6,7 @@
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
+#include <dirent.h>
#include <sys/ioctl.h>
#include <sys/types.h>
@@ -25,6 +26,12 @@ struct applause_evdev {
pthread_t thread;
};
+const char *
+applause_dirent_name(const struct dirent *entry)
+{
+ return entry->d_name;
+}
+
char *
applause_evdev_getname(const char *node)
{