wscons: Move to its own device type

This reduces ifdefs and avoids overloading evdev as something it is not.
This commit is contained in:
Kenny Levinsen 2022-03-29 10:41:16 +02:00
parent 684dd61945
commit 0462e9331d
7 changed files with 51 additions and 27 deletions

27
common/wscons.c Normal file
View file

@ -0,0 +1,27 @@
#include <stdlib.h>
#include <string.h>
#if defined(__NetBSD__)
#include <stdlib.h>
#include <sys/stat.h>
#endif
#include "wscons.h"
#define STRLEN(s) ((sizeof(s) / sizeof(s[0])) - 1)
#if defined(__NetBSD__)
int path_is_wscons(const char *path) {
const char *wskbd = "/dev/wskbd";
const char *wsmouse = "/dev/wsmouse";
const char *wsmux = "/dev/wsmux";
return strncmp(path, wskbd, STRLEN(wskbd)) == 0 ||
strncmp(path, wsmouse, STRLEN(wsmouse)) == 0 ||
strncmp(path, wsmux, STRLEN(wsmouse)) == 0;
}
#else
int path_is_wscons(const char *path) {
(void)path;
return 0;
}
#endif