[go: up one dir, main page]

File: wscons.c

package info (click to toggle)
seatd 0.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 500 kB
  • sloc: ansic: 4,861; sh: 24; makefile: 6
file content (27 lines) | stat: -rw-r--r-- 624 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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) {
	static const char wskbd[] = "/dev/wskbd";
	static const char wsmouse[] = "/dev/wsmouse";
	static 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