aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/devdraw/nowsys.c
blob: 08e0521fd5a0727496c3bb3c46b5bd38c0959947 (plain)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <u.h>
#include <libc.h>
#include <draw.h>
#include <mouse.h>
#include <cursor.h>
#include <drawfcall.h>

void
usage(void)
{
	fprint(2, "usage: devdraw (don't run  directly)\n");
	exits("usage");
}

void
main(int argc, char **argv)
{
	int n;
	uchar buf[1024*1024];
	Wsysmsg m;

	ARGBEGIN{
	case 'D':
		break;
	default:
		usage();
	}ARGEND

	if(argc != 0)
		usage();

	while((n = readwsysmsg(0, buf, sizeof buf)) > 0){
		convM2W(buf, n, &m);
		m.type = Rerror;
		m.error = "no window system present";
		n = convW2M(&m, buf, sizeof buf);
		write(1, buf, n);
	}
	exits(0);
}