plan9port/src/cmd/devdraw/nowsys.c
Dan Cross fa325e9b42 Trivial changes: whitespace and modes.
Remote whitespace at the ends of lines.
Remove blank lines from the ends of files.
Change modes on source files so that they
are not executable.

Signed-off-by: Dan Cross <cross@gajendra.net>
2020-01-10 14:54:30 +00:00

41 lines
580 B
C

#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);
}