diff options
Diffstat (limited to 'modules/evdev')
-rw-r--r-- | modules/evdev/evdev.c | 25 | ||||
-rw-r--r-- | modules/evdev/print.c | 13 |
2 files changed, 10 insertions, 28 deletions
diff --git a/modules/evdev/evdev.c b/modules/evdev/evdev.c index e54ba6b..ba924f4 100644 --- a/modules/evdev/evdev.c +++ b/modules/evdev/evdev.c @@ -14,11 +14,6 @@ #include "print.h" -#define DEBUG_MODULE "evdev" -#define DEBUG_LEVEL 5 -#include <re_dbg.h> - - /* Note: * * KEY_NUMERIC_xyz added in linux kernel 2.6.28 @@ -186,29 +181,21 @@ static void evdev_fd_handler(int flags, void *arg) /* This might happen if you unplug a USB device */ if (flags & FD_EXCEPT) { - DEBUG_WARNING("fd handler: FD_EXCEPT - device unplugged?\n"); + warning("evdev: fd handler: FD_EXCEPT - device unplugged?\n"); evdev_close(st); return; } - if (FD_READ != flags) { - DEBUG_WARNING("fd_handler: unexpected flags 0x%02x\n", flags); - return; - } - n = read(st->fd, evv, sizeof(evv)); if (n < (int) sizeof(struct input_event)) { - DEBUG_WARNING("event: short read (%m)\n", errno); + warning("evdev: event: short read (%m)\n", errno); return; } for (i = 0; i < (int) (n / sizeof(struct input_event)); i++) { const struct input_event *ev = &evv[i]; - DEBUG_INFO("Event: type %u, code %u, value %d\n", - ev->type, ev->code, ev->value); - if (EV_KEY != ev->type) continue; @@ -220,8 +207,8 @@ static void evdev_fd_handler(int flags, void *arg) if (1 == ev->value) { const int ascii = code2ascii(modifier, ev->code); if (-1 == ascii) { - DEBUG_WARNING("unhandled key code %u\n", - ev->code); + warning("evdev: unhandled key code %u\n", + ev->code); } else reportkey(st, ascii); @@ -259,7 +246,7 @@ static int evdev_alloc(struct ui_st **stp, struct ui_prm *prm, /* grab the event device to prevent it from propagating its events to the regular keyboard driver */ if (-1 == ioctl(st->fd, EVIOCGRAB, (void *)1)) { - DEBUG_WARNING("ioctl EVIOCGRAB on %s (%m)\n", dev, errno); + warning("evdev: ioctl EVIOCGRAB on %s (%m)\n", dev, errno); } #endif @@ -296,7 +283,7 @@ static int buzz(const struct ui_st *st, int value) n = write(st->fd, &ev, sizeof(ev)); if (n < 0) { - DEBUG_WARNING("output: write fd=%d (%m)\n", st->fd, errno); + warning("evdev: output: write fd=%d (%m)\n", st->fd, errno); } return errno; diff --git a/modules/evdev/print.c b/modules/evdev/print.c index 3e2b762..4c6cc77 100644 --- a/modules/evdev/print.c +++ b/modules/evdev/print.c @@ -10,16 +10,11 @@ #include <sys/stat.h> #include <fcntl.h> #include <linux/input.h> -#include <re_types.h> -#include <re_fmt.h> +#include <re.h> +#include <baresip.h> #include "print.h" -#define DEBUG_MODULE "evdev" -#define DEBUG_LEVEL 5 -#include <re_dbg.h> - - #define test_bit(bit, array) (array[bit/8] & (1<<(bit%8))) @@ -36,7 +31,7 @@ void print_name(int fd) perror("evdev ioctl"); } - DEBUG_NOTICE("evdev device name: %s\n", name); + info("evdev: device name: %s\n", name); } @@ -52,7 +47,7 @@ void print_events(int fd) memset(evtype_bitmask, 0, sizeof(evtype_bitmask)); if (ioctl(fd, EVIOCGBIT(0, EV_MAX), evtype_bitmask) < 0) { - DEBUG_WARNING("evdev ioctl EVIOCGBIT (%m)\n", errno); + warning("evdev: ioctl EVIOCGBIT (%m)\n", errno); return; } |